Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1
into poseidon.:/home/tomas/mysql-5.1-new-ndb
This commit is contained in:
commit
044c410968
@ -95,6 +95,14 @@ enum ha_key_alg {
|
|||||||
HA_KEY_ALG_FULLTEXT= 4 /* FULLTEXT (MyISAM tables) */
|
HA_KEY_ALG_FULLTEXT= 4 /* FULLTEXT (MyISAM tables) */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Storage media types */
|
||||||
|
|
||||||
|
enum ha_storage_media {
|
||||||
|
HA_SM_DEFAULT= 0, /* Not specified (engine default) */
|
||||||
|
HA_SM_DISK= 1, /* DISK storage */
|
||||||
|
HA_SM_MEMORY= 2 /* MAIN MEMORY storage */
|
||||||
|
};
|
||||||
|
|
||||||
/* The following is parameter to ha_extra() */
|
/* The following is parameter to ha_extra() */
|
||||||
|
|
||||||
enum ha_extra_function {
|
enum ha_extra_function {
|
||||||
|
@ -354,3 +354,48 @@ select * from t1 where a = 12;
|
|||||||
a b c
|
a b c
|
||||||
12 403 NULL
|
12 403 NULL
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 (a int not null, b varchar(10)) engine=ndb;
|
||||||
|
show index from t1;
|
||||||
|
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||||
|
alter table t1 add primary key (a);
|
||||||
|
show index from t1;
|
||||||
|
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||||
|
t1 0 PRIMARY 1 a A 0 NULL NULL BTREE
|
||||||
|
alter table t1 drop primary key;
|
||||||
|
show index from t1;
|
||||||
|
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||||
|
drop table t1;
|
||||||
|
create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` int(11) NOT NULL,
|
||||||
|
`b` int(11) NOT NULL DEFAULT '0',
|
||||||
|
`c` varchar(254) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`a`)
|
||||||
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
|
alter table t1 alter b set default 1;
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` int(11) NOT NULL,
|
||||||
|
`b` int(11) NOT NULL DEFAULT '1',
|
||||||
|
`c` varchar(254) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`a`)
|
||||||
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
|
create table t1 (a int not null, b int not null) engine=ndb;
|
||||||
|
insert into t1 values (1, 300), (2, 200), (3, 100);
|
||||||
|
select * from t1 order by a;
|
||||||
|
a b
|
||||||
|
1 300
|
||||||
|
2 200
|
||||||
|
3 100
|
||||||
|
alter table t1 order by b;
|
||||||
|
select * from t1 order by b;
|
||||||
|
a b
|
||||||
|
3 100
|
||||||
|
2 200
|
||||||
|
1 300
|
||||||
|
drop table t1;
|
||||||
|
End of 5.1 tests
|
||||||
|
@ -773,4 +773,80 @@ a b
|
|||||||
2 2
|
2 2
|
||||||
3 3
|
3 3
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
|
||||||
|
create table if not exists t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
|
||||||
|
create table t2 like t1;
|
||||||
|
rename table t1 to t10, t2 to t20;
|
||||||
|
drop table t10,t20;
|
||||||
|
create table t1 (a int not null primary key, b int not null) engine=ndb;
|
||||||
|
create table t2 (a int not null primary key, b int not null) engine=ndb;
|
||||||
|
insert into t1 values (1,10), (2,20), (3,30);
|
||||||
|
insert into t2 values (1,10), (2,20), (3,30);
|
||||||
|
select * from t1 order by a;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
2 20
|
||||||
|
3 30
|
||||||
|
delete from t1 where a > 0 order by a desc limit 1;
|
||||||
|
select * from t1 order by a;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
2 20
|
||||||
|
delete from t1,t2 using t1,t2 where t1.a = t2.a;
|
||||||
|
select * from t2 order by a;
|
||||||
|
a b
|
||||||
|
3 30
|
||||||
|
drop table t1,t2;
|
||||||
|
create table t1 (a int not null primary key, b int not null) engine=ndb;
|
||||||
|
insert into t1 values (1,10), (2,20), (3,30);
|
||||||
|
insert into t1 set a=1, b=100;
|
||||||
|
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||||
|
insert ignore into t1 set a=1, b=100;
|
||||||
|
select * from t1 order by a;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
2 20
|
||||||
|
3 30
|
||||||
|
insert into t1 set a=1, b=1000 on duplicate key update b=b+1;
|
||||||
|
select * from t1 order by a;
|
||||||
|
a b
|
||||||
|
1 11
|
||||||
|
2 20
|
||||||
|
3 30
|
||||||
|
drop table t1;
|
||||||
|
create table t1 (a int not null primary key, b int not null) engine=ndb;
|
||||||
|
create table t2 (c int not null primary key, d int not null) engine=ndb;
|
||||||
|
insert into t1 values (1,10), (2,10), (3,30), (4, 30);
|
||||||
|
insert into t2 values (1,10), (2,10), (3,30), (4, 30);
|
||||||
|
update t1 set a = 1 where a = 3;
|
||||||
|
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||||
|
select * from t1 order by a;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
2 10
|
||||||
|
3 30
|
||||||
|
4 30
|
||||||
|
update t1 set b = 1 where a > 1 order by a desc limit 1;
|
||||||
|
select * from t1 order by a;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
2 10
|
||||||
|
3 30
|
||||||
|
4 1
|
||||||
|
update t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
|
||||||
|
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||||
|
select * from t1 order by a;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
2 10
|
||||||
|
3 30
|
||||||
|
4 1
|
||||||
|
update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
|
||||||
|
select * from t1 order by a;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
2 10
|
||||||
|
3 1
|
||||||
|
4 1
|
||||||
|
drop table t1,t2;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
@ -5,7 +5,7 @@ show binlog events from <binlog_start>;
|
|||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000001 # Query # # BEGIN
|
master-bin.000001 # Query # # BEGIN
|
||||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||||
master-bin.000001 # Table_map # # table_id: # (mysql.apply_status)
|
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: #
|
||||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||||
master-bin.000001 # Query # # COMMIT
|
master-bin.000001 # Query # # COMMIT
|
||||||
|
40
mysql-test/r/ndb_cursor.result
Normal file
40
mysql-test/r/ndb_cursor.result
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
drop table if exists t1;
|
||||||
|
drop table if exists t2;
|
||||||
|
create table t1 (
|
||||||
|
a int not null primary key,
|
||||||
|
b int not null
|
||||||
|
) engine=ndb;
|
||||||
|
create table t2 (
|
||||||
|
a int not null primary key,
|
||||||
|
b int not null
|
||||||
|
) engine=ndb;
|
||||||
|
insert into t1 values (1,10), (2,20), (3,30), (4, 40);
|
||||||
|
create procedure test_cursor ()
|
||||||
|
begin
|
||||||
|
declare done int default 0;
|
||||||
|
declare temp_a int;
|
||||||
|
declare temp_b int;
|
||||||
|
declare cur1 cursor for select a,b from t1;
|
||||||
|
declare continue handler for sqlstate '02000' set done = 1;
|
||||||
|
open cur1;
|
||||||
|
repeat
|
||||||
|
fetch cur1 into temp_a, temp_b;
|
||||||
|
if not done then
|
||||||
|
insert into t2 values (temp_a, temp_b);
|
||||||
|
end if;
|
||||||
|
until done end repeat;
|
||||||
|
close cur1;
|
||||||
|
end;
|
||||||
|
//
|
||||||
|
select * from t2 order by a;
|
||||||
|
a b
|
||||||
|
call test_cursor();
|
||||||
|
select * from t2 order by a;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
2 20
|
||||||
|
3 30
|
||||||
|
4 40
|
||||||
|
drop procedure test_cursor;
|
||||||
|
drop table t1,t2;
|
||||||
|
end of 5.1 tests
|
@ -282,7 +282,13 @@ a1
|
|||||||
18
|
18
|
||||||
19
|
19
|
||||||
20
|
20
|
||||||
|
SELECT * FROM information_schema.partitions WHERE table_name= 't1' AND partition_name = 'p0';
|
||||||
|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
|
||||||
|
NULL test t1 p0 NULL 1 NULL KEY NULL NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default ts
|
||||||
ALTER TABLE test.t1 ADD a2 FLOAT, ADD a3 DOUBLE;
|
ALTER TABLE test.t1 ADD a2 FLOAT, ADD a3 DOUBLE;
|
||||||
|
SELECT * FROM information_schema.partitions WHERE table_name= 't1' AND partition_name = 'p0';
|
||||||
|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
|
||||||
|
NULL test t1 p0 NULL 1 NULL KEY NULL NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default ts
|
||||||
SELECT * FROM test.t1 ORDER BY a1;
|
SELECT * FROM test.t1 ORDER BY a1;
|
||||||
a1 a2 a3
|
a1 a2 a3
|
||||||
1 2.2345 20000001
|
1 2.2345 20000001
|
||||||
@ -369,7 +375,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
`a13` text,
|
`a13` text,
|
||||||
`a14` blob,
|
`a14` blob,
|
||||||
PRIMARY KEY (`a1`)
|
PRIMARY KEY (`a1`)
|
||||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
ALTER TABLE test.t1 ADD INDEX a2_i (a2), ADD INDEX a3_i (a3);
|
ALTER TABLE test.t1 ADD INDEX a2_i (a2), ADD INDEX a3_i (a3);
|
||||||
SHOW CREATE TABLE test.t1;
|
SHOW CREATE TABLE test.t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
@ -391,7 +397,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
PRIMARY KEY (`a1`),
|
PRIMARY KEY (`a1`),
|
||||||
KEY `a2_i` (`a2`),
|
KEY `a2_i` (`a2`),
|
||||||
KEY `a3_i` (`a3`)
|
KEY `a3_i` (`a3`)
|
||||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
ALTER TABLE test.t1 DROP INDEX a2_i;
|
ALTER TABLE test.t1 DROP INDEX a2_i;
|
||||||
SHOW CREATE TABLE test.t1;
|
SHOW CREATE TABLE test.t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
@ -412,7 +418,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
`a14` blob,
|
`a14` blob,
|
||||||
PRIMARY KEY (`a1`),
|
PRIMARY KEY (`a1`),
|
||||||
KEY `a3_i` (`a3`)
|
KEY `a3_i` (`a3`)
|
||||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
ALTER TABLE test.t1 DROP a14;
|
ALTER TABLE test.t1 DROP a14;
|
||||||
ALTER TABLE test.t1 DROP a13;
|
ALTER TABLE test.t1 DROP a13;
|
||||||
ALTER TABLE test.t1 DROP a12;
|
ALTER TABLE test.t1 DROP a12;
|
||||||
@ -432,7 +438,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
`a4` bit(1) DEFAULT NULL,
|
`a4` bit(1) DEFAULT NULL,
|
||||||
`a5` tinyint(4) DEFAULT NULL,
|
`a5` tinyint(4) DEFAULT NULL,
|
||||||
KEY `a3_i` (`a3`)
|
KEY `a3_i` (`a3`)
|
||||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
DROP TABLE test.t1;
|
DROP TABLE test.t1;
|
||||||
ALTER TABLESPACE ts
|
ALTER TABLESPACE ts
|
||||||
DROP DATAFILE './table_space/datafile.dat'
|
DROP DATAFILE './table_space/datafile.dat'
|
||||||
|
@ -183,6 +183,11 @@ INITIAL_SIZE 1M
|
|||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
CREATE TABLE t1
|
CREATE TABLE t1
|
||||||
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
|
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
|
||||||
|
TABLESPACE ts1 STORAGE MEMORY
|
||||||
|
ENGINE NDB;
|
||||||
|
ERROR HY000: Can't create table 'test.t1' (errno: 138)
|
||||||
|
CREATE TABLE t1
|
||||||
|
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
|
||||||
TABLESPACE ts1 STORAGE DISK
|
TABLESPACE ts1 STORAGE DISK
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
CREATE INDEX b_i on t1(b);
|
CREATE INDEX b_i on t1(b);
|
||||||
|
@ -237,7 +237,7 @@ t2 CREATE TABLE `t2` (
|
|||||||
`c2` int(11) NOT NULL,
|
`c2` int(11) NOT NULL,
|
||||||
PRIMARY KEY (`pk2`)
|
PRIMARY KEY (`pk2`)
|
||||||
) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
ALTER TABLE test.t1 ENGINE=NDBCLUSTER;
|
ALTER TABLE test.t1 STORAGE MEMORY ENGINE=NDBCLUSTER;
|
||||||
SHOW CREATE TABLE test.t1;
|
SHOW CREATE TABLE test.t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
@ -341,7 +341,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
KEY `a2` (`a2`),
|
KEY `a2` (`a2`),
|
||||||
KEY `a3` (`a3`),
|
KEY `a3` (`a3`),
|
||||||
KEY `a8` (`a8`)
|
KEY `a8` (`a8`)
|
||||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t2 CREATE TABLE `t2` (
|
t2 CREATE TABLE `t2` (
|
||||||
`b1` smallint(6) NOT NULL,
|
`b1` smallint(6) NOT NULL,
|
||||||
|
@ -137,6 +137,21 @@ a b c
|
|||||||
6 7 2
|
6 7 2
|
||||||
7 8 3
|
7 8 3
|
||||||
8 2 3
|
8 2 3
|
||||||
|
create unique index bi using hash on t2(b);
|
||||||
|
insert into t2 values(9, 3, 1);
|
||||||
|
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||||
|
alter table t2 drop index bi;
|
||||||
|
insert into t2 values(9, 3, 1);
|
||||||
|
select * from t2 order by a;
|
||||||
|
a b c
|
||||||
|
2 3 5
|
||||||
|
3 4 6
|
||||||
|
4 5 8
|
||||||
|
5 6 2
|
||||||
|
6 7 2
|
||||||
|
7 8 3
|
||||||
|
8 2 3
|
||||||
|
9 3 1
|
||||||
drop table t2;
|
drop table t2;
|
||||||
CREATE TABLE t2 (
|
CREATE TABLE t2 (
|
||||||
a int unsigned NOT NULL PRIMARY KEY,
|
a int unsigned NOT NULL PRIMARY KEY,
|
||||||
|
@ -428,3 +428,17 @@ NULL 7
|
|||||||
2005-12-08 15:58:27 1
|
2005-12-08 15:58:27 1
|
||||||
2006-02-23 15:01:35 1
|
2006-02-23 15:01:35 1
|
||||||
DROP TABLE t1, t11, t12, t21, t22;
|
DROP TABLE t1, t11, t12, t21, t22;
|
||||||
|
CREATE TABLE t1 (id varchar(255) NOT NULL,
|
||||||
|
tag int(11) NOT NULL,
|
||||||
|
doc text NOT NULL,
|
||||||
|
type varchar(150) NOT NULL,
|
||||||
|
modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=ndbcluster;
|
||||||
|
INSERT INTO t1 VALUES ('sakila',1,'Some text goes here','text',CURRENT_TIMESTAMP);
|
||||||
|
SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','orka');
|
||||||
|
id tag doc type
|
||||||
|
SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila');
|
||||||
|
id tag doc type
|
||||||
|
sakila 1 Some text goes here text
|
||||||
|
DROP TABLE t1;
|
||||||
|
44
mysql-test/r/ndb_sp.result
Normal file
44
mysql-test/r/ndb_sp.result
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
drop table if exists t1;
|
||||||
|
create table t1 (
|
||||||
|
a int not null primary key,
|
||||||
|
b int not null
|
||||||
|
) engine=ndb;
|
||||||
|
insert into t1 values (1,10), (2,20), (3,100), (4, 100);
|
||||||
|
create procedure test_proc1 (in var_in int)
|
||||||
|
begin
|
||||||
|
select * from t1 where a = var_in;
|
||||||
|
end;
|
||||||
|
create procedure test_proc2 (out var_out int)
|
||||||
|
begin
|
||||||
|
select b from t1 where a = 1 into var_out;
|
||||||
|
end;
|
||||||
|
create procedure test_proc3 (inout var_inout int)
|
||||||
|
begin
|
||||||
|
select b from t1 where a = var_inout into var_inout;
|
||||||
|
end;
|
||||||
|
//
|
||||||
|
call test_proc1(1);
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
call test_proc2(@test_var);
|
||||||
|
select @test_var;
|
||||||
|
@test_var
|
||||||
|
10
|
||||||
|
set @test_var = 1;
|
||||||
|
call test_proc3(@test_var);
|
||||||
|
select @test_var;
|
||||||
|
@test_var
|
||||||
|
10
|
||||||
|
alter procedure test_proc1 comment 'new comment';
|
||||||
|
show create procedure test_proc1;
|
||||||
|
Procedure sql_mode Create Procedure
|
||||||
|
test_proc1 CREATE DEFINER=`root`@`localhost` PROCEDURE `test_proc1`(in var_in int)
|
||||||
|
COMMENT 'new comment'
|
||||||
|
begin
|
||||||
|
select * from t1 where a = var_in;
|
||||||
|
end
|
||||||
|
drop procedure test_proc1;
|
||||||
|
drop procedure test_proc2;
|
||||||
|
drop procedure test_proc3;
|
||||||
|
drop table t1;
|
||||||
|
End of 5.1 tests
|
@ -1,11 +1,14 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1, t2, t3, t4;
|
||||||
drop table if exists t2;
|
|
||||||
create table t1 (p int not null primary key, u int not null, o int not null,
|
create table t1 (p int not null primary key, u int not null, o int not null,
|
||||||
unique (u), key(o)) engine=ndb;
|
unique (u), key(o)) engine=ndb;
|
||||||
create table t2 (p int not null primary key, u int not null, o int not null,
|
create table t2 (p int not null primary key, u int not null, o int not null,
|
||||||
unique (u), key(o)) engine=ndb;
|
unique (u), key(o)) engine=ndb;
|
||||||
|
create table t3 (a int not null primary key, b int not null) engine=ndb;
|
||||||
|
create table t4 (c int not null primary key, d int not null) engine=ndb;
|
||||||
insert into t1 values (1,1,1),(2,2,2),(3,3,3);
|
insert into t1 values (1,1,1),(2,2,2),(3,3,3);
|
||||||
insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
|
insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
|
||||||
|
insert into t3 values (1,10), (2,10), (3,30), (4, 30);
|
||||||
|
insert into t4 values (1,10), (2,10), (3,30), (4, 30);
|
||||||
explain select * from t2 where p NOT IN (select p from t1);
|
explain select * from t2 where p NOT IN (select p from t1);
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where
|
1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where
|
||||||
@ -57,5 +60,33 @@ p u
|
|||||||
1 1
|
1 1
|
||||||
2 2
|
2 2
|
||||||
3 3
|
3 3
|
||||||
drop table t1;
|
select * from t3 where a = any (select c from t4 where c = 1) order by a;
|
||||||
drop table t2;
|
a b
|
||||||
|
1 10
|
||||||
|
select * from t3 where a in (select c from t4 where c = 1) order by a;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
select * from t3 where a <> some (select c from t4 where c = 1) order by a;
|
||||||
|
a b
|
||||||
|
2 10
|
||||||
|
3 30
|
||||||
|
4 30
|
||||||
|
select * from t3 where a > all (select c from t4 where c = 1) order by a;
|
||||||
|
a b
|
||||||
|
2 10
|
||||||
|
3 30
|
||||||
|
4 30
|
||||||
|
select * from t3 where row(1,10) = (select c,d from t4 where c = 1) order by a;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
2 10
|
||||||
|
3 30
|
||||||
|
4 30
|
||||||
|
select * from t3 where exists (select * from t4 where c = 1) order by a;
|
||||||
|
a b
|
||||||
|
1 10
|
||||||
|
2 10
|
||||||
|
3 30
|
||||||
|
4 30
|
||||||
|
drop table if exists t1, t2, t3, t4;
|
||||||
|
End of 5.1 tests
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
drop table if exists t1, t2, t3;
|
drop table if exists t1, t2, t3, t4, t5;
|
||||||
create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
|
create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
|
||||||
create table t2 (op char(1), a int not null, b decimal (63,30));
|
create table t2 (op char(1), a int not null, b decimal (63,30));
|
||||||
create table t3 select 1 as i;
|
create table t3 select 1 as i;
|
||||||
|
create table t4 (a int not null primary key, b int) engine=ndb;
|
||||||
|
create table t5 (a int not null primary key, b int) engine=ndb;
|
||||||
create trigger t1_bu before update on t1 for each row
|
create trigger t1_bu before update on t1 for each row
|
||||||
begin
|
begin
|
||||||
insert into t2 values ("u", old.a, old.b);
|
insert into t2 values ("u", old.a, old.b);
|
||||||
@ -11,7 +13,19 @@ create trigger t1_bd before delete on t1 for each row
|
|||||||
begin
|
begin
|
||||||
insert into t2 values ("d", old.a, old.b);
|
insert into t2 values ("d", old.a, old.b);
|
||||||
end;//
|
end;//
|
||||||
|
create trigger t4_au after update on t4
|
||||||
|
for each row begin
|
||||||
|
update t5 set b = b+1;
|
||||||
|
end;
|
||||||
|
//
|
||||||
|
create trigger t4_ad after delete on t4
|
||||||
|
for each row begin
|
||||||
|
update t5 set b = b+1;
|
||||||
|
end;
|
||||||
|
//
|
||||||
insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (3, 3, 3.05), (4, 4, 4.05);
|
insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (3, 3, 3.05), (4, 4, 4.05);
|
||||||
|
insert into t4 values (1,1), (2,2), (3,3), (4, 4);
|
||||||
|
insert into t5 values (1,0);
|
||||||
update t1 set a=5 where a != 3;
|
update t1 set a=5 where a != 3;
|
||||||
select * from t1 order by id;
|
select * from t1 order by id;
|
||||||
id a b
|
id a b
|
||||||
@ -115,5 +129,16 @@ select * from t2 order by op, a, b;
|
|||||||
op a b
|
op a b
|
||||||
d 1 1.050000000000000000000000000000
|
d 1 1.050000000000000000000000000000
|
||||||
d 2 2.050000000000000000000000000000
|
d 2 2.050000000000000000000000000000
|
||||||
drop tables t1, t2, t3;
|
update t4 set b = 10 where a = 1;
|
||||||
End of 5.0 tests
|
select * from t5 order by a;
|
||||||
|
a b
|
||||||
|
1 1
|
||||||
|
update t5 set b = 0;
|
||||||
|
delete from t4 where a = 1;
|
||||||
|
select * from t5 order by a;
|
||||||
|
a b
|
||||||
|
1 1
|
||||||
|
drop trigger t4_au;
|
||||||
|
drop trigger t4_ad;
|
||||||
|
drop table t1, t2, t3, t4, t5;
|
||||||
|
End of 5.1 tests
|
||||||
|
@ -1409,7 +1409,7 @@ select a,b from t1 where b = @arg00;
|
|||||||
a b
|
a b
|
||||||
6 six
|
6 six
|
||||||
execute stmt1 using @arg00;
|
execute stmt1 using @arg00;
|
||||||
ERROR 23000: Duplicate entry '6' for key 1
|
ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
|
||||||
set @arg00=NULL ;
|
set @arg00=NULL ;
|
||||||
prepare stmt1 from 'insert into t1 values(0, ? )';
|
prepare stmt1 from 'insert into t1 values(0, ? )';
|
||||||
execute stmt1 using @arg00;
|
execute stmt1 using @arg00;
|
||||||
@ -1522,7 +1522,7 @@ a b
|
|||||||
set @arg00=81 ;
|
set @arg00=81 ;
|
||||||
set @arg01=1 ;
|
set @arg01=1 ;
|
||||||
execute stmt1 using @arg00, @arg01;
|
execute stmt1 using @arg00, @arg01;
|
||||||
ERROR 23000: Duplicate entry '82' for key 1
|
ERROR 23000: Duplicate entry '82' for key 'PRIMARY'
|
||||||
drop table if exists t2 ;
|
drop table if exists t2 ;
|
||||||
create table t2 (id int auto_increment primary key)
|
create table t2 (id int auto_increment primary key)
|
||||||
ENGINE= 'NDB' ;
|
ENGINE= 'NDB' ;
|
||||||
@ -1758,31 +1758,31 @@ NULL as const12, @arg12 as param12,
|
|||||||
show create table t5 ;
|
show create table t5 ;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t5 CREATE TABLE `t5` (
|
t5 CREATE TABLE `t5` (
|
||||||
`const01` int(1) NOT NULL default '0',
|
`const01` int(1) NOT NULL DEFAULT '0',
|
||||||
`param01` bigint(20) default NULL,
|
`param01` bigint(20) DEFAULT NULL,
|
||||||
`const02` decimal(2,1) NOT NULL default '0.0',
|
`const02` decimal(2,1) NOT NULL DEFAULT '0.0',
|
||||||
`param02` decimal(65,30) default NULL,
|
`param02` decimal(65,30) DEFAULT NULL,
|
||||||
`const03` double NOT NULL default '0',
|
`const03` double NOT NULL DEFAULT '0',
|
||||||
`param03` double default NULL,
|
`param03` double DEFAULT NULL,
|
||||||
`const04` varchar(3) NOT NULL default '',
|
`const04` varchar(3) NOT NULL DEFAULT '',
|
||||||
`param04` longtext,
|
`param04` longtext,
|
||||||
`const05` varbinary(3) NOT NULL default '',
|
`const05` varbinary(3) NOT NULL DEFAULT '',
|
||||||
`param05` longblob,
|
`param05` longblob,
|
||||||
`const06` varchar(10) NOT NULL default '',
|
`const06` varchar(10) NOT NULL DEFAULT '',
|
||||||
`param06` longtext,
|
`param06` longtext,
|
||||||
`const07` date default NULL,
|
`const07` date DEFAULT NULL,
|
||||||
`param07` longblob,
|
`param07` longblob,
|
||||||
`const08` varchar(19) NOT NULL default '',
|
`const08` varchar(19) NOT NULL DEFAULT '',
|
||||||
`param08` longtext,
|
`param08` longtext,
|
||||||
`const09` datetime default NULL,
|
`const09` datetime DEFAULT NULL,
|
||||||
`param09` longblob,
|
`param09` longblob,
|
||||||
`const10` int(10) NOT NULL default '0',
|
`const10` int(10) NOT NULL DEFAULT '0',
|
||||||
`param10` bigint(20) default NULL,
|
`param10` bigint(20) DEFAULT NULL,
|
||||||
`const11` int(4) default NULL,
|
`const11` int(4) DEFAULT NULL,
|
||||||
`param11` bigint(20) default NULL,
|
`param11` bigint(20) DEFAULT NULL,
|
||||||
`const12` binary(0) default NULL,
|
`const12` binary(0) DEFAULT NULL,
|
||||||
`param12` bigint(20) default NULL,
|
`param12` bigint(20) DEFAULT NULL,
|
||||||
`param13` decimal(65,30) default NULL,
|
`param13` decimal(65,30) DEFAULT NULL,
|
||||||
`param14` longtext,
|
`param14` longtext,
|
||||||
`param15` longblob
|
`param15` longblob
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
@ -1912,26 +1912,26 @@ def @arg09 253 23 1 Y 128 31 63
|
|||||||
def @arg10 253 23 1 Y 128 31 63
|
def @arg10 253 23 1 Y 128 31 63
|
||||||
def @arg11 253 67 6 Y 128 30 63
|
def @arg11 253 67 6 Y 128 30 63
|
||||||
def @arg12 253 67 6 Y 128 30 63
|
def @arg12 253 67 6 Y 128 30 63
|
||||||
def @arg13 253 8192 10 Y 128 31 63
|
def @arg13 253 16777216 10 Y 128 31 63
|
||||||
def @arg14 253 8192 19 Y 128 31 63
|
def @arg14 253 16777216 19 Y 128 31 63
|
||||||
def @arg15 253 8192 19 Y 128 31 63
|
def @arg15 253 16777216 19 Y 128 31 63
|
||||||
def @arg16 253 8192 8 Y 128 31 63
|
def @arg16 253 16777216 8 Y 128 31 63
|
||||||
def @arg17 253 20 4 Y 128 0 63
|
def @arg17 253 20 4 Y 128 0 63
|
||||||
def @arg18 253 20 1 Y 128 0 63
|
def @arg18 253 20 1 Y 128 0 63
|
||||||
def @arg19 253 20 1 Y 128 0 63
|
def @arg19 253 20 1 Y 128 0 63
|
||||||
def @arg20 253 8192 1 Y 0 31 8
|
def @arg20 253 16777216 1 Y 0 31 8
|
||||||
def @arg21 253 8192 10 Y 0 31 8
|
def @arg21 253 16777216 10 Y 0 31 8
|
||||||
def @arg22 253 8192 30 Y 0 31 8
|
def @arg22 253 16777216 30 Y 0 31 8
|
||||||
def @arg23 253 8192 8 Y 128 31 63
|
def @arg23 253 16777216 8 Y 128 31 63
|
||||||
def @arg24 253 8192 8 Y 0 31 8
|
def @arg24 253 16777216 8 Y 0 31 8
|
||||||
def @arg25 253 8192 4 Y 128 31 63
|
def @arg25 253 16777216 4 Y 128 31 63
|
||||||
def @arg26 253 8192 4 Y 0 31 8
|
def @arg26 253 16777216 4 Y 0 31 8
|
||||||
def @arg27 253 8192 10 Y 128 31 63
|
def @arg27 253 16777216 10 Y 128 31 63
|
||||||
def @arg28 253 8192 10 Y 0 31 8
|
def @arg28 253 16777216 10 Y 0 31 8
|
||||||
def @arg29 253 8192 8 Y 128 31 63
|
def @arg29 253 16777216 8 Y 128 31 63
|
||||||
def @arg30 253 8192 8 Y 0 31 8
|
def @arg30 253 16777216 8 Y 0 31 8
|
||||||
def @arg31 253 8192 3 Y 0 31 8
|
def @arg31 253 16777216 3 Y 0 31 8
|
||||||
def @arg32 253 8192 6 Y 0 31 8
|
def @arg32 253 16777216 6 Y 0 31 8
|
||||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||||
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
|
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
|
||||||
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
|
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
|
||||||
@ -1959,26 +1959,26 @@ def @arg09 253 23 0 Y 128 31 63
|
|||||||
def @arg10 253 23 0 Y 128 31 63
|
def @arg10 253 23 0 Y 128 31 63
|
||||||
def @arg11 253 67 0 Y 128 30 63
|
def @arg11 253 67 0 Y 128 30 63
|
||||||
def @arg12 253 67 0 Y 128 30 63
|
def @arg12 253 67 0 Y 128 30 63
|
||||||
def @arg13 253 8192 0 Y 128 31 63
|
def @arg13 253 16777216 0 Y 128 31 63
|
||||||
def @arg14 253 8192 0 Y 128 31 63
|
def @arg14 253 16777216 0 Y 128 31 63
|
||||||
def @arg15 253 8192 19 Y 128 31 63
|
def @arg15 253 16777216 19 Y 128 31 63
|
||||||
def @arg16 253 8192 0 Y 128 31 63
|
def @arg16 253 16777216 0 Y 128 31 63
|
||||||
def @arg17 253 20 0 Y 128 0 63
|
def @arg17 253 20 0 Y 128 0 63
|
||||||
def @arg18 253 20 0 Y 128 0 63
|
def @arg18 253 20 0 Y 128 0 63
|
||||||
def @arg19 253 20 0 Y 128 0 63
|
def @arg19 253 20 0 Y 128 0 63
|
||||||
def @arg20 253 8192 0 Y 0 31 8
|
def @arg20 253 16777216 0 Y 0 31 8
|
||||||
def @arg21 253 8192 0 Y 0 31 8
|
def @arg21 253 16777216 0 Y 0 31 8
|
||||||
def @arg22 253 8192 0 Y 0 31 8
|
def @arg22 253 16777216 0 Y 0 31 8
|
||||||
def @arg23 253 8192 0 Y 128 31 63
|
def @arg23 253 16777216 0 Y 128 31 63
|
||||||
def @arg24 253 8192 0 Y 0 31 8
|
def @arg24 253 16777216 0 Y 0 31 8
|
||||||
def @arg25 253 8192 0 Y 128 31 63
|
def @arg25 253 16777216 0 Y 128 31 63
|
||||||
def @arg26 253 8192 0 Y 0 31 8
|
def @arg26 253 16777216 0 Y 0 31 8
|
||||||
def @arg27 253 8192 0 Y 128 31 63
|
def @arg27 253 16777216 0 Y 128 31 63
|
||||||
def @arg28 253 8192 0 Y 0 31 8
|
def @arg28 253 16777216 0 Y 0 31 8
|
||||||
def @arg29 253 8192 0 Y 128 31 63
|
def @arg29 253 16777216 0 Y 128 31 63
|
||||||
def @arg30 253 8192 0 Y 0 31 8
|
def @arg30 253 16777216 0 Y 0 31 8
|
||||||
def @arg31 253 8192 0 Y 0 31 8
|
def @arg31 253 16777216 0 Y 0 31 8
|
||||||
def @arg32 253 8192 0 Y 0 31 8
|
def @arg32 253 16777216 0 Y 0 31 8
|
||||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||||
prepare stmt1 from "select
|
prepare stmt1 from "select
|
||||||
@ -2009,26 +2009,26 @@ def @arg09 253 23 1 Y 128 31 63
|
|||||||
def @arg10 253 23 1 Y 128 31 63
|
def @arg10 253 23 1 Y 128 31 63
|
||||||
def @arg11 253 67 6 Y 128 30 63
|
def @arg11 253 67 6 Y 128 30 63
|
||||||
def @arg12 253 67 6 Y 128 30 63
|
def @arg12 253 67 6 Y 128 30 63
|
||||||
def @arg13 253 8192 10 Y 128 31 63
|
def @arg13 253 16777216 10 Y 128 31 63
|
||||||
def @arg14 253 8192 19 Y 128 31 63
|
def @arg14 253 16777216 19 Y 128 31 63
|
||||||
def @arg15 253 8192 19 Y 128 31 63
|
def @arg15 253 16777216 19 Y 128 31 63
|
||||||
def @arg16 253 8192 8 Y 128 31 63
|
def @arg16 253 16777216 8 Y 128 31 63
|
||||||
def @arg17 253 20 4 Y 128 0 63
|
def @arg17 253 20 4 Y 128 0 63
|
||||||
def @arg18 253 20 1 Y 128 0 63
|
def @arg18 253 20 1 Y 128 0 63
|
||||||
def @arg19 253 20 1 Y 128 0 63
|
def @arg19 253 20 1 Y 128 0 63
|
||||||
def @arg20 253 8192 1 Y 0 31 8
|
def @arg20 253 16777216 1 Y 0 31 8
|
||||||
def @arg21 253 8192 10 Y 0 31 8
|
def @arg21 253 16777216 10 Y 0 31 8
|
||||||
def @arg22 253 8192 30 Y 0 31 8
|
def @arg22 253 16777216 30 Y 0 31 8
|
||||||
def @arg23 253 8192 8 Y 128 31 63
|
def @arg23 253 16777216 8 Y 128 31 63
|
||||||
def @arg24 253 8192 8 Y 0 31 8
|
def @arg24 253 16777216 8 Y 0 31 8
|
||||||
def @arg25 253 8192 4 Y 128 31 63
|
def @arg25 253 16777216 4 Y 128 31 63
|
||||||
def @arg26 253 8192 4 Y 0 31 8
|
def @arg26 253 16777216 4 Y 0 31 8
|
||||||
def @arg27 253 8192 10 Y 128 31 63
|
def @arg27 253 16777216 10 Y 128 31 63
|
||||||
def @arg28 253 8192 10 Y 0 31 8
|
def @arg28 253 16777216 10 Y 0 31 8
|
||||||
def @arg29 253 8192 8 Y 128 31 63
|
def @arg29 253 16777216 8 Y 128 31 63
|
||||||
def @arg30 253 8192 8 Y 0 31 8
|
def @arg30 253 16777216 8 Y 0 31 8
|
||||||
def @arg31 253 8192 3 Y 0 31 8
|
def @arg31 253 16777216 3 Y 0 31 8
|
||||||
def @arg32 253 8192 6 Y 0 31 8
|
def @arg32 253 16777216 6 Y 0 31 8
|
||||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||||
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
|
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
|
||||||
set @my_key= 0 ;
|
set @my_key= 0 ;
|
||||||
@ -2049,26 +2049,26 @@ def @arg09 253 23 0 Y 128 31 63
|
|||||||
def @arg10 253 23 0 Y 128 31 63
|
def @arg10 253 23 0 Y 128 31 63
|
||||||
def @arg11 253 67 0 Y 128 30 63
|
def @arg11 253 67 0 Y 128 30 63
|
||||||
def @arg12 253 67 0 Y 128 30 63
|
def @arg12 253 67 0 Y 128 30 63
|
||||||
def @arg13 253 8192 0 Y 128 31 63
|
def @arg13 253 16777216 0 Y 128 31 63
|
||||||
def @arg14 253 8192 0 Y 128 31 63
|
def @arg14 253 16777216 0 Y 128 31 63
|
||||||
def @arg15 253 8192 19 Y 128 31 63
|
def @arg15 253 16777216 19 Y 128 31 63
|
||||||
def @arg16 253 8192 0 Y 128 31 63
|
def @arg16 253 16777216 0 Y 128 31 63
|
||||||
def @arg17 253 20 0 Y 128 0 63
|
def @arg17 253 20 0 Y 128 0 63
|
||||||
def @arg18 253 20 0 Y 128 0 63
|
def @arg18 253 20 0 Y 128 0 63
|
||||||
def @arg19 253 20 0 Y 128 0 63
|
def @arg19 253 20 0 Y 128 0 63
|
||||||
def @arg20 253 8192 0 Y 0 31 8
|
def @arg20 253 16777216 0 Y 0 31 8
|
||||||
def @arg21 253 8192 0 Y 0 31 8
|
def @arg21 253 16777216 0 Y 0 31 8
|
||||||
def @arg22 253 8192 0 Y 0 31 8
|
def @arg22 253 16777216 0 Y 0 31 8
|
||||||
def @arg23 253 8192 0 Y 128 31 63
|
def @arg23 253 16777216 0 Y 128 31 63
|
||||||
def @arg24 253 8192 0 Y 0 31 8
|
def @arg24 253 16777216 0 Y 0 31 8
|
||||||
def @arg25 253 8192 0 Y 128 31 63
|
def @arg25 253 16777216 0 Y 128 31 63
|
||||||
def @arg26 253 8192 0 Y 0 31 8
|
def @arg26 253 16777216 0 Y 0 31 8
|
||||||
def @arg27 253 8192 0 Y 128 31 63
|
def @arg27 253 16777216 0 Y 128 31 63
|
||||||
def @arg28 253 8192 0 Y 0 31 8
|
def @arg28 253 16777216 0 Y 0 31 8
|
||||||
def @arg29 253 8192 0 Y 128 31 63
|
def @arg29 253 16777216 0 Y 128 31 63
|
||||||
def @arg30 253 8192 0 Y 0 31 8
|
def @arg30 253 16777216 0 Y 0 31 8
|
||||||
def @arg31 253 8192 0 Y 0 31 8
|
def @arg31 253 16777216 0 Y 0 31 8
|
||||||
def @arg32 253 8192 0 Y 0 31 8
|
def @arg32 253 16777216 0 Y 0 31 8
|
||||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||||
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
|
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
|
||||||
@ -2097,26 +2097,26 @@ def @arg09 253 23 1 Y 128 31 63
|
|||||||
def @arg10 253 23 1 Y 128 31 63
|
def @arg10 253 23 1 Y 128 31 63
|
||||||
def @arg11 253 67 6 Y 128 30 63
|
def @arg11 253 67 6 Y 128 30 63
|
||||||
def @arg12 253 67 6 Y 128 30 63
|
def @arg12 253 67 6 Y 128 30 63
|
||||||
def @arg13 253 8192 10 Y 128 31 63
|
def @arg13 253 16777216 10 Y 128 31 63
|
||||||
def @arg14 253 8192 19 Y 128 31 63
|
def @arg14 253 16777216 19 Y 128 31 63
|
||||||
def @arg15 253 8192 19 Y 128 31 63
|
def @arg15 253 16777216 19 Y 128 31 63
|
||||||
def @arg16 253 8192 8 Y 128 31 63
|
def @arg16 253 16777216 8 Y 128 31 63
|
||||||
def @arg17 253 20 4 Y 128 0 63
|
def @arg17 253 20 4 Y 128 0 63
|
||||||
def @arg18 253 20 1 Y 128 0 63
|
def @arg18 253 20 1 Y 128 0 63
|
||||||
def @arg19 253 20 1 Y 128 0 63
|
def @arg19 253 20 1 Y 128 0 63
|
||||||
def @arg20 253 8192 1 Y 0 31 8
|
def @arg20 253 16777216 1 Y 0 31 8
|
||||||
def @arg21 253 8192 10 Y 0 31 8
|
def @arg21 253 16777216 10 Y 0 31 8
|
||||||
def @arg22 253 8192 30 Y 0 31 8
|
def @arg22 253 16777216 30 Y 0 31 8
|
||||||
def @arg23 253 8192 8 Y 128 31 63
|
def @arg23 253 16777216 8 Y 128 31 63
|
||||||
def @arg24 253 8192 8 Y 0 31 8
|
def @arg24 253 16777216 8 Y 0 31 8
|
||||||
def @arg25 253 8192 4 Y 128 31 63
|
def @arg25 253 16777216 4 Y 128 31 63
|
||||||
def @arg26 253 8192 4 Y 0 31 8
|
def @arg26 253 16777216 4 Y 0 31 8
|
||||||
def @arg27 253 8192 10 Y 128 31 63
|
def @arg27 253 16777216 10 Y 128 31 63
|
||||||
def @arg28 253 8192 10 Y 0 31 8
|
def @arg28 253 16777216 10 Y 0 31 8
|
||||||
def @arg29 253 8192 8 Y 128 31 63
|
def @arg29 253 16777216 8 Y 128 31 63
|
||||||
def @arg30 253 8192 8 Y 0 31 8
|
def @arg30 253 16777216 8 Y 0 31 8
|
||||||
def @arg31 253 8192 3 Y 0 31 8
|
def @arg31 253 16777216 3 Y 0 31 8
|
||||||
def @arg32 253 8192 6 Y 0 31 8
|
def @arg32 253 16777216 6 Y 0 31 8
|
||||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||||
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
|
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
|
||||||
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
|
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
|
||||||
@ -2141,26 +2141,26 @@ def @arg09 253 23 0 Y 128 31 63
|
|||||||
def @arg10 253 23 0 Y 128 31 63
|
def @arg10 253 23 0 Y 128 31 63
|
||||||
def @arg11 253 67 0 Y 128 30 63
|
def @arg11 253 67 0 Y 128 30 63
|
||||||
def @arg12 253 67 0 Y 128 30 63
|
def @arg12 253 67 0 Y 128 30 63
|
||||||
def @arg13 253 8192 0 Y 128 31 63
|
def @arg13 253 16777216 0 Y 128 31 63
|
||||||
def @arg14 253 8192 0 Y 128 31 63
|
def @arg14 253 16777216 0 Y 128 31 63
|
||||||
def @arg15 253 8192 19 Y 128 31 63
|
def @arg15 253 16777216 19 Y 128 31 63
|
||||||
def @arg16 253 8192 0 Y 128 31 63
|
def @arg16 253 16777216 0 Y 128 31 63
|
||||||
def @arg17 253 20 0 Y 128 0 63
|
def @arg17 253 20 0 Y 128 0 63
|
||||||
def @arg18 253 20 0 Y 128 0 63
|
def @arg18 253 20 0 Y 128 0 63
|
||||||
def @arg19 253 20 0 Y 128 0 63
|
def @arg19 253 20 0 Y 128 0 63
|
||||||
def @arg20 253 8192 0 Y 0 31 8
|
def @arg20 253 16777216 0 Y 0 31 8
|
||||||
def @arg21 253 8192 0 Y 0 31 8
|
def @arg21 253 16777216 0 Y 0 31 8
|
||||||
def @arg22 253 8192 0 Y 0 31 8
|
def @arg22 253 16777216 0 Y 0 31 8
|
||||||
def @arg23 253 8192 0 Y 128 31 63
|
def @arg23 253 16777216 0 Y 128 31 63
|
||||||
def @arg24 253 8192 0 Y 0 31 8
|
def @arg24 253 16777216 0 Y 0 31 8
|
||||||
def @arg25 253 8192 0 Y 128 31 63
|
def @arg25 253 16777216 0 Y 128 31 63
|
||||||
def @arg26 253 8192 0 Y 0 31 8
|
def @arg26 253 16777216 0 Y 0 31 8
|
||||||
def @arg27 253 8192 0 Y 128 31 63
|
def @arg27 253 16777216 0 Y 128 31 63
|
||||||
def @arg28 253 8192 0 Y 0 31 8
|
def @arg28 253 16777216 0 Y 0 31 8
|
||||||
def @arg29 253 8192 0 Y 128 31 63
|
def @arg29 253 16777216 0 Y 128 31 63
|
||||||
def @arg30 253 8192 0 Y 0 31 8
|
def @arg30 253 16777216 0 Y 0 31 8
|
||||||
def @arg31 253 8192 0 Y 0 31 8
|
def @arg31 253 16777216 0 Y 0 31 8
|
||||||
def @arg32 253 8192 0 Y 0 31 8
|
def @arg32 253 16777216 0 Y 0 31 8
|
||||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||||
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
|
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
|
||||||
@ -2187,26 +2187,26 @@ def @arg09 253 23 1 Y 128 31 63
|
|||||||
def @arg10 253 23 1 Y 128 31 63
|
def @arg10 253 23 1 Y 128 31 63
|
||||||
def @arg11 253 67 6 Y 128 30 63
|
def @arg11 253 67 6 Y 128 30 63
|
||||||
def @arg12 253 67 6 Y 128 30 63
|
def @arg12 253 67 6 Y 128 30 63
|
||||||
def @arg13 253 8192 10 Y 128 31 63
|
def @arg13 253 16777216 10 Y 128 31 63
|
||||||
def @arg14 253 8192 19 Y 128 31 63
|
def @arg14 253 16777216 19 Y 128 31 63
|
||||||
def @arg15 253 8192 19 Y 128 31 63
|
def @arg15 253 16777216 19 Y 128 31 63
|
||||||
def @arg16 253 8192 8 Y 128 31 63
|
def @arg16 253 16777216 8 Y 128 31 63
|
||||||
def @arg17 253 20 4 Y 128 0 63
|
def @arg17 253 20 4 Y 128 0 63
|
||||||
def @arg18 253 20 1 Y 128 0 63
|
def @arg18 253 20 1 Y 128 0 63
|
||||||
def @arg19 253 20 1 Y 128 0 63
|
def @arg19 253 20 1 Y 128 0 63
|
||||||
def @arg20 253 8192 1 Y 0 31 8
|
def @arg20 253 16777216 1 Y 0 31 8
|
||||||
def @arg21 253 8192 10 Y 0 31 8
|
def @arg21 253 16777216 10 Y 0 31 8
|
||||||
def @arg22 253 8192 30 Y 0 31 8
|
def @arg22 253 16777216 30 Y 0 31 8
|
||||||
def @arg23 253 8192 8 Y 128 31 63
|
def @arg23 253 16777216 8 Y 128 31 63
|
||||||
def @arg24 253 8192 8 Y 0 31 8
|
def @arg24 253 16777216 8 Y 0 31 8
|
||||||
def @arg25 253 8192 4 Y 128 31 63
|
def @arg25 253 16777216 4 Y 128 31 63
|
||||||
def @arg26 253 8192 4 Y 0 31 8
|
def @arg26 253 16777216 4 Y 0 31 8
|
||||||
def @arg27 253 8192 10 Y 128 31 63
|
def @arg27 253 16777216 10 Y 128 31 63
|
||||||
def @arg28 253 8192 10 Y 0 31 8
|
def @arg28 253 16777216 10 Y 0 31 8
|
||||||
def @arg29 253 8192 8 Y 128 31 63
|
def @arg29 253 16777216 8 Y 128 31 63
|
||||||
def @arg30 253 8192 8 Y 0 31 8
|
def @arg30 253 16777216 8 Y 0 31 8
|
||||||
def @arg31 253 8192 3 Y 0 31 8
|
def @arg31 253 16777216 3 Y 0 31 8
|
||||||
def @arg32 253 8192 6 Y 0 31 8
|
def @arg32 253 16777216 6 Y 0 31 8
|
||||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||||
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
|
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
|
||||||
set @my_key= 0 ;
|
set @my_key= 0 ;
|
||||||
@ -2225,26 +2225,26 @@ def @arg09 253 23 0 Y 128 31 63
|
|||||||
def @arg10 253 23 0 Y 128 31 63
|
def @arg10 253 23 0 Y 128 31 63
|
||||||
def @arg11 253 67 0 Y 128 30 63
|
def @arg11 253 67 0 Y 128 30 63
|
||||||
def @arg12 253 67 0 Y 128 30 63
|
def @arg12 253 67 0 Y 128 30 63
|
||||||
def @arg13 253 8192 0 Y 128 31 63
|
def @arg13 253 16777216 0 Y 128 31 63
|
||||||
def @arg14 253 8192 0 Y 128 31 63
|
def @arg14 253 16777216 0 Y 128 31 63
|
||||||
def @arg15 253 8192 19 Y 128 31 63
|
def @arg15 253 16777216 19 Y 128 31 63
|
||||||
def @arg16 253 8192 0 Y 128 31 63
|
def @arg16 253 16777216 0 Y 128 31 63
|
||||||
def @arg17 253 20 0 Y 128 0 63
|
def @arg17 253 20 0 Y 128 0 63
|
||||||
def @arg18 253 20 0 Y 128 0 63
|
def @arg18 253 20 0 Y 128 0 63
|
||||||
def @arg19 253 20 0 Y 128 0 63
|
def @arg19 253 20 0 Y 128 0 63
|
||||||
def @arg20 253 8192 0 Y 0 31 8
|
def @arg20 253 16777216 0 Y 0 31 8
|
||||||
def @arg21 253 8192 0 Y 0 31 8
|
def @arg21 253 16777216 0 Y 0 31 8
|
||||||
def @arg22 253 8192 0 Y 0 31 8
|
def @arg22 253 16777216 0 Y 0 31 8
|
||||||
def @arg23 253 8192 0 Y 128 31 63
|
def @arg23 253 16777216 0 Y 128 31 63
|
||||||
def @arg24 253 8192 0 Y 0 31 8
|
def @arg24 253 16777216 0 Y 0 31 8
|
||||||
def @arg25 253 8192 0 Y 128 31 63
|
def @arg25 253 16777216 0 Y 128 31 63
|
||||||
def @arg26 253 8192 0 Y 0 31 8
|
def @arg26 253 16777216 0 Y 0 31 8
|
||||||
def @arg27 253 8192 0 Y 128 31 63
|
def @arg27 253 16777216 0 Y 128 31 63
|
||||||
def @arg28 253 8192 0 Y 0 31 8
|
def @arg28 253 16777216 0 Y 0 31 8
|
||||||
def @arg29 253 8192 0 Y 128 31 63
|
def @arg29 253 16777216 0 Y 128 31 63
|
||||||
def @arg30 253 8192 0 Y 0 31 8
|
def @arg30 253 16777216 0 Y 0 31 8
|
||||||
def @arg31 253 8192 0 Y 0 31 8
|
def @arg31 253 16777216 0 Y 0 31 8
|
||||||
def @arg32 253 8192 0 Y 0 31 8
|
def @arg32 253 16777216 0 Y 0 31 8
|
||||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||||
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
|
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
|
||||||
|
@ -70,7 +70,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
PRIMARY KEY (`c1`),
|
PRIMARY KEY (`c1`),
|
||||||
KEY `t1_i` (`c2`,`c3`),
|
KEY `t1_i` (`c2`,`c3`),
|
||||||
KEY `c5` (`c5`)
|
KEY `c5` (`c5`)
|
||||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
**** Show first set of ALTERs on SLAVE ****
|
**** Show first set of ALTERs on SLAVE ****
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
@ -83,7 +83,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
PRIMARY KEY (`c1`),
|
PRIMARY KEY (`c1`),
|
||||||
KEY `t1_i` (`c2`,`c3`),
|
KEY `t1_i` (`c2`,`c3`),
|
||||||
KEY `c5` (`c5`)
|
KEY `c5` (`c5`)
|
||||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
**** Second set of alters test 1 ****
|
**** Second set of alters test 1 ****
|
||||||
ALTER TABLE t1 RENAME t2;
|
ALTER TABLE t1 RENAME t2;
|
||||||
ALTER TABLE t2 DROP INDEX c5;
|
ALTER TABLE t2 DROP INDEX c5;
|
||||||
@ -102,7 +102,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
`c5` double DEFAULT NULL,
|
`c5` double DEFAULT NULL,
|
||||||
PRIMARY KEY (`c1`),
|
PRIMARY KEY (`c1`),
|
||||||
KEY `t1_i` (`c2`,`c3`)
|
KEY `t1_i` (`c2`,`c3`)
|
||||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
**** Show second set of ALTERs on SLAVE ****
|
**** Show second set of ALTERs on SLAVE ****
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
@ -114,7 +114,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
`c5` double DEFAULT NULL,
|
`c5` double DEFAULT NULL,
|
||||||
PRIMARY KEY (`c1`),
|
PRIMARY KEY (`c1`),
|
||||||
KEY `t1_i` (`c2`,`c3`)
|
KEY `t1_i` (`c2`,`c3`)
|
||||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
**** Third and last set of alters for test1 ****
|
**** Third and last set of alters for test1 ****
|
||||||
ALTER TABLE t1 CHANGE c1 c1 DOUBLE;
|
ALTER TABLE t1 CHANGE c1 c1 DOUBLE;
|
||||||
ALTER TABLE t1 CHANGE c2 c2 DECIMAL(10,2);
|
ALTER TABLE t1 CHANGE c2 c2 DECIMAL(10,2);
|
||||||
@ -136,7 +136,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
`c5` double DEFAULT NULL,
|
`c5` double DEFAULT NULL,
|
||||||
PRIMARY KEY (`c1`),
|
PRIMARY KEY (`c1`),
|
||||||
KEY `t1_i` (`c2`)
|
KEY `t1_i` (`c2`)
|
||||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
SELECT * FROM t1 ORDER BY c1 LIMIT 5;
|
SELECT * FROM t1 ORDER BY c1 LIMIT 5;
|
||||||
c1 c2 c3 c5
|
c1 c2 c3 c5
|
||||||
1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
|
1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
|
||||||
@ -154,7 +154,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
`c5` double DEFAULT NULL,
|
`c5` double DEFAULT NULL,
|
||||||
PRIMARY KEY (`c1`),
|
PRIMARY KEY (`c1`),
|
||||||
KEY `t1_i` (`c2`)
|
KEY `t1_i` (`c2`)
|
||||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||||
SELECT * FROM t1 where c1 = 1;
|
SELECT * FROM t1 where c1 = 1;
|
||||||
c1 c2 c3 c5
|
c1 c2 c3 c5
|
||||||
1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
|
1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
|
||||||
|
@ -21,7 +21,6 @@ ndb_restore_partition : Problem with cluster/def/schema table that is in std_
|
|||||||
rpl_ndb_sync : Problem with cluster/def/schema table that is in std_data/ndb_backup51; Pekka will schdule this to someone
|
rpl_ndb_sync : Problem with cluster/def/schema table that is in std_data/ndb_backup51; Pekka will schdule this to someone
|
||||||
|
|
||||||
partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
|
partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
|
||||||
ps_7ndb : BUG#18950 2006-02-16 jmiller create table like does not obtain LOCK_open
|
|
||||||
rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
|
rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
|
||||||
rpl_ndb_2myisam : BUG#19227 Seems to pass currently
|
rpl_ndb_2myisam : BUG#19227 Seems to pass currently
|
||||||
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
|
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
|
||||||
@ -34,8 +33,8 @@ synchronization : Bug#24529 Test 'synchronization' fails on Mac pushb
|
|||||||
|
|
||||||
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
|
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
|
||||||
#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
|
#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
|
||||||
ndb_binlog_discover : bug#21806 2006-08-24
|
#ndb_binlog_discover : bug#21806 2006-08-24
|
||||||
ndb_autodiscover3 : bug#21806
|
#ndb_autodiscover3 : bug#21806
|
||||||
|
|
||||||
flush2 : Bug#24805 Pushbuild can't handle test with --disable-log-bin
|
flush2 : Bug#24805 Pushbuild can't handle test with --disable-log-bin
|
||||||
mysql_upgrade : Bug#25074 mysql_upgrade gives inconsisten results
|
mysql_upgrade : Bug#25074 mysql_upgrade gives inconsisten results
|
||||||
|
@ -410,3 +410,30 @@ alter table t2 rename t1;
|
|||||||
insert into t1 (b) values (401),(402),(403);
|
insert into t1 (b) values (401),(402),(403);
|
||||||
select * from t1 where a = 12;
|
select * from t1 where a = 12;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
# some other ALTER combinations
|
||||||
|
# add/drop pk
|
||||||
|
create table t1 (a int not null, b varchar(10)) engine=ndb;
|
||||||
|
show index from t1;
|
||||||
|
alter table t1 add primary key (a);
|
||||||
|
show index from t1;
|
||||||
|
alter table t1 drop primary key;
|
||||||
|
show index from t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
# alter .. alter
|
||||||
|
create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
|
||||||
|
show create table t1;
|
||||||
|
alter table t1 alter b set default 1;
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
# alter .. order by
|
||||||
|
create table t1 (a int not null, b int not null) engine=ndb;
|
||||||
|
insert into t1 values (1, 300), (2, 200), (3, 100);
|
||||||
|
select * from t1 order by a;
|
||||||
|
alter table t1 order by b;
|
||||||
|
select * from t1 order by b;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
--echo End of 5.1 tests
|
||||||
|
@ -747,4 +747,57 @@ select * from t1 order by a;
|
|||||||
select * from t2 order by a;
|
select * from t2 order by a;
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
|
||||||
|
# create table if not exists
|
||||||
|
--disable_warnings
|
||||||
|
create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
|
||||||
|
create table if not exists t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
# create like
|
||||||
|
create table t2 like t1;
|
||||||
|
|
||||||
|
# multi rename
|
||||||
|
rename table t1 to t10, t2 to t20;
|
||||||
|
drop table t10,t20;
|
||||||
|
|
||||||
|
# delete
|
||||||
|
create table t1 (a int not null primary key, b int not null) engine=ndb;
|
||||||
|
create table t2 (a int not null primary key, b int not null) engine=ndb;
|
||||||
|
insert into t1 values (1,10), (2,20), (3,30);
|
||||||
|
insert into t2 values (1,10), (2,20), (3,30);
|
||||||
|
select * from t1 order by a;
|
||||||
|
delete from t1 where a > 0 order by a desc limit 1;
|
||||||
|
select * from t1 order by a;
|
||||||
|
delete from t1,t2 using t1,t2 where t1.a = t2.a;
|
||||||
|
select * from t2 order by a;
|
||||||
|
drop table t1,t2;
|
||||||
|
|
||||||
|
# insert ignore
|
||||||
|
create table t1 (a int not null primary key, b int not null) engine=ndb;
|
||||||
|
insert into t1 values (1,10), (2,20), (3,30);
|
||||||
|
--error 1062
|
||||||
|
insert into t1 set a=1, b=100;
|
||||||
|
insert ignore into t1 set a=1, b=100;
|
||||||
|
select * from t1 order by a;
|
||||||
|
insert into t1 set a=1, b=1000 on duplicate key update b=b+1;
|
||||||
|
select * from t1 order by a;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
# update
|
||||||
|
create table t1 (a int not null primary key, b int not null) engine=ndb;
|
||||||
|
create table t2 (c int not null primary key, d int not null) engine=ndb;
|
||||||
|
insert into t1 values (1,10), (2,10), (3,30), (4, 30);
|
||||||
|
insert into t2 values (1,10), (2,10), (3,30), (4, 30);
|
||||||
|
--error 1062
|
||||||
|
update t1 set a = 1 where a = 3;
|
||||||
|
select * from t1 order by a;
|
||||||
|
update t1 set b = 1 where a > 1 order by a desc limit 1;
|
||||||
|
select * from t1 order by a;
|
||||||
|
--error 1062
|
||||||
|
update t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
|
||||||
|
select * from t1 order by a;
|
||||||
|
update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
|
||||||
|
select * from t1 order by a;
|
||||||
|
drop table t1,t2;
|
||||||
|
|
||||||
--echo End of 5.1 tests
|
--echo End of 5.1 tests
|
||||||
|
47
mysql-test/t/ndb_cursor.test
Normal file
47
mysql-test/t/ndb_cursor.test
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
-- source include/have_ndb.inc
|
||||||
|
-- source include/not_embedded.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
drop table if exists t1;
|
||||||
|
drop table if exists t2;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
create table t1 (
|
||||||
|
a int not null primary key,
|
||||||
|
b int not null
|
||||||
|
) engine=ndb;
|
||||||
|
|
||||||
|
create table t2 (
|
||||||
|
a int not null primary key,
|
||||||
|
b int not null
|
||||||
|
) engine=ndb;
|
||||||
|
|
||||||
|
insert into t1 values (1,10), (2,20), (3,30), (4, 40);
|
||||||
|
|
||||||
|
delimiter //;
|
||||||
|
create procedure test_cursor ()
|
||||||
|
begin
|
||||||
|
declare done int default 0;
|
||||||
|
declare temp_a int;
|
||||||
|
declare temp_b int;
|
||||||
|
declare cur1 cursor for select a,b from t1;
|
||||||
|
declare continue handler for sqlstate '02000' set done = 1;
|
||||||
|
open cur1;
|
||||||
|
repeat
|
||||||
|
fetch cur1 into temp_a, temp_b;
|
||||||
|
if not done then
|
||||||
|
insert into t2 values (temp_a, temp_b);
|
||||||
|
end if;
|
||||||
|
until done end repeat;
|
||||||
|
close cur1;
|
||||||
|
end;
|
||||||
|
//
|
||||||
|
delimiter ;//
|
||||||
|
|
||||||
|
select * from t2 order by a;
|
||||||
|
call test_cursor();
|
||||||
|
select * from t2 order by a;
|
||||||
|
drop procedure test_cursor;
|
||||||
|
drop table t1,t2;
|
||||||
|
|
||||||
|
--echo end of 5.1 tests
|
@ -156,8 +156,12 @@ enable_query_log;
|
|||||||
|
|
||||||
SELECT * FROM test.t1 ORDER BY a1;
|
SELECT * FROM test.t1 ORDER BY a1;
|
||||||
|
|
||||||
|
SELECT * FROM information_schema.partitions WHERE table_name= 't1' AND partition_name = 'p0';
|
||||||
|
|
||||||
ALTER TABLE test.t1 ADD a2 FLOAT, ADD a3 DOUBLE;
|
ALTER TABLE test.t1 ADD a2 FLOAT, ADD a3 DOUBLE;
|
||||||
|
|
||||||
|
SELECT * FROM information_schema.partitions WHERE table_name= 't1' AND partition_name = 'p0';
|
||||||
|
|
||||||
let $1=20;
|
let $1=20;
|
||||||
disable_query_log;
|
disable_query_log;
|
||||||
while ($1)
|
while ($1)
|
||||||
|
@ -270,11 +270,18 @@ ADD DATAFILE 'datafile2.dat'
|
|||||||
INITIAL_SIZE 1M
|
INITIAL_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
|
|
||||||
|
--error 1005
|
||||||
|
CREATE TABLE t1
|
||||||
|
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
|
||||||
|
TABLESPACE ts1 STORAGE MEMORY
|
||||||
|
ENGINE NDB;
|
||||||
|
|
||||||
CREATE TABLE t1
|
CREATE TABLE t1
|
||||||
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
|
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
|
||||||
TABLESPACE ts1 STORAGE DISK
|
TABLESPACE ts1 STORAGE DISK
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
|
|
||||||
|
|
||||||
CREATE INDEX b_i on t1(b);
|
CREATE INDEX b_i on t1(b);
|
||||||
CREATE INDEX bc_i on t1(b, c);
|
CREATE INDEX bc_i on t1(b, c);
|
||||||
|
|
||||||
@ -351,4 +358,6 @@ engine ndb;
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# End 5.1 test
|
# End 5.1 test
|
||||||
|
@ -111,7 +111,7 @@ SHOW CREATE TABLE test.t1;
|
|||||||
ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK
|
ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
SHOW CREATE TABLE test.t2;
|
SHOW CREATE TABLE test.t2;
|
||||||
ALTER TABLE test.t1 ENGINE=NDBCLUSTER;
|
ALTER TABLE test.t1 STORAGE MEMORY ENGINE=NDBCLUSTER;
|
||||||
SHOW CREATE TABLE test.t1;
|
SHOW CREATE TABLE test.t1;
|
||||||
--echo
|
--echo
|
||||||
######################### End Test Section 2 #################
|
######################### End Test Section 2 #################
|
||||||
|
@ -89,6 +89,14 @@ delete from t2 where a = 1;
|
|||||||
insert into t2 values(8, 2, 3);
|
insert into t2 values(8, 2, 3);
|
||||||
select * from t2 order by a;
|
select * from t2 order by a;
|
||||||
|
|
||||||
|
# Bug #24818 CREATE UNIQUE INDEX (...) USING HASH on a NDB table crashes mysqld
|
||||||
|
create unique index bi using hash on t2(b);
|
||||||
|
-- error 1062
|
||||||
|
insert into t2 values(9, 3, 1);
|
||||||
|
alter table t2 drop index bi;
|
||||||
|
insert into t2 values(9, 3, 1);
|
||||||
|
select * from t2 order by a;
|
||||||
|
|
||||||
drop table t2;
|
drop table t2;
|
||||||
|
|
||||||
CREATE TABLE t2 (
|
CREATE TABLE t2 (
|
||||||
|
@ -257,3 +257,18 @@ group by c
|
|||||||
order by c;
|
order by c;
|
||||||
|
|
||||||
DROP TABLE t1, t11, t12, t21, t22;
|
DROP TABLE t1, t11, t12, t21, t22;
|
||||||
|
|
||||||
|
# bug#19956
|
||||||
|
CREATE TABLE t1 (id varchar(255) NOT NULL,
|
||||||
|
tag int(11) NOT NULL,
|
||||||
|
doc text NOT NULL,
|
||||||
|
type varchar(150) NOT NULL,
|
||||||
|
modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=ndbcluster;
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES ('sakila',1,'Some text goes here','text',CURRENT_TIMESTAMP);
|
||||||
|
SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','orka');
|
||||||
|
SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila');
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
42
mysql-test/t/ndb_sp.test
Normal file
42
mysql-test/t/ndb_sp.test
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
-- source include/have_ndb.inc
|
||||||
|
-- source include/not_embedded.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
drop table if exists t1;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
create table t1 (
|
||||||
|
a int not null primary key,
|
||||||
|
b int not null
|
||||||
|
) engine=ndb;
|
||||||
|
insert into t1 values (1,10), (2,20), (3,100), (4, 100);
|
||||||
|
|
||||||
|
delimiter //;
|
||||||
|
create procedure test_proc1 (in var_in int)
|
||||||
|
begin
|
||||||
|
select * from t1 where a = var_in;
|
||||||
|
end;
|
||||||
|
create procedure test_proc2 (out var_out int)
|
||||||
|
begin
|
||||||
|
select b from t1 where a = 1 into var_out;
|
||||||
|
end;
|
||||||
|
create procedure test_proc3 (inout var_inout int)
|
||||||
|
begin
|
||||||
|
select b from t1 where a = var_inout into var_inout;
|
||||||
|
end;
|
||||||
|
//
|
||||||
|
delimiter ;//
|
||||||
|
call test_proc1(1);
|
||||||
|
call test_proc2(@test_var);
|
||||||
|
select @test_var;
|
||||||
|
set @test_var = 1;
|
||||||
|
call test_proc3(@test_var);
|
||||||
|
select @test_var;
|
||||||
|
alter procedure test_proc1 comment 'new comment';
|
||||||
|
show create procedure test_proc1;
|
||||||
|
drop procedure test_proc1;
|
||||||
|
drop procedure test_proc2;
|
||||||
|
drop procedure test_proc3;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
--echo End of 5.1 tests
|
@ -2,8 +2,7 @@
|
|||||||
-- source include/not_embedded.inc
|
-- source include/not_embedded.inc
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
drop table if exists t1;
|
drop table if exists t1, t2, t3, t4;
|
||||||
drop table if exists t2;
|
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
##########
|
##########
|
||||||
@ -14,8 +13,13 @@ unique (u), key(o)) engine=ndb;
|
|||||||
create table t2 (p int not null primary key, u int not null, o int not null,
|
create table t2 (p int not null primary key, u int not null, o int not null,
|
||||||
unique (u), key(o)) engine=ndb;
|
unique (u), key(o)) engine=ndb;
|
||||||
|
|
||||||
|
create table t3 (a int not null primary key, b int not null) engine=ndb;
|
||||||
|
create table t4 (c int not null primary key, d int not null) engine=ndb;
|
||||||
|
|
||||||
insert into t1 values (1,1,1),(2,2,2),(3,3,3);
|
insert into t1 values (1,1,1),(2,2,2),(3,3,3);
|
||||||
insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
|
insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
|
||||||
|
insert into t3 values (1,10), (2,10), (3,30), (4, 30);
|
||||||
|
insert into t4 values (1,10), (2,10), (3,30), (4, 30);
|
||||||
|
|
||||||
# Use pk
|
# Use pk
|
||||||
--replace_column 9 #
|
--replace_column 9 #
|
||||||
@ -63,7 +67,13 @@ where t1.u = t2.u
|
|||||||
|
|
||||||
select * from t2 order by 1;
|
select * from t2 order by 1;
|
||||||
|
|
||||||
drop table t1;
|
select * from t3 where a = any (select c from t4 where c = 1) order by a;
|
||||||
drop table t2;
|
select * from t3 where a in (select c from t4 where c = 1) order by a;
|
||||||
|
select * from t3 where a <> some (select c from t4 where c = 1) order by a;
|
||||||
|
select * from t3 where a > all (select c from t4 where c = 1) order by a;
|
||||||
|
select * from t3 where row(1,10) = (select c,d from t4 where c = 1) order by a;
|
||||||
|
select * from t3 where exists (select * from t4 where c = 1) order by a;
|
||||||
|
|
||||||
|
drop table if exists t1, t2, t3, t4;
|
||||||
|
|
||||||
|
--echo End of 5.1 tests
|
||||||
|
@ -14,12 +14,14 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
drop table if exists t1, t2, t3;
|
drop table if exists t1, t2, t3, t4, t5;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
|
create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
|
||||||
create table t2 (op char(1), a int not null, b decimal (63,30));
|
create table t2 (op char(1), a int not null, b decimal (63,30));
|
||||||
create table t3 select 1 as i;
|
create table t3 select 1 as i;
|
||||||
|
create table t4 (a int not null primary key, b int) engine=ndb;
|
||||||
|
create table t5 (a int not null primary key, b int) engine=ndb;
|
||||||
|
|
||||||
delimiter //;
|
delimiter //;
|
||||||
create trigger t1_bu before update on t1 for each row
|
create trigger t1_bu before update on t1 for each row
|
||||||
@ -31,8 +33,21 @@ create trigger t1_bd before delete on t1 for each row
|
|||||||
begin
|
begin
|
||||||
insert into t2 values ("d", old.a, old.b);
|
insert into t2 values ("d", old.a, old.b);
|
||||||
end;//
|
end;//
|
||||||
|
create trigger t4_au after update on t4
|
||||||
|
for each row begin
|
||||||
|
update t5 set b = b+1;
|
||||||
|
end;
|
||||||
|
//
|
||||||
|
create trigger t4_ad after delete on t4
|
||||||
|
for each row begin
|
||||||
|
update t5 set b = b+1;
|
||||||
|
end;
|
||||||
|
//
|
||||||
delimiter ;//
|
delimiter ;//
|
||||||
|
|
||||||
insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (3, 3, 3.05), (4, 4, 4.05);
|
insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (3, 3, 3.05), (4, 4, 4.05);
|
||||||
|
insert into t4 values (1,1), (2,2), (3,3), (4, 4);
|
||||||
|
insert into t5 values (1,0);
|
||||||
|
|
||||||
# Check that usual update works as it should
|
# Check that usual update works as it should
|
||||||
update t1 set a=5 where a != 3;
|
update t1 set a=5 where a != 3;
|
||||||
@ -86,7 +101,14 @@ insert into t1 values (3, 1, 1.05), (5, 2, 2.05);
|
|||||||
load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
|
load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
|
||||||
select * from t1 order by id;
|
select * from t1 order by id;
|
||||||
select * from t2 order by op, a, b;
|
select * from t2 order by op, a, b;
|
||||||
|
update t4 set b = 10 where a = 1;
|
||||||
|
select * from t5 order by a;
|
||||||
|
update t5 set b = 0;
|
||||||
|
delete from t4 where a = 1;
|
||||||
|
select * from t5 order by a;
|
||||||
|
drop trigger t4_au;
|
||||||
|
drop trigger t4_ad;
|
||||||
|
|
||||||
drop tables t1, t2, t3;
|
drop table t1, t2, t3, t4, t5;
|
||||||
|
|
||||||
--echo End of 5.0 tests
|
--echo End of 5.1 tests
|
||||||
|
@ -133,7 +133,6 @@ static uint ndbcluster_alter_table_flags(uint flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int ndbcluster_inited= 0;
|
static int ndbcluster_inited= 0;
|
||||||
int ndbcluster_util_inited= 0;
|
|
||||||
|
|
||||||
static Ndb* g_ndb= NULL;
|
static Ndb* g_ndb= NULL;
|
||||||
Ndb_cluster_connection* g_ndb_cluster_connection= NULL;
|
Ndb_cluster_connection* g_ndb_cluster_connection= NULL;
|
||||||
@ -157,6 +156,7 @@ static int ndb_get_table_statistics(ha_ndbcluster*, bool, Ndb*, const NDBTAB *,
|
|||||||
|
|
||||||
// Util thread variables
|
// Util thread variables
|
||||||
pthread_t ndb_util_thread;
|
pthread_t ndb_util_thread;
|
||||||
|
int ndb_util_thread_running= 0;
|
||||||
pthread_mutex_t LOCK_ndb_util_thread;
|
pthread_mutex_t LOCK_ndb_util_thread;
|
||||||
pthread_cond_t COND_ndb_util_thread;
|
pthread_cond_t COND_ndb_util_thread;
|
||||||
pthread_handler_t ndb_util_thread_func(void *arg);
|
pthread_handler_t ndb_util_thread_func(void *arg);
|
||||||
@ -3477,8 +3477,9 @@ int ha_ndbcluster::read_range_first_to_buf(const key_range *start_key,
|
|||||||
{
|
{
|
||||||
if (m_active_cursor && (error= close_scan()))
|
if (m_active_cursor && (error= close_scan()))
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
DBUG_RETURN(pk_read(start_key->key, start_key->length, buf,
|
error= pk_read(start_key->key, start_key->length, buf,
|
||||||
part_spec.start_part));
|
part_spec.start_part);
|
||||||
|
DBUG_RETURN(error == HA_ERR_KEY_NOT_FOUND ? HA_ERR_END_OF_FILE : error);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UNIQUE_ORDERED_INDEX:
|
case UNIQUE_ORDERED_INDEX:
|
||||||
@ -3489,7 +3490,9 @@ int ha_ndbcluster::read_range_first_to_buf(const key_range *start_key,
|
|||||||
{
|
{
|
||||||
if (m_active_cursor && (error= close_scan()))
|
if (m_active_cursor && (error= close_scan()))
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
DBUG_RETURN(unique_index_read(start_key->key, start_key->length, buf));
|
|
||||||
|
error= unique_index_read(start_key->key, start_key->length, buf);
|
||||||
|
DBUG_RETURN(error == HA_ERR_KEY_NOT_FOUND ? HA_ERR_END_OF_FILE : error);
|
||||||
}
|
}
|
||||||
else if (type == UNIQUE_INDEX)
|
else if (type == UNIQUE_INDEX)
|
||||||
DBUG_RETURN(unique_index_scan(key_info,
|
DBUG_RETURN(unique_index_scan(key_info,
|
||||||
@ -4803,7 +4806,7 @@ int ha_ndbcluster::create(const char *name,
|
|||||||
if ((my_errno= create_ndb_column(col, field, info)))
|
if ((my_errno= create_ndb_column(col, field, info)))
|
||||||
DBUG_RETURN(my_errno);
|
DBUG_RETURN(my_errno);
|
||||||
|
|
||||||
if (info->store_on_disk || getenv("NDB_DEFAULT_DISK"))
|
if (info->storage_media == HA_SM_DISK || getenv("NDB_DEFAULT_DISK"))
|
||||||
col.setStorageType(NdbDictionary::Column::StorageTypeDisk);
|
col.setStorageType(NdbDictionary::Column::StorageTypeDisk);
|
||||||
else
|
else
|
||||||
col.setStorageType(NdbDictionary::Column::StorageTypeMemory);
|
col.setStorageType(NdbDictionary::Column::StorageTypeMemory);
|
||||||
@ -4823,7 +4826,7 @@ int ha_ndbcluster::create(const char *name,
|
|||||||
NdbDictionary::Column::StorageTypeMemory);
|
NdbDictionary::Column::StorageTypeMemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->store_on_disk)
|
if (info->storage_media == HA_SM_DISK)
|
||||||
{
|
{
|
||||||
if (info->tablespace)
|
if (info->tablespace)
|
||||||
tab.setTablespace(info->tablespace);
|
tab.setTablespace(info->tablespace);
|
||||||
@ -4832,8 +4835,18 @@ int ha_ndbcluster::create(const char *name,
|
|||||||
}
|
}
|
||||||
else if (info->tablespace)
|
else if (info->tablespace)
|
||||||
{
|
{
|
||||||
|
if (info->storage_media == HA_SM_MEMORY)
|
||||||
|
{
|
||||||
|
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
|
||||||
|
ER_ILLEGAL_HA_CREATE_OPTION,
|
||||||
|
ER(ER_ILLEGAL_HA_CREATE_OPTION),
|
||||||
|
ndbcluster_hton_name,
|
||||||
|
"TABLESPACE currently only supported for "
|
||||||
|
"STORAGE DISK");
|
||||||
|
DBUG_RETURN(HA_ERR_UNSUPPORTED);
|
||||||
|
}
|
||||||
tab.setTablespace(info->tablespace);
|
tab.setTablespace(info->tablespace);
|
||||||
info->store_on_disk = true; //if use tablespace, that also means store on disk
|
info->storage_media = HA_SM_DISK; //if use tablespace, that also means store on disk
|
||||||
}
|
}
|
||||||
|
|
||||||
// No primary key, create shadow key as 64 bit, auto increment
|
// No primary key, create shadow key as 64 bit, auto increment
|
||||||
@ -6716,6 +6729,12 @@ static int ndbcluster_init(void *p)
|
|||||||
goto ndbcluster_init_error;
|
goto ndbcluster_init_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Wait for the util thread to start */
|
||||||
|
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||||
|
while (!ndb_util_thread_running)
|
||||||
|
pthread_cond_wait(&COND_ndb_util_thread, &LOCK_ndb_util_thread);
|
||||||
|
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||||
|
|
||||||
ndbcluster_inited= 1;
|
ndbcluster_inited= 1;
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
|
|
||||||
@ -6738,6 +6757,27 @@ static int ndbcluster_end(handlerton *hton, ha_panic_function type)
|
|||||||
|
|
||||||
if (!ndbcluster_inited)
|
if (!ndbcluster_inited)
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
ndbcluster_inited= 0;
|
||||||
|
|
||||||
|
/* wait for util thread to finish */
|
||||||
|
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||||
|
if (ndb_util_thread_running > 0)
|
||||||
|
{
|
||||||
|
pthread_cond_signal(&COND_ndb_util_thread);
|
||||||
|
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||||
|
|
||||||
|
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||||
|
while (ndb_util_thread_running > 0)
|
||||||
|
{
|
||||||
|
struct timespec abstime;
|
||||||
|
set_timespec(abstime, 1);
|
||||||
|
pthread_cond_timedwait(&COND_ndb_util_thread,
|
||||||
|
&LOCK_ndb_util_thread,
|
||||||
|
&abstime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_NDB_BINLOG
|
#ifdef HAVE_NDB_BINLOG
|
||||||
{
|
{
|
||||||
@ -6784,7 +6824,6 @@ static int ndbcluster_end(handlerton *hton, ha_panic_function type)
|
|||||||
pthread_mutex_destroy(&ndbcluster_mutex);
|
pthread_mutex_destroy(&ndbcluster_mutex);
|
||||||
pthread_mutex_destroy(&LOCK_ndb_util_thread);
|
pthread_mutex_destroy(&LOCK_ndb_util_thread);
|
||||||
pthread_cond_destroy(&COND_ndb_util_thread);
|
pthread_cond_destroy(&COND_ndb_util_thread);
|
||||||
ndbcluster_inited= 0;
|
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8330,6 +8369,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
|||||||
{
|
{
|
||||||
thd->cleanup();
|
thd->cleanup();
|
||||||
delete thd;
|
delete thd;
|
||||||
|
ndb_util_thread_running= 0;
|
||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
}
|
}
|
||||||
thd->init_for_queries();
|
thd->init_for_queries();
|
||||||
@ -8342,6 +8382,9 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
|||||||
thd->main_security_ctx.priv_user = 0;
|
thd->main_security_ctx.priv_user = 0;
|
||||||
thd->current_stmt_binlog_row_based= TRUE; // If in mixed mode
|
thd->current_stmt_binlog_row_based= TRUE; // If in mixed mode
|
||||||
|
|
||||||
|
ndb_util_thread_running= 1;
|
||||||
|
pthread_cond_signal(&COND_ndb_util_thread);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
wait for mysql server to start
|
wait for mysql server to start
|
||||||
*/
|
*/
|
||||||
@ -8350,8 +8393,6 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
|||||||
pthread_cond_wait(&COND_server_started, &LOCK_server_started);
|
pthread_cond_wait(&COND_server_started, &LOCK_server_started);
|
||||||
pthread_mutex_unlock(&LOCK_server_started);
|
pthread_mutex_unlock(&LOCK_server_started);
|
||||||
|
|
||||||
ndbcluster_util_inited= 1;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Wait for cluster to start
|
Wait for cluster to start
|
||||||
*/
|
*/
|
||||||
@ -8533,6 +8574,9 @@ ndb_util_thread_end:
|
|||||||
net_end(&thd->net);
|
net_end(&thd->net);
|
||||||
thd->cleanup();
|
thd->cleanup();
|
||||||
delete thd;
|
delete thd;
|
||||||
|
pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||||
|
ndb_util_thread_running= 0;
|
||||||
|
pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
||||||
DBUG_PRINT("exit", ("ndb_util_thread"));
|
DBUG_PRINT("exit", ("ndb_util_thread"));
|
||||||
my_thread_end();
|
my_thread_end();
|
||||||
pthread_exit(0);
|
pthread_exit(0);
|
||||||
@ -9945,7 +9989,7 @@ int ha_ndbcluster::generate_scan_filter_from_key(NdbScanOperation *op,
|
|||||||
/*
|
/*
|
||||||
get table space info for SHOW CREATE TABLE
|
get table space info for SHOW CREATE TABLE
|
||||||
*/
|
*/
|
||||||
char* ha_ndbcluster::get_tablespace_name(THD *thd)
|
char* ha_ndbcluster::get_tablespace_name(THD *thd, char* name, uint name_len)
|
||||||
{
|
{
|
||||||
Ndb *ndb= check_ndb_in_thd(thd);
|
Ndb *ndb= check_ndb_in_thd(thd);
|
||||||
NDBDICT *ndbdict= ndb->getDictionary();
|
NDBDICT *ndbdict= ndb->getDictionary();
|
||||||
@ -9963,6 +10007,12 @@ char* ha_ndbcluster::get_tablespace_name(THD *thd)
|
|||||||
ndberr= ndbdict->getNdbError();
|
ndberr= ndbdict->getNdbError();
|
||||||
if(ndberr.classification != NdbError::NoError)
|
if(ndberr.classification != NdbError::NoError)
|
||||||
goto err;
|
goto err;
|
||||||
|
if (name)
|
||||||
|
{
|
||||||
|
strxnmov(name, name_len, ts.getName(), NullS);
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
else
|
||||||
return (my_strdup(ts.getName(), MYF(0)));
|
return (my_strdup(ts.getName(), MYF(0)));
|
||||||
}
|
}
|
||||||
err:
|
err:
|
||||||
|
@ -823,7 +823,7 @@ private:
|
|||||||
uint set_up_partition_info(partition_info *part_info,
|
uint set_up_partition_info(partition_info *part_info,
|
||||||
TABLE *table,
|
TABLE *table,
|
||||||
void *tab);
|
void *tab);
|
||||||
char* get_tablespace_name(THD *thd);
|
char* get_tablespace_name(THD *thd, char *name, uint name_len);
|
||||||
int set_range_data(void *tab, partition_info* part_info);
|
int set_range_data(void *tab, partition_info* part_info);
|
||||||
int set_list_data(void *tab, partition_info* part_info);
|
int set_list_data(void *tab, partition_info* part_info);
|
||||||
int complemented_read(const byte *old_data, byte *new_data,
|
int complemented_read(const byte *old_data, byte *new_data,
|
||||||
|
@ -81,6 +81,8 @@ THD *injector_thd= 0;
|
|||||||
static Ndb *injector_ndb= 0;
|
static Ndb *injector_ndb= 0;
|
||||||
static Ndb *schema_ndb= 0;
|
static Ndb *schema_ndb= 0;
|
||||||
|
|
||||||
|
static int ndbcluster_binlog_inited= 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Mutex and condition used for interacting between client sql thread
|
Mutex and condition used for interacting between client sql thread
|
||||||
and injector thread
|
and injector thread
|
||||||
@ -558,29 +560,28 @@ ndbcluster_binlog_log_query(handlerton *hton, THD *thd, enum_binlog_command binl
|
|||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
End use of the NDB Cluster table handler
|
End use of the NDB Cluster binlog
|
||||||
- free all global variables allocated by
|
- wait for binlog thread to shutdown
|
||||||
ndbcluster_init()
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int ndbcluster_binlog_end(THD *thd)
|
static int ndbcluster_binlog_end(THD *thd)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("ndb_binlog_end");
|
DBUG_ENTER("ndbcluster_binlog_end");
|
||||||
|
|
||||||
if (!ndbcluster_util_inited)
|
if (!ndbcluster_binlog_inited)
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
ndbcluster_binlog_inited= 0;
|
||||||
// Kill ndb utility thread
|
|
||||||
(void) pthread_mutex_lock(&LOCK_ndb_util_thread);
|
|
||||||
DBUG_PRINT("exit",("killing ndb util thread: %lx", ndb_util_thread));
|
|
||||||
(void) pthread_cond_signal(&COND_ndb_util_thread);
|
|
||||||
(void) pthread_mutex_unlock(&LOCK_ndb_util_thread);
|
|
||||||
|
|
||||||
#ifdef HAVE_NDB_BINLOG
|
#ifdef HAVE_NDB_BINLOG
|
||||||
/* wait for injector thread to finish */
|
/* wait for injector thread to finish */
|
||||||
|
pthread_mutex_lock(&injector_mutex);
|
||||||
if (ndb_binlog_thread_running > 0)
|
if (ndb_binlog_thread_running > 0)
|
||||||
{
|
{
|
||||||
|
pthread_cond_signal(&injector_cond);
|
||||||
|
pthread_mutex_unlock(&injector_mutex);
|
||||||
|
|
||||||
pthread_mutex_lock(&injector_mutex);
|
pthread_mutex_lock(&injector_mutex);
|
||||||
while (ndb_binlog_thread_running > 0)
|
while (ndb_binlog_thread_running > 0)
|
||||||
{
|
{
|
||||||
@ -588,8 +589,9 @@ static int ndbcluster_binlog_end(THD *thd)
|
|||||||
set_timespec(abstime, 1);
|
set_timespec(abstime, 1);
|
||||||
pthread_cond_timedwait(&injector_cond, &injector_mutex, &abstime);
|
pthread_cond_timedwait(&injector_cond, &injector_mutex, &abstime);
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&injector_mutex);
|
|
||||||
}
|
}
|
||||||
|
pthread_mutex_unlock(&injector_mutex);
|
||||||
|
|
||||||
|
|
||||||
/* remove all shares */
|
/* remove all shares */
|
||||||
{
|
{
|
||||||
@ -617,8 +619,10 @@ static int ndbcluster_binlog_end(THD *thd)
|
|||||||
}
|
}
|
||||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pthread_mutex_destroy(&injector_mutex);
|
||||||
|
pthread_cond_destroy(&injector_cond);
|
||||||
#endif
|
#endif
|
||||||
ndbcluster_util_inited= 0;
|
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2286,9 +2290,9 @@ int ndbcluster_binlog_start()
|
|||||||
DBUG_RETURN(-1);
|
DBUG_RETURN(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
ndbcluster_binlog_inited= 1;
|
||||||
Wait for the ndb injector thread to finish starting up.
|
|
||||||
*/
|
/* Wait for the injector thread to start */
|
||||||
pthread_mutex_lock(&injector_mutex);
|
pthread_mutex_lock(&injector_mutex);
|
||||||
while (!ndb_binlog_thread_running)
|
while (!ndb_binlog_thread_running)
|
||||||
pthread_cond_wait(&injector_cond, &injector_mutex);
|
pthread_cond_wait(&injector_cond, &injector_mutex);
|
||||||
@ -2297,20 +2301,10 @@ int ndbcluster_binlog_start()
|
|||||||
if (ndb_binlog_thread_running < 0)
|
if (ndb_binlog_thread_running < 0)
|
||||||
DBUG_RETURN(-1);
|
DBUG_RETURN(-1);
|
||||||
|
|
||||||
|
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ndbcluster_binlog_close_connection(THD *thd)
|
|
||||||
{
|
|
||||||
DBUG_ENTER("ndbcluster_binlog_close_connection");
|
|
||||||
const char *save_info= thd->proc_info;
|
|
||||||
thd->proc_info= "ndbcluster_binlog_close_connection";
|
|
||||||
do_ndbcluster_binlog_close_connection= BCCC_exit;
|
|
||||||
while (ndb_binlog_thread_running > 0)
|
|
||||||
sleep(1);
|
|
||||||
thd->proc_info= save_info;
|
|
||||||
DBUG_VOID_RETURN;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************
|
/**************************************************************
|
||||||
Internal helper functions for creating/dropping ndb events
|
Internal helper functions for creating/dropping ndb events
|
||||||
@ -3542,7 +3536,7 @@ restart:
|
|||||||
if (abort_loop)
|
if (abort_loop)
|
||||||
goto err;
|
goto err;
|
||||||
schema_res= s_ndb->pollEvents(100, &schema_gci);
|
schema_res= s_ndb->pollEvents(100, &schema_gci);
|
||||||
} while (ndb_latest_received_binlog_epoch == schema_gci);
|
} while (schema_gci == 0 || ndb_latest_received_binlog_epoch == schema_gci);
|
||||||
if (ndb_binlog_running)
|
if (ndb_binlog_running)
|
||||||
{
|
{
|
||||||
Uint64 gci= i_ndb->getLatestGCI();
|
Uint64 gci= i_ndb->getLatestGCI();
|
||||||
@ -3953,15 +3947,12 @@ restart:
|
|||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
err:
|
err:
|
||||||
|
sql_print_information("Stopping Cluster Binlog");
|
||||||
DBUG_PRINT("info",("Shutting down cluster binlog thread"));
|
DBUG_PRINT("info",("Shutting down cluster binlog thread"));
|
||||||
thd->proc_info= "Shutting down";
|
thd->proc_info= "Shutting down";
|
||||||
close_thread_tables(thd);
|
close_thread_tables(thd);
|
||||||
pthread_mutex_lock(&injector_mutex);
|
pthread_mutex_lock(&injector_mutex);
|
||||||
/* don't mess with the injector_ndb anymore from other threads */
|
/* don't mess with the injector_ndb anymore from other threads */
|
||||||
uint ndb_obj_cnt= 1; // g_ndb
|
|
||||||
ndb_obj_cnt+= injector_ndb == 0 ? 0 : 1;
|
|
||||||
ndb_obj_cnt+= schema_ndb == 0 ? 0 : 1;
|
|
||||||
ndb_obj_cnt+= ndbcluster_util_inited ? 1 : 0;
|
|
||||||
injector_thd= 0;
|
injector_thd= 0;
|
||||||
injector_ndb= 0;
|
injector_ndb= 0;
|
||||||
p_latest_trans_gci= 0;
|
p_latest_trans_gci= 0;
|
||||||
@ -3969,29 +3960,6 @@ err:
|
|||||||
pthread_mutex_unlock(&injector_mutex);
|
pthread_mutex_unlock(&injector_mutex);
|
||||||
thd->db= 0; // as not to try to free memory
|
thd->db= 0; // as not to try to free memory
|
||||||
|
|
||||||
if (!ndb_extra_logging)
|
|
||||||
sql_print_information("Stopping Cluster Binlog");
|
|
||||||
else
|
|
||||||
sql_print_information("Stopping Cluster Binlog: %u(%u)",
|
|
||||||
g_ndb_cluster_connection->get_active_ndb_objects(),
|
|
||||||
ndb_obj_cnt);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add extra wait loop to make user "user" ndb-object go away...
|
|
||||||
* otherwise user thread can have ongoing SUB_DATA
|
|
||||||
*/
|
|
||||||
int sleep_cnt= 0;
|
|
||||||
while (sleep_cnt < 300 &&
|
|
||||||
g_ndb_cluster_connection->get_active_ndb_objects() > ndb_obj_cnt)
|
|
||||||
{
|
|
||||||
my_sleep(10000); // 10ms
|
|
||||||
sleep_cnt++;
|
|
||||||
}
|
|
||||||
if (ndb_extra_logging)
|
|
||||||
sql_print_information("Stopping Cluster Binlog: waited %ums %u(%u)",
|
|
||||||
10*sleep_cnt, g_ndb_cluster_connection->get_active_ndb_objects(),
|
|
||||||
ndb_obj_cnt);
|
|
||||||
|
|
||||||
if (ndb_apply_status_share)
|
if (ndb_apply_status_share)
|
||||||
{
|
{
|
||||||
free_share(&ndb_apply_status_share);
|
free_share(&ndb_apply_status_share);
|
||||||
@ -4047,8 +4015,8 @@ err:
|
|||||||
|
|
||||||
hash_free(&ndb_schema_objects);
|
hash_free(&ndb_schema_objects);
|
||||||
|
|
||||||
// Placed here to avoid a memory leak; TODO: check if needed
|
|
||||||
net_end(&thd->net);
|
net_end(&thd->net);
|
||||||
|
thd->cleanup();
|
||||||
delete thd;
|
delete thd;
|
||||||
|
|
||||||
ndb_binlog_thread_running= -1;
|
ndb_binlog_thread_running= -1;
|
||||||
|
@ -763,7 +763,7 @@ typedef struct st_ha_create_information
|
|||||||
bool table_existed; /* 1 in create if table existed */
|
bool table_existed; /* 1 in create if table existed */
|
||||||
bool frm_only; /* 1 if no ha_create_table() */
|
bool frm_only; /* 1 if no ha_create_table() */
|
||||||
bool varchar; /* 1 if table has a VARCHAR */
|
bool varchar; /* 1 if table has a VARCHAR */
|
||||||
bool store_on_disk; /* 1 if table stored on disk */
|
enum ha_storage_media storage_media; /* DEFAULT, DISK or MEMORY */
|
||||||
} HA_CREATE_INFO;
|
} HA_CREATE_INFO;
|
||||||
|
|
||||||
|
|
||||||
@ -1409,7 +1409,7 @@ public:
|
|||||||
{ return FALSE; }
|
{ return FALSE; }
|
||||||
virtual char* get_foreign_key_create_info()
|
virtual char* get_foreign_key_create_info()
|
||||||
{ return(NULL);} /* gets foreign key create string from InnoDB */
|
{ return(NULL);} /* gets foreign key create string from InnoDB */
|
||||||
virtual char* get_tablespace_name(THD *thd)
|
virtual char* get_tablespace_name(THD *thd, char *name, uint name_len)
|
||||||
{ return(NULL);} /* gets tablespace name from handler */
|
{ return(NULL);} /* gets tablespace name from handler */
|
||||||
/* used in ALTER TABLE; 1 if changing storage engine is allowed */
|
/* used in ALTER TABLE; 1 if changing storage engine is allowed */
|
||||||
virtual bool can_switch_engines() { return 1; }
|
virtual bool can_switch_engines() { return 1; }
|
||||||
|
@ -983,7 +983,7 @@ my_bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
|
|||||||
{
|
{
|
||||||
rw_rdlock(&THR_LOCK_plugin);
|
rw_rdlock(&THR_LOCK_plugin);
|
||||||
for (uint i=idx; i < total; i++)
|
for (uint i=idx; i < total; i++)
|
||||||
if (plugins[i]->state & state_mask)
|
if (plugins[i] && plugins[i]->state & state_mask)
|
||||||
plugins[i]=0;
|
plugins[i]=0;
|
||||||
rw_unlock(&THR_LOCK_plugin);
|
rw_unlock(&THR_LOCK_plugin);
|
||||||
}
|
}
|
||||||
|
@ -1266,7 +1266,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
|
|||||||
to the CREATE TABLE statement
|
to the CREATE TABLE statement
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((for_str= file->get_tablespace_name(thd)))
|
if ((for_str= file->get_tablespace_name(thd,0,0)))
|
||||||
{
|
{
|
||||||
packet->append(STRING_WITH_LEN(" /*!50100 TABLESPACE "));
|
packet->append(STRING_WITH_LEN(" /*!50100 TABLESPACE "));
|
||||||
packet->append(for_str, strlen(for_str));
|
packet->append(for_str, strlen(for_str));
|
||||||
@ -3973,7 +3973,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table,
|
|||||||
strlen(part_elem->tablespace_name), cs);
|
strlen(part_elem->tablespace_name), cs);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *ts= showing_table->file->get_tablespace_name(thd);
|
char *ts= showing_table->file->get_tablespace_name(thd,0,0);
|
||||||
if(ts)
|
if(ts)
|
||||||
{
|
{
|
||||||
table->field[24]->store(ts, strlen(ts), cs);
|
table->field[24]->store(ts, strlen(ts), cs);
|
||||||
|
@ -5306,7 +5306,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
|||||||
int error;
|
int error;
|
||||||
char tmp_name[80],old_name[32],new_name_buff[FN_REFLEN];
|
char tmp_name[80],old_name[32],new_name_buff[FN_REFLEN];
|
||||||
char new_alias_buff[FN_REFLEN], *table_name, *db, *new_alias, *alias;
|
char new_alias_buff[FN_REFLEN], *table_name, *db, *new_alias, *alias;
|
||||||
char index_file[FN_REFLEN], data_file[FN_REFLEN];
|
char index_file[FN_REFLEN], data_file[FN_REFLEN], tablespace[FN_LEN];
|
||||||
char path[FN_REFLEN];
|
char path[FN_REFLEN];
|
||||||
char reg_path[FN_REFLEN+1];
|
char reg_path[FN_REFLEN+1];
|
||||||
ha_rows copied,deleted;
|
ha_rows copied,deleted;
|
||||||
@ -5629,6 +5629,15 @@ view_err:
|
|||||||
if (!(used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE))
|
if (!(used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE))
|
||||||
create_info->key_block_size= table->s->key_block_size;
|
create_info->key_block_size= table->s->key_block_size;
|
||||||
|
|
||||||
|
if (!create_info->tablespace && create_info->storage_media != HA_SM_MEMORY)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Regular alter table of disk stored table (no tablespace/storage change)
|
||||||
|
Copy tablespace name
|
||||||
|
*/
|
||||||
|
if ((table->file->get_tablespace_name(thd, tablespace, FN_LEN)))
|
||||||
|
create_info->tablespace= tablespace;
|
||||||
|
}
|
||||||
restore_record(table, s->default_values); // Empty record for DEFAULT
|
restore_record(table, s->default_values); // Empty record for DEFAULT
|
||||||
List_iterator<Alter_drop> drop_it(alter_info->drop_list);
|
List_iterator<Alter_drop> drop_it(alter_info->drop_list);
|
||||||
List_iterator<create_field> def_it(fields);
|
List_iterator<create_field> def_it(fields);
|
||||||
|
@ -4008,8 +4008,8 @@ create_table_option:
|
|||||||
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.data_file_name= $4.str; Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR; }
|
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.data_file_name= $4.str; Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR; }
|
||||||
| INDEX_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.index_file_name= $4.str; Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR; }
|
| INDEX_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.index_file_name= $4.str; Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR; }
|
||||||
| TABLESPACE ident {Lex->create_info.tablespace= $2.str;}
|
| TABLESPACE ident {Lex->create_info.tablespace= $2.str;}
|
||||||
| STORAGE_SYM DISK_SYM {Lex->create_info.store_on_disk= TRUE;}
|
| STORAGE_SYM DISK_SYM {Lex->create_info.storage_media= HA_SM_DISK;}
|
||||||
| STORAGE_SYM MEMORY_SYM {Lex->create_info.store_on_disk= FALSE;}
|
| STORAGE_SYM MEMORY_SYM {Lex->create_info.storage_media= HA_SM_MEMORY;}
|
||||||
| CONNECTION_SYM opt_equal TEXT_STRING_sys { Lex->create_info.connect_string.str= $3.str; Lex->create_info.connect_string.length= $3.length; Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION; }
|
| CONNECTION_SYM opt_equal TEXT_STRING_sys { Lex->create_info.connect_string.str= $3.str; Lex->create_info.connect_string.length= $3.length; Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION; }
|
||||||
| KEY_BLOCK_SIZE opt_equal ulong_num
|
| KEY_BLOCK_SIZE opt_equal ulong_num
|
||||||
{
|
{
|
||||||
@ -4751,6 +4751,7 @@ alter:
|
|||||||
lex->alter_info.reset();
|
lex->alter_info.reset();
|
||||||
lex->alter_info.flags= 0;
|
lex->alter_info.flags= 0;
|
||||||
lex->no_write_to_binlog= 0;
|
lex->no_write_to_binlog= 0;
|
||||||
|
lex->create_info.storage_media= HA_SM_DEFAULT;
|
||||||
}
|
}
|
||||||
alter_commands
|
alter_commands
|
||||||
{}
|
{}
|
||||||
@ -8417,6 +8418,7 @@ show_param:
|
|||||||
if (!lex->select_lex.add_table_to_list(YYTHD, $3, NULL,0))
|
if (!lex->select_lex.add_table_to_list(YYTHD, $3, NULL,0))
|
||||||
YYABORT;
|
YYABORT;
|
||||||
lex->only_view= 0;
|
lex->only_view= 0;
|
||||||
|
lex->create_info.storage_media= HA_SM_DEFAULT;
|
||||||
}
|
}
|
||||||
| CREATE VIEW_SYM table_ident
|
| CREATE VIEW_SYM table_ident
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,8 @@ private:
|
|||||||
BUFFER_FULL_FRAG_COMPLETE = 3,
|
BUFFER_FULL_FRAG_COMPLETE = 3,
|
||||||
BUFFER_FULL_META = 4,
|
BUFFER_FULL_META = 4,
|
||||||
BACKUP_FRAGMENT_INFO = 5,
|
BACKUP_FRAGMENT_INFO = 5,
|
||||||
RESET_DISK_SPEED_COUNTER = 6
|
RESET_DISK_SPEED_COUNTER = 6,
|
||||||
|
ZDELAY_SCAN_NEXT = 7
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -74,6 +74,8 @@ struct FreeExtentReq {
|
|||||||
Local_key key;
|
Local_key key;
|
||||||
Uint32 table_id;
|
Uint32 table_id;
|
||||||
Uint32 tablespace_id;
|
Uint32 tablespace_id;
|
||||||
|
Uint32 lsn_hi;
|
||||||
|
Uint32 lsn_lo;
|
||||||
} request;
|
} request;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
@ -96,6 +96,8 @@
|
|||||||
#define CFG_DB_CHECKPOINT_SPEED 164
|
#define CFG_DB_CHECKPOINT_SPEED 164
|
||||||
#define CFG_DB_CHECKPOINT_SPEED_SR 165
|
#define CFG_DB_CHECKPOINT_SPEED_SR 165
|
||||||
|
|
||||||
|
#define CFG_DB_MEMREPORT_FREQUENCY 166
|
||||||
|
|
||||||
#define CFG_DB_SGA 198 /* super pool mem */
|
#define CFG_DB_SGA 198 /* super pool mem */
|
||||||
#define CFG_DB_DATA_MEM_2 199 /* used in special build in 5.1 */
|
#define CFG_DB_DATA_MEM_2 199 /* used in special build in 5.1 */
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ BIN_DIRS := ndbapi_simple \
|
|||||||
ndbapi_scan \
|
ndbapi_scan \
|
||||||
mgmapi_logevent \
|
mgmapi_logevent \
|
||||||
ndbapi_simple_dual \
|
ndbapi_simple_dual \
|
||||||
mgmapi_logevent_dual
|
mgmapi_logevent2
|
||||||
|
|
||||||
bins: $(patsubst %, _bins_%, $(BIN_DIRS))
|
bins: $(patsubst %, _bins_%, $(BIN_DIRS))
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
TARGET = mgmapi_logevent_dual
|
TARGET = mgmapi_logevent2
|
||||||
SRCS = $(TARGET).cpp
|
SRCS = $(TARGET).cpp
|
||||||
OBJS = $(TARGET).o
|
OBJS = $(TARGET).o
|
||||||
CXX = g++
|
CXX = g++
|
@ -8,7 +8,7 @@ Next DBDICT 6007
|
|||||||
Next DBDIH 7178
|
Next DBDIH 7178
|
||||||
Next DBTC 8039
|
Next DBTC 8039
|
||||||
Next CMVMI 9000
|
Next CMVMI 9000
|
||||||
Next BACKUP 10036
|
Next BACKUP 10038
|
||||||
Next DBUTIL 11002
|
Next DBUTIL 11002
|
||||||
Next DBTUX 12008
|
Next DBTUX 12008
|
||||||
Next SUMA 13001
|
Next SUMA 13001
|
||||||
@ -425,6 +425,9 @@ Backup Stuff:
|
|||||||
10034: define backup reply error
|
10034: define backup reply error
|
||||||
10035: Fail to allocate buffers
|
10035: Fail to allocate buffers
|
||||||
|
|
||||||
|
10036: Halt backup for table >= 2
|
||||||
|
10037: Resume backup (from 10036)
|
||||||
|
|
||||||
11001: Send UTIL_SEQUENCE_REF (in master)
|
11001: Send UTIL_SEQUENCE_REF (in master)
|
||||||
|
|
||||||
5028: Crash when receiving LQHKEYREQ (in non-master)
|
5028: Crash when receiving LQHKEYREQ (in non-master)
|
||||||
|
@ -355,6 +355,25 @@ Backup::execCONTINUEB(Signal* signal)
|
|||||||
GetTabInfoReq::SignalLength, JBB);
|
GetTabInfoReq::SignalLength, JBB);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
case BackupContinueB::ZDELAY_SCAN_NEXT:
|
||||||
|
if (ERROR_INSERTED(10036))
|
||||||
|
{
|
||||||
|
jam();
|
||||||
|
sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 300,
|
||||||
|
signal->getLength());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jam();
|
||||||
|
CLEAR_ERROR_INSERT_VALUE;
|
||||||
|
ndbout_c("Resuming backup");
|
||||||
|
memmove(signal->theData, signal->theData + 1,
|
||||||
|
4*ScanFragNextReq::SignalLength);
|
||||||
|
sendSignal(DBLQH_REF, GSN_SCAN_NEXTREQ, signal,
|
||||||
|
ScanFragNextReq::SignalLength, JBB);
|
||||||
|
return ;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
ndbrequire(0);
|
ndbrequire(0);
|
||||||
}//switch
|
}//switch
|
||||||
@ -3924,6 +3943,22 @@ Backup::checkScan(Signal* signal, BackupFilePtr filePtr)
|
|||||||
req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8);
|
req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8);
|
||||||
req->batch_size_rows= 16;
|
req->batch_size_rows= 16;
|
||||||
req->batch_size_bytes= 0;
|
req->batch_size_bytes= 0;
|
||||||
|
|
||||||
|
if (ERROR_INSERTED(10036) &&
|
||||||
|
filePtr.p->tableId >= 2 &&
|
||||||
|
filePtr.p->operation.noOfRecords > 0)
|
||||||
|
{
|
||||||
|
ndbout_c("halting backup for table %d fragment: %d after %d records",
|
||||||
|
filePtr.p->tableId,
|
||||||
|
filePtr.p->fragmentNo,
|
||||||
|
filePtr.p->operation.noOfRecords);
|
||||||
|
memmove(signal->theData+1, signal->theData,
|
||||||
|
4*ScanFragNextReq::SignalLength);
|
||||||
|
signal->theData[0] = BackupContinueB::ZDELAY_SCAN_NEXT;
|
||||||
|
sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal,
|
||||||
|
300, 1+ScanFragNextReq::SignalLength);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(ERROR_INSERTED(10032))
|
if(ERROR_INSERTED(10032))
|
||||||
sendSignalWithDelay(DBLQH_REF, GSN_SCAN_NEXTREQ, signal,
|
sendSignalWithDelay(DBLQH_REF, GSN_SCAN_NEXTREQ, signal,
|
||||||
100, ScanFragNextReq::SignalLength);
|
100, ScanFragNextReq::SignalLength);
|
||||||
|
@ -1099,6 +1099,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Uint32 c_errorInsert3000_TableId;
|
Uint32 c_errorInsert3000_TableId;
|
||||||
|
Uint32 c_memusage_report_frequency;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -111,6 +111,7 @@ void Dbacc::execCONTINUEB(Signal* signal)
|
|||||||
}
|
}
|
||||||
case ZREPORT_MEMORY_USAGE:{
|
case ZREPORT_MEMORY_USAGE:{
|
||||||
jam();
|
jam();
|
||||||
|
Uint32 cnt = signal->theData[1];
|
||||||
static int c_currentMemUsed = 0;
|
static int c_currentMemUsed = 0;
|
||||||
int now = cpagesize ? (cnoOfAllocatedPages * 100)/cpagesize : 0;
|
int now = cpagesize ? (cnoOfAllocatedPages * 100)/cpagesize : 0;
|
||||||
const int thresholds[] = { 99, 90, 80, 0};
|
const int thresholds[] = { 99, 90, 80, 0};
|
||||||
@ -124,14 +125,22 @@ void Dbacc::execCONTINUEB(Signal* signal)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(now != c_currentMemUsed){
|
if(now != c_currentMemUsed ||
|
||||||
reportMemoryUsage(signal, now > c_currentMemUsed ? 1 : -1);
|
(c_memusage_report_frequency && cnt + 1 == c_memusage_report_frequency))
|
||||||
}
|
{
|
||||||
|
reportMemoryUsage(signal,
|
||||||
|
now > c_currentMemUsed ? 1 :
|
||||||
|
now < c_currentMemUsed ? -1 : 0);
|
||||||
|
cnt = 0;
|
||||||
c_currentMemUsed = now;
|
c_currentMemUsed = now;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cnt ++;
|
||||||
|
}
|
||||||
signal->theData[0] = ZREPORT_MEMORY_USAGE;
|
signal->theData[0] = ZREPORT_MEMORY_USAGE;
|
||||||
sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 2000, 1);
|
signal->theData[1] = cnt;
|
||||||
|
sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 1000, 2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,7 +207,8 @@ void Dbacc::execNDB_STTOR(Signal* signal)
|
|||||||
csystemRestart = ZFALSE;
|
csystemRestart = ZFALSE;
|
||||||
|
|
||||||
signal->theData[0] = ZREPORT_MEMORY_USAGE;
|
signal->theData[0] = ZREPORT_MEMORY_USAGE;
|
||||||
sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 2000, 1);
|
signal->theData[1] = 0;
|
||||||
|
sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 1000, 2);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
jam();
|
jam();
|
||||||
@ -352,6 +362,10 @@ void Dbacc::execREAD_CONFIG_REQ(Signal* signal)
|
|||||||
initRecords();
|
initRecords();
|
||||||
ndbrestart1Lab(signal);
|
ndbrestart1Lab(signal);
|
||||||
|
|
||||||
|
c_memusage_report_frequency = 0;
|
||||||
|
ndb_mgm_get_int_parameter(p, CFG_DB_MEMREPORT_FREQUENCY,
|
||||||
|
&c_memusage_report_frequency);
|
||||||
|
|
||||||
tdata0 = 0;
|
tdata0 = 0;
|
||||||
initialiseRecordsLab(signal, ref, senderData);
|
initialiseRecordsLab(signal, ref, senderData);
|
||||||
return;
|
return;
|
||||||
|
@ -478,7 +478,7 @@ Dbdict::packTableIntoPages(SimpleProperties::Writer & w,
|
|||||||
CreateFragmentationReq::SignalLength);
|
CreateFragmentationReq::SignalLength);
|
||||||
ndbrequire(signal->theData[0] == 0);
|
ndbrequire(signal->theData[0] == 0);
|
||||||
Uint16 *data = (Uint16*)&signal->theData[25];
|
Uint16 *data = (Uint16*)&signal->theData[25];
|
||||||
Uint32 count = 2 + data[0] * data[1];
|
Uint32 count = 2 + (1 + data[0]) * data[1];
|
||||||
w.add(DictTabInfo::ReplicaDataLen, 2*count);
|
w.add(DictTabInfo::ReplicaDataLen, 2*count);
|
||||||
for (Uint32 i = 0; i < count; i++)
|
for (Uint32 i = 0; i < count; i++)
|
||||||
data[i] = htons(data[i]);
|
data[i] = htons(data[i]);
|
||||||
|
@ -6727,7 +6727,7 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal)
|
|||||||
FragmentstorePtr fragPtr;
|
FragmentstorePtr fragPtr;
|
||||||
ReplicaRecordPtr replicaPtr;
|
ReplicaRecordPtr replicaPtr;
|
||||||
getFragstore(primTabPtr.p, fragNo, fragPtr);
|
getFragstore(primTabPtr.p, fragNo, fragPtr);
|
||||||
fragments[count++] = c_nextLogPart++;
|
fragments[count++] = fragPtr.p->m_log_part_id;
|
||||||
fragments[count++] = fragPtr.p->preferredPrimary;
|
fragments[count++] = fragPtr.p->preferredPrimary;
|
||||||
for (replicaPtr.i = fragPtr.p->storedReplicas;
|
for (replicaPtr.i = fragPtr.p->storedReplicas;
|
||||||
replicaPtr.i != RNIL;
|
replicaPtr.i != RNIL;
|
||||||
|
@ -11275,7 +11275,7 @@ void Dblqh::execLCP_PREPARE_REF(Signal* signal)
|
|||||||
/**
|
/**
|
||||||
* First fragment mean that last LCP is complete :-)
|
* First fragment mean that last LCP is complete :-)
|
||||||
*/
|
*/
|
||||||
EXECUTE_DIRECT(TSMAN, GSN_END_LCP_REQ, signal, signal->length());
|
EXECUTE_DIRECT(TSMAN, GSN_LCP_FRAG_ORD, signal, signal->length());
|
||||||
jamEntry();
|
jamEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11326,7 +11326,7 @@ void Dblqh::execLCP_PREPARE_CONF(Signal* signal)
|
|||||||
/**
|
/**
|
||||||
* First fragment mean that last LCP is complete :-)
|
* First fragment mean that last LCP is complete :-)
|
||||||
*/
|
*/
|
||||||
EXECUTE_DIRECT(TSMAN, GSN_END_LCP_REQ, signal, signal->length());
|
EXECUTE_DIRECT(TSMAN, GSN_LCP_FRAG_ORD, signal, signal->length());
|
||||||
jamEntry();
|
jamEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11610,6 +11610,9 @@ void Dblqh::completeLcpRoundLab(Signal* signal, Uint32 lcpId)
|
|||||||
sendSignal(LGMAN_REF, GSN_END_LCP_REQ, signal,
|
sendSignal(LGMAN_REF, GSN_END_LCP_REQ, signal,
|
||||||
EndLcpReq::SignalLength, JBB);
|
EndLcpReq::SignalLength, JBB);
|
||||||
|
|
||||||
|
EXECUTE_DIRECT(TSMAN, GSN_END_LCP_REQ, signal, EndLcpReq::SignalLength);
|
||||||
|
jamEntry();
|
||||||
|
|
||||||
lcpPtr.i = 0;
|
lcpPtr.i = 0;
|
||||||
ptrAss(lcpPtr, lcpRecord);
|
ptrAss(lcpPtr, lcpRecord);
|
||||||
lcpPtr.p->m_outstanding = 3;
|
lcpPtr.p->m_outstanding = 3;
|
||||||
|
@ -5057,7 +5057,7 @@ void Dbtc::execLQHKEYREF(Signal* signal)
|
|||||||
ptrAss(tcConnectptr, tcConnectRecord);
|
ptrAss(tcConnectptr, tcConnectRecord);
|
||||||
TcConnectRecord * const regTcPtr = tcConnectptr.p;
|
TcConnectRecord * const regTcPtr = tcConnectptr.p;
|
||||||
if (regTcPtr->tcConnectstate == OS_OPERATING) {
|
if (regTcPtr->tcConnectstate == OS_OPERATING) {
|
||||||
apiConnectptr.i = regTcPtr->apiConnect;
|
Uint32 save = apiConnectptr.i = regTcPtr->apiConnect;
|
||||||
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
|
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
|
||||||
ApiConnectRecord * const regApiPtr = apiConnectptr.p;
|
ApiConnectRecord * const regApiPtr = apiConnectptr.p;
|
||||||
compare_transid1 = regApiPtr->transid[0] ^ lqhKeyRef->transId1;
|
compare_transid1 = regApiPtr->transid[0] ^ lqhKeyRef->transId1;
|
||||||
@ -5181,7 +5181,7 @@ void Dbtc::execLQHKEYREF(Signal* signal)
|
|||||||
regApiPtr->lqhkeyreqrec--; // Compensate for extra during read
|
regApiPtr->lqhkeyreqrec--; // Compensate for extra during read
|
||||||
tcKeyRef->connectPtr = indexOp;
|
tcKeyRef->connectPtr = indexOp;
|
||||||
EXECUTE_DIRECT(DBTC, GSN_TCKEYREF, signal, TcKeyRef::SignalLength);
|
EXECUTE_DIRECT(DBTC, GSN_TCKEYREF, signal, TcKeyRef::SignalLength);
|
||||||
apiConnectptr.i = regTcPtr->apiConnect;
|
apiConnectptr.i = save;
|
||||||
apiConnectptr.p = regApiPtr;
|
apiConnectptr.p = regApiPtr;
|
||||||
} else {
|
} else {
|
||||||
jam();
|
jam();
|
||||||
@ -5206,6 +5206,8 @@ void Dbtc::execLQHKEYREF(Signal* signal)
|
|||||||
jam();
|
jam();
|
||||||
sendtckeyconf(signal, 1);
|
sendtckeyconf(signal, 1);
|
||||||
regApiPtr->apiConnectstate = CS_CONNECTED;
|
regApiPtr->apiConnectstate = CS_CONNECTED;
|
||||||
|
regApiPtr->m_transaction_nodes.clear();
|
||||||
|
setApiConTimer(apiConnectptr.i, 0,__LINE__);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (regApiPtr->tckeyrec > 0 || regApiPtr->m_exec_flag) {
|
} else if (regApiPtr->tckeyrec > 0 || regApiPtr->m_exec_flag) {
|
||||||
@ -11863,17 +11865,6 @@ void Dbtc::execTCKEYREF(Signal* signal)
|
|||||||
case(IOS_INDEX_ACCESS_WAIT_FOR_TRANSID_AI):
|
case(IOS_INDEX_ACCESS_WAIT_FOR_TRANSID_AI):
|
||||||
case(IOS_INDEX_ACCESS_WAIT_FOR_TCKEYCONF): {
|
case(IOS_INDEX_ACCESS_WAIT_FOR_TCKEYCONF): {
|
||||||
jam();
|
jam();
|
||||||
// If we fail index access for a non-read operation during commit
|
|
||||||
// we abort transaction
|
|
||||||
if (commitFlg == 1) {
|
|
||||||
jam();
|
|
||||||
releaseIndexOperation(regApiPtr, indexOp);
|
|
||||||
apiConnectptr.i = indexOp->connectionIndex;
|
|
||||||
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
|
|
||||||
terrorCode = tcKeyRef->errorCode;
|
|
||||||
abortErrorLab(signal);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Increase count as it will be decreased below...
|
* Increase count as it will be decreased below...
|
||||||
* (and the code is written to handle failing lookup on "real" table
|
* (and the code is written to handle failing lookup on "real" table
|
||||||
|
@ -624,7 +624,8 @@ struct Fragrecord {
|
|||||||
|
|
||||||
DLList<ScanOp>::Head m_scanList;
|
DLList<ScanOp>::Head m_scanList;
|
||||||
|
|
||||||
bool m_undo_complete;
|
enum { UC_LCP = 1, UC_CREATE = 2 };
|
||||||
|
Uint32 m_undo_complete;
|
||||||
Uint32 m_tablespace_id;
|
Uint32 m_tablespace_id;
|
||||||
Uint32 m_logfile_group_id;
|
Uint32 m_logfile_group_id;
|
||||||
Disk_alloc_info m_disk_alloc_info;
|
Disk_alloc_info m_disk_alloc_info;
|
||||||
@ -988,6 +989,9 @@ ArrayPool<TupTriggerData> c_triggerPool;
|
|||||||
,UNDO_UPDATE = File_formats::Undofile::UNDO_TUP_UPDATE
|
,UNDO_UPDATE = File_formats::Undofile::UNDO_TUP_UPDATE
|
||||||
,UNDO_FREE = File_formats::Undofile::UNDO_TUP_FREE
|
,UNDO_FREE = File_formats::Undofile::UNDO_TUP_FREE
|
||||||
,UNDO_CREATE = File_formats::Undofile::UNDO_TUP_CREATE
|
,UNDO_CREATE = File_formats::Undofile::UNDO_TUP_CREATE
|
||||||
|
,UNDO_DROP = File_formats::Undofile::UNDO_TUP_DROP
|
||||||
|
,UNDO_ALLOC_EXTENT = File_formats::Undofile::UNDO_TUP_ALLOC_EXTENT
|
||||||
|
,UNDO_FREE_EXTENT = File_formats::Undofile::UNDO_TUP_FREE_EXTENT
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Alloc
|
struct Alloc
|
||||||
@ -1020,6 +1024,30 @@ ArrayPool<TupTriggerData> c_triggerPool;
|
|||||||
Uint32 m_table;
|
Uint32 m_table;
|
||||||
Uint32 m_type_length; // 16 bit type, 16 bit length
|
Uint32 m_type_length; // 16 bit type, 16 bit length
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Drop
|
||||||
|
{
|
||||||
|
Uint32 m_table;
|
||||||
|
Uint32 m_type_length; // 16 bit type, 16 bit length
|
||||||
|
};
|
||||||
|
|
||||||
|
struct AllocExtent
|
||||||
|
{
|
||||||
|
Uint32 m_table;
|
||||||
|
Uint32 m_fragment;
|
||||||
|
Uint32 m_page_no;
|
||||||
|
Uint32 m_file_no;
|
||||||
|
Uint32 m_type_length;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct FreeExtent
|
||||||
|
{
|
||||||
|
Uint32 m_table;
|
||||||
|
Uint32 m_fragment;
|
||||||
|
Uint32 m_page_no;
|
||||||
|
Uint32 m_file_no;
|
||||||
|
Uint32 m_type_length;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
Extent_info_pool c_extent_pool;
|
Extent_info_pool c_extent_pool;
|
||||||
@ -1419,7 +1447,7 @@ public:
|
|||||||
int nr_delete(Signal*, Uint32, Uint32 fragPtr, const Local_key*, Uint32 gci);
|
int nr_delete(Signal*, Uint32, Uint32 fragPtr, const Local_key*, Uint32 gci);
|
||||||
|
|
||||||
void nr_delete_page_callback(Signal*, Uint32 op, Uint32 page);
|
void nr_delete_page_callback(Signal*, Uint32 op, Uint32 page);
|
||||||
void nr_delete_logbuffer_callback(Signal*, Uint32 op, Uint32 page);
|
void nr_delete_log_buffer_callback(Signal*, Uint32 op, Uint32 page);
|
||||||
private:
|
private:
|
||||||
BLOCK_DEFINES(Dbtup);
|
BLOCK_DEFINES(Dbtup);
|
||||||
|
|
||||||
@ -2344,9 +2372,10 @@ private:
|
|||||||
Uint32 fragId);
|
Uint32 fragId);
|
||||||
|
|
||||||
|
|
||||||
void releaseFragment(Signal* signal, Uint32 tableId);
|
void releaseFragment(Signal* signal, Uint32 tableId, Uint32);
|
||||||
void drop_fragment_free_var_pages(Signal*);
|
void drop_fragment_free_var_pages(Signal*);
|
||||||
void drop_fragment_free_exent(Signal*, TablerecPtr, FragrecordPtr, Uint32);
|
void drop_fragment_free_extent(Signal*, TablerecPtr, FragrecordPtr, Uint32);
|
||||||
|
void drop_fragment_free_extent_log_buffer_callback(Signal*, Uint32, Uint32);
|
||||||
void drop_fragment_unmap_pages(Signal*, TablerecPtr, FragrecordPtr, Uint32);
|
void drop_fragment_unmap_pages(Signal*, TablerecPtr, FragrecordPtr, Uint32);
|
||||||
void drop_fragment_unmap_page_callback(Signal* signal, Uint32, Uint32);
|
void drop_fragment_unmap_page_callback(Signal* signal, Uint32, Uint32);
|
||||||
|
|
||||||
@ -2570,6 +2599,7 @@ private:
|
|||||||
|
|
||||||
// Trigger variables
|
// Trigger variables
|
||||||
Uint32 c_maxTriggersPerTable;
|
Uint32 c_maxTriggersPerTable;
|
||||||
|
Uint32 c_memusage_report_frequency;
|
||||||
|
|
||||||
Uint32 c_errorInsert4000TableId;
|
Uint32 c_errorInsert4000TableId;
|
||||||
Uint32 c_min_list_size[MAX_FREE_LIST + 1];
|
Uint32 c_min_list_size[MAX_FREE_LIST + 1];
|
||||||
@ -2630,6 +2660,9 @@ private:
|
|||||||
|
|
||||||
void disk_page_log_buffer_callback(Signal*, Uint32 opPtrI, Uint32);
|
void disk_page_log_buffer_callback(Signal*, Uint32 opPtrI, Uint32);
|
||||||
|
|
||||||
|
void disk_page_alloc_extent_log_buffer_callback(Signal*, Uint32, Uint32);
|
||||||
|
void disk_page_free_extent_log_buffer_callback(Signal*, Uint32, Uint32);
|
||||||
|
|
||||||
Uint64 disk_page_undo_alloc(Page*, const Local_key*,
|
Uint64 disk_page_undo_alloc(Page*, const Local_key*,
|
||||||
Uint32 sz, Uint32 gci, Uint32 logfile_group_id);
|
Uint32 sz, Uint32 gci, Uint32 logfile_group_id);
|
||||||
|
|
||||||
@ -2644,6 +2677,9 @@ private:
|
|||||||
void undo_createtable_callback(Signal* signal, Uint32 opPtrI, Uint32 unused);
|
void undo_createtable_callback(Signal* signal, Uint32 opPtrI, Uint32 unused);
|
||||||
void undo_createtable_logsync_callback(Signal* signal, Uint32, Uint32);
|
void undo_createtable_logsync_callback(Signal* signal, Uint32, Uint32);
|
||||||
|
|
||||||
|
void drop_table_log_buffer_callback(Signal*, Uint32, Uint32);
|
||||||
|
void drop_table_logsync_callback(Signal*, Uint32, Uint32);
|
||||||
|
|
||||||
void disk_page_set_dirty(Ptr<Page>);
|
void disk_page_set_dirty(Ptr<Page>);
|
||||||
void restart_setup_page(Disk_alloc_info&, Ptr<Page>);
|
void restart_setup_page(Disk_alloc_info&, Ptr<Page>);
|
||||||
void update_extent_pos(Disk_alloc_info&, Ptr<Extent_info>);
|
void update_extent_pos(Disk_alloc_info&, Ptr<Extent_info>);
|
||||||
@ -2677,7 +2713,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void disk_restart_undo_next(Signal*);
|
void disk_restart_undo_next(Signal*);
|
||||||
void disk_restart_undo_lcp(Uint32, Uint32);
|
void disk_restart_undo_lcp(Uint32, Uint32, Uint32 flag);
|
||||||
void disk_restart_undo_callback(Signal* signal, Uint32, Uint32);
|
void disk_restart_undo_callback(Signal* signal, Uint32, Uint32);
|
||||||
void disk_restart_undo_alloc(Apply_undo*);
|
void disk_restart_undo_alloc(Apply_undo*);
|
||||||
void disk_restart_undo_update(Apply_undo*);
|
void disk_restart_undo_update(Apply_undo*);
|
||||||
|
@ -151,10 +151,10 @@ void Dbtup::initOpConnection(Operationrec* regOperPtr)
|
|||||||
static
|
static
|
||||||
inline
|
inline
|
||||||
bool
|
bool
|
||||||
operator>=(const Local_key& key1, const Local_key& key2)
|
operator>(const Local_key& key1, const Local_key& key2)
|
||||||
{
|
{
|
||||||
return key1.m_page_no > key2.m_page_no ||
|
return key1.m_page_no > key2.m_page_no ||
|
||||||
(key1.m_page_no == key2.m_page_no && key1.m_page_idx >= key2.m_page_idx);
|
(key1.m_page_no == key2.m_page_no && key1.m_page_idx > key2.m_page_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -175,8 +175,11 @@ Dbtup::dealloc_tuple(Signal* signal,
|
|||||||
{
|
{
|
||||||
Local_key disk;
|
Local_key disk;
|
||||||
memcpy(&disk, ptr->get_disk_ref_ptr(regTabPtr), sizeof(disk));
|
memcpy(&disk, ptr->get_disk_ref_ptr(regTabPtr), sizeof(disk));
|
||||||
|
PagePtr tmpptr;
|
||||||
|
tmpptr.i = m_pgman.m_ptr.i;
|
||||||
|
tmpptr.p = reinterpret_cast<Page*>(m_pgman.m_ptr.p);
|
||||||
disk_page_free(signal, regTabPtr, regFragPtr,
|
disk_page_free(signal, regTabPtr, regFragPtr,
|
||||||
&disk, *(PagePtr*)&m_pgman.m_ptr, gci);
|
&disk, tmpptr, gci);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! (bits & Tuple_header::LCP_SKIP) && lcpScan_ptr_i != RNIL)
|
if (! (bits & Tuple_header::LCP_SKIP) && lcpScan_ptr_i != RNIL)
|
||||||
@ -186,7 +189,7 @@ Dbtup::dealloc_tuple(Signal* signal,
|
|||||||
Local_key rowid = regOperPtr->m_tuple_location;
|
Local_key rowid = regOperPtr->m_tuple_location;
|
||||||
Local_key scanpos = scanOp.p->m_scanPos.m_key;
|
Local_key scanpos = scanOp.p->m_scanPos.m_key;
|
||||||
rowid.m_page_no = page->frag_page_id;
|
rowid.m_page_no = page->frag_page_id;
|
||||||
if (rowid >= scanpos)
|
if (rowid > scanpos)
|
||||||
{
|
{
|
||||||
extra_bits = Tuple_header::LCP_KEEP; // Note REMOVE FREE
|
extra_bits = Tuple_header::LCP_KEEP; // Note REMOVE FREE
|
||||||
ptr->m_operation_ptr_i = lcp_keep_list;
|
ptr->m_operation_ptr_i = lcp_keep_list;
|
||||||
@ -214,6 +217,7 @@ Dbtup::commit_operation(Signal* signal,
|
|||||||
{
|
{
|
||||||
ndbassert(regOperPtr->op_struct.op_type != ZDELETE);
|
ndbassert(regOperPtr->op_struct.op_type != ZDELETE);
|
||||||
|
|
||||||
|
Uint32 lcpScan_ptr_i= regFragPtr->m_lcp_scan_op;
|
||||||
Uint32 save= tuple_ptr->m_operation_ptr_i;
|
Uint32 save= tuple_ptr->m_operation_ptr_i;
|
||||||
Uint32 bits= tuple_ptr->m_header_bits;
|
Uint32 bits= tuple_ptr->m_header_bits;
|
||||||
|
|
||||||
@ -263,7 +267,6 @@ Dbtup::commit_operation(Signal* signal,
|
|||||||
Local_key key;
|
Local_key key;
|
||||||
memcpy(&key, copy->get_disk_ref_ptr(regTabPtr), sizeof(Local_key));
|
memcpy(&key, copy->get_disk_ref_ptr(regTabPtr), sizeof(Local_key));
|
||||||
Uint32 logfile_group_id= regFragPtr->m_logfile_group_id;
|
Uint32 logfile_group_id= regFragPtr->m_logfile_group_id;
|
||||||
Uint32 lcpScan_ptr_i= regFragPtr->m_lcp_scan_op;
|
|
||||||
|
|
||||||
PagePtr diskPagePtr = *(PagePtr*)&m_pgman.m_ptr;
|
PagePtr diskPagePtr = *(PagePtr*)&m_pgman.m_ptr;
|
||||||
ndbassert(diskPagePtr.p->m_page_no == key.m_page_no);
|
ndbassert(diskPagePtr.p->m_page_no == key.m_page_no);
|
||||||
@ -272,19 +275,6 @@ Dbtup::commit_operation(Signal* signal,
|
|||||||
if(copy_bits & Tuple_header::DISK_ALLOC)
|
if(copy_bits & Tuple_header::DISK_ALLOC)
|
||||||
{
|
{
|
||||||
disk_page_alloc(signal, regTabPtr, regFragPtr, &key, diskPagePtr, gci);
|
disk_page_alloc(signal, regTabPtr, regFragPtr, &key, diskPagePtr, gci);
|
||||||
|
|
||||||
if(lcpScan_ptr_i != RNIL)
|
|
||||||
{
|
|
||||||
ScanOpPtr scanOp;
|
|
||||||
c_scanOpPool.getPtr(scanOp, lcpScan_ptr_i);
|
|
||||||
Local_key rowid = regOperPtr->m_tuple_location;
|
|
||||||
Local_key scanpos = scanOp.p->m_scanPos.m_key;
|
|
||||||
rowid.m_page_no = pagePtr.p->frag_page_id;
|
|
||||||
if(rowid >= scanpos)
|
|
||||||
{
|
|
||||||
copy_bits |= Tuple_header::LCP_SKIP;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(regTabPtr->m_attributes[DD].m_no_of_varsize == 0)
|
if(regTabPtr->m_attributes[DD].m_no_of_varsize == 0)
|
||||||
@ -311,6 +301,18 @@ Dbtup::commit_operation(Signal* signal,
|
|||||||
copy_bits |= Tuple_header::DISK_PART;
|
copy_bits |= Tuple_header::DISK_PART;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(lcpScan_ptr_i != RNIL && (bits & Tuple_header::ALLOC))
|
||||||
|
{
|
||||||
|
ScanOpPtr scanOp;
|
||||||
|
c_scanOpPool.getPtr(scanOp, lcpScan_ptr_i);
|
||||||
|
Local_key rowid = regOperPtr->m_tuple_location;
|
||||||
|
Local_key scanpos = scanOp.p->m_scanPos.m_key;
|
||||||
|
rowid.m_page_no = pagePtr.p->frag_page_id;
|
||||||
|
if(rowid > scanpos)
|
||||||
|
{
|
||||||
|
copy_bits |= Tuple_header::LCP_SKIP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Uint32 clear=
|
Uint32 clear=
|
||||||
Tuple_header::ALLOC | Tuple_header::FREE |
|
Tuple_header::ALLOC | Tuple_header::FREE |
|
||||||
@ -356,7 +358,12 @@ Dbtup::disk_page_commit_callback(Signal* signal,
|
|||||||
regOperPtr.p->m_commit_disk_callback_page= page_id;
|
regOperPtr.p->m_commit_disk_callback_page= page_id;
|
||||||
m_global_page_pool.getPtr(m_pgman.m_ptr, page_id);
|
m_global_page_pool.getPtr(m_pgman.m_ptr, page_id);
|
||||||
|
|
||||||
disk_page_set_dirty(*(Ptr<Page>*)&m_pgman.m_ptr);
|
{
|
||||||
|
PagePtr tmp;
|
||||||
|
tmp.i = m_pgman.m_ptr.i;
|
||||||
|
tmp.p = reinterpret_cast<Page*>(m_pgman.m_ptr.p);
|
||||||
|
disk_page_set_dirty(tmp);
|
||||||
|
}
|
||||||
|
|
||||||
execTUP_COMMITREQ(signal);
|
execTUP_COMMITREQ(signal);
|
||||||
if(signal->theData[0] == 0)
|
if(signal->theData[0] == 0)
|
||||||
@ -543,7 +550,14 @@ void Dbtup::execTUP_COMMITREQ(Signal* signal)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
get_page = true;
|
get_page = true;
|
||||||
disk_page_set_dirty(*(Ptr<Page>*)&m_pgman.m_ptr);
|
|
||||||
|
{
|
||||||
|
PagePtr tmpptr;
|
||||||
|
tmpptr.i = m_pgman.m_ptr.i;
|
||||||
|
tmpptr.p = reinterpret_cast<Page*>(m_pgman.m_ptr.p);
|
||||||
|
disk_page_set_dirty(tmpptr);
|
||||||
|
}
|
||||||
|
|
||||||
regOperPtr.p->m_commit_disk_callback_page= res;
|
regOperPtr.p->m_commit_disk_callback_page= res;
|
||||||
regOperPtr.p->op_struct.m_load_diskpage_on_commit= 0;
|
regOperPtr.p->op_struct.m_load_diskpage_on_commit= 0;
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,26 @@ operator<<(NdbOut& out, const Ptr<Dbtup::Extent_info> & ptr)
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if NOT_YET_FREE_EXTENT
|
||||||
|
static
|
||||||
|
inline
|
||||||
|
bool
|
||||||
|
check_free(const Dbtup::Extent_info* extP)
|
||||||
|
{
|
||||||
|
Uint32 res = 0;
|
||||||
|
for (Uint32 i = 1; i<MAX_FREE_LIST; i++)
|
||||||
|
res += extP->m_free_page_count[i];
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
#error "Code for deallocting extents when they get empty"
|
||||||
|
#error "This code is not yet complete"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if NOT_YET_UNDO_ALLOC_EXTENT
|
||||||
|
#error "This is needed for deallocting extents when they get empty"
|
||||||
|
#error "This code is not complete yet"
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
Dbtup::dump_disk_alloc(Dbtup::Disk_alloc_info & alloc)
|
Dbtup::dump_disk_alloc(Dbtup::Disk_alloc_info & alloc)
|
||||||
{
|
{
|
||||||
@ -444,10 +464,26 @@ Dbtup::disk_page_prealloc(Signal* signal,
|
|||||||
/**
|
/**
|
||||||
* We need to alloc an extent
|
* We need to alloc an extent
|
||||||
*/
|
*/
|
||||||
|
#if NOT_YET_UNDO_ALLOC_EXTENT
|
||||||
|
Uint32 logfile_group_id = fragPtr.p->m_logfile_group_id;
|
||||||
|
|
||||||
|
err = c_lgman->alloc_log_space(logfile_group_id,
|
||||||
|
sizeof(Disk_undo::AllocExtent)>>2);
|
||||||
|
if(unlikely(err))
|
||||||
|
{
|
||||||
|
return -err;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!c_extent_pool.seize(ext))
|
if (!c_extent_pool.seize(ext))
|
||||||
{
|
{
|
||||||
|
jam();
|
||||||
//XXX
|
//XXX
|
||||||
err= 2;
|
err= 2;
|
||||||
|
#if NOT_YET_UNDO_ALLOC_EXTENT
|
||||||
|
c_lgman->free_log_space(logfile_group_id,
|
||||||
|
sizeof(Disk_undo::AllocExtent)>>2);
|
||||||
|
#endif
|
||||||
c_page_request_pool.release(req);
|
c_page_request_pool.release(req);
|
||||||
ndbout_c("no free extent info");
|
ndbout_c("no free extent info");
|
||||||
return -err;
|
return -err;
|
||||||
@ -455,12 +491,44 @@ Dbtup::disk_page_prealloc(Signal* signal,
|
|||||||
|
|
||||||
if ((err= tsman.alloc_extent(&ext.p->m_key)) < 0)
|
if ((err= tsman.alloc_extent(&ext.p->m_key)) < 0)
|
||||||
{
|
{
|
||||||
|
jam();
|
||||||
|
#if NOT_YET_UNDO_ALLOC_EXTENT
|
||||||
|
c_lgman->free_log_space(logfile_group_id,
|
||||||
|
sizeof(Disk_undo::AllocExtent)>>2);
|
||||||
|
#endif
|
||||||
c_extent_pool.release(ext);
|
c_extent_pool.release(ext);
|
||||||
c_page_request_pool.release(req);
|
c_page_request_pool.release(req);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pages= err;
|
int pages= err;
|
||||||
|
#if NOT_YET_UNDO_ALLOC_EXTENT
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Do something here
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
Callback cb;
|
||||||
|
cb.m_callbackData= ext.i;
|
||||||
|
cb.m_callbackFunction =
|
||||||
|
safe_cast(&Dbtup::disk_page_alloc_extent_log_buffer_callback);
|
||||||
|
Uint32 sz= sizeof(Disk_undo::AllocExtent)>>2;
|
||||||
|
|
||||||
|
Logfile_client lgman(this, c_lgman, logfile_group_id);
|
||||||
|
int res= lgman.get_log_buffer(signal, sz, &cb);
|
||||||
|
switch(res){
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case -1:
|
||||||
|
ndbrequire("NOT YET IMPLEMENTED" == 0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
execute(signal, cb, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ndbout << "allocated " << pages << " pages: " << ext.p->m_key << endl;
|
ndbout << "allocated " << pages << " pages: " << ext.p->m_key << endl;
|
||||||
ext.p->m_first_page_no = ext.p->m_key.m_page_no;
|
ext.p->m_first_page_no = ext.p->m_key.m_page_no;
|
||||||
bzero(ext.p->m_free_page_count, sizeof(ext.p->m_free_page_count));
|
bzero(ext.p->m_free_page_count, sizeof(ext.p->m_free_page_count));
|
||||||
@ -1016,6 +1084,12 @@ Dbtup::disk_page_free(Signal *signal,
|
|||||||
|
|
||||||
extentPtr.p->m_free_space += sz;
|
extentPtr.p->m_free_space += sz;
|
||||||
update_extent_pos(alloc, extentPtr);
|
update_extent_pos(alloc, extentPtr);
|
||||||
|
#if NOT_YET_FREE_EXTENT
|
||||||
|
if (check_free(extentPtr.p) == 0)
|
||||||
|
{
|
||||||
|
ndbout_c("free: extent is free");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1118,13 +1192,55 @@ Dbtup::disk_page_abort_prealloc_callback_1(Signal* signal,
|
|||||||
|
|
||||||
extentPtr.p->m_free_space += sz;
|
extentPtr.p->m_free_space += sz;
|
||||||
update_extent_pos(alloc, extentPtr);
|
update_extent_pos(alloc, extentPtr);
|
||||||
|
#if NOT_YET_FREE_EXTENT
|
||||||
|
if (check_free(extentPtr.p) == 0)
|
||||||
|
{
|
||||||
|
ndbout_c("abort: extent is free");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if NOT_YET_UNDO_ALLOC_EXTENT
|
||||||
|
void
|
||||||
|
Dbtup::disk_page_alloc_extent_log_buffer_callback(Signal* signal,
|
||||||
|
Uint32 extentPtrI,
|
||||||
|
Uint32 unused)
|
||||||
|
{
|
||||||
|
Ptr<Extent_info> extentPtr;
|
||||||
|
c_extent_pool.getPtr(extentPtr, extentPtrI);
|
||||||
|
|
||||||
|
Local_key key = extentPtr.p->m_key;
|
||||||
|
Tablespace_client2 tsman(signal, c_tsman, &key);
|
||||||
|
|
||||||
|
Ptr<Tablerec> tabPtr;
|
||||||
|
tabPtr.i= tsman.m_table_id;
|
||||||
|
ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
|
||||||
|
|
||||||
|
Ptr<Fragrecord> fragPtr;
|
||||||
|
getFragmentrec(fragPtr, tsman.m_fragment_id, tabPtr.p);
|
||||||
|
|
||||||
|
Logfile_client lgman(this, c_lgman, fragPtr.p->m_logfile_group_id);
|
||||||
|
|
||||||
|
Disk_undo::AllocExtent alloc;
|
||||||
|
alloc.m_table = tabPtr.i;
|
||||||
|
alloc.m_fragment = tsman.m_fragment_id;
|
||||||
|
alloc.m_page_no = key.m_page_no;
|
||||||
|
alloc.m_file_no = key.m_file_no;
|
||||||
|
alloc.m_type_length = (Disk_undo::UNDO_ALLOC_EXTENT<<16)|(sizeof(alloc)>> 2);
|
||||||
|
|
||||||
|
Logfile_client::Change c[1] = {{ &alloc, sizeof(alloc) >> 2 } };
|
||||||
|
|
||||||
|
Uint64 lsn= lgman.add_entry(c, 1);
|
||||||
|
|
||||||
|
tsman.update_lsn(&key, lsn);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Uint64
|
Uint64
|
||||||
Dbtup::disk_page_undo_alloc(Page* page, const Local_key* key,
|
Dbtup::disk_page_undo_alloc(Page* page, const Local_key* key,
|
||||||
Uint32 sz, Uint32 gci, Uint32 logfile_group_id)
|
Uint32 sz, Uint32 gci, Uint32 logfile_group_id)
|
||||||
{
|
{
|
||||||
Logfile_client lsman(this, c_lgman, logfile_group_id);
|
Logfile_client lgman(this, c_lgman, logfile_group_id);
|
||||||
|
|
||||||
Disk_undo::Alloc alloc;
|
Disk_undo::Alloc alloc;
|
||||||
alloc.m_type_length= (Disk_undo::UNDO_ALLOC << 16) | (sizeof(alloc) >> 2);
|
alloc.m_type_length= (Disk_undo::UNDO_ALLOC << 16) | (sizeof(alloc) >> 2);
|
||||||
@ -1133,7 +1249,7 @@ Dbtup::disk_page_undo_alloc(Page* page, const Local_key* key,
|
|||||||
|
|
||||||
Logfile_client::Change c[1] = {{ &alloc, sizeof(alloc) >> 2 } };
|
Logfile_client::Change c[1] = {{ &alloc, sizeof(alloc) >> 2 } };
|
||||||
|
|
||||||
Uint64 lsn= lsman.add_entry(c, 1);
|
Uint64 lsn= lgman.add_entry(c, 1);
|
||||||
m_pgman.update_lsn(* key, lsn);
|
m_pgman.update_lsn(* key, lsn);
|
||||||
|
|
||||||
return lsn;
|
return lsn;
|
||||||
@ -1144,7 +1260,7 @@ Dbtup::disk_page_undo_update(Page* page, const Local_key* key,
|
|||||||
const Uint32* src, Uint32 sz,
|
const Uint32* src, Uint32 sz,
|
||||||
Uint32 gci, Uint32 logfile_group_id)
|
Uint32 gci, Uint32 logfile_group_id)
|
||||||
{
|
{
|
||||||
Logfile_client lsman(this, c_lgman, logfile_group_id);
|
Logfile_client lgman(this, c_lgman, logfile_group_id);
|
||||||
|
|
||||||
Disk_undo::Update update;
|
Disk_undo::Update update;
|
||||||
update.m_page_no = key->m_page_no;
|
update.m_page_no = key->m_page_no;
|
||||||
@ -1162,7 +1278,7 @@ Dbtup::disk_page_undo_update(Page* page, const Local_key* key,
|
|||||||
|
|
||||||
ndbassert(4*(3 + sz + 1) == (sizeof(update) + 4*sz - 4));
|
ndbassert(4*(3 + sz + 1) == (sizeof(update) + 4*sz - 4));
|
||||||
|
|
||||||
Uint64 lsn= lsman.add_entry(c, 3);
|
Uint64 lsn= lgman.add_entry(c, 3);
|
||||||
m_pgman.update_lsn(* key, lsn);
|
m_pgman.update_lsn(* key, lsn);
|
||||||
|
|
||||||
return lsn;
|
return lsn;
|
||||||
@ -1173,7 +1289,7 @@ Dbtup::disk_page_undo_free(Page* page, const Local_key* key,
|
|||||||
const Uint32* src, Uint32 sz,
|
const Uint32* src, Uint32 sz,
|
||||||
Uint32 gci, Uint32 logfile_group_id)
|
Uint32 gci, Uint32 logfile_group_id)
|
||||||
{
|
{
|
||||||
Logfile_client lsman(this, c_lgman, logfile_group_id);
|
Logfile_client lgman(this, c_lgman, logfile_group_id);
|
||||||
|
|
||||||
Disk_undo::Free free;
|
Disk_undo::Free free;
|
||||||
free.m_page_no = key->m_page_no;
|
free.m_page_no = key->m_page_no;
|
||||||
@ -1191,7 +1307,7 @@ Dbtup::disk_page_undo_free(Page* page, const Local_key* key,
|
|||||||
|
|
||||||
ndbassert(4*(3 + sz + 1) == (sizeof(free) + 4*sz - 4));
|
ndbassert(4*(3 + sz + 1) == (sizeof(free) + 4*sz - 4));
|
||||||
|
|
||||||
Uint64 lsn= lsman.add_entry(c, 3);
|
Uint64 lsn= lgman.add_entry(c, 3);
|
||||||
m_pgman.update_lsn(* key, lsn);
|
m_pgman.update_lsn(* key, lsn);
|
||||||
|
|
||||||
return lsn;
|
return lsn;
|
||||||
@ -1221,7 +1337,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn,
|
|||||||
ndbrequire(len == 3);
|
ndbrequire(len == 3);
|
||||||
Uint32 tableId = ptr[1] >> 16;
|
Uint32 tableId = ptr[1] >> 16;
|
||||||
Uint32 fragId = ptr[1] & 0xFFFF;
|
Uint32 fragId = ptr[1] & 0xFFFF;
|
||||||
disk_restart_undo_lcp(tableId, fragId);
|
disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_LCP);
|
||||||
disk_restart_undo_next(signal);
|
disk_restart_undo_next(signal);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1260,10 +1376,20 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn,
|
|||||||
ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
|
ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
|
||||||
for(Uint32 i = 0; i<MAX_FRAG_PER_NODE; i++)
|
for(Uint32 i = 0; i<MAX_FRAG_PER_NODE; i++)
|
||||||
if (tabPtr.p->fragrec[i] != RNIL)
|
if (tabPtr.p->fragrec[i] != RNIL)
|
||||||
disk_restart_undo_lcp(tabPtr.i, tabPtr.p->fragid[i]);
|
disk_restart_undo_lcp(tabPtr.i, tabPtr.p->fragid[i],
|
||||||
|
Fragrecord::UC_CREATE);
|
||||||
disk_restart_undo_next(signal);
|
disk_restart_undo_next(signal);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
case File_formats::Undofile::UNDO_TUP_DROP:
|
||||||
|
jam();
|
||||||
|
case File_formats::Undofile::UNDO_TUP_ALLOC_EXTENT:
|
||||||
|
jam();
|
||||||
|
case File_formats::Undofile::UNDO_TUP_FREE_EXTENT:
|
||||||
|
jam();
|
||||||
|
disk_restart_undo_next(signal);
|
||||||
|
return;
|
||||||
|
|
||||||
case File_formats::Undofile::UNDO_END:
|
case File_formats::Undofile::UNDO_END:
|
||||||
f_undo_done = true;
|
f_undo_done = true;
|
||||||
return;
|
return;
|
||||||
@ -1297,7 +1423,7 @@ Dbtup::disk_restart_undo_next(Signal* signal)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId)
|
Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId, Uint32 flag)
|
||||||
{
|
{
|
||||||
Ptr<Tablerec> tabPtr;
|
Ptr<Tablerec> tabPtr;
|
||||||
tabPtr.i= tableId;
|
tabPtr.i= tableId;
|
||||||
@ -1309,7 +1435,7 @@ Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId)
|
|||||||
getFragmentrec(fragPtr, fragId, tabPtr.p);
|
getFragmentrec(fragPtr, fragId, tabPtr.p);
|
||||||
if (!fragPtr.isNull())
|
if (!fragPtr.isNull())
|
||||||
{
|
{
|
||||||
fragPtr.p->m_undo_complete = true;
|
fragPtr.p->m_undo_complete |= flag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1518,6 +1644,12 @@ Dbtup::disk_restart_alloc_extent(Uint32 tableId, Uint32 fragId,
|
|||||||
if (tabPtr.p->tableStatus == DEFINED)
|
if (tabPtr.p->tableStatus == DEFINED)
|
||||||
{
|
{
|
||||||
getFragmentrec(fragPtr, fragId, tabPtr.p);
|
getFragmentrec(fragPtr, fragId, tabPtr.p);
|
||||||
|
if (fragPtr.p->m_undo_complete & Fragrecord::UC_CREATE)
|
||||||
|
{
|
||||||
|
jam();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!fragPtr.isNull())
|
if (!fragPtr.isNull())
|
||||||
{
|
{
|
||||||
Disk_alloc_info& alloc= fragPtr.p->m_disk_alloc_info;
|
Disk_alloc_info& alloc= fragPtr.p->m_disk_alloc_info;
|
||||||
|
@ -3125,7 +3125,7 @@ Dbtup::nr_delete(Signal* signal, Uint32 senderData,
|
|||||||
disk_page_set_dirty(disk_page);
|
disk_page_set_dirty(disk_page);
|
||||||
|
|
||||||
preq.m_callback.m_callbackFunction =
|
preq.m_callback.m_callbackFunction =
|
||||||
safe_cast(&Dbtup::nr_delete_logbuffer_callback);
|
safe_cast(&Dbtup::nr_delete_log_buffer_callback);
|
||||||
Logfile_client lgman(this, c_lgman, fragPtr.p->m_logfile_group_id);
|
Logfile_client lgman(this, c_lgman, fragPtr.p->m_logfile_group_id);
|
||||||
res= lgman.get_log_buffer(signal, sz, &preq.m_callback);
|
res= lgman.get_log_buffer(signal, sz, &preq.m_callback);
|
||||||
switch(res){
|
switch(res){
|
||||||
@ -3178,7 +3178,7 @@ Dbtup::nr_delete_page_callback(Signal* signal,
|
|||||||
Callback cb;
|
Callback cb;
|
||||||
cb.m_callbackData = userpointer;
|
cb.m_callbackData = userpointer;
|
||||||
cb.m_callbackFunction =
|
cb.m_callbackFunction =
|
||||||
safe_cast(&Dbtup::nr_delete_logbuffer_callback);
|
safe_cast(&Dbtup::nr_delete_log_buffer_callback);
|
||||||
Logfile_client lgman(this, c_lgman, fragPtr.p->m_logfile_group_id);
|
Logfile_client lgman(this, c_lgman, fragPtr.p->m_logfile_group_id);
|
||||||
int res= lgman.get_log_buffer(signal, sz, &cb);
|
int res= lgman.get_log_buffer(signal, sz, &cb);
|
||||||
switch(res){
|
switch(res){
|
||||||
@ -3198,7 +3198,7 @@ Dbtup::nr_delete_page_callback(Signal* signal,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Dbtup::nr_delete_logbuffer_callback(Signal* signal,
|
Dbtup::nr_delete_log_buffer_callback(Signal* signal,
|
||||||
Uint32 userpointer,
|
Uint32 userpointer,
|
||||||
Uint32 unused)
|
Uint32 unused)
|
||||||
{
|
{
|
||||||
|
@ -163,11 +163,12 @@ void Dbtup::execCONTINUEB(Signal* signal)
|
|||||||
break;
|
break;
|
||||||
case ZREL_FRAG:
|
case ZREL_FRAG:
|
||||||
ljam();
|
ljam();
|
||||||
releaseFragment(signal, dataPtr);
|
releaseFragment(signal, dataPtr, signal->theData[2]);
|
||||||
break;
|
break;
|
||||||
case ZREPORT_MEMORY_USAGE:{
|
case ZREPORT_MEMORY_USAGE:{
|
||||||
ljam();
|
ljam();
|
||||||
static int c_currentMemUsed = 0;
|
static int c_currentMemUsed = 0;
|
||||||
|
Uint32 cnt = signal->theData[1];
|
||||||
Uint32 tmp = c_page_pool.getSize();
|
Uint32 tmp = c_page_pool.getSize();
|
||||||
int now = tmp ? (cnoOfAllocatedPages * 100)/tmp : 0;
|
int now = tmp ? (cnoOfAllocatedPages * 100)/tmp : 0;
|
||||||
const int thresholds[] = { 100, 90, 80, 0 };
|
const int thresholds[] = { 100, 90, 80, 0 };
|
||||||
@ -181,12 +182,22 @@ void Dbtup::execCONTINUEB(Signal* signal)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(now != c_currentMemUsed){
|
if(now != c_currentMemUsed ||
|
||||||
reportMemoryUsage(signal, now > c_currentMemUsed ? 1 : -1);
|
(c_memusage_report_frequency && cnt + 1 == c_memusage_report_frequency))
|
||||||
|
{
|
||||||
|
reportMemoryUsage(signal,
|
||||||
|
now > c_currentMemUsed ? 1 :
|
||||||
|
now < c_currentMemUsed ? -1 : 0);
|
||||||
|
cnt = 0;
|
||||||
c_currentMemUsed = now;
|
c_currentMemUsed = now;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cnt++;
|
||||||
|
}
|
||||||
signal->theData[0] = ZREPORT_MEMORY_USAGE;
|
signal->theData[0] = ZREPORT_MEMORY_USAGE;
|
||||||
sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 2000, 1);
|
signal->theData[1] = cnt;
|
||||||
|
sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 1000, 2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case ZBUILD_INDEX:
|
case ZBUILD_INDEX:
|
||||||
@ -211,7 +222,7 @@ void Dbtup::execCONTINUEB(Signal* signal)
|
|||||||
fragPtr.i= signal->theData[2];
|
fragPtr.i= signal->theData[2];
|
||||||
ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
|
ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
|
||||||
ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
|
ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
|
||||||
drop_fragment_free_exent(signal, tabPtr, fragPtr, signal->theData[3]);
|
drop_fragment_free_extent(signal, tabPtr, fragPtr, signal->theData[3]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case ZUNMAP_PAGES:
|
case ZUNMAP_PAGES:
|
||||||
@ -336,6 +347,10 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal)
|
|||||||
clastBitMask = 1;
|
clastBitMask = 1;
|
||||||
clastBitMask = clastBitMask << 31;
|
clastBitMask = clastBitMask << 31;
|
||||||
|
|
||||||
|
c_memusage_report_frequency = 0;
|
||||||
|
ndb_mgm_get_int_parameter(p, CFG_DB_MEMREPORT_FREQUENCY,
|
||||||
|
&c_memusage_report_frequency);
|
||||||
|
|
||||||
initialiseRecordsLab(signal, 0, ref, senderData);
|
initialiseRecordsLab(signal, 0, ref, senderData);
|
||||||
}//Dbtup::execSIZEALT_REP()
|
}//Dbtup::execSIZEALT_REP()
|
||||||
|
|
||||||
@ -501,7 +516,8 @@ void Dbtup::execNDB_STTOR(Signal* signal)
|
|||||||
/* RESTART. */
|
/* RESTART. */
|
||||||
/*****************************************/
|
/*****************************************/
|
||||||
signal->theData[0] = ZREPORT_MEMORY_USAGE;
|
signal->theData[0] = ZREPORT_MEMORY_USAGE;
|
||||||
sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 2000, 1);
|
signal->theData[1] = 0;
|
||||||
|
sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 1000, 1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ljam();
|
ljam();
|
||||||
|
@ -308,6 +308,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal)
|
|||||||
|
|
||||||
if(lastAttr)
|
if(lastAttr)
|
||||||
{
|
{
|
||||||
|
jam();
|
||||||
/**
|
/**
|
||||||
* Init Disk_alloc_info
|
* Init Disk_alloc_info
|
||||||
*/
|
*/
|
||||||
@ -319,6 +320,11 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal)
|
|||||||
ndbrequire(tsman.get_tablespace_info(&rep) == 0);
|
ndbrequire(tsman.get_tablespace_info(&rep) == 0);
|
||||||
regFragPtr.p->m_logfile_group_id= rep.tablespace.logfile_group_id;
|
regFragPtr.p->m_logfile_group_id= rep.tablespace.logfile_group_id;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jam();
|
||||||
|
regFragPtr.p->m_logfile_group_id = RNIL;
|
||||||
|
}
|
||||||
new (®FragPtr.p->m_disk_alloc_info)
|
new (®FragPtr.p->m_disk_alloc_info)
|
||||||
Disk_alloc_info(regTabPtr.p, rep.tablespace.extent_size);
|
Disk_alloc_info(regTabPtr.p, rep.tablespace.extent_size);
|
||||||
releaseFragoperrec(fragOperPtr);
|
releaseFragoperrec(fragOperPtr);
|
||||||
@ -564,6 +570,11 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal)
|
|||||||
ndbrequire(tsman.get_tablespace_info(&rep) == 0);
|
ndbrequire(tsman.get_tablespace_info(&rep) == 0);
|
||||||
regFragPtr.p->m_logfile_group_id= rep.tablespace.logfile_group_id;
|
regFragPtr.p->m_logfile_group_id= rep.tablespace.logfile_group_id;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jam();
|
||||||
|
regFragPtr.p->m_logfile_group_id = RNIL;
|
||||||
|
}
|
||||||
|
|
||||||
new (®FragPtr.p->m_disk_alloc_info)
|
new (®FragPtr.p->m_disk_alloc_info)
|
||||||
Disk_alloc_info(regTabPtr.p, rep.tablespace.extent_size);
|
Disk_alloc_info(regTabPtr.p, rep.tablespace.extent_size);
|
||||||
@ -596,7 +607,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal)
|
|||||||
ndbrequire("NOT YET IMPLEMENTED" == 0);
|
ndbrequire("NOT YET IMPLEMENTED" == 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
execute(signal, cb, 0);
|
execute(signal, cb, regFragPtr.p->m_logfile_group_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -873,7 +884,8 @@ Dbtup::execDROP_TAB_REQ(Signal* signal)
|
|||||||
|
|
||||||
signal->theData[0]= ZREL_FRAG;
|
signal->theData[0]= ZREL_FRAG;
|
||||||
signal->theData[1]= tabPtr.i;
|
signal->theData[1]= tabPtr.i;
|
||||||
sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB);
|
signal->theData[2]= RNIL;
|
||||||
|
sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dbtup::releaseTabDescr(Tablerec* const regTabPtr)
|
void Dbtup::releaseTabDescr(Tablerec* const regTabPtr)
|
||||||
@ -901,7 +913,8 @@ void Dbtup::releaseTabDescr(Tablerec* const regTabPtr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dbtup::releaseFragment(Signal* signal, Uint32 tableId)
|
void Dbtup::releaseFragment(Signal* signal, Uint32 tableId,
|
||||||
|
Uint32 logfile_group_id)
|
||||||
{
|
{
|
||||||
TablerecPtr tabPtr;
|
TablerecPtr tabPtr;
|
||||||
tabPtr.i= tableId;
|
tabPtr.i= tableId;
|
||||||
@ -929,15 +942,34 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DropTabConf * const dropConf= (DropTabConf *)signal->getDataPtrSend();
|
#if NOT_YET_UNDO_DROP_TABLE
|
||||||
dropConf->senderRef= reference();
|
#error "This code is complete, but I prefer not to enable it until I need it"
|
||||||
dropConf->senderData= tabPtr.p->m_dropTable.tabUserPtr;
|
if (logfile_group_id != RNIL)
|
||||||
dropConf->tableId= tabPtr.i;
|
{
|
||||||
sendSignal(tabPtr.p->m_dropTable.tabUserRef, GSN_DROP_TAB_CONF,
|
Callback cb;
|
||||||
signal, DropTabConf::SignalLength, JBB);
|
cb.m_callbackData= tabPtr.i;
|
||||||
|
cb.m_callbackFunction =
|
||||||
|
safe_cast(&Dbtup::drop_table_log_buffer_callback);
|
||||||
|
Uint32 sz= sizeof(Disk_undo::Drop) >> 2;
|
||||||
|
int r0 = c_lgman->alloc_log_space(logfile_group_id, sz);
|
||||||
|
|
||||||
releaseTabDescr(tabPtr.p);
|
Logfile_client lgman(this, c_lgman, logfile_group_id);
|
||||||
initTab(tabPtr.p);
|
int res= lgman.get_log_buffer(signal, sz, &cb);
|
||||||
|
switch(res){
|
||||||
|
case 0:
|
||||||
|
ljam();
|
||||||
|
return;
|
||||||
|
case -1:
|
||||||
|
ndbrequire("NOT YET IMPLEMENTED" == 0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
execute(signal, cb, logfile_group_id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
drop_table_logsync_callback(signal, tabPtr.i, RNIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -964,7 +996,7 @@ Dbtup::drop_fragment_unmap_pages(Signal *signal,
|
|||||||
alloc_info.m_curr_extent_info_ptr_i= RNIL;
|
alloc_info.m_curr_extent_info_ptr_i= RNIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
drop_fragment_free_exent(signal, tabPtr, fragPtr, 0);
|
drop_fragment_free_extent(signal, tabPtr, fragPtr, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -997,7 +1029,7 @@ Dbtup::drop_fragment_unmap_pages(Signal *signal,
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
drop_fragment_free_exent(signal, tabPtr, fragPtr, 0);
|
drop_fragment_free_extent(signal, tabPtr, fragPtr, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1030,7 +1062,7 @@ Dbtup::drop_fragment_unmap_page_callback(Signal* signal,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Dbtup::drop_fragment_free_exent(Signal *signal,
|
Dbtup::drop_fragment_free_extent(Signal *signal,
|
||||||
TablerecPtr tabPtr,
|
TablerecPtr tabPtr,
|
||||||
FragrecordPtr fragPtr,
|
FragrecordPtr fragPtr,
|
||||||
Uint32 pos)
|
Uint32 pos)
|
||||||
@ -1043,25 +1075,32 @@ Dbtup::drop_fragment_free_exent(Signal *signal,
|
|||||||
if(!alloc_info.m_free_extents[pos].isEmpty())
|
if(!alloc_info.m_free_extents[pos].isEmpty())
|
||||||
{
|
{
|
||||||
jam();
|
jam();
|
||||||
Local_extent_info_list
|
Callback cb;
|
||||||
list(c_extent_pool, alloc_info.m_free_extents[pos]);
|
cb.m_callbackData= fragPtr.i;
|
||||||
Ptr<Extent_info> ext_ptr;
|
cb.m_callbackFunction =
|
||||||
list.first(ext_ptr);
|
safe_cast(&Dbtup::drop_fragment_free_extent_log_buffer_callback);
|
||||||
|
#if NOT_YET_UNDO_FREE_EXTENT
|
||||||
|
Uint32 sz= sizeof(Disk_undo::FreeExtent) >> 2;
|
||||||
|
int r0 = c_lgman->alloc_log_space(fragPtr.p->m_logfile_group_id, sz);
|
||||||
|
|
||||||
Tablespace_client tsman(signal, c_tsman, tabPtr.i,
|
Logfile_client lgman(this, c_lgman, fragPtr.p->m_logfile_group_id);
|
||||||
fragPtr.p->fragmentId,
|
|
||||||
fragPtr.p->m_tablespace_id);
|
|
||||||
|
|
||||||
tsman.free_extent(&ext_ptr.p->m_key);
|
int res= lgman.get_log_buffer(signal, sz, &cb);
|
||||||
c_extent_hash.remove(ext_ptr);
|
switch(res){
|
||||||
list.release(ext_ptr);
|
case 0:
|
||||||
|
ljam();
|
||||||
signal->theData[0] = ZFREE_EXTENT;
|
|
||||||
signal->theData[1] = tabPtr.i;
|
|
||||||
signal->theData[2] = fragPtr.i;
|
|
||||||
signal->theData[3] = pos;
|
|
||||||
sendSignal(cownref, GSN_CONTINUEB, signal, 4, JBB);
|
|
||||||
return;
|
return;
|
||||||
|
case -1:
|
||||||
|
ndbrequire("NOT YET IMPLEMENTED" == 0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
execute(signal, cb, fragPtr.p->m_logfile_group_id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
execute(signal, cb, fragPtr.p->m_logfile_group_id);
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1080,6 +1119,123 @@ Dbtup::drop_fragment_free_exent(Signal *signal,
|
|||||||
sendSignal(reference(), GSN_CONTINUEB, signal, 3, JBB);
|
sendSignal(reference(), GSN_CONTINUEB, signal, 3, JBB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Dbtup::drop_table_log_buffer_callback(Signal* signal, Uint32 tablePtrI,
|
||||||
|
Uint32 logfile_group_id)
|
||||||
|
{
|
||||||
|
TablerecPtr tabPtr;
|
||||||
|
tabPtr.i = tablePtrI;
|
||||||
|
ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
|
||||||
|
|
||||||
|
ndbrequire(tabPtr.p->m_no_of_disk_attributes);
|
||||||
|
|
||||||
|
Disk_undo::Drop drop;
|
||||||
|
drop.m_table = tabPtr.i;
|
||||||
|
drop.m_type_length =
|
||||||
|
(Disk_undo::UNDO_DROP << 16) | (sizeof(drop) >> 2);
|
||||||
|
Logfile_client lgman(this, c_lgman, logfile_group_id);
|
||||||
|
|
||||||
|
Logfile_client::Change c[1] = {{ &drop, sizeof(drop) >> 2 } };
|
||||||
|
Uint64 lsn = lgman.add_entry(c, 1);
|
||||||
|
|
||||||
|
Logfile_client::Request req;
|
||||||
|
req.m_callback.m_callbackData= tablePtrI;
|
||||||
|
req.m_callback.m_callbackFunction =
|
||||||
|
safe_cast(&Dbtup::drop_table_logsync_callback);
|
||||||
|
|
||||||
|
int ret = lgman.sync_lsn(signal, lsn, &req, 0);
|
||||||
|
switch(ret){
|
||||||
|
case 0:
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
ndbout_c("ret: %d", ret);
|
||||||
|
ndbrequire(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Dbtup::drop_table_logsync_callback(Signal* signal,
|
||||||
|
Uint32 tabPtrI,
|
||||||
|
Uint32 logfile_group_id)
|
||||||
|
{
|
||||||
|
TablerecPtr tabPtr;
|
||||||
|
tabPtr.i = tabPtrI;
|
||||||
|
ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
|
||||||
|
|
||||||
|
DropTabConf * const dropConf= (DropTabConf *)signal->getDataPtrSend();
|
||||||
|
dropConf->senderRef= reference();
|
||||||
|
dropConf->senderData= tabPtr.p->m_dropTable.tabUserPtr;
|
||||||
|
dropConf->tableId= tabPtr.i;
|
||||||
|
sendSignal(tabPtr.p->m_dropTable.tabUserRef, GSN_DROP_TAB_CONF,
|
||||||
|
signal, DropTabConf::SignalLength, JBB);
|
||||||
|
|
||||||
|
releaseTabDescr(tabPtr.p);
|
||||||
|
initTab(tabPtr.p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Dbtup::drop_fragment_free_extent_log_buffer_callback(Signal* signal,
|
||||||
|
Uint32 fragPtrI,
|
||||||
|
Uint32 unused)
|
||||||
|
{
|
||||||
|
FragrecordPtr fragPtr;
|
||||||
|
fragPtr.i = fragPtrI;
|
||||||
|
ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
|
||||||
|
|
||||||
|
TablerecPtr tabPtr;
|
||||||
|
tabPtr.i = fragPtr.p->fragTableId;
|
||||||
|
ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
|
||||||
|
|
||||||
|
ndbrequire(tabPtr.p->m_no_of_disk_attributes);
|
||||||
|
Disk_alloc_info& alloc_info= fragPtr.p->m_disk_alloc_info;
|
||||||
|
|
||||||
|
for(Uint32 pos = 0; pos<EXTENT_SEARCH_MATRIX_SIZE; pos++)
|
||||||
|
{
|
||||||
|
if(!alloc_info.m_free_extents[pos].isEmpty())
|
||||||
|
{
|
||||||
|
jam();
|
||||||
|
Local_extent_info_list
|
||||||
|
list(c_extent_pool, alloc_info.m_free_extents[pos]);
|
||||||
|
Ptr<Extent_info> ext_ptr;
|
||||||
|
list.first(ext_ptr);
|
||||||
|
|
||||||
|
#if NOT_YET_UNDO_FREE_EXTENT
|
||||||
|
#error "This code is complete"
|
||||||
|
#error "but not needed until we do dealloc of empty extents"
|
||||||
|
Disk_undo::FreeExtent free;
|
||||||
|
free.m_table = tabPtr.i;
|
||||||
|
free.m_fragment = fragPtr.p->fragmentId;
|
||||||
|
free.m_file_no = ext_ptr.p->m_key.m_file_no;
|
||||||
|
free.m_page_no = ext_ptr.p->m_key.m_page_no;
|
||||||
|
free.m_type_length =
|
||||||
|
(Disk_undo::UNDO_FREE_EXTENT << 16) | (sizeof(free) >> 2);
|
||||||
|
Logfile_client lgman(this, c_lgman, fragPtr.p->m_logfile_group_id);
|
||||||
|
|
||||||
|
Logfile_client::Change c[1] = {{ &free, sizeof(free) >> 2 } };
|
||||||
|
Uint64 lsn = lgman.add_entry(c, 1);
|
||||||
|
#else
|
||||||
|
Uint64 lsn = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Tablespace_client tsman(signal, c_tsman, tabPtr.i,
|
||||||
|
fragPtr.p->fragmentId,
|
||||||
|
fragPtr.p->m_tablespace_id);
|
||||||
|
|
||||||
|
tsman.free_extent(&ext_ptr.p->m_key, lsn);
|
||||||
|
c_extent_hash.remove(ext_ptr);
|
||||||
|
list.release(ext_ptr);
|
||||||
|
|
||||||
|
signal->theData[0] = ZFREE_EXTENT;
|
||||||
|
signal->theData[1] = tabPtr.i;
|
||||||
|
signal->theData[2] = fragPtr.i;
|
||||||
|
signal->theData[3] = pos;
|
||||||
|
sendSignal(cownref, GSN_CONTINUEB, signal, 4, JBB);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ndbrequire(false);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Dbtup::drop_fragment_free_var_pages(Signal* signal)
|
Dbtup::drop_fragment_free_var_pages(Signal* signal)
|
||||||
{
|
{
|
||||||
@ -1111,7 +1267,7 @@ Dbtup::drop_fragment_free_var_pages(Signal* signal)
|
|||||||
sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
|
sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Uint32 logfile_group_id = fragPtr.p->m_logfile_group_id ;
|
||||||
releaseFragPages(fragPtr.p);
|
releaseFragPages(fragPtr.p);
|
||||||
Uint32 i;
|
Uint32 i;
|
||||||
for(i= 0; i<MAX_FRAG_PER_NODE; i++)
|
for(i= 0; i<MAX_FRAG_PER_NODE; i++)
|
||||||
@ -1125,7 +1281,8 @@ Dbtup::drop_fragment_free_var_pages(Signal* signal)
|
|||||||
|
|
||||||
signal->theData[0]= ZREL_FRAG;
|
signal->theData[0]= ZREL_FRAG;
|
||||||
signal->theData[1]= tabPtr.i;
|
signal->theData[1]= tabPtr.i;
|
||||||
sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB);
|
signal->theData[2]= logfile_group_id;
|
||||||
|
sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,6 +784,7 @@ int Dbtup::updateAttributes(KeyReqStruct *req_struct,
|
|||||||
memcpy(req_struct->m_tuple_ptr->get_disk_ref_ptr(regTabPtr),
|
memcpy(req_struct->m_tuple_ptr->get_disk_ref_ptr(regTabPtr),
|
||||||
inBuffer+inBufIndex+1, sz << 2);
|
inBuffer+inBufIndex+1, sz << 2);
|
||||||
inBufIndex += 1 + sz;
|
inBufIndex += 1 + sz;
|
||||||
|
req_struct->in_buf_index = inBufIndex;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -53,8 +53,7 @@ Dbtup::execACC_SCANREQ(Signal* signal)
|
|||||||
// flags
|
// flags
|
||||||
Uint32 bits = 0;
|
Uint32 bits = 0;
|
||||||
|
|
||||||
if (!AccScanReq::getLcpScanFlag(req->requestInfo) ||
|
if (!AccScanReq::getLcpScanFlag(req->requestInfo))
|
||||||
tablePtr.p->m_no_of_disk_attributes == 0)
|
|
||||||
{
|
{
|
||||||
// seize from pool and link to per-fragment list
|
// seize from pool and link to per-fragment list
|
||||||
LocalDLList<ScanOp> list(c_scanOpPool, frag.m_scanList);
|
LocalDLList<ScanOp> list(c_scanOpPool, frag.m_scanList);
|
||||||
@ -1051,8 +1050,6 @@ Dbtup::execLCP_FRAG_ORD(Signal* signal)
|
|||||||
tablePtr.i = req->tableId;
|
tablePtr.i = req->tableId;
|
||||||
ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
|
ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
|
||||||
|
|
||||||
if(tablePtr.p->m_no_of_disk_attributes)
|
|
||||||
{
|
|
||||||
jam();
|
jam();
|
||||||
FragrecordPtr fragPtr;
|
FragrecordPtr fragPtr;
|
||||||
Uint32 fragId = req->fragmentId;
|
Uint32 fragId = req->fragmentId;
|
||||||
@ -1070,5 +1067,4 @@ Dbtup::execLCP_FRAG_ORD(Signal* signal)
|
|||||||
|
|
||||||
scanFirst(signal, scanPtr);
|
scanFirst(signal, scanPtr);
|
||||||
scanPtr.p->m_state = ScanOp::First;
|
scanPtr.p->m_state = ScanOp::First;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -154,6 +154,9 @@ struct File_formats
|
|||||||
,UNDO_TUP_UPDATE = 4
|
,UNDO_TUP_UPDATE = 4
|
||||||
,UNDO_TUP_FREE = 5
|
,UNDO_TUP_FREE = 5
|
||||||
,UNDO_TUP_CREATE = 6
|
,UNDO_TUP_CREATE = 6
|
||||||
|
,UNDO_TUP_DROP = 7
|
||||||
|
,UNDO_TUP_ALLOC_EXTENT = 8
|
||||||
|
,UNDO_TUP_FREE_EXTENT = 9
|
||||||
|
|
||||||
,UNDO_END = 0x7FFF
|
,UNDO_END = 0x7FFF
|
||||||
,UNDO_NEXT_LSN = 0x8000
|
,UNDO_NEXT_LSN = 0x8000
|
||||||
|
@ -1160,13 +1160,14 @@ Lgman::process_log_sync_waiters(Signal* signal, Ptr<Logfile_group> ptr)
|
|||||||
bool removed= false;
|
bool removed= false;
|
||||||
Ptr<Log_waiter> waiter;
|
Ptr<Log_waiter> waiter;
|
||||||
list.first(waiter);
|
list.first(waiter);
|
||||||
|
Uint32 logfile_group_id = ptr.p->m_logfile_group_id;
|
||||||
|
|
||||||
if(waiter.p->m_sync_lsn <= ptr.p->m_last_synced_lsn)
|
if(waiter.p->m_sync_lsn <= ptr.p->m_last_synced_lsn)
|
||||||
{
|
{
|
||||||
removed= true;
|
removed= true;
|
||||||
Uint32 block = waiter.p->m_block;
|
Uint32 block = waiter.p->m_block;
|
||||||
SimulatedBlock* b = globalData.getBlock(block);
|
SimulatedBlock* b = globalData.getBlock(block);
|
||||||
b->execute(signal, waiter.p->m_callback, 0);
|
b->execute(signal, waiter.p->m_callback, logfile_group_id);
|
||||||
|
|
||||||
list.releaseFirst(waiter);
|
list.releaseFirst(waiter);
|
||||||
}
|
}
|
||||||
@ -1522,12 +1523,13 @@ Lgman::process_log_buffer_waiters(Signal* signal, Ptr<Logfile_group> ptr)
|
|||||||
bool removed= false;
|
bool removed= false;
|
||||||
Ptr<Log_waiter> waiter;
|
Ptr<Log_waiter> waiter;
|
||||||
list.first(waiter);
|
list.first(waiter);
|
||||||
|
Uint32 logfile_group_id = ptr.p->m_logfile_group_id;
|
||||||
if(waiter.p->m_size + 2*File_formats::UNDO_PAGE_WORDS < free_buffer)
|
if(waiter.p->m_size + 2*File_formats::UNDO_PAGE_WORDS < free_buffer)
|
||||||
{
|
{
|
||||||
removed= true;
|
removed= true;
|
||||||
Uint32 block = waiter.p->m_block;
|
Uint32 block = waiter.p->m_block;
|
||||||
SimulatedBlock* b = globalData.getBlock(block);
|
SimulatedBlock* b = globalData.getBlock(block);
|
||||||
b->execute(signal, waiter.p->m_callback, 0);
|
b->execute(signal, waiter.p->m_callback, logfile_group_id);
|
||||||
|
|
||||||
list.releaseFirst(waiter);
|
list.releaseFirst(waiter);
|
||||||
}
|
}
|
||||||
@ -2061,6 +2063,7 @@ Lgman::execSTART_RECREQ(Signal* signal)
|
|||||||
if(ptr.i != RNIL)
|
if(ptr.i != RNIL)
|
||||||
{
|
{
|
||||||
infoEvent("Applying undo to LCP: %d", m_latest_lcp);
|
infoEvent("Applying undo to LCP: %d", m_latest_lcp);
|
||||||
|
ndbout_c("Applying undo to LCP: %d", m_latest_lcp);
|
||||||
find_log_head(signal, ptr);
|
find_log_head(signal, ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2680,13 +2683,14 @@ Lgman::execute_undo_record(Signal* signal)
|
|||||||
case File_formats::Undofile::UNDO_LCP_FIRST:
|
case File_formats::Undofile::UNDO_LCP_FIRST:
|
||||||
{
|
{
|
||||||
Uint32 lcp = * (ptr - len + 1);
|
Uint32 lcp = * (ptr - len + 1);
|
||||||
if(lcp > m_latest_lcp)
|
if(m_latest_lcp && lcp > m_latest_lcp)
|
||||||
{
|
{
|
||||||
// Just ignore
|
// Just ignore
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lcp < m_latest_lcp ||
|
if(m_latest_lcp == 0 ||
|
||||||
|
lcp < m_latest_lcp ||
|
||||||
(lcp == m_latest_lcp &&
|
(lcp == m_latest_lcp &&
|
||||||
mask == File_formats::Undofile::UNDO_LCP_FIRST))
|
mask == File_formats::Undofile::UNDO_LCP_FIRST))
|
||||||
{
|
{
|
||||||
@ -2699,6 +2703,9 @@ Lgman::execute_undo_record(Signal* signal)
|
|||||||
case File_formats::Undofile::UNDO_TUP_UPDATE:
|
case File_formats::Undofile::UNDO_TUP_UPDATE:
|
||||||
case File_formats::Undofile::UNDO_TUP_FREE:
|
case File_formats::Undofile::UNDO_TUP_FREE:
|
||||||
case File_formats::Undofile::UNDO_TUP_CREATE:
|
case File_formats::Undofile::UNDO_TUP_CREATE:
|
||||||
|
case File_formats::Undofile::UNDO_TUP_DROP:
|
||||||
|
case File_formats::Undofile::UNDO_TUP_ALLOC_EXTENT:
|
||||||
|
case File_formats::Undofile::UNDO_TUP_FREE_EXTENT:
|
||||||
tup->disk_restart_undo(signal, lsn, mask, ptr - len + 1, len);
|
tup->disk_restart_undo(signal, lsn, mask, ptr - len + 1, len);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
|
@ -304,6 +304,8 @@ print_undo_page(int count, void* ptr, Uint32 sz){
|
|||||||
case File_formats::Undofile::UNDO_LCP:
|
case File_formats::Undofile::UNDO_LCP:
|
||||||
printf("[ %lld LCP %d tab: %d frag: %d ]", lsn,
|
printf("[ %lld LCP %d tab: %d frag: %d ]", lsn,
|
||||||
src[0], src[1] >> 16, src[1] & 0xFFFF);
|
src[0], src[1] >> 16, src[1] & 0xFFFF);
|
||||||
|
if(g_verbosity <= 3)
|
||||||
|
printf("\n");
|
||||||
break;
|
break;
|
||||||
case File_formats::Undofile::UNDO_TUP_ALLOC:
|
case File_formats::Undofile::UNDO_TUP_ALLOC:
|
||||||
if(g_verbosity > 3)
|
if(g_verbosity > 3)
|
||||||
@ -340,6 +342,48 @@ print_undo_page(int count, void* ptr, Uint32 sz){
|
|||||||
req->m_gci);
|
req->m_gci);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case File_formats::Undofile::UNDO_TUP_CREATE:
|
||||||
|
{
|
||||||
|
Dbtup::Disk_undo::Create *req = (Dbtup::Disk_undo::Create*)src;
|
||||||
|
printf("[ %lld Create %d ]", lsn, req->m_table);
|
||||||
|
if(g_verbosity <= 3)
|
||||||
|
printf("\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case File_formats::Undofile::UNDO_TUP_DROP:
|
||||||
|
{
|
||||||
|
Dbtup::Disk_undo::Drop *req = (Dbtup::Disk_undo::Drop*)src;
|
||||||
|
printf("[ %lld Drop %d ]", lsn, req->m_table);
|
||||||
|
if(g_verbosity <= 3)
|
||||||
|
printf("\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case File_formats::Undofile::UNDO_TUP_ALLOC_EXTENT:
|
||||||
|
{
|
||||||
|
Dbtup::Disk_undo::AllocExtent *req = (Dbtup::Disk_undo::AllocExtent*)src;
|
||||||
|
printf("[ %lld AllocExtent tab: %d frag: %d file: %d page: %d ]",
|
||||||
|
lsn,
|
||||||
|
req->m_table,
|
||||||
|
req->m_fragment,
|
||||||
|
req->m_file_no,
|
||||||
|
req->m_page_no);
|
||||||
|
if(g_verbosity <= 3)
|
||||||
|
printf("\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case File_formats::Undofile::UNDO_TUP_FREE_EXTENT:
|
||||||
|
{
|
||||||
|
Dbtup::Disk_undo::FreeExtent *req = (Dbtup::Disk_undo::FreeExtent*)src;
|
||||||
|
printf("[ %lld FreeExtent tab: %d frag: %d file: %d page: %d ]",
|
||||||
|
lsn,
|
||||||
|
req->m_table,
|
||||||
|
req->m_fragment,
|
||||||
|
req->m_file_no,
|
||||||
|
req->m_page_no);
|
||||||
|
if(g_verbosity <= 3)
|
||||||
|
printf("\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
ndbout_c("[ Unknown type %d len: %d, pos: %d ]", type, len, pos);
|
ndbout_c("[ Unknown type %d len: %d, pos: %d ]", type, len, pos);
|
||||||
if(!(len && type))
|
if(!(len && type))
|
||||||
|
@ -79,12 +79,14 @@ Tsman::Tsman(Block_context& ctx,
|
|||||||
|
|
||||||
addRecSignal(GSN_START_RECREQ, &Tsman::execSTART_RECREQ);
|
addRecSignal(GSN_START_RECREQ, &Tsman::execSTART_RECREQ);
|
||||||
|
|
||||||
|
addRecSignal(GSN_LCP_FRAG_ORD, &Tsman::execLCP_FRAG_ORD);
|
||||||
addRecSignal(GSN_END_LCP_REQ, &Tsman::execEND_LCP_REQ);
|
addRecSignal(GSN_END_LCP_REQ, &Tsman::execEND_LCP_REQ);
|
||||||
|
|
||||||
addRecSignal(GSN_GET_TABINFOREQ, &Tsman::execGET_TABINFOREQ);
|
addRecSignal(GSN_GET_TABINFOREQ, &Tsman::execGET_TABINFOREQ);
|
||||||
|
|
||||||
m_tablespace_hash.setSize(10);
|
m_tablespace_hash.setSize(10);
|
||||||
m_file_hash.setSize(10);
|
m_file_hash.setSize(10);
|
||||||
|
m_lcp_ongoing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Tsman::~Tsman()
|
Tsman::~Tsman()
|
||||||
@ -1101,6 +1103,7 @@ Tsman::load_extent_page_callback(Signal* signal,
|
|||||||
ptr.p->m_online.m_lcp_free_extent_tail = RNIL;
|
ptr.p->m_online.m_lcp_free_extent_tail = RNIL;
|
||||||
ptr.p->m_online.m_data_pages = data_pages;
|
ptr.p->m_online.m_data_pages = data_pages;
|
||||||
ptr.p->m_online.m_used_extent_cnt = 0;
|
ptr.p->m_online.m_used_extent_cnt = 0;
|
||||||
|
ptr.p->m_online.m_extent_headers_per_extent_page = per_page;
|
||||||
|
|
||||||
Ptr<Tablespace> ts_ptr;
|
Ptr<Tablespace> ts_ptr;
|
||||||
m_tablespace_pool.getPtr(ts_ptr, ptr.p->m_tablespace_ptr_i);
|
m_tablespace_pool.getPtr(ts_ptr, ptr.p->m_tablespace_ptr_i);
|
||||||
@ -1182,9 +1185,8 @@ Tsman::scan_extent_headers(Signal* signal, Ptr<Datafile> ptr)
|
|||||||
m_tablespace_pool.getPtr(lg_ptr, ptr.p->m_tablespace_ptr_i);
|
m_tablespace_pool.getPtr(lg_ptr, ptr.p->m_tablespace_ptr_i);
|
||||||
|
|
||||||
Uint32 firstFree= RNIL;
|
Uint32 firstFree= RNIL;
|
||||||
Uint32 size = lg_ptr.p->m_extent_size;
|
Uint32 size = ptr.p->m_extent_size;
|
||||||
Uint32 eh_words = File_formats::Datafile::extent_header_words(size);
|
Uint32 per_page = ptr.p->m_online.m_extent_headers_per_extent_page;
|
||||||
Uint32 per_page = File_formats::Datafile::EXTENT_PAGE_WORDS/eh_words;
|
|
||||||
Uint32 SZ= File_formats::Datafile::EXTENT_HEADER_BITMASK_BITS_PER_PAGE;
|
Uint32 SZ= File_formats::Datafile::EXTENT_HEADER_BITMASK_BITS_PER_PAGE;
|
||||||
Uint32 pages= ptr.p->m_online.m_offset_data_pages - 1;
|
Uint32 pages= ptr.p->m_online.m_offset_data_pages - 1;
|
||||||
Uint32 datapages= ptr.p->m_online.m_data_pages;
|
Uint32 datapages= ptr.p->m_online.m_data_pages;
|
||||||
@ -1410,23 +1412,21 @@ Tsman::execALLOC_EXTENT_REQ(Signal* signal)
|
|||||||
AllocExtentReq::ErrorCode err;
|
AllocExtentReq::ErrorCode err;
|
||||||
|
|
||||||
ndbrequire(m_tablespace_hash.find(ts_ptr, req.request.tablespace_id));
|
ndbrequire(m_tablespace_hash.find(ts_ptr, req.request.tablespace_id));
|
||||||
Uint32 size = ts_ptr.p->m_extent_size;
|
|
||||||
Local_datafile_list tmp(m_file_pool, ts_ptr.p->m_free_files);
|
Local_datafile_list tmp(m_file_pool, ts_ptr.p->m_free_files);
|
||||||
|
|
||||||
if (tmp.first(file_ptr))
|
if (tmp.first(file_ptr))
|
||||||
{
|
{
|
||||||
Uint32 eh_words = File_formats::Datafile::extent_header_words(size);
|
Uint32 size = file_ptr.p->m_extent_size;
|
||||||
Uint32 per_page = File_formats::Datafile::EXTENT_PAGE_WORDS/eh_words;
|
|
||||||
|
|
||||||
Uint32 extent = file_ptr.p->m_online.m_first_free_extent;
|
Uint32 extent = file_ptr.p->m_online.m_first_free_extent;
|
||||||
Uint32 data_off = file_ptr.p->m_online.m_offset_data_pages;
|
Uint32 data_off = file_ptr.p->m_online.m_offset_data_pages;
|
||||||
|
Uint32 eh_words = File_formats::Datafile::extent_header_words(size);
|
||||||
|
Uint32 per_page = File_formats::Datafile::EXTENT_PAGE_WORDS/eh_words;
|
||||||
Uint32 page_no = extent / per_page;
|
Uint32 page_no = extent / per_page;
|
||||||
Uint32 extent_no = extent % per_page;
|
Uint32 extent_no = extent % per_page;
|
||||||
|
|
||||||
Page_cache_client::Request preq;
|
Page_cache_client::Request preq;
|
||||||
preq.m_page.m_page_no = page_no;
|
preq.m_page.m_page_no = page_no;
|
||||||
preq.m_page.m_file_no = file_ptr.p->m_file_no;
|
preq.m_page.m_file_no = file_ptr.p->m_file_no;
|
||||||
preq.m_page.m_page_idx = extent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handling of unmapped extent header pages is not implemented
|
* Handling of unmapped extent header pages is not implemented
|
||||||
@ -1470,6 +1470,7 @@ Tsman::execALLOC_EXTENT_REQ(Signal* signal)
|
|||||||
*/
|
*/
|
||||||
ndbassert(extent >= per_page);
|
ndbassert(extent >= per_page);
|
||||||
preq.m_page.m_page_no = data_off + size * (extent - /* zero */ per_page);
|
preq.m_page.m_page_no = data_off + size * (extent - /* zero */ per_page);
|
||||||
|
preq.m_page.m_page_idx = extent; // extent_no
|
||||||
|
|
||||||
AllocExtentReq* rep = (AllocExtentReq*)signal->getDataPtr();
|
AllocExtentReq* rep = (AllocExtentReq*)signal->getDataPtr();
|
||||||
rep->reply.errorCode = 0;
|
rep->reply.errorCode = 0;
|
||||||
@ -1501,28 +1502,21 @@ void
|
|||||||
Tsman::execFREE_EXTENT_REQ(Signal* signal)
|
Tsman::execFREE_EXTENT_REQ(Signal* signal)
|
||||||
{
|
{
|
||||||
jamEntry();
|
jamEntry();
|
||||||
Ptr<Tablespace> ts_ptr;
|
|
||||||
Ptr<Datafile> file_ptr;
|
Ptr<Datafile> file_ptr;
|
||||||
FreeExtentReq req = *(FreeExtentReq*)signal->getDataPtr();
|
FreeExtentReq req = *(FreeExtentReq*)signal->getDataPtr();
|
||||||
FreeExtentReq::ErrorCode err = (FreeExtentReq::ErrorCode)0;
|
FreeExtentReq::ErrorCode err = (FreeExtentReq::ErrorCode)0;
|
||||||
|
|
||||||
ndbrequire(m_tablespace_hash.find(ts_ptr, req.request.tablespace_id));
|
|
||||||
Datafile file_key;
|
Datafile file_key;
|
||||||
file_key.m_file_no = req.request.key.m_file_no;
|
file_key.m_file_no = req.request.key.m_file_no;
|
||||||
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
||||||
Uint32 size = ts_ptr.p->m_extent_size;
|
|
||||||
|
|
||||||
Uint32 eh_words = File_formats::Datafile::extent_header_words(size);
|
struct req val = lookup_extent(req.request.key.m_page_no, file_ptr.p);
|
||||||
Uint32 per_page = File_formats::Datafile::EXTENT_PAGE_WORDS/eh_words;
|
Uint32 extent =
|
||||||
Uint32 data_off = file_ptr.p->m_online.m_offset_data_pages;
|
(req.request.key.m_page_no - val.m_extent_pages) / val.m_extent_size +
|
||||||
Uint32 extent = (req.request.key.m_page_no - data_off) / size + per_page;
|
file_ptr.p->m_online.m_extent_headers_per_extent_page;
|
||||||
|
|
||||||
|
|
||||||
Uint32 page_no = extent / per_page;
|
|
||||||
Uint32 extent_no = extent % per_page;
|
|
||||||
|
|
||||||
Page_cache_client::Request preq;
|
Page_cache_client::Request preq;
|
||||||
preq.m_page.m_page_no = page_no;
|
preq.m_page.m_page_no = val.m_extent_page_no;
|
||||||
preq.m_page.m_file_no = req.request.key.m_file_no;
|
preq.m_page.m_file_no = req.request.key.m_file_no;
|
||||||
|
|
||||||
ndbout << "Free extent: " << req.request.key << endl;
|
ndbout << "Free extent: " << req.request.key << endl;
|
||||||
@ -1539,16 +1533,38 @@ Tsman::execFREE_EXTENT_REQ(Signal* signal)
|
|||||||
File_formats::Datafile::Extent_page* page =
|
File_formats::Datafile::Extent_page* page =
|
||||||
(File_formats::Datafile::Extent_page*)ptr_p;
|
(File_formats::Datafile::Extent_page*)ptr_p;
|
||||||
File_formats::Datafile::Extent_header* header =
|
File_formats::Datafile::Extent_header* header =
|
||||||
page->get_header(extent_no, size);
|
page->get_header(val.m_extent_no, val.m_extent_size);
|
||||||
|
|
||||||
ndbrequire(header->m_table == req.request.table_id);
|
ndbrequire(header->m_table == req.request.table_id);
|
||||||
header->m_table = RNIL;
|
header->m_table = RNIL;
|
||||||
header->m_next_free_extent= file_ptr.p->m_online.m_lcp_free_extent_head;
|
|
||||||
|
|
||||||
|
file_ptr.p->m_online.m_used_extent_cnt--;
|
||||||
|
if (m_lcp_ongoing)
|
||||||
|
{
|
||||||
|
jam();
|
||||||
|
header->m_next_free_extent= file_ptr.p->m_online.m_lcp_free_extent_head;
|
||||||
if(file_ptr.p->m_online.m_lcp_free_extent_head == RNIL)
|
if(file_ptr.p->m_online.m_lcp_free_extent_head == RNIL)
|
||||||
file_ptr.p->m_online.m_lcp_free_extent_tail= extent;
|
file_ptr.p->m_online.m_lcp_free_extent_tail= extent;
|
||||||
file_ptr.p->m_online.m_lcp_free_extent_head= extent;
|
file_ptr.p->m_online.m_lcp_free_extent_head= extent;
|
||||||
file_ptr.p->m_online.m_used_extent_cnt--;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jam();
|
||||||
|
header->m_next_free_extent = file_ptr.p->m_online.m_first_free_extent;
|
||||||
|
if (file_ptr.p->m_online.m_first_free_extent == RNIL)
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Move from full to free
|
||||||
|
*/
|
||||||
|
Ptr<Tablespace> ptr;
|
||||||
|
m_tablespace_pool.getPtr(ptr, file_ptr.p->m_tablespace_ptr_i);
|
||||||
|
Local_datafile_list free(m_file_pool, ptr.p->m_free_files);
|
||||||
|
Local_datafile_list full(m_file_pool, ptr.p->m_full_files);
|
||||||
|
full.remove(file_ptr);
|
||||||
|
free.add(file_ptr);
|
||||||
|
}
|
||||||
|
file_ptr.p->m_online.m_first_free_extent = extent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1583,18 +1599,10 @@ Tsman::update_page_free_bits(Signal* signal,
|
|||||||
file_key.m_file_no = key->m_file_no;
|
file_key.m_file_no = key->m_file_no;
|
||||||
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
||||||
|
|
||||||
Uint32 size = file_ptr.p->m_extent_size;
|
struct req val = lookup_extent(key->m_page_no, file_ptr.p);
|
||||||
Uint32 data_off = file_ptr.p->m_online.m_offset_data_pages;
|
|
||||||
Uint32 eh_words = File_formats::Datafile::extent_header_words(size);
|
|
||||||
Uint32 per_page = File_formats::Datafile::EXTENT_PAGE_WORDS/eh_words;
|
|
||||||
Uint32 SZ= File_formats::Datafile::EXTENT_HEADER_BITMASK_BITS_PER_PAGE;
|
|
||||||
|
|
||||||
Uint32 extent = (key->m_page_no - data_off) / size + per_page;
|
|
||||||
Uint32 page_no = extent / per_page;
|
|
||||||
Uint32 extent_no = extent % per_page;
|
|
||||||
|
|
||||||
Page_cache_client::Request preq;
|
Page_cache_client::Request preq;
|
||||||
preq.m_page.m_page_no = page_no;
|
preq.m_page.m_page_no = val.m_extent_page_no;
|
||||||
preq.m_page.m_file_no = key->m_file_no;
|
preq.m_page.m_file_no = key->m_file_no;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1609,11 +1617,11 @@ Tsman::update_page_free_bits(Signal* signal,
|
|||||||
File_formats::Datafile::Extent_page* page =
|
File_formats::Datafile::Extent_page* page =
|
||||||
(File_formats::Datafile::Extent_page*)ptr_p;
|
(File_formats::Datafile::Extent_page*)ptr_p;
|
||||||
File_formats::Datafile::Extent_header* header =
|
File_formats::Datafile::Extent_header* header =
|
||||||
page->get_header(extent_no, size);
|
page->get_header(val.m_extent_no, val.m_extent_size);
|
||||||
|
|
||||||
ndbrequire(header->m_table != RNIL);
|
ndbrequire(header->m_table != RNIL);
|
||||||
|
|
||||||
Uint32 page_no_in_extent = (key->m_page_no - data_off) % size;
|
Uint32 page_no_in_extent = calc_page_no_in_extent(key->m_page_no, &val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle word
|
* Toggle word
|
||||||
@ -1637,26 +1645,15 @@ Tsman::get_page_free_bits(Signal* signal, Local_key *key,
|
|||||||
{
|
{
|
||||||
jamEntry();
|
jamEntry();
|
||||||
|
|
||||||
/**
|
|
||||||
* XXX make into subroutine
|
|
||||||
*/
|
|
||||||
Ptr<Datafile> file_ptr;
|
Ptr<Datafile> file_ptr;
|
||||||
Datafile file_key;
|
Datafile file_key;
|
||||||
file_key.m_file_no = key->m_file_no;
|
file_key.m_file_no = key->m_file_no;
|
||||||
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
||||||
|
|
||||||
Uint32 size = file_ptr.p->m_extent_size;
|
struct req val = lookup_extent(key->m_page_no, file_ptr.p);
|
||||||
Uint32 data_off = file_ptr.p->m_online.m_offset_data_pages;
|
|
||||||
Uint32 eh_words = File_formats::Datafile::extent_header_words(size);
|
|
||||||
Uint32 per_page = File_formats::Datafile::EXTENT_PAGE_WORDS/eh_words;
|
|
||||||
Uint32 SZ= File_formats::Datafile::EXTENT_HEADER_BITMASK_BITS_PER_PAGE;
|
|
||||||
|
|
||||||
Uint32 extent = (key->m_page_no - data_off) / size + per_page;
|
|
||||||
Uint32 page_no = extent / per_page;
|
|
||||||
Uint32 extent_no = extent % per_page;
|
|
||||||
|
|
||||||
Page_cache_client::Request preq;
|
Page_cache_client::Request preq;
|
||||||
preq.m_page.m_page_no = page_no;
|
preq.m_page.m_page_no = val.m_extent_page_no;
|
||||||
preq.m_page.m_file_no = key->m_file_no;
|
preq.m_page.m_file_no = key->m_file_no;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1671,11 +1668,11 @@ Tsman::get_page_free_bits(Signal* signal, Local_key *key,
|
|||||||
File_formats::Datafile::Extent_page* page =
|
File_formats::Datafile::Extent_page* page =
|
||||||
(File_formats::Datafile::Extent_page*)ptr_p;
|
(File_formats::Datafile::Extent_page*)ptr_p;
|
||||||
File_formats::Datafile::Extent_header* header =
|
File_formats::Datafile::Extent_header* header =
|
||||||
page->get_header(extent_no, size);
|
page->get_header(val.m_extent_no, val.m_extent_size);
|
||||||
|
|
||||||
ndbrequire(header->m_table != RNIL);
|
ndbrequire(header->m_table != RNIL);
|
||||||
|
|
||||||
Uint32 page_no_in_extent = (key->m_page_no - data_off) % size;
|
Uint32 page_no_in_extent = calc_page_no_in_extent(key->m_page_no, &val);
|
||||||
Uint32 bits = header->get_free_bits(page_no_in_extent);
|
Uint32 bits = header->get_free_bits(page_no_in_extent);
|
||||||
*uncommitted = (bits & UNCOMMITTED_MASK) >> UNCOMMITTED_SHIFT;
|
*uncommitted = (bits & UNCOMMITTED_MASK) >> UNCOMMITTED_SHIFT;
|
||||||
*committed = (bits & COMMITTED_MASK);
|
*committed = (bits & COMMITTED_MASK);
|
||||||
@ -1701,18 +1698,10 @@ Tsman::unmap_page(Signal* signal, Local_key *key, Uint32 uncommitted_bits)
|
|||||||
file_key.m_file_no = key->m_file_no;
|
file_key.m_file_no = key->m_file_no;
|
||||||
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
||||||
|
|
||||||
Uint32 size = file_ptr.p->m_extent_size;
|
struct req val = lookup_extent(key->m_page_no, file_ptr.p);
|
||||||
Uint32 data_off = file_ptr.p->m_online.m_offset_data_pages;
|
|
||||||
Uint32 eh_words = File_formats::Datafile::extent_header_words(size);
|
|
||||||
Uint32 per_page = File_formats::Datafile::EXTENT_PAGE_WORDS/eh_words;
|
|
||||||
Uint32 SZ= File_formats::Datafile::EXTENT_HEADER_BITMASK_BITS_PER_PAGE;
|
|
||||||
|
|
||||||
Uint32 extent = (key->m_page_no - data_off) / size + per_page;
|
|
||||||
Uint32 page_no = extent / per_page;
|
|
||||||
Uint32 extent_no = extent % per_page;
|
|
||||||
|
|
||||||
Page_cache_client::Request preq;
|
Page_cache_client::Request preq;
|
||||||
preq.m_page.m_page_no = page_no;
|
preq.m_page.m_page_no = val.m_extent_page_no;
|
||||||
preq.m_page.m_file_no = key->m_file_no;
|
preq.m_page.m_file_no = key->m_file_no;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1727,11 +1716,11 @@ Tsman::unmap_page(Signal* signal, Local_key *key, Uint32 uncommitted_bits)
|
|||||||
File_formats::Datafile::Extent_page* page =
|
File_formats::Datafile::Extent_page* page =
|
||||||
(File_formats::Datafile::Extent_page*)ptr_p;
|
(File_formats::Datafile::Extent_page*)ptr_p;
|
||||||
File_formats::Datafile::Extent_header* header =
|
File_formats::Datafile::Extent_header* header =
|
||||||
page->get_header(extent_no, size);
|
page->get_header(val.m_extent_no, val.m_extent_size);
|
||||||
|
|
||||||
ndbrequire(header->m_table != RNIL);
|
ndbrequire(header->m_table != RNIL);
|
||||||
|
|
||||||
Uint32 page_no_in_extent = (key->m_page_no - data_off) % size;
|
Uint32 page_no_in_extent = calc_page_no_in_extent(key->m_page_no, &val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle word
|
* Toggle word
|
||||||
@ -1767,18 +1756,10 @@ Tsman::restart_undo_page_free_bits(Signal* signal,
|
|||||||
file_key.m_file_no = key->m_file_no;
|
file_key.m_file_no = key->m_file_no;
|
||||||
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
||||||
|
|
||||||
Uint32 size = file_ptr.p->m_extent_size;
|
struct req val = lookup_extent(key->m_page_no, file_ptr.p);
|
||||||
Uint32 data_off = file_ptr.p->m_online.m_offset_data_pages;
|
|
||||||
Uint32 eh_words = File_formats::Datafile::extent_header_words(size);
|
|
||||||
Uint32 per_page = File_formats::Datafile::EXTENT_PAGE_WORDS/eh_words;
|
|
||||||
Uint32 SZ= File_formats::Datafile::EXTENT_HEADER_BITMASK_BITS_PER_PAGE;
|
|
||||||
|
|
||||||
Uint32 extent = (key->m_page_no - data_off) / size + per_page;
|
|
||||||
Uint32 page_no = extent / per_page;
|
|
||||||
Uint32 extent_no = extent % per_page;
|
|
||||||
|
|
||||||
Page_cache_client::Request preq;
|
Page_cache_client::Request preq;
|
||||||
preq.m_page.m_page_no = page_no;
|
preq.m_page.m_page_no = val.m_extent_page_no;
|
||||||
preq.m_page.m_file_no = key->m_file_no;
|
preq.m_page.m_file_no = key->m_file_no;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1793,7 +1774,7 @@ Tsman::restart_undo_page_free_bits(Signal* signal,
|
|||||||
File_formats::Datafile::Extent_page* page =
|
File_formats::Datafile::Extent_page* page =
|
||||||
(File_formats::Datafile::Extent_page*)ptr_p;
|
(File_formats::Datafile::Extent_page*)ptr_p;
|
||||||
File_formats::Datafile::Extent_header* header =
|
File_formats::Datafile::Extent_header* header =
|
||||||
page->get_header(extent_no, size);
|
page->get_header(val.m_extent_no, val.m_extent_size);
|
||||||
|
|
||||||
Uint64 lsn = 0;
|
Uint64 lsn = 0;
|
||||||
lsn += page->m_page_header.m_page_lsn_hi; lsn <<= 32;
|
lsn += page->m_page_header.m_page_lsn_hi; lsn <<= 32;
|
||||||
@ -1816,7 +1797,7 @@ Tsman::restart_undo_page_free_bits(Signal* signal,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint32 page_no_in_extent = (key->m_page_no - data_off) % size;
|
Uint32 page_no_in_extent = calc_page_no_in_extent(key->m_page_no, &val);
|
||||||
Uint32 src = header->get_free_bits(page_no_in_extent);
|
Uint32 src = header->get_free_bits(page_no_in_extent);
|
||||||
|
|
||||||
ndbrequire(header->m_table == tableId);
|
ndbrequire(header->m_table == tableId);
|
||||||
@ -1863,16 +1844,10 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
|
|||||||
file_key.m_file_no = req.key.m_file_no;
|
file_key.m_file_no = req.key.m_file_no;
|
||||||
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
ndbrequire(m_file_hash.find(file_ptr, file_key));
|
||||||
|
|
||||||
Uint32 size = file_ptr.p->m_extent_size;
|
struct req val = lookup_extent(req.key.m_page_no, file_ptr.p);
|
||||||
Uint32 data_off = file_ptr.p->m_online.m_offset_data_pages;
|
|
||||||
Uint32 eh_words = File_formats::Datafile::extent_header_words(size);
|
|
||||||
Uint32 per_page = File_formats::Datafile::EXTENT_PAGE_WORDS/eh_words;
|
|
||||||
|
|
||||||
Uint32 extent = (req.key.m_page_no - data_off) / size;
|
|
||||||
Uint32 extent_no = extent % per_page;
|
|
||||||
|
|
||||||
Page_cache_client::Request preq;
|
Page_cache_client::Request preq;
|
||||||
preq.m_page.m_page_no = 1 /* zero */ + extent / per_page;
|
preq.m_page.m_page_no = val.m_extent_page_no;
|
||||||
preq.m_page.m_file_no = req.key.m_file_no;
|
preq.m_page.m_file_no = req.key.m_file_no;
|
||||||
|
|
||||||
Uint32 SZ= File_formats::Datafile::EXTENT_HEADER_BITMASK_BITS_PER_PAGE;
|
Uint32 SZ= File_formats::Datafile::EXTENT_HEADER_BITMASK_BITS_PER_PAGE;
|
||||||
@ -1891,11 +1866,11 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
|
|||||||
|
|
||||||
File_formats::Datafile::Extent_page* page =
|
File_formats::Datafile::Extent_page* page =
|
||||||
(File_formats::Datafile::Extent_page*)ptr_p;
|
(File_formats::Datafile::Extent_page*)ptr_p;
|
||||||
header= page->get_header(extent_no, size);
|
header= page->get_header(val.m_extent_no, val.m_extent_size);
|
||||||
|
|
||||||
ndbrequire(header->m_table == req.request.table_id);
|
ndbrequire(header->m_table == req.request.table_id);
|
||||||
|
|
||||||
Uint32 page_no_in_extent = (req.key.m_page_no - data_off) % size;
|
Uint32 page_no_in_extent = calc_page_no_in_extent(req.key.m_page_no, &val);
|
||||||
Uint32 word = header->get_free_word_offset(page_no_in_extent);
|
Uint32 word = header->get_free_word_offset(page_no_in_extent);
|
||||||
Uint32 shift = SZ * (page_no_in_extent & 7);
|
Uint32 shift = SZ * (page_no_in_extent & 7);
|
||||||
|
|
||||||
@ -1912,7 +1887,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
|
|||||||
* Search
|
* Search
|
||||||
*/
|
*/
|
||||||
Uint32 *src= header->m_page_bitmask + word;
|
Uint32 *src= header->m_page_bitmask + word;
|
||||||
for(page_no= page_no_in_extent; page_no<size; page_no++)
|
for(page_no= page_no_in_extent; page_no<val.m_extent_size; page_no++)
|
||||||
{
|
{
|
||||||
src_bits= (* src >> shift) & ((1 << SZ) - 1);
|
src_bits= (* src >> shift) & ((1 << SZ) - 1);
|
||||||
if((src_bits & UNCOMMITTED_MASK) <= reqbits)
|
if((src_bits & UNCOMMITTED_MASK) <= reqbits)
|
||||||
@ -1955,15 +1930,26 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
|
|||||||
found:
|
found:
|
||||||
header->update_free_bits(page_no, src_bits | UNCOMMITTED_MASK);
|
header->update_free_bits(page_no, src_bits | UNCOMMITTED_MASK);
|
||||||
rep->bits= (src_bits & UNCOMMITTED_MASK) >> UNCOMMITTED_SHIFT;
|
rep->bits= (src_bits & UNCOMMITTED_MASK) >> UNCOMMITTED_SHIFT;
|
||||||
rep->key.m_page_no= data_off + extent * size + page_no;
|
rep->key.m_page_no=
|
||||||
|
val.m_extent_pages + val.m_extent_no * val.m_extent_size + page_no;
|
||||||
rep->reply.errorCode= 0;
|
rep->reply.errorCode= 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Tsman::execLCP_FRAG_ORD(Signal* signal)
|
||||||
|
{
|
||||||
|
jamEntry();
|
||||||
|
ndbrequire(!m_lcp_ongoing);
|
||||||
|
m_lcp_ongoing = true;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Tsman::execEND_LCP_REQ(Signal* signal)
|
Tsman::execEND_LCP_REQ(Signal* signal)
|
||||||
{
|
{
|
||||||
jamEntry();
|
jamEntry();
|
||||||
|
ndbrequire(m_lcp_ongoing);
|
||||||
|
m_lcp_ongoing = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move extents from "lcp" free list to real free list
|
* Move extents from "lcp" free list to real free list
|
||||||
|
@ -63,6 +63,7 @@ protected:
|
|||||||
|
|
||||||
void execALLOC_PAGE_REQ(Signal* signal);
|
void execALLOC_PAGE_REQ(Signal* signal);
|
||||||
|
|
||||||
|
void execLCP_FRAG_ORD(Signal*);
|
||||||
void execEND_LCP_REQ(Signal*);
|
void execEND_LCP_REQ(Signal*);
|
||||||
void end_lcp(Signal*, Uint32 tablespace, Uint32 list, Uint32 file);
|
void end_lcp(Signal*, Uint32 tablespace, Uint32 list, Uint32 file);
|
||||||
|
|
||||||
@ -108,6 +109,7 @@ public:
|
|||||||
Uint32 m_offset_data_pages; // 1(zero) + extent header pages
|
Uint32 m_offset_data_pages; // 1(zero) + extent header pages
|
||||||
Uint32 m_data_pages;
|
Uint32 m_data_pages;
|
||||||
Uint32 m_used_extent_cnt;
|
Uint32 m_used_extent_cnt;
|
||||||
|
Uint32 m_extent_headers_per_extent_page;
|
||||||
} m_online;
|
} m_online;
|
||||||
struct {
|
struct {
|
||||||
Uint32 m_senderData;
|
Uint32 m_senderData;
|
||||||
@ -196,6 +198,7 @@ private:
|
|||||||
Datafile_pool m_file_pool;
|
Datafile_pool m_file_pool;
|
||||||
Tablespace_pool m_tablespace_pool;
|
Tablespace_pool m_tablespace_pool;
|
||||||
|
|
||||||
|
bool m_lcp_ongoing;
|
||||||
Datafile_hash m_file_hash;
|
Datafile_hash m_file_hash;
|
||||||
Tablespace_list m_tablespace_list;
|
Tablespace_list m_tablespace_list;
|
||||||
Tablespace_hash m_tablespace_hash;
|
Tablespace_hash m_tablespace_hash;
|
||||||
@ -226,15 +229,52 @@ private:
|
|||||||
|
|
||||||
void release_extent_pages(Signal* signal, Ptr<Datafile> ptr);
|
void release_extent_pages(Signal* signal, Ptr<Datafile> ptr);
|
||||||
void release_extent_pages_callback(Signal*, Uint32, Uint32);
|
void release_extent_pages_callback(Signal*, Uint32, Uint32);
|
||||||
|
|
||||||
|
struct req
|
||||||
|
{
|
||||||
|
Uint32 m_extent_pages;
|
||||||
|
Uint32 m_extent_size;
|
||||||
|
Uint32 m_extent_no; // on extent page
|
||||||
|
Uint32 m_extent_page_no;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct req lookup_extent(Uint32 page_no, const Datafile*) const;
|
||||||
|
Uint32 calc_page_no_in_extent(Uint32 page_no, const struct req* val) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline
|
||||||
|
Tsman::req
|
||||||
|
Tsman::lookup_extent(Uint32 page_no, const Datafile * filePtrP) const
|
||||||
|
{
|
||||||
|
struct req val;
|
||||||
|
val.m_extent_size = filePtrP->m_extent_size;
|
||||||
|
val.m_extent_pages = filePtrP->m_online.m_offset_data_pages;
|
||||||
|
Uint32 per_page = filePtrP->m_online.m_extent_headers_per_extent_page;
|
||||||
|
|
||||||
|
Uint32 extent =
|
||||||
|
(page_no - val.m_extent_pages) / val.m_extent_size + per_page;
|
||||||
|
|
||||||
|
val.m_extent_page_no = extent / per_page;
|
||||||
|
val.m_extent_no = extent % per_page;
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
Uint32
|
||||||
|
Tsman::calc_page_no_in_extent(Uint32 page_no, const Tsman::req* val) const
|
||||||
|
{
|
||||||
|
return (page_no - val->m_extent_pages) % val->m_extent_size;
|
||||||
|
}
|
||||||
|
|
||||||
class Tablespace_client
|
class Tablespace_client
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
Tsman * m_tsman;
|
Tsman * m_tsman;
|
||||||
Signal* m_signal;
|
Signal* m_signal;
|
||||||
Uint32 m_table_id;
|
Uint32 m_table_id;
|
||||||
Uint32 m_fragment_id;
|
Uint32 m_fragment_id;
|
||||||
Uint32 m_tablespace_id;
|
Uint32 m_tablespace_id;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Tablespace_client(Signal* signal, Tsman* tsman,
|
Tablespace_client(Signal* signal, Tsman* tsman,
|
||||||
Uint32 table, Uint32 fragment, Uint32 tablespaceId) {
|
Uint32 table, Uint32 fragment, Uint32 tablespaceId) {
|
||||||
@ -245,6 +285,8 @@ public:
|
|||||||
m_tablespace_id= tablespaceId;
|
m_tablespace_id= tablespaceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Tablespace_client(Signal* signal, Tsman* tsman, Local_key* key);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return >0 if success, no of pages in extent, sets key
|
* Return >0 if success, no of pages in extent, sets key
|
||||||
* <0 if failure, -error code
|
* <0 if failure, -error code
|
||||||
@ -274,7 +316,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Free extent
|
* Free extent
|
||||||
*/
|
*/
|
||||||
int free_extent(Local_key* key);
|
int free_extent(Local_key* key, Uint64 lsn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update page free bits
|
* Update page free bits
|
||||||
@ -307,6 +349,11 @@ public:
|
|||||||
* <0 - on error
|
* <0 - on error
|
||||||
*/
|
*/
|
||||||
int get_tablespace_info(CreateFilegroupImplReq* rep);
|
int get_tablespace_info(CreateFilegroupImplReq* rep);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update lsn of page corresponing to key
|
||||||
|
*/
|
||||||
|
int update_lsn(Local_key* key, Uint64 lsn);
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <signaldata/Extent.hpp>
|
#include <signaldata/Extent.hpp>
|
||||||
@ -351,12 +398,14 @@ Tablespace_client::alloc_page_from_extent(Local_key* key, Uint32 bits)
|
|||||||
|
|
||||||
inline
|
inline
|
||||||
int
|
int
|
||||||
Tablespace_client::free_extent(Local_key* key)
|
Tablespace_client::free_extent(Local_key* key, Uint64 lsn)
|
||||||
{
|
{
|
||||||
FreeExtentReq* req = (FreeExtentReq*)m_signal->theData;
|
FreeExtentReq* req = (FreeExtentReq*)m_signal->theData;
|
||||||
req->request.key = *key;
|
req->request.key = *key;
|
||||||
req->request.table_id = m_table_id;
|
req->request.table_id = m_table_id;
|
||||||
req->request.tablespace_id = m_tablespace_id;
|
req->request.tablespace_id = m_tablespace_id;
|
||||||
|
req->request.lsn_hi = (Uint32)(lsn >> 32);
|
||||||
|
req->request.lsn_lo = (Uint32)(lsn & 0xFFFFFFFF);
|
||||||
m_tsman->execFREE_EXTENT_REQ(m_signal);
|
m_tsman->execFREE_EXTENT_REQ(m_signal);
|
||||||
|
|
||||||
if(req->reply.errorCode == 0){
|
if(req->reply.errorCode == 0){
|
||||||
@ -407,5 +456,4 @@ Tablespace_client::restart_undo_page_free_bits(Local_key* key,
|
|||||||
page_lsn);
|
page_lsn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1289,6 +1289,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
|
|||||||
"0",
|
"0",
|
||||||
STR_VALUE(MAX_INT_RNIL) },
|
STR_VALUE(MAX_INT_RNIL) },
|
||||||
|
|
||||||
|
{
|
||||||
|
CFG_DB_MEMREPORT_FREQUENCY,
|
||||||
|
"MemReportFrequency",
|
||||||
|
DB_TOKEN,
|
||||||
|
"Frequency of mem reports in seconds, 0 = only when passing %-limits",
|
||||||
|
ConfigInfo::CI_USED,
|
||||||
|
false,
|
||||||
|
ConfigInfo::CI_INT,
|
||||||
|
"0",
|
||||||
|
"0",
|
||||||
|
STR_VALUE(MAX_INT_RNIL) },
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* API
|
* API
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
@ -1921,7 +1921,7 @@ MgmtSrvr::handleStatus(NodeId nodeId, bool alive, bool nfComplete)
|
|||||||
m_started_nodes.push_back(nodeId);
|
m_started_nodes.push_back(nodeId);
|
||||||
rep->setEventType(NDB_LE_Connected);
|
rep->setEventType(NDB_LE_Connected);
|
||||||
} else {
|
} else {
|
||||||
rep->setEventType(NDB_LE_Connected);
|
rep->setEventType(NDB_LE_Disconnected);
|
||||||
if(nfComplete)
|
if(nfComplete)
|
||||||
{
|
{
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
|
@ -2190,9 +2190,14 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
|
|||||||
impl->m_replicaCount = replicaCount;
|
impl->m_replicaCount = replicaCount;
|
||||||
impl->m_fragmentCount = fragCount;
|
impl->m_fragmentCount = fragCount;
|
||||||
DBUG_PRINT("info", ("replicaCount=%x , fragCount=%x",replicaCount,fragCount));
|
DBUG_PRINT("info", ("replicaCount=%x , fragCount=%x",replicaCount,fragCount));
|
||||||
for(i = 0; i < (Uint32) (fragCount*replicaCount); i++)
|
Uint32 pos = 2;
|
||||||
|
for(i = 0; i < (Uint32) fragCount;i++)
|
||||||
{
|
{
|
||||||
impl->m_fragments.push_back(ntohs(tableDesc->ReplicaData[i+2]));
|
pos++; // skip logpart
|
||||||
|
for (Uint32 j = 0; j<(Uint32)replicaCount; j++)
|
||||||
|
{
|
||||||
|
impl->m_fragments.push_back(ntohs(tableDesc->ReplicaData[pos++]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint32 topBit = (1 << 31);
|
Uint32 topBit = (1 << 31);
|
||||||
@ -2296,7 +2301,7 @@ NdbDictionaryImpl::createTable(NdbTableImpl &t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// blob tables - use "t2" to get values set by kernel
|
// blob tables - use "t2" to get values set by kernel
|
||||||
if (t2->m_noOfBlobs != 0 && createBlobTables(*t2) != 0) {
|
if (t2->m_noOfBlobs != 0 && createBlobTables(t, *t2) != 0) {
|
||||||
int save_code = m_error.code;
|
int save_code = m_error.code;
|
||||||
(void)dropTableGlobal(*t2);
|
(void)dropTableGlobal(*t2);
|
||||||
m_error.code = save_code;
|
m_error.code = save_code;
|
||||||
@ -2310,7 +2315,7 @@ NdbDictionaryImpl::createTable(NdbTableImpl &t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionaryImpl::createBlobTables(NdbTableImpl &t)
|
NdbDictionaryImpl::createBlobTables(NdbTableImpl& orig, NdbTableImpl &t)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("NdbDictionaryImpl::createBlobTables");
|
DBUG_ENTER("NdbDictionaryImpl::createBlobTables");
|
||||||
for (unsigned i = 0; i < t.m_columns.size(); i++) {
|
for (unsigned i = 0; i < t.m_columns.size(); i++) {
|
||||||
@ -2319,6 +2324,10 @@ NdbDictionaryImpl::createBlobTables(NdbTableImpl &t)
|
|||||||
continue;
|
continue;
|
||||||
NdbTableImpl bt;
|
NdbTableImpl bt;
|
||||||
NdbBlob::getBlobTable(bt, &t, &c);
|
NdbBlob::getBlobTable(bt, &t, &c);
|
||||||
|
NdbDictionary::Column::StorageType
|
||||||
|
d = NdbDictionary::Column::StorageTypeDisk;
|
||||||
|
if (orig.m_columns[i]->getStorageType() == d)
|
||||||
|
bt.getColumn("DATA")->setStorageType(d);
|
||||||
if (createTable(bt) != 0) {
|
if (createTable(bt) != 0) {
|
||||||
DBUG_RETURN(-1);
|
DBUG_RETURN(-1);
|
||||||
}
|
}
|
||||||
|
@ -581,7 +581,7 @@ public:
|
|||||||
bool setTransporter(class TransporterFacade * tf);
|
bool setTransporter(class TransporterFacade * tf);
|
||||||
|
|
||||||
int createTable(NdbTableImpl &t);
|
int createTable(NdbTableImpl &t);
|
||||||
int createBlobTables(NdbTableImpl& t);
|
int createBlobTables(NdbTableImpl& org, NdbTableImpl& created);
|
||||||
int alterTable(NdbTableImpl &t);
|
int alterTable(NdbTableImpl &t);
|
||||||
int dropTable(const char * name);
|
int dropTable(const char * name);
|
||||||
int dropTable(NdbTableImpl &);
|
int dropTable(NdbTableImpl &);
|
||||||
|
@ -476,6 +476,7 @@ NdbTransaction::executeNoBlobs(ExecType aTypeOfExec,
|
|||||||
* This timeout situation can occur if NDB crashes.
|
* This timeout situation can occur if NDB crashes.
|
||||||
*/
|
*/
|
||||||
ndbout << "This timeout should never occur, execute(..)" << endl;
|
ndbout << "This timeout should never occur, execute(..)" << endl;
|
||||||
|
theError.code = 4012;
|
||||||
setOperationErrorCodeAbort(4012); // Error code for "Cluster Failure"
|
setOperationErrorCodeAbort(4012); // Error code for "Cluster Failure"
|
||||||
DBUG_RETURN(-1);
|
DBUG_RETURN(-1);
|
||||||
}//if
|
}//if
|
||||||
@ -1978,6 +1979,14 @@ NdbTransaction::receiveTCINDXCONF(const TcIndxConf * indxConf,
|
|||||||
}
|
}
|
||||||
} else if ((tNoComp >= tNoSent) &&
|
} else if ((tNoComp >= tNoSent) &&
|
||||||
(theLastExecOpInList->theCommitIndicator == 1)){
|
(theLastExecOpInList->theCommitIndicator == 1)){
|
||||||
|
|
||||||
|
if (m_abortOption == AO_IgnoreError && theError.code != 0){
|
||||||
|
/**
|
||||||
|
* There's always a TCKEYCONF when using IgnoreError
|
||||||
|
*/
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
// We sent the transaction with Commit flag set and received a CONF with
|
// We sent the transaction with Commit flag set and received a CONF with
|
||||||
// no Commit flag set. This is clearly an anomaly.
|
// no Commit flag set. This is clearly an anomaly.
|
||||||
|
@ -1088,6 +1088,7 @@ Ndb::check_send_timeout()
|
|||||||
//abort();
|
//abort();
|
||||||
#endif
|
#endif
|
||||||
a_con->theReleaseOnClose = true;
|
a_con->theReleaseOnClose = true;
|
||||||
|
a_con->theError.code = 4012;
|
||||||
a_con->setOperationErrorCodeAbort(4012);
|
a_con->setOperationErrorCodeAbort(4012);
|
||||||
a_con->theCommitStatus = NdbTransaction::NeedAbort;
|
a_con->theCommitStatus = NdbTransaction::NeedAbort;
|
||||||
a_con->theCompletionStatus = NdbTransaction::CompletedFailure;
|
a_con->theCompletionStatus = NdbTransaction::CompletedFailure;
|
||||||
@ -1275,9 +1276,9 @@ Ndb::waitCompletedTransactions(int aMilliSecondsToWait,
|
|||||||
NDB_TICKS currTime = NdbTick_CurrentMillisecond();
|
NDB_TICKS currTime = NdbTick_CurrentMillisecond();
|
||||||
NDB_TICKS maxTime = currTime + (NDB_TICKS)waitTime;
|
NDB_TICKS maxTime = currTime + (NDB_TICKS)waitTime;
|
||||||
theMinNoOfEventsToWakeUp = noOfEventsToWaitFor;
|
theMinNoOfEventsToWakeUp = noOfEventsToWaitFor;
|
||||||
|
const int maxsleep = aMilliSecondsToWait > 10 ? 10 : aMilliSecondsToWait;
|
||||||
do {
|
do {
|
||||||
if (waitTime < 1000) waitTime = 1000;
|
poll_guard->wait_for_input(maxsleep);
|
||||||
poll_guard->wait_for_input(waitTime);
|
|
||||||
if (theNoOfCompletedTransactions >= (Uint32)noOfEventsToWaitFor) {
|
if (theNoOfCompletedTransactions >= (Uint32)noOfEventsToWaitFor) {
|
||||||
break;
|
break;
|
||||||
}//if
|
}//if
|
||||||
|
@ -1384,15 +1384,13 @@ int PollGuard::wait_for_input_in_loop(int wait_time, bool forceSend)
|
|||||||
m_tp->forceSend(m_block_no);
|
m_tp->forceSend(m_block_no);
|
||||||
else
|
else
|
||||||
m_tp->checkForceSend(m_block_no);
|
m_tp->checkForceSend(m_block_no);
|
||||||
if (wait_time == -1) //Means wait forever
|
|
||||||
response_time= WAITFOR_RESPONSE_TIMEOUT;
|
|
||||||
else
|
|
||||||
response_time= wait_time;
|
|
||||||
NDB_TICKS curr_time = NdbTick_CurrentMillisecond();
|
NDB_TICKS curr_time = NdbTick_CurrentMillisecond();
|
||||||
NDB_TICKS max_time = curr_time + (NDB_TICKS)wait_time;
|
NDB_TICKS max_time = curr_time + (NDB_TICKS)wait_time;
|
||||||
|
const int maxsleep = (wait_time == -1 || wait_time > 10) ? 10 : wait_time;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
wait_for_input(response_time);
|
wait_for_input(maxsleep);
|
||||||
Uint32 state= m_waiter->get_state();
|
Uint32 state= m_waiter->get_state();
|
||||||
if (state == NO_WAIT)
|
if (state == NO_WAIT)
|
||||||
{
|
{
|
||||||
|
@ -1249,6 +1249,29 @@ runInsertError2(NDBT_Context* ctx, NDBT_Step* step){
|
|||||||
return NDBT_OK;
|
return NDBT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
runBug25090(NDBT_Context* ctx, NDBT_Step* step){
|
||||||
|
|
||||||
|
Ndb* pNdb = GETNDB(step);
|
||||||
|
NdbDictionary::Dictionary * dict = pNdb->getDictionary();
|
||||||
|
|
||||||
|
HugoOperations ops(*ctx->getTab());
|
||||||
|
|
||||||
|
int loops = ctx->getNumLoops();
|
||||||
|
const int rows = ctx->getNumRecords();
|
||||||
|
|
||||||
|
while (loops--)
|
||||||
|
{
|
||||||
|
ops.startTransaction(pNdb);
|
||||||
|
ops.pkReadRecord(pNdb, 1, 1);
|
||||||
|
ops.execute_Commit(pNdb, AO_IgnoreError);
|
||||||
|
sleep(10);
|
||||||
|
ops.closeTransaction(pNdb);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NDBT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NDBT_TESTSUITE(testBasic);
|
NDBT_TESTSUITE(testBasic);
|
||||||
TESTCASE("PkInsert",
|
TESTCASE("PkInsert",
|
||||||
"Verify that we can insert and delete from this table using PK"
|
"Verify that we can insert and delete from this table using PK"
|
||||||
@ -1509,6 +1532,16 @@ TESTCASE("InsertError", "" ){
|
|||||||
TESTCASE("InsertError2", "" ){
|
TESTCASE("InsertError2", "" ){
|
||||||
INITIALIZER(runInsertError2);
|
INITIALIZER(runInsertError2);
|
||||||
}
|
}
|
||||||
|
TESTCASE("Fill",
|
||||||
|
"Verify what happens when we fill the db" ){
|
||||||
|
INITIALIZER(runFillTable);
|
||||||
|
INITIALIZER(runPkRead);
|
||||||
|
FINALIZER(runClearTable2);
|
||||||
|
}
|
||||||
|
TESTCASE("Bug25090",
|
||||||
|
"Verify what happens when we fill the db" ){
|
||||||
|
STEP(runBug25090);
|
||||||
|
}
|
||||||
NDBT_TESTSUITE_END(testBasic);
|
NDBT_TESTSUITE_END(testBasic);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -1238,7 +1238,65 @@ runBug21384(NDBT_Context* ctx, NDBT_Step* step)
|
|||||||
return NDBT_OK;
|
return NDBT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
runBug25059(NDBT_Context* ctx, NDBT_Step* step)
|
||||||
|
{
|
||||||
|
Ndb* pNdb = GETNDB(step);
|
||||||
|
NdbDictionary::Dictionary * dict = pNdb->getDictionary();
|
||||||
|
const NdbDictionary::Index * idx = dict->getIndex(pkIdxName,
|
||||||
|
ctx->getTab()->getName());
|
||||||
|
|
||||||
|
HugoOperations ops(*ctx->getTab(), idx);
|
||||||
|
|
||||||
|
int res = NDBT_OK;
|
||||||
|
int loops = ctx->getNumLoops();
|
||||||
|
const int rows = ctx->getNumRecords();
|
||||||
|
|
||||||
|
while (res == NDBT_OK && loops--)
|
||||||
|
{
|
||||||
|
ops.startTransaction(pNdb);
|
||||||
|
ops.pkReadRecord(pNdb, 10 + rand() % rows, rows);
|
||||||
|
int tmp;
|
||||||
|
if (tmp = ops.execute_Commit(pNdb, AO_IgnoreError))
|
||||||
|
{
|
||||||
|
if (tmp == 4012)
|
||||||
|
res = NDBT_FAILED;
|
||||||
|
else
|
||||||
|
if (ops.getTransaction()->getNdbError().code == 4012)
|
||||||
|
res = NDBT_FAILED;
|
||||||
|
}
|
||||||
|
ops.closeTransaction(pNdb);
|
||||||
|
}
|
||||||
|
|
||||||
|
loops = ctx->getNumLoops();
|
||||||
|
while (res == NDBT_OK && loops--)
|
||||||
|
{
|
||||||
|
ops.startTransaction(pNdb);
|
||||||
|
ops.pkUpdateRecord(pNdb, 10 + rand() % rows, rows);
|
||||||
|
int tmp;
|
||||||
|
int arg;
|
||||||
|
switch(rand() % 2){
|
||||||
|
case 0:
|
||||||
|
arg = AbortOnError;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
arg = AO_IgnoreError;
|
||||||
|
ndbout_c("ignore error");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (tmp = ops.execute_Commit(pNdb, (AbortOption)arg))
|
||||||
|
{
|
||||||
|
if (tmp == 4012)
|
||||||
|
res = NDBT_FAILED;
|
||||||
|
else
|
||||||
|
if (ops.getTransaction()->getNdbError().code == 4012)
|
||||||
|
res = NDBT_FAILED;
|
||||||
|
}
|
||||||
|
ops.closeTransaction(pNdb);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
NDBT_TESTSUITE(testIndex);
|
NDBT_TESTSUITE(testIndex);
|
||||||
TESTCASE("CreateAll",
|
TESTCASE("CreateAll",
|
||||||
@ -1563,6 +1621,14 @@ TESTCASE("Bug21384",
|
|||||||
FINALIZER(createPkIndex_Drop);
|
FINALIZER(createPkIndex_Drop);
|
||||||
FINALIZER(runClearTable);
|
FINALIZER(runClearTable);
|
||||||
}
|
}
|
||||||
|
TESTCASE("Bug25059",
|
||||||
|
"Test that unique indexes and nulls"){
|
||||||
|
TC_PROPERTY("LoggedIndexes", (unsigned)0);
|
||||||
|
INITIALIZER(createPkIndex);
|
||||||
|
INITIALIZER(runLoadTable);
|
||||||
|
STEP(runBug25059);
|
||||||
|
FINALIZER(createPkIndex_Drop);
|
||||||
|
}
|
||||||
NDBT_TESTSUITE_END(testIndex);
|
NDBT_TESTSUITE_END(testIndex);
|
||||||
|
|
||||||
int main(int argc, const char** argv){
|
int main(int argc, const char** argv){
|
||||||
|
@ -1161,6 +1161,64 @@ runBug21536(NDBT_Context* ctx, NDBT_Step* step)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
runBug24664(NDBT_Context* ctx, NDBT_Step* step)
|
||||||
|
{
|
||||||
|
int result = NDBT_OK;
|
||||||
|
NdbRestarter restarter;
|
||||||
|
Ndb* pNdb = GETNDB(step);
|
||||||
|
const Uint32 nodeCount = restarter.getNumDbNodes();
|
||||||
|
|
||||||
|
int records = ctx->getNumRecords();
|
||||||
|
UtilTransactions utilTrans(*ctx->getTab());
|
||||||
|
HugoTransactions hugoTrans(*ctx->getTab());
|
||||||
|
|
||||||
|
int args[] = { DumpStateOrd::DihMaxTimeBetweenLCP };
|
||||||
|
int dump[] = { DumpStateOrd::DihStartLcpImmediately };
|
||||||
|
|
||||||
|
int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_CHECKPOINT, 0 };
|
||||||
|
NdbLogEventHandle handle =
|
||||||
|
ndb_mgm_create_logevent_handle(restarter.handle, filter);
|
||||||
|
|
||||||
|
struct ndb_logevent event;
|
||||||
|
|
||||||
|
do {
|
||||||
|
CHECK(restarter.dumpStateAllNodes(args, 1) == 0);
|
||||||
|
CHECK(restarter.dumpStateAllNodes(dump, 1) == 0);
|
||||||
|
while(ndb_logevent_get_next(handle, &event, 0) >= 0 &&
|
||||||
|
event.type != NDB_LE_LocalCheckpointStarted);
|
||||||
|
while(ndb_logevent_get_next(handle, &event, 0) >= 0 &&
|
||||||
|
event.type != NDB_LE_LocalCheckpointCompleted);
|
||||||
|
|
||||||
|
if (hugoTrans.loadTable(GETNDB(step), records) != 0){
|
||||||
|
return NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
restarter.insertErrorInAllNodes(10036); // Hang LCP
|
||||||
|
CHECK(restarter.dumpStateAllNodes(dump, 1) == 0);
|
||||||
|
while(ndb_logevent_get_next(handle, &event, 0) >= 0 &&
|
||||||
|
event.type != NDB_LE_LocalCheckpointStarted);
|
||||||
|
NdbSleep_SecSleep(3);
|
||||||
|
CHECK(utilTrans.clearTable(pNdb, records) == 0);
|
||||||
|
if (hugoTrans.loadTable(GETNDB(step), records) != 0){
|
||||||
|
return NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
restarter.insertErrorInAllNodes(10037); // Resume LCP
|
||||||
|
while(ndb_logevent_get_next(handle, &event, 0) >= 0 &&
|
||||||
|
event.type != NDB_LE_LocalCheckpointCompleted);
|
||||||
|
|
||||||
|
while(ndb_logevent_get_next(handle, &event, 0) >= 0 &&
|
||||||
|
event.type != NDB_LE_GlobalCheckpointCompleted);
|
||||||
|
while(ndb_logevent_get_next(handle, &event, 0) >= 0 &&
|
||||||
|
event.type != NDB_LE_GlobalCheckpointCompleted);
|
||||||
|
restarter.restartAll(false, false, true);
|
||||||
|
CHECK(restarter.waitClusterStarted() == 0);
|
||||||
|
} while(false);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
NDBT_TESTSUITE(testSystemRestart);
|
NDBT_TESTSUITE(testSystemRestart);
|
||||||
TESTCASE("SR1",
|
TESTCASE("SR1",
|
||||||
"Basic system restart test. Focus on testing restart from REDO log.\n"
|
"Basic system restart test. Focus on testing restart from REDO log.\n"
|
||||||
@ -1333,6 +1391,14 @@ TESTCASE("Bug21536",
|
|||||||
STEP(runBug21536);
|
STEP(runBug21536);
|
||||||
FINALIZER(runClearTable);
|
FINALIZER(runClearTable);
|
||||||
}
|
}
|
||||||
|
TESTCASE("Bug24664",
|
||||||
|
"Check handling of LCP skip/keep")
|
||||||
|
{
|
||||||
|
INITIALIZER(runWaitStarted);
|
||||||
|
INITIALIZER(runClearTable);
|
||||||
|
STEP(runBug24664);
|
||||||
|
FINALIZER(runClearTable);
|
||||||
|
}
|
||||||
NDBT_TESTSUITE_END(testSystemRestart);
|
NDBT_TESTSUITE_END(testSystemRestart);
|
||||||
|
|
||||||
int main(int argc, const char** argv){
|
int main(int argc, const char** argv){
|
||||||
|
@ -231,6 +231,14 @@ max-time: 500
|
|||||||
cmd: testTimeout
|
cmd: testTimeout
|
||||||
args: T1
|
args: T1
|
||||||
|
|
||||||
|
max-time: 500
|
||||||
|
cmd: testBasic
|
||||||
|
args: -n Bug25090 T1
|
||||||
|
|
||||||
|
max-time: 500
|
||||||
|
cmd: testIndex
|
||||||
|
args: -n Bug25059 -r 3000 T1
|
||||||
|
|
||||||
# SCAN TESTS
|
# SCAN TESTS
|
||||||
#
|
#
|
||||||
max-time: 500
|
max-time: 500
|
||||||
@ -752,6 +760,10 @@ max-time: 300
|
|||||||
cmd: testNodeRestart
|
cmd: testNodeRestart
|
||||||
args: -n Bug24543 T1
|
args: -n Bug24543 T1
|
||||||
|
|
||||||
|
max-time: 1500
|
||||||
|
cmd: testSystemRestart
|
||||||
|
args: -n Bug24664
|
||||||
|
|
||||||
# OLD FLEX
|
# OLD FLEX
|
||||||
max-time: 500
|
max-time: 500
|
||||||
cmd: flexBench
|
cmd: flexBench
|
||||||
|
Loading…
x
Reference in New Issue
Block a user