mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Post review fixes for BUG#16474: SP crashed MySQL.
mysql-test/r/ps.result: Added test coverage for "order by" in prepared statements (related to BUG#16474). mysql-test/r/sp.result: Added reference to test case for BUG#16474. mysql-test/t/ps.test: Added test coverage for "order by" in prepared statements (related to BUG#16474). mysql-test/t/sp.test: Added reference to test case for BUG#16474. sql/sql_select.cc: Fixed comment and test for basic_const_item() instead of is_splocal().
This commit is contained in:
@ -12327,9 +12327,10 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
|
||||
|
||||
/*
|
||||
Local SP variables may be int but are expressions, not positions.
|
||||
(And they must be fixed.)
|
||||
(And they can't be used before fix_fields is called for them).
|
||||
*/
|
||||
if (order_item->type() == Item::INT_ITEM && !order_item->is_splocal())
|
||||
// if (order_item->type() == Item::INT_ITEM && !order_item->is_splocal())
|
||||
if (order_item->type() == Item::INT_ITEM && order_item->basic_const_item())
|
||||
{ /* Order by position */
|
||||
uint count= (uint) order_item->val_int();
|
||||
if (!count || count > fields.elements)
|
||||
|
Reference in New Issue
Block a user