mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge msvensson@build.mysql.com:/home/bk/mysql-4.1
into neptunus.(none):/home/magnus/mysql/mysql-4.1
This commit is contained in:
@ -102,6 +102,7 @@ miguel@light.local
|
|||||||
miguel@sartre.local
|
miguel@sartre.local
|
||||||
mikron@c-fb0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
|
mikron@c-fb0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
|
||||||
mikron@mikael-ronstr-ms-dator.local
|
mikron@mikael-ronstr-ms-dator.local
|
||||||
|
mleich@mysql.com
|
||||||
mmatthew@markslaptop.
|
mmatthew@markslaptop.
|
||||||
monty@bitch.mysql.fi
|
monty@bitch.mysql.fi
|
||||||
monty@butch.
|
monty@butch.
|
||||||
|
@ -110,10 +110,10 @@ select a,b from t1 where a=@arg00;
|
|||||||
set @arg00=NULL;
|
set @arg00=NULL;
|
||||||
set @arg01=2;
|
set @arg01=2;
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
set @arg00=0;
|
set @arg00=0;
|
||||||
execute stmt1 using @arg01, @arg00;
|
execute stmt1 using @arg01, @arg00;
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
|
|
||||||
## update with subquery and several parameters
|
## update with subquery and several parameters
|
||||||
set @arg00=23;
|
set @arg00=23;
|
||||||
@ -134,7 +134,7 @@ prepare stmt1 from 'update t1 set a=? where b=?
|
|||||||
and a not in (select ? from t2
|
and a not in (select ? from t2
|
||||||
where b = ? or a = ?)';
|
where b = ? or a = ?)';
|
||||||
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
||||||
select a,b from t1 ;
|
select a,b from t1 order by a;
|
||||||
drop table t2 ;
|
drop table t2 ;
|
||||||
|
|
||||||
## update with parameters in limit
|
## update with parameters in limit
|
||||||
@ -202,7 +202,7 @@ set @arg01=1 ;
|
|||||||
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
||||||
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
select * from t1;
|
select * from t1 order by a;
|
||||||
set @arg00=81 ;
|
set @arg00=81 ;
|
||||||
set @arg01=1 ;
|
set @arg01=1 ;
|
||||||
--error 1062
|
--error 1062
|
||||||
@ -221,17 +221,17 @@ set @updated="updated" ;
|
|||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
||||||
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
||||||
on duplicate key update a = a + ?, b = concat(b,?) ';
|
on duplicate key update a = a + ?, b = concat(b,?) ';
|
||||||
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
|
|
||||||
## replace
|
## replace
|
||||||
|
@ -45,19 +45,19 @@
|
|||||||
set @duplicate='duplicate ' ;
|
set @duplicate='duplicate ' ;
|
||||||
set @1000=1000 ;
|
set @1000=1000 ;
|
||||||
set @5=5 ;
|
set @5=5 ;
|
||||||
select a,b from t1 where a < 5 ;
|
select a,b from t1 where a < 5 order by a ;
|
||||||
--enable_info
|
--enable_info
|
||||||
insert into t1 select a + @1000, concat(@duplicate,b) from t1
|
insert into t1 select a + @1000, concat(@duplicate,b) from t1
|
||||||
where a < @5 ;
|
where a < @5 ;
|
||||||
--disable_info
|
--disable_info
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
|
prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
|
||||||
where a < ? ' ;
|
where a < ? ' ;
|
||||||
--enable_info
|
--enable_info
|
||||||
execute stmt1 using @1000, @duplicate, @5;
|
execute stmt1 using @1000, @duplicate, @5;
|
||||||
--disable_info
|
--disable_info
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
|
|
||||||
set @float=1.00;
|
set @float=1.00;
|
||||||
@ -78,7 +78,7 @@ select b, a + @100 from t1
|
|||||||
where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
|
where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
|
||||||
from t1);
|
from t1);
|
||||||
--disable_info
|
--disable_info
|
||||||
select a,b from t2;
|
select a,b from t2 order by a ;
|
||||||
delete from t2 ;
|
delete from t2 ;
|
||||||
prepare stmt1 from ' insert into t2 (b,a)
|
prepare stmt1 from ' insert into t2 (b,a)
|
||||||
select ?, sum(first.a)
|
select ?, sum(first.a)
|
||||||
@ -93,5 +93,5 @@ select b, a + ? from t1
|
|||||||
--enable_info
|
--enable_info
|
||||||
execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
|
execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
|
||||||
--disable_info
|
--disable_info
|
||||||
select a,b from t2;
|
select a,b from t2 order by a ;
|
||||||
drop table t2;
|
drop table t2;
|
||||||
|
@ -1016,15 +1016,15 @@ set @arg01=2;
|
|||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 one
|
|
||||||
0 two
|
0 two
|
||||||
|
1 one
|
||||||
3 three
|
3 three
|
||||||
4 four
|
4 four
|
||||||
set @arg00=0;
|
set @arg00=0;
|
||||||
execute stmt1 using @arg01, @arg00;
|
execute stmt1 using @arg01, @arg00;
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
@ -1048,7 +1048,7 @@ prepare stmt1 from 'update t1 set a=? where b=?
|
|||||||
and a not in (select ? from t2
|
and a not in (select ? from t2
|
||||||
where b = ? or a = ?)';
|
where b = ? or a = ?)';
|
||||||
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
||||||
select a,b from t1 ;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
@ -1142,19 +1142,19 @@ set @arg01=1 ;
|
|||||||
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
||||||
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
select * from t1;
|
select * from t1 order by a;
|
||||||
a b
|
a b
|
||||||
|
0 NULL
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
3 three
|
3 three
|
||||||
4 four
|
4 four
|
||||||
5 five
|
5 five
|
||||||
7 sixmodified
|
7 sixmodified
|
||||||
0 NULL
|
|
||||||
8 eight
|
8 eight
|
||||||
|
9 nine
|
||||||
81 8-1
|
81 8-1
|
||||||
82 8-2
|
82 8-2
|
||||||
9 nine
|
|
||||||
set @arg00=81 ;
|
set @arg00=81 ;
|
||||||
set @arg01=1 ;
|
set @arg01=1 ;
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
@ -1170,7 +1170,7 @@ set @updated="updated" ;
|
|||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
||||||
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
1100 x1000_1updated
|
1100 x1000_1updated
|
||||||
@ -1179,14 +1179,14 @@ insert into t1 values(1000,'x1000_1') ;
|
|||||||
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
||||||
on duplicate key update a = a + ?, b = concat(b,?) ';
|
on duplicate key update a = a + ?, b = concat(b,?) ';
|
||||||
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
1100 x1000_1updated
|
1100 x1000_1updated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1200 x1000_1updatedupdated
|
1200 x1000_1updatedupdated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
@ -1195,37 +1195,37 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye
|
|||||||
set @duplicate='duplicate ' ;
|
set @duplicate='duplicate ' ;
|
||||||
set @1000=1000 ;
|
set @1000=1000 ;
|
||||||
set @5=5 ;
|
set @5=5 ;
|
||||||
select a,b from t1 where a < 5 ;
|
select a,b from t1 where a < 5 order by a ;
|
||||||
a b
|
a b
|
||||||
|
0 NULL
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
3 three
|
3 three
|
||||||
4 four
|
4 four
|
||||||
0 NULL
|
|
||||||
insert into t1 select a + @1000, concat(@duplicate,b) from t1
|
insert into t1 select a + @1000, concat(@duplicate,b) from t1
|
||||||
where a < @5 ;
|
where a < @5 ;
|
||||||
affected rows: 5
|
affected rows: 5
|
||||||
info: Records: 5 Duplicates: 0 Warnings: 0
|
info: Records: 5 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
|
1000 NULL
|
||||||
1001 duplicate one
|
1001 duplicate one
|
||||||
1002 duplicate two
|
1002 duplicate two
|
||||||
1003 duplicate three
|
1003 duplicate three
|
||||||
1004 duplicate four
|
1004 duplicate four
|
||||||
1000 NULL
|
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
|
prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
|
||||||
where a < ? ' ;
|
where a < ? ' ;
|
||||||
execute stmt1 using @1000, @duplicate, @5;
|
execute stmt1 using @1000, @duplicate, @5;
|
||||||
affected rows: 5
|
affected rows: 5
|
||||||
info: Records: 5 Duplicates: 0 Warnings: 0
|
info: Records: 5 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1004 duplicate four
|
|
||||||
1003 duplicate three
|
|
||||||
1002 duplicate two
|
|
||||||
1001 duplicate one
|
|
||||||
1000 NULL
|
1000 NULL
|
||||||
|
1001 duplicate one
|
||||||
|
1002 duplicate two
|
||||||
|
1003 duplicate three
|
||||||
|
1004 duplicate four
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
set @float=1.00;
|
set @float=1.00;
|
||||||
set @five='five' ;
|
set @five='five' ;
|
||||||
@ -1243,15 +1243,15 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
|
|||||||
from t1);
|
from t1);
|
||||||
affected rows: 8
|
affected rows: 8
|
||||||
info: Records: 8 Duplicates: 0 Warnings: 0
|
info: Records: 8 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t2;
|
select a,b from t2 order by a ;
|
||||||
a b
|
a b
|
||||||
|
3 duplicate
|
||||||
|
4 duplicate
|
||||||
|
7 duplicate
|
||||||
|
8 duplicate
|
||||||
|
9 duplicate
|
||||||
81 duplicate
|
81 duplicate
|
||||||
82 duplicate
|
82 duplicate
|
||||||
8 duplicate
|
|
||||||
4 duplicate
|
|
||||||
9 duplicate
|
|
||||||
7 duplicate
|
|
||||||
3 duplicate
|
|
||||||
103 three
|
103 three
|
||||||
delete from t2 ;
|
delete from t2 ;
|
||||||
prepare stmt1 from ' insert into t2 (b,a)
|
prepare stmt1 from ' insert into t2 (b,a)
|
||||||
@ -1267,15 +1267,15 @@ select b, a + ? from t1
|
|||||||
execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
|
execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
|
||||||
affected rows: 8
|
affected rows: 8
|
||||||
info: Records: 8 Duplicates: 0 Warnings: 0
|
info: Records: 8 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t2;
|
select a,b from t2 order by a ;
|
||||||
a b
|
a b
|
||||||
|
3 duplicate
|
||||||
|
4 duplicate
|
||||||
|
7 duplicate
|
||||||
|
8 duplicate
|
||||||
|
9 duplicate
|
||||||
81 duplicate
|
81 duplicate
|
||||||
82 duplicate
|
82 duplicate
|
||||||
8 duplicate
|
|
||||||
4 duplicate
|
|
||||||
9 duplicate
|
|
||||||
7 duplicate
|
|
||||||
3 duplicate
|
|
||||||
103 three
|
103 three
|
||||||
drop table t2;
|
drop table t2;
|
||||||
drop table t1, t_many_col_types;
|
drop table t1, t_many_col_types;
|
||||||
|
@ -1016,7 +1016,7 @@ set @arg01=2;
|
|||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
0 two
|
0 two
|
||||||
1 one
|
1 one
|
||||||
@ -1024,7 +1024,7 @@ a b
|
|||||||
4 four
|
4 four
|
||||||
set @arg00=0;
|
set @arg00=0;
|
||||||
execute stmt1 using @arg01, @arg00;
|
execute stmt1 using @arg01, @arg00;
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
@ -1048,7 +1048,7 @@ prepare stmt1 from 'update t1 set a=? where b=?
|
|||||||
and a not in (select ? from t2
|
and a not in (select ? from t2
|
||||||
where b = ? or a = ?)';
|
where b = ? or a = ?)';
|
||||||
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
||||||
select a,b from t1 ;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
@ -1142,7 +1142,7 @@ set @arg01=1 ;
|
|||||||
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
||||||
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
select * from t1;
|
select * from t1 order by a;
|
||||||
a b
|
a b
|
||||||
0 NULL
|
0 NULL
|
||||||
1 one
|
1 one
|
||||||
@ -1170,7 +1170,7 @@ set @updated="updated" ;
|
|||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
||||||
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
1100 x1000_1updated
|
1100 x1000_1updated
|
||||||
@ -1179,14 +1179,14 @@ insert into t1 values(1000,'x1000_1') ;
|
|||||||
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
||||||
on duplicate key update a = a + ?, b = concat(b,?) ';
|
on duplicate key update a = a + ?, b = concat(b,?) ';
|
||||||
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
1100 x1000_1updated
|
1100 x1000_1updated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1200 x1000_1updatedupdated
|
1200 x1000_1updatedupdated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
@ -1195,7 +1195,7 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye
|
|||||||
set @duplicate='duplicate ' ;
|
set @duplicate='duplicate ' ;
|
||||||
set @1000=1000 ;
|
set @1000=1000 ;
|
||||||
set @5=5 ;
|
set @5=5 ;
|
||||||
select a,b from t1 where a < 5 ;
|
select a,b from t1 where a < 5 order by a ;
|
||||||
a b
|
a b
|
||||||
0 NULL
|
0 NULL
|
||||||
1 one
|
1 one
|
||||||
@ -1206,7 +1206,7 @@ insert into t1 select a + @1000, concat(@duplicate,b) from t1
|
|||||||
where a < @5 ;
|
where a < @5 ;
|
||||||
affected rows: 5
|
affected rows: 5
|
||||||
info: Records: 5 Duplicates: 0 Warnings: 0
|
info: Records: 5 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 NULL
|
1000 NULL
|
||||||
1001 duplicate one
|
1001 duplicate one
|
||||||
@ -1219,7 +1219,7 @@ where a < ? ' ;
|
|||||||
execute stmt1 using @1000, @duplicate, @5;
|
execute stmt1 using @1000, @duplicate, @5;
|
||||||
affected rows: 5
|
affected rows: 5
|
||||||
info: Records: 5 Duplicates: 0 Warnings: 0
|
info: Records: 5 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 NULL
|
1000 NULL
|
||||||
1001 duplicate one
|
1001 duplicate one
|
||||||
@ -1243,7 +1243,7 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
|
|||||||
from t1);
|
from t1);
|
||||||
affected rows: 8
|
affected rows: 8
|
||||||
info: Records: 8 Duplicates: 0 Warnings: 0
|
info: Records: 8 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t2;
|
select a,b from t2 order by a ;
|
||||||
a b
|
a b
|
||||||
3 duplicate
|
3 duplicate
|
||||||
4 duplicate
|
4 duplicate
|
||||||
@ -1267,7 +1267,7 @@ select b, a + ? from t1
|
|||||||
execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
|
execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
|
||||||
affected rows: 8
|
affected rows: 8
|
||||||
info: Records: 8 Duplicates: 0 Warnings: 0
|
info: Records: 8 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t2;
|
select a,b from t2 order by a ;
|
||||||
a b
|
a b
|
||||||
3 duplicate
|
3 duplicate
|
||||||
4 duplicate
|
4 duplicate
|
||||||
|
@ -1017,15 +1017,15 @@ set @arg01=2;
|
|||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 one
|
|
||||||
0 two
|
0 two
|
||||||
|
1 one
|
||||||
3 three
|
3 three
|
||||||
4 four
|
4 four
|
||||||
set @arg00=0;
|
set @arg00=0;
|
||||||
execute stmt1 using @arg01, @arg00;
|
execute stmt1 using @arg01, @arg00;
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
@ -1049,7 +1049,7 @@ prepare stmt1 from 'update t1 set a=? where b=?
|
|||||||
and a not in (select ? from t2
|
and a not in (select ? from t2
|
||||||
where b = ? or a = ?)';
|
where b = ? or a = ?)';
|
||||||
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
||||||
select a,b from t1 ;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
@ -1143,19 +1143,19 @@ set @arg01=1 ;
|
|||||||
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
||||||
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
select * from t1;
|
select * from t1 order by a;
|
||||||
a b
|
a b
|
||||||
|
0 NULL
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
3 three
|
3 three
|
||||||
4 four
|
4 four
|
||||||
5 five
|
5 five
|
||||||
7 sixmodified
|
7 sixmodified
|
||||||
0 NULL
|
|
||||||
8 eight
|
8 eight
|
||||||
|
9 nine
|
||||||
81 8-1
|
81 8-1
|
||||||
82 8-2
|
82 8-2
|
||||||
9 nine
|
|
||||||
set @arg00=81 ;
|
set @arg00=81 ;
|
||||||
set @arg01=1 ;
|
set @arg01=1 ;
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
@ -1171,23 +1171,23 @@ set @updated="updated" ;
|
|||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
||||||
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1100 x1000_1updated
|
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
|
1100 x1000_1updated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
||||||
on duplicate key update a = a + ?, b = concat(b,?) ';
|
on duplicate key update a = a + ?, b = concat(b,?) ';
|
||||||
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
1100 x1000_1updated
|
1100 x1000_1updated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1200 x1000_1updatedupdated
|
1200 x1000_1updatedupdated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
@ -1196,37 +1196,37 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye
|
|||||||
set @duplicate='duplicate ' ;
|
set @duplicate='duplicate ' ;
|
||||||
set @1000=1000 ;
|
set @1000=1000 ;
|
||||||
set @5=5 ;
|
set @5=5 ;
|
||||||
select a,b from t1 where a < 5 ;
|
select a,b from t1 where a < 5 order by a ;
|
||||||
a b
|
a b
|
||||||
|
0 NULL
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
3 three
|
3 three
|
||||||
4 four
|
4 four
|
||||||
0 NULL
|
|
||||||
insert into t1 select a + @1000, concat(@duplicate,b) from t1
|
insert into t1 select a + @1000, concat(@duplicate,b) from t1
|
||||||
where a < @5 ;
|
where a < @5 ;
|
||||||
affected rows: 5
|
affected rows: 5
|
||||||
info: Records: 5 Duplicates: 0 Warnings: 0
|
info: Records: 5 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1002 duplicate two
|
1000 NULL
|
||||||
1001 duplicate one
|
1001 duplicate one
|
||||||
|
1002 duplicate two
|
||||||
1003 duplicate three
|
1003 duplicate three
|
||||||
1004 duplicate four
|
1004 duplicate four
|
||||||
1000 NULL
|
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
|
prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
|
||||||
where a < ? ' ;
|
where a < ? ' ;
|
||||||
execute stmt1 using @1000, @duplicate, @5;
|
execute stmt1 using @1000, @duplicate, @5;
|
||||||
affected rows: 5
|
affected rows: 5
|
||||||
info: Records: 5 Duplicates: 0 Warnings: 0
|
info: Records: 5 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 NULL
|
1000 NULL
|
||||||
1004 duplicate four
|
|
||||||
1003 duplicate three
|
|
||||||
1002 duplicate two
|
|
||||||
1001 duplicate one
|
1001 duplicate one
|
||||||
|
1002 duplicate two
|
||||||
|
1003 duplicate three
|
||||||
|
1004 duplicate four
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
set @float=1.00;
|
set @float=1.00;
|
||||||
set @five='five' ;
|
set @five='five' ;
|
||||||
@ -1244,15 +1244,15 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
|
|||||||
from t1);
|
from t1);
|
||||||
affected rows: 8
|
affected rows: 8
|
||||||
info: Records: 8 Duplicates: 0 Warnings: 0
|
info: Records: 8 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t2;
|
select a,b from t2 order by a ;
|
||||||
a b
|
a b
|
||||||
|
3 duplicate
|
||||||
|
4 duplicate
|
||||||
|
7 duplicate
|
||||||
|
8 duplicate
|
||||||
|
9 duplicate
|
||||||
81 duplicate
|
81 duplicate
|
||||||
82 duplicate
|
82 duplicate
|
||||||
8 duplicate
|
|
||||||
4 duplicate
|
|
||||||
9 duplicate
|
|
||||||
7 duplicate
|
|
||||||
3 duplicate
|
|
||||||
103 three
|
103 three
|
||||||
delete from t2 ;
|
delete from t2 ;
|
||||||
prepare stmt1 from ' insert into t2 (b,a)
|
prepare stmt1 from ' insert into t2 (b,a)
|
||||||
@ -1268,15 +1268,15 @@ select b, a + ? from t1
|
|||||||
execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
|
execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
|
||||||
affected rows: 8
|
affected rows: 8
|
||||||
info: Records: 8 Duplicates: 0 Warnings: 0
|
info: Records: 8 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t2;
|
select a,b from t2 order by a ;
|
||||||
a b
|
a b
|
||||||
|
3 duplicate
|
||||||
|
4 duplicate
|
||||||
|
7 duplicate
|
||||||
|
8 duplicate
|
||||||
|
9 duplicate
|
||||||
81 duplicate
|
81 duplicate
|
||||||
82 duplicate
|
82 duplicate
|
||||||
8 duplicate
|
|
||||||
4 duplicate
|
|
||||||
9 duplicate
|
|
||||||
7 duplicate
|
|
||||||
3 duplicate
|
|
||||||
103 three
|
103 three
|
||||||
drop table t2;
|
drop table t2;
|
||||||
drop table t1, t_many_col_types;
|
drop table t1, t_many_col_types;
|
||||||
|
@ -1059,19 +1059,19 @@ set @arg01=2;
|
|||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
3 three
|
|
||||||
0 two
|
0 two
|
||||||
1 one
|
1 one
|
||||||
|
3 three
|
||||||
4 four
|
4 four
|
||||||
set @arg00=0;
|
set @arg00=0;
|
||||||
execute stmt1 using @arg01, @arg00;
|
execute stmt1 using @arg01, @arg00;
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
3 three
|
|
||||||
2 two
|
|
||||||
1 one
|
1 one
|
||||||
|
2 two
|
||||||
|
3 three
|
||||||
4 four
|
4 four
|
||||||
set @arg00=23;
|
set @arg00=23;
|
||||||
set @arg01='two';
|
set @arg01='two';
|
||||||
@ -1091,11 +1091,11 @@ prepare stmt1 from 'update t1 set a=? where b=?
|
|||||||
and a not in (select ? from t2
|
and a not in (select ? from t2
|
||||||
where b = ? or a = ?)';
|
where b = ? or a = ?)';
|
||||||
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
||||||
select a,b from t1 ;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
3 three
|
|
||||||
2 two
|
|
||||||
1 one
|
1 one
|
||||||
|
2 two
|
||||||
|
3 three
|
||||||
4 four
|
4 four
|
||||||
drop table t2 ;
|
drop table t2 ;
|
||||||
set @arg00=1;
|
set @arg00=1;
|
||||||
@ -1185,19 +1185,19 @@ set @arg01=1 ;
|
|||||||
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
||||||
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
select * from t1;
|
select * from t1 order by a;
|
||||||
a b
|
a b
|
||||||
4 four
|
0 NULL
|
||||||
3 three
|
|
||||||
2 two
|
|
||||||
1 one
|
1 one
|
||||||
|
2 two
|
||||||
|
3 three
|
||||||
|
4 four
|
||||||
5 five
|
5 five
|
||||||
7 sixmodified
|
7 sixmodified
|
||||||
0 NULL
|
|
||||||
8 eight
|
8 eight
|
||||||
|
9 nine
|
||||||
81 8-1
|
81 8-1
|
||||||
82 8-2
|
82 8-2
|
||||||
9 nine
|
|
||||||
set @arg00=81 ;
|
set @arg00=81 ;
|
||||||
set @arg01=1 ;
|
set @arg01=1 ;
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
@ -1213,7 +1213,7 @@ set @updated="updated" ;
|
|||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
||||||
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
1100 x1000_1updated
|
1100 x1000_1updated
|
||||||
@ -1222,14 +1222,14 @@ insert into t1 values(1000,'x1000_1') ;
|
|||||||
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
||||||
on duplicate key update a = a + ?, b = concat(b,?) ';
|
on duplicate key update a = a + ?, b = concat(b,?) ';
|
||||||
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
1100 x1000_1updated
|
1100 x1000_1updated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1200 x1000_1updatedupdated
|
1200 x1000_1updatedupdated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
@ -2254,19 +2254,19 @@ set @arg01=2;
|
|||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
3 three
|
|
||||||
0 two
|
0 two
|
||||||
1 one
|
1 one
|
||||||
|
3 three
|
||||||
4 four
|
4 four
|
||||||
set @arg00=0;
|
set @arg00=0;
|
||||||
execute stmt1 using @arg01, @arg00;
|
execute stmt1 using @arg01, @arg00;
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
3 three
|
|
||||||
2 two
|
|
||||||
1 one
|
1 one
|
||||||
|
2 two
|
||||||
|
3 three
|
||||||
4 four
|
4 four
|
||||||
set @arg00=23;
|
set @arg00=23;
|
||||||
set @arg01='two';
|
set @arg01='two';
|
||||||
@ -2286,11 +2286,11 @@ prepare stmt1 from 'update t1 set a=? where b=?
|
|||||||
and a not in (select ? from t2
|
and a not in (select ? from t2
|
||||||
where b = ? or a = ?)';
|
where b = ? or a = ?)';
|
||||||
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
||||||
select a,b from t1 ;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
3 three
|
|
||||||
2 two
|
|
||||||
1 one
|
1 one
|
||||||
|
2 two
|
||||||
|
3 three
|
||||||
4 four
|
4 four
|
||||||
drop table t2 ;
|
drop table t2 ;
|
||||||
set @arg00=1;
|
set @arg00=1;
|
||||||
@ -2380,19 +2380,19 @@ set @arg01=1 ;
|
|||||||
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
||||||
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
select * from t1;
|
select * from t1 order by a;
|
||||||
a b
|
a b
|
||||||
4 four
|
0 NULL
|
||||||
3 three
|
|
||||||
2 two
|
|
||||||
1 one
|
1 one
|
||||||
|
2 two
|
||||||
|
3 three
|
||||||
|
4 four
|
||||||
5 five
|
5 five
|
||||||
7 sixmodified
|
7 sixmodified
|
||||||
0 NULL
|
|
||||||
8 eight
|
8 eight
|
||||||
|
9 nine
|
||||||
81 8-1
|
81 8-1
|
||||||
82 8-2
|
82 8-2
|
||||||
9 nine
|
|
||||||
set @arg00=81 ;
|
set @arg00=81 ;
|
||||||
set @arg01=1 ;
|
set @arg01=1 ;
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
@ -2408,7 +2408,7 @@ set @updated="updated" ;
|
|||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
||||||
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
1100 x1000_1updated
|
1100 x1000_1updated
|
||||||
@ -2417,14 +2417,14 @@ insert into t1 values(1000,'x1000_1') ;
|
|||||||
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
||||||
on duplicate key update a = a + ?, b = concat(b,?) ';
|
on duplicate key update a = a + ?, b = concat(b,?) ';
|
||||||
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
1100 x1000_1updated
|
1100 x1000_1updated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1200 x1000_1updatedupdated
|
1200 x1000_1updatedupdated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
|
@ -1016,7 +1016,7 @@ set @arg01=2;
|
|||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
0 two
|
0 two
|
||||||
1 one
|
1 one
|
||||||
@ -1024,7 +1024,7 @@ a b
|
|||||||
4 four
|
4 four
|
||||||
set @arg00=0;
|
set @arg00=0;
|
||||||
execute stmt1 using @arg01, @arg00;
|
execute stmt1 using @arg01, @arg00;
|
||||||
select a,b from t1;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
@ -1048,7 +1048,7 @@ prepare stmt1 from 'update t1 set a=? where b=?
|
|||||||
and a not in (select ? from t2
|
and a not in (select ? from t2
|
||||||
where b = ? or a = ?)';
|
where b = ? or a = ?)';
|
||||||
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
|
||||||
select a,b from t1 ;
|
select a,b from t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 one
|
1 one
|
||||||
2 two
|
2 two
|
||||||
@ -1142,7 +1142,7 @@ set @arg01=1 ;
|
|||||||
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
|
||||||
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
on duplicate key update a=a + ?, b=concat(b,''modified'') ';
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
select * from t1;
|
select * from t1 order by a;
|
||||||
a b
|
a b
|
||||||
0 NULL
|
0 NULL
|
||||||
1 one
|
1 one
|
||||||
@ -1170,7 +1170,7 @@ set @updated="updated" ;
|
|||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
|
||||||
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
on duplicate key update a = a + @100, b = concat(b,@updated) ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
1100 x1000_1updated
|
1100 x1000_1updated
|
||||||
@ -1179,14 +1179,14 @@ insert into t1 values(1000,'x1000_1') ;
|
|||||||
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
prepare stmt1 from ' insert into t1 values(?,?),(?,?)
|
||||||
on duplicate key update a = a + ?, b = concat(b,?) ';
|
on duplicate key update a = a + ?, b = concat(b,?) ';
|
||||||
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 x1000_3
|
1000 x1000_3
|
||||||
1100 x1000_1updated
|
1100 x1000_1updated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
insert into t1 values(1000,'x1000_1') ;
|
insert into t1 values(1000,'x1000_1') ;
|
||||||
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1200 x1000_1updatedupdated
|
1200 x1000_1updatedupdated
|
||||||
delete from t1 where a >= 1000 ;
|
delete from t1 where a >= 1000 ;
|
||||||
@ -1195,7 +1195,7 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye
|
|||||||
set @duplicate='duplicate ' ;
|
set @duplicate='duplicate ' ;
|
||||||
set @1000=1000 ;
|
set @1000=1000 ;
|
||||||
set @5=5 ;
|
set @5=5 ;
|
||||||
select a,b from t1 where a < 5 ;
|
select a,b from t1 where a < 5 order by a ;
|
||||||
a b
|
a b
|
||||||
0 NULL
|
0 NULL
|
||||||
1 one
|
1 one
|
||||||
@ -1206,7 +1206,7 @@ insert into t1 select a + @1000, concat(@duplicate,b) from t1
|
|||||||
where a < @5 ;
|
where a < @5 ;
|
||||||
affected rows: 5
|
affected rows: 5
|
||||||
info: Records: 5 Duplicates: 0 Warnings: 0
|
info: Records: 5 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 NULL
|
1000 NULL
|
||||||
1001 duplicate one
|
1001 duplicate one
|
||||||
@ -1219,7 +1219,7 @@ where a < ? ' ;
|
|||||||
execute stmt1 using @1000, @duplicate, @5;
|
execute stmt1 using @1000, @duplicate, @5;
|
||||||
affected rows: 5
|
affected rows: 5
|
||||||
info: Records: 5 Duplicates: 0 Warnings: 0
|
info: Records: 5 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t1 where a >= 1000 ;
|
select a,b from t1 where a >= 1000 order by a ;
|
||||||
a b
|
a b
|
||||||
1000 NULL
|
1000 NULL
|
||||||
1001 duplicate one
|
1001 duplicate one
|
||||||
@ -1243,7 +1243,7 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
|
|||||||
from t1);
|
from t1);
|
||||||
affected rows: 8
|
affected rows: 8
|
||||||
info: Records: 8 Duplicates: 0 Warnings: 0
|
info: Records: 8 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t2;
|
select a,b from t2 order by a ;
|
||||||
a b
|
a b
|
||||||
3 duplicate
|
3 duplicate
|
||||||
4 duplicate
|
4 duplicate
|
||||||
@ -1267,7 +1267,7 @@ select b, a + ? from t1
|
|||||||
execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
|
execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
|
||||||
affected rows: 8
|
affected rows: 8
|
||||||
info: Records: 8 Duplicates: 0 Warnings: 0
|
info: Records: 8 Duplicates: 0 Warnings: 0
|
||||||
select a,b from t2;
|
select a,b from t2 order by a ;
|
||||||
a b
|
a b
|
||||||
3 duplicate
|
3 duplicate
|
||||||
4 duplicate
|
4 duplicate
|
||||||
|
@ -159,6 +159,7 @@ Configuration::Configuration()
|
|||||||
_initialStart = false;
|
_initialStart = false;
|
||||||
_daemonMode = false;
|
_daemonMode = false;
|
||||||
m_config_retriever= 0;
|
m_config_retriever= 0;
|
||||||
|
m_clusterConfig= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Configuration::~Configuration(){
|
Configuration::~Configuration(){
|
||||||
|
@ -30,7 +30,7 @@ testSystemRestart \
|
|||||||
testTimeout \
|
testTimeout \
|
||||||
testTransactions \
|
testTransactions \
|
||||||
testDeadlock \
|
testDeadlock \
|
||||||
test_event ndbapi_slow_select testReadPerf
|
test_event ndbapi_slow_select testReadPerf testLcp
|
||||||
|
|
||||||
#flexTimedAsynch
|
#flexTimedAsynch
|
||||||
#testBlobs
|
#testBlobs
|
||||||
@ -68,6 +68,7 @@ testDeadlock_SOURCES = testDeadlock.cpp
|
|||||||
test_event_SOURCES = test_event.cpp
|
test_event_SOURCES = test_event.cpp
|
||||||
ndbapi_slow_select_SOURCES = slow_select.cpp
|
ndbapi_slow_select_SOURCES = slow_select.cpp
|
||||||
testReadPerf_SOURCES = testReadPerf.cpp
|
testReadPerf_SOURCES = testReadPerf.cpp
|
||||||
|
testLcp_SOURCES = testLcp.cpp
|
||||||
|
|
||||||
INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel
|
INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel
|
||||||
|
|
||||||
|
@ -2097,47 +2097,50 @@ int Bank::increaseSystemValue(SystemValueId sysValId, Uint64 &value){
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
DBUG_ENTER("Bank::increaseSystemValue");
|
||||||
|
|
||||||
int check;
|
int check;
|
||||||
|
|
||||||
NdbConnection* pTrans = m_ndb.startTransaction();
|
NdbConnection* pTrans = m_ndb.startTransaction();
|
||||||
if (pTrans == NULL){
|
if (pTrans == NULL){
|
||||||
ERR(m_ndb.getNdbError());
|
ERR(m_ndb.getNdbError());
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbOperation* pOp = pTrans->getNdbOperation("SYSTEM_VALUES");
|
NdbOperation* pOp = pTrans->getNdbOperation("SYSTEM_VALUES");
|
||||||
if (pOp == NULL) {
|
if (pOp == NULL) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp->readTupleExclusive();
|
check = pOp->readTupleExclusive();
|
||||||
|
// check = pOp->readTuple();
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp->equal("SYSTEM_VALUES_ID", sysValId);
|
check = pOp->equal("SYSTEM_VALUES_ID", sysValId);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbRecAttr* valueRec = pOp->getValue("VALUE");
|
NdbRecAttr* valueRec = pOp->getValue("VALUE");
|
||||||
if( valueRec ==NULL ) {
|
if( valueRec ==NULL ) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pTrans->execute(NoCommit);
|
check = pTrans->execute(NoCommit);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
value = valueRec->u_64_value();
|
value = valueRec->u_64_value();
|
||||||
@ -2147,49 +2150,56 @@ int Bank::increaseSystemValue(SystemValueId sysValId, Uint64 &value){
|
|||||||
if (pOp2 == NULL) {
|
if (pOp2 == NULL) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp2->updateTuple();
|
check = pOp2->updateTuple();
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp2->equal("SYSTEM_VALUES_ID", sysValId);
|
check = pOp2->equal("SYSTEM_VALUES_ID", sysValId);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp2->setValue("VALUE", value);
|
check = pOp2->setValue("VALUE", value);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
|
}
|
||||||
|
|
||||||
|
check = pTrans->execute(NoCommit);
|
||||||
|
if( check == -1 ) {
|
||||||
|
ERR(pTrans->getNdbError());
|
||||||
|
m_ndb.closeTransaction(pTrans);
|
||||||
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbOperation* pOp3 = pTrans->getNdbOperation("SYSTEM_VALUES");
|
NdbOperation* pOp3 = pTrans->getNdbOperation("SYSTEM_VALUES");
|
||||||
if (pOp3 == NULL) {
|
if (pOp3 == NULL) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp3->readTuple();
|
check = pOp3->readTuple();
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp3->equal("SYSTEM_VALUES_ID", sysValId);
|
check = pOp3->equal("SYSTEM_VALUES_ID", sysValId);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read new value
|
// Read new value
|
||||||
@ -2197,28 +2207,31 @@ int Bank::increaseSystemValue(SystemValueId sysValId, Uint64 &value){
|
|||||||
if( valueNewRec ==NULL ) {
|
if( valueNewRec ==NULL ) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pTrans->execute(Commit);
|
check = pTrans->execute(Commit);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pTrans->getNdbError());
|
ERR(pTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that value updated equals the value we read after the update
|
// Check that value updated equals the value we read after the update
|
||||||
if (valueNewRec->u_64_value() != value){
|
if (valueNewRec->u_64_value() != value){
|
||||||
|
|
||||||
|
printf("value actual=%lld\n", valueNewRec->u_64_value());
|
||||||
|
printf("value expected=%lld actual=%lld\n", value, valueNewRec->u_64_value());
|
||||||
|
|
||||||
|
DBUG_PRINT("info", ("value expected=%ld actual=%ld", value, valueNewRec->u_64_value()));
|
||||||
g_err << "getNextTransactionId: value was not updated" << endl;
|
g_err << "getNextTransactionId: value was not updated" << endl;
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
return NDBT_FAILED;
|
DBUG_RETURN(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ndb.closeTransaction(pTrans);
|
m_ndb.closeTransaction(pTrans);
|
||||||
|
|
||||||
|
DBUG_RETURN(0);
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bank::increaseSystemValue2(SystemValueId sysValId, Uint64 &value){
|
int Bank::increaseSystemValue2(SystemValueId sysValId, Uint64 &value){
|
||||||
|
320
ndb/test/ndbapi/testLcp.cpp
Normal file
320
ndb/test/ndbapi/testLcp.cpp
Normal file
@ -0,0 +1,320 @@
|
|||||||
|
|
||||||
|
#include <NDBT.hpp>
|
||||||
|
#include <NdbApi.hpp>
|
||||||
|
#include <NdbRestarter.hpp>
|
||||||
|
#include <HugoOperations.hpp>
|
||||||
|
#include <UtilTransactions.hpp>
|
||||||
|
#include <signaldata/DumpStateOrd.hpp>
|
||||||
|
|
||||||
|
struct CASE
|
||||||
|
{
|
||||||
|
bool start_row;
|
||||||
|
bool end_row;
|
||||||
|
bool curr_row;
|
||||||
|
const char * op1;
|
||||||
|
const char * op2;
|
||||||
|
int val;
|
||||||
|
};
|
||||||
|
|
||||||
|
static CASE g_ops[] =
|
||||||
|
{
|
||||||
|
{ false, true, false, "INSERT", 0, 0 },
|
||||||
|
{ false, true, false, "INSERT", "UPDATE", 0 },
|
||||||
|
{ false, false, false, "INSERT", "DELETE", 0 },
|
||||||
|
{ true, true, false, "UPDATE", 0, 0 },
|
||||||
|
{ true, true, false, "UPDATE", "UPDATE", 0 },
|
||||||
|
{ true, false, false, "UPDATE", "DELETE", 0 },
|
||||||
|
{ true, false, false, "DELETE", 0, 0 },
|
||||||
|
{ true, true, false, "DELETE", "INSERT", 0 }
|
||||||
|
};
|
||||||
|
const size_t OP_COUNT = (sizeof(g_ops)/sizeof(g_ops[0]));
|
||||||
|
|
||||||
|
static Ndb* g_ndb = 0;
|
||||||
|
static CASE* g_cases;
|
||||||
|
static HugoOperations* g_hugo_ops;
|
||||||
|
|
||||||
|
static int g_rows = 1000;
|
||||||
|
static int g_setup_tables = 1;
|
||||||
|
static const char * g_tablename = "T1";
|
||||||
|
static const NdbDictionary::Table* g_table = 0;
|
||||||
|
static NdbRestarter g_restarter;
|
||||||
|
|
||||||
|
static int init_ndb(int argc, char** argv);
|
||||||
|
static int parse_args(int argc, char** argv);
|
||||||
|
static int connect_ndb();
|
||||||
|
static int drop_all_tables();
|
||||||
|
static int load_table();
|
||||||
|
static int pause_lcp();
|
||||||
|
static int do_op(int row);
|
||||||
|
static int continue_lcp(int error);
|
||||||
|
static int commit();
|
||||||
|
static int restart();
|
||||||
|
static int validate();
|
||||||
|
|
||||||
|
#define require(x) { bool b = x; if(!b){g_err << __LINE__ << endl; abort();}}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char ** argv){
|
||||||
|
|
||||||
|
require(!init_ndb(argc, argv));
|
||||||
|
require(!parse_args(argc, argv));
|
||||||
|
require(!connect_ndb());
|
||||||
|
|
||||||
|
if(g_setup_tables){
|
||||||
|
require(!drop_all_tables());
|
||||||
|
|
||||||
|
if(NDBT_Tables::createTable(g_ndb, g_tablename) != 0){
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
g_table = g_ndb->getDictionary()->getTable(g_tablename);
|
||||||
|
if(g_table == 0){
|
||||||
|
g_err << "Failed to retreive table: " << g_tablename << endl;
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
require(g_hugo_ops = new HugoOperations(* g_table));
|
||||||
|
require(!g_hugo_ops->startTransaction(g_ndb));
|
||||||
|
|
||||||
|
g_cases= new CASE[g_rows];
|
||||||
|
require(!load_table());
|
||||||
|
|
||||||
|
g_info << "Performing all ops wo/ inteference of LCP" << endl;
|
||||||
|
|
||||||
|
g_info << "Testing pre LCP operations, ZLCP_OP_WRITE_RT_BREAK" << endl;
|
||||||
|
g_info << " where ZLCP_OP_WRITE_RT_BREAK is finished before SAVE_PAGES"
|
||||||
|
<< endl;
|
||||||
|
require(!pause_lcp());
|
||||||
|
for(size_t j = 0; j<g_rows; j++){
|
||||||
|
require(!do_op(j));
|
||||||
|
}
|
||||||
|
require(!continue_lcp(5900));
|
||||||
|
require(!commit());
|
||||||
|
require(!restart());
|
||||||
|
require(!validate());
|
||||||
|
|
||||||
|
g_info << "Testing pre LCP operations, ZLCP_OP_WRITE_RT_BREAK" << endl;
|
||||||
|
g_info << " where ZLCP_OP_WRITE_RT_BREAK is finished after SAVE_PAGES"
|
||||||
|
<< endl;
|
||||||
|
require(!load_table());
|
||||||
|
require(!pause_lcp());
|
||||||
|
for(size_t j = 0; j<g_rows; j++){
|
||||||
|
require(!do_op(j));
|
||||||
|
}
|
||||||
|
require(!continue_lcp(5901));
|
||||||
|
require(!commit());
|
||||||
|
require(!restart());
|
||||||
|
require(!validate());
|
||||||
|
|
||||||
|
g_info << "Testing pre LCP operations, undo-ed at commit" << endl;
|
||||||
|
require(!load_table());
|
||||||
|
require(!pause_lcp());
|
||||||
|
for(size_t j = 0; j<g_rows; j++){
|
||||||
|
require(!do_op(j));
|
||||||
|
}
|
||||||
|
require(!continue_lcp(5902));
|
||||||
|
require(!commit());
|
||||||
|
require(!continue_lcp(5903));
|
||||||
|
require(!restart());
|
||||||
|
require(!validate());
|
||||||
|
}
|
||||||
|
|
||||||
|
static int init_ndb(int argc, char** argv)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int parse_args(int argc, char** argv)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int connect_ndb()
|
||||||
|
{
|
||||||
|
g_ndb = new Ndb("TEST_DB");
|
||||||
|
g_ndb->init();
|
||||||
|
if(g_ndb->waitUntilReady(30) == 0){
|
||||||
|
int args[] = { DumpStateOrd::DihMaxTimeBetweenLCP };
|
||||||
|
return g_restarter.dumpStateAllNodes(args, 1);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int disconnect_ndb()
|
||||||
|
{
|
||||||
|
delete g_ndb;
|
||||||
|
g_ndb = 0;
|
||||||
|
g_table = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int drop_all_tables()
|
||||||
|
{
|
||||||
|
NdbDictionary::Dictionary * dict = g_ndb->getDictionary();
|
||||||
|
require(dict);
|
||||||
|
|
||||||
|
BaseString db = g_ndb->getDatabaseName();
|
||||||
|
BaseString schema = g_ndb->getSchemaName();
|
||||||
|
|
||||||
|
NdbDictionary::Dictionary::List list;
|
||||||
|
if (dict->listObjects(list, NdbDictionary::Object::TypeUndefined) == -1){
|
||||||
|
g_err << "Failed to list tables: " << endl
|
||||||
|
<< dict->getNdbError() << endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
for (unsigned i = 0; i < list.count; i++) {
|
||||||
|
NdbDictionary::Dictionary::List::Element& elt = list.elements[i];
|
||||||
|
switch (elt.type) {
|
||||||
|
case NdbDictionary::Object::SystemTable:
|
||||||
|
case NdbDictionary::Object::UserTable:
|
||||||
|
g_ndb->setDatabaseName(elt.database);
|
||||||
|
g_ndb->setSchemaName(elt.schema);
|
||||||
|
if(dict->dropTable(elt.name) != 0){
|
||||||
|
g_err << "Failed to drop table: "
|
||||||
|
<< elt.database << "/" << elt.schema << "/" << elt.name <<endl;
|
||||||
|
g_err << dict->getNdbError() << endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case NdbDictionary::Object::UniqueHashIndex:
|
||||||
|
case NdbDictionary::Object::OrderedIndex:
|
||||||
|
case NdbDictionary::Object::HashIndexTrigger:
|
||||||
|
case NdbDictionary::Object::IndexTrigger:
|
||||||
|
case NdbDictionary::Object::SubscriptionTrigger:
|
||||||
|
case NdbDictionary::Object::ReadOnlyConstraint:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
g_ndb->setDatabaseName(db.c_str());
|
||||||
|
g_ndb->setSchemaName(schema.c_str());
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int load_table()
|
||||||
|
{
|
||||||
|
UtilTransactions clear(* g_table);
|
||||||
|
require(!clear.clearTable(g_ndb));
|
||||||
|
|
||||||
|
HugoOperations ops(* g_table);
|
||||||
|
require(!ops.startTransaction(g_ndb));
|
||||||
|
for(size_t i = 0; i<g_rows; i++){
|
||||||
|
g_cases[i] = g_ops[ i % OP_COUNT];
|
||||||
|
if(g_cases[i].start_row){
|
||||||
|
g_cases[i].curr_row = true;
|
||||||
|
g_cases[i].val = rand();
|
||||||
|
require(!ops.pkInsertRecord(g_ndb, i, 1, g_cases[i].val));
|
||||||
|
}
|
||||||
|
if((i+1) % 100 == 0){
|
||||||
|
require(!ops.execute_Commit(g_ndb));
|
||||||
|
require(!ops.getTransaction()->restart());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if((g_rows+1) % 100 != 0)
|
||||||
|
require(!ops.execute_Commit(g_ndb));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int pause_lcp()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int do_op(int row)
|
||||||
|
{
|
||||||
|
HugoOperations & ops = * g_hugo_ops;
|
||||||
|
if(strcmp(g_cases[row].op1, "INSERT") == 0){
|
||||||
|
require(!g_cases[row].curr_row);
|
||||||
|
g_cases[row].curr_row = true;
|
||||||
|
g_cases[row].val = rand();
|
||||||
|
require(!ops.pkInsertRecord(g_ndb, row, 1, g_cases[row].val));
|
||||||
|
} else if(strcmp(g_cases[row].op1, "UPDATE") == 0){
|
||||||
|
require(g_cases[row].curr_row);
|
||||||
|
g_cases[row].val = rand();
|
||||||
|
require(!ops.pkUpdateRecord(g_ndb, row, 1, g_cases[row].val));
|
||||||
|
} else if(strcmp(g_cases[row].op1, "DELETE") == 0){
|
||||||
|
require(g_cases[row].curr_row);
|
||||||
|
g_cases[row].curr_row = false;
|
||||||
|
require(!ops.pkDeleteRecord(g_ndb, row, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
require(!ops.execute_NoCommit(g_ndb));
|
||||||
|
|
||||||
|
if(g_cases[row].op2 == 0){
|
||||||
|
} else if(strcmp(g_cases[row].op2, "INSERT") == 0){
|
||||||
|
require(!g_cases[row].curr_row);
|
||||||
|
g_cases[row].curr_row = true;
|
||||||
|
g_cases[row].val = rand();
|
||||||
|
require(!ops.pkInsertRecord(g_ndb, row, 1, g_cases[row].val));
|
||||||
|
} else if(strcmp(g_cases[row].op2, "UPDATE") == 0){
|
||||||
|
require(g_cases[row].curr_row);
|
||||||
|
g_cases[row].val = rand();
|
||||||
|
require(!ops.pkUpdateRecord(g_ndb, row, 1, g_cases[row].val));
|
||||||
|
} else if(strcmp(g_cases[row].op2, "DELETE") == 0){
|
||||||
|
require(g_cases[row].curr_row);
|
||||||
|
g_cases[row].curr_row = false;
|
||||||
|
require(!ops.pkDeleteRecord(g_ndb, row, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(g_cases[row].op2 != 0)
|
||||||
|
require(!ops.execute_NoCommit(g_ndb));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int continue_lcp(int error)
|
||||||
|
{
|
||||||
|
error = 0;
|
||||||
|
if(g_restarter.insertErrorInAllNodes(error) == 0){
|
||||||
|
int args[] = { DumpStateOrd::DihStartLcpImmediately };
|
||||||
|
return g_restarter.dumpStateAllNodes(args, 1);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int commit()
|
||||||
|
{
|
||||||
|
HugoOperations & ops = * g_hugo_ops;
|
||||||
|
int res = ops.execute_Commit(g_ndb);
|
||||||
|
if(res == 0){
|
||||||
|
return ops.getTransaction()->restart();
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int restart()
|
||||||
|
{
|
||||||
|
g_info << "Restarting cluster" << endl;
|
||||||
|
disconnect_ndb();
|
||||||
|
delete g_hugo_ops;
|
||||||
|
|
||||||
|
require(!g_restarter.restartAll());
|
||||||
|
require(!g_restarter.waitClusterStarted(30));
|
||||||
|
require(!connect_ndb());
|
||||||
|
|
||||||
|
g_table = g_ndb->getDictionary()->getTable(g_tablename);
|
||||||
|
require(g_table);
|
||||||
|
require(g_hugo_ops = new HugoOperations(* g_table));
|
||||||
|
require(!g_hugo_ops->startTransaction(g_ndb));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int validate()
|
||||||
|
{
|
||||||
|
HugoOperations ops(* g_table);
|
||||||
|
for(size_t i = 0; i<g_rows; i++){
|
||||||
|
require(g_cases[i].curr_row == g_cases[i].end_row);
|
||||||
|
require(!ops.startTransaction(g_ndb));
|
||||||
|
ops.pkReadRecord(g_ndb, i, 1);
|
||||||
|
int res = ops.execute_Commit(g_ndb);
|
||||||
|
if(g_cases[i].curr_row){
|
||||||
|
require(res == 0 && ops.verifyUpdatesValue(g_cases[i].val) == 0);
|
||||||
|
} else {
|
||||||
|
require(res == 626);
|
||||||
|
}
|
||||||
|
ops.closeTransaction(g_ndb);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -859,6 +859,11 @@ void NDBT_TestSuite::execute(Ndb* ndb, const NdbDictionary::Table* pTab,
|
|||||||
else
|
else
|
||||||
numTestsOk++;
|
numTestsOk++;
|
||||||
numTestsExecuted++;
|
numTestsExecuted++;
|
||||||
|
|
||||||
|
if (result == NDBT_OK && createTable == true){
|
||||||
|
pDict->dropTable(pTab->getName());
|
||||||
|
}
|
||||||
|
|
||||||
delete ctx;
|
delete ctx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user