Bugs item #2134428, was opened at 2008-09-28 19:59
Message generated for change (Comment added) made by skinkie
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2134428&group_id=56967
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/Core
Group: MonetDB5 CVS Head
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Stefan de Konink (skinkie)
Assigned to: Niels Nes (nielsnes)
Summary: some issue with 'as' clause
Initial Comment:
1) It is not the latest monetdb CVS version
2) If you cannot reproduce it I'll upgrade later
select w1.wayid from way_tags as w1, way_tags as w2 where w1.wayid=w2.wayid and
w1.k='bridge' and w2.k<>'layers';
or
select * from way_tags as w1, way_tags as w2 where w1.k = 'bridge' and w1.wayid
= w2.wayid;
Result in:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x43a56950 (LWP 6885)]
0x00007fc6f55fc969 in CMD_EQ_oid (ret=0x2b73688, l=0x2b73668, r=0x2b73678)
at ../../../../src/modules/kernel/batcalc.mx:1112
1112 *o = (*p @2 *t);
(gdb) bt
#0 0x00007fc6f55fc969 in CMD_EQ_oid (ret=0x2b73688, l=0x2b73668, r=0x2b73678)
at ../../../../src/modules/kernel/batcalc.mx:1112
#1 0x00007fc7018ebfd5 in DFLOWstep (t=0x2baaa78, fs=0x41618298)
at ../../../src/mal/mal_interpreter.mx:1523
#2 0x00007fc7018f0610 in runDFLOWworker (t=0x2baaa78)
at ../../../src/mal/mal_interpreter.mx:810
#3 0x00007fc6ffdc9067 in start_thread () from /lib/libpthread.so.0
#4 0x00007fc6fef03edd in clone () from /lib/libc.so.6
#5 0x0000000000000000 in ?? ()
----------------------------------------------------------------------
Comment By: Stefan de Konink (skinkie)
Date: 2008-10-20 23:43
Message:
sql>select * from way_tags as w1, way_tags as w2 where w1.k = 'bridge' and
more>w1.wayid = w2.wayid;
0 tuples
!MALException:algebra.join:GDKerror
!ERROR: GDKload: cannot mmap(): name=27/2705, ext=tail
!OS: Cannot allocate memory
!ERROR: GDKload failed: name=27/2705, ext=tail
0 tuples
This looks like a much better error handling :) :)
But still; why isn't it possible to select two tables at the same time;
First select from table one a feature; And try to match the foreign key of
this table, on the identical table, to match other features of (in my case)
a way.
----------------------------------------------------------------------
Comment By: Stefan de Konink (skinkie)
Date: 2008-10-09 04:45
Message:
I'll give detailed instructions now...
http://repo.or.cz/w/handlerosm.git?a=blob_plain;f=osmparser.c;hb=HEAD
Download this program. Compile it, it is easy C.
http://hypercube.telascience.org/planet/planet-nl-latest.osm.gz
Now sadly there is a problem in this file. Find way id=7062297, and remove
all duplicate tags, or remove the way entirely.
using: osmparser /path/to/your/planet-nl-latest > insert.sql
will result in some *.csv files and an insert.sql
mclient -lsql <insert.sql should automatically work (if you fixed the
above artifact).
Execute the following statement:
select * from way_tags as w1, way_tags as w2 where w1.k = 'bridge' and
w1.wayid = w2.wayid;
Your gdb session in mserver5 should look like this:
0x00007fd3f83402b6 in CMD_EQ_oid (ret=0x259f3c8, l=0x259f3a8, r=0x259f3b8)
at ../../../../src/modules/kernel/batcalc.mx:1128
1128 *o = (*p @2 *t);
(gdb) bt
#0 0x00007fd3f83402b6 in CMD_EQ_oid (ret=0x259f3c8, l=0x259f3a8,
r=0x259f3b8) at ../../../../src/modules/kernel/batcalc.mx:1128
#1 0x00007fd404653455 in DFLOWstep (t=0x253aa08, fs=0x4292cdf0) at
../../../src/mal/mal_interpreter.mx:1523
#2 0x00007fd404657a81 in runDFLOWworker (t=0x253aa08) at
../../../src/mal/mal_interpreter.mx:810
#3 0x00007fd403e95373 in wrapper_routine (data=0x4292d270) at
../../../src/gdk/gdk_posix.mx:935
#4 0x00007fd402b3a027 in start_thread () from /lib/libpthread.so.0
#5 0x00007fd401c6afad in clone () from /lib/libc.so.6
#6 0x0000000000000000 in ?? ()
(I have a system ready you already are able to login to, with the latest
CVS version)
----------------------------------------------------------------------
Comment By: Niels Nes (nielsnes)
Date: 2008-10-07 20:01
Message:
I need data to run the query. Probably a small number or records will do.
----------------------------------------------------------------------
Comment By: Stefan de Konink (skinkie)
Date: 2008-10-07 17:12
Message:
printf("CREATE TABLE nodes_legacy (id serial, x double, y double,
username varchar(255), timestamp timestamptz);\n");
printf("CREATE TABLE node_tags (node integer, k varchar(255), v
varchar(1024), primary key (node, k), foreign key(node) references
nodes_legacy);\n");
printf("CREATE TABLE ways (id serial,username varchar(255), timestamp
timestamptz);\n");
printf("CREATE TABLE way_tags (way integer, k varchar(255), v
varchar(1024), primary key (way, k), foreign key(way) references
ways);\n");
printf("CREATE TABLE way_nds (way integer, idx integer, to_node
integer, foreign key(way) references ways, foreign key(to_node) references
nodes_legacy, primary key(way, idx));\n");
printf("CREATE TABLE relations(id serial, username varchar(255),
timestamp timestamptz);\n");
printf("CREATE TABLE relation_members_node (relation integer, idx
integer, to_node integer, role varchar(255), foreign key(relation)
references relations, foreign key(to_node) references nodes_legacy, primary
key(relation, idx));\n");
printf("CREATE TABLE relation_members_relation (relation integer, idx
integer, to_relation integer, role varchar(255), foreign key(relation)
references relations, foreign key(to_relation) references relations,
primary key(relation, idx));\n");
printf("CREATE TABLE relation_members_way (relation integer, idx
integer, to_way integer, role varchar(255), foreign key(relation)
references relations, foreign key(to_way) references ways, primary
key(relation, idx));\n");
printf("CREATE TABLE relation_tags (relation integer, k varchar(255),
v varchar(1024), foreign key(relation) references relations, primary
key(relation, k));\n");
This is the program code that was used to generate the initial table. I
hope you mean this, and not the other 74GB.
----------------------------------------------------------------------
Comment By: Niels Nes (nielsnes)
Date: 2008-10-07 15:31
Message:
Sofar I cannot reproduce it. I think also some (or all) data is needed for
this query to fail.
----------------------------------------------------------------------
Comment By: Stefan de Konink (skinkie)
Date: 2008-10-07 14:16
Message:
What do you want me to add here? The full openstreetmap dataset, the table
description?
sql>\d ways
CREATE TABLE "sys"."ways" (
"id" int NOT NULL DEFAULT next value for "sys"."seq_3903",
"username" varchar(255),
"timestamp" timestamptz(7),
CONSTRAINT "ways_id_pkey" PRIMARY KEY ("id")
);
sql>\d way_tags
CREATE TABLE "sys"."way_tags" (
"way" int NOT NULL,
"k" varchar(255) NOT NULL,
"v" varchar(1024),
CONSTRAINT "way_tags_way_k_pkey" PRIMARY KEY ("way", "k"),
CONSTRAINT "way_tags_way_fkey" FOREIGN KEY ("way") REFERENCES
"ways" ("id")
);
----------------------------------------------------------------------
Comment By: Niels Nes (nielsnes)
Date: 2008-10-07 13:38
Message:
please add the full sql (create table statements).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2134428&group_id=56967
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs