mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
fixed ORDER BY ?
new tests to ensure that prepared statement *really* work (and that MySQL not picks up some number from arbitrary location that happens to match the parameter's value) mysql-test/include/ps_query.inc: new tests to ensure that prepared statement *really* work (and that MySQL not picks up some number from arbitrary location that happens to match the parameter's value) mysql-test/r/ps_2myisam.result: results updated mysql-test/r/ps_3innodb.result: results updated mysql-test/r/ps_4heap.result: results updated mysql-test/r/ps_5merge.result: results updated mysql-test/r/ps_6bdb.result: results updated sql/sql_select.cc: don't shortcut - it backfires! (in particular - when itemptr is Item_param :)
This commit is contained in:
@@ -8000,7 +8000,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array,
|
||||
Item *itemptr=*order->item;
|
||||
if (itemptr->type() == Item::INT_ITEM)
|
||||
{ /* Order by position */
|
||||
uint count= (uint) ((Item_int*)itemptr)->value;
|
||||
uint count= itemptr->val_int();
|
||||
if (!count || count > fields.elements)
|
||||
{
|
||||
my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),
|
||||
|
||||
Reference in New Issue
Block a user