On Nov 25, 2007 10:35 PM, Niels Nes
On Sun, Nov 25, 2007 at 10:32:56PM +0100, Markus Gritsch wrote:
On Nov 25, 2007 10:29 PM, Niels Nes
wrote: On Sun, Nov 25, 2007 at 10:20:25PM +0100, Markus Gritsch wrote:
Hi,
I have another question with an SQL query that works in SQLite and MySQL but does not in MonetDB.
SELECT * FROM test WHERE ((1) AND (id=100)) syntax error, unexpected AND in: "prepare select * from test where ((1) and"
The query is forged by an ORM. I programmatically put together the WHERE clause. All the contitions are put together using AND, and in the case of no conditions, the WHERE clause simply reads (1), which yields all entries in the table. However, MonetDB cannot parse this. I guess its a default casting problem. As I expect the following to work: select * from test where ((true) and (id=100))
No, this yields:
But thats a completely different problem. Could you send the complete bug ie includeing schema for test and full query which gives this problem.
sql>CREATE TABLE test (id INT); sql>INSERT INTO test VALUES (1); Rows affected 1 sql>SELECT * FROM test WHERE ((true) AND (id=1)); !TypeException:user.s1_4[14]:'calc.max' undefined in: _22:any := calc.max(_20:bit, _21:int) !TypeException:user.s1_4[15]:'calc.min' undefined in: _23:any := calc.min(_20:bit, _21:int) !TypeException:user.s1_4[16]:'algebra.uselect' undefined in: _24:any := algebra.uselect(_19:bat[:oid,:bit], _22:any, _23:any, _18:bit, _18:bit) !TypeException:user.s1_4[18]:'algebra.markT' undefined in: _27:any := algebra.markT(_24:any, _25:oid) !TypeException:user.s1_4[19]:'bat.reverse' undefined in: _28:any := bat.reverse(_27:any) !TypeException:user.s1_4[20]:'algebra.join' undefined in: _29:any := algebra.join(_28:any, _13:bat[:oid,:int]) +-------+ | id | +=======+ | 18645 | +-------+ sql>DROP TABLE test; sql>