summaryrefslogtreecommitdiff
path: root/mysql-test/r/ps.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/ps.result')
-rw-r--r--mysql-test/r/ps.result46
1 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 4d108e06356..9afbca9dcb1 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -880,3 +880,49 @@ select row_count();
row_count()
1
drop table t1;
+create table t1 (a int, b int);
+insert into t1 (a,b) values (2,8),(1,9),(3,7);
+prepare stmt from "select * from t1 order by ?";
+execute stmt using @a;
+a b
+2 8
+1 9
+3 7
+set @a=1;
+execute stmt using @a;
+a b
+1 9
+2 8
+3 7
+set @a=2;
+execute stmt using @a;
+a b
+3 7
+2 8
+1 9
+deallocate prepare stmt;
+select * from t1 order by 1;
+a b
+1 9
+2 8
+3 7
+prepare stmt from "select * from t1 order by ?+1";
+set @a=0;
+execute stmt using @a;
+a b
+2 8
+1 9
+3 7
+set @a=1;
+execute stmt using @a;
+a b
+2 8
+1 9
+3 7
+deallocate prepare stmt;
+select * from t1 order by 1+1;
+a b
+2 8
+1 9
+3 7
+drop table t1;