#At file:///home/frazer/bzr/mysql-5.1-telco-7.1/ based on revid:jonas@stripped
4248 Frazer Clement 2011-06-20 [merge]
Merge 7.0->7.1
added:
mysql-test/suite/ndb/r/ndb_alter_table_online_multi.result
mysql-test/suite/ndb/t/ndb_alter_table_online_multi.test
modified:
mysql-test/suite/ndb/r/ndb_alter_table_online.result
mysql-test/suite/ndb/r/ndb_index_ordered.result
mysql-test/suite/ndb/r/ndb_multi.result
mysql-test/suite/ndb/t/ndb_alter_table_online.test
mysql-test/suite/ndb/t/ndb_index_ordered.test
mysql-test/suite/ndb/t/ndb_multi.test
sql/ha_ndbcluster.cc
=== modified file 'mysql-test/suite/ndb/r/ndb_alter_table_online.result'
--- a/mysql-test/suite/ndb/r/ndb_alter_table_online.result 2011-04-11 13:36:12 +0000
+++ b/mysql-test/suite/ndb/r/ndb_alter_table_online.result 2011-06-17 10:15:34 +0000
@@ -142,67 +142,6 @@ select name from ndb_show_tables_results
name
DROP TABLE t1;
*******************************
-* basic concurent online alter test
-*******************************
-* With Commit
-*******************************
-CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
-begin;
-update t1 set b = 0 where a = 1;
-update t1 set b = 1 where a = 2;
-delete from t1 where a = 3;
-insert into t1 values (5,5),(6,6);
-update t1 set b = 0 where a = 6;
-ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
-Warnings:
-Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
-Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
-Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
-update t1 set b = 0 where a = 2;
-update t1 set b = 0 where a = 4;
-update t1 set b = 0 where a = 5;
-insert into t1 values (7,0,null,null,null),(8,0,'8','8','8');
-commit;
-SELECT * FROM t1 ORDER BY a;
-a b c d e
-1 0 NULL NULL NULL
-2 0 NULL NULL NULL
-4 0 NULL NULL NULL
-5 0 NULL NULL NULL
-6 0 NULL NULL NULL
-7 0 NULL NULL NULL
-8 0 8 8 8
-DROP TABLE t1;
-*******************************
-* basic concurent online alter test
-*******************************
-* With Rollback
-*******************************
-CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
-begin;
-update t1 set b = 0 where a = 1;
-update t1 set b = 1 where a = 2;
-delete from t1 where a = 3;
-insert into t1 values (5,5),(6,6);
-update t1 set b = 0 where a = 6;
-ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
-Warnings:
-Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
-Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
-Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
-update t1 set b = 0 where a = 2;
-update t1 set b = 0 where a = 4;
-update t1 set b = 0 where a = 5;
-insert into t1 values (7,0,null,null,null),(8,0,'8','8','8');
-rollback;
-SELECT * FROM t1 ORDER BY a;
-a b c d e
-1 1 NULL NULL NULL
-2 2 NULL NULL NULL
-3 3 NULL NULL NULL
-4 4 NULL NULL NULL
-DROP TABLE t1;
-*******************************
* The following ALTER operations are not supported on-line
*******************************
* Not supported Test#1
=== added file 'mysql-test/suite/ndb/r/ndb_alter_table_online_multi.result'
--- a/mysql-test/suite/ndb/r/ndb_alter_table_online_multi.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_alter_table_online_multi.result 2011-06-17 10:15:34 +0000
@@ -0,0 +1,61 @@
+*******************************
+* basic concurent online alter test
+*******************************
+* With Commit
+*******************************
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
+begin;
+update t1 set b = 0 where a = 1;
+update t1 set b = 1 where a = 2;
+delete from t1 where a = 3;
+insert into t1 values (5,5),(6,6);
+update t1 set b = 0 where a = 6;
+ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
+Warnings:
+Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+update t1 set b = 0 where a = 2;
+update t1 set b = 0 where a = 4;
+update t1 set b = 0 where a = 5;
+insert into t1 values (7,0,null,null,null),(8,0,'8','8','8');
+commit;
+SELECT * FROM t1 ORDER BY a;
+a b c d e
+1 0 NULL NULL NULL
+2 0 NULL NULL NULL
+4 0 NULL NULL NULL
+5 0 NULL NULL NULL
+6 0 NULL NULL NULL
+7 0 NULL NULL NULL
+8 0 8 8 8
+DROP TABLE t1;
+*******************************
+* basic concurent online alter test
+*******************************
+* With Rollback
+*******************************
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
+begin;
+update t1 set b = 0 where a = 1;
+update t1 set b = 1 where a = 2;
+delete from t1 where a = 3;
+insert into t1 values (5,5),(6,6);
+update t1 set b = 0 where a = 6;
+ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
+Warnings:
+Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
+update t1 set b = 0 where a = 2;
+update t1 set b = 0 where a = 4;
+update t1 set b = 0 where a = 5;
+insert into t1 values (7,0,null,null,null),(8,0,'8','8','8');
+rollback;
+SELECT * FROM t1 ORDER BY a;
+a b c d e
+1 1 NULL NULL NULL
+2 2 NULL NULL NULL
+3 3 NULL NULL NULL
+4 4 NULL NULL NULL
+DROP TABLE t1;
=== modified file 'mysql-test/suite/ndb/r/ndb_index_ordered.result'
--- a/mysql-test/suite/ndb/r/ndb_index_ordered.result 2011-06-15 10:37:56 +0000
+++ b/mysql-test/suite/ndb/r/ndb_index_ordered.result 2011-06-17 10:15:04 +0000
@@ -637,21 +637,6 @@ select count(*)- 4 from t1 use index (v)
count(*)- 4
0
drop table t1;
-create table t1(a int primary key, b int not null, index(b));
-insert into t1 values (1,1), (2,2);
-set autocommit=0;
-begin;
-select count(*) from t1;
-count(*)
-2
-ALTER TABLE t1 ADD COLUMN c int;
-select a from t1 where b = 2;
-a
-2
-show tables;
-Tables_in_test
-t1
-drop table t1;
create table t1 (a int, c varchar(10),
primary key using hash (a), index(c)) engine=ndb;
insert into t1 (a, c) values (1,'aaa'),(3,'bbb');
=== modified file 'mysql-test/suite/ndb/r/ndb_multi.result'
--- a/mysql-test/suite/ndb/r/ndb_multi.result 2011-03-22 08:32:32 +0000
+++ b/mysql-test/suite/ndb/r/ndb_multi.result 2011-06-17 10:15:04 +0000
@@ -196,3 +196,19 @@ insert into t1 values(37);
alter table t1 engine ndb;
truncate t1;
drop table t1;
+create table t1(a int primary key, b int not null, index(b)) engine = ndb;
+insert into t1 values (1,1), (2,2);
+set autocommit=0;
+begin;
+select count(*) from t1;
+count(*)
+2
+ALTER OFFLINE TABLE t1 ADD COLUMN c int;
+select a from t1 where b = 2;
+a
+2
+commit;
+show tables;
+Tables_in_test
+t1
+drop table t1;
=== modified file 'mysql-test/suite/ndb/t/ndb_alter_table_online.test'
--- a/mysql-test/suite/ndb/t/ndb_alter_table_online.test 2011-04-11 13:36:12 +0000
+++ b/mysql-test/suite/ndb/t/ndb_alter_table_online.test 2011-06-17 10:15:34 +0000
@@ -139,91 +139,6 @@ select name from ndb_show_tables_results
DROP TABLE t1;
--echo *******************************
---echo * basic concurent online alter test
---echo *******************************
---echo * With Commit
---echo *******************************
-
-connection server1;
-
-CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
-let $v=4;
-disable_query_log;
-while ($v)
-{
- --eval INSERT INTO t1 VALUES($v,$v);
- dec $v;
-}
-enable_query_log;
-
-
-connection server2;
-begin;
-update t1 set b = 0 where a = 1;
-update t1 set b = 1 where a = 2;
-delete from t1 where a = 3;
-
-insert into t1 values (5,5),(6,6);
-update t1 set b = 0 where a = 6;
-
-connection server1;
-ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
-
-connection server2;
-update t1 set b = 0 where a = 2;
-update t1 set b = 0 where a = 4;
-update t1 set b = 0 where a = 5;
-insert into t1 values (7,0,null,null,null),(8,0,'8','8','8');
-commit;
-
-connection server1;
-SELECT * FROM t1 ORDER BY a;
-
-DROP TABLE t1;
-
---echo *******************************
---echo * basic concurent online alter test
---echo *******************************
---echo * With Rollback
---echo *******************************
-
-connection server1;
-
-CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
-let $v=4;
-disable_query_log;
-while ($v)
-{
- --eval INSERT INTO t1 VALUES($v,$v);
- dec $v;
-}
-enable_query_log;
-
-connection server2;
-begin;
-update t1 set b = 0 where a = 1;
-update t1 set b = 1 where a = 2;
-delete from t1 where a = 3;
-
-insert into t1 values (5,5),(6,6);
-update t1 set b = 0 where a = 6;
-
-connection server1;
-ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
-
-connection server2;
-update t1 set b = 0 where a = 2;
-update t1 set b = 0 where a = 4;
-update t1 set b = 0 where a = 5;
-insert into t1 values (7,0,null,null,null),(8,0,'8','8','8');
-rollback;
-
-connection server1;
-SELECT * FROM t1 ORDER BY a;
-
-DROP TABLE t1;
-
---echo *******************************
--echo * The following ALTER operations are not supported on-line
--echo *******************************
--echo * Not supported Test#1
=== added file 'mysql-test/suite/ndb/t/ndb_alter_table_online_multi.test'
--- a/mysql-test/suite/ndb/t/ndb_alter_table_online_multi.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_alter_table_online_multi.test 2011-06-17 10:15:34 +0000
@@ -0,0 +1,88 @@
+-- source include/not_embedded.inc
+-- source include/have_multi_ndb.inc
+
+--echo *******************************
+--echo * basic concurent online alter test
+--echo *******************************
+--echo * With Commit
+--echo *******************************
+
+connection server1;
+
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
+let $v=4;
+disable_query_log;
+while ($v)
+{
+ --eval INSERT INTO t1 VALUES($v,$v);
+ dec $v;
+}
+enable_query_log;
+
+
+connection server2;
+begin;
+update t1 set b = 0 where a = 1;
+update t1 set b = 1 where a = 2;
+delete from t1 where a = 3;
+
+insert into t1 values (5,5),(6,6);
+update t1 set b = 0 where a = 6;
+
+connection server1;
+ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
+
+connection server2;
+update t1 set b = 0 where a = 2;
+update t1 set b = 0 where a = 4;
+update t1 set b = 0 where a = 5;
+insert into t1 values (7,0,null,null,null),(8,0,'8','8','8');
+commit;
+
+connection server1;
+SELECT * FROM t1 ORDER BY a;
+
+DROP TABLE t1;
+
+--echo *******************************
+--echo * basic concurent online alter test
+--echo *******************************
+--echo * With Rollback
+--echo *******************************
+
+connection server1;
+
+CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
+let $v=4;
+disable_query_log;
+while ($v)
+{
+ --eval INSERT INTO t1 VALUES($v,$v);
+ dec $v;
+}
+enable_query_log;
+
+connection server2;
+begin;
+update t1 set b = 0 where a = 1;
+update t1 set b = 1 where a = 2;
+delete from t1 where a = 3;
+
+insert into t1 values (5,5),(6,6);
+update t1 set b = 0 where a = 6;
+
+connection server1;
+ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
+
+connection server2;
+update t1 set b = 0 where a = 2;
+update t1 set b = 0 where a = 4;
+update t1 set b = 0 where a = 5;
+insert into t1 values (7,0,null,null,null),(8,0,'8','8','8');
+rollback;
+
+connection server1;
+SELECT * FROM t1 ORDER BY a;
+
+DROP TABLE t1;
+
=== modified file 'mysql-test/suite/ndb/t/ndb_index_ordered.test'
--- a/mysql-test/suite/ndb/t/ndb_index_ordered.test 2011-06-15 10:37:56 +0000
+++ b/mysql-test/suite/ndb/t/ndb_index_ordered.test 2011-06-17 10:15:04 +0000
@@ -332,22 +332,6 @@ select count(*)- 4 from t1 use index (v)
drop table t1;
-# bug#7798
-create table t1(a int primary key, b int not null, index(b));
-insert into t1 values (1,1), (2,2);
-connect (con1,localhost,root,,test);
-connect (con2,localhost,root,,test);
-connection con1;
-set autocommit=0;
-begin;
-select count(*) from t1;
-connection con2;
-ALTER TABLE t1 ADD COLUMN c int;
-connection con1;
-select a from t1 where b = 2;
-show tables;
-drop table t1;
-
# mysqld 5.0.13 crash, no bug#
create table t1 (a int, c varchar(10),
primary key using hash (a), index(c)) engine=ndb;
=== modified file 'mysql-test/suite/ndb/t/ndb_multi.test'
--- a/mysql-test/suite/ndb/t/ndb_multi.test 2011-03-22 08:32:32 +0000
+++ b/mysql-test/suite/ndb/t/ndb_multi.test 2011-06-17 10:15:04 +0000
@@ -246,3 +246,18 @@ truncate t1;
# Cleanup
drop table t1;
connection server1;
+
+# bug#7798
+create table t1(a int primary key, b int not null, index(b)) engine = ndb;
+insert into t1 values (1,1), (2,2);
+set autocommit=0;
+begin;
+select count(*) from t1;
+connection server2;
+ALTER OFFLINE TABLE t1 ADD COLUMN c int;
+connection server1;
+select a from t1 where b = 2;
+commit;
+show tables;
+drop table t1;
+
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2011-06-17 07:14:20 +0000
+++ b/sql/ha_ndbcluster.cc 2011-06-20 16:22:38 +0000
@@ -601,9 +601,9 @@ SHOW_VAR ndb_status_variables_dynamic[]=
};
SHOW_VAR ndb_status_conflict_variables[]= {
- {"fn_max", (char*) &g_ndb_slave_state.total_violation_count[CFT_NDB_MAX], SHOW_LONG},
- {"fn_old", (char*) &g_ndb_slave_state.total_violation_count[CFT_NDB_OLD], SHOW_LONG},
- {"fn_max_del_win", (char*) &g_ndb_slave_state.total_violation_count[CFT_NDB_MAX_DEL_WIN], SHOW_LONG},
+ {"fn_max", (char*) &g_ndb_slave_state.total_violation_count[CFT_NDB_MAX], SHOW_LONGLONG},
+ {"fn_old", (char*) &g_ndb_slave_state.total_violation_count[CFT_NDB_OLD], SHOW_LONGLONG},
+ {"fn_max_del_win", (char*) &g_ndb_slave_state.total_violation_count[CFT_NDB_MAX_DEL_WIN], SHOW_LONGLONG},
{NullS, NullS, SHOW_LONG}
};
@@ -11303,7 +11303,15 @@ ha_ndbcluster::records_in_range(uint inx
ha_rows rows= HA_POS_ERROR;
int err= ndb_index_stat_get_rir(inx, min_key, max_key, &rows);
if (err == 0)
+ {
+ /**
+ * optmizer thinks that all values < 2 are exact...but
+ * but we don't provide exact statistics
+ */
+ if (rows < 2)
+ rows = 2;
DBUG_RETURN(rows);
+ }
/*fall through*/
}
No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.1 branch (frazer.clement:4248) | Frazer Clement | 20 Jun |