Commit 4d9cbaf3 authored by joerg@debian.(none)'s avatar joerg@debian.(none)

Fix a bad BitKeeper dependency structure for the "funcs_1" suite:

Step 2:
Restore the 5.1 contents in the 5.0-dependent files.
parent c80ced41
#### suite/funcs_1/cursors/cursors_master.test
let $message= NOT YET IMPLEMENTED: cursor tests;
--source include/show_msg80.inc
......@@ -3881,11 +3881,11 @@ let $message= Testcase 3.2.20.1:;
let $is_table= referential_constraints;
# when table is implemented remove this and the next 4 lines and "enable" 5th line:
# and don't forget to add the test description to QATestPlanV50func
let $message= checking a table that will be implemented later;
--source include/show_msg.inc
--error 1109
#let $message= checking a table that will be implemented later;
#--source include/show_msg.inc
#--error 1109
eval DESC $is_table;
#--source suite/funcs_1/datadict/datadict_show_table_design.inc
--source suite/funcs_1/datadict/datadict_show_table_design.inc
# -------------------------------------------------------------------------------------------------------
......
......@@ -58,5 +58,5 @@ eval $dd_part1 triggers $dd_part2;
--error 1109
eval $dd_part1 parameters $dd_part2;
--error 1109
--error 0,1109
eval $dd_part1 referential_constraints $dd_part2;
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -166,7 +166,7 @@ declare y integer default 1;
set @x = x;
set @y = y;
set @z = 234;
SELECT f1, f2 into @x, @y from t2 limit 1;
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
SELECT @x, @y, @z, invar;
BEGIN
set @x = 2;
......@@ -209,7 +209,7 @@ BEGIN
declare x integer; declare y integer;
set @x=x;
set @y=y;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT @x, @y;
END//
CALL sp1();
......@@ -544,6 +544,9 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
Warnings:
Note 1051 Unknown table 'tqq'
Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
......@@ -1084,7 +1087,8 @@ declare f2_value char(20);
declare f5_value char(20);
declare f4_value integer;
declare f6_value integer;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
where f4 >=-5000 order by f4 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
......@@ -1167,7 +1171,7 @@ of a compound statement ends.
DROP TABLE IF EXISTS temp1;
DROP PROCEDURE IF EXISTS sp1;
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
SELECT f1, f2, f4, f5 from t2;
SELECT f1, f2, f4, f5 from t2 order by f4;
f1 f2 f4 f5
a` a` -5000 a`
aaa aaa -4999 aaa
......@@ -1187,21 +1191,21 @@ declare newf1 char(20);
declare newf2 char(20);
declare newf5 char(20);
declare newf4 integer;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
open cur1;
open cur2;
BEGIN
declare continue handler for sqlstate '02000' set count = 1;
declare continue handler for sqlstate '02000' set count=1;
fetch cur1 into newf1, newf2, newf4, newf5;
SELECT '-1-', count, newf1, newf2, newf4, newf5;
insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
set count = 4;
set count= 4;
BEGIN
while count > 0 do
while count> 0 do
fetch cur1 into newf1, newf2, newf4, newf5;
SELECT '-2-', count, newf1, newf2, newf4, newf5;
set count = count - 1;
set count = count- 1;
END while;
SELECT '-3-', count, newf1, newf2, newf4, newf4;
END;
......@@ -1270,8 +1274,10 @@ declare i_newf11 char(20);
declare i_newf12 char(20);
declare i_newf13 date;
declare i_newf14 integer;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 3;
declare continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
......@@ -1302,8 +1308,10 @@ DECLARE o_newf11 CHAR(20);
DECLARE o_newf12 CHAR(20);
DECLARE o_newf13 DATE;
DECLARE o_newf14 INTEGER;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;
......
......@@ -80,7 +80,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
user_1@localhost db_storedproc
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
BEGIN
SELECT * FROM db_storedproc.t1 LIMIT 1;
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
END//
CREATE FUNCTION fn31105(n INT) RETURNS INT
BEGIN
......@@ -209,7 +209,7 @@ CALL sp_ins_1();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......@@ -226,7 +226,7 @@ CALL sp_ins_3();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......@@ -246,7 +246,7 @@ CALL sp_upd();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......@@ -279,7 +279,7 @@ COUNT( f1 ) f1
SELECT row_count();
row_count()
3
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......
......@@ -199,6 +199,9 @@ CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14';
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
insert into t1 (f2) values ('insert 3.5.1.7');
select * from t1;
f1 f2 f3
......@@ -207,12 +210,14 @@ update t1 set f2='update 3.5.1.7';
select * from t1;
f1 f2 f3
NULL update 3.5.1.7 42
select trigger_name from information_schema.triggers;
select trigger_name from information_schema.triggers order by trigger_name;
trigger_name
trg5_1
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
drop trigger trg5_1;
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
drop table t1;
Testcase 3.5.1.8:
......@@ -314,7 +319,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
select @test_var1, @test_var2, @test_var3;
@test_var1 @test_var2 @test_var3
trig1 trig2 trig3
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
......@@ -324,7 +329,7 @@ trig2 3
select * from trig_db3.t1;
f1 f2
trig3 4
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
......@@ -349,10 +354,10 @@ for each row set @test_var2='trig1_a';
create trigger trig_db2.trig2 before insert on trig_db2.t1
for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
trig_db1 trig1_b t1
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db2 trig2 t1
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
......
......@@ -93,18 +93,18 @@ Create trigger trg1 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.1';
Use db_drop;
Insert into t1 values ('Insert error 3.5.4.1');
Select * from t1;
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1;
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
Insert no trigger 3.5.4.1
Trigger 3.5.4.1
drop trigger trg1;
drop database if exists db_drop;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
......@@ -258,7 +258,7 @@ use dbtest_one;
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
Warnings:
Warning 1265 Data truncated for column 'f1' at row 1
Select * from dbtest_two.t2;
Select * from dbtest_two.t2 order by f1;
f1
1st Insert 3.5.
2nd Insert 3.5.
......
......@@ -139,10 +139,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i;
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u;
select * from db_test.t1_u order by u120;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
b 00222 0000023456 1.050000000000000000000000000000
......@@ -150,7 +150,7 @@ c 00333 0000099999 999.990000000000000000000000000000
d 00222 0000023456 1.050000000000000000000000000000
e 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
select * from db_test.t1_d;
select * from db_test.t1_d order by d120;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
......@@ -162,14 +162,22 @@ select @test_var;
3.5.8.4 - single SQL - insert
-----------------------------
Create trigger trg2 BEFORE UPDATE on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
END//
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
where f122='Test 3.5.8.4';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i;
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
I 00222 0000023456 1.050000000000000000000000000000
......@@ -186,14 +194,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u;
select * from db_test.t1_u order by u120;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
3.5.8.3/4 - single SQL - delete
-------------------------------
......@@ -206,7 +214,7 @@ f122='Test 3.5.8.4-Single Delete'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
select * from db_test.t1_d;
select * from db_test.t1_d order by d120;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
......@@ -253,29 +261,29 @@ END//
set @test_var='Empty', @test_var2=0;
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 one 2nd else
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 two 2nd else
D Test 3.5.8.5-if 00102 two 2nd else
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd if
D Test 3.5.8.5-if 00101 three 2nd if
D Test 3.5.8.5-if 00102 three 2nd if
d Test 3.5.8.5-if 00010 three 2nd if
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00101 three 2nd else
D Test 3.5.8.5-if 00102 three 2nd else
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00103 three 2nd else
create trigger trg3 before update on tb3 for each row
BEGIN
......@@ -335,20 +343,20 @@ set @test_var='Empty';
Insert into tb3 (f120, f122, f136, f144)
values ('a', 'Test 3.5.8.5-case', 5, 7);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 A*seven
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 C=one
B Test 3.5.8.5-case 00191 0000000016 C=one
......@@ -358,34 +366,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
create trigger trg3a before update on tb3 for each row
BEGIN
CASE
......
......@@ -120,7 +120,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
Insert into tb3 (f122, f136, f163)
values ('Test 3.5.9.3', 7, 123.17);
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
......@@ -136,7 +136,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
0 0 0 0 0
delete from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
......@@ -176,7 +176,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
Insert into tb3 (f122, f136, f151, f163)
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4%';
where f122 like 'Test 3.5.9.4%' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
......@@ -194,9 +194,9 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
Warnings:
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
Warning 1048 Column 'f136' cannot be null
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig';
where f122 like 'Test 3.5.9.4-trig' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4-trig 00000 999 NULL
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
......
......@@ -87,7 +87,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
Insert into vw11 (f122, f151) values ('Not in View', 3);
select f121, f122, f151, f163
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
......@@ -101,7 +101,7 @@ f121 f122 f151 f163
NULL Not in View 3 111.110000000000000000000000000000
Update vw11 set f163=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
......@@ -115,7 +115,7 @@ before delete
0
delete from vw11 where f151=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
select f121, f122, f151, f163 from vw11;
......@@ -146,7 +146,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Rows Loaded After
10
Select * from tb_load limit 10;
Select * from tb_load order by f1 limit 10;
f1 f2 f3
-5000 a` 1000
-4999 aaa 999
......@@ -241,7 +241,7 @@ insert into t3 (f1) values (new.f1+1000);
create trigger tr2_4 after insert on t2_4 for each row
insert into t3 (f1) values (new.f1+10000);
insert into t1 values (1);
select * from t3;
select * from t3 order by f1;
f1
12
102
......@@ -276,14 +276,14 @@ create trigger tr4 after insert on t4
for each row insert into t1 (f1) values (new.f4+1);
insert into t1 values (1);
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
select * from t1;
select * from t1 order by f1;
f1
0
select * from t2;
select * from t2 order by f2;
f2
select * from t3;
select * from t3 order by f3;
f3
select * from t4;
select * from t4 order by f4;
f4
drop trigger tr1;
drop trigger tr2;
......@@ -369,7 +369,7 @@ create table t4 (f4 tinyint) engine = innodb;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) default NULL
`f1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values (1);
create trigger tr1 after insert on t1
......@@ -381,14 +381,14 @@ for each row insert into t4 (f4) values (new.f3+1000);
set autocommit=0;
start transaction;
insert into t1 values (1);
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
ERROR 22003: Out of range value for column 'f4' at row 1
commit;
select * from t1;
select * from t1 order by f1;
f1
1
select * from t2;
select * from t2 order by f2;
f2
select * from t3;
select * from t3 order by f3;
f3
drop trigger tr1;
drop trigger tr2;
......
......@@ -116,7 +116,7 @@ insert into t1 values (3,'Department C');
insert into t2 values (1,2,'Emp 1');
insert into t2 values (2,3,'Emp 2');
insert into t2 values (3,4,'Emp 3');
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f_id`) REFERENCES `t1` (`id`) ON UPDATE CASCADE)
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f_id`) REFERENCES `t1` (`id`) ON UPDATE CASCADE)
create trigger tr_t2 before insert on t2 for each row
insert into t1 values(new.f_id, concat('New Department ', new.f_id));
lock tables t1 write, t2 write;
......
......@@ -1926,7 +1926,7 @@ f1 f2
2 two
4 four
INSERT INTO v1 VALUES(2,'two');
ERROR 23000: Duplicate entry '2' for key 1
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
INSERT INTO v1 VALUES(3,'three');
affected rows: 1
INSERT INTO v1 VALUES(6,'six');
......@@ -1945,7 +1945,7 @@ f1 f2
3 three
4 four
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
ERROR 23000: Duplicate entry '2' for key 1
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
......@@ -1992,12 +1992,12 @@ DROP VIEW IF EXISTS test.v1;
CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
ENGINE = innodb;
INSERT INTO t1 VALUES ('A', 1);
SELECT * FROM t1;
SELECT * FROM t1 order by f1, f2;
f1 f2
A 1
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
WITH CASCADED CHECK OPTION ;
SELECT * FROM v1;
SELECT * FROM v1 order by f1, f2;
f1 f2
A 1
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
......@@ -2005,7 +2005,7 @@ affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
INSERT INTO v1 VALUES('B',2);
affected rows: 1
SELECT * FROM v1;
SELECT * FROM v1 order by f1, f2;
f1 f2
A 2
B 2
......@@ -2013,7 +2013,7 @@ UPDATE v1 SET f2 = 4;
ERROR HY000: CHECK OPTION failed 'test.v1'
INSERT INTO v1 VALUES('B',3);
ERROR HY000: CHECK OPTION failed 'test.v1'
SELECT * FROM v1;
SELECT * FROM v1 order by f1, f2;
f1 f2
A 2
B 2
......@@ -10580,7 +10580,7 @@ f1 f2 f3 f4
DELETE FROM t1;
INSERT INTO v1 SET f2 = 'ABC';
INSERT INTO v1 SET f2 = 'ABC';
ERROR 23000: Duplicate entry '0' for key 1
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
SELECT * from t1;
f1 f2 f3 f4
0 ABC NULL NULL
......@@ -10649,7 +10649,7 @@ DROP VIEW v1;
CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
INSERT INTO v1 SET f2 = 'ABC';
INSERT INTO v1 SET f2 = 'ABC';
ERROR 23000: Duplicate entry '0' for key 1
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
SELECT * from t1;
f1 f2 f3 f4
0 ABC NULL NULL
......@@ -10984,11 +10984,11 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(5) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11008,12 +11008,12 @@ f4x char(5) YES NULL
report char(10) YES NULL
DESCRIBE v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4x report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
0 NULL ABC t1 1
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
......@@ -11031,14 +11031,14 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(10) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
0 NULL ABC t1 1
2 NULL <-- 10 --> t1 2
2 NULL <-- 10 --> v1 2
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11067,7 +11067,7 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(8) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11076,7 +11076,7 @@ f1 f2 f4 report
2 NULL <-- 10 - v1 2
3 NULL <-- 10 - t1 3
3 NULL <-- 10 - v1 3
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11100,7 +11100,7 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11111,7 +11111,7 @@ f1 f2 f4 report
3 NULL <-- 10 - v1 3
4 NULL <------ 20 --------> t1 4
4 NULL <------ 20 --------> v1 4
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11139,7 +11139,7 @@ f1 varchar(30) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11152,7 +11152,7 @@ f1 f2 f4 report
4 NULL <------ 20 --------> v1 4
<------------- 30 -----------> NULL <------ 20 --------> t1 5
<------------- 30 -----------> NULL <------ 20 --------> v1 5
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11176,7 +11176,7 @@ f4 varchar(20) YES NULL
report char(10) YES NULL
DESCRIBE v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report
-1 ABC t1 0
-1 ABC v1 0
......@@ -11190,7 +11190,7 @@ f1 f4 report
<------------- 30 -----------> <------ 20 --------> t1 5
<------------- 30 -----------> <------ 20 --------> v1 5
ABC <------ 20 --------> t1 6
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
......@@ -11209,7 +11209,7 @@ f1 varchar(30) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report f2
-1 ABC t1 0 NULL
-1 ABC v1 0 NULL
......@@ -11225,7 +11225,7 @@ f1 f4 report f2
ABC <------ 20 --------> t1 6 NULL
ABC <------ 20 --------> t1 7 1500-12-04
ABC <------ 20 --------> v1 7 1500-12-04
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11259,7 +11259,7 @@ f1 varchar(30) YES NULL
f2 float YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report f2
-1 ABC t1 0 NULL
-1 ABC v1 0 NULL
......@@ -11274,10 +11274,10 @@ f1 f4 report f2
<------------- 30 -----------> <------ 20 --------> v1 5 NULL
ABC <------ 20 --------> t1 6 NULL
ABC <------ 20 --------> t1 7 NULL
ABC <------ 20 --------> v1 7 NULL
ABC <------ 20 --------> t1 8 -0.00033
ABC <------ 20 --------> v1 7 NULL
ABC <------ 20 --------> v1 8 -0.00033
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11292,8 +11292,8 @@ f1 f2 f4 report
<------------- 30 -----------> NULL <------ 20 --------> v1 5
ABC NULL <------ 20 --------> t1 6
ABC NULL <------ 20 --------> t1 7
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> v1 8
ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
......@@ -11316,7 +11316,7 @@ f1 varchar(30) YES NULL
f2 float YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report f2 f3
-1 ABC t1 0 NULL NULL
-1 ABC v1 0 NULL NULL
......@@ -11331,12 +11331,12 @@ f1 f4 report f2 f3
<------------- 30 -----------> <------ 20 --------> v1 5 NULL NULL
ABC <------ 20 --------> t1 6 NULL NULL
ABC <------ 20 --------> t1 7 NULL NULL
ABC <------ 20 --------> v1 7 NULL NULL
ABC <------ 20 --------> t1 8 -0.00033 NULL
ABC <------ 20 --------> v1 8 -0.00033 NULL
ABC <------ 20 --------> t1 9 -0.00033 -2.20
ABC <------ 20 --------> v1 7 NULL NULL
ABC <------ 20 --------> v1 8 -0.00033 NULL
ABC <------ 20 --------> v1 9a -0.00033 NULL
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11351,10 +11351,10 @@ f1 f2 f4 report
<------------- 30 -----------> NULL <------ 20 --------> v1 5
ABC NULL <------ 20 --------> t1 6
ABC NULL <------ 20 --------> t1 7
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
ABC -0.00033 <------ 20 --------> v1 8
ABC -0.00033 <------ 20 --------> t1 9
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> v1 8
ABC -0.00033 <------ 20 --------> v1 9a
DROP TABLE t1;
DROP VIEW v1;
......@@ -11369,10 +11369,10 @@ DESCRIBE v1;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, f2;
f1 f2
ABC 3
SELECT * FROM v1;
SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 1.7320508075689
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
......@@ -11385,21 +11385,21 @@ DESCRIBE v1;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, f2;
f1 f2
ABC 3
ABC DEF
SELECT * FROM v1;
SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 1.7320508075689
ABC 0
ABC 1.7320508075689
SELECT SQRT('DEF');
SQRT('DEF')
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
CREATE VIEW v2 AS SELECT SQRT('DEF');
SELECT * FROM v2;
SELECT * FROM v2 order by 1;
SQRT('DEF')
0
Warnings:
......@@ -11409,27 +11409,27 @@ DESCRIBE v2;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM v2;
SELECT * FROM v2 order by 2;
f1 my_sqrt
ABC 1.7320508075689
ABC 0
ABC 1.7320508075689
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
SELECT * FROM t2;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
ABC 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
SELECT * FROM t2;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
ABC 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
SELECT * FROM t2;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
ABC 1.73205080756888
DROP TABLE t1;
DROP TABLE t2;
DROP VIEW v1;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -166,7 +166,7 @@ declare y integer default 1;
set @x = x;
set @y = y;
set @z = 234;
SELECT f1, f2 into @x, @y from t2 limit 1;
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
SELECT @x, @y, @z, invar;
BEGIN
set @x = 2;
......@@ -209,7 +209,7 @@ BEGIN
declare x integer; declare y integer;
set @x=x;
set @y=y;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT @x, @y;
END//
CALL sp1();
......@@ -544,6 +544,9 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
Warnings:
Note 1051 Unknown table 'tqq'
Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
......@@ -1084,7 +1087,8 @@ declare f2_value char(20);
declare f5_value char(20);
declare f4_value integer;
declare f6_value integer;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
where f4 >=-5000 order by f4 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
......@@ -1167,7 +1171,7 @@ of a compound statement ends.
DROP TABLE IF EXISTS temp1;
DROP PROCEDURE IF EXISTS sp1;
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
SELECT f1, f2, f4, f5 from t2;
SELECT f1, f2, f4, f5 from t2 order by f4;
f1 f2 f4 f5
a` a` -5000 a`
aaa aaa -4999 aaa
......@@ -1187,21 +1191,21 @@ declare newf1 char(20);
declare newf2 char(20);
declare newf5 char(20);
declare newf4 integer;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
open cur1;
open cur2;
BEGIN
declare continue handler for sqlstate '02000' set count = 1;
declare continue handler for sqlstate '02000' set count=1;
fetch cur1 into newf1, newf2, newf4, newf5;
SELECT '-1-', count, newf1, newf2, newf4, newf5;
insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
set count = 4;
set count= 4;
BEGIN
while count > 0 do
while count> 0 do
fetch cur1 into newf1, newf2, newf4, newf5;
SELECT '-2-', count, newf1, newf2, newf4, newf5;
set count = count - 1;
set count = count- 1;
END while;
SELECT '-3-', count, newf1, newf2, newf4, newf4;
END;
......@@ -1270,8 +1274,10 @@ declare i_newf11 char(20);
declare i_newf12 char(20);
declare i_newf13 date;
declare i_newf14 integer;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 3;
declare continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
......@@ -1302,8 +1308,10 @@ DECLARE o_newf11 CHAR(20);
DECLARE o_newf12 CHAR(20);
DECLARE o_newf13 DATE;
DECLARE o_newf14 INTEGER;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;
......
......@@ -80,7 +80,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
user_1@localhost db_storedproc
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
BEGIN
SELECT * FROM db_storedproc.t1 LIMIT 1;
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
END//
CREATE FUNCTION fn31105(n INT) RETURNS INT
BEGIN
......@@ -209,7 +209,7 @@ CALL sp_ins_1();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......@@ -226,7 +226,7 @@ CALL sp_ins_3();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......@@ -246,7 +246,7 @@ CALL sp_upd();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......@@ -279,7 +279,7 @@ COUNT( f1 ) f1
SELECT row_count();
row_count()
3
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......
......@@ -195,6 +195,9 @@ CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14';
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
insert into t1 (f2) values ('insert 3.5.1.7');
select * from t1;
f1 f2 f3
......@@ -203,12 +206,14 @@ update t1 set f2='update 3.5.1.7';
select * from t1;
f1 f2 f3
NULL update 3.5.1.7 42
select trigger_name from information_schema.triggers;
select trigger_name from information_schema.triggers order by trigger_name;
trigger_name
trg5_1
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
drop trigger trg5_1;
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
drop table t1;
Testcase 3.5.1.8:
......@@ -310,7 +315,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
select @test_var1, @test_var2, @test_var3;
@test_var1 @test_var2 @test_var3
trig1 trig2 trig3
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
......@@ -320,7 +325,7 @@ trig2 3
select * from trig_db3.t1;
f1 f2
trig3 4
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
......@@ -345,10 +350,10 @@ for each row set @test_var2='trig1_a';
create trigger trig_db2.trig2 before insert on trig_db2.t1
for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
trig_db1 trig1_b t1
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db2 trig2 t1
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
......
......@@ -89,18 +89,18 @@ Create trigger trg1 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.1';
Use db_drop;
Insert into t1 values ('Insert error 3.5.4.1');
Select * from t1;
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1;
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
Insert no trigger 3.5.4.1
Trigger 3.5.4.1
drop trigger trg1;
drop database if exists db_drop;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
......@@ -254,7 +254,7 @@ use dbtest_one;
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
Warnings:
Warning 1265 Data truncated for column 'f1' at row 1
Select * from dbtest_two.t2;
Select * from dbtest_two.t2 order by f1;
f1
1st Insert 3.5.
2nd Insert 3.5.
......
......@@ -135,10 +135,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i;
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u;
select * from db_test.t1_u order by u120;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
b 00222 0000023456 1.050000000000000000000000000000
......@@ -146,7 +146,7 @@ c 00333 0000099999 999.990000000000000000000000000000
d 00222 0000023456 1.050000000000000000000000000000
e 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
select * from db_test.t1_d;
select * from db_test.t1_d order by d120;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
......@@ -158,14 +158,22 @@ select @test_var;
3.5.8.4 - single SQL - insert
-----------------------------
Create trigger trg2 BEFORE UPDATE on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
END//
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
where f122='Test 3.5.8.4';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i;
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
I 00222 0000023456 1.050000000000000000000000000000
......@@ -182,14 +190,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u;
select * from db_test.t1_u order by u120;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
3.5.8.3/4 - single SQL - delete
-------------------------------
......@@ -202,7 +210,7 @@ f122='Test 3.5.8.4-Single Delete'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
select * from db_test.t1_d;
select * from db_test.t1_d order by d120;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
......@@ -249,29 +257,29 @@ END//
set @test_var='Empty', @test_var2=0;
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 one 2nd else
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 two 2nd else
D Test 3.5.8.5-if 00102 two 2nd else
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd if
D Test 3.5.8.5-if 00101 three 2nd if
D Test 3.5.8.5-if 00102 three 2nd if
d Test 3.5.8.5-if 00010 three 2nd if
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00101 three 2nd else
D Test 3.5.8.5-if 00102 three 2nd else
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00103 three 2nd else
create trigger trg3 before update on tb3 for each row
BEGIN
......@@ -331,20 +339,20 @@ set @test_var='Empty';
Insert into tb3 (f120, f122, f136, f144)
values ('a', 'Test 3.5.8.5-case', 5, 7);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 A*seven
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 C=one
B Test 3.5.8.5-case 00191 0000000016 C=one
......@@ -354,34 +362,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
create trigger trg3a before update on tb3 for each row
BEGIN
CASE
......
......@@ -116,7 +116,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
Insert into tb3 (f122, f136, f163)
values ('Test 3.5.9.3', 7, 123.17);
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
......@@ -132,7 +132,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
0 0 0 0 0
delete from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
......@@ -172,7 +172,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
Insert into tb3 (f122, f136, f151, f163)
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4%';
where f122 like 'Test 3.5.9.4%' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
......@@ -190,9 +190,9 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
Warnings:
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
Warning 1048 Column 'f136' cannot be null
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig';
where f122 like 'Test 3.5.9.4-trig' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4-trig 00000 999 NULL
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
......
......@@ -83,7 +83,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
Insert into vw11 (f122, f151) values ('Not in View', 3);
select f121, f122, f151, f163
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
......@@ -97,7 +97,7 @@ f121 f122 f151 f163
NULL Not in View 3 111.110000000000000000000000000000
Update vw11 set f163=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
......@@ -111,7 +111,7 @@ before delete
0
delete from vw11 where f151=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
select f121, f122, f151, f163 from vw11;
......@@ -142,7 +142,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Rows Loaded After
10
Select * from tb_load limit 10;
Select * from tb_load order by f1 limit 10;
f1 f2 f3
-5000 a` 1000
-4999 aaa 999
......@@ -237,7 +237,7 @@ insert into t3 (f1) values (new.f1+1000);
create trigger tr2_4 after insert on t2_4 for each row
insert into t3 (f1) values (new.f1+10000);
insert into t1 values (1);
select * from t3;
select * from t3 order by f1;
f1
12
102
......@@ -272,17 +272,17 @@ create trigger tr4 after insert on t4
for each row insert into t1 (f1) values (new.f4+1);
insert into t1 values (1);
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
select * from t1;
select * from t1 order by f1;
f1
0
1
select * from t2;
select * from t2 order by f2;
f2
2
select * from t3;
select * from t3 order by f3;
f3
3
select * from t4;
select * from t4 order by f4;
f4
4
drop trigger tr1;
......@@ -369,7 +369,7 @@ create table t4 (f4 tinyint) engine = memory;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) default NULL
`f1` int(11) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1
insert into t1 values (1);
create trigger tr1 after insert on t1
......@@ -381,16 +381,16 @@ for each row insert into t4 (f4) values (new.f3+1000);
set autocommit=0;
start transaction;
insert into t1 values (1);
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
ERROR 22003: Out of range value for column 'f4' at row 1
commit;
select * from t1;
select * from t1 order by f1;
f1
1
1
select * from t2;
select * from t2 order by f2;
f2
2
select * from t3;
select * from t3 order by f3;
f3
3
drop trigger tr1;
......
......@@ -1930,7 +1930,7 @@ f1 f2
2 two
4 four
INSERT INTO v1 VALUES(2,'two');
ERROR 23000: Duplicate entry '2' for key 1
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
INSERT INTO v1 VALUES(3,'three');
affected rows: 1
INSERT INTO v1 VALUES(6,'six');
......@@ -1949,7 +1949,7 @@ f1 f2
3 three
4 four
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
ERROR 23000: Duplicate entry '2' for key 1
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
......@@ -1997,12 +1997,12 @@ DROP VIEW IF EXISTS test.v1;
CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
ENGINE = memory;
INSERT INTO t1 VALUES ('A', 1);
SELECT * FROM t1;
SELECT * FROM t1 order by f1, f2;
f1 f2
A 1
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
WITH CASCADED CHECK OPTION ;
SELECT * FROM v1;
SELECT * FROM v1 order by f1, f2;
f1 f2
A 1
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
......@@ -2010,7 +2010,7 @@ affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
INSERT INTO v1 VALUES('B',2);
affected rows: 1
SELECT * FROM v1;
SELECT * FROM v1 order by f1, f2;
f1 f2
A 2
B 2
......@@ -2018,7 +2018,7 @@ UPDATE v1 SET f2 = 4;
ERROR HY000: CHECK OPTION failed 'test.v1'
INSERT INTO v1 VALUES('B',3);
ERROR HY000: CHECK OPTION failed 'test.v1'
SELECT * FROM v1;
SELECT * FROM v1 order by f1, f2;
f1 f2
A 2
B 2
......@@ -10585,7 +10585,7 @@ f1 f2 f3 f4
DELETE FROM t1;
INSERT INTO v1 SET f2 = 'ABC';
INSERT INTO v1 SET f2 = 'ABC';
ERROR 23000: Duplicate entry '0' for key 1
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
SELECT * from t1;
f1 f2 f3 f4
0 ABC NULL NULL
......@@ -10654,7 +10654,7 @@ DROP VIEW v1;
CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
INSERT INTO v1 SET f2 = 'ABC';
INSERT INTO v1 SET f2 = 'ABC';
ERROR 23000: Duplicate entry '0' for key 1
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
SELECT * from t1;
f1 f2 f3 f4
0 ABC NULL NULL
......@@ -10989,11 +10989,11 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(5) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11013,12 +11013,12 @@ f4x char(5) YES NULL
report char(10) YES NULL
DESCRIBE v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4x report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
0 NULL ABC t1 1
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
......@@ -11036,14 +11036,14 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(10) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
0 NULL ABC t1 1
2 NULL <-- 10 --> t1 2
2 NULL <-- 10 --> v1 2
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11072,7 +11072,7 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(8) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11081,7 +11081,7 @@ f1 f2 f4 report
2 NULL <-- 10 - v1 2
3 NULL <-- 10 - t1 3
3 NULL <-- 10 - v1 3
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11105,7 +11105,7 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11116,7 +11116,7 @@ f1 f2 f4 report
3 NULL <-- 10 - v1 3
4 NULL <------ 20 --------> t1 4
4 NULL <------ 20 --------> v1 4
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11144,7 +11144,7 @@ f1 varchar(30) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11157,7 +11157,7 @@ f1 f2 f4 report
4 NULL <------ 20 --------> v1 4
<------------- 30 -----------> NULL <------ 20 --------> t1 5
<------------- 30 -----------> NULL <------ 20 --------> v1 5
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11181,7 +11181,7 @@ f4 varchar(20) YES NULL
report char(10) YES NULL
DESCRIBE v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report
-1 ABC t1 0
-1 ABC v1 0
......@@ -11195,7 +11195,7 @@ f1 f4 report
<------------- 30 -----------> <------ 20 --------> t1 5
<------------- 30 -----------> <------ 20 --------> v1 5
ABC <------ 20 --------> t1 6
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
......@@ -11214,7 +11214,7 @@ f1 varchar(30) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report f2
-1 ABC t1 0 NULL
-1 ABC v1 0 NULL
......@@ -11230,7 +11230,7 @@ f1 f4 report f2
ABC <------ 20 --------> t1 6 NULL
ABC <------ 20 --------> t1 7 1500-12-04
ABC <------ 20 --------> v1 7 1500-12-04
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11264,7 +11264,7 @@ f1 varchar(30) YES NULL
f2 float YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report f2
-1 ABC t1 0 NULL
-1 ABC v1 0 NULL
......@@ -11279,10 +11279,10 @@ f1 f4 report f2
<------------- 30 -----------> <------ 20 --------> v1 5 NULL
ABC <------ 20 --------> t1 6 NULL
ABC <------ 20 --------> t1 7 NULL
ABC <------ 20 --------> v1 7 NULL
ABC <------ 20 --------> t1 8 -0.00033
ABC <------ 20 --------> v1 7 NULL
ABC <------ 20 --------> v1 8 -0.00033
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11297,8 +11297,8 @@ f1 f2 f4 report
<------------- 30 -----------> NULL <------ 20 --------> v1 5
ABC NULL <------ 20 --------> t1 6
ABC NULL <------ 20 --------> t1 7
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> v1 8
ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
......@@ -11321,7 +11321,7 @@ f1 varchar(30) YES NULL
f2 float YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report f2 f3
-1 ABC t1 0 NULL NULL
-1 ABC v1 0 NULL NULL
......@@ -11336,12 +11336,12 @@ f1 f4 report f2 f3
<------------- 30 -----------> <------ 20 --------> v1 5 NULL NULL
ABC <------ 20 --------> t1 6 NULL NULL
ABC <------ 20 --------> t1 7 NULL NULL
ABC <------ 20 --------> v1 7 NULL NULL
ABC <------ 20 --------> t1 8 -0.00033 NULL
ABC <------ 20 --------> v1 8 -0.00033 NULL
ABC <------ 20 --------> t1 9 -0.00033 -2.20
ABC <------ 20 --------> v1 7 NULL NULL
ABC <------ 20 --------> v1 8 -0.00033 NULL
ABC <------ 20 --------> v1 9a -0.00033 NULL
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
......@@ -11356,10 +11356,10 @@ f1 f2 f4 report
<------------- 30 -----------> NULL <------ 20 --------> v1 5
ABC NULL <------ 20 --------> t1 6
ABC NULL <------ 20 --------> t1 7
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
ABC -0.00033 <------ 20 --------> v1 8
ABC -0.00033 <------ 20 --------> t1 9
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> v1 8
ABC -0.00033 <------ 20 --------> v1 9a
DROP TABLE t1;
DROP VIEW v1;
......@@ -11374,10 +11374,10 @@ DESCRIBE v1;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, f2;
f1 f2
ABC 3
SELECT * FROM v1;
SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 1.7320508075689
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
......@@ -11390,21 +11390,21 @@ DESCRIBE v1;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, f2;
f1 f2
ABC 3
ABC DEF
SELECT * FROM v1;
SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 1.7320508075689
ABC 0
ABC 1.7320508075689
SELECT SQRT('DEF');
SQRT('DEF')
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
CREATE VIEW v2 AS SELECT SQRT('DEF');
SELECT * FROM v2;
SELECT * FROM v2 order by 1;
SQRT('DEF')
0
Warnings:
......@@ -11414,27 +11414,27 @@ DESCRIBE v2;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM v2;
SELECT * FROM v2 order by 2;
f1 my_sqrt
ABC 1.7320508075689
ABC 0
ABC 1.7320508075689
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
SELECT * FROM t2;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
ABC 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
SELECT * FROM t2;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
ABC 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
SELECT * FROM t2;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
ABC 1.73205080756888
DROP TABLE t1;
DROP TABLE t2;
DROP VIEW v1;
......
......@@ -166,7 +166,7 @@ declare y integer default 1;
set @x = x;
set @y = y;
set @z = 234;
SELECT f1, f2 into @x, @y from t2 limit 1;
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
SELECT @x, @y, @z, invar;
BEGIN
set @x = 2;
......@@ -209,7 +209,7 @@ BEGIN
declare x integer; declare y integer;
set @x=x;
set @y=y;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT @x, @y;
END//
CALL sp1();
......@@ -544,6 +544,9 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
Warnings:
Note 1051 Unknown table 'tqq'
Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
......@@ -1084,7 +1087,8 @@ declare f2_value char(20);
declare f5_value char(20);
declare f4_value integer;
declare f6_value integer;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
where f4 >=-5000 order by f4 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
......@@ -1167,7 +1171,7 @@ of a compound statement ends.
DROP TABLE IF EXISTS temp1;
DROP PROCEDURE IF EXISTS sp1;
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
SELECT f1, f2, f4, f5 from t2;
SELECT f1, f2, f4, f5 from t2 order by f4;
f1 f2 f4 f5
a` a` -5000 a`
aaa aaa -4999 aaa
......@@ -1187,21 +1191,21 @@ declare newf1 char(20);
declare newf2 char(20);
declare newf5 char(20);
declare newf4 integer;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
open cur1;
open cur2;
BEGIN
declare continue handler for sqlstate '02000' set count = 1;
declare continue handler for sqlstate '02000' set count=1;
fetch cur1 into newf1, newf2, newf4, newf5;
SELECT '-1-', count, newf1, newf2, newf4, newf5;
insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
set count = 4;
set count= 4;
BEGIN
while count > 0 do
while count> 0 do
fetch cur1 into newf1, newf2, newf4, newf5;
SELECT '-2-', count, newf1, newf2, newf4, newf5;
set count = count - 1;
set count = count- 1;
END while;
SELECT '-3-', count, newf1, newf2, newf4, newf4;
END;
......@@ -1270,8 +1274,10 @@ declare i_newf11 char(20);
declare i_newf12 char(20);
declare i_newf13 date;
declare i_newf14 integer;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 3;
declare continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
......@@ -1302,8 +1308,10 @@ DECLARE o_newf11 CHAR(20);
DECLARE o_newf12 CHAR(20);
DECLARE o_newf13 DATE;
DECLARE o_newf14 INTEGER;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;
......
......@@ -80,7 +80,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
user_1@localhost db_storedproc
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
BEGIN
SELECT * FROM db_storedproc.t1 LIMIT 1;
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
END//
CREATE FUNCTION fn31105(n INT) RETURNS INT
BEGIN
......@@ -209,7 +209,7 @@ CALL sp_ins_1();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......@@ -226,7 +226,7 @@ CALL sp_ins_3();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......@@ -246,7 +246,7 @@ CALL sp_upd();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......@@ -279,7 +279,7 @@ COUNT( f1 ) f1
SELECT row_count();
row_count()
3
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
f1 f2 f3 f4 f5 f6
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
......
......@@ -199,6 +199,9 @@ CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14';
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
insert into t1 (f2) values ('insert 3.5.1.7');
select * from t1;
f1 f2 f3
......@@ -207,12 +210,14 @@ update t1 set f2='update 3.5.1.7';
select * from t1;
f1 f2 f3
NULL update 3.5.1.7 42
select trigger_name from information_schema.triggers;
select trigger_name from information_schema.triggers order by trigger_name;
trigger_name
trg5_1
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
drop trigger trg5_1;
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
drop table t1;
Testcase 3.5.1.8:
......@@ -314,7 +319,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
select @test_var1, @test_var2, @test_var3;
@test_var1 @test_var2 @test_var3
trig1 trig2 trig3
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
......@@ -324,7 +329,7 @@ trig2 3
select * from trig_db3.t1;
f1 f2
trig3 4
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
......@@ -349,10 +354,10 @@ for each row set @test_var2='trig1_a';
create trigger trig_db2.trig2 before insert on trig_db2.t1
for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
trig_db1 trig1_b t1
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db2 trig2 t1
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
......
......@@ -93,18 +93,18 @@ Create trigger trg1 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.1';
Use db_drop;
Insert into t1 values ('Insert error 3.5.4.1');
Select * from t1;
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1;
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
Insert no trigger 3.5.4.1
Trigger 3.5.4.1
drop trigger trg1;
drop database if exists db_drop;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
......@@ -258,7 +258,7 @@ use dbtest_one;
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
Warnings:
Warning 1265 Data truncated for column 'f1' at row 1
Select * from dbtest_two.t2;
Select * from dbtest_two.t2 order by f1;
f1
1st Insert 3.5.
2nd Insert 3.5.
......
......@@ -139,10 +139,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i;
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u;
select * from db_test.t1_u order by u120;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
b 00222 0000023456 1.050000000000000000000000000000
......@@ -150,7 +150,7 @@ c 00333 0000099999 999.990000000000000000000000000000
d 00222 0000023456 1.050000000000000000000000000000
e 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
select * from db_test.t1_d;
select * from db_test.t1_d order by d120;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
......@@ -162,14 +162,22 @@ select @test_var;
3.5.8.4 - single SQL - insert
-----------------------------
Create trigger trg2 BEFORE UPDATE on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
END//
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
where f122='Test 3.5.8.4';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i;
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
I 00222 0000023456 1.050000000000000000000000000000
......@@ -186,14 +194,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u;
select * from db_test.t1_u order by u120;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
3.5.8.3/4 - single SQL - delete
-------------------------------
......@@ -206,7 +214,7 @@ f122='Test 3.5.8.4-Single Delete'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
select * from db_test.t1_d;
select * from db_test.t1_d order by d120;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
......@@ -253,29 +261,29 @@ END//
set @test_var='Empty', @test_var2=0;
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 one 2nd else
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 two 2nd else
D Test 3.5.8.5-if 00102 two 2nd else
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd if
D Test 3.5.8.5-if 00101 three 2nd if
D Test 3.5.8.5-if 00102 three 2nd if
d Test 3.5.8.5-if 00010 three 2nd if
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00101 three 2nd else
D Test 3.5.8.5-if 00102 three 2nd else
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00103 three 2nd else
create trigger trg3 before update on tb3 for each row
BEGIN
......@@ -335,20 +343,20 @@ set @test_var='Empty';
Insert into tb3 (f120, f122, f136, f144)
values ('a', 'Test 3.5.8.5-case', 5, 7);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 A*seven
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 C=one
B Test 3.5.8.5-case 00191 0000000016 C=one
......@@ -358,34 +366,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
create trigger trg3a before update on tb3 for each row
BEGIN
CASE
......
......@@ -120,7 +120,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
Insert into tb3 (f122, f136, f163)
values ('Test 3.5.9.3', 7, 123.17);
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
......@@ -136,7 +136,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
0 0 0 0 0
delete from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
......@@ -176,7 +176,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
Insert into tb3 (f122, f136, f151, f163)
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4%';
where f122 like 'Test 3.5.9.4%' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
......@@ -194,9 +194,9 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
Warnings:
Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'f136' at row 11
Warning 1048 Column 'f136' cannot be null
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig';
where f122 like 'Test 3.5.9.4-trig' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4-trig 00000 999 NULL
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
......
......@@ -87,7 +87,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
Insert into vw11 (f122, f151) values ('Not in View', 3);
select f121, f122, f151, f163
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
......@@ -101,7 +101,7 @@ f121 f122 f151 f163
NULL Not in View 3 111.110000000000000000000000000000
Update vw11 set f163=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
......@@ -115,7 +115,7 @@ before delete
0
delete from vw11 where f151=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
select f121, f122, f151, f163 from vw11;
......@@ -146,7 +146,7 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Rows Loaded After
10
Select * from tb_load limit 10;
Select * from tb_load order by f1 limit 10;
f1 f2 f3
-5000 a` 1000
-4999 aaa 999
......@@ -241,7 +241,7 @@ insert into t3 (f1) values (new.f1+1000);
create trigger tr2_4 after insert on t2_4 for each row
insert into t3 (f1) values (new.f1+10000);
insert into t1 values (1);
select * from t3;
select * from t3 order by f1;
f1
12
102
......@@ -276,17 +276,17 @@ create trigger tr4 after insert on t4
for each row insert into t1 (f1) values (new.f4+1);
insert into t1 values (1);
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
select * from t1;
select * from t1 order by f1;
f1
0
1
select * from t2;
select * from t2 order by f2;
f2
2
select * from t3;
select * from t3 order by f3;
f3
3
select * from t4;
select * from t4 order by f4;
f4
4
drop trigger tr1;
......@@ -373,7 +373,7 @@ create table t4 (f4 tinyint) engine = myisam;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) default NULL
`f1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (1);
create trigger tr1 after insert on t1
......@@ -385,16 +385,16 @@ for each row insert into t4 (f4) values (new.f3+1000);
set autocommit=0;
start transaction;
insert into t1 values (1);
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
ERROR 22003: Out of range value for column 'f4' at row 1
commit;
select * from t1;
select * from t1 order by f1;
f1
1
1
select * from t2;
select * from t2 order by f2;
f2
2
select * from t3;
select * from t3 order by f3;
f3
3
drop trigger tr1;
......
......@@ -209,7 +209,7 @@ BEGIN
set @x = x;
set @y = y;
set @z = 234;
SELECT f1, f2 into @x, @y from t2 limit 1;
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
SELECT @x, @y, @z, invar;
BEGIN
set @x = 2;
......@@ -257,7 +257,7 @@ BEGIN
declare x integer; declare y integer;
set @x=x;
set @y=y;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT @x, @y;
END//
delimiter ;//
......@@ -1271,7 +1271,8 @@ BEGIN
declare f5_value char(20);
declare f4_value integer;
declare f6_value integer;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
where f4 >=-5000 order by f4 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
......@@ -1368,7 +1369,7 @@ create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) )
#Error: 1329 SQLSTATE: 02000 (ER_SP_FETCH_NO_DATA) Message: No data to FETCH
SELECT f1, f2, f4, f5 from t2;
SELECT f1, f2, f4, f5 from t2 order by f4;
delimiter //;
CREATE PROCEDURE sp1( )
......@@ -1379,21 +1380,21 @@ BEGIN
declare newf2 char(20);
declare newf5 char(20);
declare newf4 integer;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
open cur1;
open cur2;
BEGIN
declare continue handler for sqlstate '02000' set count = 1;
declare continue handler for sqlstate '02000' set count=1;
fetch cur1 into newf1, newf2, newf4, newf5;
SELECT '-1-', count, newf1, newf2, newf4, newf5;
insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
set count = 4;
set count= 4;
BEGIN
while count > 0 do
while count> 0 do
fetch cur1 into newf1, newf2, newf4, newf5;
SELECT '-2-', count, newf1, newf2, newf4, newf5;
set count = count - 1;
set count = count- 1;
END while;
SELECT '-3-', count, newf1, newf2, newf4, newf4;
END;
......@@ -1453,8 +1454,10 @@ BEGIN
declare i_newf12 char(20);
declare i_newf13 date;
declare i_newf14 integer;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 3;
declare continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
......@@ -1486,8 +1489,10 @@ BEGIN
DECLARE o_newf12 CHAR(20);
DECLARE o_newf13 DATE;
DECLARE o_newf14 INTEGER;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;
......
......@@ -54,7 +54,7 @@ connect (user2_1, localhost, user_1, , db_storedproc);
delimiter //;
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
BEGIN
SELECT * FROM db_storedproc.t1 LIMIT 1;
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
END//
delimiter ;//
......@@ -244,21 +244,21 @@ delimiter ;//
CALL sp_ins_1();
SELECT row_count();
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
CALL sp_ins_3();
#FIXME: check is 1 correct here? I expect 3 for 3 inserted rows inside the procedure
SELECT row_count();
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
CALL sp_upd();
SELECT row_count();
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
#FIXME: check is 3 correct here? I expect 7 for 4 inserted and then 3 updated rows inside the procedure
CALL sp_ins_upd();
SELECT row_count();
SELECT * FROM temp;
SELECT * FROM temp ORDER BY f4;
# cleanup
DROP PROCEDURE sp_ins_1;
......
......@@ -6,19 +6,16 @@ let $message= .
. IMPORTANT NOTICE:
. -----------------
.
. FIXME: The <engine>_storedproc.result files are still NOT CHECKED
. for correctness!
. FIXME: The .result files are still NOT CHECKED for correctness!
.
. FIXME: Several tests are affected by known problems around DECIMAL
. FIXME: and NUMERIC that needs to be checked again after WL#2984
. FIXME: and NUMERIC that will be checked again after WL#2984 once
. FIXME: has been completed. Some of them are marked in the result.
.
. This .result file has been checked OK with Linux 5.0.23-bk,
. ChangeSet@1.2211, 2006-06-28 10:11:43-07:00.
.
. This file has been saved although it might contain failures / wrong
. results to be able to detect _new_ differences in the behaviour.
. Hopefully the remaining checks can be made soon.
. Currently (Dec 06, 2005) this .result file is checked OK for Linux
. with 5.0.17-bk (ChangeSet@1.1975.1.2, 2005-12-05 18:33:48+01:00).
. Using the available Windows version 5.0.16 there are differences
. that can be ignored (e.g. WL#2984).
.;
--source include/show_msg80.inc
......@@ -914,7 +911,7 @@ SELECT * from t1 where f2 = f1;
#/t'ql/mysql-test
#t]# t@localhost t
#FIXME check this is OK:--error 1064
--error 0,1064
CREATE PROCEDURE function()
SELECT * from t1 where f2=f1;
DROP PROCEDURE function;
......@@ -1015,7 +1012,7 @@ CREATE PROCEDURE collate()
CREATE PROCEDURE column()
SELECT * from t1 where f2=f1;
#FIXME check this is OK:--error 1064
--error 1064
CREATE PROCEDURE columns()
SELECT * from t1 where f2=f1;
DROP PROCEDURE columns;
......@@ -1192,7 +1189,7 @@ CREATE PROCEDURE false()
CREATE PROCEDURE fetch()
SELECT * from t1 where f2=f1;
#FIXME check this is OK:--error 1064
--error 1064
CREATE PROCEDURE fields()
SELECT * from t1 where f2=f1;
DROP PROCEDURE fields;
......@@ -1213,7 +1210,7 @@ CREATE PROCEDURE force()
CREATE PROCEDURE foreign()
SELECT * from t1 where f2=f1;
#FIXME check this is OK:--error 1064
--error 1064
CREATE PROCEDURE found()
SELECT * from t1 where f2=f1;
DROP PROCEDURE found;
......@@ -1226,7 +1223,7 @@ CREATE PROCEDURE from()
CREATE PROCEDURE fulltext()
SELECT * from t1 where f2=f1;
#FIXME check this is OK:--error 1064
--error 1064
CREATE PROCEDURE goto()
SELECT * from t1 where f2=f1;
DROP PROCEDURE goto;
......@@ -1495,7 +1492,7 @@ CREATE PROCEDURE precision()
CREATE PROCEDURE primary()
SELECT * from t1 where f2=f1;
#FIXME check this is OK:--error 1064
--error 1064
CREATE PROCEDURE privileges()
SELECT * from t1 where f2=f1;
DROP PROCEDURE privileges;
......@@ -1656,7 +1653,7 @@ CREATE PROCEDURE straight_join()
CREATE PROCEDURE table()
SELECT * from t1 where f2=f1;
#FIXME check this is OK:--error 1064
--error 1064
CREATE PROCEDURE tables()
SELECT * from t1 where f2=f1;
DROP PROCEDURE tables;
......@@ -1837,7 +1834,7 @@ CREATE FUNCTION char ascii not null(f1 char ascii not null) returns char ascii n
CREATE FUNCTION tinytext(f1 tinytext) returns tinytext
return f1;
#FIXME check this is OK:--error 1064
--error 1064
CREATE FUNCTION text(f1 text) returns text
return f1;
DROP FUNCTION text;
......@@ -10128,7 +10125,7 @@ DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
--error 1064
#FIXME check this is OK:--error 1064
CREATE PROCEDURE sp1()
BEGIN
declare precision char;
......@@ -10430,7 +10427,7 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error 1064
#FIXME check this is OK:--error 1064
CREATE PROCEDURE sp1()
BEGIN
declare soname char;
......
......@@ -214,21 +214,29 @@ let $message= Testcase 3.5.1.7: - need to fix;
eval create table t1 (f1 int, f2 char(25),f3 int) engine=$engine_type;
CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14';
# In 5.0 names to long (more than 64 chars) were trimed without an error
# In 5.1 an error is returned. So adding a call with the expected error
# and one with a shorter name to validate proper execution
--error 1059
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
insert into t1 (f2) values ('insert 3.5.1.7');
select * from t1;
update t1 set f2='update 3.5.1.7';
select * from t1;
select trigger_name from information_schema.triggers;
select trigger_name from information_schema.triggers order by trigger_name;
#Cleanup
--disable_warnings
--error 0, 1360
drop trigger trg5_1;
# The above trigger should be dropped since the name was trimmed.
# In 5.1 the long name should generate an error that is to long
--error 1059
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
drop table t1;
#Section 3.5.1.8
......@@ -385,10 +393,10 @@ let $message= Testcase 3.5.1.11:;
insert into trig_db2.t2 (f1,f2) values ('insert to db2 t2 from db1',3);
insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
select @test_var1, @test_var2, @test_var3;
select * from t1;
select * from t1 order by f2;
select * from trig_db2.t2;
select * from trig_db3.t1;
select * from t1;
select * from t1 order by f2;
use test;
#Cleanup
......@@ -434,7 +442,7 @@ let $message= Testcase 3.5.2.1/2/3:;
create trigger trig_db2.trig2 before insert on trig_db2.t1
for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
......
......@@ -51,14 +51,14 @@ let $message= Testcase 3.5.4.1:;
connection con1_general;
Use db_drop;
Insert into t1 values ('Insert error 3.5.4.1');
Select * from t1;
Select * from t1 order by f1;
connection con1_super;
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
connection con1_general;
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1;
Select * from t1 order by f1;
#Cleanup
--disable_warnings
......@@ -294,7 +294,7 @@ let $message= Testcase 3.5.5.4:;
Select * from t2;
use dbtest_one;
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
Select * from dbtest_two.t2;
Select * from dbtest_two.t2 order by f1;
#Cleanup
connection con1_super;
......@@ -535,7 +535,7 @@ let $message= Testcase 3.5.7.13/14:;
Create trigger trg9_1 BEFORE DELETE
on tb3 for each row set @test_var=@test_var+1;
--error ER_NOT_SUPPORTED_YET
--error ER_NOT_SUPPORTED_YET
Create trigger trg9_2 BEFORE DELETE
on tb3 for each row set @test_var=@test_var+10;
......
......@@ -85,7 +85,7 @@ let $message= Testcase 3.5.9.3:;
values ('Test 3.5.9.3', 7, 123.17);
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
......@@ -104,7 +104,7 @@ let $message= Testcase 3.5.9.3:;
delete from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
......@@ -159,7 +159,7 @@ let $message= Testcase 3.5.9.4:;
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4%';
where f122 like 'Test 3.5.9.4%' order by f163;
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
......@@ -180,7 +180,7 @@ let $message= Testcase 3.5.9.4:;
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig';
where f122 like 'Test 3.5.9.4-trig' order by f163;
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment