summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorunknown <igor@olga.mysql.com>2007-01-25 18:44:35 -0800
committerunknown <igor@olga.mysql.com>2007-01-25 18:44:35 -0800
commitda561a802caff95d755b8d2061c27c248f22e3cd (patch)
tree8a121243129b7782eb39a40dd3442eb15198b028 /sql/item.h
parent6d04643ab3b8ed31a693ac1df6dadc7da42c53b8 (diff)
downloadmariadb-git-da561a802caff95d755b8d2061c27c248f22e3cd.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. mysql-test/r/subselect.result: Added a test cases for bug #24653. mysql-test/t/subselect.test: Added a test cases for bug #24653. sql/filesort.cc: Fixed bug #24653. Added a check for fatal error after reading the next row from the table in the function find_all_keys. sql/item.cc: Fixed bug #24653. Down-ported calculation of the attribute with_subselect of for Item objects. sql/item.h: Fixed bug #24653. Down-ported calculation of the attribute with_subselect of for Item objects. sql/item_cmpfunc.cc: Fixed bug #24653. Down-ported calculation of the attribute with_subselect of for Item objects. sql/item_cmpfunc.h: Fixed bug #24653. Down-ported calculation of the attribute with_subselect of for Item objects. sql/item_func.cc: Fixed bug #24653. Down-ported calculation of the attribute with_subselect of for Item objects. sql/item_subselect.cc: Fixed bug #24653. Added a check for fatal error in the method Item_subselect::exec to block evaluation of subselects in erroneous situations. Down-ported calculation of the attribute with_subselect of for Item objects. sql/sql_select.cc: Fixed bug #24653. Added a check to verify that any constant expression used in ORDER BY and/or GROUP BY lists which is optimized away does not contain subselects returning more than one row. If it does a fatal error is reported.
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h
index ad8bea663f1..f2136c4997a 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -142,6 +142,9 @@ public:
my_bool with_sum_func;
my_bool fixed; /* If item fixed with fix_fields */
DTCollation collation;
+ my_bool with_subselect; /* If this item is a subselect or some
+ of its arguments is or contains a
+ subselect */
// alloc & destruct is done as start of select using sql_alloc
Item();