summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorigor@olga.mysql.com <>2007-01-25 18:44:35 -0800
committerigor@olga.mysql.com <>2007-01-25 18:44:35 -0800
commit36df33d80abb4ed946c7feee6b20205619ba3534 (patch)
tree8a121243129b7782eb39a40dd3442eb15198b028 /sql/item_cmpfunc.h
parent9659c11b6eee9e3ddf7d18b40d9afbc00e310bf2 (diff)
downloadmariadb-git-36df33d80abb4ed946c7feee6b20205619ba3534.tar.gz
Fixed bug #24653.
The bug report has demonstrated the following two problems. 1. If an ORDER/GROUP BY list includes a constant expression being optimized away and, at the same time, containing single-row subselects that return more that one row, no error is reported. Strictly speaking the standard allows to ignore error in this case. Yet, now a corresponding fatal error is reported in this case. 2. If a query requires sorting by expressions containing single-row subselects that, however, return more than one row, then the execution of the query may cause a server crash. To fix this some code has been added that blocks execution of a subselect item in case of a fatal error in the method Item_subselect::exec.
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 0e157fd412c..4635a301c31 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -843,7 +843,8 @@ public:
else
{
args[0]->update_used_tables();
- if ((const_item_cache= !(used_tables_cache= args[0]->used_tables())))
+ if ((const_item_cache= !(used_tables_cache= args[0]->used_tables())) &&
+ !with_subselect)
{
/* Remember if the value is always NULL or never NULL */
cached_value= (longlong) args[0]->is_null();