non-PostgreSQL: display NOT NULL checks (fix #1237)

This commit is contained in:
Jakub Vrana
2026-02-08 08:44:06 +01:00
parent 83301e37da
commit bdc28bc959
2 changed files with 3 additions and 2 deletions

View File

@@ -16,6 +16,7 @@
- PostgreSQL: Fix definition of complex generated columns
- PostgreSQL: Mark unique partial indexes as unique (bug #1172)
- PostgreSQL: fix namespace in inheritance links (bug #1221)
- non-PostgreSQL: display NOT NULL checks (bug #1237)
- ClickHouse: Fix offset (bug #1188)
- ClickHouse: Fix list of tables (bug #1176)
- Plugins: Methods showVariables() and showStatus() (bug #1157)

View File

@@ -271,8 +271,8 @@ abstract class SqlDriver {
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" . ($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
AND t.TABLE_NAME = " . q($table) . (JUSH == "pgsql" ? "
AND CHECK_CLAUSE NOT LIKE '% IS NOT NULL'" : ""), $this->conn); // ignore default IS NOT NULL checks in PostrgreSQL
}
/** Get all fields in the current schema