From 004f42ab6c8169ed518aec8dad3662312a74babe Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 30 Nov 2021 16:46:20 +0900 Subject: [PATCH] fix: SQL in MySQLi\Connection::_foreignKeyData() Fixes #4996 --- system/Database/MySQLi/Connection.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/Database/MySQLi/Connection.php b/system/Database/MySQLi/Connection.php index 9736bf0b03c6..5badaf1c4881 100644 --- a/system/Database/MySQLi/Connection.php +++ b/system/Database/MySQLi/Connection.php @@ -485,8 +485,10 @@ protected function _foreignKeyData(string $table): array FROM information_schema.TABLE_CONSTRAINTS AS tc INNER JOIN information_schema.REFERENTIAL_CONSTRAINTS AS rc ON tc.CONSTRAINT_NAME = rc.CONSTRAINT_NAME + AND tc.CONSTRAINT_SCHEMA = rc.CONSTRAINT_SCHEMA INNER JOIN information_schema.KEY_COLUMN_USAGE AS kcu ON tc.CONSTRAINT_NAME = kcu.CONSTRAINT_NAME + AND tc.CONSTRAINT_SCHEMA = kcu.CONSTRAINT_SCHEMA WHERE tc.CONSTRAINT_TYPE = ' . $this->escape('FOREIGN KEY') . ' AND tc.TABLE_SCHEMA = ' . $this->escape($this->database) . ' AND