summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-07-21 19:17:50 +0200
committerunknown <serg@serg.mylan>2004-07-21 19:17:50 +0200
commit1cd522ec04e9f0beff5f014a07f9f36c1d45bd7a (patch)
tree642a2cf7541d329ee402db5439635e950f4e1be1
parent8df1bf6b4206d64f68ba2eb2179bcb7e2c852d1e (diff)
parentcb35648ec804ff3102895611b0a04999eb93ade1 (diff)
downloadmariadb-git-1cd522ec04e9f0beff5f014a07f9f36c1d45bd7a.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
-rw-r--r--mysql-test/include/ps_query.inc5
-rw-r--r--mysql-test/r/ps_2myisam.result10
-rw-r--r--mysql-test/r/ps_3innodb.result10
-rw-r--r--mysql-test/r/ps_4heap.result10
-rw-r--r--mysql-test/r/ps_5merge.result20
-rw-r--r--mysql-test/r/ps_6bdb.result10
-rw-r--r--sql/sql_select.cc2
7 files changed, 66 insertions, 1 deletions
diff --git a/mysql-test/include/ps_query.inc b/mysql-test/include/ps_query.inc
index e22f168dcd7..bc5d3eb6ed1 100644
--- a/mysql-test/include/ps_query.inc
+++ b/mysql-test/include/ps_query.inc
@@ -246,6 +246,11 @@ select a,b from t1 order by 2 ;
prepare stmt1 from ' select a,b from t1
order by ? ';
execute stmt1 using @arg00;
+set @arg00=1 ;
+execute stmt1 using @arg00;
+set @arg00=0 ;
+--error 1054
+execute stmt1 using @arg00;
##### parameter used in limit clause
set @arg00=1;
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index d630730d96f..23ce63cacc3 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -334,6 +334,16 @@ a b
1 one
3 three
2 two
+set @arg00=1 ;
+execute stmt1 using @arg00;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=0 ;
+execute stmt1 using @arg00;
+ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index b89daca7128..8ec7caa311c 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -334,6 +334,16 @@ a b
1 one
3 three
2 two
+set @arg00=1 ;
+execute stmt1 using @arg00;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=0 ;
+execute stmt1 using @arg00;
+ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index 112ef86a681..fae17eb2e23 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -335,6 +335,16 @@ a b
1 one
3 three
2 two
+set @arg00=1 ;
+execute stmt1 using @arg00;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=0 ;
+execute stmt1 using @arg00;
+ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index 8fc035b0aef..5aedebe396f 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -377,6 +377,16 @@ a b
1 one
3 three
2 two
+set @arg00=1 ;
+execute stmt1 using @arg00;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=0 ;
+execute stmt1 using @arg00;
+ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';
@@ -1560,6 +1570,16 @@ a b
1 one
3 three
2 two
+set @arg00=1 ;
+execute stmt1 using @arg00;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=0 ;
+execute stmt1 using @arg00;
+ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';
diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result
index eeabd114b91..1c6b309576c 100644
--- a/mysql-test/r/ps_6bdb.result
+++ b/mysql-test/r/ps_6bdb.result
@@ -334,6 +334,16 @@ a b
1 one
3 three
2 two
+set @arg00=1 ;
+execute stmt1 using @arg00;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=0 ;
+execute stmt1 using @arg00;
+ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';
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),