select * from mysql.proc where name='foo' and db='mysqltest1';
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate
mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
declare b int;
set b = 8;
...
...
@@ -27,10 +27,10 @@ declare b int;
set b = 8;
insert into t1 values (b);
insert into t1 values (unix_timestamp());
end
end NONE
connection slave;
select * from mysql.proc where name='foo' and db='mysqltest1';
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate
mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
select * from mysql.proc where name="foo4" and db='mysqltest1';
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate
mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin
insert into t2 values(20),(20);
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
insert into t2 values(20),(20);
end
end NONE
connection master;
drop procedure foo4;
select * from mysql.proc where name="foo4" and db='mysqltest1';
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate
connection slave;
select * from mysql.proc where name="foo4" and db='mysqltest1';
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate
connection master;
drop procedure foo;
drop procedure foo2;
...
...
@@ -234,22 +235,22 @@ select fn3();
fn3()
0
select * from mysql.proc where db='mysqltest1';
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate
mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
return unix_timestamp();
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
return unix_timestamp();
end
end NONE
mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
return unix_timestamp();
end zedjzlcsjhd@localhost # # STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci begin
return unix_timestamp();
end
end NONE
mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
return 0;
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
return 0;
end
end NONE
select * from t1;
a
1000000000
...
...
@@ -259,22 +260,22 @@ select * from t1;
a
1000000000
select * from mysql.proc where db='mysqltest1';
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate
mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
return unix_timestamp();
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
return unix_timestamp();
end
end NONE
mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
return unix_timestamp();
end zedjzlcsjhd@localhost # # STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci begin
return unix_timestamp();
end
end NONE
mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
return 0;
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
return 0;
end
end NONE
connection master;
delete from t2;
alter table t2 add unique (a);
...
...
@@ -290,6 +291,7 @@ end|
do fn1(100);
Warnings:
Error 1062 Duplicate entry '100' for key 'a'
Note 4094 At line 3 in mysqltest1.fn1
select fn1(20);
ERROR 23000: Duplicate entry '20' for key 'a'
select * from t2;
...
...
@@ -794,19 +796,19 @@ insert into t1 values (b);
insert into t1 values (unix_timestamp());
end
/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values ( NAME_CONST('b',8))
/*!*/;
COMMIT/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (unix_timestamp())
/*!*/;
COMMIT/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
...
...
@@ -851,20 +853,20 @@ insert into t2 values(3);
insert into t1 values (5);
end
/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(3)
/*!*/;
COMMIT/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.sql_mode=0/*!*/;
insert into t1 values (15)
/*!*/;
COMMIT/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
...
...
@@ -875,20 +877,20 @@ SET TIMESTAMP=t/*!*/;
SET @@session.sql_mode=0/*!*/;
alter procedure foo4 sql security invoker
/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
insert into t2 values(3)
/*!*/;
COMMIT/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (5)
/*!*/;
COMMIT/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.sql_mode=0/*!*/;
...
...
@@ -928,7 +930,7 @@ insert into t1 values (x);
return x+2;
end
/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete t1,t2 from t1,t2
...
...
@@ -936,13 +938,13 @@ delete t1,t2 from t1,t2
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest1`.`fn1`(20)
/*!*/;
COMMIT/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(fn1(21))
...
...
@@ -958,13 +960,13 @@ begin
return unix_timestamp();
end
/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
/*!*/;
COMMIT/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values(fn1())
...
...
@@ -986,7 +988,7 @@ begin
return 0;
end
/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t2
...
...
@@ -1005,7 +1007,7 @@ insert into t2 values(x),(x);
return 10;
end
/*!*/;
BEGIN
START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
...
...
@@ -1014,13 +1016,13 @@ COMMIT/*!*/;
SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10