diff --git a/src/PHPSQLParser/processors/InsertProcessor.php b/src/PHPSQLParser/processors/InsertProcessor.php index a6d04f9e..e1b3b7d9 100644 --- a/src/PHPSQLParser/processors/InsertProcessor.php +++ b/src/PHPSQLParser/processors/InsertProcessor.php @@ -85,6 +85,7 @@ protected function processKeyword($keyword, $tokenList) { continue; case 'INSERT': + case 'REPLACE': continue; default: @@ -148,8 +149,8 @@ public function process($tokenList, $token_category = 'INSERT') { $parsed = array_merge($parsed, $key); unset($tokenList['INTO']); - if ($table === '' && $token_category === 'INSERT') { - list($table, $cols, $key) = $this->processKeyword('INSERT', $tokenList); + if ($table === '' && in_array($token_category, array('INSERT', 'REPLACE'))) { + list($table, $cols, $key) = $this->processKeyword($token_category, $tokenList); } $parsed[] = array('expr_type' => ExpressionType::TABLE, 'table' => $table,