Commit 83af1d42 authored by unknown's avatar unknown
Browse files

Merge bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/opt/local/work/mysql-5.0-7306-final

parents 1531ab87 edb38786
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -174,11 +174,8 @@ where a=2
limit 1';
execute stmt1 ;
select a,b from t1 where b = 'bla' ;
# currently (May 2004, Version 4.1) it is impossible
-- error 1064
prepare stmt1 from 'update t1 set b=''bla''
where a=2
limit ?';
prepare stmt1 from 'update t1 set b=''bla'' where a=2 limit ?';
execute stmt1 using @arg00;

--disable_query_log
select '------ insert tests ------' as test_sequence ;
+2 −4
Original line number Diff line number Diff line
@@ -300,10 +300,8 @@ set @arg00=1;
prepare stmt1 from ' select a,b from t1 order by a
limit 1 ';
execute stmt1 ;
# currently (May 2004, Version 4.1) it is impossible
-- error 1064
prepare stmt1 from ' select a,b from t1
limit ? ';
prepare stmt1 from ' select a,b from t1 limit ? ';
execute stmt1 using @arg00;

##### parameter used in many places
set @arg00='b' ;
+41 −0
Original line number Diff line number Diff line
@@ -634,3 +634,44 @@ id
3
deallocate prepare stmt;
drop table t1, t2;
create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
prepare stmt from "select * from t1 limit ?, ?";
set @offset=0, @limit=1;
execute stmt using @offset, @limit;
a
1
select * from t1 limit 0, 1;
a
1
set @offset=3, @limit=2;
execute stmt using @offset, @limit;
a
4
5
select * from t1 limit 3, 2;
a
4
5
prepare stmt from "select * from t1 limit ?";
execute stmt using @limit;
a
1
2
prepare stmt from "select * from t1 where a in (select a from t1 limit ?)";
ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
prepare stmt from "select * from t1 union all select * from t1 limit ?, ?";
set @offset=9;
set @limit=2;
execute stmt using @offset, @limit;
a
10
1
prepare stmt from "(select * from t1 limit ?, ?) union all
                   (select * from t1 limit ?, ?) order by a limit ?";
execute stmt using @offset, @limit, @offset, @limit, @limit;
a
10
10
drop table t1;
deallocate prepare stmt;
+6 −7
Original line number Diff line number Diff line
@@ -444,9 +444,10 @@ limit 1 ';
execute stmt1 ;
a	b
1	one
prepare stmt1 from ' select a,b from t1
limit ? ';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2
prepare stmt1 from ' select a,b from t1 limit ? ';
execute stmt1 using @arg00;
a	b
1	one
set @arg00='b' ;
set @arg01=0 ;
set @arg02=2 ;
@@ -1381,10 +1382,8 @@ execute stmt1 ;
select a,b from t1 where b = 'bla' ;
a	b
2	bla
prepare stmt1 from 'update t1 set b=''bla''
where a=2
limit ?';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3
prepare stmt1 from 'update t1 set b=''bla'' where a=2 limit ?';
execute stmt1 using @arg00;
test_sequence
------ insert tests ------
delete from t1 ;
+6 −7
Original line number Diff line number Diff line
@@ -444,9 +444,10 @@ limit 1 ';
execute stmt1 ;
a	b
1	one
prepare stmt1 from ' select a,b from t1
limit ? ';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2
prepare stmt1 from ' select a,b from t1 limit ? ';
execute stmt1 using @arg00;
a	b
1	one
set @arg00='b' ;
set @arg01=0 ;
set @arg02=2 ;
@@ -1364,10 +1365,8 @@ execute stmt1 ;
select a,b from t1 where b = 'bla' ;
a	b
2	bla
prepare stmt1 from 'update t1 set b=''bla''
where a=2
limit ?';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3
prepare stmt1 from 'update t1 set b=''bla'' where a=2 limit ?';
execute stmt1 using @arg00;
test_sequence
------ insert tests ------
delete from t1 ;
Loading