1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge mysql.com:/extern/mysql/bk/mysql-5.0-runtime

into  mysql.com:/extern/mysql/5.0/bug16474/mysql-5.0-runtime


mysql-test/t/sp.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/sp.result:
  Manual merge.
This commit is contained in:
unknown
2006-03-28 14:18:47 +02:00
5 changed files with 157 additions and 1 deletions

View File

@@ -12333,7 +12333,12 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
Item **select_item; /* The corresponding item from the SELECT clause. */
Field *from_field; /* The corresponding field from the FROM clause. */
if (order_item->type() == Item::INT_ITEM)
/*
Local SP variables may be int but are expressions, not positions.
(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->basic_const_item())
{ /* Order by position */
uint count= (uint) order_item->val_int();
if (!count || count > fields.elements)