diff options
Diffstat (limited to 'src/Statements/ReplaceStatement.php')
-rw-r--r-- | src/Statements/ReplaceStatement.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/Statements/ReplaceStatement.php b/src/Statements/ReplaceStatement.php index 3fa675a..59d66ae 100644 --- a/src/Statements/ReplaceStatement.php +++ b/src/Statements/ReplaceStatement.php @@ -6,14 +6,14 @@ namespace PhpMyAdmin\SqlParser\Statements; -use PhpMyAdmin\SqlParser\Parser; -use PhpMyAdmin\SqlParser\Token; -use PhpMyAdmin\SqlParser\TokensList; -use PhpMyAdmin\SqlParser\Statement; use PhpMyAdmin\SqlParser\Components\Array2d; use PhpMyAdmin\SqlParser\Components\IntoKeyword; use PhpMyAdmin\SqlParser\Components\OptionsArray; use PhpMyAdmin\SqlParser\Components\SetOperation; +use PhpMyAdmin\SqlParser\Parser; +use PhpMyAdmin\SqlParser\Statement; +use PhpMyAdmin\SqlParser\Token; +use PhpMyAdmin\SqlParser\TokensList; /** * `REPLACE` statement. @@ -87,8 +87,7 @@ class ReplaceStatement extends Statement */ public function build() { - $ret = 'REPLACE ' . $this->options - . ' INTO ' . $this->into; + $ret = 'REPLACE ' . $this->options . ' INTO ' . $this->into; if ($this->values != null && count($this->values) > 0) { $ret .= ' VALUES ' . Array2d::build($this->values); @@ -115,6 +114,7 @@ class ReplaceStatement extends Statement $list, static::$OPTIONS ); + ++$list->idx; /** @@ -154,14 +154,13 @@ class ReplaceStatement extends Statement ) { $parser->error('Unexpected keyword.', $token); break; - } else { - ++$list->idx; - $this->into = IntoKeyword::parse( - $parser, - $list, - array('fromReplace' => true) - ); } + ++$list->idx; + $this->into = IntoKeyword::parse( + $parser, + $list, + array('fromReplace' => true) + ); $state = 1; } elseif ($state === 1) { |