FIX: pgsql: prevent 'WHERE 1'

This commit is contained in:
Marc de Lima Lucio 2021-05-05 11:49:11 +02:00
parent e6b4f1eab6
commit 139ae3db00
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. * %f will be replaced by a list of field names.
* (%t and %f only applies to DefaultQueryTable) * (%t and %f only applies to DefaultQueryTable)
*/ */
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1'; $cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1 = 1';
$cfg['DefaultQueryDatabase'] = ''; $cfg['DefaultQueryDatabase'] = '';
/** /**

View File

@ -8123,7 +8123,7 @@ function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield
if (!isset($dictvalues[$tablename])) if (!isset($dictvalues[$tablename]))
{ {
$dictvalues[$tablename] = array(); $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).')'; if ($checkentity) $sql .= ' AND entity IN (0,'.getEntity($tablename).')';
$resql = $db->query($sql); $resql = $db->query($sql);

View File

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