Problems with comments in SQL code

Robert Koch gms_xy at gmx.de
Fri Oct 17 11:32:29 CEST 2014


SELECT
    *
FROM
    sys.storage
WHERE 1=1
    AND "schema" = 'sapsr3'
    AND "table" = 'dfkkop'
;

works in mclient and DBVisualizer (via JDBC)


SELECT
    *
FROM
    sys.storage
WHERE 1=1
    AND "schema" = 'sapsr3'
    --AND "table" = 'dfkkop'
;

works in mclient, but does not work in DBVisualizer. error message:

11:23:37  [SELECT - 0 row(s), 0.000 secs]  1) [Error Code: 0, SQL State: 42000]  syntax error, unexpected $end, expecting SCOLON in: "select. 2) [Error Code: 0, SQL State: 22000]      *. 3) [Error Code: 0, SQL State: 22000]  from. 4) [Error Code: 0, SQL State: 22000]      sys.storage. 5) [Error Code: 0, SQL State: 22000]  where 1=1. 6) [Error Code: 0, SQL State: 22000]      and "schema" = 'sapsr3'. 7) [Error Code: 0, SQL State: 22000]      --AND "table" = 'dfkkop';"
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec  [0 successful, 0 warnings, 1 errors]


I also noticed this problem (handling comments) in other statements, especially when comments appear before the semicolon. I am not sure, if this is a problem in JDBC driver or DBVisualizer. To see, what is received by monetdb server, I would like to see log files of SQL queries. I found a directory named "/sql_logs/sql", but it consits of 2 files nearly empty. Where can I enable logging?



More information about the developers-list mailing list