diff options
author | Robin Müller <coder-hugo@users.noreply.github.com> | 2018-02-16 09:27:16 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-06 11:25:07 +0100 |
commit | 619ee5683528fd31ac04215e39c15afcb852bd08 (patch) | |
tree | 170850d6fd176011b0f2a93af3c8e815ef21354e | |
parent | ff7237a09894f9d3c4fd4871592776dfe6049646 (diff) | |
download | nextcloud-server-619ee5683528fd31ac04215e39c15afcb852bd08.tar.gz nextcloud-server-619ee5683528fd31ac04215e39c15afcb852bd08.zip |
Don't use double quotes in MySQL queries
MySQL databases with the ANSI_QUOTES mode enabled treat " as an identifier
quote (see https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_ansi_quotes).
So for such databases the 'occ upgrade' fails with an error message like this:
... unknown column 'oc_*' in where clause.
This fix replaces the doulbe quotes with single quotes that should be always
used in MySQL queries to quote literal strings.
Signed-off-by: Robin Müller <robin.mueller@1und1.de>
-rw-r--r-- | lib/private/Repair/Collation.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/Repair/Collation.php b/lib/private/Repair/Collation.php index 2642985371b..f2cc9373176 100644 --- a/lib/private/Repair/Collation.php +++ b/lib/private/Repair/Collation.php @@ -6,6 +6,7 @@ * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <robin@icewind.nl> * @author Thomas Müller <thomas.mueller@tmit.eu> + * @author Robin Müller <robin.mueller@1und1.de> * * @license AGPL-3.0 * @@ -124,7 +125,7 @@ class Collation implements IRepairStep { " FROM INFORMATION_SCHEMA . COLUMNS" . " WHERE TABLE_SCHEMA = ?" . " AND (COLLATION_NAME <> '" . $characterSet . "_bin' OR CHARACTER_SET_NAME <> '" . $characterSet . "')" . - " AND TABLE_NAME LIKE \"*PREFIX*%\"", + " AND TABLE_NAME LIKE '*PREFIX*%'", array($dbName) ); $rows = $statement->fetchAll(); @@ -139,7 +140,7 @@ class Collation implements IRepairStep { " FROM INFORMATION_SCHEMA . TABLES" . " WHERE TABLE_SCHEMA = ?" . " AND TABLE_COLLATION <> '" . $characterSet . "_bin'" . - " AND TABLE_NAME LIKE \"*PREFIX*%\"", + " AND TABLE_NAME LIKE '*PREFIX*%'", [$dbName] ); $rows = $statement->fetchAll(); |