BUG Faulty query escape in tableList()
This caused tables starting with "sql" to be excluded from the tableList() results, where only "sql_" should be filtered. An unescaped underscore in ANSI SQL pattern matching stands for "any single character", the escape needed to be doubled to account for PHP's own escape expanding. This broke SQLQueryTest since the test data wasn't reset between test runs.
This commit is contained in:
parent
fc7a21b567
commit
cd7b761bed
|
@ -1264,7 +1264,7 @@ class PostgreSQLDatabase extends SS_Database {
|
|||
public function tableList() {
|
||||
$schema_SQL = pg_escape_string($this->dbConn, $this->schema);
|
||||
$tables=array();
|
||||
foreach($this->query("SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname = '{$schema_SQL}' AND tablename NOT ILIKE 'pg\_%' AND tablename NOT ILIKE 'sql\_%'") as $record) {
|
||||
foreach($this->query("SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname = '{$schema_SQL}' AND tablename NOT ILIKE 'pg\\\_%' AND tablename NOT ILIKE 'sql\\\_%'") as $record) {
|
||||
//$table = strtolower(reset($record));
|
||||
$table = reset($record);
|
||||
$tables[$table] = $table;
|
||||
|
|
Loading…
Reference in New Issue