summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-07-21 19:17:07 +0200
committerunknown <serg@serg.mylan>2004-07-21 19:17:07 +0200
commitcb35648ec804ff3102895611b0a04999eb93ade1 (patch)
treeaa5680b866c9ffa1e4bc05dec5fc9d26335615c7 /sql/sql_select.cc
parentbf95f9195fe431841fe1e29e6b82c9f47ec52ad3 (diff)
downloadmariadb-git-cb35648ec804ff3102895611b0a04999eb93ade1.tar.gz
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 :)
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 657853c98ba..487caeb62db 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -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),