On Sun, Nov 25, 2007 at 11:16:57PM +0100, Markus Gritsch wrote:
On Nov 25, 2007 10:44 PM, Markus Gritsch
wrote: On Nov 25, 2007 10:35 PM, Niels Nes
wrote: 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>
And the server console prints
= TODO: select_count(const) This warning is meant for me only and is harmless. I thought you were using a released version, if this is through we somehow build wrong for the releases (ie with asserts on).
Niels
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl