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

Limit is unable to process if "offset" written in Upper case #139

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add query with limit and offset as "limit 2 offset 0"
2. Parser returns output as 
  "LIMIT": {
    "offset": "",
    "rowcount": "2 offset 0"
  }

What is the expected output? What do you see instead?
  "LIMIT": {
    "offset": "0",
    "rowcount": "2"
  }

What version of the product are you using? On what operating system?
php-sql-parser-20140108.zip on Centos

Please provide any additional information below.

If we change line number 57 in "LimitProcessor.php" file to
<code>
if (strtoupper($trim) === "OFFSET") {
</code>

It will fix the limit and return will come correctly as
  "LIMIT": {
    "offset": "0",
    "rowcount": "2"
  }

Original issue reported on code.google.com by rrmal...@gmail.com on 9 May 2014 at 12:29

GoogleCodeExporter commented 8 years ago
You use an old version, this issue has been fixed already. 

Try to download a newer version from 
https://github.com/greenlion/PHP-SQL-Parser/wiki/Downloads

Original comment by pho...@gmx.de on 9 May 2014 at 6:52

GoogleCodeExporter commented 8 years ago
Sorry, error occurs also in newer versions, I'll fix it this evening.

Original comment by pho...@gmx.de on 9 May 2014 at 6:55

GoogleCodeExporter commented 8 years ago
Issue has been fixed, see r1355

Original comment by pho...@gmx.de on 12 May 2014 at 12:41