diff --git a/CHANGELOG.md b/CHANGELOG.md index 77d11246..9b3a3ece 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Display uneditable fields in edit form - Shorten all but numeric and date types in select - Fix escaping spaces in cookie value (bug #1208) +- MariaDB: don't display checks with the same name from another table (bug #1135) - PostgreSQL: Offer foreign keys in create table - PostgreSQL: Add missing parentheses to CHECK export - PostgreSQL: Allow creating NOT DEFERRABLE foreign keys diff --git a/adminer/include/driver.inc.php b/adminer/include/driver.inc.php index 5aa22fd9..b0f1ceb9 100644 --- a/adminer/include/driver.inc.php +++ b/adminer/include/driver.inc.php @@ -269,7 +269,7 @@ abstract class SqlDriver { // MariaDB contains CHECK_CONSTRAINTS.TABLE_NAME, MySQL and PostrgreSQL not return get_key_vals("SELECT c.CONSTRAINT_NAME, CHECK_CLAUSE FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS c -JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS t ON c.CONSTRAINT_SCHEMA = t.CONSTRAINT_SCHEMA AND c.CONSTRAINT_NAME = t.CONSTRAINT_NAME +JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS t ON c.CONSTRAINT_SCHEMA = t.CONSTRAINT_SCHEMA AND c.CONSTRAINT_NAME = t.CONSTRAINT_NAME" . ($this->conn->flavor == 'maria' ? " AND c.TABLE_NAME = t.TABLE_NAME" : "") . " WHERE c.CONSTRAINT_SCHEMA = " . q($_GET["ns"] != "" ? $_GET["ns"] : DB) . " AND t.TABLE_NAME = " . q($table) . " AND CHECK_CLAUSE NOT LIKE '% IS NOT NULL'", $this->conn); // ignore default IS NOT NULL checks in PostrgreSQL