[DATABASE] Check SQL boolean values with "IS TRUE"
This way UNKNOWN (NULL) explicitly turns to FALSE when three-valued logic is
reduced to binary.
In pgsqlschema, however, use "IS FALSE" as boolean attributes in pg_index are
non-nullable, there is no outer join and there's no clear preference for NULL
reduction.
Over-complicated constructions in TagCloud queries have been simplified, which
should not affect their performance.
Additionally, in TagCloud's lib/subscriptionspeopleselftagcloudsection.php
a typing mistake in an equi-join of "profile_tag" and "profile_list" on
"tagger" was fixed.
That regression was introduced in f446db8e2a
This commit is contained in:
@@ -201,12 +201,16 @@ class PgsqlSchema extends Schema
|
||||
*/
|
||||
public function fetchIndexInfo(string $table): array
|
||||
{
|
||||
$query = 'SELECT indexname AS key_name, indexdef AS key_def, pg_index.* ' .
|
||||
'FROM pg_index INNER JOIN pg_indexes ON pg_index.indexrelid = CAST(pg_indexes.indexname AS regclass) ' .
|
||||
'WHERE tablename = \'%s\' AND indisprimary = FALSE AND indisunique = FALSE ' .
|
||||
'ORDER BY indrelid, indexrelid';
|
||||
$sql = sprintf($query, $table);
|
||||
return $this->fetchQueryData($sql);
|
||||
return $this->fetchQueryData(
|
||||
<<<END
|
||||
SELECT indexname AS key_name, indexdef AS key_def, pg_index.*
|
||||
FROM pg_index INNER JOIN pg_indexes
|
||||
ON pg_index.indexrelid = CAST(pg_indexes.indexname AS regclass)
|
||||
WHERE pg_indexes.tablename = '{$table}'
|
||||
AND indisprimary IS FALSE AND indisunique IS FALSE
|
||||
ORDER BY indrelid, indexrelid;
|
||||
END
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user