mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-27 02:14:45 +01:00
quote order column in backup and always quote "index" as it seems to be one of very little names not automatic recogniced in MySQL
This commit is contained in:
parent
31b4209346
commit
3e47f37983
@ -945,7 +945,7 @@ class db_backup
|
|||||||
empty($pk) || !$max ? false : $pk.' > '.$this->db->quote($max, $schema['fd'][$pk]['type']),
|
empty($pk) || !$max ? false : $pk.' > '.$this->db->quote($max, $schema['fd'][$pk]['type']),
|
||||||
__LINE__, __FILE__,
|
__LINE__, __FILE__,
|
||||||
empty($pk) ? false : 0, // if no primary key, query all rows
|
empty($pk) ? false : 0, // if no primary key, query all rows
|
||||||
empty($pk) ? '' : 'ORDER BY '.$pk.' ASC', // order by primary key
|
empty($pk) ? '' : 'ORDER BY '.$this->db->name_quote($pk).' ASC', // order by primary key
|
||||||
false, self::ROW_CHUNK) as $row)
|
false, self::ROW_CHUNK) as $row)
|
||||||
{
|
{
|
||||||
if (!empty($pk)) $max = $row[$pk];
|
if (!empty($pk)) $max = $row[$pk];
|
||||||
|
@ -1386,7 +1386,7 @@ class egw_db
|
|||||||
{
|
{
|
||||||
// if name contains special characters, quote it
|
// if name contains special characters, quote it
|
||||||
// always quote for postgreSQL, as this is the only way to support mixed case names
|
// always quote for postgreSQL, as this is the only way to support mixed case names
|
||||||
if (preg_match('/\W/', $name) || $type == 'pgsql' && preg_match('/[A-Z]+/', $name))
|
if (preg_match('/\W/', $name) || $type == 'pgsql' && preg_match('/[A-Z]+/', $name) || $name == 'index')
|
||||||
{
|
{
|
||||||
return $quote . $name . $quote;
|
return $quote . $name . $quote;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user