Bugs item #2825974, was opened at 2009-07-23 15:15
Message generated for change (Comment added) made by stmane
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2825974&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: select * where bla = "whatever" crashes
Initial Comment:
Some of our 'friendly' webservice users tried MonetDB in a somewhat disturbing
way, resulting in a segmentation fault of the server. The query in the subject
will reproduce it from mclient as well.
----------------------------------------------------------------------
>Comment By: Stefan Manegold (stmane)
Date: 2009-07-31 08:59
Message:
For the records:
===================================================================
2009/07/31 - nielsnes: sql/src/server/rel_select.mx,1.143.2.5
fix crash with select * from 'whatever' = bla
===================================================================
2009/07/31 - stmane: sql/src/server/rel_select.mx,1.143.2.6
"selection" might be NULL in this case;
hence, we postpone dereferencing it
until we are sure it is not NULL.
NOTE:
this and Niels' previous checkin might (will)
conflict with
"
2009/07/25 - nielsnes: sql/src/server/rel_select.mx,1.148
added support for 'create cluster name on tname ( column list )'
which caused lots of changes all over the place.
also fixed (moved code out of sql -> mkey)
moved finally copy into over to a function and into relational alg.
"
during propagation;
in fact, the above mentioned checkin on the development trunk
might (does?) subsume these two checkin on the May2009 branch
(needs to be verified!)
===================================================================
----------------------------------------------------------------------
Comment By: Stefan de Konink (skinkie)
Date: 2009-07-31 07:58
Message:
I see that the provided patch should not check for selection->h but
selection like Niels did. Both work probably because ->h is the first
element of the struct.
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2009-07-31 07:56
Message:
Correction:
1)
On the May2009 release branch, the provided patch results in
sql>select * where bla = "whatever";
!SELECT: identifier 'bla' unknown
0 tuples
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2009-07-31 07:54
Message:
ps:
1)
On the May2009 release branch, the provided patch results in
sql>select * where bla = "whatever";
!SELECT: a query should atleast have a selection and/or a from part
0 tuples
2)
On the May2009 release branch, the provided patch does not appear to
"harm" any of the tests in the sql repository,
i.e., after applying the patch, `Mtest.py -r` reports the same as it did
before.
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2009-07-31 07:46
Message:
Just for the records:
In the development trunk, the following checkin appears to avoid the
crash:
===================================================================
2009/07/25 - nielsnes: sql/src/server/rel_select.mx,1.148
added support for 'create cluster name on tname ( column list )'
which caused lots of changes all over the place.
also fixed (moved code out of sql -> mkey)
moved finally copy into over to a function and into relational alg.
===================================================================
(cf. `cvs diff -r1.14{7,8} sql/src/server/rel_select.mx` for details)
sql>select * where bla = "whatever";
!SELECT: a query should atleast have a selection and/or a from part
0 tuples
(While this problem has been reported for the development trunk (CVS HEAD)
and the provided patch represents a diff with the development trunk
(revision 1.147 of sql/src/server/rel_select.mx, i.e., before the above
patch), the problem seems occur also in the May2009 release branch, and the
patch appears to be applicable there, too.)
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2009-07-31 07:13
Message:
I meant origin as "what was wrong in the code".
----------------------------------------------------------------------
Comment By: Stefan de Konink (skinkie)
Date: 2009-07-31 07:08
Message:
selection->h is not available with broken queries, must be explicitly
checked before use. Removes void cast of where because the variable is in
use.
The origin of the problem was a user entering a malformed query on my
webinterface that segfaulted monet. The patch implements a null check to
prevent n->* to be used.
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2009-07-31 05:59
Message:
Would it be possible to provide a context diff to ensure correct automatic
application (or prevent incorrect application automatic application) even
in case the original code base has changed in the meantime?
Would it be possible to provide the context diff in unified format to
improve human readability?
(admittedly personal taste)
Would it be possible to explain/document the details of the patch, and
hence enlighten us what the origin of the actual problem was, and how it
has been solved?
Thank you very much in advance!
----------------------------------------------------------------------
Comment By: Stefan de Konink (skinkie)
Date: 2009-07-23 16:35
Message:
The attached file basically prevents the crash, but I wonder if we can
solve it higher in the tree. Output now is:
sql>select * where bla = "whatever";
!SELECT: identifier 'bla' unknown
0 tuples
So that looks good :)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2825974&group_id=56967
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs