Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#909 Incorrect query parsing

3.1
open
Rob Manning
9
2010-10-20
2010-10-20
Anonymous
No

Squirrel incorrectly parses valid sql request which leads to an error

To reproduce:
select TRIM(BOTH '|' FROM '|test|')

Result:
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1
SQLState: 42000
ErrorCode: 1064
Error occured in:
select TRIM(BOTH '

Discussion


  • Anonymous
    2010-10-20

    • assigned_to: nobody --> manningr
    • priority: 5 --> 9
     
  • Claus
    Claus
    2010-11-08

    If you don't have a "FROM TABLE" in your select it won't work in ANSI-Syntax (SQL99).
    If I can trust this link:
    http://www.oreilly.de/catalog/sqlnutger/chapter/ch04.html
    besides your missing table your syntax seems to be OK

    I tried the same in DB2 and it worked (Test in 3.1.2).
    select TRIM(BOTH '|' FROM '|test|') from sysibm.sysdummy1;

    Here same in Oracle:
    select TRIM(BOTH '|' FROM '|test|') from dual;

     

  • Anonymous
    2010-11-08

    cwittmann:
    Query below does work in MySQL:
    select TRIM(BOTH '1' FROM 'test1')

    This means that the problem is not in standards that you mentioned but in the way Squirrel parses the query.

     
  • Joachim Karrer
    Joachim Karrer
    2011-07-07

    Duplicate of #1845435

    Simply open your "MySQL Plugin"-Preferences and replace the "Procedure/Function separator" by something else (e.g. "|||")