summaryrefslogtreecommitdiffstats
path: root/src/Statement.php
diff options
context:
space:
mode:
authorDeven Bansod <devenbansod@users.noreply.github.com>2018-12-21 16:41:34 +0530
committerGitHub <noreply@github.com>2018-12-21 16:41:34 +0530
commita1e919682ced8de219bad032940d959f924f8fb7 (patch)
tree70aabf082d36c809b0367fe030f75373eb6e2263 /src/Statement.php
parent1b644028d693f7140868ba32e4847e5cd866fa4f (diff)
parente135782aca6e54e9535e43aaa34259392d92dc89 (diff)
downloadsql-parser-a1e919682ced8de219bad032940d959f924f8fb7.zip
sql-parser-a1e919682ced8de219bad032940d959f924f8fb7.tar.gz
sql-parser-a1e919682ced8de219bad032940d959f924f8fb7.tar.bz2
Merge pull request #211 from devenbansod/fix/190
Add support for end options in SET statement
Diffstat (limited to 'src/Statement.php')
-rw-r--r--src/Statement.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Statement.php b/src/Statement.php
index 4186275..ec715c2 100644
--- a/src/Statement.php
+++ b/src/Statement.php
@@ -354,12 +354,23 @@ abstract class Statement
$parsedOptions = true;
}
} elseif ($class === null) {
- // Handle special end options in Select statement
- // See Statements\SelectStatement::$END_OPTIONS
if ($this instanceof Statements\SelectStatement
&& ($token->value === 'FOR UPDATE'
|| $token->value === 'LOCK IN SHARE MODE')
) {
+ // Handle special end options in Select statement
+ // See Statements\SelectStatement::$END_OPTIONS
+ $this->end_options = OptionsArray::parse(
+ $parser,
+ $list,
+ static::$END_OPTIONS
+ );
+ } elseif ($this instanceof Statements\SetStatement
+ && ($token->value === 'COLLATE'
+ || $token->value === 'DEFAULT')
+ ) {
+ // Handle special end options in SET statement
+ // See Statements\SetStatement::$END_OPTIONS
$this->end_options = OptionsArray::parse(
$parser,
$list,