Merge pull request #17498 from marc-dll/FIX_11.0_pgsql_where_boolean

FIX: pgsql: prevent 'WHERE 1'
This commit is contained in:
Laurent Destailleur 2021-05-06 15:58:41 +02:00 committed by GitHub
commit a4d93424dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -542,7 +542,7 @@ $cfg['ThemePerServer'] = FALSE; // allow diferent theme for each co
* %f will be replaced by a list of field names.
* (%t and %f only applies to DefaultQueryTable)
*/
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1 = 1';
$cfg['DefaultQueryDatabase'] = '';
/**

View File

@ -8123,7 +8123,7 @@ function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield
if (!isset($dictvalues[$tablename]))
{
$dictvalues[$tablename] = array();
$sql = 'SELECT * FROM '.$tablename.' WHERE 1'; // Here select * is allowed as it is generic code and we don't have list of fields
$sql = 'SELECT * FROM '.$tablename.' WHERE 1 = 1'; // Here select * is allowed as it is generic code and we don't have list of fields
if ($checkentity) $sql .= ' AND entity IN (0,'.getEntity($tablename).')';
$resql = $db->query($sql);

View File

@ -3320,7 +3320,7 @@ class User extends CommonObject
}
else
{
$sql .= " WHERE 1";
$sql .= " WHERE 1 = 1";
}
// Manage filter