mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 06:44:16 +01:00
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1-ndb
into mysql.com:/windows/Linux_space/MySQL/mysql-5.1-new-ndb
This commit is contained in:
commit
f92959dea5
60 changed files with 5539 additions and 409 deletions
|
@ -1,16 +1,22 @@
|
|||
#############################################################
|
||||
# Author: Chuck
|
||||
#############################################################
|
||||
# Purpose: To test having extra columns on the master WL#3915
|
||||
# engine inspecific sourced part
|
||||
#############################################################
|
||||
|
||||
# Change Author: Jeb
|
||||
# Change: Cleanup and extend testing
|
||||
#############################################################
|
||||
# TODO: partition specific
|
||||
# -- source include/have_partition.inc
|
||||
# Note: Will be done in different test due to NDB using this
|
||||
# test case.
|
||||
############################################################
|
||||
|
||||
########### Clean up ################
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
DROP TABLE IF EXISTS t1,t2,t3,t4,t31;
|
||||
|
||||
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t10,t11,t12,t13,t14,t15,t16,t17,t18,t31;
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
|
||||
|
@ -70,154 +76,87 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t31;
|
|||
#VARCHAR(M)
|
||||
#
|
||||
|
||||
|
||||
let $binformat = `SHOW VARIABLES LIKE '%binlog_format%'`;
|
||||
--echo
|
||||
--echo ***********************************************************
|
||||
--echo ***********************************************************
|
||||
--echo ***************** Start of Testing ************************
|
||||
--echo ***********************************************************
|
||||
--echo ***********************************************************
|
||||
--echo * This test format == $binformat and engine == $engine_type
|
||||
--echo ***********************************************************
|
||||
--echo ***********************************************************
|
||||
--echo
|
||||
--echo ***** Testing more columns on the Master *****
|
||||
--echo
|
||||
connection master;
|
||||
eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
||||
f5 FLOAT DEFAULT '2.00')
|
||||
ENGINE=$engine_type;
|
||||
|
||||
sync_slave_with_master;
|
||||
alter table t1 drop f5;
|
||||
|
||||
connection master;
|
||||
INSERT into t1 values (1, 1, 1, 'first', 1.0);
|
||||
|
||||
sync_slave_with_master;
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical show slave status;
|
||||
select * from t1 order by f3;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
||||
f5 FLOAT DEFAULT '2.00',
|
||||
f6 CHAR(4) DEFAULT 'TEST')
|
||||
ENGINE=$engine_type;
|
||||
|
||||
sync_slave_with_master;
|
||||
alter table t1 drop f5, drop f6;
|
||||
|
||||
connection master;
|
||||
INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi');
|
||||
|
||||
sync_slave_with_master;
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical show slave status;
|
||||
select * from t1 order by f3;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
||||
f5 FLOAT DEFAULT '2.00',
|
||||
f6 CHAR(4) DEFAULT 'TEST',
|
||||
f7 INT DEFAULT '0')
|
||||
ENGINE=$engine_type;
|
||||
|
||||
sync_slave_with_master;
|
||||
alter table t1 drop f5, drop f6, drop f7;
|
||||
|
||||
connection master;
|
||||
INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1);
|
||||
sync_slave_with_master;
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical show slave status;
|
||||
select * from t1 order by f3;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
||||
f5 FLOAT DEFAULT '2.00',
|
||||
f6 CHAR(4) DEFAULT 'TEST',
|
||||
f7 INT DEFAULT '0',
|
||||
f8 TEXT)
|
||||
ENGINE=$engine_type;
|
||||
|
||||
sync_slave_with_master;
|
||||
alter table t1 drop f5, drop f6, drop f7, drop f8;
|
||||
|
||||
connection master;
|
||||
INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness');
|
||||
sync_slave_with_master;
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical show slave status;
|
||||
select * from t1 order by f3;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
||||
f5 FLOAT DEFAULT '2.00',
|
||||
f6 CHAR(4) DEFAULT 'TEST',
|
||||
f7 INT DEFAULT '0',
|
||||
f8 TEXT,
|
||||
f9 LONGBLOB)
|
||||
ENGINE=$engine_type;
|
||||
|
||||
sync_slave_with_master;
|
||||
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9;
|
||||
|
||||
connection master;
|
||||
INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob');
|
||||
sync_slave_with_master;
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical show slave status;
|
||||
select * from t1 order by f3;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
||||
f5 FLOAT DEFAULT '2.00',
|
||||
f6 CHAR(4) DEFAULT 'TEST',
|
||||
f7 INT DEFAULT '0',
|
||||
f8 TEXT,
|
||||
f9 LONGBLOB,
|
||||
f10 BIT(63))
|
||||
ENGINE=$engine_type;
|
||||
|
||||
sync_slave_with_master;
|
||||
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10;
|
||||
|
||||
connection master;
|
||||
INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob', b'01010101010101');
|
||||
sync_slave_with_master;
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical show slave status;
|
||||
select * from t1 order by f3;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
||||
/* extra */
|
||||
f5 FLOAT DEFAULT '2.00',
|
||||
f6 CHAR(4) DEFAULT 'TEST',
|
||||
f7 INT DEFAULT '0',
|
||||
f8 TEXT,
|
||||
f9 LONGBLOB,
|
||||
f10 BIT(63),
|
||||
f11 VARBINARY(64))
|
||||
ENGINE=$engine_type;
|
||||
|
||||
#connection slave;
|
||||
sync_slave_with_master;
|
||||
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
|
||||
f5 FLOAT DEFAULT '2.00',
|
||||
f6 CHAR(4) DEFAULT 'TEST',
|
||||
f7 INT DEFAULT '0',
|
||||
f8 TEXT,
|
||||
f9 LONGBLOB,
|
||||
f10 BIT(63),
|
||||
f11 VARBINARY(64))ENGINE=$engine_type;
|
||||
--echo
|
||||
--echo * Alter Table on Slave and drop columns f5 through f11 *
|
||||
--echo
|
||||
sync_slave_with_master;
|
||||
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
|
||||
|
||||
--echo
|
||||
--echo * Insert data in Master then update and delete some rows*
|
||||
--echo
|
||||
connection master;
|
||||
let $j= 50;
|
||||
--disable_query_log
|
||||
while ($j)
|
||||
{
|
||||
eval INSERT INTO t1 VALUES ($j, $j, $j, 'second', 2.0, 'kaks', 2,
|
||||
'got stolen from the paradise',
|
||||
'very fat blob', b'01010101010101',
|
||||
0x123456);
|
||||
dec $j;
|
||||
}
|
||||
let $j= 30;
|
||||
while ($j)
|
||||
{
|
||||
eval update t1 set f4= 'next' where f1=$j;
|
||||
dec $j;
|
||||
dec $j;
|
||||
eval delete from t1 where f1=$j;
|
||||
dec $j;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob', b'01010101010101', 0x123456);
|
||||
INSERT into t1 values (2, 2, 2, 'second', 2.0, 'kaks', 2, 'got stolen from the paradise', 'very fat blob', b'01010101010101', 0x123456), (3, 3, 3, 'third', 3.0, 'kolm', 3, 'got stolen from the paradise', 'very fat blob', b'01010101010101', 0x123456);
|
||||
update t1 set f4= 'next' where f1=1;
|
||||
delete from t1 where f1=1;
|
||||
|
||||
select * from t1 order by f3;
|
||||
|
||||
--echo * Select count and 20 rows from Master *
|
||||
--echo
|
||||
SELECT COUNT(*) FROM t1;
|
||||
--echo
|
||||
SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
|
||||
hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
|
||||
|
||||
#connection slave;
|
||||
sync_slave_with_master;
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--query_vertical show slave status;
|
||||
select * from t1 order by f3;
|
||||
sync_slave_with_master;
|
||||
--echo
|
||||
--echo * Select count and 20 rows from Slave *
|
||||
--echo
|
||||
SELECT COUNT(*) FROM t1;
|
||||
--echo
|
||||
SELECT * FROM t1 ORDER BY f3 LIMIT 20;
|
||||
|
||||
--echo
|
||||
--echo * Show Slave Status *
|
||||
--echo
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical show slave status;
|
||||
--echo
|
||||
|
||||
### Altering table def scenario
|
||||
--echo
|
||||
--echo ***** Testing Altering table def scenario *****
|
||||
--echo
|
||||
|
||||
connection master;
|
||||
|
||||
|
@ -232,7 +171,7 @@ connection master;
|
|||
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
|
||||
f12 SET('a', 'b', 'c') default 'b')
|
||||
ENGINE=$engine_type;
|
||||
|
||||
--echo
|
||||
eval CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
||||
/* extra */
|
||||
f5 DOUBLE DEFAULT '2.00',
|
||||
|
@ -243,7 +182,7 @@ connection master;
|
|||
f12 SET('a', 'b', 'c') default 'b')
|
||||
ENGINE=$engine_type;
|
||||
|
||||
|
||||
--echo
|
||||
# no ENUM and SET
|
||||
eval CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
||||
/* extra */
|
||||
|
@ -256,7 +195,7 @@ connection master;
|
|||
f11 CHAR(255))
|
||||
ENGINE=$engine_type;
|
||||
|
||||
|
||||
--echo
|
||||
eval CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
||||
|
||||
/* extra */
|
||||
|
@ -293,7 +232,9 @@ connection master;
|
|||
f34 VARBINARY(1025),
|
||||
f35 VARCHAR(257)
|
||||
) ENGINE=$engine_type;
|
||||
|
||||
--echo
|
||||
--echo ** Alter tables on slave and drop columns **
|
||||
--echo
|
||||
#connection slave;
|
||||
sync_slave_with_master;
|
||||
alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
|
||||
|
@ -308,8 +249,8 @@ f12;
|
|||
drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
|
||||
drop f33, drop f34, drop f35;
|
||||
|
||||
|
||||
|
||||
--echo
|
||||
--echo ** Insert Data into Master **
|
||||
connection master;
|
||||
INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
|
||||
some var char';
|
||||
|
@ -458,7 +399,10 @@ binary data';
|
|||
/*f34 VARBINARY(1025),*/ '3333 minus 3',
|
||||
/*f35 VARCHAR(257),*/ NULL
|
||||
);
|
||||
|
||||
--echo
|
||||
--echo ** Sync slave with master **
|
||||
--echo ** Do selects from tables **
|
||||
--echo
|
||||
#connection slave;
|
||||
sync_slave_with_master;
|
||||
|
||||
|
@ -469,24 +413,33 @@ binary data';
|
|||
select * from t31 order by f1;
|
||||
|
||||
connection master;
|
||||
|
||||
--echo
|
||||
--echo ** Do updates master **
|
||||
--echo
|
||||
update t31 set f5=555555555555555 where f3=6;
|
||||
update t31 set f2=2 where f3=2;
|
||||
update t31 set f1=NULL where f3=1;
|
||||
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
|
||||
|
||||
--echo
|
||||
--echo ** Delete from Master **
|
||||
--echo
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
delete from t3;
|
||||
delete from t4;
|
||||
delete from t31;
|
||||
|
||||
--echo
|
||||
--echo ** Check slave status **
|
||||
--echo
|
||||
#connection slave;
|
||||
sync_slave_with_master;
|
||||
select * from t31;
|
||||
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical show slave status;
|
||||
|
||||
#### Clean Up ####
|
||||
|
@ -496,11 +449,600 @@ connection master;
|
|||
--disable_query_log
|
||||
DROP TABLE t1,t2,t3,t4,t31;
|
||||
|
||||
######################################################
|
||||
#connection slave;
|
||||
sync_slave_with_master;
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo ****************************************
|
||||
--echo * columns in master at middle of table *
|
||||
--echo * Expect: Proper error message *
|
||||
--echo ****************************************
|
||||
--echo
|
||||
--echo ** Stop and Reset Slave **
|
||||
--echo
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
--echo
|
||||
--echo ** create table slave side **
|
||||
eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
|
||||
# END of the tests
|
||||
--echo
|
||||
--echo ** Connect to master and create table **
|
||||
--echo
|
||||
--connection master
|
||||
eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
|
||||
c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type;
|
||||
RESET MASTER;
|
||||
|
||||
--echo
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
|
||||
(2,@b1,DEFAULT,'JOE',DEFAULT),
|
||||
(3,@b1,DEFAULT,'QA',DEFAULT);
|
||||
|
||||
--echo
|
||||
--echo ********************************************
|
||||
--echo *** Expect slave to fail with Error 1523 ***
|
||||
--echo ********************************************
|
||||
--echo
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Drop t10 ***
|
||||
connection master;
|
||||
DROP TABLE t10;
|
||||
sync_slave_with_master;
|
||||
|
||||
############################################
|
||||
############## Continued ###################
|
||||
############################################
|
||||
--echo
|
||||
--echo *********************************************
|
||||
--echo * More columns in master at middle of table *
|
||||
--echo * Expect: Proper error message *
|
||||
--echo *********************************************
|
||||
--echo
|
||||
--echo *** Create t11 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
|
||||
eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
|
||||
) ENGINE=$engine_type;
|
||||
|
||||
--echo
|
||||
--echo *** Create t11 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
|
||||
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
--echo
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
|
||||
(2,@b1,'Testing is cool','JOE',DEFAULT),
|
||||
(3,@b1,DEFAULT,'QA',DEFAULT);
|
||||
|
||||
--echo
|
||||
--echo ********************************************
|
||||
--echo *** Expect slave to fail with Error 1523 ***
|
||||
--echo ********************************************
|
||||
--echo
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Drop t11 ***
|
||||
connection master;
|
||||
DROP TABLE t11;
|
||||
sync_slave_with_master;
|
||||
|
||||
############################################
|
||||
############## Continued ###################
|
||||
############################################
|
||||
--echo
|
||||
--echo *********************************************
|
||||
--echo * More columns in master at middle of table *
|
||||
--echo * Expect: This one should pass blob-text *
|
||||
--echo *********************************************
|
||||
--echo
|
||||
--echo *** Create t12 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
|
||||
) ENGINE=$engine_type;
|
||||
|
||||
--echo
|
||||
--echo *** Create t12 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
|
||||
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
--echo
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
|
||||
(2,@b1,'JOE',DEFAULT,DEFAULT),
|
||||
(3,@b1,'QA',DEFAULT,DEFAULT);
|
||||
--echo
|
||||
SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
|
||||
|
||||
--echo
|
||||
--echo *** Select on Slave ***
|
||||
sync_slave_with_master;
|
||||
SELECT a,hex(b),c FROM t12 ORDER BY a;
|
||||
|
||||
--echo
|
||||
--echo *** Drop t12 ***
|
||||
connection master;
|
||||
DROP TABLE t12;
|
||||
sync_slave_with_master;
|
||||
|
||||
############################################
|
||||
############## Continued ###################
|
||||
############################################
|
||||
--echo
|
||||
--echo ****************************************************
|
||||
--echo * - Alter Master adding columns at middle of table *
|
||||
--echo * Expect: columns added *
|
||||
--echo ****************************************************
|
||||
--echo
|
||||
--echo
|
||||
--echo *** Create t14 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
|
||||
--echo
|
||||
--echo *** Create t14 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE=$engine_type;
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
--echo
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
|
||||
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
|
||||
--echo
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
|
||||
(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
|
||||
(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
|
||||
--echo
|
||||
--replace_column 7 CURRENT_TIMESTAMP
|
||||
SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
|
||||
|
||||
--echo
|
||||
--echo *** Select on Slave ****
|
||||
sync_slave_with_master;
|
||||
SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
|
||||
|
||||
####################################################
|
||||
--echo
|
||||
--echo ****************************************************
|
||||
--echo * - Alter Master Dropping columns from the middle. *
|
||||
--echo * Expect: columns dropped *
|
||||
--echo ****************************************************
|
||||
--echo
|
||||
--echo *** connect to master and drop columns ***
|
||||
connection master;
|
||||
ALTER TABLE t14 DROP COLUMN c2;
|
||||
ALTER TABLE t14 DROP COLUMN c7;
|
||||
--echo
|
||||
--echo *** Select from Master ***
|
||||
SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
|
||||
--echo
|
||||
|
||||
--echo ************
|
||||
--echo * Bug30415 *
|
||||
--echo ************
|
||||
# Uncomment below once fixed
|
||||
|
||||
#--echo *** Select from Slave ***
|
||||
#sync_slave_with_master;
|
||||
#SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
|
||||
|
||||
# Bug30415
|
||||
# Remove below once fixed
|
||||
#***************************
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
#***************************
|
||||
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Drop t14 ***
|
||||
DROP TABLE t14;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t14;
|
||||
RESET MASTER;
|
||||
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
#################################################
|
||||
--echo
|
||||
--echo *************************************************
|
||||
--echo * - Alter Master adding columns at end of table *
|
||||
--echo * Expect: Error 1054 *
|
||||
--echo *************************************************
|
||||
--echo
|
||||
--echo *** Create t15 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
|
||||
--echo
|
||||
--echo *** Create t15 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE=$engine_type;
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
--echo
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
|
||||
(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
|
||||
(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
|
||||
--replace_column 5 CURRENT_TIMESTAMP
|
||||
SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
|
||||
|
||||
--echo
|
||||
--echo ********************************************
|
||||
--echo *** Expect slave to fail with Error 1054 ***
|
||||
--echo ********************************************
|
||||
--echo
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Drop t15 ***
|
||||
DROP TABLE t15;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t15;
|
||||
RESET MASTER;
|
||||
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
####################################################
|
||||
--echo
|
||||
--echo ************************************************
|
||||
--echo * - Create index on Master column not on slave *
|
||||
--echo * Expect:Warning *
|
||||
--echo ************************************************
|
||||
--echo
|
||||
--echo *** Create t16 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
|
||||
--echo
|
||||
--echo *** Create t16 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE=$engine_type;
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
--echo
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Master Create Index and Data Insert ***
|
||||
connection master;
|
||||
CREATE INDEX part_of_c6 ON t16 (c6);
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
|
||||
(2,@b1,'JOE',2,DEFAULT),
|
||||
(3,@b1,'QA',3,DEFAULT);
|
||||
--replace_column 5 CURRENT_TIMESTAMP
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
|
||||
|
||||
# Uncomment the below when bug 30434 is patched
|
||||
|
||||
#--echo *** Select on Slave ****
|
||||
#sync_slave_with_master;
|
||||
#SELECT c1,hex(c4),c5 FROM t16 ORDER BY c1;
|
||||
#
|
||||
#--echo *** Drop t16 ***
|
||||
#connection master;
|
||||
#DROP TABLE t16;
|
||||
#sync_slave_with_master;
|
||||
|
||||
# Remove the below when bug 30434 is patched
|
||||
#*******************************************
|
||||
--echo
|
||||
--echo *****************
|
||||
--echo *** BUG 30434 ***
|
||||
--echo *****************
|
||||
--echo
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Drop t16 ***
|
||||
DROP TABLE t16;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t16;
|
||||
RESET MASTER;
|
||||
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
#*******************************************
|
||||
|
||||
####################################################
|
||||
--echo
|
||||
--echo *****************************************************
|
||||
--echo * - Delete rows using column on Master not on slave *
|
||||
--echo * Expect: Rows Deleted *
|
||||
--echo *****************************************************
|
||||
--echo
|
||||
--echo *** Create t17 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
|
||||
--echo
|
||||
--echo *** Create t17 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE=$engine_type;
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
--echo
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
|
||||
(2,@b1,'JOE',2,DEFAULT),
|
||||
(3,@b1,'QA',3,DEFAULT);
|
||||
--replace_column 5 CURRENT_TIMESTAMP
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
|
||||
|
||||
--echo
|
||||
--echo ** Select * from Slave **
|
||||
sync_slave_with_master;
|
||||
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
|
||||
|
||||
--echo
|
||||
--echo ** Delete from master **
|
||||
connection master;
|
||||
DELETE FROM t17 WHERE c6 = 3;
|
||||
--replace_column 5 CURRENT_TIMESTAMP
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
|
||||
|
||||
--echo
|
||||
--echo ** Check slave **
|
||||
sync_slave_with_master;
|
||||
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
|
||||
|
||||
|
||||
connection master;
|
||||
DROP TABLE t17;
|
||||
sync_slave_with_master;
|
||||
--echo
|
||||
|
||||
####################################################
|
||||
--echo
|
||||
--echo *****************************************************
|
||||
--echo * - Update row using column on Master not on slave *
|
||||
--echo * Expect: Rows updated *
|
||||
--echo *****************************************************
|
||||
--echo
|
||||
--echo ** Bug30674 **
|
||||
--echo
|
||||
--echo *** Create t18 on slave ***
|
||||
--echo
|
||||
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
|
||||
--echo
|
||||
--echo *** Create t18 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 INT DEFAULT '1',
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE=$engine_type;
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
--echo
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
set @b1 = concat(@b1,@b1);
|
||||
|
||||
INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
|
||||
(2,@b1,'JOE',2,DEFAULT),
|
||||
(3,@b1,'QA',3,DEFAULT);
|
||||
--replace_column 5 CURRENT_TIMESTAMP
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
|
||||
|
||||
--echo
|
||||
--echo ** Select * from Slave **
|
||||
sync_slave_with_master;
|
||||
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
|
||||
|
||||
--echo
|
||||
--echo ** update from master **
|
||||
connection master;
|
||||
#######################################
|
||||
# This test should be uncommented
|
||||
# once bug30674 is patched
|
||||
#######################################
|
||||
|
||||
#***************************
|
||||
#UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
|
||||
#***************************
|
||||
|
||||
--replace_column 5 CURRENT_TIMESTAMP
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
|
||||
|
||||
--echo
|
||||
--echo ** Check slave **
|
||||
sync_slave_with_master;
|
||||
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t18;
|
||||
sync_slave_with_master;
|
||||
--echo
|
||||
|
||||
####################################################
|
||||
--echo
|
||||
--echo *****************************************************
|
||||
--echo * - Insert UUID column on Master not on slave *
|
||||
--echo * Expect: Rows inserted *
|
||||
--echo *****************************************************
|
||||
--echo
|
||||
--echo *** Create t5 on slave ***
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
||||
) ENGINE=$engine_type;
|
||||
|
||||
--echo
|
||||
--echo *** Create t5 on Master ***
|
||||
connection master;
|
||||
eval CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
||||
c6 LONG,
|
||||
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)ENGINE=$engine_type;
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
--echo
|
||||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
--echo
|
||||
--echo *** Master Data Insert ***
|
||||
connection master;
|
||||
set @b1 = 'b1b1b1b1';
|
||||
INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
|
||||
(2,@b1,'JOE',UUID(),DEFAULT),
|
||||
(3,@b1,'QA',UUID(),DEFAULT);
|
||||
--replace_column 4 UUID 5 TIME
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
|
||||
|
||||
--echo
|
||||
--echo ** Select * from Slave **
|
||||
sync_slave_with_master;
|
||||
SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t5;
|
||||
sync_slave_with_master;
|
||||
--echo
|
||||
|
||||
# END of 5.1 tests case
|
||||
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ show create database mysqltest3;
|
|||
|
||||
connection master;
|
||||
use mysqltest2;
|
||||
create table t1 (a int auto_increment primary key, b varchar(100));
|
||||
--eval create table t1 (a int auto_increment primary key, b varchar(100))engine=$engine_type;
|
||||
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
|
||||
insert into t1 (b) values(@@character_set_server);
|
||||
insert into t1 (b) values(@@collation_server);
|
||||
|
@ -146,13 +146,15 @@ set collation_server=9999998;
|
|||
|
||||
select "--- --3943--" as "";
|
||||
use test;
|
||||
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
|
||||
--eval CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=$engine_type;
|
||||
SET CHARACTER_SET_CLIENT=koi8r,
|
||||
CHARACTER_SET_CONNECTION=cp1251,
|
||||
CHARACTER_SET_RESULTS=koi8r;
|
||||
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
|
||||
SET SQL_BIG_SELECTS=1;
|
||||
select hex(c1), hex(c2) from t1;
|
||||
sync_slave_with_master;
|
||||
SET SQL_BIG_SELECTS=1;
|
||||
select hex(c1), hex(c2) from t1;
|
||||
|
||||
connection master;
|
||||
|
|
|
@ -1888,5 +1888,27 @@ set engine_condition_pushdown = 1;
|
|||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
fname lname
|
||||
Young Foo
|
||||
drop table t1;
|
||||
create table t1 (a int, b int, c int, d int, primary key using hash(a))
|
||||
engine=ndbcluster;
|
||||
insert into t1 values (10,1,100,0+0x1111);
|
||||
insert into t1 values (20,2,200,0+0x2222);
|
||||
insert into t1 values (30,3,300,0+0x3333);
|
||||
insert into t1 values (40,4,400,0+0x4444);
|
||||
insert into t1 values (50,5,500,0+0x5555);
|
||||
set engine_condition_pushdown = on;
|
||||
select a,b,d from t1
|
||||
where b in (0,1,2,5)
|
||||
order by b;
|
||||
a b d
|
||||
10 1 4369
|
||||
20 2 8738
|
||||
50 5 21845
|
||||
a b d
|
||||
10 1 4369
|
||||
20 2 8738
|
||||
50 5 21845
|
||||
Warnings:
|
||||
Warning 4294 Scan filter is too large, discarded
|
||||
set engine_condition_pushdown = @old_ecpd;
|
||||
DROP TABLE t1,t2,t3,t4,t5;
|
||||
|
|
|
@ -121,3 +121,24 @@ show tables;
|
|||
Tables_in_db
|
||||
t2
|
||||
drop database db;
|
||||
use test;
|
||||
create table `test`.`t1$EX`
|
||||
(server_id int unsigned,
|
||||
master_server_id int unsigned,
|
||||
master_epoch bigint unsigned,
|
||||
count int unsigned,
|
||||
primary key(server_id, master_server_id,
|
||||
master_epoch, count))
|
||||
engine ndb;
|
||||
show tables like '%$%';
|
||||
Tables_in_test (%$%)
|
||||
t1$EX
|
||||
use test;
|
||||
show tables like '%$%';
|
||||
Tables_in_test (%$%)
|
||||
t1$EX
|
||||
drop table `test`.`t1$EX`;
|
||||
show tables like '%$%';
|
||||
Tables_in_test (%$%)
|
||||
show tables like '%$%';
|
||||
Tables_in_test (%$%)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -122,4 +122,31 @@ connection server2;
|
|||
show tables;
|
||||
drop database db;
|
||||
|
||||
|
||||
#
|
||||
# bug#31470, ndb table with special characters in name
|
||||
# are not discovered correctly
|
||||
connection server1;
|
||||
use test;
|
||||
create table `test`.`t1$EX`
|
||||
(server_id int unsigned,
|
||||
master_server_id int unsigned,
|
||||
master_epoch bigint unsigned,
|
||||
count int unsigned,
|
||||
primary key(server_id, master_server_id,
|
||||
master_epoch, count))
|
||||
engine ndb;
|
||||
|
||||
# check that table shows up ok on both servers
|
||||
# before bugfix table would not show up on server2
|
||||
show tables like '%$%';
|
||||
connection server2;
|
||||
use test;
|
||||
show tables like '%$%';
|
||||
|
||||
# check cleanup
|
||||
drop table `test`.`t1$EX`;
|
||||
show tables like '%$%';
|
||||
|
||||
connection server1;
|
||||
show tables like '%$%';
|
||||
|
|
|
@ -61,3 +61,4 @@ visits_id myid src ip cc org ref time host entry visit_exit user_id visit_start
|
|||
SELECT * FROM visits_events;
|
||||
event_id visit_id timestamp src data visits_events_id
|
||||
20000 21231038 2007-09-18 03:59:02 Downloads/MySQL-4.1/mysql-4.1.12a-win32.zip 33712207
|
||||
DROP DATABASE track;
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -40,7 +40,7 @@ show create database mysqltest3;
|
|||
Database Create Database
|
||||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||||
use mysqltest2;
|
||||
create table t1 (a int auto_increment primary key, b varchar(100));
|
||||
create table t1 (a int auto_increment primary key, b varchar(100))engine=myisam;;
|
||||
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
|
||||
insert into t1 (b) values(@@character_set_server);
|
||||
insert into t1 (b) values(@@collation_server);
|
||||
|
@ -117,7 +117,7 @@ master-bin.000001 # Query # # create database mysqltest2 character set latin2
|
|||
master-bin.000001 # Query # # create database mysqltest3
|
||||
master-bin.000001 # Query # # drop database mysqltest3
|
||||
master-bin.000001 # Query # # create database mysqltest3
|
||||
master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
|
||||
master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=myisam
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
|
@ -177,14 +177,16 @@ select "--- --3943--" as "";
|
|||
|
||||
--- --3943--
|
||||
use test;
|
||||
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
|
||||
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=myisam;;
|
||||
SET CHARACTER_SET_CLIENT=koi8r,
|
||||
CHARACTER_SET_CONNECTION=cp1251,
|
||||
CHARACTER_SET_RESULTS=koi8r;
|
||||
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
|
||||
SET SQL_BIG_SELECTS=1;
|
||||
select hex(c1), hex(c2) from t1;
|
||||
hex(c1) hex(c2)
|
||||
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
|
||||
SET SQL_BIG_SELECTS=1;
|
||||
select hex(c1), hex(c2) from t1;
|
||||
hex(c1) hex(c2)
|
||||
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
|
||||
|
|
215
mysql-test/suite/rpl/r/rpl_row_charset_innodb.result
Normal file
215
mysql-test/suite/rpl/r/rpl_row_charset_innodb.result
Normal file
|
@ -0,0 +1,215 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
set timestamp=1000000000;
|
||||
drop database if exists mysqltest2;
|
||||
drop database if exists mysqltest3;
|
||||
create database mysqltest2 character set latin2;
|
||||
set @@character_set_server=latin5;
|
||||
create database mysqltest3;
|
||||
|
||||
--- --master--
|
||||
show create database mysqltest2;
|
||||
Database Create Database
|
||||
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
|
||||
show create database mysqltest3;
|
||||
Database Create Database
|
||||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||
|
||||
--- --slave--
|
||||
show create database mysqltest2;
|
||||
Database Create Database
|
||||
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
|
||||
show create database mysqltest3;
|
||||
Database Create Database
|
||||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||
set @@collation_server=armscii8_bin;
|
||||
drop database mysqltest3;
|
||||
create database mysqltest3;
|
||||
|
||||
--- --master--
|
||||
show create database mysqltest3;
|
||||
Database Create Database
|
||||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||||
|
||||
--- --slave--
|
||||
show create database mysqltest3;
|
||||
Database Create Database
|
||||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||||
use mysqltest2;
|
||||
create table t1 (a int auto_increment primary key, b varchar(100))engine=innodb;;
|
||||
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
|
||||
insert into t1 (b) values(@@character_set_server);
|
||||
insert into t1 (b) values(@@collation_server);
|
||||
insert into t1 (b) values(@@character_set_client);
|
||||
insert into t1 (b) values(@@character_set_connection);
|
||||
insert into t1 (b) values(@@collation_connection);
|
||||
|
||||
--- --master--
|
||||
select * from t1 order by a;
|
||||
a b
|
||||
1 armscii8
|
||||
2 armscii8_bin
|
||||
3 cp850
|
||||
4 latin2
|
||||
5 latin2_croatian_ci
|
||||
|
||||
--- --slave--
|
||||
select * from mysqltest2.t1 order by a;
|
||||
a b
|
||||
1 armscii8
|
||||
2 armscii8_bin
|
||||
3 cp850
|
||||
4 latin2
|
||||
5 latin2_croatian_ci
|
||||
select "--- --muller--" as "";
|
||||
|
||||
--- --muller--
|
||||
set character_set_client=latin1, collation_connection=latin1_german1_ci;
|
||||
truncate table t1;
|
||||
insert into t1 (b) values(@@collation_connection);
|
||||
insert into t1 (b) values(LEAST("Müller","Muffler"));
|
||||
set collation_connection=latin1_german2_ci;
|
||||
insert into t1 (b) values(@@collation_connection);
|
||||
insert into t1 (b) values(LEAST("Müller","Muffler"));
|
||||
|
||||
--- --master--
|
||||
select * from t1 order by a;
|
||||
a b
|
||||
1 latin1_german1_ci
|
||||
2 Muffler
|
||||
3 latin1_german2_ci
|
||||
4 Müller
|
||||
|
||||
--- --slave--
|
||||
select * from mysqltest2.t1 order by a;
|
||||
a b
|
||||
1 latin1_german1_ci
|
||||
2 Muffler
|
||||
3 latin1_german2_ci
|
||||
4 Müller
|
||||
select "--- --INSERT--" as "";
|
||||
|
||||
--- --INSERT--
|
||||
set @a= _cp850 'Müller' collate cp850_general_ci;
|
||||
truncate table t1;
|
||||
insert into t1 (b) values(collation(@a));
|
||||
|
||||
--- --master--
|
||||
select * from t1 order by a;
|
||||
a b
|
||||
1 cp850_general_ci
|
||||
|
||||
--- --slave--
|
||||
select * from mysqltest2.t1 order by a;
|
||||
a b
|
||||
1 cp850_general_ci
|
||||
drop database mysqltest2;
|
||||
drop database mysqltest3;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # drop database if exists mysqltest2
|
||||
master-bin.000001 # Query # # drop database if exists mysqltest3
|
||||
master-bin.000001 # Query # # create database mysqltest2 character set latin2
|
||||
master-bin.000001 # Query # # create database mysqltest3
|
||||
master-bin.000001 # Query # # drop database mysqltest3
|
||||
master-bin.000001 # Query # # create database mysqltest3
|
||||
master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=innodb
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # drop database mysqltest2
|
||||
master-bin.000001 # Query # # drop database mysqltest3
|
||||
select "--- --global--" as "";
|
||||
|
||||
--- --global--
|
||||
set global character_set_server=latin2;
|
||||
set global character_set_server=latin1;
|
||||
set global character_set_server=latin2;
|
||||
set global character_set_server=latin1;
|
||||
select "--- --oneshot--" as "";
|
||||
|
||||
--- --oneshot--
|
||||
set one_shot @@character_set_server=latin5;
|
||||
set @@max_join_size=1000;
|
||||
select @@character_set_server;
|
||||
@@character_set_server
|
||||
latin5
|
||||
select @@character_set_server;
|
||||
@@character_set_server
|
||||
latin1
|
||||
set @@character_set_server=latin5;
|
||||
select @@character_set_server;
|
||||
@@character_set_server
|
||||
latin5
|
||||
select @@character_set_server;
|
||||
@@character_set_server
|
||||
latin5
|
||||
set one_shot max_join_size=10;
|
||||
ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
|
||||
set character_set_client=9999999;
|
||||
ERROR 42000: Unknown character set: '9999999'
|
||||
set collation_server=9999998;
|
||||
ERROR HY000: Unknown collation: '9999998'
|
||||
select "--- --3943--" as "";
|
||||
|
||||
--- --3943--
|
||||
use test;
|
||||
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=innodb;;
|
||||
SET CHARACTER_SET_CLIENT=koi8r,
|
||||
CHARACTER_SET_CONNECTION=cp1251,
|
||||
CHARACTER_SET_RESULTS=koi8r;
|
||||
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
|
||||
SET SQL_BIG_SELECTS=1;
|
||||
select hex(c1), hex(c2) from t1;
|
||||
hex(c1) hex(c2)
|
||||
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
|
||||
SET SQL_BIG_SELECTS=1;
|
||||
select hex(c1), hex(c2) from t1;
|
||||
hex(c1) hex(c2)
|
||||
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
|
||||
drop table t1;
|
||||
select "--- --6676--" as "";
|
||||
|
||||
--- --6676--
|
||||
create table `t1` (
|
||||
`pk` varchar(10) not null default '',
|
||||
primary key (`pk`)
|
||||
) engine=innodb default charset=latin1;
|
||||
set @p=_latin1 'test';
|
||||
update t1 set pk='test' where pk=@p;
|
||||
drop table t1;
|
Binary file not shown.
|
@ -111,3 +111,6 @@ VALUES ('3m3l4rhs6do0sf5p1i9lr94g928a272v', '', '', INET_ATON('71.118.124.98'),
|
|||
|
||||
SELECT * FROM visits;
|
||||
SELECT * FROM visits_events;
|
||||
|
||||
DROP DATABASE track;
|
||||
# End 5.1 test case
|
||||
|
|
|
@ -12,4 +12,5 @@ set binlog_format=row;
|
|||
set binlog_format=statement;
|
||||
-- source extra/rpl_tests/rpl_extraMaster_Col.test
|
||||
|
||||
|
||||
set binlog_format=mixed;
|
||||
-- source extra/rpl_tests/rpl_extraMaster_Col.test
|
||||
|
|
|
@ -11,3 +11,5 @@ set binlog_format=row;
|
|||
set binlog_format=statement;
|
||||
-- source extra/rpl_tests/rpl_extraMaster_Col.test
|
||||
|
||||
set binlog_format=mixed;
|
||||
-- source extra/rpl_tests/rpl_extraMaster_Col.test
|
||||
|
|
1
mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt
Normal file
1
mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--innodb
|
1
mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt
Normal file
1
mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--innodb
|
9
mysql-test/suite/rpl/t/rpl_row_charset_innodb.test
Normal file
9
mysql-test/suite/rpl/t/rpl_row_charset_innodb.test
Normal file
|
@ -0,0 +1,9 @@
|
|||
########################################################
|
||||
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
|
||||
# Added to skip if ndb is default #
|
||||
########################################################
|
||||
-- source include/not_ndb_default.inc
|
||||
-- source include/have_binlog_format_row.inc
|
||||
-- source include/master-slave.inc
|
||||
let $engine_type=innodb;
|
||||
-- source extra/rpl_tests/rpl_row_charset.test
|
|
@ -1,12 +0,0 @@
|
|||
###########################################
|
||||
# Purpose: Wrapper for rpl_extraMaster_Col.test
|
||||
# Using NDB
|
||||
###########################################
|
||||
-- source include/have_ndb.inc
|
||||
-- source include/ndb_master-slave.inc
|
||||
-- source include/have_binlog_format_row.inc
|
||||
|
||||
let $engine_type = 'NDB';
|
||||
|
||||
-- source extra/rpl_tests/rpl_extraMaster_Col.test
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
###########################################
|
||||
# Purpose: Wrapper for rpl_extraMaster_Col.test
|
||||
# Using NDB
|
||||
###########################################
|
||||
-- source include/have_ndb.inc
|
||||
-- source include/ndb_master-slave.inc
|
||||
-- source include/have_binlog_format_statement.inc
|
||||
|
||||
let $engine_type = 'NDB';
|
||||
|
||||
-- source extra/rpl_tests/rpl_extraMaster_Col.test
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ show create database mysqltest3;
|
|||
Database Create Database
|
||||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||||
use mysqltest2;
|
||||
create table t1 (a int auto_increment primary key, b varchar(100));
|
||||
create table t1 (a int auto_increment primary key, b varchar(100))engine=NDB;;
|
||||
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
|
||||
insert into t1 (b) values(@@character_set_server);
|
||||
insert into t1 (b) values(@@collation_server);
|
||||
|
@ -117,29 +117,27 @@ master-bin.000001 # Query # # create database mysqltest2 character set latin2
|
|||
master-bin.000001 # Query # # create database mysqltest3
|
||||
master-bin.000001 # Query # # drop database mysqltest3
|
||||
master-bin.000001 # Query # # create database mysqltest3
|
||||
master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=NDB
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
|
||||
master-bin.000001 # Write_rows # # table_id: #
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
|
||||
master-bin.000001 # Write_rows # # table_id: #
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
|
||||
master-bin.000001 # Write_rows # # table_id: #
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # drop database mysqltest2
|
||||
master-bin.000001 # Query # # drop database mysqltest3
|
||||
select "--- --global--" as "";
|
||||
|
@ -177,14 +175,16 @@ select "--- --3943--" as "";
|
|||
|
||||
--- --3943--
|
||||
use test;
|
||||
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
|
||||
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=NDB;;
|
||||
SET CHARACTER_SET_CLIENT=koi8r,
|
||||
CHARACTER_SET_CONNECTION=cp1251,
|
||||
CHARACTER_SET_RESULTS=koi8r;
|
||||
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
|
||||
SET SQL_BIG_SELECTS=1;
|
||||
select hex(c1), hex(c2) from t1;
|
||||
hex(c1) hex(c2)
|
||||
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
|
||||
SET SQL_BIG_SELECTS=1;
|
||||
select hex(c1), hex(c2) from t1;
|
||||
hex(c1) hex(c2)
|
||||
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
|
||||
|
|
2286
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result
Normal file
2286
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,8 +1,8 @@
|
|||
########################################################
|
||||
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
|
||||
########################################################
|
||||
--source include/have_ndb.inc
|
||||
-- source include/have_binlog_format_row.inc
|
||||
-- source include/have_ndb.inc
|
||||
-- source include/have_binlog_format_mixed_or_row.inc
|
||||
-- source include/ndb_master-slave.inc
|
||||
let $engine_type=NDB;
|
||||
-- source extra/rpl_tests/rpl_row_charset.test
|
||||
|
|
14
mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test
Normal file
14
mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test
Normal file
|
@ -0,0 +1,14 @@
|
|||
#############################################################
|
||||
# Purpose: To test having extra columns on the master WL#3915
|
||||
#############################################################
|
||||
-- source include/have_ndb.inc
|
||||
-- source include/ndb_master-slave.inc
|
||||
-- source include/have_binlog_format_mixed_or_row.inc
|
||||
|
||||
let $engine_type = 'NDB';
|
||||
|
||||
set binlog_format=row;
|
||||
-- source extra/rpl_tests/rpl_extraMaster_Col.test
|
||||
|
||||
set binlog_format=mixed;
|
||||
-- source extra/rpl_tests/rpl_extraMaster_Col.test
|
|
@ -1338,9 +1338,23 @@ ha_ndbcluster_cond::generate_scan_filter(NdbScanOperation *op)
|
|||
|
||||
if (m_cond_stack)
|
||||
{
|
||||
NdbScanFilter filter(op);
|
||||
NdbScanFilter filter(op, false); // don't abort on too large
|
||||
|
||||
DBUG_RETURN(generate_scan_filter_from_cond(filter));
|
||||
int ret=generate_scan_filter_from_cond(filter);
|
||||
if (ret != 0)
|
||||
{
|
||||
const NdbError& err=filter.getNdbError();
|
||||
if (err.code == NdbScanFilter::FilterTooLarge)
|
||||
{
|
||||
// err.message has static storage
|
||||
DBUG_PRINT("info", ("%s", err.message));
|
||||
push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
err.code, err.message);
|
||||
ret=0;
|
||||
}
|
||||
}
|
||||
if (ret != 0)
|
||||
DBUG_RETURN(ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1391,7 +1405,7 @@ int ha_ndbcluster_cond::generate_scan_filter_from_key(NdbScanOperation *op,
|
|||
{
|
||||
KEY_PART_INFO* key_part= key_info->key_part;
|
||||
KEY_PART_INFO* end= key_part+key_info->key_parts;
|
||||
NdbScanFilter filter(op);
|
||||
NdbScanFilter filter(op, true); // abort on too large
|
||||
int res;
|
||||
DBUG_ENTER("generate_scan_filter_from_key");
|
||||
|
||||
|
|
|
@ -2641,8 +2641,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
|
|||
frmblob and frmlen are set, write the frm to disk
|
||||
*/
|
||||
|
||||
(void)strxnmov(path,FN_REFLEN-1,mysql_data_home,FN_ROOTDIR,
|
||||
db,FN_ROOTDIR,name,NullS);
|
||||
build_table_filename(path, FN_REFLEN-1, db, name, "", 0);
|
||||
// Save the frm file
|
||||
error= writefrm(path, frmblob, frmlen);
|
||||
my_free(frmblob, MYF(0));
|
||||
|
|
|
@ -46,6 +46,7 @@ public:
|
|||
* Length of signal
|
||||
*/
|
||||
STATIC_CONST( StaticLength = 11 );
|
||||
STATIC_CONST( MaxTotalAttrInfo = 0xFFFF );
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -1056,6 +1056,7 @@ class Ndb
|
|||
friend class NdbBlob;
|
||||
friend class NdbImpl;
|
||||
friend class Ndb_internal;
|
||||
friend class NdbScanFilterImpl;
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
|
|
@ -842,8 +842,10 @@ protected:
|
|||
virtual ~NdbOperation();
|
||||
void next(NdbOperation*); // Set next pointer
|
||||
NdbOperation* next(); // Get next pointer
|
||||
|
||||
public:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
NdbTransaction* getNdbTransaction();
|
||||
const NdbOperation* next() const;
|
||||
const NdbRecAttr* getFirstRecAttr() const;
|
||||
#endif
|
||||
|
|
|
@ -17,7 +17,8 @@ class Ndb;
|
|||
class NdbPool;
|
||||
|
||||
bool
|
||||
create_instance(Uint32 max_ndb_objects,
|
||||
create_instance(Ndb_cluster_connection* cc,
|
||||
Uint32 max_ndb_objects,
|
||||
Uint32 no_conn_obj,
|
||||
Uint32 init_no_ndb_objects);
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#define NDB_SCAN_FILTER_HPP
|
||||
|
||||
#include <ndb_types.h>
|
||||
#include <ndbapi_limits.h>
|
||||
|
||||
/**
|
||||
* @class NdbScanFilter
|
||||
|
@ -31,8 +32,13 @@ public:
|
|||
/**
|
||||
* Constructor
|
||||
* @param op The NdbOperation that the filter belongs to (is applied to).
|
||||
* @param abort_on_too_large abort transaction on filter too large
|
||||
* default: true
|
||||
* @param max_size Maximum size of generated filter in words
|
||||
*/
|
||||
NdbScanFilter(class NdbOperation * op);
|
||||
NdbScanFilter(class NdbOperation * op,
|
||||
bool abort_on_too_large = true,
|
||||
Uint32 max_size = NDB_MAX_SCANFILTER_SIZE_IN_WORDS);
|
||||
~NdbScanFilter();
|
||||
|
||||
/**
|
||||
|
@ -166,6 +172,27 @@ public:
|
|||
/** @} *********************************************************************/
|
||||
#endif
|
||||
|
||||
enum Error {
|
||||
FilterTooLarge = 4294
|
||||
};
|
||||
|
||||
/**
|
||||
* Get filter level error.
|
||||
*
|
||||
* Most errors are set only on operation level, and they abort the
|
||||
* transaction. The error FilterTooLarge is set on filter level and
|
||||
* by default it propagates to operation level and also aborts the
|
||||
* transaction.
|
||||
*
|
||||
* If option abort_on_too_large is set to false, then FilterTooLarge
|
||||
* does not propagate. One can then either ignore this error (in
|
||||
* which case no filtering is done) or try to define a new filter
|
||||
* immediately.
|
||||
*/
|
||||
const class NdbError & getNdbError() const;
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
NdbOperation * getNdbOperation();
|
||||
#endif
|
||||
private:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
friend class NdbScanFilterImpl;
|
||||
|
|
|
@ -170,6 +170,15 @@ public:
|
|||
#endif
|
||||
};
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
/**
|
||||
* Convenience method to fetch this transaction's Ndb* object
|
||||
*/
|
||||
Ndb * getNdb() {
|
||||
return theNdb;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
|
||||
/**
|
||||
* Get an NdbOperation for a table.
|
||||
|
|
|
@ -26,4 +26,6 @@
|
|||
#define NDB_MAX_TUPLE_SIZE (NDB_MAX_TUPLE_SIZE_IN_WORDS*4)
|
||||
#define NDB_MAX_ACTIVE_EVENTS 100
|
||||
|
||||
#define NDB_MAX_SCANFILTER_SIZE_IN_WORDS 50000
|
||||
|
||||
#endif
|
||||
|
|
|
@ -498,10 +498,10 @@ void getTextTransReportCounters(QQQQ) {
|
|||
// -------------------------------------------------------------------
|
||||
BaseString::snprintf(m_text, m_text_len,
|
||||
"Trans. Count = %u, Commit Count = %u, "
|
||||
"Read Count = %u, Simple Read Count = %u,\n"
|
||||
"Read Count = %u, Simple Read Count = %u, "
|
||||
"Write Count = %u, AttrInfo Count = %u, "
|
||||
"Concurrent Operations = %u, Abort Count = %u\n"
|
||||
" Scans: %u Range scans: %u",
|
||||
"Concurrent Operations = %u, Abort Count = %u"
|
||||
" Scans = %u Range scans = %u",
|
||||
theData[1],
|
||||
theData[2],
|
||||
theData[3],
|
||||
|
@ -797,9 +797,9 @@ void getTextBackupFailedToStart(QQQQ) {
|
|||
}
|
||||
void getTextBackupCompleted(QQQQ) {
|
||||
BaseString::snprintf(m_text, m_text_len,
|
||||
"Backup %u started from node %u completed\n"
|
||||
" StartGCP: %u StopGCP: %u\n"
|
||||
" #Records: %u #LogRecords: %u\n"
|
||||
"Backup %u started from node %u completed."
|
||||
" StartGCP: %u StopGCP: %u"
|
||||
" #Records: %u #LogRecords: %u"
|
||||
" Data: %u bytes Log: %u bytes",
|
||||
theData[2], refToNode(theData[1]),
|
||||
theData[3], theData[4], theData[6], theData[8],
|
||||
|
|
|
@ -145,7 +145,7 @@ CPCDAPISession::CPCDAPISession(NDB_SOCKET_TYPE sock,
|
|||
: SocketServer::Session(sock)
|
||||
, m_cpcd(cpcd)
|
||||
{
|
||||
m_input = new SocketInputStream(sock);
|
||||
m_input = new SocketInputStream(sock, 7*24*60*60000);
|
||||
m_output = new SocketOutputStream(sock);
|
||||
m_parser = new Parser<CPCDAPISession>(commands, *m_input, true, true, true);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ Next DBACC 3002
|
|||
Next DBTUP 4029
|
||||
Next DBLQH 5045
|
||||
Next DBDICT 6008
|
||||
Next DBDIH 7186
|
||||
Next DBDIH 7193
|
||||
Next DBTC 8054
|
||||
Next CMVMI 9000
|
||||
Next BACKUP 10038
|
||||
|
@ -157,6 +157,9 @@ And crash when all have "not" been sent
|
|||
7027: Crash in master when changing state to LCP_TAB_SAVED
|
||||
7018: Crash in master when changing state to LCP_TAB_SAVED
|
||||
|
||||
7191: Crash when receiving LCP_COMPLETE_REP
|
||||
7192: Crash in setLcpActiveStatusStart - when dead node missed to LCP's
|
||||
|
||||
ERROR CODES FOR TESTING NODE FAILURE, FAILURE IN COPY FRAGMENT PROCESS:
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -318,6 +318,7 @@ public:
|
|||
Uint8 noOfStartedChkpt;
|
||||
|
||||
MasterLCPConf::State lcpStateAtTakeOver;
|
||||
Uint32 m_remove_node_from_table_lcp_id;
|
||||
};
|
||||
typedef Ptr<NodeRecord> NodeRecordPtr;
|
||||
/**********************************************************************/
|
||||
|
|
|
@ -5069,6 +5069,18 @@ void Dbdih::startRemoveFailedNode(Signal* signal, NodeRecordPtr failedNodePtr)
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* If node has node complete LCP
|
||||
* we need to remove it as undo might not be complete
|
||||
* bug#31257
|
||||
*/
|
||||
failedNodePtr.p->m_remove_node_from_table_lcp_id = RNIL;
|
||||
if (c_lcpState.m_LCP_COMPLETE_REP_Counter_LQH.isWaitingFor(failedNodePtr.i))
|
||||
{
|
||||
jam();
|
||||
failedNodePtr.p->m_remove_node_from_table_lcp_id = SYSFILE->latestLCP_ID;
|
||||
}
|
||||
|
||||
jam();
|
||||
signal->theData[0] = DihContinueB::ZREMOVE_NODE_FROM_TABLE;
|
||||
signal->theData[1] = failedNodePtr.i;
|
||||
|
@ -5710,6 +5722,11 @@ void Dbdih::removeNodeFromTable(Signal* signal,
|
|||
return;
|
||||
}//if
|
||||
|
||||
NodeRecordPtr nodePtr;
|
||||
nodePtr.i = nodeId;
|
||||
ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRecord);
|
||||
const Uint32 lcpId = nodePtr.p->m_remove_node_from_table_lcp_id;
|
||||
|
||||
/**
|
||||
* For each fragment
|
||||
*/
|
||||
|
@ -5717,7 +5734,6 @@ void Dbdih::removeNodeFromTable(Signal* signal,
|
|||
Uint32 noOfRemovedLcpReplicas = 0; // No of replicas in LCP removed
|
||||
Uint32 noOfRemainingLcpReplicas = 0;// No of replicas in LCP remaining
|
||||
|
||||
//const Uint32 lcpId = SYSFILE->latestLCP_ID;
|
||||
const bool lcpOngoingFlag = (tabPtr.p->tabLcpStatus== TabRecord::TLS_ACTIVE);
|
||||
const bool unlogged = (tabPtr.p->tabStorage != TabRecord::ST_NORMAL);
|
||||
|
||||
|
@ -5752,6 +5768,23 @@ void Dbdih::removeNodeFromTable(Signal* signal,
|
|||
noOfRemovedLcpReplicas ++;
|
||||
replicaPtr.p->lcpOngoingFlag = false;
|
||||
}
|
||||
|
||||
if (lcpId != RNIL)
|
||||
{
|
||||
jam();
|
||||
Uint32 lcpNo = prevLcpNo(replicaPtr.p->nextLcp);
|
||||
if (replicaPtr.p->lcpStatus[lcpNo] == ZVALID &&
|
||||
replicaPtr.p->lcpId[lcpNo] == SYSFILE->latestLCP_ID)
|
||||
{
|
||||
jam();
|
||||
replicaPtr.p->lcpStatus[lcpNo] = ZINVALID;
|
||||
replicaPtr.p->lcpId[lcpNo] = 0;
|
||||
replicaPtr.p->nextLcp = lcpNo;
|
||||
ndbout_c("REMOVING lcp: %u from table: %u frag: %u node: %u",
|
||||
SYSFILE->latestLCP_ID,
|
||||
tabPtr.i, fragNo, nodeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
|
@ -10898,6 +10931,8 @@ void Dbdih::execLCP_COMPLETE_REP(Signal* signal)
|
|||
{
|
||||
jamEntry();
|
||||
|
||||
CRASH_INSERTION(7191);
|
||||
|
||||
#if 0
|
||||
g_eventLogger.info("LCP_COMPLETE_REP");
|
||||
printLCP_COMPLETE_REP(stdout,
|
||||
|
@ -13657,6 +13692,7 @@ void Dbdih::setLcpActiveStatusStart(Signal* signal)
|
|||
// It must be taken over with the copy fragment process after a system
|
||||
// crash. We indicate this by setting the active status to TAKE_OVER.
|
||||
/*-------------------------------------------------------------------*/
|
||||
c_lcpState.m_participatingLQH.set(nodePtr.i);
|
||||
nodePtr.p->activeStatus = Sysfile::NS_TakeOver;
|
||||
//break; // Fall through
|
||||
case Sysfile::NS_TakeOver:{
|
||||
|
@ -13699,6 +13735,7 @@ void Dbdih::setLcpActiveStatusStart(Signal* signal)
|
|||
break;
|
||||
case Sysfile::NS_ActiveMissed_2:
|
||||
jam();
|
||||
CRASH_INSERTION(7192);
|
||||
if ((nodePtr.p->nodeStatus == NodeRecord::ALIVE) &&
|
||||
(!nodePtr.p->copyCompleted)) {
|
||||
jam();
|
||||
|
|
|
@ -14084,11 +14084,16 @@ void Dblqh::execSTART_FRAGREQ(Signal* signal)
|
|||
fragptr.p->fragStatus = Fragrecord::ACTIVE_CREATION;
|
||||
}
|
||||
|
||||
c_tup->disk_restart_mark_no_lcp(tabptr.i, fragId);
|
||||
c_tup->disk_restart_lcp_id(tabptr.i, fragId, RNIL);
|
||||
jamEntry();
|
||||
|
||||
return;
|
||||
}//if
|
||||
}
|
||||
else
|
||||
{
|
||||
jam();
|
||||
c_tup->disk_restart_lcp_id(tabptr.i, fragId, lcpId);
|
||||
jamEntry();
|
||||
}
|
||||
|
||||
c_lcpId = (c_lcpId == 0 ? lcpId : c_lcpId);
|
||||
c_lcpId = (c_lcpId < lcpId ? c_lcpId : lcpId);
|
||||
|
|
|
@ -641,6 +641,8 @@ typedef Ptr<Fragoperrec> FragoperrecPtr;
|
|||
*/
|
||||
Page_request_list::Head m_page_requests[MAX_FREE_LIST];
|
||||
|
||||
DLList<Page>::Head m_unmap_pages;
|
||||
|
||||
/**
|
||||
* Current extent
|
||||
*/
|
||||
|
@ -702,7 +704,8 @@ struct Fragrecord {
|
|||
|
||||
DLList<ScanOp>::Head m_scanList;
|
||||
|
||||
enum { UC_LCP = 1, UC_CREATE = 2 };
|
||||
enum { UC_LCP = 1, UC_CREATE = 2, UC_SET_LCP = 3 };
|
||||
Uint32 m_restore_lcp_id;
|
||||
Uint32 m_undo_complete;
|
||||
Uint32 m_tablespace_id;
|
||||
Uint32 m_logfile_group_id;
|
||||
|
@ -2830,7 +2833,7 @@ private:
|
|||
public:
|
||||
int disk_page_load_hook(Uint32 page_id);
|
||||
|
||||
void disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count);
|
||||
void disk_page_unmap_callback(Uint32 when, Uint32 page, Uint32 dirty_count);
|
||||
|
||||
int disk_restart_alloc_extent(Uint32 tableId, Uint32 fragId,
|
||||
const Local_key* key, Uint32 pages);
|
||||
|
@ -2851,11 +2854,11 @@ public:
|
|||
Local_key m_key;
|
||||
};
|
||||
|
||||
void disk_restart_mark_no_lcp(Uint32 table, Uint32 frag);
|
||||
void disk_restart_lcp_id(Uint32 table, Uint32 frag, Uint32 lcpId);
|
||||
|
||||
private:
|
||||
void disk_restart_undo_next(Signal*);
|
||||
void disk_restart_undo_lcp(Uint32, Uint32, Uint32 flag);
|
||||
void disk_restart_undo_lcp(Uint32, Uint32, Uint32 flag, Uint32 lcpId);
|
||||
void disk_restart_undo_callback(Signal* signal, Uint32, Uint32);
|
||||
void disk_restart_undo_alloc(Apply_undo*);
|
||||
void disk_restart_undo_update(Apply_undo*);
|
||||
|
|
|
@ -903,8 +903,10 @@ Dbtup::disk_page_set_dirty(PagePtr pagePtr)
|
|||
}
|
||||
|
||||
void
|
||||
Dbtup::disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count)
|
||||
Dbtup::disk_page_unmap_callback(Uint32 when,
|
||||
Uint32 page_id, Uint32 dirty_count)
|
||||
{
|
||||
jamEntry();
|
||||
Ptr<GlobalPage> gpage;
|
||||
m_global_page_pool.getPtr(gpage, page_id);
|
||||
PagePtr pagePtr;
|
||||
|
@ -918,17 +920,9 @@ Dbtup::disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count)
|
|||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
Local_key key;
|
||||
key.m_page_no = pagePtr.p->m_page_no;
|
||||
key.m_file_no = pagePtr.p->m_file_no;
|
||||
|
||||
Uint32 idx = pagePtr.p->list_index;
|
||||
|
||||
ndbassert((idx & 0x8000) == 0);
|
||||
|
||||
if (DBG_DISK)
|
||||
ndbout << "disk_page_unmap_callback " << key << endl;
|
||||
|
||||
Ptr<Tablerec> tabPtr;
|
||||
tabPtr.i= pagePtr.p->m_table_id;
|
||||
ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
|
||||
|
@ -938,26 +932,89 @@ Dbtup::disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count)
|
|||
|
||||
Disk_alloc_info& alloc= fragPtr.p->m_disk_alloc_info;
|
||||
|
||||
if (dirty_count == 0)
|
||||
if (when == 0)
|
||||
{
|
||||
Uint32 free = pagePtr.p->free_space;
|
||||
Uint32 used = pagePtr.p->uncommitted_used_space;
|
||||
ddassert(free >= used);
|
||||
ddassert(alloc.calc_page_free_bits(free - used) == idx);
|
||||
/**
|
||||
* Before pageout
|
||||
*/
|
||||
jam();
|
||||
|
||||
if (DBG_DISK)
|
||||
{
|
||||
Local_key key;
|
||||
key.m_page_no = pagePtr.p->m_page_no;
|
||||
key.m_file_no = pagePtr.p->m_file_no;
|
||||
ndbout << "disk_page_unmap_callback(before) " << key
|
||||
<< " cnt: " << dirty_count << " " << (idx & ~0x8000) << endl;
|
||||
}
|
||||
|
||||
ndbassert((idx & 0x8000) == 0);
|
||||
|
||||
ArrayPool<Page> *pool= (ArrayPool<Page>*)&m_global_page_pool;
|
||||
LocalDLList<Page> list(*pool, alloc.m_dirty_pages[idx]);
|
||||
LocalDLList<Page> list2(*pool, alloc.m_unmap_pages);
|
||||
list.remove(pagePtr);
|
||||
list2.add(pagePtr);
|
||||
|
||||
if (dirty_count == 0)
|
||||
{
|
||||
jam();
|
||||
pagePtr.p->list_index = idx | 0x8000;
|
||||
|
||||
Local_key key;
|
||||
key.m_page_no = pagePtr.p->m_page_no;
|
||||
key.m_file_no = pagePtr.p->m_file_no;
|
||||
|
||||
Uint32 free = pagePtr.p->free_space;
|
||||
Uint32 used = pagePtr.p->uncommitted_used_space;
|
||||
ddassert(free >= used);
|
||||
ddassert(alloc.calc_page_free_bits(free - used) == idx);
|
||||
|
||||
Tablespace_client tsman(0, c_tsman,
|
||||
fragPtr.p->fragTableId,
|
||||
fragPtr.p->fragmentId,
|
||||
fragPtr.p->m_tablespace_id);
|
||||
|
||||
tsman.unmap_page(&key, idx);
|
||||
jamEntry();
|
||||
}
|
||||
}
|
||||
else if (when == 1)
|
||||
{
|
||||
/**
|
||||
* After page out
|
||||
*/
|
||||
jam();
|
||||
|
||||
Local_key key;
|
||||
key.m_page_no = pagePtr.p->m_page_no;
|
||||
key.m_file_no = pagePtr.p->m_file_no;
|
||||
Uint32 real_free = pagePtr.p->free_space;
|
||||
|
||||
if (DBG_DISK)
|
||||
{
|
||||
ndbout << "disk_page_unmap_callback(after) " << key
|
||||
<< " cnt: " << dirty_count << " " << (idx & ~0x8000) << endl;
|
||||
}
|
||||
|
||||
ArrayPool<Page> *pool= (ArrayPool<Page>*)&m_global_page_pool;
|
||||
LocalDLList<Page> list(*pool, alloc.m_unmap_pages);
|
||||
list.remove(pagePtr);
|
||||
|
||||
Tablespace_client tsman(0, c_tsman,
|
||||
fragPtr.p->fragTableId,
|
||||
fragPtr.p->fragmentId,
|
||||
fragPtr.p->m_tablespace_id);
|
||||
|
||||
tsman.unmap_page(&key, idx);
|
||||
jamEntry();
|
||||
pagePtr.p->list_index = idx | 0x8000;
|
||||
if (DBG_DISK && alloc.calc_page_free_bits(real_free) != (idx & ~0x8000))
|
||||
{
|
||||
ndbout << key
|
||||
<< " calc: " << alloc.calc_page_free_bits(real_free)
|
||||
<< " idx: " << (idx & ~0x8000)
|
||||
<< endl;
|
||||
}
|
||||
tsman.update_page_free_bits(&key, alloc.calc_page_free_bits(real_free));
|
||||
}
|
||||
|
||||
ArrayPool<Page> *pool= (ArrayPool<Page>*)&m_global_page_pool;
|
||||
LocalDLList<Page> list(*pool, alloc.m_dirty_pages[idx]);
|
||||
list.remove(pagePtr);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -969,8 +1026,6 @@ Dbtup::disk_page_alloc(Signal* signal,
|
|||
Disk_alloc_info& alloc= fragPtrP->m_disk_alloc_info;
|
||||
|
||||
Uint64 lsn;
|
||||
Uint32 old_free = pagePtr.p->free_space;
|
||||
Uint32 old_bits= alloc.calc_page_free_bits(old_free);
|
||||
if (tabPtrP->m_attributes[DD].m_no_of_varsize == 0)
|
||||
{
|
||||
ddassert(pagePtr.p->uncommitted_used_space > 0);
|
||||
|
@ -988,20 +1043,6 @@ Dbtup::disk_page_alloc(Signal* signal,
|
|||
|
||||
lsn= disk_page_undo_alloc(pagePtr.p, key, sz, gci, logfile_group_id);
|
||||
}
|
||||
|
||||
Uint32 new_free = pagePtr.p->free_space;
|
||||
Uint32 new_bits= alloc.calc_page_free_bits(new_free);
|
||||
|
||||
if (old_bits != new_bits)
|
||||
{
|
||||
Tablespace_client tsman(signal, c_tsman,
|
||||
fragPtrP->fragTableId,
|
||||
fragPtrP->fragmentId,
|
||||
fragPtrP->m_tablespace_id);
|
||||
|
||||
tsman.update_page_free_bits(key, new_bits, lsn);
|
||||
jamEntry();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1016,7 +1057,6 @@ Dbtup::disk_page_free(Signal *signal,
|
|||
Uint32 logfile_group_id= fragPtrP->m_logfile_group_id;
|
||||
Disk_alloc_info& alloc= fragPtrP->m_disk_alloc_info;
|
||||
Uint32 old_free= pagePtr.p->free_space;
|
||||
Uint32 old_bits= alloc.calc_page_free_bits(old_free);
|
||||
|
||||
Uint32 sz;
|
||||
Uint64 lsn;
|
||||
|
@ -1043,19 +1083,7 @@ Dbtup::disk_page_free(Signal *signal,
|
|||
}
|
||||
|
||||
Uint32 new_free = pagePtr.p->free_space;
|
||||
Uint32 new_bits = alloc.calc_page_free_bits(new_free);
|
||||
|
||||
if (old_bits != new_bits)
|
||||
{
|
||||
Tablespace_client tsman(signal, c_tsman,
|
||||
fragPtrP->fragTableId,
|
||||
fragPtrP->fragmentId,
|
||||
fragPtrP->m_tablespace_id);
|
||||
|
||||
tsman.update_page_free_bits(key, new_bits, lsn);
|
||||
jamEntry();
|
||||
}
|
||||
|
||||
Uint32 ext = pagePtr.p->m_extent_info_ptr;
|
||||
Uint32 used = pagePtr.p->uncommitted_used_space;
|
||||
Uint32 old_idx = pagePtr.p->list_index;
|
||||
|
@ -1341,15 +1369,23 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn,
|
|||
case File_formats::Undofile::UNDO_LCP_FIRST:
|
||||
case File_formats::Undofile::UNDO_LCP:
|
||||
{
|
||||
jam();
|
||||
ndbrequire(len == 3);
|
||||
Uint32 lcp = ptr[0];
|
||||
Uint32 tableId = ptr[1] >> 16;
|
||||
Uint32 fragId = ptr[1] & 0xFFFF;
|
||||
disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_LCP);
|
||||
disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_LCP, lcp);
|
||||
disk_restart_undo_next(signal);
|
||||
|
||||
if (DBG_UNDO)
|
||||
{
|
||||
ndbout_c("UNDO LCP %u (%u, %u)", lcp, tableId, fragId);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case File_formats::Undofile::UNDO_TUP_ALLOC:
|
||||
{
|
||||
jam();
|
||||
Disk_undo::Alloc* rec= (Disk_undo::Alloc*)ptr;
|
||||
preq.m_page.m_page_no = rec->m_page_no;
|
||||
preq.m_page.m_file_no = rec->m_file_no_page_idx >> 16;
|
||||
|
@ -1358,6 +1394,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn,
|
|||
}
|
||||
case File_formats::Undofile::UNDO_TUP_UPDATE:
|
||||
{
|
||||
jam();
|
||||
Disk_undo::Update* rec= (Disk_undo::Update*)ptr;
|
||||
preq.m_page.m_page_no = rec->m_page_no;
|
||||
preq.m_page.m_file_no = rec->m_file_no_page_idx >> 16;
|
||||
|
@ -1366,6 +1403,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn,
|
|||
}
|
||||
case File_formats::Undofile::UNDO_TUP_FREE:
|
||||
{
|
||||
jam();
|
||||
Disk_undo::Free* rec= (Disk_undo::Free*)ptr;
|
||||
preq.m_page.m_page_no = rec->m_page_no;
|
||||
preq.m_page.m_file_no = rec->m_file_no_page_idx >> 16;
|
||||
|
@ -1377,6 +1415,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn,
|
|||
*
|
||||
*/
|
||||
{
|
||||
jam();
|
||||
Disk_undo::Create* rec= (Disk_undo::Create*)ptr;
|
||||
Ptr<Tablerec> tabPtr;
|
||||
tabPtr.i= rec->m_table;
|
||||
|
@ -1384,12 +1423,34 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn,
|
|||
for(Uint32 i = 0; i<MAX_FRAG_PER_NODE; i++)
|
||||
if (tabPtr.p->fragrec[i] != RNIL)
|
||||
disk_restart_undo_lcp(tabPtr.i, tabPtr.p->fragid[i],
|
||||
Fragrecord::UC_CREATE);
|
||||
Fragrecord::UC_CREATE, 0);
|
||||
disk_restart_undo_next(signal);
|
||||
|
||||
if (DBG_UNDO)
|
||||
{
|
||||
ndbout_c("UNDO CREATE (%u)", tabPtr.i);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case File_formats::Undofile::UNDO_TUP_DROP:
|
||||
{
|
||||
jam();
|
||||
Disk_undo::Drop* rec = (Disk_undo::Drop*)ptr;
|
||||
Ptr<Tablerec> tabPtr;
|
||||
tabPtr.i= rec->m_table;
|
||||
ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
|
||||
for(Uint32 i = 0; i<MAX_FRAG_PER_NODE; i++)
|
||||
if (tabPtr.p->fragrec[i] != RNIL)
|
||||
disk_restart_undo_lcp(tabPtr.i, tabPtr.p->fragid[i],
|
||||
Fragrecord::UC_CREATE, 0);
|
||||
disk_restart_undo_next(signal);
|
||||
|
||||
if (DBG_UNDO)
|
||||
{
|
||||
ndbout_c("UNDO DROP (%u)", tabPtr.i);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case File_formats::Undofile::UNDO_TUP_ALLOC_EXTENT:
|
||||
jam();
|
||||
case File_formats::Undofile::UNDO_TUP_FREE_EXTENT:
|
||||
|
@ -1398,6 +1459,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn,
|
|||
return;
|
||||
|
||||
case File_formats::Undofile::UNDO_END:
|
||||
jam();
|
||||
f_undo_done = true;
|
||||
return;
|
||||
default:
|
||||
|
@ -1431,14 +1493,32 @@ Dbtup::disk_restart_undo_next(Signal* signal)
|
|||
}
|
||||
|
||||
void
|
||||
Dbtup::disk_restart_mark_no_lcp(Uint32 tableId, Uint32 fragId)
|
||||
Dbtup::disk_restart_lcp_id(Uint32 tableId, Uint32 fragId, Uint32 lcpId)
|
||||
{
|
||||
jamEntry();
|
||||
disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_CREATE);
|
||||
|
||||
if (lcpId == RNIL)
|
||||
{
|
||||
disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_CREATE, 0);
|
||||
if (DBG_UNDO)
|
||||
{
|
||||
ndbout_c("mark_no_lcp (%u, %u)", tableId, fragId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_SET_LCP, lcpId);
|
||||
if (DBG_UNDO)
|
||||
{
|
||||
ndbout_c("mark_no_lcp (%u, %u)", tableId, fragId);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId, Uint32 flag)
|
||||
Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId, Uint32 flag,
|
||||
Uint32 lcpId)
|
||||
{
|
||||
Ptr<Tablerec> tabPtr;
|
||||
tabPtr.i= tableId;
|
||||
|
@ -1446,11 +1526,43 @@ Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId, Uint32 flag)
|
|||
|
||||
if (tabPtr.p->tableStatus == DEFINED)
|
||||
{
|
||||
jam();
|
||||
FragrecordPtr fragPtr;
|
||||
getFragmentrec(fragPtr, fragId, tabPtr.p);
|
||||
if (!fragPtr.isNull())
|
||||
{
|
||||
fragPtr.p->m_undo_complete |= flag;
|
||||
jam();
|
||||
switch(flag){
|
||||
case Fragrecord::UC_CREATE:
|
||||
jam();
|
||||
fragPtr.p->m_undo_complete |= flag;
|
||||
return;
|
||||
case Fragrecord::UC_LCP:
|
||||
jam();
|
||||
if (fragPtr.p->m_undo_complete == 0 &&
|
||||
fragPtr.p->m_restore_lcp_id == lcpId)
|
||||
{
|
||||
jam();
|
||||
fragPtr.p->m_undo_complete |= flag;
|
||||
if (DBG_UNDO)
|
||||
ndbout_c("table: %u fragment: %u lcp: %u -> done",
|
||||
tableId, fragId, lcpId);
|
||||
}
|
||||
return;
|
||||
case Fragrecord::UC_SET_LCP:
|
||||
{
|
||||
jam();
|
||||
if (DBG_UNDO)
|
||||
ndbout_c("table: %u fragment: %u restore to lcp: %u",
|
||||
tableId, fragId, lcpId);
|
||||
ndbrequire(fragPtr.p->m_undo_complete == 0);
|
||||
ndbrequire(fragPtr.p->m_restore_lcp_id == RNIL);
|
||||
fragPtr.p->m_restore_lcp_id = lcpId;
|
||||
return;
|
||||
}
|
||||
}
|
||||
jamLine(flag);
|
||||
ndbrequire(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1474,6 +1586,7 @@ Dbtup::disk_restart_undo_callback(Signal* signal,
|
|||
pagePtr.p->nextList != RNIL ||
|
||||
pagePtr.p->prevList != RNIL)
|
||||
{
|
||||
jam();
|
||||
update = true;
|
||||
pagePtr.p->list_index |= 0x8000;
|
||||
pagePtr.p->nextList = pagePtr.p->prevList = RNIL;
|
||||
|
@ -1484,6 +1597,9 @@ Dbtup::disk_restart_undo_callback(Signal* signal,
|
|||
|
||||
if (tableId >= cnoOfTablerec)
|
||||
{
|
||||
jam();
|
||||
if (DBG_UNDO)
|
||||
ndbout_c("UNDO table> %u", tableId);
|
||||
disk_restart_undo_next(signal);
|
||||
return;
|
||||
}
|
||||
|
@ -1492,6 +1608,9 @@ Dbtup::disk_restart_undo_callback(Signal* signal,
|
|||
|
||||
if (undo->m_table_ptr.p->tableStatus != DEFINED)
|
||||
{
|
||||
jam();
|
||||
if (DBG_UNDO)
|
||||
ndbout_c("UNDO !defined (%u) ", tableId);
|
||||
disk_restart_undo_next(signal);
|
||||
return;
|
||||
}
|
||||
|
@ -1499,19 +1618,25 @@ Dbtup::disk_restart_undo_callback(Signal* signal,
|
|||
getFragmentrec(undo->m_fragment_ptr, fragId, undo->m_table_ptr.p);
|
||||
if(undo->m_fragment_ptr.isNull())
|
||||
{
|
||||
jam();
|
||||
if (DBG_UNDO)
|
||||
ndbout_c("UNDO fragment null %u/%u", tableId, fragId);
|
||||
disk_restart_undo_next(signal);
|
||||
return;
|
||||
}
|
||||
|
||||
if (undo->m_fragment_ptr.p->m_undo_complete)
|
||||
{
|
||||
jam();
|
||||
if (DBG_UNDO)
|
||||
ndbout_c("UNDO undo complete %u/%u", tableId, fragId);
|
||||
disk_restart_undo_next(signal);
|
||||
return;
|
||||
}
|
||||
|
||||
Local_key key;
|
||||
key.m_page_no = pagePtr.p->m_page_no;
|
||||
key.m_file_no = pagePtr.p->m_file_no;
|
||||
Local_key key = undo->m_key;
|
||||
// key.m_page_no = pagePtr.p->m_page_no;
|
||||
// key.m_file_no = pagePtr.p->m_file_no;
|
||||
|
||||
Uint64 lsn = 0;
|
||||
lsn += pagePtr.p->m_page_header.m_page_lsn_hi; lsn <<= 32;
|
||||
|
@ -1521,6 +1646,7 @@ Dbtup::disk_restart_undo_callback(Signal* signal,
|
|||
|
||||
if (undo->m_lsn <= lsn)
|
||||
{
|
||||
jam();
|
||||
if (DBG_UNDO)
|
||||
{
|
||||
ndbout << "apply: " << undo->m_lsn << "(" << lsn << " )"
|
||||
|
@ -1535,12 +1661,15 @@ Dbtup::disk_restart_undo_callback(Signal* signal,
|
|||
*/
|
||||
switch(undo->m_type){
|
||||
case File_formats::Undofile::UNDO_TUP_ALLOC:
|
||||
jam();
|
||||
disk_restart_undo_alloc(undo);
|
||||
break;
|
||||
case File_formats::Undofile::UNDO_TUP_UPDATE:
|
||||
jam();
|
||||
disk_restart_undo_update(undo);
|
||||
break;
|
||||
case File_formats::Undofile::UNDO_TUP_FREE:
|
||||
jam();
|
||||
disk_restart_undo_free(undo);
|
||||
break;
|
||||
default:
|
||||
|
@ -1555,14 +1684,17 @@ Dbtup::disk_restart_undo_callback(Signal* signal,
|
|||
|
||||
m_pgman.update_lsn(undo->m_key, lsn);
|
||||
jamEntry();
|
||||
|
||||
disk_restart_undo_page_bits(signal, undo);
|
||||
}
|
||||
else if (DBG_UNDO)
|
||||
{
|
||||
jam();
|
||||
ndbout << "ignore: " << undo->m_lsn << "(" << lsn << " )"
|
||||
<< key << " type: " << undo->m_type << endl;
|
||||
<< key << " type: " << undo->m_type
|
||||
<< " tab: " << tableId << endl;
|
||||
}
|
||||
|
||||
disk_restart_undo_page_bits(signal, undo);
|
||||
disk_restart_undo_next(signal);
|
||||
}
|
||||
|
||||
|
@ -1637,16 +1769,12 @@ Dbtup::disk_restart_undo_page_bits(Signal* signal, Apply_undo* undo)
|
|||
Uint32 new_bits = alloc.calc_page_free_bits(free);
|
||||
pageP->list_index = 0x8000 | new_bits;
|
||||
|
||||
Uint64 lsn = 0;
|
||||
lsn += pageP->m_page_header.m_page_lsn_hi; lsn <<= 32;
|
||||
lsn += pageP->m_page_header.m_page_lsn_lo;
|
||||
|
||||
Tablespace_client tsman(signal, c_tsman,
|
||||
fragPtrP->fragTableId,
|
||||
fragPtrP->fragmentId,
|
||||
fragPtrP->m_tablespace_id);
|
||||
|
||||
tsman.restart_undo_page_free_bits(&undo->m_key, new_bits, undo->m_lsn, lsn);
|
||||
tsman.restart_undo_page_free_bits(&undo->m_key, new_bits);
|
||||
jamEntry();
|
||||
}
|
||||
|
||||
|
@ -1683,6 +1811,7 @@ Dbtup::disk_restart_alloc_extent(Uint32 tableId, Uint32 fragId,
|
|||
|
||||
if (alloc.m_curr_extent_info_ptr_i != RNIL)
|
||||
{
|
||||
jam();
|
||||
Ptr<Extent_info> old;
|
||||
c_extent_pool.getPtr(old, alloc.m_curr_extent_info_ptr_i);
|
||||
ndbassert(old.p->m_free_matrix_pos == RNIL);
|
||||
|
@ -1709,6 +1838,7 @@ void
|
|||
Dbtup::disk_restart_page_bits(Uint32 tableId, Uint32 fragId,
|
||||
const Local_key*, Uint32 bits)
|
||||
{
|
||||
jam();
|
||||
TablerecPtr tabPtr;
|
||||
FragrecordPtr fragPtr;
|
||||
tabPtr.i = tableId;
|
||||
|
|
|
@ -143,6 +143,7 @@ void Dbtup::execTUPFRAGREQ(Signal* signal)
|
|||
regFragPtr.p->m_lcp_scan_op = RNIL;
|
||||
regFragPtr.p->m_lcp_keep_list = RNIL;
|
||||
regFragPtr.p->m_var_page_chunks = RNIL;
|
||||
regFragPtr.p->m_restore_lcp_id = RNIL;
|
||||
|
||||
if (ERROR_INSERTED(4007) && regTabPtr.p->fragid[0] == fragId ||
|
||||
ERROR_INSERTED(4008) && regTabPtr.p->fragid[1] == fragId) {
|
||||
|
@ -674,11 +675,11 @@ Dbtup::undo_createtable_callback(Signal* signal, Uint32 opPtrI, Uint32 unused)
|
|||
switch(ret){
|
||||
case 0:
|
||||
return;
|
||||
case -1:
|
||||
warningEvent("Failed to sync log for create of table: %u", regTabPtr.i);
|
||||
default:
|
||||
ndbout_c("ret: %d", ret);
|
||||
ndbrequire(false);
|
||||
execute(signal, req.m_callback, regFragPtr.p->m_logfile_group_id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -959,8 +960,6 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId,
|
|||
return;
|
||||
}
|
||||
|
||||
#if NOT_YET_UNDO_DROP_TABLE
|
||||
#error "This code is complete, but I prefer not to enable it until I need it"
|
||||
if (logfile_group_id != RNIL)
|
||||
{
|
||||
Callback cb;
|
||||
|
@ -968,8 +967,15 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId,
|
|||
cb.m_callbackFunction =
|
||||
safe_cast(&Dbtup::drop_table_log_buffer_callback);
|
||||
Uint32 sz= sizeof(Disk_undo::Drop) >> 2;
|
||||
(void) c_lgman->alloc_log_space(logfile_group_id, sz);
|
||||
|
||||
int r0 = c_lgman->alloc_log_space(logfile_group_id, sz);
|
||||
if (r0)
|
||||
{
|
||||
jam();
|
||||
warningEvent("Failed to alloc log space for drop table: %u",
|
||||
tabPtr.i);
|
||||
goto done;
|
||||
}
|
||||
|
||||
Logfile_client lgman(this, c_lgman, logfile_group_id);
|
||||
int res= lgman.get_log_buffer(signal, sz, &cb);
|
||||
switch(res){
|
||||
|
@ -977,15 +983,18 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId,
|
|||
jam();
|
||||
return;
|
||||
case -1:
|
||||
ndbrequire("NOT YET IMPLEMENTED" == 0);
|
||||
warningEvent("Failed to get log buffer for drop table: %u",
|
||||
tabPtr.i);
|
||||
c_lgman->free_log_space(logfile_group_id, sz);
|
||||
goto done;
|
||||
break;
|
||||
default:
|
||||
execute(signal, cb, logfile_group_id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
done:
|
||||
drop_table_logsync_callback(signal, tabPtr.i, RNIL);
|
||||
}
|
||||
|
||||
|
@ -997,7 +1006,20 @@ Dbtup::drop_fragment_unmap_pages(Signal *signal,
|
|||
{
|
||||
if (tabPtr.p->m_no_of_disk_attributes)
|
||||
{
|
||||
jam();
|
||||
Disk_alloc_info& alloc_info= fragPtr.p->m_disk_alloc_info;
|
||||
|
||||
if (!alloc_info.m_unmap_pages.isEmpty())
|
||||
{
|
||||
jam();
|
||||
ndbout_c("waiting for unmape pages");
|
||||
signal->theData[0] = ZUNMAP_PAGES;
|
||||
signal->theData[1] = tabPtr.i;
|
||||
signal->theData[2] = fragPtr.i;
|
||||
signal->theData[3] = pos;
|
||||
sendSignal(cownref, GSN_CONTINUEB, signal, 4, JBB);
|
||||
return;
|
||||
}
|
||||
while(alloc_info.m_dirty_pages[pos].isEmpty() && pos < MAX_FREE_LIST)
|
||||
pos++;
|
||||
|
||||
|
@ -1164,9 +1186,10 @@ Dbtup::drop_table_log_buffer_callback(Signal* signal, Uint32 tablePtrI,
|
|||
switch(ret){
|
||||
case 0:
|
||||
return;
|
||||
case -1:
|
||||
warningEvent("Failed to syn log for drop of table: %u", tablePtrI);
|
||||
default:
|
||||
ndbout_c("ret: %d", ret);
|
||||
ndbrequire(false);
|
||||
execute(signal, req.m_callback, logfile_group_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -772,7 +772,7 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr)
|
|||
uncommitted = committed = ~(unsigned)0;
|
||||
int ret = tsman.get_page_free_bits(&key, &uncommitted, &committed);
|
||||
ndbrequire(ret == 0);
|
||||
if (committed == 0) {
|
||||
if (committed == 0 && uncommitted == 0) {
|
||||
// skip empty page
|
||||
jam();
|
||||
pos.m_get = ScanPos::Get_next_page_dd;
|
||||
|
|
|
@ -2701,8 +2701,16 @@ Lgman::execute_undo_record(Signal* signal)
|
|||
Uint32 lcp = * (ptr - len + 1);
|
||||
if(m_latest_lcp && lcp > m_latest_lcp)
|
||||
{
|
||||
// Just ignore
|
||||
break;
|
||||
if (0)
|
||||
{
|
||||
const Uint32 * base = ptr - len + 1;
|
||||
Uint32 lcp = base[0];
|
||||
Uint32 tableId = base[1] >> 16;
|
||||
Uint32 fragId = base[1] & 0xFFFF;
|
||||
|
||||
ndbout_c("NOT! ignoring lcp: %u tab: %u frag: %u",
|
||||
lcp, tableId, fragId);
|
||||
}
|
||||
}
|
||||
|
||||
if(m_latest_lcp == 0 ||
|
||||
|
|
|
@ -500,6 +500,11 @@ Pgman::release_page_entry(Ptr<Page_entry>& ptr)
|
|||
|
||||
if (! (state & Page_entry::LOCKED))
|
||||
ndbrequire(! (state & Page_entry::REQUEST));
|
||||
|
||||
if (ptr.p->m_copy_page_i != RNIL)
|
||||
{
|
||||
m_global_page_pool.release(ptr.p->m_copy_page_i);
|
||||
}
|
||||
|
||||
set_page_state(ptr, 0);
|
||||
m_page_hashlist.remove(ptr);
|
||||
|
@ -1149,7 +1154,8 @@ Pgman::process_cleanup(Signal* signal)
|
|||
#ifdef VM_TRACE
|
||||
debugOut << "PGMAN: " << ptr << " : process_cleanup" << endl;
|
||||
#endif
|
||||
c_tup->disk_page_unmap_callback(ptr.p->m_real_page_i,
|
||||
c_tup->disk_page_unmap_callback(0,
|
||||
ptr.p->m_real_page_i,
|
||||
ptr.p->m_dirty_count);
|
||||
pageout(signal, ptr);
|
||||
max_count--;
|
||||
|
@ -1187,6 +1193,11 @@ Pgman::move_cleanup_ptr(Ptr<Page_entry> ptr)
|
|||
void
|
||||
Pgman::execLCP_FRAG_ORD(Signal* signal)
|
||||
{
|
||||
if (ERROR_INSERTED(11008))
|
||||
{
|
||||
ndbout_c("Ignore LCP_FRAG_ORD");
|
||||
return;
|
||||
}
|
||||
LcpFragOrd* ord = (LcpFragOrd*)signal->getDataPtr();
|
||||
ndbrequire(ord->lcpId >= m_last_lcp_complete + 1 || m_last_lcp_complete == 0);
|
||||
m_last_lcp = ord->lcpId;
|
||||
|
@ -1203,6 +1214,12 @@ Pgman::execLCP_FRAG_ORD(Signal* signal)
|
|||
void
|
||||
Pgman::execEND_LCP_REQ(Signal* signal)
|
||||
{
|
||||
if (ERROR_INSERTED(11008))
|
||||
{
|
||||
ndbout_c("Ignore END_LCP");
|
||||
return;
|
||||
}
|
||||
|
||||
EndLcpReq* req = (EndLcpReq*)signal->getDataPtr();
|
||||
m_end_lcp_req = *req;
|
||||
|
||||
|
@ -1281,7 +1298,8 @@ Pgman::process_lcp(Signal* signal)
|
|||
{
|
||||
DBG_LCP(" pageout()" << endl);
|
||||
ptr.p->m_state |= Page_entry::LCP;
|
||||
c_tup->disk_page_unmap_callback(ptr.p->m_real_page_i,
|
||||
c_tup->disk_page_unmap_callback(0,
|
||||
ptr.p->m_real_page_i,
|
||||
ptr.p->m_dirty_count);
|
||||
pageout(signal, ptr);
|
||||
}
|
||||
|
@ -1503,6 +1521,10 @@ Pgman::fswriteconf(Signal* signal, Ptr<Page_entry> ptr)
|
|||
Page_state state = ptr.p->m_state;
|
||||
ndbrequire(state & Page_entry::PAGEOUT);
|
||||
|
||||
c_tup->disk_page_unmap_callback(1,
|
||||
ptr.p->m_real_page_i,
|
||||
ptr.p->m_dirty_count);
|
||||
|
||||
state &= ~ Page_entry::PAGEOUT;
|
||||
state &= ~ Page_entry::EMPTY;
|
||||
state &= ~ Page_entry::DIRTY;
|
||||
|
@ -1756,7 +1778,7 @@ Pgman::get_page(Signal* signal, Ptr<Page_entry> ptr, Page_request page_req)
|
|||
#endif
|
||||
|
||||
state |= Page_entry::REQUEST;
|
||||
if (only_request && req_flags & Page_request::EMPTY_PAGE)
|
||||
if (only_request && (req_flags & Page_request::EMPTY_PAGE))
|
||||
{
|
||||
state |= Page_entry::EMPTY;
|
||||
}
|
||||
|
@ -2418,7 +2440,8 @@ Pgman::execDUMP_STATE_ORD(Signal* signal)
|
|||
if (pl_hash.find(ptr, key))
|
||||
{
|
||||
ndbout << "pageout " << ptr << endl;
|
||||
c_tup->disk_page_unmap_callback(ptr.p->m_real_page_i,
|
||||
c_tup->disk_page_unmap_callback(0,
|
||||
ptr.p->m_real_page_i,
|
||||
ptr.p->m_dirty_count);
|
||||
pageout(signal, ptr);
|
||||
}
|
||||
|
@ -2474,6 +2497,11 @@ Pgman::execDUMP_STATE_ORD(Signal* signal)
|
|||
{
|
||||
SET_ERROR_INSERT_VALUE(11007);
|
||||
}
|
||||
|
||||
if (signal->theData[0] == 11008)
|
||||
{
|
||||
SET_ERROR_INSERT_VALUE(11008);
|
||||
}
|
||||
}
|
||||
|
||||
// page cache client
|
||||
|
|
|
@ -299,7 +299,7 @@ Tsman::execDUMP_STATE_ORD(Signal* signal){
|
|||
Uint32 new_bits = curr_bits ^ rand();
|
||||
Local_key key = chunks[chunk].start_page;
|
||||
key.m_page_no += page;
|
||||
ndbrequire(update_page_free_bits(signal, &key, new_bits, 0) == 0);
|
||||
ndbrequire(update_page_free_bits(signal, &key, new_bits) == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -366,6 +366,20 @@ Tsman::execCREATE_FILEGROUP_REQ(Signal* signal){
|
|||
CreateFilegroupImplRef::SignalLength, JBB);
|
||||
}
|
||||
|
||||
NdbOut&
|
||||
operator<<(NdbOut& out, const File_formats::Datafile::Extent_header & obj)
|
||||
{
|
||||
out << "table: " << obj.m_table
|
||||
<< " fragment: " << obj.m_fragment_id << " ";
|
||||
for(Uint32 i = 0; i<32; i++)
|
||||
{
|
||||
char t[2];
|
||||
BaseString::snprintf(t, sizeof(t), "%x", obj.get_free_bits(i));
|
||||
out << t;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
void
|
||||
Tsman::execDROP_FILEGROUP_REQ(Signal* signal){
|
||||
jamEntry();
|
||||
|
@ -1590,8 +1604,7 @@ Tsman::execFREE_EXTENT_REQ(Signal* signal)
|
|||
int
|
||||
Tsman::update_page_free_bits(Signal* signal,
|
||||
Local_key *key,
|
||||
unsigned committed_bits,
|
||||
Uint64 lsn)
|
||||
unsigned committed_bits)
|
||||
{
|
||||
jamEntry();
|
||||
|
||||
|
@ -1626,6 +1639,18 @@ Tsman::update_page_free_bits(Signal* signal,
|
|||
File_formats::Datafile::Extent_header* header =
|
||||
page->get_header(val.m_extent_no, val.m_extent_size);
|
||||
|
||||
if (header->m_table == RNIL)
|
||||
{
|
||||
ndbout << "update page free bits page: " << *key
|
||||
<< " " << *header << endl;
|
||||
}
|
||||
|
||||
if (0)
|
||||
{
|
||||
ndbout << "update page free bits page(" << committed_bits << ") "
|
||||
<< *key << " " << *header << endl;
|
||||
}
|
||||
|
||||
ndbrequire(header->m_table != RNIL);
|
||||
|
||||
Uint32 page_no_in_extent = calc_page_no_in_extent(key->m_page_no, &val);
|
||||
|
@ -1637,7 +1662,7 @@ Tsman::update_page_free_bits(Signal* signal,
|
|||
Uint32 src = header->get_free_bits(page_no_in_extent) & UNCOMMITTED_MASK;
|
||||
header->update_free_bits(page_no_in_extent, src | committed_bits);
|
||||
|
||||
m_page_cache_client.update_lsn(preq.m_page, lsn);
|
||||
m_page_cache_client.update_lsn(preq.m_page, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1725,6 +1750,11 @@ Tsman::unmap_page(Signal* signal, Local_key *key, Uint32 uncommitted_bits)
|
|||
File_formats::Datafile::Extent_header* header =
|
||||
page->get_header(val.m_extent_no, val.m_extent_size);
|
||||
|
||||
if (header->m_table == RNIL)
|
||||
{
|
||||
ndbout << "trying to unmap page: " << *key
|
||||
<< " " << *header << endl;
|
||||
}
|
||||
ndbrequire(header->m_table != RNIL);
|
||||
|
||||
Uint32 page_no_in_extent = calc_page_no_in_extent(key->m_page_no, &val);
|
||||
|
@ -1746,9 +1776,7 @@ Tsman::restart_undo_page_free_bits(Signal* signal,
|
|||
Uint32 tableId,
|
||||
Uint32 fragId,
|
||||
Local_key *key,
|
||||
unsigned bits,
|
||||
Uint64 undo_lsn,
|
||||
Uint64 page_lsn)
|
||||
unsigned bits)
|
||||
{
|
||||
jamEntry();
|
||||
|
||||
|
@ -1782,21 +1810,7 @@ Tsman::restart_undo_page_free_bits(Signal* signal,
|
|||
(File_formats::Datafile::Extent_page*)ptr_p;
|
||||
File_formats::Datafile::Extent_header* header =
|
||||
page->get_header(val.m_extent_no, val.m_extent_size);
|
||||
|
||||
Uint64 lsn = 0;
|
||||
lsn += page->m_page_header.m_page_lsn_hi; lsn <<= 32;
|
||||
lsn += page->m_page_header.m_page_lsn_lo;
|
||||
|
||||
if (undo_lsn > lsn && undo_lsn > page_lsn)
|
||||
{
|
||||
if (DBG_UNDO)
|
||||
ndbout << "tsman: ignore " << undo_lsn << "(" << lsn << ", "
|
||||
<< page_lsn << ") "
|
||||
<< *key << " "
|
||||
<< " -> " << bits << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (header->m_table == RNIL)
|
||||
{
|
||||
if (DBG_UNDO)
|
||||
|
@ -1815,7 +1829,7 @@ Tsman::restart_undo_page_free_bits(Signal* signal,
|
|||
*/
|
||||
if (DBG_UNDO)
|
||||
{
|
||||
ndbout << "tsman: apply " << undo_lsn << "(" << lsn << ") "
|
||||
ndbout << "tsman: apply "
|
||||
<< *key << " " << (src & COMMITTED_MASK)
|
||||
<< " -> " << bits << endl;
|
||||
}
|
||||
|
@ -1863,7 +1877,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
|
|||
/**
|
||||
* Handling of unmapped extent header pages is not implemented
|
||||
*/
|
||||
int flags = 0;
|
||||
int flags = Page_cache_client::DIRTY_REQ;
|
||||
int real_page_id;
|
||||
Uint32 page_no;
|
||||
Uint32 src_bits;
|
||||
|
|
|
@ -209,12 +209,12 @@ private:
|
|||
void load_extent_page_callback(Signal*, Uint32, Uint32);
|
||||
void create_file_ref(Signal*, Ptr<Tablespace>, Ptr<Datafile>,
|
||||
Uint32,Uint32,Uint32);
|
||||
int update_page_free_bits(Signal*, Local_key*, unsigned committed_bits,
|
||||
Uint64 lsn);
|
||||
int update_page_free_bits(Signal*, Local_key*, unsigned committed_bits);
|
||||
|
||||
int get_page_free_bits(Signal*, Local_key*, unsigned*, unsigned*);
|
||||
int unmap_page(Signal*, Local_key*, unsigned uncommitted_bits);
|
||||
int restart_undo_page_free_bits(Signal*, Uint32, Uint32, Local_key*,
|
||||
unsigned committed_bits, Uint64, Uint64);
|
||||
unsigned committed_bits);
|
||||
|
||||
int alloc_extent(Signal* signal, Uint32 tablespace, Local_key* key);
|
||||
int alloc_page_from_extent(Signal*, Uint32, Local_key*, Uint32 bits);
|
||||
|
@ -320,7 +320,7 @@ public:
|
|||
/**
|
||||
* Update page free bits
|
||||
*/
|
||||
int update_page_free_bits(Local_key*, unsigned bits, Uint64 lsn);
|
||||
int update_page_free_bits(Local_key*, unsigned bits);
|
||||
|
||||
/**
|
||||
* Get page free bits
|
||||
|
@ -336,8 +336,7 @@ public:
|
|||
/**
|
||||
* Undo handling of page bits
|
||||
*/
|
||||
int restart_undo_page_free_bits(Local_key*, unsigned bits,
|
||||
Uint64 lsn, Uint64 page_lsn);
|
||||
int restart_undo_page_free_bits(Local_key*, unsigned bits);
|
||||
|
||||
/**
|
||||
* Get tablespace info
|
||||
|
@ -417,10 +416,9 @@ Tablespace_client::free_extent(Local_key* key, Uint64 lsn)
|
|||
inline
|
||||
int
|
||||
Tablespace_client::update_page_free_bits(Local_key *key,
|
||||
unsigned committed_bits,
|
||||
Uint64 lsn)
|
||||
unsigned committed_bits)
|
||||
{
|
||||
return m_tsman->update_page_free_bits(m_signal, key, committed_bits, lsn);
|
||||
return m_tsman->update_page_free_bits(m_signal, key, committed_bits);
|
||||
}
|
||||
|
||||
inline
|
||||
|
@ -442,17 +440,13 @@ Tablespace_client::unmap_page(Local_key *key, unsigned uncommitted_bits)
|
|||
inline
|
||||
int
|
||||
Tablespace_client::restart_undo_page_free_bits(Local_key* key,
|
||||
unsigned committed_bits,
|
||||
Uint64 lsn,
|
||||
Uint64 page_lsn)
|
||||
unsigned committed_bits)
|
||||
{
|
||||
return m_tsman->restart_undo_page_free_bits(m_signal,
|
||||
m_table_id,
|
||||
m_fragment_id,
|
||||
key,
|
||||
committed_bits,
|
||||
lsn,
|
||||
page_lsn);
|
||||
committed_bits);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -269,8 +269,8 @@ static const char* helpText =
|
|||
"CLUSTERLOG TOGGLE [<severity>] ... Toggle severity filter on/off\n"
|
||||
"CLUSTERLOG INFO Print cluster log information\n"
|
||||
"<id> START Start data node (started with -n)\n"
|
||||
"<id> RESTART [-n] [-i] Restart data or management server node\n"
|
||||
"<id> STOP Stop data or management server node\n"
|
||||
"<id> RESTART [-n] [-i] [-a] Restart data or management server node\n"
|
||||
"<id> STOP [-a] Stop data or management server node\n"
|
||||
"ENTER SINGLE USER MODE <id> Enter single user mode\n"
|
||||
"EXIT SINGLE USER MODE Exit single user mode\n"
|
||||
"<id> STATUS Print status\n"
|
||||
|
@ -434,7 +434,7 @@ static const char* helpTextRestart =
|
|||
" NDB Cluster -- Management Client -- Help for RESTART command\n"
|
||||
"---------------------------------------------------------------------------\n"
|
||||
"RESTART Restart data or management server node\n\n"
|
||||
"<id> RESTART [-n] [-i] \n"
|
||||
"<id> RESTART [-n] [-i] [-a]\n"
|
||||
" Restart the data or management node <id>(or All data nodes).\n\n"
|
||||
" -n (--nostart) restarts the node but does not\n"
|
||||
" make it join the cluster. Use '<id> START' to\n"
|
||||
|
@ -445,6 +445,7 @@ static const char* helpTextRestart =
|
|||
" in the same node group during start up.\n\n"
|
||||
" Consult the documentation before using -i.\n\n"
|
||||
" INCORRECT USE OF -i WILL CAUSE DATA LOSS!\n"
|
||||
" -a Aborts the node, not syncing GCP.\n"
|
||||
;
|
||||
|
||||
static const char* helpTextStop =
|
||||
|
@ -452,10 +453,11 @@ static const char* helpTextStop =
|
|||
" NDB Cluster -- Management Client -- Help for STOP command\n"
|
||||
"---------------------------------------------------------------------------\n"
|
||||
"STOP Stop data or management server node\n\n"
|
||||
"<id> STOP Stop the data or management server node <id>.\n\n"
|
||||
"<id> STOP [-a] Stop the data or management server node <id>.\n\n"
|
||||
" ALL STOP will just stop all data nodes.\n\n"
|
||||
" If you desire to also shut down management servers,\n"
|
||||
" use SHUTDOWN instead.\n"
|
||||
" use SHUTDOWN instead.\n"
|
||||
" -a Aborts the node, not syncing GCP.\n"
|
||||
;
|
||||
|
||||
static const char* helpTextEnterSingleUserMode =
|
||||
|
|
|
@ -234,10 +234,10 @@ MgmtSrvr::startEventLog()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
MgmtSrvr::stopEventLog()
|
||||
void
|
||||
MgmtSrvr::stopEventLog()
|
||||
{
|
||||
// Nothing yet
|
||||
g_eventLogger.close();
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -429,3 +429,9 @@ NdbOperation::getTable() const
|
|||
{
|
||||
return m_currentTable;
|
||||
}
|
||||
|
||||
NdbTransaction*
|
||||
NdbOperation::getNdbTransaction()
|
||||
{
|
||||
return theNdbCon;
|
||||
}
|
||||
|
|
|
@ -14,11 +14,15 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#include <NdbScanFilter.hpp>
|
||||
#include <Ndb.hpp>
|
||||
#include <NdbOperation.hpp>
|
||||
#include "NdbDictionaryImpl.hpp"
|
||||
#include <Vector.hpp>
|
||||
#include <NdbOut.hpp>
|
||||
#include <Interpreter.hpp>
|
||||
#include <signaldata/AttrInfo.hpp>
|
||||
#include "NdbApiSignal.hpp"
|
||||
#include "NdbUtil.hpp"
|
||||
|
||||
#ifdef VM_TRACE
|
||||
#include <NdbEnv.h>
|
||||
|
@ -52,14 +56,37 @@ public:
|
|||
|
||||
int cond_col_const(Interpreter::BinaryCondition, Uint32 attrId,
|
||||
const void * value, Uint32 len);
|
||||
|
||||
bool m_abort_on_too_large;
|
||||
|
||||
NdbOperation::OperationStatus m_initial_op_status;
|
||||
Uint32 m_initial_AI_size;
|
||||
Uint32 m_max_size;
|
||||
|
||||
Uint32 get_size() {
|
||||
assert(m_operation->theTotalCurrAI_Len >= m_initial_AI_size);
|
||||
return m_operation->theTotalCurrAI_Len - m_initial_AI_size;
|
||||
}
|
||||
bool check_size() {
|
||||
if (get_size() <= m_max_size)
|
||||
return true;
|
||||
handle_filter_too_large();
|
||||
return false;
|
||||
}
|
||||
void handle_filter_too_large();
|
||||
|
||||
NdbError m_error;
|
||||
};
|
||||
|
||||
const Uint32 LabelExit = ~0;
|
||||
|
||||
|
||||
NdbScanFilter::NdbScanFilter(class NdbOperation * op)
|
||||
NdbScanFilter::NdbScanFilter(class NdbOperation * op,
|
||||
bool abort_on_too_large,
|
||||
Uint32 max_size)
|
||||
: m_impl(* new NdbScanFilterImpl())
|
||||
{
|
||||
DBUG_ENTER("NdbScanFilter::NdbScanFilter");
|
||||
m_impl.m_current.m_group = (NdbScanFilter::Group)0;
|
||||
m_impl.m_current.m_popCount = 0;
|
||||
m_impl.m_current.m_ownLabel = 0;
|
||||
|
@ -69,6 +96,21 @@ NdbScanFilter::NdbScanFilter(class NdbOperation * op)
|
|||
m_impl.m_latestAttrib = ~0;
|
||||
m_impl.m_operation = op;
|
||||
m_impl.m_negative = 0;
|
||||
|
||||
DBUG_PRINT("info", ("op status: %d tot AI: %u in curr: %u",
|
||||
op->theStatus,
|
||||
op->theTotalCurrAI_Len, op->theAI_LenInCurrAI));
|
||||
|
||||
m_impl.m_abort_on_too_large = abort_on_too_large;
|
||||
|
||||
m_impl.m_initial_op_status = op->theStatus;
|
||||
m_impl.m_initial_AI_size = op->theTotalCurrAI_Len;
|
||||
if (max_size > NDB_MAX_SCANFILTER_SIZE_IN_WORDS)
|
||||
max_size = NDB_MAX_SCANFILTER_SIZE_IN_WORDS;
|
||||
m_impl.m_max_size = max_size;
|
||||
|
||||
m_impl.m_error.code = 0;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
NdbScanFilter::~NdbScanFilter(){
|
||||
|
@ -200,30 +242,38 @@ NdbScanFilter::end(){
|
|||
switch(tmp.m_group){
|
||||
case NdbScanFilter::AND:
|
||||
if(tmp.m_trueLabel == (Uint32)~0){
|
||||
m_impl.m_operation->interpret_exit_ok();
|
||||
if (m_impl.m_operation->interpret_exit_ok() == -1)
|
||||
return -1;
|
||||
} else {
|
||||
m_impl.m_operation->branch_label(tmp.m_trueLabel);
|
||||
if (m_impl.m_operation->branch_label(tmp.m_trueLabel) == -1)
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case NdbScanFilter::NAND:
|
||||
if(tmp.m_trueLabel == (Uint32)~0){
|
||||
m_impl.m_operation->interpret_exit_nok();
|
||||
if (m_impl.m_operation->interpret_exit_nok() == -1)
|
||||
return -1;
|
||||
} else {
|
||||
m_impl.m_operation->branch_label(tmp.m_falseLabel);
|
||||
if (m_impl.m_operation->branch_label(tmp.m_falseLabel) == -1)
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case NdbScanFilter::OR:
|
||||
if(tmp.m_falseLabel == (Uint32)~0){
|
||||
m_impl.m_operation->interpret_exit_nok();
|
||||
if (m_impl.m_operation->interpret_exit_nok() == -1)
|
||||
return -1;
|
||||
} else {
|
||||
m_impl.m_operation->branch_label(tmp.m_falseLabel);
|
||||
if (m_impl.m_operation->branch_label(tmp.m_falseLabel) == -1)
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case NdbScanFilter::NOR:
|
||||
if(tmp.m_falseLabel == (Uint32)~0){
|
||||
m_impl.m_operation->interpret_exit_ok();
|
||||
if (m_impl.m_operation->interpret_exit_ok() == -1)
|
||||
return -1;
|
||||
} else {
|
||||
m_impl.m_operation->branch_label(tmp.m_trueLabel);
|
||||
if (m_impl.m_operation->branch_label(tmp.m_trueLabel) == -1)
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -231,24 +281,29 @@ NdbScanFilter::end(){
|
|||
return -1;
|
||||
}
|
||||
|
||||
m_impl.m_operation->def_label(tmp.m_ownLabel);
|
||||
if (m_impl.m_operation->def_label(tmp.m_ownLabel) == -1)
|
||||
return -1;
|
||||
|
||||
if(m_impl.m_stack.size() == 0){
|
||||
switch(tmp.m_group){
|
||||
case NdbScanFilter::AND:
|
||||
case NdbScanFilter::NOR:
|
||||
m_impl.m_operation->interpret_exit_nok();
|
||||
if (m_impl.m_operation->interpret_exit_nok() == -1)
|
||||
return -1;
|
||||
break;
|
||||
case NdbScanFilter::OR:
|
||||
case NdbScanFilter::NAND:
|
||||
m_impl.m_operation->interpret_exit_ok();
|
||||
if (m_impl.m_operation->interpret_exit_ok() == -1)
|
||||
return -1;
|
||||
break;
|
||||
default:
|
||||
m_impl.m_operation->setErrorCodeAbort(4260);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!m_impl.check_size())
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -261,10 +316,16 @@ NdbScanFilter::istrue(){
|
|||
}
|
||||
|
||||
if(m_impl.m_current.m_trueLabel == (Uint32)~0){
|
||||
return m_impl.m_operation->interpret_exit_ok();
|
||||
if (m_impl.m_operation->interpret_exit_ok() == -1)
|
||||
return -1;
|
||||
} else {
|
||||
return m_impl.m_operation->branch_label(m_impl.m_current.m_trueLabel);
|
||||
if (m_impl.m_operation->branch_label(m_impl.m_current.m_trueLabel) == -1)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!m_impl.check_size())
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -276,12 +337,22 @@ NdbScanFilter::isfalse(){
|
|||
}
|
||||
|
||||
if(m_impl.m_current.m_falseLabel == (Uint32)~0){
|
||||
return m_impl.m_operation->interpret_exit_nok();
|
||||
if (m_impl.m_operation->interpret_exit_nok() == -1)
|
||||
return -1;
|
||||
} else {
|
||||
return m_impl.m_operation->branch_label(m_impl.m_current.m_falseLabel);
|
||||
if (m_impl.m_operation->branch_label(m_impl.m_current.m_falseLabel) == -1)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!m_impl.check_size())
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
NdbOperation *
|
||||
NdbScanFilter::getNdbOperation(){
|
||||
return m_impl.m_operation;
|
||||
}
|
||||
|
||||
#define action(x, y, z)
|
||||
|
||||
|
@ -330,7 +401,11 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){
|
|||
}
|
||||
|
||||
Branch1 branch = table2[op].m_branches[m_current.m_group];
|
||||
(m_operation->* branch)(AttrId, m_current.m_ownLabel);
|
||||
if ((m_operation->* branch)(AttrId, m_current.m_ownLabel) == -1)
|
||||
return -1;
|
||||
|
||||
if (!check_size())
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -463,8 +538,12 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op,
|
|||
return -1;
|
||||
}
|
||||
|
||||
int ret = (m_operation->* branch)(AttrId, value, len, false, m_current.m_ownLabel);
|
||||
return ret;
|
||||
if ((m_operation->* branch)(AttrId, value, len, false, m_current.m_ownLabel) == -1)
|
||||
return -1;
|
||||
|
||||
if (!check_size())
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -490,7 +569,130 @@ NdbScanFilter::cmp(BinaryCondition cond, int ColId,
|
|||
return m_impl.cond_col_const(Interpreter::NOT_LIKE, ColId, val, len);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
NdbScanFilterImpl::handle_filter_too_large()
|
||||
{
|
||||
DBUG_ENTER("NdbScanFilterImpl::handle_filter_too_large");
|
||||
|
||||
NdbOperation* const op = m_operation;
|
||||
m_error.code = NdbScanFilter::FilterTooLarge;
|
||||
if (m_abort_on_too_large)
|
||||
op->setErrorCodeAbort(m_error.code);
|
||||
|
||||
/*
|
||||
* Possible interpreted parts at this point are:
|
||||
*
|
||||
* 1. initial read
|
||||
* 2. interpreted program
|
||||
*
|
||||
* It is assumed that NdbScanFilter has created all of 2
|
||||
* so that we don't have to save interpreter state.
|
||||
*/
|
||||
|
||||
const Uint32 size = get_size();
|
||||
assert(size != 0);
|
||||
|
||||
// new ATTRINFO size
|
||||
const Uint32 new_size = m_initial_AI_size;
|
||||
|
||||
// find last signal for new size
|
||||
assert(op->theFirstATTRINFO != NULL);
|
||||
NdbApiSignal* lastSignal = op->theFirstATTRINFO;
|
||||
Uint32 n = 0;
|
||||
while (n + AttrInfo::DataLength < new_size) {
|
||||
lastSignal = lastSignal->next();
|
||||
assert(lastSignal != NULL);
|
||||
n += AttrInfo::DataLength;
|
||||
}
|
||||
assert(n < size);
|
||||
|
||||
// release remaining signals
|
||||
NdbApiSignal* tSignal = lastSignal->next();
|
||||
op->theNdb->releaseSignalsInList(&tSignal);
|
||||
lastSignal->next(NULL);
|
||||
|
||||
// length of lastSignal
|
||||
const Uint32 new_curr = AttrInfo::HeaderLength + new_size - n;
|
||||
assert(new_curr <= 25);
|
||||
|
||||
DBUG_PRINT("info", ("op status: %d->%d tot AI: %u->%u in curr: %u->%u",
|
||||
op->theStatus, m_initial_op_status,
|
||||
op->theTotalCurrAI_Len, new_size,
|
||||
op->theAI_LenInCurrAI, new_curr));
|
||||
|
||||
// reset op state
|
||||
op->theStatus = m_initial_op_status;
|
||||
|
||||
// reset interpreter state to initial
|
||||
|
||||
NdbBranch* tBranch = op->theFirstBranch;
|
||||
while (tBranch != NULL) {
|
||||
NdbBranch* tmp = tBranch;
|
||||
tBranch = tBranch->theNext;
|
||||
op->theNdb->releaseNdbBranch(tmp);
|
||||
}
|
||||
op->theFirstBranch = NULL;
|
||||
op->theLastBranch = NULL;
|
||||
|
||||
NdbLabel* tLabel = op->theFirstLabel;
|
||||
while (tLabel != NULL) {
|
||||
NdbLabel* tmp = tLabel;
|
||||
tLabel = tLabel->theNext;
|
||||
op->theNdb->releaseNdbLabel(tmp);
|
||||
}
|
||||
op->theFirstLabel = NULL;
|
||||
op->theLastLabel = NULL;
|
||||
|
||||
NdbCall* tCall = op->theFirstCall;
|
||||
while (tCall != NULL) {
|
||||
NdbCall* tmp = tCall;
|
||||
tCall = tCall->theNext;
|
||||
op->theNdb->releaseNdbCall(tmp);
|
||||
}
|
||||
op->theFirstCall = NULL;
|
||||
op->theLastCall = NULL;
|
||||
|
||||
NdbSubroutine* tSubroutine = op->theFirstSubroutine;
|
||||
while (tSubroutine != NULL) {
|
||||
NdbSubroutine* tmp = tSubroutine;
|
||||
tSubroutine = tSubroutine->theNext;
|
||||
op->theNdb->releaseNdbSubroutine(tmp);
|
||||
}
|
||||
op->theFirstSubroutine = NULL;
|
||||
op->theLastSubroutine = NULL;
|
||||
|
||||
op->theNoOfLabels = 0;
|
||||
op->theNoOfSubroutines = 0;
|
||||
|
||||
// reset AI size
|
||||
op->theTotalCurrAI_Len = new_size;
|
||||
op->theAI_LenInCurrAI = new_curr;
|
||||
|
||||
// reset signal pointers
|
||||
op->theCurrentATTRINFO = lastSignal;
|
||||
op->theATTRINFOptr = &lastSignal->getDataPtrSend()[new_curr];
|
||||
|
||||
// interpreter sizes are set later somewhere
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
static void
|
||||
update(const NdbError & _err){
|
||||
NdbError & error = (NdbError &) _err;
|
||||
ndberror_struct ndberror = (ndberror_struct)error;
|
||||
ndberror_update(&ndberror);
|
||||
error = NdbError(ndberror);
|
||||
}
|
||||
|
||||
const NdbError &
|
||||
NdbScanFilter::getNdbError() const
|
||||
{
|
||||
update(m_impl.m_error);
|
||||
return m_impl.m_error;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -872,6 +872,10 @@ NdbScanOperation::doSendScan(int aProcessorId)
|
|||
// sending it. This could not be done in openScan because
|
||||
// we created the ATTRINFO signals after the SCAN_TABREQ signal.
|
||||
ScanTabReq * const req = CAST_PTR(ScanTabReq, tSignal->getDataPtrSend());
|
||||
if (unlikely(theTotalCurrAI_Len > ScanTabReq::MaxTotalAttrInfo)) {
|
||||
setErrorCode(4257);
|
||||
return -1;
|
||||
}
|
||||
req->attrLenKeyLen = (tupKeyLen << 16) | theTotalCurrAI_Len;
|
||||
Uint32 tmp = req->requestInfo;
|
||||
ScanTabReq::setDistributionKeyFlag(tmp, theDistrKeyIndicator_);
|
||||
|
|
|
@ -624,6 +624,7 @@ ErrorBundle ErrorCodes[] = {
|
|||
{ 4273, DMEC, IE, "No blob table in dict cache" },
|
||||
{ 4274, DMEC, IE, "Corrupted main table PK in blob operation" },
|
||||
{ 4275, DMEC, AE, "The blob method is incompatible with operation type or lock mode" },
|
||||
{ 4294, DMEC, AE, "Scan filter is too large, discarded" },
|
||||
|
||||
{ NO_CONTACT_WITH_PROCESS, DMEC, AE,
|
||||
"No contact with the process (dead ?)."},
|
||||
|
|
|
@ -684,7 +684,7 @@ int runTestFragmentTypes(NDBT_Context* ctx, NDBT_Step* step){
|
|||
CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
|
||||
CHECK(count == records);
|
||||
CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0);
|
||||
CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
|
||||
CHECK(count == (records/2));
|
||||
|
||||
|
@ -862,7 +862,7 @@ int runPkSizes(NDBT_Context* ctx, NDBT_Step* step){
|
|||
CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
|
||||
CHECK(count == records);
|
||||
CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0);
|
||||
CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
|
||||
CHECK(count == (records/2));
|
||||
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||
|
@ -2706,7 +2706,262 @@ runDictRestart(NDBT_Context* ctx, NDBT_Step* step)
|
|||
return NDBT_OK;
|
||||
}
|
||||
|
||||
int
|
||||
runBug29501(NDBT_Context* ctx, NDBT_Step* step) {
|
||||
NdbRestarter res;
|
||||
NdbDictionary::LogfileGroup lg;
|
||||
lg.setName("DEFAULT-LG");
|
||||
lg.setUndoBufferSize(8*1024*1024);
|
||||
|
||||
if (res.getNumDbNodes() < 2)
|
||||
return NDBT_OK;
|
||||
|
||||
Ndb* pNdb = GETNDB(step);
|
||||
NdbDictionary::Dictionary* pDict = pNdb->getDictionary();
|
||||
|
||||
int node = res.getRandomNotMasterNodeId(rand());
|
||||
res.restartOneDbNode(node, true, true, false);
|
||||
|
||||
if(pDict->createLogfileGroup(lg) != 0){
|
||||
g_err << "Failed to create logfilegroup:"
|
||||
<< endl << pDict->getNdbError() << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
NdbDictionary::Undofile uf;
|
||||
uf.setPath("undofile01.dat");
|
||||
uf.setSize(5*1024*1024);
|
||||
uf.setLogfileGroup("DEFAULT-LG");
|
||||
|
||||
if(pDict->createUndofile(uf) != 0){
|
||||
g_err << "Failed to create undofile:"
|
||||
<< endl << pDict->getNdbError() << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
res.waitNodesNoStart(&node, 1);
|
||||
res.startNodes(&node, 1);
|
||||
|
||||
if (res.waitClusterStarted()){
|
||||
g_err << "Node restart failed"
|
||||
<< endl << pDict->getNdbError() << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
if (pDict->dropLogfileGroup(pDict->getLogfileGroup(lg.getName())) != 0){
|
||||
g_err << "Drop of LFG Failed"
|
||||
<< endl << pDict->getNdbError() << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
int
|
||||
runDropDDObjects(NDBT_Context* ctx, NDBT_Step* step){
|
||||
//Purpose is to drop all tables, data files, Table spaces and LFG's
|
||||
Uint32 i = 0;
|
||||
|
||||
Ndb* pNdb = GETNDB(step);
|
||||
NdbDictionary::Dictionary* pDict = pNdb->getDictionary();
|
||||
|
||||
NdbDictionary::Dictionary::List list;
|
||||
if (pDict->listObjects(list) == -1)
|
||||
return NDBT_FAILED;
|
||||
|
||||
//Search the list and drop all tables found
|
||||
const char * tableFound = 0;
|
||||
for (i = 0; i < list.count; i++){
|
||||
switch(list.elements[i].type){
|
||||
case NdbDictionary::Object::UserTable:
|
||||
tableFound = list.elements[i].name;
|
||||
if(tableFound != 0){
|
||||
if(pDict->dropTable(tableFound) != 0){
|
||||
g_err << "Failed to drop table: " << pDict->getNdbError() << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
}
|
||||
tableFound = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Search the list and drop all data file found
|
||||
const char * dfFound = 0;
|
||||
for (i = 0; i < list.count; i++){
|
||||
switch(list.elements[i].type){
|
||||
case NdbDictionary::Object::Datafile:
|
||||
dfFound = list.elements[i].name;
|
||||
if(dfFound != 0){
|
||||
if(pDict->dropDatafile(pDict->getDatafile(0, dfFound)) != 0){
|
||||
g_err << "Failed to drop datafile: " << pDict->getNdbError() << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
}
|
||||
dfFound = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Search the list and drop all Table Spaces Found
|
||||
const char * tsFound = 0;
|
||||
for (i = 0; i <list.count; i++){
|
||||
switch(list.elements[i].type){
|
||||
case NdbDictionary::Object::Tablespace:
|
||||
tsFound = list.elements[i].name;
|
||||
if(tsFound != 0){
|
||||
if(pDict->dropTablespace(pDict->getTablespace(tsFound)) != 0){
|
||||
g_err << "Failed to drop tablespace: " << pDict->getNdbError() << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
}
|
||||
tsFound = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Search the list and drop all LFG Found
|
||||
//Currently only 1 LGF is supported, but written for future
|
||||
//when more then one is supported.
|
||||
const char * lgFound = 0;
|
||||
for (i = 0; i < list.count; i++){
|
||||
switch(list.elements[i].type){
|
||||
case NdbDictionary::Object::LogfileGroup:
|
||||
lgFound = list.elements[i].name;
|
||||
if(lgFound != 0){
|
||||
if (pDict->dropLogfileGroup(pDict->getLogfileGroup(lgFound)) != 0){
|
||||
g_err << "Failed to drop tablespace: " << pDict->getNdbError() << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
}
|
||||
lgFound = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
int
|
||||
runWaitStarted(NDBT_Context* ctx, NDBT_Step* step){
|
||||
|
||||
NdbRestarter restarter;
|
||||
restarter.waitClusterStarted(300);
|
||||
|
||||
NdbSleep_SecSleep(3);
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
int
|
||||
testDropDDObjectsSetup(NDBT_Context* ctx, NDBT_Step* step){
|
||||
//Purpose is to setup to test DropDDObjects
|
||||
char tsname[256];
|
||||
char dfname[256];
|
||||
|
||||
Ndb* pNdb = GETNDB(step);
|
||||
NdbDictionary::Dictionary* pDict = pNdb->getDictionary();
|
||||
|
||||
NdbDictionary::LogfileGroup lg;
|
||||
lg.setName("DEFAULT-LG");
|
||||
lg.setUndoBufferSize(8*1024*1024);
|
||||
|
||||
|
||||
if(pDict->createLogfileGroup(lg) != 0){
|
||||
g_err << "Failed to create logfilegroup:"
|
||||
<< endl << pDict->getNdbError() << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
NdbDictionary::Undofile uf;
|
||||
uf.setPath("undofile01.dat");
|
||||
uf.setSize(5*1024*1024);
|
||||
uf.setLogfileGroup("DEFAULT-LG");
|
||||
|
||||
if(pDict->createUndofile(uf) != 0){
|
||||
g_err << "Failed to create undofile:"
|
||||
<< endl << pDict->getNdbError() << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
BaseString::snprintf(tsname, sizeof(tsname), "TS-%u", rand());
|
||||
BaseString::snprintf(dfname, sizeof(dfname), "%s-%u.dat", tsname, rand());
|
||||
|
||||
if (create_tablespace(pDict, lg.getName(), tsname, dfname)){
|
||||
g_err << "Failed to create undofile:"
|
||||
<< endl << pDict->getNdbError() << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
int
|
||||
DropDDObjectsVerify(NDBT_Context* ctx, NDBT_Step* step){
|
||||
//Purpose is to verify test DropDDObjects worked
|
||||
Uint32 i = 0;
|
||||
|
||||
Ndb* pNdb = GETNDB(step);
|
||||
NdbDictionary::Dictionary* pDict = pNdb->getDictionary();
|
||||
|
||||
NdbDictionary::Dictionary::List list;
|
||||
if (pDict->listObjects(list) == -1)
|
||||
return NDBT_FAILED;
|
||||
|
||||
bool ddFound = false;
|
||||
for (i = 0; i <list.count; i++){
|
||||
switch(list.elements[i].type){
|
||||
case NdbDictionary::Object::Tablespace:
|
||||
ddFound = true;
|
||||
break;
|
||||
case NdbDictionary::Object::LogfileGroup:
|
||||
ddFound = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(ddFound == true){
|
||||
g_err << "DropDDObjects Failed: DD found:"
|
||||
<< endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
}
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
NDBT_TESTSUITE(testDict);
|
||||
TESTCASE("testDropDDObjects",
|
||||
"* 1. start cluster\n"
|
||||
"* 2. Create LFG\n"
|
||||
"* 3. create TS\n"
|
||||
"* 4. run DropDDObjects\n"
|
||||
"* 5. Verify DropDDObjectsRestart worked\n"){
|
||||
INITIALIZER(runWaitStarted);
|
||||
INITIALIZER(runDropDDObjects);
|
||||
INITIALIZER(testDropDDObjectsSetup);
|
||||
STEP(runDropDDObjects);
|
||||
FINALIZER(DropDDObjectsVerify);
|
||||
}
|
||||
|
||||
TESTCASE("Bug29501",
|
||||
"* 1. start cluster\n"
|
||||
"* 2. Restart 1 node -abort -nostart\n"
|
||||
"* 3. create LFG\n"
|
||||
"* 4. Restart data node\n"
|
||||
"* 5. Restart 1 node -nostart\n"
|
||||
"* 6. Drop LFG\n"){
|
||||
INITIALIZER(runWaitStarted);
|
||||
INITIALIZER(runDropDDObjects);
|
||||
STEP(runBug29501);
|
||||
FINALIZER(runDropDDObjects);
|
||||
}
|
||||
TESTCASE("CreateAndDrop",
|
||||
"Try to create and drop the table loop number of times\n"){
|
||||
INITIALIZER(runCreateAndDrop);
|
||||
|
|
|
@ -809,7 +809,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){
|
|||
CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(utilTrans.verifyIndex(pNdb, idxName, 16, false) == 0);
|
||||
CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0);
|
||||
CHECK(utilTrans.verifyIndex(pNdb, idxName, 16, false) == 0);
|
||||
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.loadTable(pNdb, records, 1) == 0);
|
||||
|
@ -834,7 +834,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){
|
|||
CHECK(utilTrans.verifyIndex(pNdb, idxName, 16, false) == 0);
|
||||
CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0);
|
||||
CHECK(utilTrans.verifyIndex(pNdb, idxName, 16, false) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0);
|
||||
CHECK(utilTrans.verifyIndex(pNdb, idxName, 16, false) == 0);
|
||||
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.loadTable(pNdb, records, 1) == 0);
|
||||
|
|
|
@ -1762,6 +1762,80 @@ runBug28717(NDBT_Context* ctx, NDBT_Step* step)
|
|||
return NDBT_OK;
|
||||
}
|
||||
|
||||
int
|
||||
runBug31525(NDBT_Context* ctx, NDBT_Step* step)
|
||||
{
|
||||
int result = NDBT_OK;
|
||||
int loops = ctx->getNumLoops();
|
||||
int records = ctx->getNumRecords();
|
||||
Ndb* pNdb = GETNDB(step);
|
||||
NdbRestarter res;
|
||||
|
||||
if (res.getNumDbNodes() < 2)
|
||||
{
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
int nodes[2];
|
||||
nodes[0] = res.getMasterNodeId();
|
||||
nodes[1] = res.getNextMasterNodeId(nodes[0]);
|
||||
|
||||
while (res.getNodeGroup(nodes[0]) != res.getNodeGroup(nodes[1]))
|
||||
{
|
||||
ndbout_c("Restarting %u as it not in same node group as %u",
|
||||
nodes[1], nodes[0]);
|
||||
if (res.restartOneDbNode(nodes[1], false, true, true))
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (res.waitNodesNoStart(nodes+1, 1))
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (res.startNodes(nodes+1, 1))
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (res.waitClusterStarted())
|
||||
return NDBT_FAILED;
|
||||
|
||||
nodes[1] = res.getNextMasterNodeId(nodes[0]);
|
||||
}
|
||||
|
||||
ndbout_c("nodes[0]: %u nodes[1]: %u", nodes[0], nodes[1]);
|
||||
|
||||
int val = DumpStateOrd::DihMinTimeBetweenLCP;
|
||||
if (res.dumpStateAllNodes(&val, 1))
|
||||
return NDBT_FAILED;
|
||||
|
||||
int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
|
||||
if (res.dumpStateAllNodes(val2, 2))
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (res.insertErrorInAllNodes(932))
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (res.insertErrorInNode(nodes[1], 7192))
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (res.insertErrorInNode(nodes[0], 7191))
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (res.waitClusterNoStart())
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (res.startAll())
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (res.waitClusterStarted())
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (res.restartOneDbNode(nodes[1], false, false, true))
|
||||
return NDBT_FAILED;
|
||||
|
||||
if (res.waitClusterStarted())
|
||||
return NDBT_FAILED;
|
||||
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
NDBT_TESTSUITE(testNodeRestart);
|
||||
TESTCASE("NoLoad",
|
||||
"Test that one node at a time can be stopped and then restarted "\
|
||||
|
@ -2085,6 +2159,9 @@ TESTCASE("Bug21271",
|
|||
STEP(runPkUpdateUntilStopped);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("Bug31525", ""){
|
||||
INITIALIZER(runBug31525);
|
||||
}
|
||||
TESTCASE("Bug24717", ""){
|
||||
INITIALIZER(runBug24717);
|
||||
}
|
||||
|
|
|
@ -579,7 +579,7 @@ int runScanUpdateUntilStopped(NDBT_Context* ctx, NDBT_Step* step){
|
|||
para = myRandom48(239)+1;
|
||||
|
||||
g_info << i << ": ";
|
||||
if (hugoTrans.scanUpdateRecords(GETNDB(step), records, 0, para) == NDBT_FAILED){
|
||||
if (hugoTrans.scanUpdateRecords(GETNDB(step), 0, 0, para) == NDBT_FAILED){
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
i++;
|
||||
|
|
|
@ -122,7 +122,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){
|
|||
CHECK(hugoTrans.loadTable(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0);
|
||||
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.loadTable(pNdb, records) == 0);
|
||||
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||
|
@ -143,7 +143,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){
|
|||
CHECK(hugoTrans.loadTable(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0);
|
||||
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.loadTable(pNdb, records) == 0);
|
||||
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||
|
@ -266,7 +266,7 @@ int runSystemRestart2(NDBT_Context* ctx, NDBT_Step* step){
|
|||
CHECK(hugoTrans.loadTable(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0);
|
||||
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.loadTable(pNdb, records) == 0);
|
||||
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||
|
@ -330,7 +330,7 @@ int runSystemRestartTestUndoLog(NDBT_Context* ctx, NDBT_Step* step){
|
|||
CHECK(hugoTrans.loadTable(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0);
|
||||
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||
CHECK(hugoTrans.loadTable(pNdb, records) == 0);
|
||||
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||
|
@ -1294,6 +1294,30 @@ runBug28770(NDBT_Context* ctx, NDBT_Step* step) {
|
|||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
runStopper(NDBT_Context* ctx, NDBT_Step* step)
|
||||
{
|
||||
NdbRestarter restarter;
|
||||
Uint32 stop = 0;
|
||||
loop:
|
||||
while (!ctx->isTestStopped() &&
|
||||
((stop = ctx->getProperty("StopAbort", Uint32(0))) == 0))
|
||||
{
|
||||
NdbSleep_MilliSleep(30);
|
||||
}
|
||||
|
||||
if (ctx->isTestStopped())
|
||||
{
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
ndbout << "Killing in " << stop << "ms..." << flush;
|
||||
NdbSleep_MilliSleep(stop);
|
||||
restarter.restartAll(false, true, true);
|
||||
ctx->setProperty("StopAbort", Uint32(0));
|
||||
goto loop;
|
||||
}
|
||||
|
||||
int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step)
|
||||
{
|
||||
Ndb* pNdb = GETNDB(step);
|
||||
|
@ -1303,6 +1327,7 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step)
|
|||
NdbRestarter restarter;
|
||||
NdbBackup backup(GETNDB(step)->getNodeId()+1);
|
||||
bool lcploop = ctx->getProperty("LCP", (unsigned)0);
|
||||
bool all = ctx->getProperty("ALL", (unsigned)0);
|
||||
|
||||
Uint32 i = 1;
|
||||
Uint32 backupId;
|
||||
|
@ -1328,11 +1353,18 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step)
|
|||
ndbout << "Loading records..." << startFrom << endl;
|
||||
CHECK(hugoTrans.loadTable(pNdb, startFrom) == 0);
|
||||
|
||||
ndbout << "Making " << nodeId << " crash" << endl;
|
||||
int kill[] = { 9999, 1000, 3000 };
|
||||
CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0);
|
||||
CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0);
|
||||
|
||||
if (!all)
|
||||
{
|
||||
ndbout << "Making " << nodeId << " crash" << endl;
|
||||
int kill[] = { 9999, 1000, 3000 };
|
||||
CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0);
|
||||
CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ndbout << "Crashing cluster" << endl;
|
||||
ctx->setProperty("StopAbort", 1000 + rand() % (3000 - 1000));
|
||||
}
|
||||
Uint64 end = NdbTick_CurrentMillisecond() + 4000;
|
||||
Uint32 row = startFrom;
|
||||
do {
|
||||
|
@ -1342,11 +1374,17 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step)
|
|||
row += 1000;
|
||||
} while (NdbTick_CurrentMillisecond() < end);
|
||||
|
||||
ndbout << "Waiting for " << nodeId << " to restart" << endl;
|
||||
CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0);
|
||||
|
||||
ndbout << "Restarting cluster" << endl;
|
||||
CHECK(restarter.restartAll(false, true, true) == 0);
|
||||
if (!all)
|
||||
{
|
||||
ndbout << "Waiting for " << nodeId << " to restart" << endl;
|
||||
CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0);
|
||||
ndbout << "Restarting cluster" << endl;
|
||||
CHECK(restarter.restartAll(false, true, true) == 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ndbout << "Waiting for cluster to restart" << endl;
|
||||
}
|
||||
CHECK(restarter.waitClusterNoStart() == 0);
|
||||
CHECK(restarter.startAll() == 0);
|
||||
CHECK(restarter.waitClusterStarted() == 0);
|
||||
|
@ -1371,7 +1409,7 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step)
|
|||
}
|
||||
|
||||
ndbout << "runSR_DD_1 finished" << endl;
|
||||
|
||||
ctx->stopTest();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1385,6 +1423,7 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step)
|
|||
NdbRestarter restarter;
|
||||
NdbBackup backup(GETNDB(step)->getNodeId()+1);
|
||||
bool lcploop = ctx->getProperty("LCP", (unsigned)0);
|
||||
bool all = ctx->getProperty("ALL", (unsigned)0);
|
||||
|
||||
Uint32 i = 1;
|
||||
Uint32 backupId;
|
||||
|
@ -1405,10 +1444,18 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step)
|
|||
|
||||
int nodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes());
|
||||
|
||||
ndbout << "Making " << nodeId << " crash" << endl;
|
||||
int kill[] = { 9999, 3000, 10000 };
|
||||
CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0);
|
||||
CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0);
|
||||
if (!all)
|
||||
{
|
||||
ndbout << "Making " << nodeId << " crash" << endl;
|
||||
int kill[] = { 9999, 3000, 10000 };
|
||||
CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0);
|
||||
CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ndbout << "Crashing cluster" << endl;
|
||||
ctx->setProperty("StopAbort", 1000 + rand() % (3000 - 1000));
|
||||
}
|
||||
|
||||
Uint64 end = NdbTick_CurrentMillisecond() + 11000;
|
||||
Uint32 row = startFrom;
|
||||
|
@ -1420,11 +1467,18 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step)
|
|||
break;
|
||||
} while (NdbTick_CurrentMillisecond() < end);
|
||||
|
||||
ndbout << "Waiting for " << nodeId << " to restart" << endl;
|
||||
CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0);
|
||||
|
||||
ndbout << "Restarting cluster" << endl;
|
||||
CHECK(restarter.restartAll(false, true, true) == 0);
|
||||
if (!all)
|
||||
{
|
||||
ndbout << "Waiting for " << nodeId << " to restart" << endl;
|
||||
CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0);
|
||||
ndbout << "Restarting cluster" << endl;
|
||||
CHECK(restarter.restartAll(false, true, true) == 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ndbout << "Waiting for cluster to restart" << endl;
|
||||
}
|
||||
|
||||
CHECK(restarter.waitClusterNoStart() == 0);
|
||||
CHECK(restarter.startAll() == 0);
|
||||
CHECK(restarter.waitClusterStarted() == 0);
|
||||
|
@ -1443,7 +1497,7 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step)
|
|||
}
|
||||
|
||||
ndbout << "runSR_DD_2 finished" << endl;
|
||||
|
||||
ctx->stopTest();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1628,12 +1682,29 @@ TESTCASE("Bug24664",
|
|||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("SR_DD_1", "")
|
||||
{
|
||||
TC_PROPERTY("ALL", 1);
|
||||
INITIALIZER(runWaitStarted);
|
||||
STEP(runStopper);
|
||||
STEP(runSR_DD_1);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("SR_DD_1b", "")
|
||||
{
|
||||
INITIALIZER(runWaitStarted);
|
||||
STEP(runSR_DD_1);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("SR_DD_1_LCP", "")
|
||||
{
|
||||
TC_PROPERTY("ALL", 1);
|
||||
TC_PROPERTY("LCP", 1);
|
||||
INITIALIZER(runWaitStarted);
|
||||
STEP(runStopper);
|
||||
STEP(runSR_DD_1);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("SR_DD_1b_LCP", "")
|
||||
{
|
||||
TC_PROPERTY("LCP", 1);
|
||||
INITIALIZER(runWaitStarted);
|
||||
|
@ -1641,12 +1712,29 @@ TESTCASE("SR_DD_1_LCP", "")
|
|||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("SR_DD_2", "")
|
||||
{
|
||||
TC_PROPERTY("ALL", 1);
|
||||
INITIALIZER(runWaitStarted);
|
||||
STEP(runStopper);
|
||||
STEP(runSR_DD_2);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("SR_DD_2b", "")
|
||||
{
|
||||
INITIALIZER(runWaitStarted);
|
||||
STEP(runSR_DD_2);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("SR_DD_2_LCP", "")
|
||||
{
|
||||
TC_PROPERTY("ALL", 1);
|
||||
TC_PROPERTY("LCP", 1);
|
||||
INITIALIZER(runWaitStarted);
|
||||
STEP(runStopper);
|
||||
STEP(runSR_DD_2);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("SR_DD_2b_LCP", "")
|
||||
{
|
||||
TC_PROPERTY("LCP", 1);
|
||||
INITIALIZER(runWaitStarted);
|
||||
|
|
|
@ -1730,7 +1730,7 @@ runScanUpdateUntilStopped(NDBT_Context* ctx, NDBT_Step* step){
|
|||
HugoTransactions hugoTrans(*ctx->getTab());
|
||||
while (ctx->isTestStopped() == false)
|
||||
{
|
||||
if (hugoTrans.scanUpdateRecords(GETNDB(step), records, abort,
|
||||
if (hugoTrans.scanUpdateRecords(GETNDB(step), 0, abort,
|
||||
parallelism) == NDBT_FAILED){
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
|
|
@ -555,7 +555,7 @@ args: -n Bug25554 T1
|
|||
|
||||
max-time: 3000
|
||||
cmd: testNodeRestart
|
||||
args: -n Bug25984
|
||||
args: -n Bug25984 T1
|
||||
|
||||
max-time: 1000
|
||||
cmd: testNodeRestart
|
||||
|
@ -575,6 +575,14 @@ args: -n Bug29364 T1
|
|||
|
||||
#
|
||||
# DICT TESTS
|
||||
max-time: 500
|
||||
cmd: testDict
|
||||
args: -n Bug29501 T1
|
||||
|
||||
max-time: 500
|
||||
cmd: testDict
|
||||
args: -n testDropDDObjects T1
|
||||
|
||||
max-time: 1500
|
||||
cmd: testDict
|
||||
args: -n CreateAndDrop
|
||||
|
@ -950,31 +958,67 @@ max-time: 1500
|
|||
cmd: testSystemRestart
|
||||
args: -n SR_DD_1 D1
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_1b D1
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_1 D2
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_1b D2
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_1_LCP D1
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_1b_LCP D1
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_1_LCP D2
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_1b_LCP D2
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_2 D1
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_2b D1
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_2 D2
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_2b D2
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_2_LCP D1
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_2b_LCP D1
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_2_LCP D2
|
||||
|
||||
max-time: 1500
|
||||
cmd: testSystemRestart
|
||||
args: -n SR_DD_2b_LCP D2
|
||||
|
||||
max-time: 600
|
||||
cmd: testNodeRestart
|
||||
args: -n Bug31525 T1
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue