Loading mysql-test/mysql-test-run.sh +12 −3 Original line number Diff line number Diff line Loading @@ -202,7 +202,14 @@ SYST=0 REALT=0 FAST_START="" MYSQL_TMP_DIR=$MYSQL_TEST_DIR/var/tmp SLAVE_LOAD_TMPDIR=../../var/tmp #needs to be same length to test logging # Use a relative path for where the slave will find the dumps # generated by "LOAD DATA" on the master. The path is relative # since it must have fixed length to test logging # i.e otherwise the output from "SHOW MASTER STATUS" will vary # with the strlen() of MYSQL_TEST_DIR SLAVE_LOAD_TMPDIR=../tmp RES_SPACE=" " MYSQLD_SRC_DIRS="strings mysys include extra regex myisam \ myisammrg heap sql" Loading Loading @@ -651,7 +658,9 @@ fi [ -d $MYSQL_TEST_DIR/var/tmp ] || mkdir $MYSQL_TEST_DIR/var/tmp [ -d $MYSQL_TEST_DIR/var/run ] || mkdir $MYSQL_TEST_DIR/var/run [ -d $MYSQL_TEST_DIR/var/log ] || mkdir $MYSQL_TEST_DIR/var/log ln -s $MYSQL_TEST_DIR/std_data $MYSQL_TEST_DIR/var/std_data_ln if ! test -L $MYSQL_TEST_DIR/var/std_data_ln ; then ln -s $MYSQL_TEST_DIR/std_data/ $MYSQL_TEST_DIR/var/std_data_ln fi if test ${COLUMNS:-0} -lt 80 ; then COLUMNS=80 ; fi E=`$EXPR $COLUMNS - 8` Loading mysql-test/r/date_formats.result +9 −0 Original line number Diff line number Diff line Loading @@ -506,3 +506,12 @@ d1 d2 02 February 01 January drop table t1; select str_to_date( 1, NULL ); str_to_date( 1, NULL ) NULL select str_to_date( NULL, 1 ); str_to_date( NULL, 1 ) NULL select str_to_date( 1, IF(1=1,NULL,NULL) ); str_to_date( 1, IF(1=1,NULL,NULL) ) NULL mysql-test/r/federated.result +1 −1 Original line number Diff line number Diff line Loading @@ -1530,7 +1530,7 @@ CREATE TABLE federated.t1 ( PRIMARY KEY (`id`) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:9308/federated/t1'; CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; INSERT INTO federated.t1 VALUES (); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() Loading mysql-test/r/sp-code.result +139 −0 Original line number Diff line number Diff line drop procedure if exists empty; drop procedure if exists code_sample; create procedure empty() begin end; Loading Loading @@ -60,3 +62,140 @@ Pos Instruction 20 cpop 1 21 stmt 0 "select t.name, t.idx from t2 t order ..." drop procedure code_sample; drop procedure if exists sudoku_solve; create procedure sudoku_solve(p_naive boolean, p_all boolean) deterministic modifies sql data begin drop temporary table if exists sudoku_work, sudoku_schedule; create temporary table sudoku_work ( row smallint not null, col smallint not null, dig smallint not null, cnt smallint, key using btree (cnt), key using btree (row), key using btree (col), unique key using hash (row,col) ); create temporary table sudoku_schedule ( idx int not null auto_increment primary key, row smallint not null, col smallint not null ); call sudoku_init(); if p_naive then update sudoku_work set cnt = 0 where dig = 0; else call sudoku_count(); end if; insert into sudoku_schedule (row,col) select row,col from sudoku_work where cnt is not null order by cnt desc; begin declare v_scounter bigint default 0; declare v_i smallint default 1; declare v_dig smallint; declare v_schedmax smallint; select count(*) into v_schedmax from sudoku_schedule; more: loop begin declare v_tcounter bigint default 0; sched: while v_i <= v_schedmax do begin declare v_row, v_col smallint; select row,col into v_row,v_col from sudoku_schedule where v_i = idx; select dig into v_dig from sudoku_work where v_row = row and v_col = col; case v_dig when 0 then set v_dig = 1; update sudoku_work set dig = 1 where v_row = row and v_col = col; when 9 then if v_i > 0 then update sudoku_work set dig = 0 where v_row = row and v_col = col; set v_i = v_i - 1; iterate sched; else select v_scounter as 'Solutions'; leave more; end if; else set v_dig = v_dig + 1; update sudoku_work set dig = v_dig where v_row = row and v_col = col; end case; set v_tcounter = v_tcounter + 1; if not sudoku_digit_ok(v_row, v_col, v_dig) then iterate sched; end if; set v_i = v_i + 1; end; end while sched; select dig from sudoku_work; select v_tcounter as 'Tests'; set v_scounter = v_scounter + 1; if p_all and v_i > 0 then set v_i = v_i - 1; else leave more; end if; end; end loop more; end; drop temporary table sudoku_work, sudoku_schedule; end// show procedure code sudoku_solve; Pos Instruction 0 stmt 9 "drop temporary table if exists sudoku..." 1 stmt 1 "create temporary table sudoku_work ( ..." 2 stmt 1 "create temporary table sudoku_schedul..." 3 stmt 94 "call sudoku_init(" 4 jump_if_not 7(8) p_naive@0 5 stmt 4 "update sudoku_work set cnt = 0 where ..." 6 jump 8 7 stmt 94 "call sudoku_count(" 8 stmt 6 "insert into sudoku_schedule (row,col)..." 9 set v_scounter@2 0 10 set v_i@3 1 11 set v_dig@4 NULL 12 set v_schedmax@5 NULL 13 stmt 0 "select count(*) into v_schedmax from ..." 14 set v_tcounter@6 0 15 jump_if_not 39(39) (v_i@3 <= v_schedmax@5) 16 set v_row@7 NULL 17 set v_col@8 NULL 18 stmt 0 "select row,col into v_row,v_col from ..." 19 stmt 0 "select dig into v_dig from sudoku_wor..." 20 set_case_expr 0 v_dig@4 21 jump_if_not 25(34) (case_expr@0 = 0) 22 set v_dig@4 1 23 stmt 4 "update sudoku_work set dig = 1 where ..." 24 jump 34 25 jump_if_not 32(34) (case_expr@0 = 9) 26 jump_if_not 30(34) (v_i@3 > 0) 27 stmt 4 "update sudoku_work set dig = 0 where ..." 28 set v_i@3 (v_i@3 - 1) 29 jump 15 30 stmt 0 "select v_scounter as 'Solutions'" 31 jump 45 32 set v_dig@4 (v_dig@4 + 1) 33 stmt 4 "update sudoku_work set dig = v_dig wh..." 34 set v_tcounter@6 (v_tcounter@6 + 1) 35 jump_if_not 37(37) not(`test`.`sudoku_digit_ok`(v_row@7,v_col@8,v_dig@4)) 36 jump 15 37 set v_i@3 (v_i@3 + 1) 38 jump 15 39 stmt 0 "select dig from sudoku_work" 40 stmt 0 "select v_tcounter as 'Tests'" 41 set v_scounter@2 (v_scounter@2 + 1) 42 jump_if_not 45(14) (p_all@1 and (v_i@3 > 0)) 43 set v_i@3 (v_i@3 - 1) 44 jump 14 45 stmt 9 "drop temporary table sudoku_work, sud..." drop procedure sudoku_solve; mysql-test/r/sp-error.result +29 −0 Original line number Diff line number Diff line Loading @@ -1134,3 +1134,32 @@ show procedure status; Db Name Type Definer Modified Created Security_type Comment test bug15658 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER drop procedure ` bug15658`; drop function if exists bug14270; drop table if exists t1; create table t1 (s1 int primary key); create function bug14270() returns int begin load index into cache t1; return 1; end| ERROR 0A000: Not allowed to return a result set from a function create function bug14270() returns int begin cache index t1 key (`primary`) in keycache1; return 1; end| ERROR 0A000: Not allowed to return a result set from a function drop table t1; drop procedure if exists bug15091; create procedure bug15091() begin declare selectstr varchar(6000) default ' '; declare conditionstr varchar(5000) default ''; set selectstr = concat(selectstr, ' and ', c.operatorid, 'in (',conditionstr, ')'); end| call bug15091(); ERROR 42S02: Unknown table 'c' in field list drop procedure bug15091; Loading
mysql-test/mysql-test-run.sh +12 −3 Original line number Diff line number Diff line Loading @@ -202,7 +202,14 @@ SYST=0 REALT=0 FAST_START="" MYSQL_TMP_DIR=$MYSQL_TEST_DIR/var/tmp SLAVE_LOAD_TMPDIR=../../var/tmp #needs to be same length to test logging # Use a relative path for where the slave will find the dumps # generated by "LOAD DATA" on the master. The path is relative # since it must have fixed length to test logging # i.e otherwise the output from "SHOW MASTER STATUS" will vary # with the strlen() of MYSQL_TEST_DIR SLAVE_LOAD_TMPDIR=../tmp RES_SPACE=" " MYSQLD_SRC_DIRS="strings mysys include extra regex myisam \ myisammrg heap sql" Loading Loading @@ -651,7 +658,9 @@ fi [ -d $MYSQL_TEST_DIR/var/tmp ] || mkdir $MYSQL_TEST_DIR/var/tmp [ -d $MYSQL_TEST_DIR/var/run ] || mkdir $MYSQL_TEST_DIR/var/run [ -d $MYSQL_TEST_DIR/var/log ] || mkdir $MYSQL_TEST_DIR/var/log ln -s $MYSQL_TEST_DIR/std_data $MYSQL_TEST_DIR/var/std_data_ln if ! test -L $MYSQL_TEST_DIR/var/std_data_ln ; then ln -s $MYSQL_TEST_DIR/std_data/ $MYSQL_TEST_DIR/var/std_data_ln fi if test ${COLUMNS:-0} -lt 80 ; then COLUMNS=80 ; fi E=`$EXPR $COLUMNS - 8` Loading
mysql-test/r/date_formats.result +9 −0 Original line number Diff line number Diff line Loading @@ -506,3 +506,12 @@ d1 d2 02 February 01 January drop table t1; select str_to_date( 1, NULL ); str_to_date( 1, NULL ) NULL select str_to_date( NULL, 1 ); str_to_date( NULL, 1 ) NULL select str_to_date( 1, IF(1=1,NULL,NULL) ); str_to_date( 1, IF(1=1,NULL,NULL) ) NULL
mysql-test/r/federated.result +1 −1 Original line number Diff line number Diff line Loading @@ -1530,7 +1530,7 @@ CREATE TABLE federated.t1 ( PRIMARY KEY (`id`) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:9308/federated/t1'; CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; INSERT INTO federated.t1 VALUES (); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() Loading
mysql-test/r/sp-code.result +139 −0 Original line number Diff line number Diff line drop procedure if exists empty; drop procedure if exists code_sample; create procedure empty() begin end; Loading Loading @@ -60,3 +62,140 @@ Pos Instruction 20 cpop 1 21 stmt 0 "select t.name, t.idx from t2 t order ..." drop procedure code_sample; drop procedure if exists sudoku_solve; create procedure sudoku_solve(p_naive boolean, p_all boolean) deterministic modifies sql data begin drop temporary table if exists sudoku_work, sudoku_schedule; create temporary table sudoku_work ( row smallint not null, col smallint not null, dig smallint not null, cnt smallint, key using btree (cnt), key using btree (row), key using btree (col), unique key using hash (row,col) ); create temporary table sudoku_schedule ( idx int not null auto_increment primary key, row smallint not null, col smallint not null ); call sudoku_init(); if p_naive then update sudoku_work set cnt = 0 where dig = 0; else call sudoku_count(); end if; insert into sudoku_schedule (row,col) select row,col from sudoku_work where cnt is not null order by cnt desc; begin declare v_scounter bigint default 0; declare v_i smallint default 1; declare v_dig smallint; declare v_schedmax smallint; select count(*) into v_schedmax from sudoku_schedule; more: loop begin declare v_tcounter bigint default 0; sched: while v_i <= v_schedmax do begin declare v_row, v_col smallint; select row,col into v_row,v_col from sudoku_schedule where v_i = idx; select dig into v_dig from sudoku_work where v_row = row and v_col = col; case v_dig when 0 then set v_dig = 1; update sudoku_work set dig = 1 where v_row = row and v_col = col; when 9 then if v_i > 0 then update sudoku_work set dig = 0 where v_row = row and v_col = col; set v_i = v_i - 1; iterate sched; else select v_scounter as 'Solutions'; leave more; end if; else set v_dig = v_dig + 1; update sudoku_work set dig = v_dig where v_row = row and v_col = col; end case; set v_tcounter = v_tcounter + 1; if not sudoku_digit_ok(v_row, v_col, v_dig) then iterate sched; end if; set v_i = v_i + 1; end; end while sched; select dig from sudoku_work; select v_tcounter as 'Tests'; set v_scounter = v_scounter + 1; if p_all and v_i > 0 then set v_i = v_i - 1; else leave more; end if; end; end loop more; end; drop temporary table sudoku_work, sudoku_schedule; end// show procedure code sudoku_solve; Pos Instruction 0 stmt 9 "drop temporary table if exists sudoku..." 1 stmt 1 "create temporary table sudoku_work ( ..." 2 stmt 1 "create temporary table sudoku_schedul..." 3 stmt 94 "call sudoku_init(" 4 jump_if_not 7(8) p_naive@0 5 stmt 4 "update sudoku_work set cnt = 0 where ..." 6 jump 8 7 stmt 94 "call sudoku_count(" 8 stmt 6 "insert into sudoku_schedule (row,col)..." 9 set v_scounter@2 0 10 set v_i@3 1 11 set v_dig@4 NULL 12 set v_schedmax@5 NULL 13 stmt 0 "select count(*) into v_schedmax from ..." 14 set v_tcounter@6 0 15 jump_if_not 39(39) (v_i@3 <= v_schedmax@5) 16 set v_row@7 NULL 17 set v_col@8 NULL 18 stmt 0 "select row,col into v_row,v_col from ..." 19 stmt 0 "select dig into v_dig from sudoku_wor..." 20 set_case_expr 0 v_dig@4 21 jump_if_not 25(34) (case_expr@0 = 0) 22 set v_dig@4 1 23 stmt 4 "update sudoku_work set dig = 1 where ..." 24 jump 34 25 jump_if_not 32(34) (case_expr@0 = 9) 26 jump_if_not 30(34) (v_i@3 > 0) 27 stmt 4 "update sudoku_work set dig = 0 where ..." 28 set v_i@3 (v_i@3 - 1) 29 jump 15 30 stmt 0 "select v_scounter as 'Solutions'" 31 jump 45 32 set v_dig@4 (v_dig@4 + 1) 33 stmt 4 "update sudoku_work set dig = v_dig wh..." 34 set v_tcounter@6 (v_tcounter@6 + 1) 35 jump_if_not 37(37) not(`test`.`sudoku_digit_ok`(v_row@7,v_col@8,v_dig@4)) 36 jump 15 37 set v_i@3 (v_i@3 + 1) 38 jump 15 39 stmt 0 "select dig from sudoku_work" 40 stmt 0 "select v_tcounter as 'Tests'" 41 set v_scounter@2 (v_scounter@2 + 1) 42 jump_if_not 45(14) (p_all@1 and (v_i@3 > 0)) 43 set v_i@3 (v_i@3 - 1) 44 jump 14 45 stmt 9 "drop temporary table sudoku_work, sud..." drop procedure sudoku_solve;
mysql-test/r/sp-error.result +29 −0 Original line number Diff line number Diff line Loading @@ -1134,3 +1134,32 @@ show procedure status; Db Name Type Definer Modified Created Security_type Comment test bug15658 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER drop procedure ` bug15658`; drop function if exists bug14270; drop table if exists t1; create table t1 (s1 int primary key); create function bug14270() returns int begin load index into cache t1; return 1; end| ERROR 0A000: Not allowed to return a result set from a function create function bug14270() returns int begin cache index t1 key (`primary`) in keycache1; return 1; end| ERROR 0A000: Not allowed to return a result set from a function drop table t1; drop procedure if exists bug15091; create procedure bug15091() begin declare selectstr varchar(6000) default ' '; declare conditionstr varchar(5000) default ''; set selectstr = concat(selectstr, ' and ', c.operatorid, 'in (',conditionstr, ')'); end| call bug15091(); ERROR 42S02: Unknown table 'c' in field list drop procedure bug15091;