diff --git a/ChangeLog b/ChangeLog index 7da42902d3..66bed1d319 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,6 +49,8 @@ phpMyAdmin - ChangeLog - issue Fix SQL syntax highlighting in database search page - issue #12056 Fix error when we can not generate random string - issue #12055 Fixed PHP syntax error in templates +- issue #12054 Fixed processing of queries with escaped quotes +- issue #12041 Fixed exporting tables with fields DEFAULT and COMMENT - issue #12073 Hide edit and delete buttons when the results are not related to a table 4.5.5.1 (2016-02-29) diff --git a/libraries/sql-parser/src/Components/Condition.php b/libraries/sql-parser/src/Components/Condition.php index e84ad864ac..65374ccbd2 100644 --- a/libraries/sql-parser/src/Components/Condition.php +++ b/libraries/sql-parser/src/Components/Condition.php @@ -38,6 +38,7 @@ class Condition extends Component * @var array */ public static $ALLOWED_KEYWORDS = array( + 'ALL' => 1, 'AND' => 1, 'BETWEEN' => 1, 'EXISTS' => 1, diff --git a/libraries/sql-parser/src/Components/Expression.php b/libraries/sql-parser/src/Components/Expression.php index 0b9f21513a..8d6471c4af 100644 --- a/libraries/sql-parser/src/Components/Expression.php +++ b/libraries/sql-parser/src/Components/Expression.php @@ -254,6 +254,9 @@ class Expression extends Component continue; } $isExpr = true; + } elseif ($brackets === 0 && count($ret->expr) > 0) { + /* End of expression */ + break; } } diff --git a/libraries/sql-parser/src/Statements/DropStatement.php b/libraries/sql-parser/src/Statements/DropStatement.php index 5110c9db16..063146e1f5 100644 --- a/libraries/sql-parser/src/Statements/DropStatement.php +++ b/libraries/sql-parser/src/Statements/DropStatement.php @@ -39,6 +39,7 @@ class DropStatement extends Statement 'SCHEMA' => 1, 'SERVER' => 1, 'TABLE' => 1, + 'VIEW' => 1, 'TABLESPACE' => 1, 'TRIGGER' => 1, diff --git a/libraries/sql-parser/src/Utils/BufferedQuery.php b/libraries/sql-parser/src/Utils/BufferedQuery.php index 1aaa9d7910..500862a19b 100644 --- a/libraries/sql-parser/src/Utils/BufferedQuery.php +++ b/libraries/sql-parser/src/Utils/BufferedQuery.php @@ -209,14 +209,14 @@ class BufferedQuery */ if ($this->status === static::STATUS_STRING_SINGLE_QUOTES) { // Single-quoted strings like 'foo'. - if ($this->query[$i] === '\'') { + if ($this->query[$i] === '\'' && $this->query[$i - 1] !== '\\') { $this->status = 0; } $this->current .= $this->query[$i]; continue; } elseif ($this->status === static::STATUS_STRING_DOUBLE_QUOTES) { // Double-quoted strings like "bar". - if ($this->query[$i] === '"') { + if ($this->query[$i] === '"' && $this->query[$i - 1] !== '\\') { $this->status = 0; } $this->current .= $this->query[$i];