1 include/master-slave.inc
3 drop database if exists mysqltest1;
4 create database mysqltest1;
6 create table t1 (a varchar(100));
12 insert into t1 values (b);
13 insert into t1 values (unix_timestamp());
15 select * from mysql.proc where name='foo' and db='mysqltest1';
16 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
17 mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
20 insert into t1 values (b);
21 insert into t1 values (unix_timestamp());
22 end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
25 insert into t1 values (b);
26 insert into t1 values (unix_timestamp());
28 select * from mysql.proc where name='foo' and db='mysqltest1';
29 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
30 mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
33 insert into t1 values (b);
34 insert into t1 values (unix_timestamp());
35 end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
38 insert into t1 values (b);
39 insert into t1 values (unix_timestamp());
41 set timestamp=1000000000;
52 create procedure foo2()
53 select * from mysqltest1.t1;
56 alter procedure foo2 contains sql;
58 create table t1 (a int);
59 create table t2 like t1;
60 create procedure foo3()
62 insert into t1 values (15);
63 grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1;
64 grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1;
65 grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
69 create procedure foo4()
72 insert into t2 values(3);
73 insert into t1 values (5);
76 Got one of the listed errors
81 Got one of the listed errors
82 alter procedure foo4 sql security invoker;
105 alter table t2 add unique (a);
107 create procedure foo4()
110 insert into t2 values(20),(20);
113 ERROR 23000: Duplicate entry '20' for key 'a'
116 Error 1062 Duplicate entry '20' for key 'a'
123 select * from mysql.proc where name="foo4" and db='mysqltest1';
124 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
125 mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin
126 insert into t2 values(20),(20);
127 end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
128 insert into t2 values(20),(20);
131 select * from mysql.proc where name="foo4" and db='mysqltest1';
132 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
133 select * from mysql.proc where name="foo4" and db='mysqltest1';
134 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
138 create function fn1(x int)
141 insert into t1 values (x);
144 ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
145 create function fn1(x int)
149 insert into t1 values (x);
152 delete t1,t2 from t1,t2;
156 insert into t2 values(fn1(21));
172 create function fn1()
176 return unix_timestamp();
178 alter function fn1 contains sql;
179 ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
181 set timestamp=1000000000;
182 insert into t1 values(fn1());
183 create function fn2()
187 return unix_timestamp();
189 ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
190 set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
191 set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
192 set global log_bin_trust_routine_creators=1;
194 Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
195 set global log_bin_trust_function_creators=0;
196 set global log_bin_trust_function_creators=1;
197 set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
198 set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
199 set global log_bin_trust_function_creators=1;
200 create function fn2()
204 return unix_timestamp();
206 create function fn3()
216 select * from mysql.proc where db='mysqltest1';
217 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
218 mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
219 return unix_timestamp();
220 end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
221 return unix_timestamp();
223 mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
224 return unix_timestamp();
225 end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
226 return unix_timestamp();
228 mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
230 end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
240 select * from mysql.proc where db='mysqltest1';
241 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
242 mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
243 return unix_timestamp();
244 end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
245 return unix_timestamp();
247 mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
248 return unix_timestamp();
249 end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
250 return unix_timestamp();
252 mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
254 end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
258 alter table t2 add unique (a);
260 create function fn1(x int)
263 insert into t2 values(x),(x);
268 Error 1062 Duplicate entry '100' for key 'a'
270 ERROR 23000: Duplicate entry '20' for key 'a'
279 create trigger trg before insert on t1 for each row set new.a= 10;
280 ERROR 42000: TRIGGER command denied to user 'zedjzlcsjhd'@'localhost' for table 't1'
282 create trigger trg before insert on t1 for each row set new.a= 10;
283 insert into t1 values (1);
292 insert into t1 values (1);
299 create procedure foo()
308 drop database mysqltest1;
309 drop user "zedjzlcsjhd"@127.0.0.1;
312 drop function if exists f1;
313 create function f1() returns int reads sql data
316 declare c cursor for select a from v1;
322 create view v1 as select 1 as a;
323 create table t1 (a int);
324 insert into t1 (a) values (f1());
333 DROP PROCEDURE IF EXISTS p1;
334 DROP TABLE IF EXISTS t1;
335 CREATE TABLE t1(col VARCHAR(10));
336 CREATE PROCEDURE p1(arg VARCHAR(10))
337 INSERT INTO t1 VALUES(arg);
347 ---> Test for BUG#20438
349 ---> Preparing environment...
350 ---> connection: master
351 DROP PROCEDURE IF EXISTS p1;
352 DROP FUNCTION IF EXISTS f1;
354 ---> Synchronizing slave with master...
356 ---> connection: master
358 ---> Creating procedure...
359 /*!50003 CREATE PROCEDURE p1() SET @a = 1 */;
360 /*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */;
362 ---> Checking on master...
363 SHOW CREATE PROCEDURE p1;
364 Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
365 p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
366 SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
367 SHOW CREATE FUNCTION f1;
368 Function sql_mode Create Function character_set_client collation_connection Database Collation
369 f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
370 RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci
372 ---> Synchronizing slave with master...
373 ---> connection: master
375 ---> Checking on slave...
376 SHOW CREATE PROCEDURE p1;
377 Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
378 p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
379 SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
380 SHOW CREATE FUNCTION f1;
381 Function sql_mode Create Function character_set_client collation_connection Database Collation
382 f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
383 RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci
385 ---> connection: master
391 drop database if exists mysqltest;
392 drop database if exists mysqltest2;
393 create database mysqltest;
394 create database mysqltest2;
396 create table t ( t integer );
397 create procedure mysqltest.test() begin end;
398 insert into t values ( 1 );
399 create procedure `\\`.test() begin end;
400 ERROR 42000: Unknown database '\\'
401 create function f1 () returns int
403 insert into t values (1);
407 set @a:= mysqltest2.f1();
408 show binlog events from <binlog_start>;
409 Log_name Pos Event_type Server_id End_log_pos Info
410 master-bin.000001 # Query # # drop database if exists mysqltest1
411 master-bin.000001 # Query # # create database mysqltest1
412 master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a varchar(100))
413 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`()
417 insert into t1 values (b);
418 insert into t1 values (unix_timestamp());
420 master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8))
421 master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (unix_timestamp())
422 master-bin.000001 # Query # # use `mysqltest1`; delete from t1
423 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`()
424 select * from mysqltest1.t1
425 master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo2 contains sql
426 master-bin.000001 # Query # # use `mysqltest1`; drop table t1
427 master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int)
428 master-bin.000001 # Query # # use `mysqltest1`; create table t2 like t1
429 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo3`()
431 insert into t1 values (15)
432 master-bin.000001 # Query # # use `mysqltest1`; grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1
433 master-bin.000001 # Query # # use `mysqltest1`; grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1
434 master-bin.000001 # Query # # use `mysqltest1`; grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1
435 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` PROCEDURE `foo4`()
438 insert into t2 values(3);
439 insert into t1 values (5);
441 master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3)
442 master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (15)
443 master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3)
444 master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo4 sql security invoker
445 master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3)
446 master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (5)
447 master-bin.000001 # Query # # use `mysqltest1`; delete from t2
448 master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a)
449 master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4
450 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo4`()
453 insert into t2 values(20),(20);
455 master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(20),(20)
456 master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4
457 master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo
458 master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo2
459 master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo3
460 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11)
463 insert into t1 values (x);
466 master-bin.000001 # Query # # use `mysqltest1`; delete t1,t2 from t1,t2
467 master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20)
468 master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(fn1(21))
469 master-bin.000001 # Query # # use `mysqltest1`; drop function fn1
470 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`() RETURNS int(11)
473 return unix_timestamp();
475 master-bin.000001 # Query # # use `mysqltest1`; delete from t1
476 master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(fn1())
477 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11)
480 return unix_timestamp();
482 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS int(11)
487 master-bin.000001 # Query # # use `mysqltest1`; delete from t2
488 master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a)
489 master-bin.000001 # Query # # use `mysqltest1`; drop function fn1
490 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11)
492 insert into t2 values(x),(x);
495 master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(100)
496 master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20)
497 master-bin.000001 # Query # # use `mysqltest1`; delete from t1
498 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
499 master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1)
500 master-bin.000001 # Query # # use `mysqltest1`; delete from t1
501 master-bin.000001 # Query # # use `mysqltest1`; drop trigger trg
502 master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1)
503 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`()
506 master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo
507 master-bin.000001 # Query # # use `mysqltest1`; drop function fn1
508 master-bin.000001 # Query # # drop database mysqltest1
509 master-bin.000001 # Query # # drop user "zedjzlcsjhd"@127.0.0.1
510 master-bin.000001 # Query # # use `test`; drop function if exists f1
511 master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
515 declare c cursor for select a from v1;
521 master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 as a
522 master-bin.000001 # Query # # use `test`; create table t1 (a int)
523 master-bin.000001 # Query # # use `test`; insert into t1 (a) values (f1())
524 master-bin.000001 # Query # # use `test`; drop view v1
525 master-bin.000001 # Query # # use `test`; drop function f1
526 master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS p1
527 master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
528 master-bin.000001 # Query # # use `test`; CREATE TABLE t1(col VARCHAR(10))
529 master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10))
530 INSERT INTO t1 VALUES(arg)
531 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
532 master-bin.000001 # Query # # use `test`; DROP PROCEDURE p1
533 master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS p1
534 master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS f1
535 master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
537 master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
539 master-bin.000001 # Query # # use `test`; DROP PROCEDURE p1
540 master-bin.000001 # Query # # use `test`; DROP FUNCTION f1
541 master-bin.000001 # Query # # use `test`; drop table t1
542 master-bin.000001 # Query # # drop database if exists mysqltest
543 master-bin.000001 # Query # # drop database if exists mysqltest2
544 master-bin.000001 # Query # # create database mysqltest
545 master-bin.000001 # Query # # create database mysqltest2
546 master-bin.000001 # Query # # use `mysqltest2`; create table t ( t integer )
547 master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`()
549 master-bin.000001 # Query # # use `mysqltest2`; insert into t values ( 1 )
550 master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
552 insert into t values (1);
555 master-bin.000001 # Query # # use `mysqltest`; SELECT `mysqltest2`.`f1`()
556 set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
558 Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
559 set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
560 set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
562 Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
563 set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
564 drop database mysqltest;
565 drop database mysqltest2;
567 /*!50001 create procedure `mysqltestbug36570_p1`() */
572 create procedure test.` mysqltestbug36570_p2`(/*!50001 a int*/)`label`:
576 /*!50001 create function test.mysqltestbug36570_f1() */
578 /*!50001 deterministic */
583 show procedure status like '%mysqltestbug36570%';
584 Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
585 test mysqltestbug36570_p2 PROCEDURE root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
586 test mysqltestbug36570_p1 PROCEDURE root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
587 show create procedure ` mysqltestbug36570_p2`;
588 Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
589 mysqltestbug36570_p2 CREATE DEFINER=`root`@`localhost` PROCEDURE ` mysqltestbug36570_p2`( a int)
593 end latin1 latin1_swedish_ci latin1_swedish_ci
594 show procedure status like '%mysqltestbug36570%';
595 Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
596 test mysqltestbug36570_p2 PROCEDURE root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
597 test mysqltestbug36570_p1 PROCEDURE root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
598 show create procedure ` mysqltestbug36570_p2`;
599 Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
600 mysqltestbug36570_p2 CREATE DEFINER=`root`@`localhost` PROCEDURE ` mysqltestbug36570_p2`( a int)
604 end latin1 latin1_swedish_ci latin1_swedish_ci
605 call ` mysqltestbug36570_p2`(42);
608 show function status like '%mysqltestbug36570%';
609 Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
610 test mysqltestbug36570_f1 FUNCTION root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
612 /*!40019 SET @@session.max_insert_delayed_threads=0*/;
613 /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
616 SET TIMESTAMP=t/*!*/;
617 SET @@session.pseudo_thread_id=999999999/*!*/;
618 SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
619 SET @@session.sql_mode=0/*!*/;
620 SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
621 /*!\C latin1 *//*!*/;
622 SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
623 SET @@session.lc_time_names=0/*!*/;
624 SET @@session.collation_database=DEFAULT/*!*/;
625 drop database if exists mysqltest1
627 SET TIMESTAMP=t/*!*/;
628 create database mysqltest1
630 use `mysqltest1`/*!*/;
631 SET TIMESTAMP=t/*!*/;
632 create table t1 (a varchar(100))
634 SET TIMESTAMP=t/*!*/;
635 CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`()
639 insert into t1 values (b);
640 insert into t1 values (unix_timestamp());
643 SET TIMESTAMP=t/*!*/;
644 insert into t1 values ( NAME_CONST('b',8))
646 SET TIMESTAMP=t/*!*/;
647 insert into t1 values (unix_timestamp())
649 SET TIMESTAMP=t/*!*/;
652 SET TIMESTAMP=t/*!*/;
653 CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`()
654 select * from mysqltest1.t1
656 SET TIMESTAMP=t/*!*/;
657 alter procedure foo2 contains sql
659 SET TIMESTAMP=t/*!*/;
662 SET TIMESTAMP=t/*!*/;
663 create table t1 (a int)
665 SET TIMESTAMP=t/*!*/;
666 create table t2 like t1
668 SET TIMESTAMP=t/*!*/;
669 CREATE DEFINER=`root`@`localhost` PROCEDURE `foo3`()
671 insert into t1 values (15)
673 SET TIMESTAMP=t/*!*/;
674 grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1
676 SET TIMESTAMP=t/*!*/;
677 grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1
679 SET TIMESTAMP=t/*!*/;
680 grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1
682 SET TIMESTAMP=t/*!*/;
683 CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` PROCEDURE `foo4`()
686 insert into t2 values(3);
687 insert into t1 values (5);
690 SET TIMESTAMP=t/*!*/;
691 insert into t2 values(3)
693 SET TIMESTAMP=t/*!*/;
694 insert into t1 values (15)
696 SET TIMESTAMP=t/*!*/;
697 insert into t2 values(3)
699 SET TIMESTAMP=t/*!*/;
700 alter procedure foo4 sql security invoker
702 SET TIMESTAMP=t/*!*/;
703 insert into t2 values(3)
705 SET TIMESTAMP=t/*!*/;
706 insert into t1 values (5)
708 SET TIMESTAMP=t/*!*/;
711 SET TIMESTAMP=t/*!*/;
712 alter table t2 add unique (a)
714 SET TIMESTAMP=t/*!*/;
717 SET TIMESTAMP=t/*!*/;
718 CREATE DEFINER=`root`@`localhost` PROCEDURE `foo4`()
721 insert into t2 values(20),(20);
724 SET TIMESTAMP=t/*!*/;
725 insert into t2 values(20),(20)
727 SET TIMESTAMP=t/*!*/;
730 SET TIMESTAMP=t/*!*/;
733 SET TIMESTAMP=t/*!*/;
736 SET TIMESTAMP=t/*!*/;
739 SET TIMESTAMP=t/*!*/;
740 CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11)
743 insert into t1 values (x);
747 SET TIMESTAMP=t/*!*/;
748 delete t1,t2 from t1,t2
750 SET TIMESTAMP=t/*!*/;
751 SELECT `mysqltest1`.`fn1`(20)
753 SET TIMESTAMP=t/*!*/;
754 insert into t2 values(fn1(21))
756 SET TIMESTAMP=t/*!*/;
759 SET TIMESTAMP=t/*!*/;
760 CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`() RETURNS int(11)
763 return unix_timestamp();
766 SET TIMESTAMP=t/*!*/;
769 SET TIMESTAMP=t/*!*/;
770 insert into t1 values(fn1())
772 SET TIMESTAMP=t/*!*/;
773 CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11)
776 return unix_timestamp();
779 SET TIMESTAMP=t/*!*/;
780 CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS int(11)
786 SET TIMESTAMP=t/*!*/;
789 SET TIMESTAMP=t/*!*/;
790 alter table t2 add unique (a)
792 SET TIMESTAMP=t/*!*/;
795 SET TIMESTAMP=t/*!*/;
796 CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11)
798 insert into t2 values(x),(x);
802 SET TIMESTAMP=t/*!*/;
803 SELECT `mysqltest1`.`fn1`(100)
805 SET TIMESTAMP=t/*!*/;
806 SELECT `mysqltest1`.`fn1`(20)
808 SET TIMESTAMP=t/*!*/;
811 SET TIMESTAMP=t/*!*/;
812 CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
814 SET TIMESTAMP=t/*!*/;
815 insert into t1 values (1)
817 SET TIMESTAMP=t/*!*/;
820 SET TIMESTAMP=t/*!*/;
823 SET TIMESTAMP=t/*!*/;
824 insert into t1 values (1)
826 SET TIMESTAMP=t/*!*/;
827 CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`()
831 SET TIMESTAMP=t/*!*/;
834 SET TIMESTAMP=t/*!*/;
837 SET TIMESTAMP=t/*!*/;
838 drop database mysqltest1
840 SET TIMESTAMP=t/*!*/;
841 drop user "zedjzlcsjhd"@127.0.0.1
844 SET TIMESTAMP=t/*!*/;
845 drop function if exists f1
847 SET TIMESTAMP=t/*!*/;
848 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
852 declare c cursor for select a from v1;
859 SET TIMESTAMP=t/*!*/;
860 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 as a
862 SET TIMESTAMP=t/*!*/;
863 create table t1 (a int)
865 SET TIMESTAMP=t/*!*/;
866 insert into t1 (a) values (f1())
868 SET TIMESTAMP=t/*!*/;
871 SET TIMESTAMP=t/*!*/;
874 SET TIMESTAMP=t/*!*/;
875 DROP PROCEDURE IF EXISTS p1
877 SET TIMESTAMP=t/*!*/;
878 DROP TABLE IF EXISTS t1
880 SET TIMESTAMP=t/*!*/;
881 CREATE TABLE t1(col VARCHAR(10))
883 SET TIMESTAMP=t/*!*/;
884 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10))
885 INSERT INTO t1 VALUES(arg)
887 SET TIMESTAMP=t/*!*/;
888 INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
890 SET TIMESTAMP=t/*!*/;
893 SET TIMESTAMP=t/*!*/;
894 DROP PROCEDURE IF EXISTS p1
896 SET TIMESTAMP=t/*!*/;
897 DROP FUNCTION IF EXISTS f1
899 SET TIMESTAMP=t/*!*/;
900 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
903 SET TIMESTAMP=t/*!*/;
904 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
907 SET TIMESTAMP=t/*!*/;
910 SET TIMESTAMP=t/*!*/;
913 SET TIMESTAMP=t/*!*/;
916 SET TIMESTAMP=t/*!*/;
917 drop database if exists mysqltest
919 SET TIMESTAMP=t/*!*/;
920 drop database if exists mysqltest2
922 SET TIMESTAMP=t/*!*/;
923 create database mysqltest
925 SET TIMESTAMP=t/*!*/;
926 create database mysqltest2
928 use `mysqltest2`/*!*/;
929 SET TIMESTAMP=t/*!*/;
930 create table t ( t integer )
932 SET TIMESTAMP=t/*!*/;
933 CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`()
936 SET TIMESTAMP=t/*!*/;
937 insert into t values ( 1 )
939 SET TIMESTAMP=t/*!*/;
940 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
942 insert into t values (1);
946 use `mysqltest`/*!*/;
947 SET TIMESTAMP=t/*!*/;
948 SELECT `mysqltest2`.`f1`()
950 SET TIMESTAMP=t/*!*/;
951 drop database mysqltest
953 SET TIMESTAMP=t/*!*/;
954 drop database mysqltest2
957 SET TIMESTAMP=t/*!*/;
958 CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltestbug36570_p1`()
964 SET TIMESTAMP=t/*!*/;
965 CREATE DEFINER=`root`@`localhost` PROCEDURE `test`.` mysqltestbug36570_p2`( a int)
971 SET TIMESTAMP=t/*!*/;
972 CREATE DEFINER=`root`@`localhost` FUNCTION `test`.`mysqltestbug36570_f1`() RETURNS int(11)
980 ROLLBACK /* added by mysqlbinlog */;
981 /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
983 drop procedure mysqltestbug36570_p1;
984 drop procedure ` mysqltestbug36570_p2`;
985 drop function mysqltestbug36570_f1;