RussellEngland / php-sql-parser

Automatically exported from code.google.com/p/php-sql-parser
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Error parsing ON DUPLICATE KEY UPDATE #90

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. $sql = 'INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE 
id=LAST_INSERT_ID(id), c=3;';
2. $parser = new \bbn\db\PHPSQLParser($sql);
3. print_r($parser->parsed);

What is the expected output? What do you see instead?

Missing argument 2 for bbn\db\PHPSQLParser::process_set_list(), called in 
D:\_www\_projects\iAPST\_appui\vendor\bbn\bbn\src\bbn\db\PHPSQLParser.php on 
line 543 and defined in 
D:\_www\_projects\iAPST\_appui\vendor\bbn\bbn\src\bbn\db\PHPSQLParser.php on 
line 593

What version of the product are you using? On what operating system?

The latest available here

Original issue reported on code.google.com by nab...@gmail.com on 10 Mar 2013 at 1:53

GoogleCodeExporter commented 8 years ago
At the line 543 of php-sql-parser.php

$out['ON DUPLICATE KEY UPDATE'] = $this->process_set_list($out['DUPLICATE']);

should be changed into 

$out['ON DUPLICATE KEY UPDATE'] = $this->process_set_list($out['DUPLICATE'], 
isset($out['UPDATE']));

Original comment by nab...@gmail.com on 10 Mar 2013 at 2:10

GoogleCodeExporter commented 8 years ago
The issue should be fixed in r396

Original comment by pho...@gmx.de on 1 Nov 2013 at 11:03

GoogleCodeExporter commented 8 years ago

Original comment by pho...@gmx.de on 2 Nov 2013 at 12:49