#At file:///net/fimafeng09/export/home/tmp/oleja/mysql/mysql-5.1-telco-7.0-spj-scan-scan/ based on revid:ole.john.aske@stripped
3483 Ole John Aske 2011-04-27 [merge]
Merge mysql-5.1-telco-7.0 -> SPJ
added:
mysql-test/suite/rpl_ndb/combinations
mysql-test/suite/rpl_ndb/t/check_conversions.inc
storage/ndb/test/run-test/conf-blade08.cnf
renamed:
mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test => mysql-test/suite/rpl_ndb/t/rpl_ndb_2multi_basic.inc
mysql-test/extra/rpl_tests/rpl_ndb_2multi_eng.test => mysql-test/suite/rpl_ndb/t/rpl_ndb_2multi_eng.inc
mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test => mysql-test/suite/rpl_ndb/t/rpl_ndb_xxx_innodb.inc
mysql-test/extra/rpl_tests/select_ndb_apply_status.inc => mysql-test/suite/rpl_ndb/t/select_ndb_apply_status.inc
storage/ndb/include/util/azlib.h => storage/ndb/include/util/ndbzio.h
storage/ndb/src/common/util/azio.c => storage/ndb/src/common/util/ndbzio.c
modified:
configure.in
mysql-test/mysql-test-run.pl
mysql-test/suite/rpl_ndb/my.cnf
mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_break_3_chain.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result
mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_break_3_chain.cnf
mysql-test/suite/rpl_ndb/t/rpl_ndb_break_3_chain.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.h
sql/sql_partition.cc
storage/ndb/include/kernel/kernel_types.h
storage/ndb/include/kernel/signaldata/AccLock.hpp
storage/ndb/include/kernel/signaldata/NextScan.hpp
storage/ndb/ndb_configure.m4
storage/ndb/src/common/debugger/signaldata/AccLock.cpp
storage/ndb/src/common/util/CMakeLists.txt
storage/ndb/src/common/util/Makefile.am
storage/ndb/src/kernel/blocks/backup/read.cpp
storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.cpp
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp
storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp
storage/ndb/src/kernel/blocks/lgman.cpp
storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp
storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp
storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.hpp
storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp
storage/ndb/src/kernel/vm/mt.cpp
storage/ndb/src/mgmsrv/ConfigInfo.cpp
storage/ndb/src/ndbapi/NdbScanOperation.cpp
storage/ndb/test/ndbapi/testDict.cpp
storage/ndb/test/run-test/Makefile.am
storage/ndb/test/run-test/daily-basic-tests.txt
storage/ndb/test/src/HugoCalculator.cpp
storage/ndb/tools/restore/Restore.cpp
storage/ndb/tools/restore/Restore.hpp
mysql-test/suite/rpl_ndb/t/rpl_ndb_xxx_innodb.inc
storage/ndb/include/util/ndbzio.h
storage/ndb/src/common/util/ndbzio.c
=== modified file 'configure.in'
--- a/configure.in 2011-04-08 13:59:44 +0000
+++ b/configure.in 2011-04-26 07:39:21 +0000
@@ -12,7 +12,7 @@ dnl
dnl When changing the major version number please also check the switch
dnl statement in mysqlbinlog::check_master_version(). You may also need
dnl to update version.c in ndb.
-AC_INIT([MySQL Server], [5.1.56-ndb-7.0.24], [], [mysql])
+AC_INIT([MySQL Server], [5.1.56-ndb-7.0.25], [], [mysql])
AC_CONFIG_SRCDIR([sql/mysqld.cc])
AC_CANONICAL_SYSTEM
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl 2011-04-08 13:59:44 +0000
+++ b/mysql-test/mysql-test-run.pl 2011-04-19 09:51:53 +0000
@@ -383,10 +383,13 @@ sub main {
my $sys_info= My::SysInfo->new();
$opt_parallel= $sys_info->num_cpus();
+ print "num_cpus: $opt_parallel, min_bogomips: " .
+ $sys_info->min_bogomips(). "\n";
for my $limit (2000, 1500, 1000, 500){
$opt_parallel-- if ($sys_info->min_bogomips() < $limit);
}
my $max_par= $ENV{MTR_MAX_PARALLEL} || 8;
+ print "max_par: $max_par\n";
$opt_parallel= $max_par if ($opt_parallel > $max_par);
$opt_parallel= $num_tests if ($opt_parallel > $num_tests);
$opt_parallel= 1 if (IS_WINDOWS and $sys_info->isvm());
=== added file 'mysql-test/suite/rpl_ndb/combinations'
--- a/mysql-test/suite/rpl_ndb/combinations 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl_ndb/combinations 2011-04-21 07:53:16 +0000
@@ -0,0 +1,5 @@
+[row]
+binlog-format=row
+
+[mix]
+binlog-format=mixed
=== modified file 'mysql-test/suite/rpl_ndb/my.cnf'
--- a/mysql-test/suite/rpl_ndb/my.cnf 2011-04-15 12:21:13 +0000
+++ b/mysql-test/suite/rpl_ndb/my.cnf 2011-04-26 09:28:41 +0000
@@ -70,7 +70,12 @@ report-host= 127.0.0.1
report-port= @mysqld.1.slave.port
report-user= root
+# Configure slave mysqld without innodb, and set myisam
+# as default storage engine(since innodb will be default
+# otherwise starting from 5.5)
loose-skip-innodb
+default-storage-engine=myisam
+
skip-slave-start
# Directory where slaves find the dumps generated by "load data"
=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result 2010-12-19 17:07:28 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result 2011-04-20 14:36:44 +0000
@@ -4,6 +4,7 @@ SET storage_engine=ndb;
=== NDB -> MYISAM ===
+[connection slave]
set @old_slave_exec_mode= @@global.slave_exec_mode;
set @@global.slave_exec_mode= 'IDEMPOTENT';
CREATE TABLE mysql.ndb_apply_status
@@ -13,7 +14,9 @@ log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
-SET storage_engine=myisam;
+SET @old_slave_storage_engine=@@global.storage_engine;
+SET @@global.storage_engine=myisam;
+include/start_slave.inc
--- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1;
--- Create Table Section ---
@@ -404,11 +407,15 @@ TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
--- Do Cleanup --
DROP TABLE IF EXISTS t1;
+[connection slave]
+include/stop_slave.inc
=== NDB -> INNODB ===
+[connection slave]
alter table mysql.ndb_apply_status engine=innodb;
-SET storage_engine=innodb;
+SET @@global.storage_engine=innodb;
+include/start_slave.inc
--- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1;
--- Create Table Section ---
@@ -451,7 +458,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
@@ -543,7 +550,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
@@ -636,7 +643,7 @@ t1 CREATE TABLE `t1` (
`u` int(11) DEFAULT NULL,
`v` char(16) DEFAULT 'default',
PRIMARY KEY (`id`,`total`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT *
FROM t1
ORDER BY id;
@@ -735,7 +742,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT '0',
`total` bigint(20) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`,`total`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
@@ -799,6 +806,9 @@ TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
--- Do Cleanup --
DROP TABLE IF EXISTS t1;
+[connection slave]
+include/stop_slave.inc
+[connection slave]
drop table mysql.ndb_apply_status;
set @@global.slave_exec_mode= @old_slave_exec_mode;
-include/rpl_end.inc
+SET @@global.storage_engine=@old_slave_storage_engine;
=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_break_3_chain.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_break_3_chain.result 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_break_3_chain.result 2011-04-26 13:48:44 +0000
@@ -1,31 +1,26 @@
-include/master-slave.inc
-[connection master]
+include/rpl_init.inc [topology=1->2->3]
+include/rpl_connect.inc [creating cluster1]
+include/rpl_connect.inc [creating cluster2]
+include/rpl_connect.inc [creating cluster3]
+[connection cluster1]
show variables like 'server_id';
Variable_name Value
server_id 1
-reset master;
select @cluster1_server_id:=(variable_value+0)
from information_schema.global_variables
where variable_name like 'server_id';
@cluster1_server_id:=(variable_value+0)
1
+[connection cluster2]
show variables like 'server_id';
Variable_name Value
server_id 2
-stop slave;
-reset master;
-reset slave;
-start slave;
+[connection cluster3]
show variables like 'server_id';
Variable_name Value
server_id 3
-stop slave;
-Warnings:
-Note 1255 Slave already has been stopped
-reset master;
-reset slave;
-start slave;
First show replication 1->2->3
+[connection cluster1]
use test;
create table t1(a int primary key, b varchar(50)) engine=ndb;
insert into t1 values (1,'Summertime');
@@ -51,8 +46,10 @@ select * from test.t1;
a b
1 Summertime
Break Cluster3's link with Cluster2
-stop slave;
+[connection cluster3]
+include/stop_slave.inc
Make further changes on Cluster1
+[connection cluster1]
insert into test.t1 values (2, "The cotton is high");
insert into test.t1 values (3, "Daddys rich");
Show changes exist on Cluster2
@@ -62,6 +59,7 @@ a b
2 The cotton is high
3 Daddys rich
Check data on Cluster3
+[connection cluster3]
select * from test.t1 order by a;
a b
1 Summertime
@@ -70,12 +68,17 @@ select * from mysql.ndb_apply_status ord
server_id epoch log_name start_pos end_pos
1 # # # #
2 # # # #
-start slave;
+include/rpl_change_topology.inc [new topology=1->2,1->3]
+include/start_slave.inc
+[connection cluster1]
Now show that cluster 3 is successfully replicating from Cluster1
+[connection cluster3]
select * from test.t1 order by a;
a b
1 Summertime
2 The cotton is high
3 Daddys rich
Clean up
+[connection cluster1]
drop table test.t1;
+include/rpl_end.inc
=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result 2011-04-07 19:57:33 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result 2011-04-21 12:36:25 +0000
@@ -38,111 +38,7 @@ ALL_LOSSY,ALL_NON_LOSSY
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
include/rpl_reset.inc
-**** Result of conversions ****
-Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave
-GEOMETRY GEOMETRY ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-BIT(1) BIT(1) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DATE DATE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-ENUM('master',' ENUM('master',' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-CHAR(10) ENUM('master',' ALL_LOSSY,ALL_NON_LOSSY <Correct error>
-CHAR(10) SET('master','s ALL_LOSSY,ALL_NON_LOSSY <Correct error>
-ENUM('master',' CHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct error>
-SET('master','s CHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct error>
-SET('master','s SET('master','s ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SET('master','s SET('master','s ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TINYINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TINYINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TINYINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TINYINT INT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TINYINT BIGINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SMALLINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SMALLINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SMALLINT TINYINT UNSIGNE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SMALLINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SMALLINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SMALLINT INT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-SMALLINT BIGINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-MEDIUMINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-MEDIUMINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-MEDIUMINT TINYINT UNSIGNE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-MEDIUMINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-MEDIUMINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-MEDIUMINT INT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-MEDIUMINT BIGINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-INT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-INT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-INT TINYINT UNSIGNE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-INT SMALLINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-INT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-INT INT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-INT BIGINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-BIGINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-BIGINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-BIGINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-BIGINT INT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-BIGINT BIGINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-CHAR(20) CHAR(20) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-CHAR(20) CHAR(30) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-CHAR(20) CHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-CHAR(20) VARCHAR(20) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-CHAR(20) VARCHAR(30) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-CHAR(20) VARCHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-CHAR(20) TINYTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-CHAR(20) TEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-CHAR(20) MEDIUMTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-CHAR(20) LONGTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(20) VARCHAR(20) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(20) VARCHAR(30) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(20) VARCHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(20) CHAR(30) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(20) CHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(20) TINYTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(20) TEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(20) MEDIUMTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(20) LONGTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(500) VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(500) VARCHAR(510) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(500) VARCHAR(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(500) TINYTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(500) TEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(500) MEDIUMTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-VARCHAR(500) LONGTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TINYTEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-MEDIUMTEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-LONGTEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TINYTEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TINYTEXT CHAR(250) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-MEDIUMTEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-LONGTEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TINYTEXT TINYTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TINYTEXT TEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-TEXT TINYTEXT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(10,5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(10,6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(11,5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(11,6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(10,4) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(9,5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(9,4) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-FLOAT DECIMAL(10,5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DOUBLE DECIMAL(10,5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) FLOAT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DOUBLE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-FLOAT FLOAT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DOUBLE DOUBLE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-FLOAT DOUBLE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-DOUBLE FLOAT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-BIT(5) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-BIT(5) BIT(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
-BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
+**** Checking result of conversions ****
DROP TABLE type_conversions;
DROP TABLE t1;
set global slave_type_conversions = @saved_slave_type_conversions;
=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result 2011-04-07 19:57:33 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result 2011-04-21 12:36:25 +0000
@@ -38,111 +38,7 @@ ALL_LOSSY,ALL_NON_LOSSY
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
include/rpl_reset.inc
-**** Result of conversions ****
-Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave
-GEOMETRY GEOMETRY ALL_LOSSY <Correct value>
-BIT(1) BIT(1) ALL_LOSSY <Correct value>
-DATE DATE ALL_LOSSY <Correct value>
-ENUM('master',' ENUM('master',' ALL_LOSSY <Correct value>
-CHAR(10) ENUM('master',' ALL_LOSSY <Correct error>
-CHAR(10) SET('master','s ALL_LOSSY <Correct error>
-ENUM('master',' CHAR(10) ALL_LOSSY <Correct error>
-SET('master','s CHAR(10) ALL_LOSSY <Correct error>
-SET('master','s SET('master','s ALL_LOSSY <Correct value>
-SET('master','s SET('master','s ALL_LOSSY <Correct value>
-SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct value>
-SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct error>
-SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct value>
-SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct value>
-TINYINT TINYINT ALL_LOSSY <Correct value>
-TINYINT SMALLINT ALL_LOSSY <Correct error>
-TINYINT MEDIUMINT ALL_LOSSY <Correct error>
-TINYINT INT ALL_LOSSY <Correct error>
-TINYINT BIGINT ALL_LOSSY <Correct error>
-SMALLINT TINYINT ALL_LOSSY <Correct value>
-SMALLINT TINYINT ALL_LOSSY <Correct value>
-SMALLINT TINYINT UNSIGNE ALL_LOSSY <Correct value>
-SMALLINT SMALLINT ALL_LOSSY <Correct value>
-SMALLINT MEDIUMINT ALL_LOSSY <Correct error>
-SMALLINT INT ALL_LOSSY <Correct error>
-SMALLINT BIGINT ALL_LOSSY <Correct error>
-MEDIUMINT TINYINT ALL_LOSSY <Correct value>
-MEDIUMINT TINYINT ALL_LOSSY <Correct value>
-MEDIUMINT TINYINT UNSIGNE ALL_LOSSY <Correct value>
-MEDIUMINT SMALLINT ALL_LOSSY <Correct value>
-MEDIUMINT MEDIUMINT ALL_LOSSY <Correct value>
-MEDIUMINT INT ALL_LOSSY <Correct error>
-MEDIUMINT BIGINT ALL_LOSSY <Correct error>
-INT TINYINT ALL_LOSSY <Correct value>
-INT TINYINT ALL_LOSSY <Correct value>
-INT TINYINT UNSIGNE ALL_LOSSY <Correct value>
-INT SMALLINT ALL_LOSSY <Correct value>
-INT MEDIUMINT ALL_LOSSY <Correct value>
-INT INT ALL_LOSSY <Correct value>
-INT BIGINT ALL_LOSSY <Correct error>
-BIGINT TINYINT ALL_LOSSY <Correct value>
-BIGINT SMALLINT ALL_LOSSY <Correct value>
-BIGINT MEDIUMINT ALL_LOSSY <Correct value>
-BIGINT INT ALL_LOSSY <Correct value>
-BIGINT BIGINT ALL_LOSSY <Correct value>
-CHAR(20) CHAR(20) ALL_LOSSY <Correct value>
-CHAR(20) CHAR(30) ALL_LOSSY <Correct error>
-CHAR(20) CHAR(10) ALL_LOSSY <Correct value>
-CHAR(20) VARCHAR(20) ALL_LOSSY <Correct error>
-CHAR(20) VARCHAR(30) ALL_LOSSY <Correct error>
-CHAR(20) VARCHAR(10) ALL_LOSSY <Correct value>
-CHAR(20) TINYTEXT ALL_LOSSY <Correct error>
-CHAR(20) TEXT ALL_LOSSY <Correct error>
-CHAR(20) MEDIUMTEXT ALL_LOSSY <Correct error>
-CHAR(20) LONGTEXT ALL_LOSSY <Correct error>
-VARCHAR(20) VARCHAR(20) ALL_LOSSY <Correct value>
-VARCHAR(20) VARCHAR(30) ALL_LOSSY <Correct error>
-VARCHAR(20) VARCHAR(10) ALL_LOSSY <Correct value>
-VARCHAR(20) CHAR(30) ALL_LOSSY <Correct error>
-VARCHAR(20) CHAR(10) ALL_LOSSY <Correct value>
-VARCHAR(20) TINYTEXT ALL_LOSSY <Correct error>
-VARCHAR(20) TEXT ALL_LOSSY <Correct error>
-VARCHAR(20) MEDIUMTEXT ALL_LOSSY <Correct error>
-VARCHAR(20) LONGTEXT ALL_LOSSY <Correct error>
-VARCHAR(500) VARCHAR(500) ALL_LOSSY <Correct value>
-VARCHAR(500) VARCHAR(510) ALL_LOSSY <Correct error>
-VARCHAR(500) VARCHAR(255) ALL_LOSSY <Correct value>
-VARCHAR(500) TINYTEXT ALL_LOSSY <Correct value>
-VARCHAR(500) TEXT ALL_LOSSY <Correct error>
-VARCHAR(500) MEDIUMTEXT ALL_LOSSY <Correct error>
-VARCHAR(500) LONGTEXT ALL_LOSSY <Correct error>
-TINYTEXT VARCHAR(500) ALL_LOSSY <Correct error>
-TEXT VARCHAR(500) ALL_LOSSY <Correct value>
-MEDIUMTEXT VARCHAR(500) ALL_LOSSY <Correct value>
-LONGTEXT VARCHAR(500) ALL_LOSSY <Correct value>
-TINYTEXT CHAR(255) ALL_LOSSY <Correct error>
-TINYTEXT CHAR(250) ALL_LOSSY <Correct value>
-TEXT CHAR(255) ALL_LOSSY <Correct value>
-MEDIUMTEXT CHAR(255) ALL_LOSSY <Correct value>
-LONGTEXT CHAR(255) ALL_LOSSY <Correct value>
-TINYTEXT TINYTEXT ALL_LOSSY <Correct value>
-TINYTEXT TEXT ALL_LOSSY <Correct error>
-TEXT TINYTEXT ALL_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(10,5) ALL_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(10,6) ALL_LOSSY <Correct error>
-DECIMAL(10,5) DECIMAL(11,5) ALL_LOSSY <Correct error>
-DECIMAL(10,5) DECIMAL(11,6) ALL_LOSSY <Correct error>
-DECIMAL(10,5) DECIMAL(10,4) ALL_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(9,5) ALL_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(9,4) ALL_LOSSY <Correct value>
-FLOAT DECIMAL(10,5) ALL_LOSSY <Correct value>
-DOUBLE DECIMAL(10,5) ALL_LOSSY <Correct value>
-DECIMAL(10,5) FLOAT ALL_LOSSY <Correct value>
-DECIMAL(10,5) DOUBLE ALL_LOSSY <Correct value>
-FLOAT FLOAT ALL_LOSSY <Correct value>
-DOUBLE DOUBLE ALL_LOSSY <Correct value>
-FLOAT DOUBLE ALL_LOSSY <Correct error>
-DOUBLE FLOAT ALL_LOSSY <Correct value>
-BIT(5) BIT(5) ALL_LOSSY <Correct value>
-BIT(5) BIT(6) ALL_LOSSY <Correct error>
-BIT(6) BIT(5) ALL_LOSSY <Correct value>
-BIT(5) BIT(12) ALL_LOSSY <Correct error>
-BIT(12) BIT(5) ALL_LOSSY <Correct value>
+**** Checking result of conversions ****
DROP TABLE type_conversions;
DROP TABLE t1;
set global slave_type_conversions = @saved_slave_type_conversions;
=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result 2011-04-07 19:57:33 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result 2011-04-21 12:36:25 +0000
@@ -38,111 +38,7 @@ ALL_LOSSY,ALL_NON_LOSSY
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
include/rpl_reset.inc
-**** Result of conversions ****
-Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave
-GEOMETRY GEOMETRY ALL_NON_LOSSY <Correct value>
-BIT(1) BIT(1) ALL_NON_LOSSY <Correct value>
-DATE DATE ALL_NON_LOSSY <Correct value>
-ENUM('master',' ENUM('master',' ALL_NON_LOSSY <Correct value>
-CHAR(10) ENUM('master',' ALL_NON_LOSSY <Correct error>
-CHAR(10) SET('master','s ALL_NON_LOSSY <Correct error>
-ENUM('master',' CHAR(10) ALL_NON_LOSSY <Correct error>
-SET('master','s CHAR(10) ALL_NON_LOSSY <Correct error>
-SET('master','s SET('master','s ALL_NON_LOSSY <Correct value>
-SET('master','s SET('master','s ALL_NON_LOSSY <Correct value>
-SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct value>
-SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct value>
-SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct error>
-SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct error>
-TINYINT TINYINT ALL_NON_LOSSY <Correct value>
-TINYINT SMALLINT ALL_NON_LOSSY <Correct value>
-TINYINT MEDIUMINT ALL_NON_LOSSY <Correct value>
-TINYINT INT ALL_NON_LOSSY <Correct value>
-TINYINT BIGINT ALL_NON_LOSSY <Correct value>
-SMALLINT TINYINT ALL_NON_LOSSY <Correct error>
-SMALLINT TINYINT ALL_NON_LOSSY <Correct error>
-SMALLINT TINYINT UNSIGNE ALL_NON_LOSSY <Correct error>
-SMALLINT SMALLINT ALL_NON_LOSSY <Correct value>
-SMALLINT MEDIUMINT ALL_NON_LOSSY <Correct value>
-SMALLINT INT ALL_NON_LOSSY <Correct value>
-SMALLINT BIGINT ALL_NON_LOSSY <Correct value>
-MEDIUMINT TINYINT ALL_NON_LOSSY <Correct error>
-MEDIUMINT TINYINT ALL_NON_LOSSY <Correct error>
-MEDIUMINT TINYINT UNSIGNE ALL_NON_LOSSY <Correct error>
-MEDIUMINT SMALLINT ALL_NON_LOSSY <Correct error>
-MEDIUMINT MEDIUMINT ALL_NON_LOSSY <Correct value>
-MEDIUMINT INT ALL_NON_LOSSY <Correct value>
-MEDIUMINT BIGINT ALL_NON_LOSSY <Correct value>
-INT TINYINT ALL_NON_LOSSY <Correct error>
-INT TINYINT ALL_NON_LOSSY <Correct error>
-INT TINYINT UNSIGNE ALL_NON_LOSSY <Correct error>
-INT SMALLINT ALL_NON_LOSSY <Correct error>
-INT MEDIUMINT ALL_NON_LOSSY <Correct error>
-INT INT ALL_NON_LOSSY <Correct value>
-INT BIGINT ALL_NON_LOSSY <Correct value>
-BIGINT TINYINT ALL_NON_LOSSY <Correct error>
-BIGINT SMALLINT ALL_NON_LOSSY <Correct error>
-BIGINT MEDIUMINT ALL_NON_LOSSY <Correct error>
-BIGINT INT ALL_NON_LOSSY <Correct error>
-BIGINT BIGINT ALL_NON_LOSSY <Correct value>
-CHAR(20) CHAR(20) ALL_NON_LOSSY <Correct value>
-CHAR(20) CHAR(30) ALL_NON_LOSSY <Correct value>
-CHAR(20) CHAR(10) ALL_NON_LOSSY <Correct error>
-CHAR(20) VARCHAR(20) ALL_NON_LOSSY <Correct value>
-CHAR(20) VARCHAR(30) ALL_NON_LOSSY <Correct value>
-CHAR(20) VARCHAR(10) ALL_NON_LOSSY <Correct error>
-CHAR(20) TINYTEXT ALL_NON_LOSSY <Correct value>
-CHAR(20) TEXT ALL_NON_LOSSY <Correct value>
-CHAR(20) MEDIUMTEXT ALL_NON_LOSSY <Correct value>
-CHAR(20) LONGTEXT ALL_NON_LOSSY <Correct value>
-VARCHAR(20) VARCHAR(20) ALL_NON_LOSSY <Correct value>
-VARCHAR(20) VARCHAR(30) ALL_NON_LOSSY <Correct value>
-VARCHAR(20) VARCHAR(10) ALL_NON_LOSSY <Correct error>
-VARCHAR(20) CHAR(30) ALL_NON_LOSSY <Correct value>
-VARCHAR(20) CHAR(10) ALL_NON_LOSSY <Correct error>
-VARCHAR(20) TINYTEXT ALL_NON_LOSSY <Correct value>
-VARCHAR(20) TEXT ALL_NON_LOSSY <Correct value>
-VARCHAR(20) MEDIUMTEXT ALL_NON_LOSSY <Correct value>
-VARCHAR(20) LONGTEXT ALL_NON_LOSSY <Correct value>
-VARCHAR(500) VARCHAR(500) ALL_NON_LOSSY <Correct value>
-VARCHAR(500) VARCHAR(510) ALL_NON_LOSSY <Correct value>
-VARCHAR(500) VARCHAR(255) ALL_NON_LOSSY <Correct error>
-VARCHAR(500) TINYTEXT ALL_NON_LOSSY <Correct error>
-VARCHAR(500) TEXT ALL_NON_LOSSY <Correct value>
-VARCHAR(500) MEDIUMTEXT ALL_NON_LOSSY <Correct value>
-VARCHAR(500) LONGTEXT ALL_NON_LOSSY <Correct value>
-TINYTEXT VARCHAR(500) ALL_NON_LOSSY <Correct value>
-TEXT VARCHAR(500) ALL_NON_LOSSY <Correct error>
-MEDIUMTEXT VARCHAR(500) ALL_NON_LOSSY <Correct error>
-LONGTEXT VARCHAR(500) ALL_NON_LOSSY <Correct error>
-TINYTEXT CHAR(255) ALL_NON_LOSSY <Correct value>
-TINYTEXT CHAR(250) ALL_NON_LOSSY <Correct error>
-TEXT CHAR(255) ALL_NON_LOSSY <Correct error>
-MEDIUMTEXT CHAR(255) ALL_NON_LOSSY <Correct error>
-LONGTEXT CHAR(255) ALL_NON_LOSSY <Correct error>
-TINYTEXT TINYTEXT ALL_NON_LOSSY <Correct value>
-TINYTEXT TEXT ALL_NON_LOSSY <Correct value>
-TEXT TINYTEXT ALL_NON_LOSSY <Correct error>
-DECIMAL(10,5) DECIMAL(10,5) ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(10,6) ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(11,5) ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(11,6) ALL_NON_LOSSY <Correct value>
-DECIMAL(10,5) DECIMAL(10,4) ALL_NON_LOSSY <Correct error>
-DECIMAL(10,5) DECIMAL(9,5) ALL_NON_LOSSY <Correct error>
-DECIMAL(10,5) DECIMAL(9,4) ALL_NON_LOSSY <Correct error>
-FLOAT DECIMAL(10,5) ALL_NON_LOSSY <Correct error>
-DOUBLE DECIMAL(10,5) ALL_NON_LOSSY <Correct error>
-DECIMAL(10,5) FLOAT ALL_NON_LOSSY <Correct error>
-DECIMAL(10,5) DOUBLE ALL_NON_LOSSY <Correct error>
-FLOAT FLOAT ALL_NON_LOSSY <Correct value>
-DOUBLE DOUBLE ALL_NON_LOSSY <Correct value>
-FLOAT DOUBLE ALL_NON_LOSSY <Correct value>
-DOUBLE FLOAT ALL_NON_LOSSY <Correct error>
-BIT(5) BIT(5) ALL_NON_LOSSY <Correct value>
-BIT(5) BIT(6) ALL_NON_LOSSY <Correct value>
-BIT(6) BIT(5) ALL_NON_LOSSY <Correct error>
-BIT(5) BIT(12) ALL_NON_LOSSY <Correct value>
-BIT(12) BIT(5) ALL_NON_LOSSY <Correct error>
+**** Checking result of conversions ****
DROP TABLE type_conversions;
DROP TABLE t1;
set global slave_type_conversions = @saved_slave_type_conversions;
=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result 2011-04-07 19:57:33 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result 2011-04-21 12:36:25 +0000
@@ -38,111 +38,7 @@ ALL_LOSSY,ALL_NON_LOSSY
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
include/rpl_reset.inc
-**** Result of conversions ****
-Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave
-GEOMETRY GEOMETRY <Correct value>
-BIT(1) BIT(1) <Correct value>
-DATE DATE <Correct value>
-ENUM('master',' ENUM('master',' <Correct value>
-CHAR(10) ENUM('master',' <Correct error>
-CHAR(10) SET('master','s <Correct error>
-ENUM('master',' CHAR(10) <Correct error>
-SET('master','s CHAR(10) <Correct error>
-SET('master','s SET('master','s <Correct value>
-SET('master','s SET('master','s <Correct value>
-SET('0','1','2' SET('0','1','2' <Correct value>
-SET('0','1','2' SET('0','1','2' <Correct error>
-SET('0','1','2' SET('0','1','2' <Correct error>
-SET('0','1','2' SET('0','1','2' <Correct error>
-TINYINT TINYINT <Correct value>
-TINYINT SMALLINT <Correct error>
-TINYINT MEDIUMINT <Correct error>
-TINYINT INT <Correct error>
-TINYINT BIGINT <Correct error>
-SMALLINT TINYINT <Correct error>
-SMALLINT TINYINT <Correct error>
-SMALLINT TINYINT UNSIGNE <Correct error>
-SMALLINT SMALLINT <Correct value>
-SMALLINT MEDIUMINT <Correct error>
-SMALLINT INT <Correct error>
-SMALLINT BIGINT <Correct error>
-MEDIUMINT TINYINT <Correct error>
-MEDIUMINT TINYINT <Correct error>
-MEDIUMINT TINYINT UNSIGNE <Correct error>
-MEDIUMINT SMALLINT <Correct error>
-MEDIUMINT MEDIUMINT <Correct value>
-MEDIUMINT INT <Correct error>
-MEDIUMINT BIGINT <Correct error>
-INT TINYINT <Correct error>
-INT TINYINT <Correct error>
-INT TINYINT UNSIGNE <Correct error>
-INT SMALLINT <Correct error>
-INT MEDIUMINT <Correct error>
-INT INT <Correct value>
-INT BIGINT <Correct error>
-BIGINT TINYINT <Correct error>
-BIGINT SMALLINT <Correct error>
-BIGINT MEDIUMINT <Correct error>
-BIGINT INT <Correct error>
-BIGINT BIGINT <Correct value>
-CHAR(20) CHAR(20) <Correct value>
-CHAR(20) CHAR(30) <Correct error>
-CHAR(20) CHAR(10) <Correct error>
-CHAR(20) VARCHAR(20) <Correct error>
-CHAR(20) VARCHAR(30) <Correct error>
-CHAR(20) VARCHAR(10) <Correct error>
-CHAR(20) TINYTEXT <Correct error>
-CHAR(20) TEXT <Correct error>
-CHAR(20) MEDIUMTEXT <Correct error>
-CHAR(20) LONGTEXT <Correct error>
-VARCHAR(20) VARCHAR(20) <Correct value>
-VARCHAR(20) VARCHAR(30) <Correct error>
-VARCHAR(20) VARCHAR(10) <Correct error>
-VARCHAR(20) CHAR(30) <Correct error>
-VARCHAR(20) CHAR(10) <Correct error>
-VARCHAR(20) TINYTEXT <Correct error>
-VARCHAR(20) TEXT <Correct error>
-VARCHAR(20) MEDIUMTEXT <Correct error>
-VARCHAR(20) LONGTEXT <Correct error>
-VARCHAR(500) VARCHAR(500) <Correct value>
-VARCHAR(500) VARCHAR(510) <Correct error>
-VARCHAR(500) VARCHAR(255) <Correct error>
-VARCHAR(500) TINYTEXT <Correct error>
-VARCHAR(500) TEXT <Correct error>
-VARCHAR(500) MEDIUMTEXT <Correct error>
-VARCHAR(500) LONGTEXT <Correct error>
-TINYTEXT VARCHAR(500) <Correct error>
-TEXT VARCHAR(500) <Correct error>
-MEDIUMTEXT VARCHAR(500) <Correct error>
-LONGTEXT VARCHAR(500) <Correct error>
-TINYTEXT CHAR(255) <Correct error>
-TINYTEXT CHAR(250) <Correct error>
-TEXT CHAR(255) <Correct error>
-MEDIUMTEXT CHAR(255) <Correct error>
-LONGTEXT CHAR(255) <Correct error>
-TINYTEXT TINYTEXT <Correct value>
-TINYTEXT TEXT <Correct error>
-TEXT TINYTEXT <Correct error>
-DECIMAL(10,5) DECIMAL(10,5) <Correct value>
-DECIMAL(10,5) DECIMAL(10,6) <Correct error>
-DECIMAL(10,5) DECIMAL(11,5) <Correct error>
-DECIMAL(10,5) DECIMAL(11,6) <Correct error>
-DECIMAL(10,5) DECIMAL(10,4) <Correct error>
-DECIMAL(10,5) DECIMAL(9,5) <Correct error>
-DECIMAL(10,5) DECIMAL(9,4) <Correct error>
-FLOAT DECIMAL(10,5) <Correct error>
-DOUBLE DECIMAL(10,5) <Correct error>
-DECIMAL(10,5) FLOAT <Correct error>
-DECIMAL(10,5) DOUBLE <Correct error>
-FLOAT FLOAT <Correct value>
-DOUBLE DOUBLE <Correct value>
-FLOAT DOUBLE <Correct error>
-DOUBLE FLOAT <Correct error>
-BIT(5) BIT(5) <Correct value>
-BIT(5) BIT(6) <Correct error>
-BIT(6) BIT(5) <Correct error>
-BIT(5) BIT(12) <Correct error>
-BIT(12) BIT(5) <Correct error>
+**** Checking result of conversions ****
DROP TABLE type_conversions;
DROP TABLE t1;
set global slave_type_conversions = @saved_slave_type_conversions;
=== added file 'mysql-test/suite/rpl_ndb/t/check_conversions.inc'
--- a/mysql-test/suite/rpl_ndb/t/check_conversions.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl_ndb/t/check_conversions.inc 2011-04-21 12:36:25 +0000
@@ -0,0 +1,26 @@
+--echo **** Checking result of conversions ****
+disable_query_log;
+# Create a temporary table containing all conversions
+# that didn't work as expected, the table should
+# normally not contain any rows
+CREATE TEMPORARY TABLE failed_type_conversions ENGINE = 'MyISAM' AS
+ SELECT RPAD(Source, 15, ' ') AS Source_Type,
+ RPAD(Target, 15, ' ') AS Target_Type,
+ RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
+ IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
+ IF(Compare, '<Correct value>',
+ CONCAT("'", On_Slave, "' != '", Expected, "'")))
+ AS Value_On_Slave
+ FROM type_conversions
+ WHERE Compare != 1 OR (Compare IS NULL AND Error IS NULL);
+enable_query_log;
+
+if (`SELECT COUNT(*) FROM failed_type_conversions`)
+{
+ echo Some type conversions failed, see below:;
+ SELECT * FROM failed_type_conversions;
+ die Type conversion failure;
+}
+
+
+
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test 2011-04-07 19:57:33 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test 2011-04-20 11:50:29 +0000
@@ -42,7 +42,7 @@ set new=on;
set storage_engine=ndbcluster;
--enable_query_log
---source extra/rpl_tests/rpl_ndb_2multi_eng.test
+--source suite/rpl_ndb/t/rpl_ndb_2multi_eng.inc
--connection slave
set @@global.slave_exec_mode= 'STRICT';
=== renamed file 'mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test' => 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2multi_basic.inc'
=== renamed file 'mysql-test/extra/rpl_tests/rpl_ndb_2multi_eng.test' => 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2multi_eng.inc'
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test 2011-04-07 19:57:33 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test 2011-04-20 11:50:29 +0000
@@ -41,7 +41,7 @@ set new=on;
set storage_engine=ndbcluster;
--enable_query_log
---source extra/rpl_tests/rpl_ndb_2multi_eng.test
+--source suite/rpl_ndb/t/rpl_ndb_2multi_eng.inc
--connection slave
set @@global.slave_exec_mode= 'STRICT';
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test 2011-04-20 12:10:50 +0000
@@ -16,5 +16,5 @@ SET storage_engine=ndb;
--echo === NDB -> NDB ===
--echo
connection slave;
---source extra/rpl_tests/rpl_ndb_2multi_basic.test
+--source suite/rpl_ndb/t/rpl_ndb_2multi_basic.inc
--source include/rpl_end.inc
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test 2010-12-19 17:07:28 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test 2011-04-20 14:36:44 +0000
@@ -7,16 +7,17 @@
--source include/have_ndb.inc
--source include/have_innodb.inc
--source include/have_binlog_format_mixed_or_row.inc
+
+let $rpl_skip_start_slave= 1; # Don't start slave automatically
--source include/master-slave.inc
# On master use NDB as storage engine.
-connection master;
SET storage_engine=ndb;
--echo
--echo === NDB -> MYISAM ===
--echo
-connection slave;
+--source include/rpl_connection_slave.inc
# Remove any old ndb_apply_status from slaves datadir
let $datadir= `SELECT @@datadir`;
@@ -34,18 +35,34 @@ CREATE TABLE mysql.ndb_apply_status
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
-SET storage_engine=myisam;
---source extra/rpl_tests/rpl_ndb_2multi_basic.test
+
+# Reconfigure slave to use MyISAM as default engine
+SET @old_slave_storage_engine=@@global.storage_engine;
+SET @@global.storage_engine=myisam;
+
+--source include/start_slave.inc
+--source suite/rpl_ndb/t/rpl_ndb_2multi_basic.inc
+--source include/rpl_connection_slave.inc
+--source include/stop_slave.inc
--echo
--echo === NDB -> INNODB ===
--echo
-connection slave;
+
+# Reconfigure slave to use Innodb as default engine
+--source include/rpl_connection_slave.inc
+
alter table mysql.ndb_apply_status engine=innodb;
-SET storage_engine=innodb;
---source extra/rpl_tests/rpl_ndb_2multi_basic.test
+SET @@global.storage_engine=innodb;
+
+--source include/start_slave.inc
+--source suite/rpl_ndb/t/rpl_ndb_2multi_basic.inc
+--source include/rpl_connection_slave.inc
+--source include/stop_slave.inc
-connection slave;
+# Cleanup
+--source include/rpl_connection_slave.inc
drop table mysql.ndb_apply_status;
set @@global.slave_exec_mode= @old_slave_exec_mode;
---source include/rpl_end.inc
+SET @@global.storage_engine=@old_slave_storage_engine;
+
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_break_3_chain.cnf'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_break_3_chain.cnf 2010-11-08 12:19:51 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_break_3_chain.cnf 2011-04-26 13:48:44 +0000
@@ -34,13 +34,12 @@ ndb-log-orig
log-bin= cluster1-bin
# for performance reasons
ndb-table-temporary=1
-ndb-log-apply-status
ndb-extra-logging=99
[mysqld.1.cluster1]
-[mysqld.1.cluster2]
+[mysqld.1.cluster2]
# Connect mysqld in the second cluster as save to first mysqld
# Hardcode the host to 127.0.0.1 until running on more
# than one host and it probably need to be masked anyway
@@ -51,22 +50,16 @@ master-password= @mysqld.1.
master-user= @mysqld.1.cluster1.#user
master-connect-retry= 1
+skip-slave-start
+
log-bin= cluster2-bin
relay-log= cluster2-relay-bin
-init-rpl-role= slave
log-slave-updates
-master-retry-count= 10
ndb-log-apply-status
-# Values reported by slave when it connect to master
-# and shows up in SHOW SLAVE STATUS;
-report-host= 127.0.0.1
-report-port= @mysqld.1.cluster2.port
-report-user= root
-
loose-skip-innodb
-skip-slave-start
+default-storage-engine=myisam
# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
@@ -76,22 +69,14 @@ slave-load-tmpdir= ../../../t
rpl-recovery-rank= @mysqld.1.cluster2.server-id
[mysqld.1.cluster3]
-master-host= 127.0.0.1
-master-port= @mysqld.1.cluster2.port
-master-password= @mysqld.1.cluster2.#password
-master-user= @mysqld.1.cluster2.#user
-master-connect-retry= 1
-
log-bin= cluster3-bin
relay-log= cluster3-relay-bin
-init-rpl-role= slave
log-slave-updates
-master-retry-count= 10
ndb-log-apply-status
loose-skip-innodb
-skip-slave-start
+default-storage-engine=myisam
# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
@@ -101,18 +86,6 @@ slave-load-tmpdir= ../../../t
rpl-recovery-rank= @mysqld.1.cluster3.server-id
[ENV]
-NDB_CONNECTSTRING= @mysql_cluster.cluster1.ndb_connectstring
-MASTER_MYPORT= @mysqld.1.cluster1.port
-MASTER_MYPORT1= @mysqld.2.cluster1.port
-CLUSTER1_HOST= 127.0.0.1
-CLUSTER1_MYPORT= @mysqld.1.cluster1.port
-CLUSTER1_USER= @mysqld.1.cluster1.#user
-
-NDB_CONNECTSTRING_SLAVE= @mysql_cluster.cluster2.ndb_connectstring
-SLAVE_MYPORT= @mysqld.1.cluster2.port
-SLAVE_MYSOCK= @mysqld.1.cluster2.socket
-CLUSTER2_MYPORT= @mysqld.1.cluster2.port
-
-CLUSTER3_MYPORT= @mysqld.1.cluster3.port
-
-NDB_BACKUP_DIR= @cluster_config.ndbd.1.cluster1.BackupDataDir
+SERVER_MYPORT_1= @mysqld.1.cluster1.port
+SERVER_MYPORT_2= @mysqld.1.cluster2.port
+SERVER_MYPORT_3= @mysqld.1.cluster3.port
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_break_3_chain.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_break_3_chain.test 2010-11-08 12:19:51 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_break_3_chain.test 2011-04-26 13:48:44 +0000
@@ -1,37 +1,42 @@
--source include/have_ndb.inc
---source suite/rpl_ndb/ndb_master-slave.inc
-connect (cluster1, 127.0.0.1,root,,test,$CLUSTER1_MYPORT);
-connect (cluster2, 127.0.0.1,root,,test,$CLUSTER2_MYPORT);
-connect (cluster3, 127.0.0.1,root,,test,$CLUSTER3_MYPORT);
+# setup replication 1->2->3
+--let $rpl_topology= 1->2->3
+--source include/rpl_init.inc
+
+# create connections to first mysqld in each cluster
+--let $rpl_connection_name= cluster1
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= cluster2
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= cluster3
+--let $rpl_server_number= 3
+--source include/rpl_connect.inc
-
-# set up replication 1->2->3
---connection cluster1
+--let $rpl_connection_name= cluster1
+--source include/rpl_connection.inc
show variables like 'server_id';
-reset master;
select @cluster1_server_id:=(variable_value+0)
from information_schema.global_variables
where variable_name like 'server_id';
let $CLUSTER1_SERVER_ID= query_get_value('select @cluster1_server_id as v',v,1);
---connection cluster2
+--let $rpl_connection_name= cluster2
+--source include/rpl_connection.inc
show variables like 'server_id';
-stop slave;
-reset master;
-reset slave;
-start slave;
---connection cluster3
+--let $rpl_connection_name= cluster3
+--source include/rpl_connection.inc
show variables like 'server_id';
-stop slave;
-reset master;
-reset slave;
-start slave;
--echo First show replication 1->2->3
---connection cluster1
+--let $rpl_connection_name= cluster1
+--source include/rpl_connection.inc
use test;
create table t1(a int primary key, b varchar(50)) engine=ndb;
@@ -52,11 +57,14 @@ select * from mysql.ndb_apply_status ord
select * from test.t1;
--echo Break Cluster3's link with Cluster2
---connection cluster3
-stop slave;
+--let $rpl_connection_name= cluster3
+--source include/rpl_connection.inc
+
+--source include/stop_slave.inc
--echo Make further changes on Cluster1
---connection cluster1
+--let $rpl_connection_name= cluster1
+--source include/rpl_connection.inc
insert into test.t1 values (2, "The cotton is high");
insert into test.t1 values (3, "Daddys rich");
@@ -65,7 +73,8 @@ insert into test.t1 values (3, "Daddys r
select * from test.t1 order by a;
--echo Check data on Cluster3
---connection cluster3
+--let $rpl_connection_name= cluster3
+--source include/rpl_connection.inc
select * from test.t1 order by a;
--echo Now change Cluster3 to skip-over Cluster2 and get binlog direct from Cluster1
@@ -79,35 +88,35 @@ eval select @binlog_file_name:=log_name
where server_id = $CLUSTER1_SERVER_ID;
eval select @binlog_file_pos:=end_pos from mysql.ndb_apply_status
where server_id = $CLUSTER1_SERVER_ID;
+--enable_query_log
+--enable_result_log
let $CLUSTER1_LOG_FILE= query_get_value('select @binlog_file_name as v', v, 1);
let $CLUSTER1_LOG_POS= query_get_value('select @binlog_file_pos as v', v, 1);
-eval change master to master_host='$CLUSTER1_HOST',
- master_port=$CLUSTER1_MYPORT,
- master_user='$CLUSTER1_USER',
- master_log_file='$CLUSTER1_LOG_FILE',
- master_log_pos=$CLUSTER1_LOG_POS;
---enable_query_log
---enable_result_log
+--let $rpl_topology= 1->2, 1->3
+--let $rpl_master_log_file= 3:$CLUSTER1_LOG_FILE
+--let $rpl_master_log_pos= 3:$CLUSTER1_LOG_POS
+--source include/rpl_change_topology.inc
-start slave;
+--source include/start_slave.inc
---connection cluster1
+--let $rpl_connection_name= cluster1
+--source include/rpl_connection.inc
--sync_slave_with_master cluster3
--echo Now show that cluster 3 is successfully replicating from Cluster1
---connection cluster3
+--let $rpl_connection_name= cluster3
+--source include/rpl_connection.inc
select * from test.t1 order by a;
-
--echo Clean up
---connection cluster1
+--let $rpl_connection_name= cluster1
+--source include/rpl_connection.inc
drop table test.t1;
---sync_slave_with_master cluster2
---connection cluster1
---sync_slave_with_master cluster3
+--source include/rpl_end.inc
+
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test 2011-04-20 11:50:29 +0000
@@ -12,5 +12,5 @@
-- source include/have_binlog_format_mixed_or_row.inc
-- source suite/rpl_ndb/ndb_master-slave.inc
SET storage_engine=innodb;
---source extra/rpl_tests/rpl_ndb_2multi_eng.test
+--source suite/rpl_ndb/t/rpl_ndb_2multi_eng.inc
--source include/rpl_end.inc
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test 2011-04-19 14:34:27 +0000
@@ -12,6 +12,6 @@
--enable_query_log
let $off_set = 9;
let $rpl_format = 'MIX';
---source extra/rpl_tests/rpl_ndb_apply_status.test
+--source suite/rpl_ndb/t/rpl_ndb_xxx_innodb.inc
--source include/rpl_end.inc
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test 2011-04-20 11:50:29 +0000
@@ -11,5 +11,5 @@
-- source include/have_binlog_format_mixed_or_row.inc
-- source suite/rpl_ndb/ndb_master-slave.inc
SET storage_engine=myisam;
---source extra/rpl_tests/rpl_ndb_2multi_eng.test
+--source suite/rpl_ndb/t/rpl_ndb_2multi_eng.inc
--source include/rpl_end.inc
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test 2011-04-19 14:34:27 +0000
@@ -16,5 +16,5 @@
SET binlog_format = STATEMENT;
let $off_set = 6;
let $rpl_format = 'SBR';
---source extra/rpl_tests/rpl_ndb_apply_status.test
+--source suite/rpl_ndb/t/rpl_ndb_xxx_innodb.inc
--source include/rpl_end.inc
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test 2011-04-21 12:36:25 +0000
@@ -1,5 +1,6 @@
--- source include/have_ndb.inc
--- source suite/rpl_ndb/ndb_master-slave.inc
+--source include/have_ndb.inc
+--source include/have_binlog_format_row.inc
+--source suite/rpl_ndb/ndb_master-slave.inc
let $engine_type=NDBCLUSTER;
connection slave;
@@ -34,17 +35,8 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_L
source extra/rpl_tests/type_conversions.test;
connection slave;
---echo **** Result of conversions ****
-disable_query_log;
-SELECT RPAD(Source, 15, ' ') AS Source_Type,
- RPAD(Target, 15, ' ') AS Target_Type,
- RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
- IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
- IF(Compare, '<Correct value>',
- CONCAT("'", On_Slave, "' != '", Expected, "'")))
- AS Value_On_Slave
- FROM type_conversions;
-enable_query_log;
+--source suite/rpl_ndb/t/check_conversions.inc
+
DROP TABLE type_conversions;
connection master;
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test 2011-04-21 12:36:25 +0000
@@ -1,5 +1,6 @@
--- source include/have_ndb.inc
--- source suite/rpl_ndb/ndb_master-slave.inc
+--source include/have_ndb.inc
+--source include/have_binlog_format_row.inc
+--source suite/rpl_ndb/ndb_master-slave.inc
let $engine_type=NDBCLUSTER;
connection slave;
@@ -34,17 +35,8 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_L
source extra/rpl_tests/type_conversions.test;
connection slave;
---echo **** Result of conversions ****
-disable_query_log;
-SELECT RPAD(Source, 15, ' ') AS Source_Type,
- RPAD(Target, 15, ' ') AS Target_Type,
- RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
- IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
- IF(Compare, '<Correct value>',
- CONCAT("'", On_Slave, "' != '", Expected, "'")))
- AS Value_On_Slave
- FROM type_conversions;
-enable_query_log;
+--source suite/rpl_ndb/t/check_conversions.inc
+
DROP TABLE type_conversions;
connection master;
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test 2011-04-21 12:36:25 +0000
@@ -1,5 +1,6 @@
--- source include/have_ndb.inc
--- source suite/rpl_ndb/ndb_master-slave.inc
+--source include/have_ndb.inc
+--source include/have_binlog_format_row.inc
+--source suite/rpl_ndb/ndb_master-slave.inc
let $engine_type=NDBCLUSTER;
connection slave;
@@ -34,17 +35,8 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_N
source extra/rpl_tests/type_conversions.test;
connection slave;
---echo **** Result of conversions ****
-disable_query_log;
-SELECT RPAD(Source, 15, ' ') AS Source_Type,
- RPAD(Target, 15, ' ') AS Target_Type,
- RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
- IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
- IF(Compare, '<Correct value>',
- CONCAT("'", On_Slave, "' != '", Expected, "'")))
- AS Value_On_Slave
- FROM type_conversions;
-enable_query_log;
+--source suite/rpl_ndb/t/check_conversions.inc
+
DROP TABLE type_conversions;
connection master;
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test 2011-04-21 12:36:25 +0000
@@ -1,5 +1,6 @@
--- source include/have_ndb.inc
--- source suite/rpl_ndb/ndb_master-slave.inc
+--source include/have_ndb.inc
+--source include/have_binlog_format_row.inc
+--source suite/rpl_ndb/ndb_master-slave.inc
let $engine_type=NDBCLUSTER;
connection slave;
@@ -34,17 +35,8 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
source extra/rpl_tests/type_conversions.test;
connection slave;
---echo **** Result of conversions ****
-disable_query_log;
-SELECT RPAD(Source, 15, ' ') AS Source_Type,
- RPAD(Target, 15, ' ') AS Target_Type,
- RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
- IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
- IF(Compare, '<Correct value>',
- CONCAT("'", On_Slave, "' != '", Expected, "'")))
- AS Value_On_Slave
- FROM type_conversions;
-enable_query_log;
+--source suite/rpl_ndb/t/check_conversions.inc
+
DROP TABLE type_conversions;
connection master;
=== renamed file 'mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test' => 'mysql-test/suite/rpl_ndb/t/rpl_ndb_xxx_innodb.inc'
--- a/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_xxx_innodb.inc 2011-04-19 14:34:27 +0000
@@ -45,7 +45,7 @@ insert into t1 values (1,2);
--echo
--sync_slave_with_master
---source extra/rpl_tests/select_ndb_apply_status.inc
+--source suite/rpl_ndb/t/select_ndb_apply_status.inc
--echo
@@ -85,7 +85,7 @@ commit;
--echo
--sync_slave_with_master
---source extra/rpl_tests/select_ndb_apply_status.inc
+--source suite/rpl_ndb/t/select_ndb_apply_status.inc
connection master;
--let $binlog_start= $start_pos
@@ -158,7 +158,7 @@ SET AUTOCOMMIT=1;
--enable_query_log
--sync_slave_with_master
---source extra/rpl_tests/select_ndb_apply_status.inc
+--source suite/rpl_ndb/t/select_ndb_apply_status.inc
--echo
@@ -208,7 +208,7 @@ SET AUTOCOMMIT=1;
--echo
--sync_slave_with_master
---source extra/rpl_tests/select_ndb_apply_status.inc
+--source suite/rpl_ndb/t/select_ndb_apply_status.inc
--echo
@@ -256,7 +256,7 @@ SET AUTOCOMMIT=1;
--enable_query_log
--sync_slave_with_master
---source extra/rpl_tests/select_ndb_apply_status.inc
+--source suite/rpl_ndb/t/select_ndb_apply_status.inc
--echo
@@ -281,7 +281,7 @@ DROP DATABASE tpcb;
####### Commenting out until decision on Bug#27960 ###########
-#--source extra/rpl_tests/select_ndb_apply_status.inc
+#--source suite/rpl_ndb/t/select_ndb_apply_status.inc
#connection master;
#--eval SHOW BINLOG EVENTS in '$log_name' from $start_pos
=== renamed file 'mysql-test/extra/rpl_tests/select_ndb_apply_status.inc' => 'mysql-test/suite/rpl_ndb/t/select_ndb_apply_status.inc'
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2011-04-27 07:42:18 +0000
+++ b/sql/ha_ndbcluster.cc 2011-04-27 08:39:36 +0000
@@ -9211,7 +9211,6 @@ int ha_ndbcluster::create(const char *na
bool use_disk= FALSE;
NdbDictionary::Table::SingleUserMode single_user_mode= NdbDictionary::Table::SingleUserModeLocked;
bool ndb_sys_table= FALSE;
- partition_info *part_info;
int result= 0;
NdbDictionary::ObjectId objId;
@@ -9254,7 +9253,7 @@ int ha_ndbcluster::create(const char *na
*/
if ((my_errno= write_ndb_file(name)))
DBUG_RETURN(my_errno);
- ndbcluster_create_binlog_setup(thd, get_ndb(thd), name, strlen(name),
+ ndbcluster_create_binlog_setup(thd, ndb, name, strlen(name),
m_dbname, m_tabname, FALSE);
DBUG_RETURN(my_errno);
}
@@ -9533,8 +9532,7 @@ int ha_ndbcluster::create(const char *na
}
// Check partition info
- part_info= form->part_info;
- if ((my_errno= set_up_partition_info(part_info, form, (void*)&tab)))
+ if ((my_errno= set_up_partition_info(form->part_info, tab)))
goto abort;
if (tab.getFragmentType() == NDBTAB::HashMapPartition &&
@@ -14871,10 +14869,11 @@ void ha_ndbcluster::set_auto_partitions(
}
-int ha_ndbcluster::set_range_data(void *tab_ref, partition_info *part_info)
+int
+ha_ndbcluster::set_range_data(const partition_info *part_info,
+ NdbDictionary::Table& ndbtab) const
{
const uint num_parts = partition_info_num_parts(part_info);
- NDBTAB *tab= (NDBTAB*)tab_ref;
int error= 0;
bool unsigned_flag= part_info->part_expr->unsigned_flag;
DBUG_ENTER("set_range_data");
@@ -14903,16 +14902,18 @@ int ha_ndbcluster::set_range_data(void *
}
range_data[i]= (int32)range_val;
}
- tab->setRangeListData(range_data, num_parts);
+ ndbtab.setRangeListData(range_data, num_parts);
error:
my_free((char*)range_data, MYF(0));
DBUG_RETURN(error);
}
-int ha_ndbcluster::set_list_data(void *tab_ref, partition_info *part_info)
+
+int
+ha_ndbcluster::set_list_data(const partition_info *part_info,
+ NdbDictionary::Table& ndbtab) const
{
const uint num_list_values = partition_info_num_list_values(part_info);
- NDBTAB *tab= (NDBTAB*)tab_ref;
int32 *list_data= (int32*)my_malloc(num_list_values*2*sizeof(int32), MYF(0));
int error= 0;
bool unsigned_flag= part_info->part_expr->unsigned_flag;
@@ -14938,7 +14939,7 @@ int ha_ndbcluster::set_list_data(void *t
list_data[2*i]= (int32)list_val;
list_data[2*i+1]= list_entry->partition_id;
}
- tab->setRangeListData(list_data, 2*num_list_values);
+ ndbtab.setRangeListData(list_data, 2*num_list_values);
error:
my_free((char*)list_data, MYF(0));
DBUG_RETURN(error);
@@ -14957,18 +14958,15 @@ error:
implement the function to map to a partition.
*/
-uint ha_ndbcluster::set_up_partition_info(partition_info *part_info,
- TABLE *table,
- void *tab_par)
+int
+ha_ndbcluster::set_up_partition_info(partition_info *part_info,
+ NdbDictionary::Table& ndbtab) const
{
uint32 frag_data[MAX_PARTITIONS];
char *ts_names[MAX_PARTITIONS];
ulong fd_index= 0, i, j;
- NDBTAB *tab= (NDBTAB*)tab_par;
NDBTAB::FragmentType ftype= NDBTAB::UserDefined;
partition_element *part_elem;
- bool first= TRUE;
- uint tot_ts_name_len;
List_iterator<partition_element> part_it(part_info->partitions);
int error;
DBUG_ENTER("ha_ndbcluster::set_up_partition_info");
@@ -14982,7 +14980,7 @@ uint ha_ndbcluster::set_up_partition_inf
for (i= 0; i < part_info->part_field_list.elements; i++)
{
- NDBCOL *col= tab->getColumn(fields[i]->field_index);
+ NDBCOL *col= ndbtab.getColumn(fields[i]->field_index);
DBUG_PRINT("info",("setting dist key on %s", col->getName()));
col->setPartitionKey(TRUE);
}
@@ -15014,25 +15012,24 @@ uint ha_ndbcluster::set_up_partition_inf
col.setNullable(FALSE);
col.setPrimaryKey(FALSE);
col.setAutoIncrement(FALSE);
- tab->addColumn(col);
+ ndbtab.addColumn(col);
if (part_info->part_type == RANGE_PARTITION)
{
- if ((error= set_range_data((void*)tab, part_info)))
+ if ((error= set_range_data(part_info, ndbtab)))
{
DBUG_RETURN(error);
}
}
else if (part_info->part_type == LIST_PARTITION)
{
- if ((error= set_list_data((void*)tab, part_info)))
+ if ((error= set_list_data(part_info, ndbtab)))
{
DBUG_RETURN(error);
}
}
}
- tab->setFragmentType(ftype);
+ ndbtab.setFragmentType(ftype);
i= 0;
- tot_ts_name_len= 0;
do
{
uint ng;
@@ -15055,13 +15052,12 @@ uint ha_ndbcluster::set_up_partition_inf
frag_data[fd_index++]= ng;
} while (++j < partition_info_num_subparts(part_info));
}
- first= FALSE;
} while (++i < partition_info_num_parts(part_info));
const bool use_default_num_parts =
partition_info_use_default_num_partitions(part_info);
- tab->setDefaultNoPartitionsFlag(use_default_num_parts);
- tab->setLinearFlag(part_info->linear_hash_ind);
+ ndbtab.setDefaultNoPartitionsFlag(use_default_num_parts);
+ ndbtab.setLinearFlag(part_info->linear_hash_ind);
{
ha_rows max_rows= table_share->max_rows;
ha_rows min_rows= table_share->min_rows;
@@ -15069,12 +15065,12 @@ uint ha_ndbcluster::set_up_partition_inf
max_rows= min_rows;
if (max_rows != (ha_rows)0) /* default setting, don't set fragmentation */
{
- tab->setMaxRows(max_rows);
- tab->setMinRows(min_rows);
+ ndbtab.setMaxRows(max_rows);
+ ndbtab.setMinRows(min_rows);
}
}
- tab->setFragmentCount(fd_index);
- tab->setFragmentData(frag_data, fd_index);
+ ndbtab.setFragmentCount(fd_index);
+ ndbtab.setFragmentData(frag_data, fd_index);
DBUG_RETURN(0);
}
=== modified file 'sql/ha_ndbcluster.h'
--- a/sql/ha_ndbcluster.h 2011-04-27 07:42:18 +0000
+++ b/sql/ha_ndbcluster.h 2011-04-27 08:39:36 +0000
@@ -704,11 +704,12 @@ private:
bool check_is_pushed() const;
int create_pushed_join(NdbQueryParamValue* paramValues, uint paramOffs= 0);
- uint set_up_partition_info(partition_info *part_info,
- TABLE *table,
- void *tab);
- int set_range_data(void *tab, partition_info* part_info);
- int set_list_data(void *tab, partition_info* part_info);
+ int set_up_partition_info(partition_info *part_info,
+ NdbDictionary::Table&) const;
+ int set_range_data(const partition_info* part_info,
+ NdbDictionary::Table&) const;
+ int set_list_data(const partition_info* part_info,
+ NdbDictionary::Table&) const;
int ndb_pk_update_row(THD *thd,
const uchar *old_data, uchar *new_data,
uint32 old_part_id);
=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc 2011-04-08 13:59:44 +0000
+++ b/sql/sql_partition.cc 2011-04-20 12:50:50 +0000
@@ -3737,7 +3737,11 @@ void get_partition_set(const TABLE *tabl
part_spec->start_part= 0;
part_spec->end_part= no_parts - 1;
if ((index < MAX_KEY) &&
- key_spec && key_spec->flag == (uint)HA_READ_KEY_EXACT &&
+#ifndef MCP_BUG12380149
+ key_spec && key_spec->flag == (uint)HA_READ_KEY_EXACT &&
+#else
+ key_spec->flag == (uint)HA_READ_KEY_EXACT &&
+#endif
part_info->some_fields_in_PF.is_set(index))
{
key_info= table->key_info+index;
=== modified file 'storage/ndb/include/kernel/kernel_types.h'
--- a/storage/ndb/include/kernel/kernel_types.h 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/kernel/kernel_types.h 2011-04-19 09:01:07 +0000
@@ -61,13 +61,24 @@ struct Local_key
bool isNull() const { return m_page_no == RNIL; }
void setNull() { m_page_no= RNIL; m_file_no= m_page_idx= ~0;}
- Uint32 ref() const { return (m_page_no << MAX_TUPLES_BITS) | m_page_idx ;}
+ Uint32 ref() const { return ref(m_page_no,m_page_idx) ;}
- Local_key& assref (Uint32 ref) {
- m_page_no =ref >> MAX_TUPLES_BITS;
- m_page_idx = ref & MAX_TUPLES_PER_PAGE;
+ Local_key& assref (Uint32 ref) {
+ m_page_no = ref2page_id(ref);
+ m_page_idx = ref2page_idx(ref);
return *this;
}
+
+ static Uint32 ref(Uint32 lk1, Uint32 lk2) {
+ return (lk1 << MAX_TUPLES_BITS) | lk2;
+ }
+
+ static Uint32 ref2page_id(Uint32 ref) { return ref >> MAX_TUPLES_BITS; }
+ static Uint32 ref2page_idx(Uint32 ref) { return ref & MAX_TUPLES_PER_PAGE; }
+
+ static bool isInvalid(Uint32 lk1, Uint32 lk2) {
+ return ref(lk1, lk2) == ~Uint32(0);
+ }
};
class NdbOut&
=== modified file 'storage/ndb/include/kernel/signaldata/AccLock.hpp'
--- a/storage/ndb/include/kernel/signaldata/AccLock.hpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/kernel/signaldata/AccLock.hpp 2011-04-19 09:01:07 +0000
@@ -47,12 +47,12 @@ public:
Refused = 3,
NoFreeOp = 4
};
- STATIC_CONST( LockSignalLength = 12 );
+ STATIC_CONST( LockSignalLength = 13 );
STATIC_CONST( UndoSignalLength = 3 );
private:
Uint32 returnCode;
Uint32 requestInfo;
- Uint32 accOpPtr;
+ Uint32 accOpPtr;
// rest only if lock request
Uint32 userPtr;
Uint32 userRef;
@@ -60,7 +60,8 @@ private:
Uint32 fragId;
Uint32 fragPtrI;
Uint32 hashValue;
- Uint32 tupAddr;
+ Uint32 page_id;
+ Uint32 page_idx;
Uint32 transId1;
Uint32 transId2;
};
=== modified file 'storage/ndb/include/kernel/signaldata/NextScan.hpp'
--- a/storage/ndb/include/kernel/signaldata/NextScan.hpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/kernel/signaldata/NextScan.hpp 2011-04-19 09:01:07 +0000
@@ -49,13 +49,12 @@ class NextScanConf {
public:
// length is less if no keyinfo or no next result
STATIC_CONST( SignalLength = 11 );
- STATIC_CONST( SignalLengthNoKeyInfo = 7 );
+ STATIC_CONST( SignalLengthNoKeyInfo = 6 );
private:
Uint32 scanPtr; // scan record in LQH
Uint32 accOperationPtr;
Uint32 fragId;
Uint32 localKey[2];
- Uint32 localKeyLength;
Uint32 gci;
};
=== renamed file 'storage/ndb/include/util/azlib.h' => 'storage/ndb/include/util/ndbzio.h'
--- a/storage/ndb/include/util/azlib.h 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/util/ndbzio.h 2011-04-04 09:37:59 +0000
@@ -1,4 +1,26 @@
/*
+ Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+/*
+ This library has been brought into the 21st century.
+ - Magnus Blåudd
+*/
+
+/*
This libary has been modified for use by the MySQL Archive Engine.
-Brian Aker
*/
@@ -6,7 +28,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.3, July 18th, 2005
- Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -38,166 +60,16 @@
#ifdef __cplusplus
extern "C" {
#endif
-/* Start of MySQL Specific Information */
-
-#define AZHEADER_SIZE 29
-#define AZMETA_BUFFER_SIZE 512-AZHEADER_SIZE
-
-#define AZ_MAGIC_POS 0
-#define AZ_VERSION_POS 1
-#define AZ_MINOR_VERSION_POS 2
-#define AZ_BLOCK_POS 3
-#define AZ_STRATEGY_POS 4
-#define AZ_FRM_POS 5
-#define AZ_FRM_LENGTH_POS 9
-#define AZ_META_POS 13
-#define AZ_META_LENGTH_POS 17
-#define AZ_START_POS 21
-#define AZ_ROW_POS 29
-#define AZ_FLUSH_POS 37
-#define AZ_CHECK_POS 45
-#define AZ_AUTOINCREMENT_POS 53
-#define AZ_LONGEST_POS 61
-#define AZ_SHORTEST_POS 65
-#define AZ_COMMENT_POS 69
-#define AZ_COMMENT_LENGTH_POS 73
-#define AZ_DIRTY_POS 77
-
-
-/*
- Flags for state
-*/
-#define AZ_STATE_CLEAN 0
-#define AZ_STATE_DIRTY 1
-#define AZ_STATE_SAVED 2
-#define AZ_STATE_CRASHED 3
-
-size_t az_inflate_mem_size();
-size_t az_deflate_mem_size();
-struct az_alloc_rec {
+size_t ndbz_inflate_mem_size();
+size_t ndbz_deflate_mem_size();
+struct ndbz_alloc_rec {
size_t size;
size_t mfree;
char *mem;
};
-/*
- The 'zlib' compression library provides in-memory compression and
- decompression functions, including integrity checks of the uncompressed
- data. This version of the library supports only one compression method
- (deflation) but other algorithms will be added later and will have the same
- stream interface.
-
- Compression can be done in a single step if the buffers are large
- enough (for example if an input file is mmap'ed), or can be done by
- repeated calls of the compression function. In the latter case, the
- application must provide more input and/or consume the output
- (providing more output space) before each call.
-
- The compressed data format used by default by the in-memory functions is
- the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
- around a deflate stream, which is itself documented in RFC 1951.
-
- The library also supports reading and writing files in gzip (.gz) format
- with an interface similar to that of stdio using the functions that start
- with "gz". The gzip format is different from the zlib format. gzip is a
- gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
-
- This library can optionally read and write gzip streams in memory as well.
-
- The zlib format was designed to be compact and fast for use in memory
- and on communications channels. The gzip format was designed for single-
- file compression on file systems, has a larger header than zlib to maintain
- directory information, and uses a different, slower check method than zlib.
-
- The library does not install any signal handler. The decoder checks
- the consistency of the compressed data, so the library should never
- crash even in case of corrupted input.
-*/
-
-
-/*
- The application must update next_in and avail_in when avail_in has
- dropped to zero. It must update next_out and avail_out when avail_out
- has dropped to zero. The application must initialize zalloc, zfree and
- opaque before calling the init function. All other fields are set by the
- compression library and must not be updated by the application.
-
- The opaque value provided by the application will be passed as the first
- parameter for calls of zalloc and zfree. This can be useful for custom
- memory management. The compression library attaches no meaning to the
- opaque value.
-
- zalloc must return Z_NULL if there is not enough memory for the object.
- If zlib is used in a multi-threaded application, zalloc and zfree must be
- thread safe.
-
- On 16-bit systems, the functions zalloc and zfree must be able to allocate
- exactly 65536 bytes, but will not be required to allocate more than this
- if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
- pointers returned by zalloc for objects of exactly 65536 bytes *must*
- have their offset normalized to zero. The default allocation function
- provided by this library ensures this (see zutil.c). To reduce memory
- requirements and avoid any allocation of 64K objects, at the expense of
- compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
-
- The fields total_in and total_out can be used for statistics or
- progress reports. After compression, total_in holds the total size of
- the uncompressed data and may be saved for use in the decompressor
- (particularly if the decompressor wants to decompress everything in
- a single step).
-*/
-
- /* constants */
-
-#define Z_NO_FLUSH 0
-#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
-#define Z_SYNC_FLUSH 2
-#define Z_FULL_FLUSH 3
-#define Z_FINISH 4
-#define Z_BLOCK 5
-/* Allowed flush values; see deflate() and inflate() below for details */
-
-#define Z_OK 0
-#define Z_STREAM_END 1
-#define Z_NEED_DICT 2
-#define Z_ERRNO (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR (-3)
-#define Z_MEM_ERROR (-4)
-#define Z_BUF_ERROR (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative
- * values are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION 0
-#define Z_BEST_SPEED 1
-#define Z_BEST_COMPRESSION 9
-#define Z_DEFAULT_COMPRESSION (-1)
-/* compression levels */
-
-#define Z_FILTERED 1
-#define Z_HUFFMAN_ONLY 2
-#define Z_RLE 3
-#define Z_FIXED 4
-#define Z_DEFAULT_STRATEGY 0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY 0
-#define Z_TEXT 1
-#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
-#define Z_UNKNOWN 2
-/* Possible values of the data_type field (though see inflate()) */
-
-#define Z_DEFLATED 8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
-#define AZ_BUFSIZE_READ 32768
-#define AZ_BUFSIZE_WRITE 16384
-
-typedef struct azio_stream {
+typedef struct ndbzio_stream {
z_stream stream;
int z_err; /* error code for last stream operation */
int z_eof; /* set if end of input file */
@@ -208,7 +80,7 @@ typedef struct azio_stream {
char *msg; /* error message */
int transparent; /* 1 if input file is not a .gz file */
char mode; /* 'w' or 'r' */
- char bufalloced; /* true if azio allocated buffers */
+ char bufalloced; /* true if ndbzio allocated buffers */
my_off_t start; /* start of compressed data in file (header skipped) */
my_off_t in; /* bytes into deflate or inflate */
my_off_t out; /* bytes out of deflate or inflate */
@@ -228,10 +100,16 @@ typedef struct azio_stream {
unsigned int frm_length; /* Position for start of FRM */
unsigned int comment_start_pos; /* Position for start of comment */
unsigned int comment_length; /* Position for start of comment */
-} azio_stream;
+} ndbzio_stream;
+
+/* Return the size in bytes used for reading */
+size_t ndbz_bufsize_read(void);
+
+/* Return the size in bytes used for writing */
+size_t ndbz_bufsize_write(void);
/* basic functions */
-extern int azopen(azio_stream *s, const char *path, int Flags);
+extern int ndbzopen(ndbzio_stream *s, const char *path, int Flags);
/*
Opens a gzip (.gz) file for reading or writing. The mode parameter
is as in fopen ("rb" or "wb") but can also include a compression level
@@ -240,29 +118,30 @@ extern int azopen(azio_stream *s, const
as in "wb1R". (See the description of deflateInit2 for more information
about the strategy parameter.)
- azopen can be used to read a file which is not in gzip format; in this
+ ndbzopen can be used to read a file which is not in gzip format; in this
case gzread will directly read from the file without decompression.
- azopen returns NULL if the file could not be opened or if there was
+ ndbzopen returns NULL if the file could not be opened or if there was
insufficient memory to allocate the (de)compression state; errno
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR). */
-int azdopen(azio_stream *s,File fd, int Flags);
+int ndbzdopen(ndbzio_stream *s, File fd, int Flags);
/*
- azdopen() associates a azio_stream with the file descriptor fd. File
+ ndbzdopen() associates a ndbzio_stream with the file descriptor fd. File
descriptors are obtained from calls like open, dup, creat, pipe or
fileno (in the file has been previously opened with fopen).
- The mode parameter is as in azopen.
- The next call of gzclose on the returned azio_stream will also close the
+ The mode parameter is as in ndbzopen.
+ The next call of gzclose on the returned ndbzio_stream will also close the
file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
- descriptor fd. If you want to keep fd open, use azdopen(dup(fd), mode).
- azdopen returns NULL if there was insufficient memory to allocate
+ descriptor fd. If you want to keep fd open, use ndbzdopen(dup(fd), mode).
+ ndbzdopen returns NULL if there was insufficient memory to allocate
the (de)compression state.
*/
-extern unsigned int azread ( azio_stream *s, voidp buf, unsigned int len, int *error);
+extern unsigned int ndbzread (ndbzio_stream *s, voidp buf,
+ unsigned int len, int *error);
/*
Reads the given number of uncompressed bytes from the compressed file.
If the input file was not in gzip format, gzread copies the given number
@@ -270,15 +149,16 @@ extern unsigned int azread ( azio_stream
gzread returns the number of uncompressed bytes actually read (0 for
end of file, -1 for error). */
-extern unsigned int azwrite (azio_stream *s, const void* buf, unsigned int len);
+extern unsigned int ndbzwrite (ndbzio_stream *s, const void* buf,
+ unsigned int len);
/*
Writes the given number of uncompressed bytes into the compressed file.
- azwrite returns the number of uncompressed bytes actually written
+ ndbzwrite returns the number of uncompressed bytes actually written
(0 in case of error).
*/
-extern int azflush(azio_stream *file, int flush);
+extern int ndbzflush(ndbzio_stream *file, int flush);
/*
Flushes all pending output into the compressed file. The parameter
flush is as in the deflate() function. The return value is the zlib
@@ -288,8 +168,8 @@ extern int azflush(azio_stream *file, in
degrade compression.
*/
-extern my_off_t azseek (azio_stream *file,
- my_off_t offset, int whence);
+extern my_off_t ndbzseek (ndbzio_stream *file,
+ my_off_t offset, int whence);
/*
Sets the starting position for the next gzread or gzwrite on the
given compressed file. The offset represents a number of bytes in the
@@ -306,14 +186,14 @@ extern my_off_t azseek (azio_stream *fil
would be before the current position.
*/
-extern int azrewind(azio_stream *file);
+extern int ndbzrewind(ndbzio_stream *file);
/*
Rewinds the given file. This function is supported only for reading.
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
*/
-extern my_off_t aztell(azio_stream *file);
+extern my_off_t ndbztell(ndbzio_stream *file);
/*
Returns the starting position for the next gzread or gzwrite on the
given compressed file. This position represents a number of bytes in the
@@ -322,17 +202,17 @@ extern my_off_t aztell(azio_stream *file
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
*/
-extern int azclose(azio_stream *file);
+extern int ndbzclose(ndbzio_stream *file);
/*
Flushes all pending output if necessary, closes the compressed file
and deallocates all the (de)compression state. The return value is the zlib
error number (see function gzerror below).
*/
-extern int azwrite_frm (azio_stream *s, char *blob, unsigned int length);
-extern int azread_frm (azio_stream *s, char *blob);
-extern int azwrite_comment (azio_stream *s, char *blob, unsigned int length);
-extern int azread_comment (azio_stream *s, char *blob);
+/*
+ Return file size of the open ndbzio_stream
+*/
+extern int ndbz_file_size(ndbzio_stream *file, size_t *size);
#ifdef __cplusplus
}
=== modified file 'storage/ndb/ndb_configure.m4'
--- a/storage/ndb/ndb_configure.m4 2011-03-31 07:22:08 +0000
+++ b/storage/ndb/ndb_configure.m4 2011-04-27 08:39:36 +0000
@@ -2,7 +2,7 @@
# Should be updated when creating a new NDB version
NDB_VERSION_MAJOR=7
NDB_VERSION_MINOR=0
-NDB_VERSION_BUILD=24
+NDB_VERSION_BUILD=25
NDB_VERSION_STATUS=""
dnl for build ndb docs
=== modified file 'storage/ndb/src/common/debugger/signaldata/AccLock.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/AccLock.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/AccLock.cpp 2011-04-19 09:01:07 +0000
@@ -70,7 +70,7 @@ printACC_LOCKREQ(FILE* output, const Uin
fprintf(output, " userPtr: 0x%x userRef: 0x%x\n", sig->userPtr, sig->userRef);
fprintf(output, " table: id=%u", sig->tableId);
fprintf(output, " fragment: id=%u ptr=0x%x\n", sig->fragId, sig->fragPtrI);
- fprintf(output, " tuple: addr=0x%x hashValue=%x\n", sig->tupAddr, sig->hashValue);
+ fprintf(output, " tuple: addr=%u/%u hashValue=%x\n", sig->page_id, sig->page_idx, sig->hashValue);
fprintf(output, " transid: %08x %08x\n", sig->transId1, sig->transId2);
}
return true;
=== modified file 'storage/ndb/src/common/util/CMakeLists.txt'
--- a/storage/ndb/src/common/util/CMakeLists.txt 2011-02-02 00:40:07 +0000
+++ b/storage/ndb/src/common/util/CMakeLists.txt 2011-04-01 11:46:04 +0000
@@ -26,7 +26,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOUR
ADD_DEFINITIONS(-DNO_DUMMY_DECL)
ADD_LIBRARY(ndbgeneral STATIC
- azio.c
+ ndbzio.c
File.cpp
md5_hash.cpp
Properties.cpp
=== modified file 'storage/ndb/src/common/util/Makefile.am'
--- a/storage/ndb/src/common/util/Makefile.am 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/util/Makefile.am 2011-04-01 11:46:04 +0000
@@ -31,7 +31,7 @@ libgeneral_la_SOURCES = \
INCLUDES_LOC = @ZLIB_INCLUDES@
-libndbazio_la_SOURCES = azio.c
+libndbazio_la_SOURCES = ndbzio.c
libndbazio_la_LIBADD = @ZLIB_LIBS@
noinst_PROGRAMS = BaseString-t HashMap-t Bitmask-t SparseBitmask-t ndb_version-t
=== renamed file 'storage/ndb/src/common/util/azio.c' => 'storage/ndb/src/common/util/ndbzio.c'
--- a/storage/ndb/src/common/util/azio.c 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/util/ndbzio.c 2011-04-18 14:15:23 +0000
@@ -1,4 +1,27 @@
/*
+ Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+/*
+ ndbzio is a modified version of azio with a cleaner interface.
+
+ - Magnus Blåudd
+*/
+
+/*
azio is a modified version of gzio. It makes use of mysys and removes mallocs.
-Brian Aker
*/
@@ -11,7 +34,7 @@
*/
/* gzio.c -- IO on .gz files
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*
*/
@@ -28,7 +51,7 @@
#include "../../../../zlib/inflate.h"
#include "../../../../zlib/deflate.h"
-#include <util/azlib.h>
+#include <util/ndbzio.h>
#include <my_sys.h>
@@ -39,6 +62,42 @@
#define VALGRIND_MAKE_MEM_NOACCESS(a,b) do {} while(0);
#endif
+/* Start of MySQL Specific Information */
+
+
+#define AZHEADER_SIZE 29
+#define AZMETA_BUFFER_SIZE 512-AZHEADER_SIZE
+
+#define AZ_MAGIC_POS 0
+#define AZ_VERSION_POS 1
+#define AZ_MINOR_VERSION_POS 2
+#define AZ_BLOCK_POS 3
+#define AZ_STRATEGY_POS 4
+#define AZ_FRM_POS 5
+#define AZ_FRM_LENGTH_POS 9
+#define AZ_META_POS 13
+#define AZ_META_LENGTH_POS 17
+#define AZ_START_POS 21
+#define AZ_ROW_POS 29
+#define AZ_FLUSH_POS 37
+#define AZ_CHECK_POS 45
+#define AZ_AUTOINCREMENT_POS 53
+#define AZ_LONGEST_POS 61
+#define AZ_SHORTEST_POS 65
+#define AZ_COMMENT_POS 69
+#define AZ_COMMENT_LENGTH_POS 73
+#define AZ_DIRTY_POS 77
+
+
+/*
+ Flags for state
+*/
+#define AZ_STATE_CLEAN 0
+#define AZ_STATE_DIRTY 1
+#define AZ_STATE_SAVED 2
+#define AZ_STATE_CRASHED 3
+
+
static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
static int const az_magic[3] = {0xfe, 0x03, 0x01}; /* az magic header */
@@ -52,24 +111,24 @@ static int const az_magic[3] = {0xfe, 0x
#define AZ_MEMLEVEL 8
-int az_open(azio_stream *s, const char *path, int Flags, File fd);
-int do_flush(azio_stream *file, int flush);
-int get_byte(azio_stream *s);
-unsigned char* get_block(azio_stream *s, int blksz);
-int check_header(azio_stream *s);
-int write_header(azio_stream *s);
-int destroy(azio_stream *s);
-void putLong(azio_stream *s, uLong x);
-uLong getLong(azio_stream *s);
-void read_header(azio_stream *s, unsigned char *buffer);
+static int ndbz_open(ndbzio_stream *s, const char *path, int Flags, File fd);
+static int do_flush(ndbzio_stream *file, int flush);
+static int get_byte(ndbzio_stream *s);
+static unsigned char* get_block(ndbzio_stream *s, int blksz);
+static int check_header(ndbzio_stream *s);
+static int write_header(ndbzio_stream *s);
+static int destroy(ndbzio_stream *s);
+static void putLong(ndbzio_stream *s, uLong x);
+static uLong getLong(ndbzio_stream *s);
+static void read_header(ndbzio_stream *s, unsigned char *buffer);
-size_t az_inflate_mem_size()
+size_t ndbz_inflate_mem_size()
{
return sizeof(struct inflate_state) /* state */
+ ((1U << MAX_WBITS)*sizeof(unsigned char)); /* window */
}
-size_t az_deflate_mem_size()
+size_t ndbz_deflate_mem_size()
{
return sizeof(deflate_state)
+ ((1U << MAX_WBITS)*(2*sizeof(Byte))) /* window = wsize,2*|Byte| */
@@ -79,10 +138,10 @@ size_t az_deflate_mem_size()
*/
}
-voidpf az_alloc(voidpf opaque, uInt items, uInt size)
+voidpf ndbz_alloc(voidpf opaque, uInt items, uInt size)
{
void * retval;
- struct az_alloc_rec *r = (struct az_alloc_rec*)opaque;
+ struct ndbz_alloc_rec *r = (struct ndbz_alloc_rec*)opaque;
if((items * size) > r->mfree || r->mfree==0)
abort();
@@ -96,12 +155,12 @@ voidpf az_alloc(voidpf opaque, uInt item
return retval;
}
-void az_free(voidpf opaque, voidpf address)
+void ndbz_free(voidpf opaque, voidpf address)
{
- struct az_alloc_rec *r;
+ struct ndbz_alloc_rec *r;
(void)address;
/* Oh how we hack. */
- r = (struct az_alloc_rec*)opaque;
+ r = (struct ndbz_alloc_rec*)opaque;
r->mfree= r->size;
if(r->mfree==r->size)
VALGRIND_MAKE_MEM_NOACCESS(r->mem,r->size);
@@ -136,11 +195,24 @@ static inline int posix_memalign(void **
}
#endif
+#define AZ_BUFSIZE_READ 32768
+#define AZ_BUFSIZE_WRITE 16384
+
+size_t ndbz_bufsize_read(void)
+{
+ return AZ_BUFSIZE_READ;
+}
+
+size_t ndbz_bufsize_write(void)
+{
+ return AZ_BUFSIZE_WRITE;
+}
+
/* ===========================================================================
Opens a gzip (.gz) file for reading or writing. The mode parameter
is as in fopen ("rb" or "wb"). The file is given either by file descriptor
or path name (if fd == -1).
- az_open returns NULL if the file could not be opened or if there was
+ ndbz_open returns NULL if the file could not be opened or if there was
insufficient memory to allocate the (de)compression state; errno
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR).
@@ -149,7 +221,7 @@ static inline int posix_memalign(void **
NOTE: If called without a fd, my_open *WILL* malloc()
*/
-int az_open (azio_stream *s, const char *path, int Flags, File fd)
+int ndbz_open (ndbzio_stream *s, const char *path, int Flags, File fd)
{
int err;
int level = Z_DEFAULT_COMPRESSION; /* compression level */
@@ -157,10 +229,9 @@ int az_open (azio_stream *s, const char
if(s->stream.opaque)
{
- s->stream.zalloc = (alloc_func)az_alloc;
- s->stream.zfree = (free_func)az_free;
+ s->stream.zalloc = (alloc_func)ndbz_alloc;
+ s->stream.zfree = (free_func)ndbz_free;
}
-/* s->stream.opaque = (voidpf)r; */
s->bufalloced = 0;
if(!s->inbuf)
{
@@ -196,8 +267,8 @@ int az_open (azio_stream *s, const char
We do our own version of append by nature.
We must always have write access to take card of the header.
*/
- DBUG_ASSERT(Flags | O_APPEND);
- DBUG_ASSERT(Flags | O_WRONLY);
+ assert(Flags | O_APPEND);
+ assert(Flags | O_WRONLY);
if (Flags & O_RDWR || Flags & O_WRONLY)
s->mode = 'w';
@@ -279,7 +350,7 @@ int az_open (azio_stream *s, const char
}
-int write_header(azio_stream *s)
+int write_header(ndbzio_stream *s)
{
char *buffer= (char*)s->outbuf;
char *ptr= buffer;
@@ -325,31 +396,31 @@ int write_header(azio_stream *s)
/* ===========================================================================
Opens a gzip (.gz) file for reading or writing.
*/
-int azopen(azio_stream *s, const char *path, int Flags)
+int ndbzopen(ndbzio_stream *s, const char *path, int Flags)
{
- return az_open(s, path, Flags, -1);
+ return ndbz_open(s, path, Flags, -1);
}
/* ===========================================================================
Associate a gzFile with the file descriptor fd. fd is not dup'ed here
to mimic the behavio(u)r of fdopen.
*/
-int azdopen(azio_stream *s, File fd, int Flags)
+int ndbzdopen(ndbzio_stream *s, File fd, int Flags)
{
if (fd < 0) return 0;
- return az_open (s, NULL, Flags, fd);
+ return ndbz_open (s, NULL, Flags, fd);
}
/*
- Read from azio_stream into buffer.
+ Read from ndbzio_stream into buffer.
Reads up to AZ_BUFSIZE_READ bytes.
Number of Bytes read is in: s->stream.avail_in
return 0 on success
*/
-int read_buffer(azio_stream *s)
+int read_buffer(ndbzio_stream *s)
{
if (s->z_eof) return EOF;
my_errno= 0;
@@ -368,12 +439,11 @@ int read_buffer(azio_stream *s)
}
/*
- Read a byte from a azio_stream; update next_in and avail_in.
+ Read a byte from a ndbzio_stream; update next_in and avail_in.
returns EOF on error;
*/
-int get_byte(s)
- azio_stream *s;
+int get_byte(ndbzio_stream *s)
{
if (s->stream.avail_in == 0)
if(read_buffer(s))
@@ -387,7 +457,7 @@ int get_byte(s)
* *MUST* be < buffer size
* *MUST* be aligned to IO size (i.e. not be only partially in buffer)
*/
-unsigned char* get_block(azio_stream *s,int blksz)
+unsigned char* get_block(ndbzio_stream *s,int blksz)
{
unsigned char *r= s->stream.next_in;
if (s->stream.avail_in == 0)
@@ -400,7 +470,7 @@ unsigned char* get_block(azio_stream *s,
}
/* ===========================================================================
- Check the gzip header of a azio_stream opened for reading. Set the stream
+ Check the gzip header of a ndbzio_stream opened for reading. Set the stream
mode to transparent if the gzip magic header is not present; set s->err
to Z_DATA_ERROR if the magic header is present but the rest of the header
is incorrect.
@@ -408,7 +478,7 @@ unsigned char* get_block(azio_stream *s,
s->stream.avail_in is zero for the first time, but may be non-zero
for concatenated .gz files.
*/
-int check_header(azio_stream *s)
+int check_header(ndbzio_stream *s)
{
int method; /* method uchar */
int flags; /* flags uchar */
@@ -476,7 +546,7 @@ int check_header(azio_stream *s)
else
{
s->transparent = 1;
- azseek(s,0,SEEK_SET);
+ ndbzseek(s,0,SEEK_SET);
s->z_err = Z_OK;
return 0;
@@ -485,7 +555,7 @@ int check_header(azio_stream *s)
return 0;
}
-void read_header(azio_stream *s, unsigned char *buffer)
+void read_header(ndbzio_stream *s, unsigned char *buffer)
{
if (buffer[0] == az_magic[0] && buffer[1] == az_magic[1])
{
@@ -507,17 +577,16 @@ void read_header(azio_stream *s, unsigne
}
else
{
- DBUG_ASSERT(buffer[0] == az_magic[0] && buffer[1] == az_magic[1]);
+ assert(buffer[0] == az_magic[0] && buffer[1] == az_magic[1]);
return;
}
}
/* ===========================================================================
- * Cleanup then free the given azio_stream. Return a zlib error code.
+ * Cleanup then free the given ndbzio_stream. Return a zlib error code.
Try freeing in the reverse order of allocations.
*/
-int destroy (s)
- azio_stream *s;
+int destroy (ndbzio_stream *s)
{
int err = Z_OK;
@@ -547,9 +616,9 @@ int destroy (s)
/* ===========================================================================
Reads the given number of uncompressed bytes from the compressed file.
- azread returns the number of bytes actually read (0 for end of file).
+ ndbzread returns the number of bytes actually read (0 for end of file).
*/
-unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, unsigned int len, int *error)
+unsigned int ZEXPORT ndbzread ( ndbzio_stream *s, voidp buf, unsigned int len, int *error)
{
Bytef *start = (Bytef*)buf; /* starting point for crc computation */
Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
@@ -677,7 +746,7 @@ unsigned int ZEXPORT azread ( azio_strea
/*
Write last remaining 512 byte block of write buffer, 0 padded.
*/
-int flush_write_buffer(azio_stream *s)
+int flush_write_buffer(ndbzio_stream *s)
{
uInt real_len = AZ_BUFSIZE_WRITE - s->stream.avail_out;
uInt len = ((real_len+0x1FF)>>9)<<9;
@@ -693,7 +762,7 @@ int flush_write_buffer(azio_stream *s)
return 0;
}
-int write_buffer(azio_stream *s)
+int write_buffer(ndbzio_stream *s)
{
if (s->stream.avail_out == 0)
{
@@ -711,9 +780,9 @@ int write_buffer(azio_stream *s)
/* ===========================================================================
Writes the given number of uncompressed bytes into the compressed file.
- azwrite returns the number of bytes actually written (0 in case of error).
+ ndbzwrite returns the number of bytes actually written (0 in case of error).
*/
-unsigned int azwrite (azio_stream *s, const void* buf, unsigned int len)
+unsigned int ndbzwrite (ndbzio_stream *s, const void* buf, unsigned int len)
{
unsigned int i;
s->stream.next_in = (Bytef*)buf;
@@ -751,7 +820,7 @@ unsigned int azwrite (azio_stream *s, co
Flushes all pending output into the compressed file. The parameter
flush is as in the deflate() function.
*/
-int do_flush (azio_stream *s, int flush)
+int do_flush (ndbzio_stream *s, int flush)
{
uInt len;
int done = 0;
@@ -786,20 +855,10 @@ int do_flush (azio_stream *s, int flush)
else
s->dirty= AZ_STATE_SAVED; /* Mark it clean, we should be good now */
-/* afterwrite_pos= my_tell(s->file, MYF(0));
- if(afterwrite_pos == -1)
- return Z_ERRNO;
- if(write_header(s) == -1)
- return Z_ERRNO;
- if(my_seek(s->file, afterwrite_pos, SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR)
- return Z_ERRNO;
-*/
return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
}
-int ZEXPORT azflush (s, flush)
- azio_stream *s;
- int flush;
+int ZEXPORT ndbzflush (ndbzio_stream *s, int flush)
{
int err;
@@ -828,8 +887,7 @@ int ZEXPORT azflush (s, flush)
/* ===========================================================================
Rewinds input file.
*/
-int azrewind (s)
- azio_stream *s;
+int ndbzrewind (ndbzio_stream *s)
{
if (s == NULL || s->mode != 'r') return -1;
@@ -846,17 +904,14 @@ int azrewind (s)
}
/* ===========================================================================
- Sets the starting position for the next azread or azwrite on the given
+ Sets the starting position for the next ndbzread or ndbzwrite on the given
compressed file. The offset represents a number of bytes in the
- azseek returns the resulting offset location as measured in bytes from
+ ndbzseek returns the resulting offset location as measured in bytes from
the beginning of the uncompressed stream, or -1 in case of error.
SEEK_END is not implemented, returns error.
- In this version of the library, azseek can be extremely slow.
+ In this version of the library, ndbzseek can be extremely slow.
*/
-my_off_t azseek (s, offset, whence)
- azio_stream *s;
- my_off_t offset;
- int whence;
+my_off_t ndbzseek (ndbzio_stream *s, my_off_t offset, int whence)
{
if (s == NULL || whence == SEEK_END ||
@@ -876,7 +931,7 @@ my_off_t azseek (s, offset, whence)
uInt size = AZ_BUFSIZE_WRITE;
if (offset < AZ_BUFSIZE_WRITE) size = (uInt)offset;
- size = azwrite(s, s->inbuf, size);
+ size = ndbzwrite(s, s->inbuf, size);
if (size == 0) return -1L;
offset -= size;
@@ -904,7 +959,7 @@ my_off_t azseek (s, offset, whence)
/* For a negative seek, rewind and use positive seek */
if (offset >= s->out) {
offset -= s->out;
- } else if (azrewind(s)) {
+ } else if (ndbzrewind(s)) {
return -1L;
}
/* offset is now the number of bytes to skip. */
@@ -920,7 +975,7 @@ my_off_t azseek (s, offset, whence)
unsigned int size = AZ_BUFSIZE_READ;
if (offset < AZ_BUFSIZE_READ) size = (int)offset;
- size = azread(s, s->outbuf, size, &error);
+ size = ndbzread(s, s->outbuf, size, &error);
if (error <= 0) return -1L;
offset -= size;
}
@@ -928,21 +983,20 @@ my_off_t azseek (s, offset, whence)
}
/* ===========================================================================
- Returns the starting position for the next azread or azwrite on the
+ Returns the starting position for the next ndbzread or ndbzwrite on the
given compressed file. This position represents a number of bytes in the
uncompressed data stream.
*/
-my_off_t ZEXPORT aztell (file)
- azio_stream *file;
+my_off_t ZEXPORT ndbztell (ndbzio_stream *file)
{
- return azseek(file, 0L, SEEK_CUR);
+ return ndbzseek(file, 0L, SEEK_CUR);
}
/* ===========================================================================
- Outputs a long in LSB order to the given azio_stream
+ Outputs a long in LSB order to the given ndbzio_stream
*/
-void putLong (azio_stream *s, uLong x)
+void putLong (ndbzio_stream *s, uLong x)
{
int n;
@@ -957,10 +1011,10 @@ void putLong (azio_stream *s, uLong x)
}
/* ===========================================================================
- Reads a long in LSB order from the given azio_stream. Sets z_err in case
+ Reads a long in LSB order from the given ndbzio_stream. Sets z_err in case
of error.
*/
-uLong getLong (azio_stream *s)
+uLong getLong (ndbzio_stream *s)
{
uLong x = (uLong)get_byte(s);
int c;
@@ -977,7 +1031,7 @@ uLong getLong (azio_stream *s)
Flushes all pending output if necessary, closes the compressed file
and deallocates all the (de)compression state.
*/
-int azclose (azio_stream *s)
+int ndbzclose (ndbzio_stream *s)
{
if (s == NULL) return Z_STREAM_ERROR;
@@ -997,73 +1051,23 @@ int azclose (azio_stream *s)
putLong(s, 0x4E444244);
flush_write_buffer(s);
-
-/* write_header(s); */
}
return destroy(s);
}
-/*
- Though this was added to support MySQL's FRM file, anything can be
- stored in this location.
-*/
-int azwrite_frm(azio_stream *s, char *blob, unsigned int length)
-{
- if (s->mode == 'r')
- return 1;
-
- if (s->rows > 0)
- return 1;
-
- s->frm_start_pos= (uint) s->start;
- s->frm_length= length;
- s->start+= length;
-
- my_pwrite(s->file, (uchar*) blob, s->frm_length, s->frm_start_pos, MYF(0));
-
- write_header(s);
- my_seek(s->file, 0, MY_SEEK_END, MYF(0));
-
- return 0;
-}
-
-int azread_frm(azio_stream *s, char *blob)
-{
- my_pread(s->file, (uchar*) blob, s->frm_length, s->frm_start_pos, MYF(0));
-
- return 0;
-}
+#include <my_dir.h> // MY_STAT, my_fstat
-
-/*
- Simple comment field
-*/
-int azwrite_comment(azio_stream *s, char *blob, unsigned int length)
+int ndbz_file_size(ndbzio_stream *s, size_t *size)
{
- if (s->mode == 'r')
- return 1;
-
- if (s->rows > 0)
- return 1;
-
- s->comment_start_pos= (uint) s->start;
- s->comment_length= length;
- s->start+= length;
-
- my_pwrite(s->file, (uchar*) blob, s->comment_length, s->comment_start_pos,
- MYF(0));
-
- write_header(s);
- my_seek(s->file, 0, MY_SEEK_END, MYF(0));
+ MY_STAT stat_buf;
- return 0;
-}
+ if (s == NULL || size == NULL)
+ return -1;
-int azread_comment(azio_stream *s, char *blob)
-{
- my_pread(s->file, (uchar*) blob, s->comment_length, s->comment_start_pos,
- MYF(0));
+ if (my_fstat(s->file, &stat_buf, 0) != 0)
+ return -1;
- return 0;
+ *size = stat_buf.st_size;
+ return 0; /* OK */
}
=== modified file 'storage/ndb/src/kernel/blocks/backup/read.cpp'
--- a/storage/ndb/src/kernel/blocks/backup/read.cpp 2011-02-01 21:05:11 +0000
+++ b/storage/ndb/src/kernel/blocks/backup/read.cpp 2011-04-04 08:30:10 +0000
@@ -24,26 +24,26 @@
#include <AttributeHeader.hpp>
#include <SimpleProperties.hpp>
#include <ndb_version.h>
-#include <util/azlib.h>
+#include <util/ndbzio.h>
-bool readHeader(azio_stream*, BackupFormat::FileHeader *);
-bool readFragHeader(azio_stream*, BackupFormat::DataFile::FragmentHeader *);
-bool readFragFooter(azio_stream*, BackupFormat::DataFile::FragmentFooter *);
-Int32 readRecord(azio_stream*, Uint32 **);
+bool readHeader(ndbzio_stream*, BackupFormat::FileHeader *);
+bool readFragHeader(ndbzio_stream*, BackupFormat::DataFile::FragmentHeader *);
+bool readFragFooter(ndbzio_stream*, BackupFormat::DataFile::FragmentFooter *);
+Int32 readRecord(ndbzio_stream*, Uint32 **);
NdbOut & operator<<(NdbOut&, const BackupFormat::FileHeader &);
NdbOut & operator<<(NdbOut&, const BackupFormat::DataFile::FragmentHeader &);
NdbOut & operator<<(NdbOut&, const BackupFormat::DataFile::FragmentFooter &);
-bool readTableList(azio_stream*, BackupFormat::CtlFile::TableList **);
-bool readTableDesc(azio_stream*, BackupFormat::CtlFile::TableDescription **);
-bool readGCPEntry(azio_stream*, BackupFormat::CtlFile::GCPEntry **);
+bool readTableList(ndbzio_stream*, BackupFormat::CtlFile::TableList **);
+bool readTableDesc(ndbzio_stream*, BackupFormat::CtlFile::TableDescription **);
+bool readGCPEntry(ndbzio_stream*, BackupFormat::CtlFile::GCPEntry **);
NdbOut & operator<<(NdbOut&, const BackupFormat::CtlFile::TableList &);
NdbOut & operator<<(NdbOut&, const BackupFormat::CtlFile::TableDescription &);
NdbOut & operator<<(NdbOut&, const BackupFormat::CtlFile::GCPEntry &);
-Int32 readLogEntry(azio_stream*, Uint32**);
+Int32 readLogEntry(ndbzio_stream*, Uint32**);
static Uint32 recNo;
static Uint32 logEntryNo;
@@ -57,18 +57,18 @@ main(int argc, const char * argv[]){
exit(1);
}
- azio_stream fo;
+ ndbzio_stream fo;
bzero(&fo, sizeof(fo));
- int r= azopen(&fo,argv[1], O_RDONLY);
-
- if(fo.file < 0)
+ int r= ndbzopen(&fo,argv[1], O_RDONLY);
+
+ if(r != 1)
{
- ndbout << "Failed to open" << argv[1] << endl;
- ndbout_c("file: %d r: %d", fo.file, r);
+ ndbout_c("Failed to open file '%s', error: %d",
+ argv[1], r);
exit(1);
}
- azio_stream* f = &fo;
+ ndbzio_stream* f = &fo;
BackupFormat::FileHeader fileHeader;
if(!readHeader(f, &fileHeader)){
@@ -215,7 +215,7 @@ main(int argc, const char * argv[]){
<< fileHeader.FileType << endl;
break;
}
- azclose(f);
+ ndbzclose(f);
return 0;
}
@@ -226,10 +226,10 @@ static bool endian = false;
static
inline
size_t
-aread(void * buf, size_t sz, size_t n, azio_stream* f)
+aread(void * buf, size_t sz, size_t n, ndbzio_stream* f)
{
int error = 0;
- unsigned r = azread(f, buf, (sz * n), &error);
+ unsigned r = ndbzread(f, buf, (sz * n), &error);
if (error || r != (sz * n))
{
printf("Failed to read!!");
@@ -239,7 +239,7 @@ aread(void * buf, size_t sz, size_t n, a
}
bool
-readHeader(azio_stream* f, BackupFormat::FileHeader * dst){
+readHeader(ndbzio_stream* f, BackupFormat::FileHeader * dst){
if(aread(dst, 4, 3, f) != 3)
RETURN_FALSE();
@@ -292,7 +292,7 @@ readHeader(azio_stream* f, BackupFormat:
}
bool
-readFragHeader(azio_stream* f, BackupFormat::DataFile::FragmentHeader * dst){
+readFragHeader(ndbzio_stream* f, BackupFormat::DataFile::FragmentHeader * dst){
if(aread(dst, 1, sizeof(* dst), f) != sizeof(* dst))
return false;
@@ -314,7 +314,7 @@ readFragHeader(azio_stream* f, BackupFor
}
bool
-readFragFooter(azio_stream* f, BackupFormat::DataFile::FragmentFooter * dst){
+readFragFooter(ndbzio_stream* f, BackupFormat::DataFile::FragmentFooter * dst){
if(aread(dst, 1, sizeof(* dst), f) != sizeof(* dst))
RETURN_FALSE();
@@ -343,7 +343,7 @@ static union {
} theData;
Int32
-readRecord(azio_stream* f, Uint32 **dst){
+readRecord(ndbzio_stream* f, Uint32 **dst){
Uint32 len;
if(aread(&len, 1, 4, f) != 4)
RETURN_FALSE();
@@ -367,7 +367,7 @@ readRecord(azio_stream* f, Uint32 **dst)
}
Int32
-readLogEntry(azio_stream* f, Uint32 **dst){
+readLogEntry(ndbzio_stream* f, Uint32 **dst){
Uint32 len;
if(aread(&len, 1, 4, f) != 4)
RETURN_FALSE();
@@ -435,7 +435,7 @@ NdbOut & operator<<(NdbOut& ndbout,
}
bool
-readTableList(azio_stream* f, BackupFormat::CtlFile::TableList **ret){
+readTableList(ndbzio_stream* f, BackupFormat::CtlFile::TableList **ret){
BackupFormat::CtlFile::TableList * dst = &theData.TableList;
if(aread(dst, 4, 2, f) != 2)
@@ -461,7 +461,7 @@ readTableList(azio_stream* f, BackupForm
}
bool
-readTableDesc(azio_stream* f, BackupFormat::CtlFile::TableDescription **ret){
+readTableDesc(ndbzio_stream* f, BackupFormat::CtlFile::TableDescription **ret){
BackupFormat::CtlFile::TableDescription * dst = &theData.TableDescription;
if(aread(dst, 4, 3, f) != 3)
@@ -484,7 +484,7 @@ readTableDesc(azio_stream* f, BackupForm
}
bool
-readGCPEntry(azio_stream* f, BackupFormat::CtlFile::GCPEntry **ret){
+readGCPEntry(ndbzio_stream* f, BackupFormat::CtlFile::GCPEntry **ret){
BackupFormat::CtlFile::GCPEntry * dst = &theData.GcpEntry;
if(aread(dst, 4, 4, f) != 4)
=== modified file 'storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp'
--- a/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp 2011-04-19 09:01:07 +0000
@@ -773,7 +773,7 @@ private:
void increaselistcont(Signal* signal);
void seizeLeftlist(Signal* signal);
void seizeRightlist(Signal* signal);
- Uint32 readTablePk(Uint32 localkey1, Uint32 eh, OperationrecPtr);
+ Uint32 readTablePk(Uint32 lkey1, Uint32 lkey2, Uint32 eh, OperationrecPtr);
Uint32 getElement(Signal* signal, OperationrecPtr& lockOwner);
void getdirindex(Signal* signal);
void commitdelete(Signal* signal);
=== modified file 'storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp 2011-04-20 11:58:16 +0000
@@ -1008,6 +1008,10 @@ void Dbacc::initOpRec(Signal* signal)
// bit to mark lock operation
// undo log is not run via ACCKEYREQ
+ if (operationRecPtr.p->tupkeylen == 0)
+ {
+ ndbassert(signal->getLength() == 9);
+ }
}//Dbacc::initOpRec()
/* --------------------------------------------------------------------------------- */
@@ -1020,10 +1024,8 @@ void Dbacc::sendAcckeyconf(Signal* signa
signal->theData[2] = operationRecPtr.p->fid;
signal->theData[3] = operationRecPtr.p->localdata[0];
signal->theData[4] = operationRecPtr.p->localdata[1];
- signal->theData[5] = fragrecptr.p->localkeylen;
}//Dbacc::sendAcckeyconf()
-
void
Dbacc::ACCKEY_error(Uint32 fromWhere)
{
@@ -1516,8 +1518,9 @@ Dbacc::accIsLockedLab(Signal* signal, Op
}
else
{
- if (!(lockOwnerPtr.p->m_op_bits & Operationrec::OP_ELEMENT_DISAPPEARED) &&
- lockOwnerPtr.p->localdata[0] != ~(Uint32)0)
+ if (! (lockOwnerPtr.p->m_op_bits & Operationrec::OP_ELEMENT_DISAPPEARED) &&
+ ! Local_key::isInvalid(lockOwnerPtr.p->localdata[0],
+ lockOwnerPtr.p->localdata[1]))
{
jam();
/* ---------------------------------------------------------------
@@ -1591,7 +1594,9 @@ void Dbacc::insertelementLab(Signal* sig
tidrForward = ZTRUE;
idrOperationRecPtr = operationRecPtr;
clocalkey[0] = localKey;
+ clocalkey[1] = localKey;
operationRecPtr.p->localdata[0] = localKey;
+ operationRecPtr.p->localdata[1] = localKey;
/* ----------------------------------------------------------------------- */
/* WE SET THE LOCAL KEY TO MINUS ONE TO INDICATE IT IS NOT YET VALID. */
/* ----------------------------------------------------------------------- */
@@ -2281,6 +2286,7 @@ void Dbacc::execACCMINUPDATE(Signal* sig
operationRecPtr.i = signal->theData[0];
tlocalkey1 = signal->theData[1];
tlocalkey2 = signal->theData[2];
+ Uint32 localref = Local_key::ref(tlocalkey1, tlocalkey2);
ptrCheckGuard(operationRecPtr, coprecsize, operationrec);
Uint32 opbits = operationRecPtr.p->m_op_bits;
fragrecptr.i = operationRecPtr.p->fragptr;
@@ -2294,17 +2300,18 @@ void Dbacc::execACCMINUPDATE(Signal* sig
ptrCheckGuard(ulkPageidptr, cpagesize, page8);
dbgWord32(ulkPageidptr, tulkLocalPtr, tlocalkey1);
arrGuard(tulkLocalPtr, 2048);
- ulkPageidptr.p->word32[tulkLocalPtr] = tlocalkey1;
operationRecPtr.p->localdata[0] = tlocalkey1;
+ operationRecPtr.p->localdata[1] = tlocalkey2;
if (likely(fragrecptr.p->localkeylen == 1))
{
+ ulkPageidptr.p->word32[tulkLocalPtr] = localref;
return;
- }
- else if (fragrecptr.p->localkeylen == 2)
+ }
+ else if (fragrecptr.p->localkeylen == 2)
{
jam();
+ ulkPageidptr.p->word32[tulkLocalPtr] = tlocalkey1;
tulkLocalPtr = tulkLocalPtr + operationRecPtr.p->elementIsforward;
- operationRecPtr.p->localdata[1] = tlocalkey2;
dbgWord32(ulkPageidptr, tulkLocalPtr, tlocalkey2);
arrGuard(tulkLocalPtr, 2048);
ulkPageidptr.p->word32[tulkLocalPtr] = tlocalkey2;
@@ -2486,8 +2493,9 @@ void Dbacc::execACC_LOCKREQ(Signal* sign
signal->theData[5] = req->transId1;
signal->theData[6] = req->transId2;
// enter local key in place of PK
- signal->theData[7] = req->tupAddr;
- EXECUTE_DIRECT(DBACC, GSN_ACCKEYREQ, signal, 8);
+ signal->theData[7] = req->page_id;
+ signal->theData[8] = req->page_idx;
+ EXECUTE_DIRECT(DBACC, GSN_ACCKEYREQ, signal, 9);
// translate the result
if (signal->theData[0] < RNIL) {
jam();
@@ -3195,7 +3203,8 @@ void Dbacc::getdirindex(Signal* signal)
}//Dbacc::getdirindex()
Uint32
-Dbacc::readTablePk(Uint32 localkey1, Uint32 eh, Ptr<Operationrec> opPtr)
+Dbacc::readTablePk(Uint32 localkey1, Uint32 localkey2,
+ Uint32 eh, Ptr<Operationrec> opPtr)
{
int ret;
Uint32 tableId = fragrecptr.p->myTableId;
@@ -3206,11 +3215,9 @@ Dbacc::readTablePk(Uint32 localkey1, Uin
memset(ckeys, 0x1f, (fragrecptr.p->keyLength * MAX_XFRM_MULTIPLY) << 2);
#endif
- if (likely(localkey1 != ~(Uint32)0))
+ if (likely(! Local_key::isInvalid(localkey1, localkey2)))
{
- Uint32 fragPageId = localkey1 >> MAX_TUPLES_BITS;
- Uint32 pageIndex = localkey1 & ((1 << MAX_TUPLES_BITS ) - 1);
- ret = c_tup->accReadPk(tableId, fragId, fragPageId, pageIndex,
+ ret = c_tup->accReadPk(tableId, fragId, localkey1, localkey2,
ckeys, true);
}
else
@@ -3276,6 +3283,7 @@ Dbacc::getElement(Signal* signal, Operat
register Uint32 tgeRemLen;
register Uint32 TelemLen = fragrecptr.p->elementLength;
register Uint32* Tkeydata = (Uint32*)&signal->theData[7];
+ const Uint32 localkeylen = fragrecptr.p->localkeylen;
getdirindex(signal);
tgePageindex = tgdiPageindex;
@@ -3287,7 +3295,7 @@ Dbacc::getElement(Signal* signal, Operat
*/
const bool searchLocalKey = operationRecPtr.p->tupkeylen == 0;
- ndbrequire(TelemLen == ZELEM_HEAD_SIZE + fragrecptr.p->localkeylen);
+ ndbrequire(TelemLen == ZELEM_HEAD_SIZE + localkeylen);
tgeNextptrtype = ZLEFT;
const Uint32 tmp = fragrecptr.p->k + fragrecptr.p->lhfragbits;
@@ -3298,7 +3306,7 @@ Dbacc::getElement(Signal* signal, Operat
jam();
tgeContainerptr = tgeContainerptr + ZHEAD_SIZE;
tgeElementptr = tgeContainerptr + ZCON_HEAD_SIZE;
- tgeKeyptr = (tgeElementptr + ZELEM_HEAD_SIZE) + fragrecptr.p->localkeylen;
+ tgeKeyptr = (tgeElementptr + ZELEM_HEAD_SIZE) + localkeylen;
tgeElemStep = TelemLen;
tgeForward = 1;
if (unlikely(tgeContainerptr >= 2048))
@@ -3316,7 +3324,7 @@ Dbacc::getElement(Signal* signal, Operat
jam();
tgeContainerptr = tgeContainerptr + ((ZHEAD_SIZE + ZBUF_SIZE) - ZCON_HEAD_SIZE);
tgeElementptr = tgeContainerptr - 1;
- tgeKeyptr = (tgeElementptr - ZELEM_HEAD_SIZE) - fragrecptr.p->localkeylen;
+ tgeKeyptr = (tgeElementptr - ZELEM_HEAD_SIZE) - localkeylen;
tgeElemStep = 0 - TelemLen;
tgeForward = (Uint32)-1;
if (unlikely(tgeContainerptr >= 2048))
@@ -3360,22 +3368,31 @@ Dbacc::getElement(Signal* signal, Operat
localkey2 = lockOwnerPtr.p->localdata[1];
} else {
jam();
+ Uint32 pos = tgeElementptr + tgeForward;
hashValuePart = ElementHeader::getHashValuePart(tgeElementHeader);
- localkey1 = gePageptr.p->word32[tgeElementptr + tgeForward];
- localkey2 = 0;
+ localkey1 = gePageptr.p->word32[pos];
+ if (likely(localkeylen == 1))
+ {
+ localkey2 = Local_key::ref2page_idx(localkey1);
+ localkey1 = Local_key::ref2page_id(localkey1);
+ }
+ else
+ {
+ localkey2 = gePageptr.p->word32[pos + tgeForward];
+ }
}
if (hashValuePart == opHashValuePart) {
jam();
bool found;
if (! searchLocalKey)
{
- Uint32 len = readTablePk(localkey1, tgeElementHeader,
+ Uint32 len = readTablePk(localkey1, localkey2, tgeElementHeader,
lockOwnerPtr);
found = (len == operationRecPtr.p->xfrmtupkeylen) &&
(memcmp(Tkeydata, ckeys, len << 2) == 0);
} else {
jam();
- found = (localkey1 == Tkeydata[0]);
+ found = (localkey1 == Tkeydata[0] && localkey2 == Tkeydata[1]);
}
if (found)
{
@@ -3460,21 +3477,20 @@ error:
void
Dbacc::report_dealloc(Signal* signal, const Operationrec* opPtrP)
{
- Uint32 localKey = opPtrP->localdata[0];
+ Uint32 localKey1 = opPtrP->localdata[0];
+ Uint32 localKey2 = opPtrP->localdata[1];
Uint32 opbits = opPtrP->m_op_bits;
Uint32 userptr= opPtrP->userptr;
Uint32 scanInd =
((opbits & Operationrec::OP_MASK) == ZSCAN_OP) ||
(opbits & Operationrec::OP_LOCK_REQ);
- if (localKey != ~(Uint32)0)
+ if (! Local_key::isInvalid(localKey1, localKey2))
{
signal->theData[0] = fragrecptr.p->myfid;
signal->theData[1] = fragrecptr.p->myTableId;
- Uint32 pageId = localKey >> MAX_TUPLES_BITS;
- Uint32 pageIndex = localKey & ((1 << MAX_TUPLES_BITS) - 1);
- signal->theData[2] = pageId;
- signal->theData[3] = pageIndex;
+ signal->theData[2] = localKey1;
+ signal->theData[3] = localKey2;
signal->theData[4] = userptr;
signal->theData[5] = scanInd;
EXECUTE_DIRECT(DBLQH, GSN_TUP_DEALLOCREQ, signal, 6);
@@ -4686,6 +4702,7 @@ Dbacc::release_lockowner(Signal* signal,
jam();
report_dealloc(signal, opPtr.p);
newOwner.p->localdata[0] = ~(Uint32)0;
+ newOwner.p->localdata[1] = ~(Uint32)0;
}
else
{
@@ -4734,6 +4751,7 @@ Dbacc::release_lockowner(Signal* signal,
{
report_dealloc(signal, opPtr.p);
newOwner.p->localdata[0] = ~(Uint32)0;
+ newOwner.p->localdata[1] = ~(Uint32)0;
}
else
{
@@ -6553,7 +6571,8 @@ void Dbacc::checkNextBucketLab(Signal* s
ElementHeader::getOpPtrI(nsPageptr.p->word32[tnsElementptr]);
ptrCheckGuard(queOperPtr, coprecsize, operationrec);
if (queOperPtr.p->m_op_bits & Operationrec::OP_ELEMENT_DISAPPEARED ||
- queOperPtr.p->localdata[0] == ~(Uint32)0)
+ Local_key::isInvalid(queOperPtr.p->localdata[0],
+ queOperPtr.p->localdata[1]))
{
jam();
/* ------------------------------------------------------------------ */
@@ -6983,9 +7002,8 @@ bool Dbacc::getScanElement(Signal* signa
/* --------------------------------------------------------------------------------- */
void Dbacc::initScanOpRec(Signal* signal)
{
- Uint32 tisoTmp;
Uint32 tisoLocalPtr;
- Uint32 guard24;
+ Uint32 localkeylen = fragrecptr.p->localkeylen;
scanPtr.p->scanOpsAllocated++;
@@ -7012,14 +7030,21 @@ void Dbacc::initScanOpRec(Signal* signal
operationRecPtr.p->elementPage = isoPageptr.i;
operationRecPtr.p->m_op_bits = opbits;
tisoLocalPtr = tisoElementptr + tisoIsforward;
- guard24 = fragrecptr.p->localkeylen - 1;
- for (tisoTmp = 0; tisoTmp <= guard24; tisoTmp++) {
- arrGuard(tisoTmp, 2);
- arrGuard(tisoLocalPtr, 2048);
- operationRecPtr.p->localdata[tisoTmp] = isoPageptr.p->word32[tisoLocalPtr];
- tisoLocalPtr = tisoLocalPtr + tisoIsforward;
- }//for
+
arrGuard(tisoLocalPtr, 2048);
+ Uint32 Tkey1 = isoPageptr.p->word32[tisoLocalPtr];
+ tisoLocalPtr = tisoLocalPtr + tisoIsforward;
+ if (localkeylen == 1)
+ {
+ operationRecPtr.p->localdata[0] = Local_key::ref2page_id(Tkey1);
+ operationRecPtr.p->localdata[1] = Local_key::ref2page_idx(Tkey1);
+ }
+ else
+ {
+ arrGuard(tisoLocalPtr, 2048);
+ operationRecPtr.p->localdata[0] = Tkey1;
+ operationRecPtr.p->localdata[1] = isoPageptr.p->word32[tisoLocalPtr];
+ }
operationRecPtr.p->tupkeylen = fragrecptr.p->keyLength;
operationRecPtr.p->xfrmtupkeylen = 0; // not used
}//Dbacc::initScanOpRec()
@@ -7369,6 +7394,7 @@ bool Dbacc::searchScanContainer(Signal*
void Dbacc::sendNextScanConf(Signal* signal)
{
Uint32 blockNo = refToMain(scanPtr.p->scanUserblockref);
+
jam();
/** ---------------------------------------------------------------------
* LQH WILL NOT HAVE ANY USE OF THE TUPLE KEY LENGTH IN THIS CASE AND
@@ -7379,8 +7405,7 @@ void Dbacc::sendNextScanConf(Signal* sig
signal->theData[2] = operationRecPtr.p->fid;
signal->theData[3] = operationRecPtr.p->localdata[0];
signal->theData[4] = operationRecPtr.p->localdata[1];
- signal->theData[5] = fragrecptr.p->localkeylen;
- EXECUTE_DIRECT(blockNo, GSN_NEXT_SCANCONF, signal, 6);
+ EXECUTE_DIRECT(blockNo, GSN_NEXT_SCANCONF, signal, 5);
return;
}//Dbacc::sendNextScanConf()
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp 2011-04-15 13:52:53 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp 2011-04-21 09:21:18 +0000
@@ -504,12 +504,12 @@ public:
Method method;
Storage tabStorage;
- Uint32 pageRef[8];
+ Uint32 pageRef[32];
//-----------------------------------------------------------------------------
// Each entry in this array contains a reference to 16 fragment records in a
// row. Thus finding the correct record is very quick provided the fragment id.
//-----------------------------------------------------------------------------
- Uint32 startFid[MAX_NDB_NODES];
+ Uint32 startFid[MAX_NDB_NODES * MAX_FRAG_PER_NODE / NO_OF_FRAGS_PER_CHUNK];
Uint32 tabFile[2];
Uint32 connectrec;
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2011-04-17 18:25:41 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2011-04-27 08:39:36 +0000
@@ -8768,6 +8768,7 @@ Dbdih::add_fragment_to_table(Ptr<TabReco
ndbrequire(cremainingfrags >= NO_OF_FRAGS_PER_CHUNK);
cremainingfrags -= NO_OF_FRAGS_PER_CHUNK;
+ ndbrequire(chunks < NDB_ARRAY_SIZE(tabPtr.p->startFid));
tabPtr.p->startFid[chunks] = fragPtr.i;
for (Uint32 i = 0; i<NO_OF_FRAGS_PER_CHUNK; i++)
{
@@ -9128,7 +9129,7 @@ Dbdih::getFragstore(TabRecord * tab,
Uint32 chunkNo = fragNo >> LOG_NO_OF_FRAGS_PER_CHUNK;
Uint32 chunkIndex = fragNo & (NO_OF_FRAGS_PER_CHUNK - 1);
fragPtr.i = tab->startFid[chunkNo] + chunkIndex;
- if (likely(chunkNo < MAX_NDB_NODES)) {
+ if (likely(chunkNo < NDB_ARRAY_SIZE(tab->startFid))) {
ptrCheckGuard(fragPtr, TfragstoreFileSize, TfragStore);
fragptr = fragPtr;
return;
@@ -9144,6 +9145,7 @@ void Dbdih::allocFragments(Uint32 noOfFr
for (Uint32 i = 0; i < noOfChunks; i++) {
jam();
Uint32 baseFrag = cfirstfragstore;
+ ndbrequire(i < NDB_ARRAY_SIZE(tabPtr.p->startFid));
tabPtr.p->startFid[i] = baseFrag;
fragPtr.i = baseFrag;
ptrCheckGuard(fragPtr, cfragstoreFileSize, fragmentstore);
@@ -9164,6 +9166,7 @@ void Dbdih::releaseFragments(TabRecordPt
FragmentstorePtr fragPtr;
for (Uint32 i = 0; i < tabPtr.p->noOfFragChunks; i++) {
jam();
+ ndbrequire(i < NDB_ARRAY_SIZE(tabPtr.p->startFid));
Uint32 baseFrag = tabPtr.p->startFid[i];
fragPtr.i = baseFrag;
ptrCheckGuard(fragPtr, cfragstoreFileSize, fragmentstore);
@@ -11042,7 +11045,7 @@ void Dbdih::readingTableLab(Signal* sign
Uint32 noOfStoredPages = pagePtr.p->word[33];
if (tabPtr.p->noPages < noOfStoredPages) {
jam();
- ndbrequire(noOfStoredPages <= 8);
+ ndbrequire(noOfStoredPages <= NDB_ARRAY_SIZE(tabPtr.p->pageRef));
for (Uint32 i = tabPtr.p->noPages; i < noOfStoredPages; i++) {
jam();
allocpage(pagePtr);
@@ -11547,7 +11550,7 @@ void Dbdih::readingTableErrorLab(Signal*
/* ---------------------------------------------------------------------- */
/* READING THIS FILE FAILED. CLOSE IT AFTER RELEASING ALL PAGES. */
/* ---------------------------------------------------------------------- */
- ndbrequire(tabPtr.p->noPages <= 8);
+ ndbrequire(tabPtr.p->noPages <= NDB_ARRAY_SIZE(tabPtr.p->pageRef));
for (Uint32 i = 0; i < tabPtr.p->noPages; i++) {
jam();
releasePage(tabPtr.p->pageRef[i]);
@@ -11596,7 +11599,7 @@ void Dbdih::execCOPY_TABREQ(Signal* sign
tabPtr.p->schemaVersion = schemaVersion;
initTableFile(tabPtr);
}//if
- ndbrequire(tabPtr.p->noPages < 8);
+ ndbrequire(tabPtr.p->noPages < NDB_ARRAY_SIZE(tabPtr.p->pageRef));
if (tabPtr.p->noOfWords == 0) {
jam();
allocpage(pagePtr);
@@ -11689,7 +11692,7 @@ void Dbdih::readPagesIntoTableLab(Signal
void Dbdih::readPagesIntoFragLab(Signal* signal, RWFragment* rf)
{
- ndbrequire(rf->pageIndex < 8);
+ ndbrequire(rf->pageIndex < NDB_ARRAY_SIZE(rf->rwfTabPtr.p->pageRef));
rf->rwfPageptr.i = rf->rwfTabPtr.p->pageRef[rf->pageIndex];
ptrCheckGuard(rf->rwfPageptr, cpageFileSize, pageRecord);
FragmentstorePtr fragPtr;
@@ -11799,7 +11802,7 @@ void Dbdih::packTableIntoPagesLab(Signal
/*****************************************************************************/
void Dbdih::packFragIntoPagesLab(Signal* signal, RWFragment* wf)
{
- ndbrequire(wf->pageIndex < 8);
+ ndbrequire(wf->pageIndex < NDB_ARRAY_SIZE(wf->rwfTabPtr.p->pageRef));
wf->rwfPageptr.i = wf->rwfTabPtr.p->pageRef[wf->pageIndex];
ptrCheckGuard(wf->rwfPageptr, cpageFileSize, pageRecord);
FragmentstorePtr fragPtr;
@@ -12411,7 +12414,7 @@ void Dbdih::copyTableNode(Signal* signal
return;
}//if
}//if
- ndbrequire(ctn->pageIndex < 8);
+ ndbrequire(ctn->pageIndex < NDB_ARRAY_SIZE(ctn->ctnTabPtr.p->pageRef));
ctn->ctnPageptr.i = ctn->ctnTabPtr.p->pageRef[ctn->pageIndex];
ptrCheckGuard(ctn->ctnPageptr, cpageFileSize, pageRecord);
/**
@@ -12456,7 +12459,7 @@ void Dbdih::copyTableNode(Signal* signal
jam();
ctn->wordIndex = 0;
ctn->pageIndex++;
- ndbrequire(ctn->pageIndex < 8);
+ ndbrequire(ctn->pageIndex < NDB_ARRAY_SIZE(ctn->ctnTabPtr.p->pageRef));
ctn->ctnPageptr.i = ctn->ctnTabPtr.p->pageRef[ctn->pageIndex];
ptrCheckGuard(ctn->ctnPageptr, cpageFileSize, pageRecord);
}//if
@@ -15345,10 +15348,10 @@ void Dbdih::initTable(TabRecordPtr tabPt
tabPtr.p->m_dropTab.tabUserRef = 0;
tabPtr.p->m_dropTab.tabUserPtr = RNIL;
Uint32 i;
- for (i = 0; i < MAX_NDB_NODES; i++) {
+ for (i = 0; i < NDB_ARRAY_SIZE(tabPtr.p->startFid); i++) {
tabPtr.p->startFid[i] = RNIL;
}//for
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < NDB_ARRAY_SIZE(tabPtr.p->pageRef); i++) {
tabPtr.p->pageRef[i] = RNIL;
}//for
tabPtr.p->tableType = DictTabInfo::UndefTableType;
@@ -16215,7 +16218,7 @@ Uint32 Dbdih::readPageWord(RWFragment* r
jam();
ndbrequire(rf->wordIndex == 2048);
rf->pageIndex++;
- ndbrequire(rf->pageIndex < 8);
+ ndbrequire(rf->pageIndex < NDB_ARRAY_SIZE(rf->rwfTabPtr.p->pageRef));
rf->rwfPageptr.i = rf->rwfTabPtr.p->pageRef[rf->pageIndex];
ptrCheckGuard(rf->rwfPageptr, cpageFileSize, pageRecord);
rf->wordIndex = 32;
@@ -16304,11 +16307,16 @@ void Dbdih::readTabfile(Signal* signal,
signal->theData[3] = ZLIST_OF_PAIRS;
signal->theData[4] = ZVAR_NO_WORD;
signal->theData[5] = tab->noPages;
- for (Uint32 i = 0; i < tab->noPages; i++) {
- signal->theData[6 + (2 * i)] = tab->pageRef[i];
- signal->theData[7 + (2 * i)] = i;
- }//for
- sendSignal(NDBFS_REF, GSN_FSREADREQ, signal, 22, JBA);
+ Uint32 section[2 * NDB_ARRAY_SIZE(tab->pageRef)];
+ for (Uint32 i = 0; i < tab->noPages; i++)
+ {
+ section[(2 * i) + 0] = tab->pageRef[i];
+ section[(2 * i) + 1] = i;
+ }
+ LinearSectionPtr ptr[3];
+ ptr[0].p = section;
+ ptr[0].sz = 2 * tab->noPages;
+ sendSignal(NDBFS_REF, GSN_FSREADREQ, signal, 6, JBA, ptr, 1);
}//Dbdih::readTabfile()
void Dbdih::releasePage(Uint32 pageIndex)
@@ -16325,7 +16333,7 @@ void Dbdih::releaseTabPages(Uint32 table
TabRecordPtr tabPtr;
tabPtr.i = tableId;
ptrCheckGuard(tabPtr, ctabFileSize, tabRecord);
- ndbrequire(tabPtr.p->noPages <= 8);
+ ndbrequire(tabPtr.p->noPages <= NDB_ARRAY_SIZE(tabPtr.p->pageRef));
for (Uint32 i = 0; i < tabPtr.p->noPages; i++) {
jam();
releasePage(tabPtr.p->pageRef[i]);
@@ -17102,7 +17110,7 @@ void Dbdih::writePageWord(RWFragment* wf
allocpage(wf->rwfPageptr);
wf->wordIndex = 32;
wf->pageIndex++;
- ndbrequire(wf->pageIndex < 8);
+ ndbrequire(wf->pageIndex < NDB_ARRAY_SIZE(wf->rwfTabPtr.p->pageRef));
wf->rwfTabPtr.p->pageRef[wf->pageIndex] = wf->rwfPageptr.i;
wf->rwfTabPtr.p->noPages++;
}//if
@@ -17173,13 +17181,17 @@ void Dbdih::writeTabfile(Signal* signal,
signal->theData[3] = ZLIST_OF_PAIRS_SYNCH;
signal->theData[4] = ZVAR_NO_WORD;
signal->theData[5] = tab->noPages;
- for (Uint32 i = 0; i < tab->noPages; i++) {
- jam();
- signal->theData[6 + (2 * i)] = tab->pageRef[i];
- signal->theData[7 + (2 * i)] = i;
- }//for
- Uint32 length = 6 + (2 * tab->noPages);
- sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal, length, JBA);
+
+ Uint32 section[2 * NDB_ARRAY_SIZE(tab->pageRef)];
+ for (Uint32 i = 0; i < tab->noPages; i++)
+ {
+ section[(2 * i) + 0] = tab->pageRef[i];
+ section[(2 * i) + 1] = i;
+ }
+ LinearSectionPtr ptr[3];
+ ptr[0].p = section;
+ ptr[0].sz = 2 * tab->noPages;
+ sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal, 6, JBA, ptr, 1);
}//Dbdih::writeTabfile()
void Dbdih::execDEBUG_SIG(Signal* signal)
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2011-04-06 08:44:46 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2011-04-27 08:39:36 +0000
@@ -2731,9 +2731,11 @@ public:
Uint32 readPrimaryKeys(Uint32 opPtrI, Uint32 * dst, bool xfrm);
private:
- void acckeyconf_tupkeyreq(Signal*, TcConnectionrec*, Fragrecord*, Uint32, Uint32);
- void acckeyconf_load_diskpage(Signal*,TcConnectionrecPtr,Fragrecord*,Uint32);
-
+ void acckeyconf_tupkeyreq(Signal*, TcConnectionrec*, Fragrecord*,
+ Uint32, Uint32, Uint32);
+ void acckeyconf_load_diskpage(Signal*,TcConnectionrecPtr,Fragrecord*,
+ Uint32, Uint32);
+
void handle_nr_copy(Signal*, Ptr<TcConnectionrec>);
void exec_acckeyreq(Signal*, Ptr<TcConnectionrec>);
int compare_key(const TcConnectionrec*, const Uint32 * ptr, Uint32 len);
@@ -3340,7 +3342,8 @@ Dblqh::accminupdate(Signal* signal, Uint
regTcPtr.i= opId;
ptrCheckGuard(regTcPtr, ctcConnectrecFileSize, tcConnectionrec);
signal->theData[0] = regTcPtr.p->accConnectrec;
- signal->theData[1] = key->m_page_no << MAX_TUPLES_BITS | key->m_page_idx;
+ signal->theData[1] = key->m_page_no;
+ signal->theData[2] = key->m_page_idx;
c_acc->execACCMINUPDATE(signal);
if (ERROR_INSERTED(5714))
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-04-10 17:32:41 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-04-27 08:39:36 +0000
@@ -5338,7 +5338,7 @@ Dblqh::nr_copy_delete_row(Signal* signal
if (rowid)
{
jam();
- keylen = 1;
+ keylen = 2;
if (g_key_descriptor_pool.getPtr(tableId)->hasCharAttr)
{
signal->theData[3] = calculateHash(tableId, signal->theData+24);
@@ -5348,7 +5348,8 @@ Dblqh::nr_copy_delete_row(Signal* signal
signal->theData[3] = md5_hash((Uint64*)(signal->theData+24), len);
}
signal->theData[4] = 0; // seach by local key
- signal->theData[7] = rowid->ref();
+ signal->theData[7] = rowid->m_page_no;
+ signal->theData[8] = rowid->m_page_idx;
}
else
{
@@ -5808,9 +5809,9 @@ void Dblqh::execACCKEYCONF(Signal* signa
Uint32 ttcConnectrecFileSize = ctcConnectrecFileSize;
Uint32 tcIndex = signal->theData[0];
Uint32 localKey1 = signal->theData[3];
- //Uint32 localKey2 = signal->theData[4];
- Uint32 localKeyFlag = signal->theData[5];
+ Uint32 localKey2 = signal->theData[4];
jamEntry();
+
tcConnectptr.i = tcIndex;
ptrCheckGuard(tcConnectptr, ttcConnectrecFileSize, regTcConnectionrec);
TcConnectionrec * const regTcPtr = tcConnectptr.p;
@@ -5865,17 +5866,18 @@ void Dblqh::execACCKEYCONF(Signal* signa
regFragptr.i = regTcPtr->fragmentptr;
c_fragment_pool.getPtr(regFragptr);
- ndbrequire(localKeyFlag == 1);
if(!regTcPtr->m_disk_table)
- acckeyconf_tupkeyreq(signal, regTcPtr, regFragptr.p, localKey1, RNIL);
+ acckeyconf_tupkeyreq(signal, regTcPtr, regFragptr.p,
+ localKey1, localKey2, RNIL);
else
- acckeyconf_load_diskpage(signal, tcConnectptr, regFragptr.p, localKey1);
+ acckeyconf_load_diskpage(signal, tcConnectptr, regFragptr.p,
+ localKey1, localKey2);
}
void
Dblqh::acckeyconf_tupkeyreq(Signal* signal, TcConnectionrec* regTcPtr,
- Fragrecord* regFragptrP,
- Uint32 local_key,
+ Fragrecord* regFragptrP,
+ Uint32 lkey1, Uint32 lkey2,
Uint32 disk_page)
{
Uint32 op = regTcPtr->operation;
@@ -5888,8 +5890,8 @@ Dblqh::acckeyconf_tupkeyreq(Signal* sign
* IS NEEDED SINCE TWO SCHEMA VERSIONS CAN BE ACTIVE SIMULTANEOUSLY ON A
* TABLE.
* ----------------------------------------------------------------------- */
- Uint32 page_idx = local_key & MAX_TUPLES_PER_PAGE;
- Uint32 page_no = local_key >> MAX_TUPLES_BITS;
+ Uint32 page_idx = lkey2;
+ Uint32 page_no = lkey1;
Uint32 Ttupreq = regTcPtr->dirtyOp;
Ttupreq = Ttupreq + (regTcPtr->opSimple << 1);
Ttupreq = Ttupreq + (op << 6);
@@ -5969,21 +5971,23 @@ Dblqh::acckeyconf_tupkeyreq(Signal* sign
void
Dblqh::acckeyconf_load_diskpage(Signal* signal, TcConnectionrecPtr regTcPtr,
- Fragrecord* regFragptrP, Uint32 local_key)
+ Fragrecord* regFragptrP,
+ Uint32 lkey1, Uint32 lkey2)
{
int res;
if((res= c_tup->load_diskpage(signal,
regTcPtr.p->tupConnectrec,
- regFragptrP->tupFragptr,
- local_key,
+ regFragptrP->tupFragptr,
+ lkey1, lkey2,
regTcPtr.p->operation)) > 0)
{
- acckeyconf_tupkeyreq(signal, regTcPtr.p, regFragptrP, local_key, res);
+ acckeyconf_tupkeyreq(signal, regTcPtr.p, regFragptrP, lkey1, lkey2, res);
}
else if(res == 0)
{
regTcPtr.p->transactionState = TcConnectionrec::WAIT_TUP;
- regTcPtr.p->m_row_id.assref(local_key);
+ regTcPtr.p->m_row_id.m_page_no = lkey1;
+ regTcPtr.p->m_row_id.m_page_idx = lkey2;
}
else
{
@@ -6011,8 +6015,9 @@ Dblqh::acckeyconf_load_diskpage_callback
FragrecordPtr fragPtr;
c_fragment_pool.getPtr(fragPtr, regTcPtr->fragmentptr);
- acckeyconf_tupkeyreq(signal, regTcPtr, fragPtr.p,
- regTcPtr->m_row_id.ref(),
+ acckeyconf_tupkeyreq(signal, regTcPtr, fragPtr.p,
+ regTcPtr->m_row_id.m_page_no,
+ regTcPtr->m_row_id.m_page_idx,
disk_page);
}
else if (state != TcConnectionrec::WAIT_TUP)
@@ -9351,18 +9356,9 @@ void Dblqh::execNEXT_SCANCONF(Signal* si
jamEntry();
scanptr.i = nextScanConf->scanPtr;
c_scanRecordPool.getPtr(scanptr);
- if (likely(nextScanConf->localKeyLength == 1)) //XXX signal length ?
- {
- jam();
- scanptr.p->m_row_id.assref(nextScanConf->localKey[0]);
- }
- else
- {
- jam();
- scanptr.p->m_row_id.m_page_no = nextScanConf->localKey[0];
- scanptr.p->m_row_id.m_page_idx = nextScanConf->localKey[1];
- }
-
+ scanptr.p->m_row_id.m_page_no = nextScanConf->localKey[0];
+ scanptr.p->m_row_id.m_page_idx = nextScanConf->localKey[1];
+
#ifdef VM_TRACE
if (signal->getLength() > 2 && nextScanConf->accOperationPtr != RNIL)
{
@@ -10792,14 +10788,14 @@ Dblqh::next_scanconf_load_diskpage(Signa
Fragrecord* fragPtrP)
{
jam();
-
+
int res;
- Uint32 local_key = scanPtr.p->m_row_id.ref();
-
- if((res= c_tup->load_diskpage_scan(signal,
+
+ if((res= c_tup->load_diskpage_scan(signal,
regTcPtr.p->tupConnectrec,
- fragPtrP->tupFragptr,
- local_key,
+ fragPtrP->tupFragptr,
+ scanPtr.p->m_row_id.m_page_no,
+ scanPtr.p->m_row_id.m_page_idx,
0)) > 0)
{
next_scanconf_tupkeyreq(signal, scanptr, regTcPtr.p, fragPtrP, res);
@@ -16891,7 +16887,7 @@ void Dblqh::execSTART_RECCONF(Signal* si
default:
ndbrequire(false);
}
-
+
jam();
csrExecUndoLogState = EULS_COMPLETED;
@@ -16950,7 +16946,16 @@ Dblqh::rebuildOrderedIndexes(Signal* sig
LogPartRecord::P_TAIL_PROBLEM, true);
}
}
-
+
+ if (!isNdbMtLqh())
+ {
+ /**
+ * There should be no disk-ops in flight here...check it
+ */
+ signal->theData[0] = 12003;
+ sendSignal(LGMAN_REF, GSN_DUMP_STATE_ORD, signal, 1, JBB);
+ }
+
StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
conf->startingNodeId = getOwnNodeId();
conf->senderData = cstartRecReqData;
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.cpp 2011-02-10 08:57:55 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.cpp 2011-04-27 08:39:36 +0000
@@ -1238,6 +1238,13 @@ DblqhProxy::sendSTART_RECCONF(Signal* si
if (ss.m_error == 0) {
jam();
+
+ /**
+ * There should be no disk-ops in flight here...check it
+ */
+ signal->theData[0] = 12003;
+ sendSignal(LGMAN_REF, GSN_DUMP_STATE_ORD, signal, 1, JBB);
+
StartRecConf* conf = (StartRecConf*)signal->getDataPtrSend();
conf->startingNodeId = getOwnNodeId();
conf->senderData = ss.m_req.senderData;
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp 2011-02-15 08:52:34 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp 2011-04-27 08:39:36 +0000
@@ -1364,12 +1364,12 @@ typedef Ptr<HostBuffer> HostBufferPtr;
STATIC_CONST( SZ32 = 1 );
void copyout(Local_key* dst) const {
- dst->m_page_no = m_ref >> MAX_TUPLES_BITS;
- dst->m_page_idx = m_ref & MAX_TUPLES_PER_PAGE;
+ dst->m_page_no = Local_key::ref2page_id(m_ref);
+ dst->m_page_idx = Local_key::ref2page_idx(m_ref);
}
void assign(const Local_key* src) {
- m_ref = (src->m_page_no << MAX_TUPLES_BITS) | src->m_page_idx;
+ m_ref = Local_key::ref(src->m_page_no, src->m_page_idx);
}
#else
Uint32 m_page_no;
@@ -1661,6 +1661,22 @@ struct TupHeadInfo {
};
*/
+ struct ChangeMask
+ {
+ Uint32 m_cols;
+ Uint32 m_mask[1];
+
+ const Uint32 * end_of_mask() const { return end_of_mask(m_cols); }
+ const Uint32 * end_of_mask(Uint32 cols) const {
+ return m_mask + ((cols + 31) >> 5);
+ }
+
+ Uint32 * end_of_mask() { return end_of_mask(m_cols); }
+ Uint32 * end_of_mask(Uint32 cols) {
+ return m_mask + ((cols + 31) >> 5);
+ }
+ };
+
// updateAttributes module
Uint32 terrorCode;
@@ -1671,7 +1687,8 @@ public:
/*
* TUX uses logical tuple address when talking to ACC and LQH.
*/
- void tuxGetTupAddr(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32& tupAddr);
+ void tuxGetTupAddr(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset,
+ Uint32& lkey1, Uint32& lkey2);
/*
* TUX index in TUP has single Uint32 array attribute which stores an
@@ -1711,11 +1728,11 @@ public:
*/
bool tuxQueryTh(Uint32 fragPtrI, Uint32 pageId, Uint32 pageIndex, Uint32 tupVersion, Uint32 transId1, Uint32 transId2, bool dirty, Uint32 savepointId);
- int load_diskpage(Signal*, Uint32 opRec, Uint32 fragPtrI,
- Uint32 local_key, Uint32 flags);
+ int load_diskpage(Signal*, Uint32 opRec, Uint32 fragPtrI,
+ Uint32 lkey1, Uint32 lkey2, Uint32 flags);
- int load_diskpage_scan(Signal*, Uint32 opRec, Uint32 fragPtrI,
- Uint32 local_key, Uint32 flags);
+ int load_diskpage_scan(Signal*, Uint32 opRec, Uint32 fragPtrI,
+ Uint32 lkey1, Uint32 lkey2, Uint32 flags);
void start_restore_lcp(Uint32 tableId, Uint32 fragmentId);
void complete_restore_lcp(Signal*, Uint32 ref, Uint32 data,
@@ -2492,10 +2509,10 @@ private:
Uint32 get_fix_page_offset(Uint32 page_index, Uint32 tuple_size);
Uint32 decr_tup_version(Uint32 tuple_version);
- void update_change_mask_info(const Tablerec*, Uint32* dst, const Uint32*src);
- void set_change_mask_info(const Tablerec*, Uint32* dst);
- void clear_change_mask_info(const Tablerec*, Uint32* dst);
- void copy_change_mask_info(const Tablerec*, Uint32* dst, const Uint32* src);
+ void update_change_mask_info(const Tablerec*, ChangeMask* dst, const Uint32*src);
+ void set_change_mask_info(const Tablerec*, ChangeMask* dst);
+ void clear_change_mask_info(const Tablerec*, ChangeMask* dst);
+ void copy_change_mask_info(const Tablerec*, ChangeMask* dst, const ChangeMask * src);
void set_commit_change_mask_info(const Tablerec*,
KeyReqStruct*,
const Operationrec*);
@@ -2933,7 +2950,7 @@ private:
void removeTdArea(Uint32 tabDesRef, Uint32 list);
void insertTdArea(Uint32 tabDesRef, Uint32 list);
void itdaMergeTabDescr(Uint32& retRef, Uint32& retNo, bool normal);
-#ifdef VM_TRACE
+#if defined VM_TRACE || defined ERROR_INSERT
void verifytabdes();
#endif
@@ -3171,9 +3188,9 @@ private:
bzero(dst, tabPtrP->total_rec_size);
#endif
Uint32 count = tabPtrP->m_no_of_attributes;
- * dst = count;
- dst += 1 + ((count + 31) >> 5);
- return (Tuple_header*)dst;
+ ChangeMask * mask = (ChangeMask*)(dst);
+ mask->m_cols = count;
+ return (Tuple_header*)(mask->end_of_mask(count));
}
Uint32 * get_copy_tuple_raw(const Local_key* ptr) {
@@ -3181,19 +3198,24 @@ private:
}
Tuple_header * get_copy_tuple(Uint32 * rawptr) {
- Uint32 masksz = ((* rawptr) + 31) >> 5;
- return (Tuple_header*)(rawptr + 1 + masksz);
+ return (Tuple_header*)(get_change_mask_ptr(rawptr)->end_of_mask());
+ }
+
+ ChangeMask * get_change_mask_ptr(Uint32 * rawptr) {
+ return (ChangeMask*)(rawptr);
}
Tuple_header* get_copy_tuple(const Local_key* ptr){
return get_copy_tuple(get_copy_tuple_raw(ptr));
}
- Uint32* get_change_mask_ptr(const Tablerec* tabP, Tuple_header* copy_tuple){
- Uint32 * tmp = (Uint32*)copy_tuple;
- tmp -= 1 + ((tabP->m_no_of_attributes + 31) >> 5);
- assert(get_copy_tuple(tmp) == copy_tuple);
- return tmp + 1;
+ ChangeMask* get_change_mask_ptr(const Tablerec* tabP,Tuple_header* copytuple){
+ Uint32 * raw = (Uint32*)copytuple;
+ Uint32 * tmp = raw - (1 + ((tabP->m_no_of_attributes + 31) >> 5));
+ ChangeMask* mask = (ChangeMask*)tmp;
+ assert(mask->end_of_mask() == raw);
+ assert(get_copy_tuple(tmp) == copytuple);
+ return mask;
}
/**
@@ -3509,52 +3531,56 @@ bool Dbtup::find_savepoint(OperationrecP
inline
void
Dbtup::update_change_mask_info(const Tablerec* tablePtrP,
- Uint32* dst,
+ ChangeMask* dst,
const Uint32 * src)
{
+ assert(dst->m_cols == tablePtrP->m_no_of_attributes);
+ Uint32 * ptr = dst->m_mask;
Uint32 len = (tablePtrP->m_no_of_attributes + 31) >> 5;
for (Uint32 i = 0; i<len; i++)
{
- * dst |= *src;
- dst++;
+ * ptr |= *src;
+ ptr++;
src++;
}
}
inline
void
-Dbtup::set_change_mask_info(const Tablerec* tablePtrP, Uint32* dst)
+Dbtup::set_change_mask_info(const Tablerec* tablePtrP, ChangeMask* dst)
{
+ assert(dst->m_cols == tablePtrP->m_no_of_attributes);
Uint32 len = (tablePtrP->m_no_of_attributes + 31) >> 5;
- BitmaskImpl::set(len, dst);
+ BitmaskImpl::set(len, dst->m_mask);
}
inline
void
-Dbtup::clear_change_mask_info(const Tablerec* tablePtrP, Uint32* dst)
+Dbtup::clear_change_mask_info(const Tablerec* tablePtrP, ChangeMask* dst)
{
+ assert(dst->m_cols == tablePtrP->m_no_of_attributes);
Uint32 len = (tablePtrP->m_no_of_attributes + 31) >> 5;
- BitmaskImpl::clear(len, dst);
+ BitmaskImpl::clear(len, dst->m_mask);
}
inline
void
Dbtup::copy_change_mask_info(const Tablerec* tablePtrP,
- Uint32* dst, const Uint32* src)
+ ChangeMask* dst, const ChangeMask* src)
{
Uint32 dst_cols = tablePtrP->m_no_of_attributes;
- Uint32 src_cols = * src;
- const Uint32 * src_ptr = src + 1;
+ assert(dst->m_cols == dst_cols);
+ Uint32 src_cols = src->m_cols;
if (dst_cols == src_cols)
{
- memcpy(dst, src_ptr, 4 * ((dst_cols + 31) >> 5));
+ memcpy(dst->m_mask, src->m_mask, 4 * ((dst_cols + 31) >> 5));
}
else
{
ndbassert(dst_cols > src_cols); // drop column not supported
- memcpy(dst, src_ptr, 4 * ((src_cols + 31) >> 5));
- BitmaskImpl::setRange((dst_cols + 31) >> 5, dst,
+ memcpy(dst->m_mask, src->m_mask, 4 * ((src_cols + 31) >> 5));
+ BitmaskImpl::setRange((dst_cols + 31) >> 5, dst->m_mask,
src_cols, (dst_cols - src_cols));
}
}
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp 2011-02-10 10:16:09 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp 2011-04-21 05:38:27 +0000
@@ -42,7 +42,7 @@ void Dbtup::execTUP_DEALLOCREQ(Signal* s
getFragmentrec(regFragPtr, frag_id, regTabPtr.p);
ndbassert(regFragPtr.p != NULL);
- if (! (((frag_page_id << MAX_TUPLES_BITS) + page_index) == ~ (Uint32) 0))
+ if (! Local_key::isInvalid(frag_page_id, page_index))
{
Local_key tmp;
tmp.m_page_no= getRealpid(regFragPtr.p, frag_page_id);
@@ -824,16 +824,17 @@ Dbtup::set_commit_change_mask_info(const
else
{
Uint32 * dst = req_struct->changeMask.rep.data;
- Uint32 * maskptr = get_copy_tuple_raw(®OperPtr->m_copy_tuple_location);
- Uint32 cols = * maskptr;
+ Uint32 * rawptr = get_copy_tuple_raw(®OperPtr->m_copy_tuple_location);
+ ChangeMask * maskptr = get_change_mask_ptr(rawptr);
+ Uint32 cols = maskptr->m_cols;
if (cols == regTabPtr->m_no_of_attributes)
{
- memcpy(dst, maskptr + 1, 4*masklen);
+ memcpy(dst, maskptr->m_mask, 4*masklen);
}
else
{
ndbassert(regTabPtr->m_no_of_attributes > cols); // no drop column
- memcpy(dst, maskptr + 1, 4*((cols + 31) >> 5));
+ memcpy(dst, maskptr->m_mask, 4*((cols + 31) >> 5));
req_struct->changeMask.setRange(cols,
regTabPtr->m_no_of_attributes - cols);
}
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp 2011-04-05 06:46:48 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp 2011-04-27 08:39:36 +0000
@@ -325,9 +325,9 @@ Dbtup::setup_read(KeyReqStruct *req_stru
}
int
-Dbtup::load_diskpage(Signal* signal,
- Uint32 opRec, Uint32 fragPtrI,
- Uint32 local_key, Uint32 flags)
+Dbtup::load_diskpage(Signal* signal,
+ Uint32 opRec, Uint32 fragPtrI,
+ Uint32 lkey1, Uint32 lkey2, Uint32 flags)
{
Ptr<Tablerec> tabptr;
Ptr<Fragrecord> fragptr;
@@ -336,15 +336,15 @@ Dbtup::load_diskpage(Signal* signal,
c_operation_pool.getPtr(operPtr, opRec);
fragptr.i= fragPtrI;
ptrCheckGuard(fragptr, cnoOfFragrec, fragrecord);
-
+
Operationrec * regOperPtr= operPtr.p;
Fragrecord * regFragPtr= fragptr.p;
-
+
tabptr.i = regFragPtr->fragTableId;
ptrCheckGuard(tabptr, cnoOfTablerec, tablerec);
Tablerec* regTabPtr = tabptr.p;
-
- if(local_key == ~(Uint32)0)
+
+ if (Local_key::ref(lkey1, lkey2) == ~(Uint32)0)
{
jam();
regOperPtr->op_struct.m_wait_log_buffer= 1;
@@ -353,8 +353,8 @@ Dbtup::load_diskpage(Signal* signal,
}
jam();
- Uint32 page_idx= local_key & MAX_TUPLES_PER_PAGE;
- Uint32 frag_page_id= local_key >> MAX_TUPLES_BITS;
+ Uint32 page_idx= lkey2;
+ Uint32 frag_page_id= lkey1;
regOperPtr->m_tuple_location.m_page_no= getRealpid(regFragPtr,
frag_page_id);
regOperPtr->m_tuple_location.m_page_idx= page_idx;
@@ -424,9 +424,9 @@ Dbtup::disk_page_load_callback(Signal* s
}
int
-Dbtup::load_diskpage_scan(Signal* signal,
- Uint32 opRec, Uint32 fragPtrI,
- Uint32 local_key, Uint32 flags)
+Dbtup::load_diskpage_scan(Signal* signal,
+ Uint32 opRec, Uint32 fragPtrI,
+ Uint32 lkey1, Uint32 lkey2, Uint32 flags)
{
Ptr<Tablerec> tabptr;
Ptr<Fragrecord> fragptr;
@@ -435,17 +435,17 @@ Dbtup::load_diskpage_scan(Signal* signal
c_operation_pool.getPtr(operPtr, opRec);
fragptr.i= fragPtrI;
ptrCheckGuard(fragptr, cnoOfFragrec, fragrecord);
-
+
Operationrec * regOperPtr= operPtr.p;
Fragrecord * regFragPtr= fragptr.p;
-
+
tabptr.i = regFragPtr->fragTableId;
ptrCheckGuard(tabptr, cnoOfTablerec, tablerec);
Tablerec* regTabPtr = tabptr.p;
-
+
jam();
- Uint32 page_idx= local_key & MAX_TUPLES_PER_PAGE;
- Uint32 frag_page_id= local_key >> MAX_TUPLES_BITS;
+ Uint32 page_idx= lkey2;
+ Uint32 frag_page_id= lkey1;
regOperPtr->m_tuple_location.m_page_no= getRealpid(regFragPtr,
frag_page_id);
regOperPtr->m_tuple_location.m_page_idx= page_idx;
@@ -627,8 +627,7 @@ void Dbtup::execTUPKEYREQ(Signal* signal
req_struct.attrinfo_len,
attrInfoIVal);
- Uint32 localkey = (pageid << MAX_TUPLES_BITS) + pageidx;
- if (Roptype == ZINSERT && localkey == ~ (Uint32) 0)
+ if (Roptype == ZINSERT && Local_key::isInvalid(pageid, pageidx))
{
// No tuple allocatated yet
goto do_insert;
@@ -985,7 +984,7 @@ int Dbtup::handleUpdateReq(Signal* signa
{
Tuple_header *dst;
Tuple_header *base= req_struct->m_tuple_ptr, *org;
- Uint32 * change_mask_ptr;
+ ChangeMask * change_mask_ptr;
if ((dst= alloc_copy_tuple(regTabPtr, &operPtrP->m_copy_tuple_location))== 0)
{
terrorCode= ZMEM_NOMEM_ERROR;
@@ -1008,7 +1007,7 @@ int Dbtup::handleUpdateReq(Signal* signa
org= get_copy_tuple(rawptr);
copy_change_mask_info(regTabPtr,
change_mask_ptr,
- rawptr);
+ get_change_mask_ptr(rawptr));
}
/**
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp 2011-04-19 09:01:07 +0000
@@ -34,13 +34,14 @@ void
Dbtup::tuxGetTupAddr(Uint32 fragPtrI,
Uint32 pageId,
Uint32 pageIndex,
- Uint32& tupAddr)
+ Uint32& lkey1,
+ Uint32& lkey2)
{
jamEntry();
PagePtr pagePtr;
c_page_pool.getPtr(pagePtr, pageId);
- Uint32 fragPageId= pagePtr.p->frag_page_id;
- tupAddr= (fragPageId << MAX_TUPLES_BITS) | pageIndex;
+ lkey1 = pagePtr.p->frag_page_id;
+ lkey2 = pageIndex;
}
int
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp 2011-04-07 07:22:49 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp 2011-04-18 15:36:25 +0000
@@ -1809,7 +1809,7 @@ Dbtup::execDROP_TAB_REQ(Signal* signal)
{
jamEntry();
if (ERROR_INSERTED(4013)) {
-#ifdef VM_TRACE
+#if defined VM_TRACE || defined ERROR_INSERT
verifytabdes();
#endif
}
@@ -2565,7 +2565,7 @@ Dbtup::execDROP_FRAG_REQ(Signal* signal)
{
jamEntry();
if (ERROR_INSERTED(4013)) {
-#ifdef VM_TRACE
+#if defined VM_TRACE || defined ERROR_INSERT
verifytabdes();
#endif
}
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp 2011-04-05 09:12:21 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp 2011-04-19 09:01:07 +0000
@@ -354,7 +354,8 @@ Dbtup::scanReply(Signal* signal, ScanOpP
lockReq->fragId = frag.fragmentId;
lockReq->fragPtrI = RNIL; // no cached frag ptr yet
lockReq->hashValue = md5_hash((Uint64*)pkData, pkSize);
- lockReq->tupAddr = key_mm.ref();
+ lockReq->page_id = key_mm.m_page_no;
+ lockReq->page_idx = key_mm.m_page_idx;
lockReq->transId1 = scan.m_transId1;
lockReq->transId2 = scan.m_transId2;
EXECUTE_DIRECT(DBACC, GSN_ACC_LOCKREQ,
@@ -432,10 +433,9 @@ Dbtup::scanReply(Signal* signal, ScanOpP
const ScanPos& pos = scan.m_scanPos;
conf->accOperationPtr = accLockOp;
conf->fragId = frag.fragmentId;
- conf->localKey[0] = pos.m_key_mm.ref();
- conf->localKey[1] = 0;
- conf->localKeyLength = 1;
- unsigned signalLength = 6;
+ conf->localKey[0] = pos.m_key_mm.m_page_no;
+ conf->localKey[1] = pos.m_key_mm.m_page_idx;
+ unsigned signalLength = 5;
if (scan.m_bits & ScanOp::SCAN_LOCK) {
sendSignal(scan.m_userRef, GSN_NEXT_SCANCONF,
signal, signalLength, JBB);
@@ -478,17 +478,9 @@ Dbtup::execACCKEYCONF(Signal* signal)
Uint32 localKey1 = signal->theData[3];
Uint32 localKey2 = signal->theData[4];
- Uint32 localKeyFlag = signal->theData[5];
Local_key tmp;
- if (localKeyFlag == 1)
- {
- tmp.assref(localKey1);
- }
- else
- {
- tmp.m_page_no = localKey1;
- tmp.m_page_idx = localKey2;
- }
+ tmp.m_page_no = localKey1;
+ tmp.m_page_idx = localKey2;
c_scanOpPool.getPtr(scanPtr);
ScanOp& scan = *scanPtr.p;
@@ -1107,12 +1099,11 @@ Dbtup::scanNext(Signal* signal, ScanOpPt
conf->scanPtr = scan.m_userPtr;
conf->accOperationPtr = RNIL;
conf->fragId = frag.fragmentId;
- conf->localKey[0] = pos.m_key_mm.ref();
- conf->localKey[1] = 0;
- conf->localKeyLength = 1;
+ conf->localKey[0] = pos.m_key_mm.m_page_no;
+ conf->localKey[1] = pos.m_key_mm.m_page_idx;
conf->gci = foundGCI;
Uint32 blockNo = refToMain(scan.m_userRef);
- EXECUTE_DIRECT(blockNo, GSN_NEXT_SCANCONF, signal, 7);
+ EXECUTE_DIRECT(blockNo, GSN_NEXT_SCANCONF, signal, 6);
jamEntry();
// TUPKEYREQ handles savepoint stuff
@@ -1170,12 +1161,11 @@ Dbtup::handle_lcp_keep(Signal* signal,
conf->scanPtr = scanPtrP->m_userPtr;
conf->accOperationPtr = (Uint32)-1;
conf->fragId = fragPtrP->fragmentId;
- conf->localKey[0] = lcp_list;
- conf->localKey[1] = 0;
- conf->localKeyLength = 1;
+ conf->localKey[0] = Local_key::ref2page_id(lcp_list);
+ conf->localKey[1] = Local_key::ref2page_idx(lcp_list);
conf->gci = 0;
Uint32 blockNo = refToMain(scanPtrP->m_userRef);
- EXECUTE_DIRECT(blockNo, GSN_NEXT_SCANCONF, signal, 7);
+ EXECUTE_DIRECT(blockNo, GSN_NEXT_SCANCONF, signal, 6);
fragPtrP->m_lcp_keep_list = next;
ptr->m_header_bits |= Tuple_header::FREED; // RESTORE free flag
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp 2011-02-07 13:21:49 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp 2011-04-19 15:59:06 +0000
@@ -28,6 +28,9 @@
* TABLE DESCRIPTOR MEMORY MANAGER
*
* Each table has a descriptor which is a contiguous array of words.
+ * Newer NDB versions also have additional "dynamic descriptors"
+ * which are allocated separately using the same method.
+ *
* The descriptor is allocated from a global array using a buddy
* algorithm. Free lists exist for each power of 2 words. Freeing
* a piece first merges with free right and left neighbours and then
@@ -257,14 +260,15 @@ void Dbtup::removeTdArea(Uint32 tabDesRe
}//if
}//Dbtup::removeTdArea()
-#ifdef VM_TRACE
+#if defined VM_TRACE || defined ERROR_INSERT
void
Dbtup::verifytabdes()
{
struct WordType {
short fl; // free list 0-15
short ti; // table id
- WordType() : fl(-1), ti(-1) {}
+ short td; // table descriptor area 0 or >0 for dynamic
+ WordType() : fl(-1), ti(-1), td(-1) {}
};
WordType* wt = new WordType [cnoOfTabDescrRec];
uint free_words = 0;
@@ -339,14 +343,16 @@ Dbtup::verifytabdes()
for (uint j = 0; j < size; j++) {
ndbrequire(wt[desc + j].ti == -1);
wt[desc + j].ti = i;
+ wt[desc + j].td = 0;
}
used_words += size;
}
+ for (uint k = 0; k < NO_DYNAMICS; k++)
{
Uint32 offset[3];
- Uint32 MaskSize = (ptr.p->m_dyn_null_bits[MM] + 31) >> 5;
+ Uint32 MaskSize = (ptr.p->m_dyn_null_bits[k] + 31) >> 5;
const Uint32 alloc = getDynTabDescrOffsets(MaskSize, offset);
- const Uint32 desc = ptr.p->dynTabDescriptor[MM];
+ const Uint32 desc = ptr.p->dynTabDescriptor[k];
Uint32 size = alloc;
if (size % ZTD_FREE_SIZE != 0)
size += ZTD_FREE_SIZE - size % ZTD_FREE_SIZE;
@@ -366,6 +372,7 @@ Dbtup::verifytabdes()
for (uint j = 0; j < size; j++) {
ndbrequire(wt[desc + j].ti == -1);
wt[desc + j].ti = i;
+ wt[desc + j].td = 1 + k;
}
used_words += size;
}
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2011-04-19 09:01:07 +0000
@@ -776,7 +776,7 @@ private:
// inlined utils
DescEnt& getDescEnt(Uint32 descPage, Uint32 descOff);
- Uint32 getTupAddr(const Frag& frag, TreeEnt ent);
+ void getTupAddr(const Frag& frag, TreeEnt ent, Uint32& lkey1, Uint32& lkey2);
static unsigned min(unsigned x, unsigned y);
static unsigned max(unsigned x, unsigned y);
@@ -1242,15 +1242,15 @@ Dbtux::getDescEnt(Uint32 descPage, Uint3
return *descEnt;
}
-inline Uint32
-Dbtux::getTupAddr(const Frag& frag, TreeEnt ent)
+inline
+void
+Dbtux::getTupAddr(const Frag& frag, TreeEnt ent, Uint32& lkey1, Uint32& lkey2)
{
const Uint32 tableFragPtrI = frag.m_tupTableFragPtrI;
const TupLoc tupLoc = ent.m_tupLoc;
- Uint32 tupAddr = NullTupAddr;
- c_tup->tuxGetTupAddr(tableFragPtrI, tupLoc.getPageId(), tupLoc.getPageOffset(), tupAddr);
+ c_tup->tuxGetTupAddr(tableFragPtrI, tupLoc.getPageId(),tupLoc.getPageOffset(),
+ lkey1, lkey2);
jamEntry();
- return tupAddr;
}
inline unsigned
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp 2011-04-19 09:01:07 +0000
@@ -511,7 +511,10 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal
const Uint32* const buf32 = static_cast<Uint32*>(pkData);
const Uint64* const buf64 = reinterpret_cast<const Uint64*>(buf32);
lockReq->hashValue = md5_hash(buf64, pkSize);
- lockReq->tupAddr = getTupAddr(frag, ent);
+ Uint32 lkey1, lkey2;
+ getTupAddr(frag, ent, lkey1, lkey2);
+ lockReq->page_id = lkey1;
+ lockReq->page_idx = lkey2;
lockReq->transId1 = scan.m_transId1;
lockReq->transId2 = scan.m_transId2;
// execute
@@ -599,10 +602,11 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal
}
conf->accOperationPtr = accLockOp;
conf->fragId = frag.m_fragId;
- conf->localKey[0] = getTupAddr(frag, ent);
- conf->localKey[1] = 0;
- conf->localKeyLength = 1;
- unsigned signalLength = 6;
+ Uint32 lkey1, lkey2;
+ getTupAddr(frag, ent, lkey1, lkey2);
+ conf->localKey[0] = lkey1;
+ conf->localKey[1] = lkey2;
+ unsigned signalLength = 5;
// add key info
if (! scan.m_readCommitted) {
sendSignal(scan.m_userRef, GSN_NEXT_SCANCONF,
=== modified file 'storage/ndb/src/kernel/blocks/lgman.cpp'
--- a/storage/ndb/src/kernel/blocks/lgman.cpp 2011-02-24 13:39:24 +0000
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp 2011-04-21 13:45:17 +0000
@@ -420,6 +420,34 @@ Lgman::execDUMP_STATE_ORD(Signal* signal
m_logfile_group_list.next(ptr);
}
}
+ if (signal->theData[0] == 12003)
+ {
+ bool crash = false;
+ Ptr<Logfile_group> ptr;
+ for (m_logfile_group_list.first(ptr); !ptr.isNull();
+ m_logfile_group_list.next(ptr))
+ {
+ if (ptr.p->m_callback_buffer_words != 0)
+ {
+ crash = true;
+ break;
+ }
+ }
+
+ if (crash)
+ {
+ ndbout_c("Detected logfile-group with non zero m_callback_buffer_words");
+ signal->theData[0] = 12002;
+ execDUMP_STATE_ORD(signal);
+ ndbrequire(false);
+ }
+#ifdef VM_TRACE
+ else
+ {
+ ndbout_c("Check for non zero m_callback_buffer_words OK!");
+ }
+#endif
+ }
}
void
@@ -2401,7 +2429,6 @@ Logfile_client::add_entry(const Change*
}
* (dst - 1) |= File_formats::Undofile::UNDO_NEXT_LSN << 16;
ptr.p->m_free_file_words += 2;
- tot += 2; // for callback_buffer
m_lgman->validate_logfile_group(ptr);
}
else
@@ -2415,6 +2442,12 @@ Logfile_client::add_entry(const Change*
dst += src[i].len;
}
}
+ /**
+ * for callback_buffer, always allocats 2 extra...
+ * not knowing if LSN must be added or not
+ */
+ tot += 2;
+
if (unlikely(! (tot <= callback_buffer)))
{
abort();
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp 2011-02-02 00:40:07 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp 2011-04-21 09:21:18 +0000
@@ -80,7 +80,7 @@ public:
char *buf;
size_t size;
off_t offset;
- } pages[16];
+ } pages[32];
} readWrite;
struct {
const char * buf;
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp 2011-04-06 12:49:06 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp 2011-04-21 09:21:18 +0000
@@ -548,7 +548,19 @@ Ndbfs::execFSCLOSEREQ(Signal * signal)
void
Ndbfs::readWriteRequest(int action, Signal * signal)
{
- const FsReadWriteReq * const fsRWReq = (FsReadWriteReq *)&signal->theData[0];
+ Uint32 theData[25 + 2 * 32];
+ memcpy(theData, signal->theData, 4 * signal->getLength());
+ SectionHandle handle(this, signal);
+ if (handle.m_cnt > 0)
+ {
+ SegmentedSectionPtr secPtr;
+ ndbrequire(handle.getSection(secPtr, 0));
+ ndbrequire(signal->getLength() + secPtr.sz < NDB_ARRAY_SIZE(theData));
+ copy(theData + signal->getLength(), secPtr);
+ releaseSections(handle);
+ }
+
+ const FsReadWriteReq * const fsRWReq = (FsReadWriteReq *)theData;
Uint16 filePointer = (Uint16)fsRWReq->filePointer;
const UintR userPointer = fsRWReq->userPointer;
const BlockReference userRef = fsRWReq->userReference;
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp 2011-04-01 13:03:45 +0000
@@ -46,29 +46,35 @@ PosixAsyncFile::PosixAsyncFile(Simulated
theFd(-1),
use_gz(0)
{
- memset(&azf,0,sizeof(azf));
+ memset(&nzf,0,sizeof(nzf));
init_mutex();
}
int PosixAsyncFile::init()
{
- // Create write buffer for bigger writes
- azfBufferUnaligned= (Byte*)ndbd_malloc((AZ_BUFSIZE_READ+AZ_BUFSIZE_WRITE)
- +NDB_O_DIRECT_WRITE_ALIGNMENT-1);
-
- azf.inbuf= (Byte*)(((UintPtr)azfBufferUnaligned
+ /*
+ Preallocate read and write buffers for ndbzio to workaround
+ default behaviour of alloc/free at open/close
+ */
+ const size_t read_size = ndbz_bufsize_read();
+ const size_t write_size = ndbz_bufsize_write();
+
+ nzfBufferUnaligned= ndbd_malloc(read_size + write_size +
+ NDB_O_DIRECT_WRITE_ALIGNMENT-1);
+ nzf.inbuf= (Byte*)(((UintPtr)nzfBufferUnaligned
+ NDB_O_DIRECT_WRITE_ALIGNMENT - 1) &
~(UintPtr)(NDB_O_DIRECT_WRITE_ALIGNMENT - 1));
+ nzf.outbuf= nzf.inbuf + read_size;
- azf.outbuf= azf.inbuf + AZ_BUFSIZE_READ;
-
- az_mempool.size = az_mempool.mfree = az_inflate_mem_size()+az_deflate_mem_size();
+ /* Preallocate inflate/deflate buffers for ndbzio */
+ nz_mempool.size = nz_mempool.mfree =
+ ndbz_inflate_mem_size() + ndbz_deflate_mem_size();
ndbout_c("NDBFS/AsyncFile: Allocating %u for In/Deflate buffer",
- (unsigned int)az_mempool.size);
- az_mempool.mem = (char*) ndbd_malloc(az_mempool.size);
+ (unsigned int)nz_mempool.size);
+ nz_mempool.mem = (char*) ndbd_malloc(nz_mempool.size);
- azf.stream.opaque= &az_mempool;
+ nzf.stream.opaque= &nz_mempool;
return 0;
}
@@ -359,7 +365,7 @@ no_odirect:
#endif
int n;
if(use_gz)
- n= azwrite(&azf,buf,size);
+ n= ndbzwrite(&nzf, buf, size);
else
n= write(theFd, buf, size);
if(n == -1 && errno == EINTR)
@@ -368,7 +374,7 @@ no_odirect:
}
if(n == -1 || n == 0)
{
- ndbout_c("azwrite|write returned %d: errno: %d my_errno: %d",n,errno,my_errno);
+ ndbout_c("ndbzwrite|write returned %d: errno: %d my_errno: %d",n,errno,my_errno);
break;
}
size -= n;
@@ -480,7 +486,7 @@ no_odirect:
if(use_gz)
{
int err;
- if((err= azdopen(&azf, theFd, new_flags)) < 1)
+ if((err= ndbzdopen(&nzf, theFd, new_flags)) < 1)
{
ndbout_c("Stewart's brain broke: %d %d %s",
err, my_errno, theFileName.c_str());
@@ -509,7 +515,7 @@ int PosixAsyncFile::readBuffer(Request *
#endif
if(use_gz)
{
- while((seek_val= azseek(&azf, offset, SEEK_SET)) == (off_t)-1
+ while((seek_val= ndbzseek(&nzf, offset, SEEK_SET)) == (off_t)-1
&& errno == EINTR) {};
if(seek_val == (off_t)-1)
{
@@ -524,14 +530,14 @@ int PosixAsyncFile::readBuffer(Request *
#if ! defined(HAVE_PREAD)
if(use_gz)
- return_value = azread(&azf, buf, size, &error);
+ return_value = ndbzread(&nzf, buf, size, &error);
else
return_value = ::read(theFd, buf, size);
#else // UNIX
if(!use_gz)
return_value = ::pread(theFd, buf, size, offset);
else
- return_value = azread(&azf, buf, size, &error);
+ return_value = ndbzread(&nzf, buf, size, &error);
#endif
if (return_value == -1 && errno == EINTR) {
DEBUG(ndbout_c("EINTR in read"));
@@ -540,13 +546,13 @@ int PosixAsyncFile::readBuffer(Request *
if (return_value == -1)
return errno;
}
- else if (return_value < 1 && azf.z_eof!=1)
+ else if (return_value < 1 && nzf.z_eof!=1)
{
- if(my_errno==0 && errno==0 && error==0 && azf.z_err==Z_STREAM_END)
+ if(my_errno==0 && errno==0 && error==0 && nzf.z_err==Z_STREAM_END)
break;
DEBUG(ndbout_c("ERROR DURING %sRead: %d off: %d from %s",(use_gz)?"gz":"",size,offset,theFileName.c_str()));
ndbout_c("ERROR IN PosixAsyncFile::readBuffer %d %d %d %d",
- my_errno, errno, azf.z_err, error);
+ my_errno, errno, nzf.z_err, error);
if(use_gz)
return my_errno;
return errno;
@@ -629,12 +635,12 @@ int PosixAsyncFile::writeBuffer(const ch
#if ! defined(HAVE_PWRITE)
if(use_gz)
- return_value= azwrite(&azf, buf, bytes_to_write);
+ return_value= ndbzwrite(&nzf, buf, bytes_to_write);
else
return_value = ::write(theFd, buf, bytes_to_write);
#else // UNIX
if(use_gz)
- return_value= azwrite(&azf, buf, bytes_to_write);
+ return_value= ndbzwrite(&nzf, buf, bytes_to_write);
else
return_value = ::pwrite(theFd, buf, bytes_to_write, offset);
#endif
@@ -643,7 +649,7 @@ int PosixAsyncFile::writeBuffer(const ch
DEBUG(ndbout_c("EINTR in write"));
} else if (return_value == -1 || return_value < 1){
ndbout_c("ERROR IN PosixAsyncFile::writeBuffer %d %d %d",
- my_errno, errno, azf.z_err);
+ my_errno, errno, nzf.z_err);
if(use_gz)
return my_errno;
return errno;
@@ -678,17 +684,17 @@ void PosixAsyncFile::closeReq(Request *r
}
int r;
if(use_gz)
- r= azclose(&azf);
+ r= ndbzclose(&nzf);
else
r= ::close(theFd);
use_gz= 0;
Byte *a,*b;
- a= azf.inbuf;
- b= azf.outbuf;
- memset(&azf,0,sizeof(azf));
- azf.inbuf= a;
- azf.outbuf= b;
- azf.stream.opaque = (void*)&az_mempool;
+ a= nzf.inbuf;
+ b= nzf.outbuf;
+ memset(&nzf,0,sizeof(nzf));
+ nzf.inbuf= a;
+ nzf.outbuf= b;
+ nzf.stream.opaque = (void*)&nz_mempool;
if (-1 == r) {
#ifndef DBUG_OFF
@@ -729,7 +735,7 @@ void PosixAsyncFile::appendReq(Request *
while(size > 0){
int n;
if(use_gz)
- n= azwrite(&azf,buf,size);
+ n= ndbzwrite(&nzf,buf,size);
else
n= write(theFd, buf, size);
if(n == -1 && errno == EINTR){
@@ -823,15 +829,19 @@ loop:
PosixAsyncFile::~PosixAsyncFile()
{
- if (azfBufferUnaligned)
- ndbd_free(azfBufferUnaligned, (AZ_BUFSIZE_READ*AZ_BUFSIZE_WRITE)
- +NDB_O_DIRECT_WRITE_ALIGNMENT-1);
-
- if(az_mempool.mem)
- ndbd_free(az_mempool.mem,az_mempool.size);
+ /* Free the read and write buffer memory used by ndbzio */
+ if (nzfBufferUnaligned)
+ ndbd_free(nzfBufferUnaligned,
+ ndbz_bufsize_read() +
+ ndbz_bufsize_write() +
+ NDB_O_DIRECT_WRITE_ALIGNMENT-1);
+ nzfBufferUnaligned = NULL;
+
+ /* Free the inflate/deflate buffers for ndbzio */
+ if(nz_mempool.mem)
+ ndbd_free(nz_mempool.mem, nz_mempool.size);
+ nz_mempool.mem = NULL;
- az_mempool.mem = NULL;
- azfBufferUnaligned = NULL;
destroy_mutex();
}
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.hpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.hpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.hpp 2011-04-01 12:30:27 +0000
@@ -25,7 +25,7 @@
* Also does direct IO, preallocation.
*/
-#include <azlib.h>
+#include <ndbzio.h>
/**
* PREAD/PWRITE is needed to use file != thread
@@ -66,9 +66,9 @@ private:
int theFd;
int use_gz;
- azio_stream azf;
- struct az_alloc_rec az_mempool;
- void* azfBufferUnaligned;
+ ndbzio_stream nzf;
+ struct ndbz_alloc_rec nz_mempool;
+ void* nzfBufferUnaligned;
int check_odirect_read(Uint32 flags, int&new_flags, int mode);
int check_odirect_write(Uint32 flags, int&new_flags, int mode);
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp 2011-04-21 09:21:18 +0000
@@ -163,6 +163,9 @@ VoidFs::execFSWRITEREQ(Signal* signal)
const Uint32 userRef = req->userReference;
const Uint32 userPointer = req->userPointer;
+ SectionHandle handle(this, signal);
+ releaseSections(handle);
+
signal->theData[0] = userPointer;
sendSignal(userRef, GSN_FSWRITECONF, signal, 1, JBB);
}
@@ -176,6 +179,9 @@ VoidFs::execFSREADREQ(Signal* signal)
const Uint32 userRef = req->userReference;
const Uint32 userPointer = req->userPointer;
+ SectionHandle handle(this, signal);
+ releaseSections(handle);
+
signal->theData[0] = userPointer;
sendSignal(userRef, GSN_FSREADCONF, signal, 1, JBB);
#if 0
=== modified file 'storage/ndb/src/kernel/vm/mt.cpp'
--- a/storage/ndb/src/kernel/vm/mt.cpp 2011-02-24 07:39:24 +0000
+++ b/storage/ndb/src/kernel/vm/mt.cpp 2011-04-27 08:39:36 +0000
@@ -401,7 +401,7 @@ struct thr_safe_pool
T* m_free_list;
Uint32 m_cnt;
- thr_spin_lock<NDB_CL - (sizeof(T*) + sizeof(Uint32))> m_lock;
+ thr_spin_lock<NDB_CL - (sizeof(void*) + sizeof(Uint32))> m_lock;
T* seize(Ndbd_mem_manager *mm, Uint32 rg) {
T* ret = 0;
=== modified file 'storage/ndb/src/mgmsrv/ConfigInfo.cpp'
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2011-04-15 13:52:53 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2011-04-19 13:47:33 +0000
@@ -1307,7 +1307,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
ConfigInfo::CI_USED,
false,
ConfigInfo::CI_ENUM,
- 0,
+ "Default", /* Default value */
(const char*)arbit_method_typelib,
0
},
@@ -2183,12 +2183,17 @@ const ConfigInfo::ParamInfo ConfigInfo::
CFG_DEFAULT_OPERATION_REDO_PROBLEM_ACTION,
"DefaultOperationRedoProblemAction",
API_TOKEN,
- "If Redo-log is having problem, should operation default (unless overridden on transaction/operation level) abort or be put on queue"
- " in a row times, transactions will be aborted",
+ "If Redo-log is having problem, should operation default "
+ "(unless overridden on transaction/operation level) abort "
+ "or be put on queue",
ConfigInfo::CI_USED,
false,
ConfigInfo::CI_ENUM,
- 0, /* default for ENUM doesnt seem to work... */
+#if NDB_VERSION_D < NDB_MAKE_VERSION(7,2,0)
+ "abort", /* Default value */
+#else
+ "queue", /* Default value */
+#endif
(const char*)default_operation_redo_problem_action_typelib,
0
},
@@ -3164,11 +3169,26 @@ ConfigInfo::ConfigInfo()
entry->name != 0; entry++)
values.put(entry->name, entry->value);
require(pinfo.put("values", &values));
- // fallthrough
+
+ if(param._default == MANDATORY)
+ pinfo.put("Mandatory", (Uint32)1);
+ else if(param._default)
+ {
+ /*
+ Map default value of enum from string to int since
+ enum is stored as int internally
+ */
+ Uint32 default_value;
+ require(values.get(param._default, &default_value));
+ require(pinfo.put("Default", default_value));
+
+ /* Also store the default as string */
+ require(pinfo.put("DefaultString", param._default));
+ }
+ break;
}
case CI_STRING:
- assert(param._type == CI_ENUM || // Allow fallthrough from enum
- param._min == 0); // String can't have min value
+ assert(param._min == 0); // String can't have min value
assert(param._max == 0); // String can't have max value
if(param._default == MANDATORY)
@@ -3218,7 +3238,6 @@ ConfigInfo::ConfigInfo()
{
case CI_SECTION:
break;
- case CI_ENUM:
case CI_STRING:
case CI_BITMASK:
require(p->put(param._fname, param._default));
@@ -3237,6 +3256,20 @@ ConfigInfo::ConfigInfo()
require(p->put64(param._fname, Uint64(default_uint64)));
break;
}
+ case CI_ENUM:
+ {
+ /*
+ Map default value of enum from string to int since
+ enum is stored as int internally
+ */
+ Uint32 default_value;
+ require(verify_enum(getInfo(param._section),
+ param._fname, param._default,
+ default_value));
+ require(p->put(param._fname, default_value));
+ break;
+ }
+
}
}
require(m_systemDefaults.put(param._section, p, true));
@@ -3264,7 +3297,7 @@ ConfigInfo::ConfigInfo()
ndbout << "Edit file " << __FILE__ << "." << endl;
require(false);
}
- }
+ }
}
@@ -3350,8 +3383,29 @@ ConfigInfo::getDefault(const Properties
const char*
ConfigInfo::getDefaultString(const Properties * section,
- const char* fname) const {
- return getInfoString(section, fname, "Default");
+ const char* fname) const
+{
+ switch (getType(section, fname))
+ {
+ case ConfigInfo::CI_BITMASK:
+ case ConfigInfo::CI_STRING:
+ return getInfoString(section, fname, "Default");
+
+ case ConfigInfo::CI_ENUM:
+ {
+ /*
+ Default value for enum are stored as int internally
+ but also stores the orignal string, use different
+ key to get at the default value as string
+ */
+ return getInfoString(section, fname, "DefaultString");
+ }
+
+ default:
+ require(false);
+ }
+
+ return NULL;
}
bool
@@ -4155,6 +4209,7 @@ applyDefaultValues(InitConfigFileParser:
else
{
switch (ctx.m_info->getType(ctx.m_currentInfo, name)){
+ case ConfigInfo::CI_ENUM:
case ConfigInfo::CI_INT:
case ConfigInfo::CI_BOOL:{
Uint32 val = 0;
@@ -4169,7 +4224,6 @@ applyDefaultValues(InitConfigFileParser:
break;
}
case ConfigInfo::CI_BITMASK:
- case ConfigInfo::CI_ENUM:
case ConfigInfo::CI_STRING:{
const char * val;
require(ctx.m_currentSection->get(name, &val));
=== modified file 'storage/ndb/src/ndbapi/NdbScanOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp 2011-02-10 08:02:41 +0000
+++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp 2011-04-27 08:39:36 +0000
@@ -1771,9 +1771,9 @@ NdbScanOperation::nextResult(const char
NdbRecAttr *getvalue_recattr= theReceiver.theFirstRecAttr;
if (((UintPtr)tBlob | (UintPtr)getvalue_recattr) != 0)
{
- Uint32 idx= m_current_api_receiver;
+ const Uint32 idx= m_current_api_receiver;
assert(idx < m_api_receivers_count);
- const NdbReceiver *receiver= m_api_receivers[m_current_api_receiver];
+ const NdbReceiver *receiver= m_api_receivers[idx];
Uint32 pos= 0;
/* First take care of any getValue(). */
=== modified file 'storage/ndb/test/ndbapi/testDict.cpp'
--- a/storage/ndb/test/ndbapi/testDict.cpp 2011-04-07 07:22:49 +0000
+++ b/storage/ndb/test/ndbapi/testDict.cpp 2011-04-23 08:21:36 +0000
@@ -31,6 +31,7 @@
#include <NdbSqlUtil.hpp>
#include <NdbEnv.h>
#include <ndb_rand.h>
+#include <Bitmask.hpp>
#define ERR_INSERT_MASTER_FAILURE1 6013
#define ERR_INSERT_MASTER_FAILURE2 6014
@@ -294,31 +295,45 @@ int runCreateAndDropAtRandom(NDBT_Contex
Ndb* pNdb = GETNDB(step);
NdbDictionary::Dictionary* pDic = pNdb->getDictionary();
int loops = ctx->getNumLoops();
- int numTables = NDBT_Tables::getNumTables();
- bool* tabList = new bool [ numTables ];
- int tabCount;
+ int records = ctx->getNumRecords();
- {
- for (int num = 0; num < numTables; num++) {
- (void)pDic->dropTable(NDBT_Tables::getTable(num)->getName());
- tabList[num] = false;
- }
- tabCount = 0;
+ int numAllTables = NDBT_Tables::getNumTables();
+ struct TabList {
+ int exists; // -1 = skip, 0 = no, 1 = yes
+ const NdbDictionary::Table* pTab; // retrieved
+ TabList() { exists = -1; pTab = 0; }
+ };
+ TabList* tabList = new TabList [ numAllTables ];
+ int numTables = 0;
+ int num;
+ for (num = 0; num < numAllTables; num++) {
+ const NdbDictionary::Table* pTab = NDBT_Tables::getTable(num);
+ if (pTab->checkColumns(0, 0) & 2) // skip disk
+ continue;
+ tabList[num].exists = 0;
+ (void)pDic->dropTable(pTab->getName());
+ numTables++;
}
+ int numExists = 0;
+
+ const bool createIndexes = ctx->getProperty("CreateIndexes");
+ const bool loadData = ctx->getProperty("LoadData");
NdbRestarter restarter;
int result = NDBT_OK;
int bias = 1; // 0-less 1-more
int i = 0;
- while (i < loops) {
- g_info << "loop " << i << " tabs " << tabCount << "/" << numTables << endl;
- int num = myRandom48(numTables);
+ while (i < loops && result == NDBT_OK) {
+ num = myRandom48(numAllTables);
+ if (tabList[num].exists == -1)
+ continue;
+ g_info << "loop " << i << " tabs " << numExists << "/" << numTables << endl;
const NdbDictionary::Table* pTab = NDBT_Tables::getTable(num);
char tabName[200];
strcpy(tabName, pTab->getName());
- if (tabList[num] == false) {
+ if (tabList[num].exists == 0) {
if (bias == 0 && myRandom48(100) < 80)
continue;
g_info << tabName << ": create" << endl;
@@ -331,17 +346,110 @@ int runCreateAndDropAtRandom(NDBT_Contex
const NdbDictionary::Table* pTab2 = pDic->getTable(tabName);
if (pTab2 == NULL) {
const NdbError err = pDic->getNdbError();
- g_err << tabName << ": verify create: " << err << endl;
+ g_err << tabName << ": verify create failed: " << err << endl;
result = NDBT_FAILED;
break;
}
- tabList[num] = true;
- assert(tabCount < numTables);
- tabCount++;
- if (tabCount == numTables)
+ tabList[num].pTab = pTab2;
+ if (loadData) {
+ g_info << tabName << ": load data" << endl;
+ HugoTransactions hugoTrans(*pTab2);
+ if (hugoTrans.loadTable(pNdb, records) != 0) {
+ g_err << tabName << ": loadTable failed" << endl;
+ result = NDBT_FAILED;
+ break;
+ }
+ }
+ if (createIndexes) {
+ int icount = myRandom48(10);
+ int inum;
+ for (inum = 0; inum < icount; inum++) {
+ const int tcols = pTab2->getNoOfColumns();
+ assert(tcols != 0);
+ int icols = 1 + myRandom48(tcols);
+ if (icols > NDB_MAX_ATTRIBUTES_IN_INDEX)
+ icols = NDB_MAX_ATTRIBUTES_IN_INDEX;
+ char indName[200];
+ sprintf(indName, "%s_X%d", tabName, inum);
+ NdbDictionary::Index ind(indName);
+ ind.setTable(tabName);
+ ind.setType(NdbDictionary::Index::OrderedIndex);
+ ind.setLogging(false);
+ Bitmask<MAX_ATTRIBUTES_IN_TABLE> mask;
+ char ilist[200];
+ ilist[0] = 0;
+ int ic;
+ for (ic = 0; ic < icols; ic++) {
+ int tc = myRandom48(tcols);
+ const NdbDictionary::Column* c = pTab2->getColumn(tc);
+ assert(c != 0);
+ if (mask.get(tc) ||
+ c->getType() == NdbDictionary::Column::Blob ||
+ c->getType() == NdbDictionary::Column::Text ||
+ c->getType() == NdbDictionary::Column::Bit ||
+ c->getStorageType() == NdbDictionary::Column::StorageTypeDisk)
+ continue;
+ ind.addColumn(*c);
+ mask.set(tc);
+ sprintf(ilist + strlen(ilist), " %d", tc);
+ }
+ if (mask.isclear())
+ continue;
+ g_info << indName << ": columns:" << ilist << endl;
+ if (pDic->createIndex(ind) == 0) {
+ g_info << indName << ": created" << endl;
+ } else {
+ const NdbError err = pDic->getNdbError();
+ g_err << indName << ": create index failed: " << err << endl;
+ if (err.code != 826 && // Too many tables and attributes..
+ err.code != 903 && // Too many ordered indexes..
+ err.code != 904 && // Out of fragment records..
+ err.code != 905 && // Out of attribute records..
+ err.code != 707 && // No more table metadata records..
+ err.code != 708) // No more attribute metadata records..
+ {
+ result = NDBT_FAILED;
+ break;
+ }
+ }
+ }
+ }
+ if (loadData) {
+ // first update a random table to flush global variables
+ int num3 = 0;
+ while (1) {
+ num3 = myRandom48(numAllTables);
+ if (num == num3 || tabList[num3].exists == 1)
+ break;
+ }
+ const NdbDictionary::Table* pTab3 = tabList[num3].pTab;
+ assert(pTab3 != 0);
+ char tabName3[200];
+ strcpy(tabName3, pTab3->getName());
+ HugoTransactions hugoTrans(*pTab3);
+ g_info << tabName3 << ": update data" << endl;
+ if (hugoTrans.pkUpdateRecords(pNdb, records) != 0) {
+ g_err << tabName3 << ": pkUpdateRecords failed" << endl;
+ result = NDBT_FAILED;
+ break;
+ }
+ }
+ if (loadData) {
+ HugoTransactions hugoTrans(*pTab2);
+ g_info << tabName << ": update data" << endl;
+ if (hugoTrans.pkUpdateRecords(pNdb, records) != 0) {
+ g_err << "pkUpdateRecords failed" << endl;
+ result = NDBT_FAILED;
+ break;
+ }
+ }
+ tabList[num].exists = 1;
+ assert(numExists < numTables);
+ numExists++;
+ if (numExists == numTables)
bias = 0;
}
- else {
+ else if (tabList[num].exists == 1) {
if (bias == 1 && myRandom48(100) < 80)
continue;
g_info << tabName << ": drop" << endl;
@@ -369,19 +477,19 @@ int runCreateAndDropAtRandom(NDBT_Contex
result = NDBT_FAILED;
break;
}
- tabList[num] = false;
- assert(tabCount > 0);
- tabCount--;
- if (tabCount == 0)
+ tabList[num].exists = 0;
+ assert(numExists > 0);
+ numExists--;
+ if (numExists == 0)
bias = 1;
}
i++;
}
-
- for (Uint32 i = 0; i<(Uint32)numTables; i++)
- if (tabList[i])
- pDic->dropTable(NDBT_Tables::getTable(i)->getName());
-
+
+ for (num = 0; num < numAllTables; num++)
+ if (tabList[num].exists == 1)
+ pDic->dropTable(NDBT_Tables::getTable(num)->getName());
+
delete [] tabList;
return result;
}
@@ -8737,6 +8845,13 @@ TESTCASE("CreateAndDropAtRandom",
"Uses error insert 4013 to make TUP verify table descriptor"){
INITIALIZER(runCreateAndDropAtRandom);
}
+TESTCASE("CreateAndDropIndexes",
+ "Like CreateAndDropAtRandom but also creates random ordered\n"
+ "indexes and loads data as a simple check of index operation"){
+ TC_PROPERTY("CreateIndexes", 1);
+ TC_PROPERTY("LoadData", 1);
+ INITIALIZER(runCreateAndDropAtRandom);
+}
TESTCASE("CreateAndDropWithData",
"Try to create and drop the table when it's filled with data\n"
"do this loop number of times\n"){
=== modified file 'storage/ndb/test/run-test/Makefile.am'
--- a/storage/ndb/test/run-test/Makefile.am 2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/run-test/Makefile.am 2011-04-21 05:41:24 +0000
@@ -26,7 +26,9 @@ test_DATA=daily-basic-tests.txt daily-de
conf-ndbmaster.cnf \
conf-fimafeng08.cnf conf-dl145a.cnf test-tests.txt conf-test.cnf \
conf-upgrade.cnf upgrade-tests.txt \
- conf-ndb07.cnf conf-fimafeng09.cnf conf-tyr64.cnf conf-techra29.cnf
+ conf-ndb07.cnf \
+ conf-fimafeng09.cnf conf-tyr64.cnf conf-techra29.cnf \
+ conf-blade08.cnf
test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \
autotest-run.sh atrt-backtrace.sh
=== added file 'storage/ndb/test/run-test/conf-blade08.cnf'
--- a/storage/ndb/test/run-test/conf-blade08.cnf 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/run-test/conf-blade08.cnf 2011-04-20 09:18:09 +0000
@@ -0,0 +1,32 @@
+[atrt]
+basedir = CHOOSE_dir
+baseport = 14000
+clusters = .2node
+
+[ndb_mgmd]
+
+[mysqld]
+skip-innodb
+skip-bdb
+
+[cluster_config.2node]
+ndb_mgmd = CHOOSE_host1
+ndbd = CHOOSE_host2,CHOOSE_host3
+ndbapi= CHOOSE_host1,CHOOSE_host1,CHOOSE_host1
+
+NoOfReplicas = 2
+IndexMemory = 100M
+DataMemory = 300M
+BackupMemory = 64M
+MaxNoOfConcurrentScans = 100
+MaxNoOfSavedMessages= 1000
+SendBufferMemory = 2M
+NoOfFragmentLogFiles = 4
+FragmentLogFileSize = 64M
+CompressedLCP=1
+CompressedBackup=1
+ODirect=1
+
+SharedGlobalMemory=256M
+InitialLogfileGroup=undo_buffer_size=64M;undofile01.dat:256M;undofile02.dat:128M
+InitialTablespace=datafile01.dat:128M;datafile02.dat:64M
=== modified file 'storage/ndb/test/run-test/daily-basic-tests.txt'
--- a/storage/ndb/test/run-test/daily-basic-tests.txt 2011-04-17 18:25:41 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt 2011-04-27 08:39:36 +0000
@@ -715,6 +715,10 @@ args: -n CreateAndDropAtRandom -l 200 T1
max-time: 1500
cmd: testDict
+args: -n CreateAndDropIndexes -l 200 T1
+
+max-time: 1500
+cmd: testDict
args: -n CreateAndDropWithData
max-time: 1500
=== modified file 'storage/ndb/test/src/HugoCalculator.cpp'
--- a/storage/ndb/test/src/HugoCalculator.cpp 2011-04-01 14:34:28 +0000
+++ b/storage/ndb/test/src/HugoCalculator.cpp 2011-04-18 11:09:11 +0000
@@ -196,8 +196,6 @@ HugoCalculator::calcValue(int record,
case NdbDictionary::Column::Unsigned:
case NdbDictionary::Column::Bigint:
case NdbDictionary::Column::Bigunsigned:
- case NdbDictionary::Column::Float:
- case NdbDictionary::Column::Double:
case NdbDictionary::Column::Olddecimal:
case NdbDictionary::Column::Olddecimalunsigned:
case NdbDictionary::Column::Decimal:
@@ -227,6 +225,22 @@ HugoCalculator::calcValue(int record,
memcpy(((Uint32*)buf)+tmp, ©, 4);
}
break;
+ case NdbDictionary::Column::Float:
+ {
+ float x = (float)myRand(&seed);
+ memcpy(buf+pos, &x, 4);
+ pos += 4;
+ len -= 4;
+ }
+ break;
+ case NdbDictionary::Column::Double:
+ {
+ double x = (double)myRand(&seed);
+ memcpy(buf+pos, &x, 8);
+ pos += 8;
+ len -= 8;
+ }
+ break;
case NdbDictionary::Column::Varbinary:
case NdbDictionary::Column::Varchar:
len = calc_len(myRand(&seed), len - 1);
=== modified file 'storage/ndb/tools/restore/Restore.cpp'
--- a/storage/ndb/tools/restore/Restore.cpp 2011-02-03 14:20:36 +0000
+++ b/storage/ndb/tools/restore/Restore.cpp 2011-04-04 09:41:30 +0000
@@ -1297,7 +1297,6 @@ BackupFile::BackupFile(void (* _free_dat
: free_data_callback(_free_data_callback)
{
memset(&m_file,0,sizeof(m_file));
- m_file.file = -1;
m_path[0] = 0;
m_fileName[0] = 0;
@@ -1311,49 +1310,41 @@ BackupFile::BackupFile(void (* _free_dat
m_is_undolog = false;
}
-BackupFile::~BackupFile(){
- if(m_file.file > 1)
- {
- azclose(&m_file);
- memset(&m_file,0,sizeof(m_file));
- }
+BackupFile::~BackupFile()
+{
+ (void)ndbzclose(&m_file);
+
if(m_buffer != 0)
free(m_buffer);
}
bool
BackupFile::openFile(){
- if(m_file.file > 1){
- azclose(&m_file);
- m_file.file = 0;
- m_file_size = 0;
- m_file_pos = 0;
- }
+ (void)ndbzclose(&m_file);
+ m_file_size = 0;
+ m_file_pos = 0;
info.setLevel(254);
info << "Opening file '" << m_fileName << "'\n";
- int r= azopen(&m_file,m_fileName, O_RDONLY);
+ int r= ndbzopen(&m_file, m_fileName, O_RDONLY);
- if(m_file.file < 0)
- r= -1;
+ if(r != 1)
+ return false;
- if (r==0)
+ size_t size;
+ if (ndbz_file_size(&m_file, &size) == 0)
{
- struct stat buf;
- if (fstat(m_file.file, &buf) == 0)
- {
- m_file_size = (Uint64)buf.st_size;
- info << "File size " << m_file_size << " bytes\n";
- }
- else
- {
- info << "Progress reporting degraded output since fstat failed,"
- << "errno: " << errno << endl;
- m_file_size = 0;
- }
+ m_file_size = (Uint64)size;
+ info << "File size " << m_file_size << " bytes\n";
+ }
+ else
+ {
+ info << "Progress reporting degraded output since fstat failed,"
+ << "errno: " << errno << endl;
+ m_file_size = 0;
}
- return r != 0;
+ return true;
}
Uint32 BackupFile::buffer_get_ptr_ahead(void **p_buf_ptr, Uint32 size, Uint32 nmemb)
@@ -1420,17 +1411,20 @@ Uint32 BackupFile::buffer_get_ptr_ahead(
* Read data into buffer before existing data.
*/
// Move to the start of data to be read
- azseek(&m_file, sizeof(m_fileHeader), SEEK_SET);
- r = azread(&m_file, (char *)buffer_data_start - file_left_entry_data, Uint32(file_left_entry_data), &error);
+ ndbzseek(&m_file, sizeof(m_fileHeader), SEEK_SET);
+ r = ndbzread(&m_file,
+ (char *)buffer_data_start - file_left_entry_data,
+ Uint32(file_left_entry_data),
+ &error);
//move back
- azseek(&m_file, sizeof(m_fileHeader), SEEK_SET);
+ ndbzseek(&m_file, sizeof(m_fileHeader), SEEK_SET);
}
else
{
// Fill remaing space at start of buffer with data from file.
- azseek(&m_file, m_file_pos-buffer_free_space, SEEK_SET);
- r = azread(&m_file, ((char *)m_buffer), buffer_free_space, &error);
- azseek(&m_file, m_file_pos-buffer_free_space, SEEK_SET);
+ ndbzseek(&m_file, m_file_pos-buffer_free_space, SEEK_SET);
+ r = ndbzread(&m_file, ((char *)m_buffer), buffer_free_space, &error);
+ ndbzseek(&m_file, m_file_pos-buffer_free_space, SEEK_SET);
}
}
m_file_pos -= r;
@@ -1442,9 +1436,9 @@ Uint32 BackupFile::buffer_get_ptr_ahead(
{
memmove(m_buffer, m_buffer_ptr, m_buffer_data_left);
int error;
- Uint32 r = azread(&m_file,
- ((char *)m_buffer) + m_buffer_data_left,
- m_buffer_sz - m_buffer_data_left, &error);
+ Uint32 r = ndbzread(&m_file,
+ ((char *)m_buffer) + m_buffer_data_left,
+ m_buffer_sz - m_buffer_data_left, &error);
m_file_pos += r;
m_buffer_data_left += r;
m_buffer_ptr = m_buffer;
@@ -1631,10 +1625,10 @@ BackupFile::readHeader(){
because footer contain 4 bytes 0 at the end of file.
we discard the remain data stored in m_buffer.
*/
- struct stat buf;
- if (fstat(m_file.file, &buf) == 0)
- m_file_size = (Uint64)buf.st_size;
- azseek(&m_file, 4, SEEK_END);
+ size_t size;
+ if (ndbz_file_size(&m_file, &size) == 0)
+ m_file_size = (Uint64)size;
+ ndbzseek(&m_file, 4, SEEK_END);
m_file_pos = m_file_size - 4;
m_buffer_data_left = 0;
m_buffer_ptr = m_buffer;
=== modified file 'storage/ndb/tools/restore/Restore.hpp'
--- a/storage/ndb/tools/restore/Restore.hpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/tools/restore/Restore.hpp 2011-04-01 12:30:27 +0000
@@ -24,7 +24,7 @@
#include <NdbOut.hpp>
#include "../src/kernel/blocks/backup/BackupFormat.hpp"
#include <NdbApi.hpp>
-#include <util/azlib.h>
+#include <util/ndbzio.h>
#include <util/UtilBuffer.hpp>
#include <ndb_version.h>
@@ -311,7 +311,7 @@ class RestoreLogIterator;
class BackupFile {
protected:
- azio_stream m_file;
+ ndbzio_stream m_file;
char m_path[PATH_MAX];
char m_fileName[PATH_MAX];
bool m_hostByteOrder;
No bundle (reason: revision is a merge).| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch(ole.john.aske:3483) | Ole John Aske | 27 Apr |