Loading mysql-test/r/sp-destruct.result 0 → 100644 +77 −0 Original line number Diff line number Diff line use test; drop procedure if exists bug14233; drop function if exists bug14233; drop table if exists t1; drop view if exists v1; create procedure bug14233() set @x = 42; create function bug14233_f() returns int return 42; create table t1 (id int); create trigger t1_ai after insert on t1 for each row call bug14233(); alter table mysql.proc drop type; call bug14233(); ERROR HY000: Failed to load routine test.bug14233. The table mysql.proc is missing, corrupt, or contains bad data (internal code -5) create view v1 as select bug14233_f(); ERROR HY000: Failed to load routine test.bug14233_f. The table mysql.proc is missing, corrupt, or contains bad data (internal code -5) insert into t1 values (0); ERROR HY000: Failed to load routine test.bug14233. The table mysql.proc is missing, corrupt, or contains bad data (internal code -5) flush table mysql.proc; call bug14233(); ERROR HY000: Incorrect information in file: './mysql/proc.frm' create view v1 as select bug14233_f(); ERROR HY000: Incorrect information in file: './mysql/proc.frm' insert into t1 values (0); ERROR HY000: Incorrect information in file: './mysql/proc.frm' flush table mysql.proc; call bug14233(); ERROR 42S02: Table 'mysql.proc' doesn't exist create view v1 as select bug14233_f(); ERROR 42S02: Table 'mysql.proc' doesn't exist insert into t1 values (0); ERROR 42S02: Table 'mysql.proc' doesn't exist flush table mysql.proc; flush privileges; delete from mysql.proc where name like 'bug14233%'; insert into mysql.proc ( db, name, type, specific_name, language, sql_data_access, is_deterministic, security_type, param_list, returns, body, definer, created, modified, sql_mode, comment ) values ( 'test', 'bug14233_1', 'FUNCTION', 'bug14233_1', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'select count(*) from mysql.user', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ), ( 'test', 'bug14233_2', 'FUNCTION', 'bug14233_2', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'begin declare x int; select count(*) into x from mysql.user; end', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ), ( 'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO', 'DEFINER', '', '', 'alksj wpsj sa ^#!@ ', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ); select bug14233_1(); ERROR HY000: Failed to load routine test.bug14233_1. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) create view v1 as select bug14233_1(); ERROR HY000: Failed to load routine test.bug14233_1. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) select bug14233_2(); ERROR HY000: Failed to load routine test.bug14233_2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) create view v1 as select bug14233_2(); ERROR HY000: Failed to load routine test.bug14233_2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) call bug14233_3(); ERROR HY000: Failed to load routine test.bug14233_3. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) drop trigger t1_ai; create trigger t1_ai after insert on t1 for each row call bug14233_3(); insert into t1 values (0); ERROR HY000: Failed to load routine test.bug14233_3. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) delete from mysql.proc where name like 'bug14233%'; drop trigger t1_ai; drop table t1; mysql-test/r/sp-error.result +1 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,7 @@ begin declare x int; set x = val+3; end| ERROR 42000: No RETURN found in FUNCTION f ERROR 42000: No RETURN found in FUNCTION test.f create function f(val int) returns int begin declare x int; Loading mysql-test/t/sp-destruct.test 0 → 100644 +124 −0 Original line number Diff line number Diff line # # Destructive stored procedure tests # # We do horrible things to the mysql.proc table here, so any unexpected # failures here might leave it in an undetermined state. # # In the case of trouble you might want to skip this. # # We're using --system things that probably doesn't work on Windows. --source include/not_windows.inc # Backup proc table --system rm -rf var/master-data/mysql/backup --system mkdir var/master-data/mysql/backup --system cp var/master-data/mysql/proc.* var/master-data/mysql/backup/ use test; --disable_warnings drop procedure if exists bug14233; drop function if exists bug14233; drop table if exists t1; drop view if exists v1; --enable_warnings create procedure bug14233() set @x = 42; create function bug14233_f() returns int return 42; create table t1 (id int); create trigger t1_ai after insert on t1 for each row call bug14233(); # Unsupported tampering with the mysql.proc definition alter table mysql.proc drop type; --error ER_SP_PROC_TABLE_CORRUPT call bug14233(); --error ER_SP_PROC_TABLE_CORRUPT create view v1 as select bug14233_f(); --error ER_SP_PROC_TABLE_CORRUPT insert into t1 values (0); flush table mysql.proc; # Thrashing the .frm file --system echo 'saljdlfa' > var/master-data/mysql/proc.frm --error ER_NOT_FORM_FILE call bug14233(); --error ER_NOT_FORM_FILE create view v1 as select bug14233_f(); --error ER_NOT_FORM_FILE insert into t1 values (0); flush table mysql.proc; # Drop the mysql.proc table --system rm var/master-data/mysql/proc.* --error ER_NO_SUCH_TABLE call bug14233(); --error ER_NO_SUCH_TABLE create view v1 as select bug14233_f(); --error ER_NO_SUCH_TABLE insert into t1 values (0); # Restore mysql.proc --system mv var/master-data/mysql/backup/* var/master-data/mysql/ --system rmdir var/master-data/mysql/backup flush table mysql.proc; flush privileges; delete from mysql.proc where name like 'bug14233%'; # Unsupported editing of mysql.proc, circumventing checks in "create ..." insert into mysql.proc ( db, name, type, specific_name, language, sql_data_access, is_deterministic, security_type, param_list, returns, body, definer, created, modified, sql_mode, comment ) values ( 'test', 'bug14233_1', 'FUNCTION', 'bug14233_1', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'select count(*) from mysql.user', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ), ( 'test', 'bug14233_2', 'FUNCTION', 'bug14233_2', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'begin declare x int; select count(*) into x from mysql.user; end', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ), ( 'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO', 'DEFINER', '', '', 'alksj wpsj sa ^#!@ ', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ); --error ER_SP_PROC_TABLE_CORRUPT select bug14233_1(); --error ER_SP_PROC_TABLE_CORRUPT create view v1 as select bug14233_1(); --error ER_SP_PROC_TABLE_CORRUPT select bug14233_2(); --error ER_SP_PROC_TABLE_CORRUPT create view v1 as select bug14233_2(); --error ER_SP_PROC_TABLE_CORRUPT call bug14233_3(); drop trigger t1_ai; create trigger t1_ai after insert on t1 for each row call bug14233_3(); --error ER_SP_PROC_TABLE_CORRUPT insert into t1 values (0); # Clean-up delete from mysql.proc where name like 'bug14233%'; drop trigger t1_ai; drop table t1; mysql-test/t/sp.test +2 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,8 @@ # Tests that require multiple connections, except security/privilege tests, # go to sp-thread. # Tests that uses 'goto' to into sp-goto.test (currently disabled) # Tests that destroys system tables (e.g. mysql.proc) for error testing # go to sp-destruct. use test; Loading ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -2040,19 +2040,22 @@ Qmgr::execAPI_VERSION_REQ(Signal * signal) { ApiVersionConf * conf = (ApiVersionConf *)req; if(getNodeInfo(nodeId).m_connected) { conf->version = getNodeInfo(nodeId).m_version; struct in_addr in= globalTransporterRegistry.get_connect_address(nodeId); conf->inet_addr= in.s_addr; } else { conf->version = 0; conf->inet_addr= 0; } conf->nodeId = nodeId; struct in_addr in= globalTransporterRegistry.get_connect_address(nodeId); conf->inet_addr= in.s_addr; sendSignal(senderRef, GSN_API_VERSION_CONF, signal, ApiVersionConf::SignalLength, JBB); } Loading Loading
mysql-test/r/sp-destruct.result 0 → 100644 +77 −0 Original line number Diff line number Diff line use test; drop procedure if exists bug14233; drop function if exists bug14233; drop table if exists t1; drop view if exists v1; create procedure bug14233() set @x = 42; create function bug14233_f() returns int return 42; create table t1 (id int); create trigger t1_ai after insert on t1 for each row call bug14233(); alter table mysql.proc drop type; call bug14233(); ERROR HY000: Failed to load routine test.bug14233. The table mysql.proc is missing, corrupt, or contains bad data (internal code -5) create view v1 as select bug14233_f(); ERROR HY000: Failed to load routine test.bug14233_f. The table mysql.proc is missing, corrupt, or contains bad data (internal code -5) insert into t1 values (0); ERROR HY000: Failed to load routine test.bug14233. The table mysql.proc is missing, corrupt, or contains bad data (internal code -5) flush table mysql.proc; call bug14233(); ERROR HY000: Incorrect information in file: './mysql/proc.frm' create view v1 as select bug14233_f(); ERROR HY000: Incorrect information in file: './mysql/proc.frm' insert into t1 values (0); ERROR HY000: Incorrect information in file: './mysql/proc.frm' flush table mysql.proc; call bug14233(); ERROR 42S02: Table 'mysql.proc' doesn't exist create view v1 as select bug14233_f(); ERROR 42S02: Table 'mysql.proc' doesn't exist insert into t1 values (0); ERROR 42S02: Table 'mysql.proc' doesn't exist flush table mysql.proc; flush privileges; delete from mysql.proc where name like 'bug14233%'; insert into mysql.proc ( db, name, type, specific_name, language, sql_data_access, is_deterministic, security_type, param_list, returns, body, definer, created, modified, sql_mode, comment ) values ( 'test', 'bug14233_1', 'FUNCTION', 'bug14233_1', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'select count(*) from mysql.user', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ), ( 'test', 'bug14233_2', 'FUNCTION', 'bug14233_2', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'begin declare x int; select count(*) into x from mysql.user; end', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ), ( 'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO', 'DEFINER', '', '', 'alksj wpsj sa ^#!@ ', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ); select bug14233_1(); ERROR HY000: Failed to load routine test.bug14233_1. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) create view v1 as select bug14233_1(); ERROR HY000: Failed to load routine test.bug14233_1. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) select bug14233_2(); ERROR HY000: Failed to load routine test.bug14233_2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) create view v1 as select bug14233_2(); ERROR HY000: Failed to load routine test.bug14233_2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) call bug14233_3(); ERROR HY000: Failed to load routine test.bug14233_3. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) drop trigger t1_ai; create trigger t1_ai after insert on t1 for each row call bug14233_3(); insert into t1 values (0); ERROR HY000: Failed to load routine test.bug14233_3. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) delete from mysql.proc where name like 'bug14233%'; drop trigger t1_ai; drop table t1;
mysql-test/r/sp-error.result +1 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,7 @@ begin declare x int; set x = val+3; end| ERROR 42000: No RETURN found in FUNCTION f ERROR 42000: No RETURN found in FUNCTION test.f create function f(val int) returns int begin declare x int; Loading
mysql-test/t/sp-destruct.test 0 → 100644 +124 −0 Original line number Diff line number Diff line # # Destructive stored procedure tests # # We do horrible things to the mysql.proc table here, so any unexpected # failures here might leave it in an undetermined state. # # In the case of trouble you might want to skip this. # # We're using --system things that probably doesn't work on Windows. --source include/not_windows.inc # Backup proc table --system rm -rf var/master-data/mysql/backup --system mkdir var/master-data/mysql/backup --system cp var/master-data/mysql/proc.* var/master-data/mysql/backup/ use test; --disable_warnings drop procedure if exists bug14233; drop function if exists bug14233; drop table if exists t1; drop view if exists v1; --enable_warnings create procedure bug14233() set @x = 42; create function bug14233_f() returns int return 42; create table t1 (id int); create trigger t1_ai after insert on t1 for each row call bug14233(); # Unsupported tampering with the mysql.proc definition alter table mysql.proc drop type; --error ER_SP_PROC_TABLE_CORRUPT call bug14233(); --error ER_SP_PROC_TABLE_CORRUPT create view v1 as select bug14233_f(); --error ER_SP_PROC_TABLE_CORRUPT insert into t1 values (0); flush table mysql.proc; # Thrashing the .frm file --system echo 'saljdlfa' > var/master-data/mysql/proc.frm --error ER_NOT_FORM_FILE call bug14233(); --error ER_NOT_FORM_FILE create view v1 as select bug14233_f(); --error ER_NOT_FORM_FILE insert into t1 values (0); flush table mysql.proc; # Drop the mysql.proc table --system rm var/master-data/mysql/proc.* --error ER_NO_SUCH_TABLE call bug14233(); --error ER_NO_SUCH_TABLE create view v1 as select bug14233_f(); --error ER_NO_SUCH_TABLE insert into t1 values (0); # Restore mysql.proc --system mv var/master-data/mysql/backup/* var/master-data/mysql/ --system rmdir var/master-data/mysql/backup flush table mysql.proc; flush privileges; delete from mysql.proc where name like 'bug14233%'; # Unsupported editing of mysql.proc, circumventing checks in "create ..." insert into mysql.proc ( db, name, type, specific_name, language, sql_data_access, is_deterministic, security_type, param_list, returns, body, definer, created, modified, sql_mode, comment ) values ( 'test', 'bug14233_1', 'FUNCTION', 'bug14233_1', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'select count(*) from mysql.user', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ), ( 'test', 'bug14233_2', 'FUNCTION', 'bug14233_2', 'SQL', 'READS_SQL_DATA', 'NO', 'DEFINER', '', 'int(10)', 'begin declare x int; select count(*) into x from mysql.user; end', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ), ( 'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO', 'DEFINER', '', '', 'alksj wpsj sa ^#!@ ', 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '' ); --error ER_SP_PROC_TABLE_CORRUPT select bug14233_1(); --error ER_SP_PROC_TABLE_CORRUPT create view v1 as select bug14233_1(); --error ER_SP_PROC_TABLE_CORRUPT select bug14233_2(); --error ER_SP_PROC_TABLE_CORRUPT create view v1 as select bug14233_2(); --error ER_SP_PROC_TABLE_CORRUPT call bug14233_3(); drop trigger t1_ai; create trigger t1_ai after insert on t1 for each row call bug14233_3(); --error ER_SP_PROC_TABLE_CORRUPT insert into t1 values (0); # Clean-up delete from mysql.proc where name like 'bug14233%'; drop trigger t1_ai; drop table t1;
mysql-test/t/sp.test +2 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,8 @@ # Tests that require multiple connections, except security/privilege tests, # go to sp-thread. # Tests that uses 'goto' to into sp-goto.test (currently disabled) # Tests that destroys system tables (e.g. mysql.proc) for error testing # go to sp-destruct. use test; Loading
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -2040,19 +2040,22 @@ Qmgr::execAPI_VERSION_REQ(Signal * signal) { ApiVersionConf * conf = (ApiVersionConf *)req; if(getNodeInfo(nodeId).m_connected) { conf->version = getNodeInfo(nodeId).m_version; struct in_addr in= globalTransporterRegistry.get_connect_address(nodeId); conf->inet_addr= in.s_addr; } else { conf->version = 0; conf->inet_addr= 0; } conf->nodeId = nodeId; struct in_addr in= globalTransporterRegistry.get_connect_address(nodeId); conf->inet_addr= in.s_addr; sendSignal(senderRef, GSN_API_VERSION_CONF, signal, ApiVersionConf::SignalLength, JBB); } Loading