missing table name with invalid column in join using (and problems after resolving it) #3534
Last updated: 2014-10-31 14:14:38 +0100
Date: 2014-08-10 21:31:59 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.58 Safari/537.36
I noticed when making a typo;
CREATE TABLE "sys"."test_a" (
CREATE TABLE "sys"."test_b" (
SELECT * FROM test_a JOIN test_b USING (c);
Thus I started fixing that based on the rel_dump.c code (patch attached).
sql>SELECT * FROM test_a JOIN test_b USING (c);
But something strange started hapening:
Since the only change I made, outputing a string that would in the "original" case be casted to a NULL (r = NULL) I am quite confused.
Removing the "AS" in the JOIN gives me:
sql>SELECT idxs.name, keys.name, kc.nr, c.name FROM sys.idxs LEFT JOIN sys.keys ON idxs.name = keys.name, sys.objects AS kc, sys._columns AS c, sys.schemas s, sys._tables AS t WHERE idxs.table_id = t.id AND idxs.id = kc.id AND t.id = c.table_id AND kc.name = c.name AND (keys.type IS NULL OR keys.type = 1) AND t.schema_id = s.id AND s.name = 'sys' AND t.name = 'test_a' ORDER BY idxs.name, kc.nr;
places where rel_get_name is used:
exps = rel_projections(sql, t1, rel_get_name(t1), 1, 1)
In the "patched" case the rel_projections query looks:
Breakpoint 6, rel_projections (sql=0x7fd1901bd450, rel=0x7fd190129050, tname=0x7fd19000d3e0 "idxs", settname=1, intern=1) at rel_select.c:342
The original case looks like:
Breakpoint 1, rel_projections (sql=0x7fa230005450, rel=0x7fa2300c4250, tname=0x0, settname=1, intern=1) at rel_select.c:342
Is the patch correct, which uncovers a bug? Or is the patch incorrect and NULL is correct?
MonetDB 5 server v11.17.22 (64-bit, 64-bit oids)
Date: 2014-08-10 21:34:32 +0200
Created attachment 294
Errors can be triggered using:
Date: 2014-08-11 15:41:14 +0200
fixed by using rel_name for the error message, the semantics for rel_get_name are needed for the projections
Date: 2014-08-11 15:42:35 +0200
For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=fecd6435c289
Date: 2014-08-11 15:46:47 +0200
(In reply to comment 2)
what does rel->r mean in the context of op_basetable?
Date: 2014-08-11 17:21:39 +0200
Suggests nothing :) Question answered.
Date: 2014-10-31 14:14:38 +0100
Oct2014 has been released.
The text was updated successfully, but these errors were encountered: