Bugs item #2183292, was opened at 2008-10-21 01:00
Message generated for change (Comment added) made by romulog
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2183292&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: SQL CVS Head
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Stefan de Konink (skinkie)
Assigned to: Niels Nes (nielsnes)
Summary: SQL: server aborts on nested query without FROM in subquery
Initial Comment:
sql>SELECT way WHERE k = 'bridge';
!SELECT: identifier 'k' unknown
0 tuples
sql>SELECT * FROM way_tags WHERE way IN (SELECT way WHERE k = 'bridge');
mserver5: ../../../src/server/sql_select.mx:475: find_pivot: Assertion `subset->
type == st_ptable' failed.
Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb1ff2b90 (LWP 1732)]
0xb80b0424 in __kernel_vsyscall ()
(gdb) bt
#0 0xb80b0424 in __kernel_vsyscall ()
#1 0xb7137670 in raise () from /lib/libc.so.6
#2 0xb7138eb8 in abort () from /lib/libc.so.6
#3 0xb713064e in __assert_fail () from /lib/libc.so.6
#4 0xb25714db in find_pivot (subset=0x9008e40, t=0x90001c8)
at ../../../src/server/sql_select.mx:475
#5 0xb2574e8d in sql_column_value (sql=0x8fb2080, scp=0x9008950,
se=0x8fb4340, grp=0x0, subset=0x9008e40, f=3)
at ../../../src/server/sql_select.mx:1571
#6 0xb2575436 in sql_value_exp (sql=0x8fb2080, scp=0x9008950, se=0x8fb4340,
grp=0x0, subset=0x9008e40, f=3, ek=
{type = 0 '\0', card = 2 '\002', reduce = 0 '\0'})
at ../../../src/server/sql_select.mx:1665
#7 0xb2578905 in _column_exp (sql=0x8fb2080, scp=0x9008950,
column_e=0x8fb43b0, grp=0x0, subset=0x9008e40, f=3)
at ../../../src/server/sql_select.mx:2701
#8 0xb2578b1b in sql_column_exp (sql=0x8fb2080, scp=0x9008950,
column_e=0x8fb43b0, grp=0x0, subset=0x9008e40, f=3)
at ../../../src/server/sql_select.mx:2735
#9 0xb257c64f in sql_simple_select (sql=0x8fb2080, scp=0x9008950,
sn=0x8fb4610) at ../../../src/server/sql_select.mx:3791
#10 0xb257cbe8 in sql_select (sql=0x8fb2080, scp=0x9008950, sn=0x8fb4610, ek=
{type = 0 '\0', card = 3 '\003', reduce = 0 '\0'})
at ../../../src/server/sql_select.mx:3907
#11 0xb2570830 in sql_subquery (sql=0x8fb2080, scp=0x9008950, sq=0x8fb4610, ek=
{type = 0 '\0', card = 3 '\003', reduce = 0 '\0'})
at ../../../src/server/sql_select.mx:236
#12 0xb25709fd in scope_subquery (sql=0x8fb2080, scp=0x9008950, sq=0x8fb4610,
ek={type = 0 '\0', card = 3 '\003', reduce = 0 '\0'})
at ../../../src/server/sql_select.mx:279
#13 0xb257548d in sql_value_exp (sql=0x8fb2080, scp=0x8ffb1e0, se=0x8fb4610,
grp=0x0, subset=0x0, f=1, ek=
{type = 0 '\0', card = 3 '\003', reduce = 0 '\0'})
at ../../../src/server/sql_select.mx:1669
#14 0xb257aeed in sql_logical_exp_ (sql=0x8fb2080, scp=0x8ffb1e0,
sc=0x8fb46e0, grp=0x0, subset=0x0, f=1, ek=
{type = 0 '\0', card = 4 '\004', reduce = 1 '\001'})
at ../../../src/server/sql_select.mx:3370
#15 0xb257bde6 in sql_logical_exp (sql=0x8fb2080, scp=0x8ffb1e0, sc=0x8fb46e0,
grp=0x0, subset=0x0, f=1, ek=
{type = 0 '\0', card = 4 '\004', reduce = 1 '\001'})
at ../../../src/server/sql_select.mx:3628
#16 0xb257cc4c in sql_select (sql=0x8fb2080, scp=0x8ffb1e0, sn=0x8fb4790, ek=
{type = 0 '\0', card = 4 '\004', reduce = 1 '\001'})
at ../../../src/server/sql_select.mx:3910
#17 0xb2570830 in sql_subquery (sql=0x8fb2080, scp=0x8ffb1e0, sq=0x8fb4790, ek=
{type = 0 '\0', card = 4 '\004', reduce = 1 '\001'})
at ../../../src/server/sql_select.mx:236
#18 0xb25709fd in scope_subquery (sql=0x8fb2080, scp=0x8ffb1e0, sq=0x8fb4790,
ek={type = 0 '\0', card = 4 '\004', reduce = 1 '\001'})
at ../../../src/server/sql_select.mx:279
#19 0xb257e327 in selects (sql=0x8fb2080, scp=0x0, s=0x8fb4790)
at ../../../src/server/sql_select.mx:4292
#20 0xb2580d01 in semantic (sql=0x8fb2080, scp=0x0, s=0x8fb4790)
at ../../../src/server/sql_semantic.mx:1160
#21 0xb2580f49 in output_semantic (sql=0x8fb2080, scp=0x0, s=0x8fb4790)
at ../../../src/server/sql_semantic.mx:1231
#22 0xb250dfe9 in sql_symbol2stmt (c=0x8fb2080, sym=0x8fb4790)
at ../../../../src/backends/monet5/sql.mx:995
#23 0xb2544844 in SQLparser (c=0x804d3f4)
at ../../../../src/backends/monet5/sql_scenario.mx:1023
#24 0xb803e74d in runPhase (c=0x804d3f4, phase=1)
at ../../../src/mal/mal_scenario.mx:591
#25 0xb803e845 in runScenarioBody (c=0x804d3f4)
at ../../../src/mal/mal_scenario.mx:622
#26 0xb803ea43 in runScenario (c=0x804d3f4)
at ../../../src/mal/mal_scenario.mx:656
#27 0xb80076b7 in MSserveClient (dummy=0x804d3f4)
at ../../../src/mal/mal_session.mx:462
#28 0xb7470170 in start_thread () from /lib/libpthread.so.0
#29 0xb71d8dfe in clone () from /lib/libc.so.6
----------------------------------------------------------------------
>Comment By: Romulo Goncalves (romulog)
Date: 2008-12-01 15:48
Message:
This bug is fixed in the algebra version for the stable and current branch
of M5-SQL.
I can't close the bug until it is fixed in the normal version as well.
To use the algebra version just call mclient with option "-G":
mclient -G
----------------------------------------------------------------------
Comment By: Romulo Goncalves (romulog)
Date: 2008-11-17 21:08
Message:
Test added:
sql/src/test/BugTracker-2008/Tests/server_aborts_on_nested_query_without_from_in_subquery.SF-2183292.sql
----------------------------------------------------------------------
Comment By: Romulo Goncalves (romulog)
Date: 2008-11-17 17:23
Message:
SELECT * FROM way_tags WHERE way IN (SELECT way WHERE k = 'bridge');
Niels,
Should the sub-query read from the table reference by the from clause in
the outside SELECT?
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2008-10-21 19:46
Message:
@skinkie:
Patient comes to doctor: "I hear voices, without seeing anybody. Please
help me."
After weeks of all kind of physical and mental checks, the doctor does
cannot find any problems. The patient is physically and mentally (as far as
that can be checked) in perfect health. The doctor is close to giving up
his job, but has one final question for the patient: "Could you please tell
me when the symptoms occur?"
Patient: "Whenever I make phone calls." ...
This story, http://www.chiark.greenend.org.uk/~sgtatham/bugs.html, today's
problems, and "common sense" should give you more than enough convincing
examples and arguments, how important clear and complete bug reports as
well as likewise communication are to be efficient and make sense ...
If not, I'm afraid, I'm not able to provide any more ...
----------------------------------------------------------------------
Comment By: Stefan de Konink (skinkie)
Date: 2008-10-21 18:47
Message:
https://sourceforge.net/tracker2/?func=detail&aid=2134428&group_id=56967&atid=482468
Date: 2008-10-09 04:45
Contains the instructions to reproduce the table and all its nodes. You
can ignore the fix in the dataset, in the mean time I have updated this
already in the original data.
If all the bug reports are incomplete because the table structure was not
known, I'm sorry for that. But I think you cannot expect a user (in a
normal business critical data structure) to show all its source material.
In my case this is different because the source material is publicly
available.
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2008-10-21 16:11
Message:
(Yet another problem with an insufficiently specified bug report ---
*please* give at least also the schema(s) of the table(s) that you use for
your quer(y|ies) ... here is why this matters:)
The reported "problematic" query (with no FROM clause in the subquery)
works "fine" (i.e., gives a proper error) in case the attribute that is
used in the subquery does not exist in the given table:
sql>create table way_tags (way integer);
0 tuples
sql>SELECT * FROM way_tags WHERE way IN (SELECT way WHERE k = 'bridge');
!SELECT: identifier 'k' unknown
0 tuples
sql>drop table way_tags;
0 tuples
However, in case the attribute does exist in the table, mserver5 aborts as
reported:
mclient:
sql>create table way_tags (way integer, k string);
0 tuples
sql>SELECT * FROM way_tags WHERE way IN (SELECT way WHERE k = 'bridge');
MAPI = [EMAIL PROTECTED]:50000
ACTION= read_line
QUERY = SELECT * FROM way_tags WHERE way IN (SELECT way WHERE k =
'bridge');
ERROR = Connection terminated
mserver5 (CVS HEAD of Tue Oct 21 15:55:53 CEST 2008):
$ mserver5 --dbinit='include sql;'
# MonetDB server v5.7.0, based on kernel v1.25.0
# Serving database 'demo', using 4 threads
# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically
linked
# Copyright (c) 1993-July 2008 CWI.
# Copyright (c) August 2008- MonetDB B.V., all rights reserved
# Visit http://monetdb.cwi.nl/ for further information
#warning: please don't forget to set your vault key!
#(see
/ufs/manegold/_/scratch0/Monet/Testing/Current/prefix.--enable-strict_--disable-optimize_--enable-debug_--enable-assert/etc/monetdb5.conf)
# Listening for connection requests on mapi:monetdb://127.0.0.1:50000/
# MonetDB/SQL module v2.25.0 loaded
>mserver5:
/ufs/manegold/_/scratch0/Monet/Testing/Current/source/sql/src/server/sql_select.mx:475:
find_pivot: Assertion `subset->type == st_ptable' failed.
Aborted
(No, I do not feel "personally offended" by incomplete/useless bug reports
--- I would appreciate, though, if requests for more information about
incomplete/useless bug reports would be answered properly, i.e., providing
the requested information, rather than adding (various) non-polite comments
We (try to) take bug reports serious as well as stick to common standards
of polite inter-human communication, and do appreciate if our users do so,
too.)
----------------------------------------------------------------------
Comment By: Martin Kersten (mlkersten)
Date: 2008-10-21 09:44
Message:
Works for me... so there is more context involved
>SELECT * FROM way_tags WHERE way IN (SELECT way WHERE k = 'bridge');
!SELECT: no such table 'way_tags'
>create table way_tags(way integer);
&3
>SELECT * FROM way_tags WHERE way IN (SELECT way WHERE k = 'bridge');
!SELECT: identifier 'k' unknown
>
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2008-10-21 09:20
Message:
Works for me (with CVS HEAD of Tue Oct 21 09:19:22 CEST 2008):
sql>create table way_tags (way integer);
0 tuples
sql>SELECT * FROM way_tags WHERE way IN (SELECT way WHERE k = 'bridge');
!SELECT: identifier 'k' unknown
0 tuples
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2183292&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