#At file:///home/jonas/src/telco-7.1/ based on revid:craig.russell@stripped
4194 jonas oreland 2011-05-13 [merge]
ndb - merge 70 to 71
modified:
CMakeLists.txt
mysql-test/suite/ndb/r/ndb_add_partition.result
mysql-test/suite/ndb/r/ndb_alter_table_online2.result
mysql-test/suite/ndb/t/ndb_add_partition.test
mysql-test/suite/ndb/t/ndb_alter_table_online2.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_gap_event.test
storage/ndb/src/common/portlib/NdbTCP.cpp
storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt 2011-03-22 13:16:46 +0000
+++ b/CMakeLists.txt 2011-05-12 14:13:43 +0000
@@ -326,3 +326,20 @@ IF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(libmysqld/examples)
ENDIF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
+
+# Dump cmake's output and error log to help diagnosing
+# platform checks
+MACRO(DUMP_FILE filename)
+ IF(EXISTS ${filename})
+ FILE(READ ${filename} content)
+ MESSAGE(STATUS "=vvvv= Dumping ${filename} ")
+ MESSAGE(STATUS "${content}")
+ MESSAGE(STATUS "=^^^^=")
+ ELSE()
+ MESSAGE(STATUS "'${filename}' does not exist")
+ ENDIF()
+ENDMACRO()
+
+DUMP_FILE("${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log")
+DUMP_FILE("${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log")
+
=== modified file 'mysql-test/suite/ndb/r/ndb_add_partition.result'
--- a/mysql-test/suite/ndb/r/ndb_add_partition.result 2009-05-09 15:49:27 +0000
+++ b/mysql-test/suite/ndb/r/ndb_add_partition.result 2011-05-12 11:31:21 +0000
@@ -144,8 +144,20 @@ a b c
50 50 50
alter online table t1 reorganize partition;
alter online table t2 reorganize partition;
+partitions added to t1
+t1_added
+0
+partitions added to t2
+t2_added
+0
alter online table t1 add partition partitions 1;
alter online table t2 add partition partitions 4;
+partitions added to t1
+t1_added
+1
+partitions added to t2
+t2_added
+4
alter online table t1 reorganize partition;
ERROR HY000: REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs
select count(*) from t1;
@@ -246,6 +258,12 @@ a b c
50 50 50
alter online table t1 add partition partitions 2;
alter online table t2 add partition partitions 1;
+partitions added to t1
+t1_added
+3
+partitions added to t2
+t2_added
+5
select count(*) from t1;
count(*)
100
=== modified file 'mysql-test/suite/ndb/r/ndb_alter_table_online2.result'
--- a/mysql-test/suite/ndb/r/ndb_alter_table_online2.result 2009-10-09 15:48:57 +0000
+++ b/mysql-test/suite/ndb/r/ndb_alter_table_online2.result 2011-05-13 11:42:59 +0000
@@ -75,6 +75,9 @@ name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update t1 set c= 0;
+select * from t1;
+pk a b c
+1 5000 5000 5000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Alter table t1 and try to add partitions
=== modified file 'mysql-test/suite/ndb/t/ndb_add_partition.test'
--- a/mysql-test/suite/ndb/t/ndb_add_partition.test 2009-02-12 15:21:46 +0000
+++ b/mysql-test/suite/ndb/t/ndb_add_partition.test 2011-05-12 11:31:21 +0000
@@ -33,6 +33,10 @@ STORAGE DISK
TABLESPACE ts1
partition by key(a);
+let $t1_part_count_start = query_get_value(select count(*) as Value from information_schema.partitions where table_schema = 'test' and table_name = 't1', Value, 1);
+
+let $t2_part_count_start = query_get_value(select count(*) as Value from information_schema.partitions where table_schema = 'test' and table_name = 't2', Value, 1);
+
INSERT INTO t1 VALUES
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
@@ -91,9 +95,31 @@ select * from t2 where b = 50;
alter online table t1 reorganize partition;
alter online table t2 reorganize partition;
+let $t1_part_count_now = query_get_value(select count(*) as Value from information_schema.partitions where table_schema = 'test' and table_name = 't1', Value, 1);
+
+let $t2_part_count_now = query_get_value(select count(*) as Value from information_schema.partitions where table_schema = 'test' and table_name = 't2', Value, 1);
+
+--disable_query_log
+--echo partitions added to t1
+eval select $t1_part_count_now - $t1_part_count_start as t1_added;
+--echo partitions added to t2
+eval select $t2_part_count_now - $t2_part_count_start as t2_added;
+--enable_query_log
+
alter online table t1 add partition partitions 1;
alter online table t2 add partition partitions 4;
+let $t1_part_count_now = query_get_value(select count(*) as Value from information_schema.partitions where table_schema = 'test' and table_name = 't1', Value, 1);
+
+let $t2_part_count_now = query_get_value(select count(*) as Value from information_schema.partitions where table_schema = 'test' and table_name = 't2', Value, 1);
+
+--disable_query_log
+--echo partitions added to t1
+eval select $t1_part_count_now - $t1_part_count_start as t1_added;
+--echo partitions added to t2
+eval select $t2_part_count_now - $t2_part_count_start as t2_added;
+--enable_query_log
+
# reorganize partition not support if not default partitioning
# and after a add partition it's no longer default
--error ER_REORG_NO_PARAM_ERROR
@@ -134,6 +160,17 @@ select * from t2 where b = 50;
alter online table t1 add partition partitions 2;
alter online table t2 add partition partitions 1;
+let $t1_part_count_now = query_get_value(select count(*) as Value from information_schema.partitions where table_schema = 'test' and table_name = 't1', Value, 1);
+
+let $t2_part_count_now = query_get_value(select count(*) as Value from information_schema.partitions where table_schema = 'test' and table_name = 't2', Value, 1);
+
+--disable_query_log
+--echo partitions added to t1
+eval select $t1_part_count_now - $t1_part_count_start as t1_added;
+--echo partitions added to t2
+eval select $t2_part_count_now - $t2_part_count_start as t2_added;
+--enable_query_log
+
select count(*) from t1;
select count(*) from t2;
--sorted_result
=== modified file 'mysql-test/suite/ndb/t/ndb_alter_table_online2.test'
--- a/mysql-test/suite/ndb/t/ndb_alter_table_online2.test 2009-10-09 15:48:57 +0000
+++ b/mysql-test/suite/ndb/t/ndb_alter_table_online2.test 2011-05-13 11:42:59 +0000
@@ -52,7 +52,7 @@ set @t1_id = (select id from ndb_show_ta
--echo
let $end_mysqlslap= 5000;
---exec $MYSQL_SLAP --silent --query="update test.t1 set a=a+1 where pk=1" -i $end_mysqlslap >> $NDB_TOOLS_OUTPUT &
+--exec $MYSQL_SLAP --query="update test.t1 set a=a+1 where pk=1" -i $end_mysqlslap >> $NDB_TOOLS_OUTPUT &
# wait for 100 updates
--disable_result_log
@@ -93,7 +93,7 @@ select name from ndb_show_tables_results
--echo
update t1 set b= 0;
---exec $MYSQL_SLAP --silent --query="update test.t1 set b=b+1 where pk=1" -i $end_mysqlslap >> $NDB_TOOLS_OUTPUT &
+--exec $MYSQL_SLAP --query="update test.t1 set b=b+1 where pk=1" -i $end_mysqlslap >> $NDB_TOOLS_OUTPUT &
# wait for 100 updates
--disable_result_log
@@ -134,22 +134,32 @@ select name from ndb_show_tables_results
--echo
update t1 set c= 0;
---exec $MYSQL_SLAP --silent --query="update test.t1 set c=c+1 where pk=1" -i $end_mysqlslap >> $NDB_TOOLS_OUTPUT &
+--exec $MYSQL_SLAP --query="update test.t1 set c=c+1 where pk=1" -i $end_mysqlslap >> $NDB_TOOLS_OUTPUT &
# wait for mysqlslap to end
--disable_result_log
--disable_query_log
--eval select @end:=$end_mysqlslap
let $val= 1;
+# 10 minutes = 600s sleep 0.1 => 6000
+let $maxwait = 6000;
while ($val)
{
--sleep 0.1
select @val1:=a,@val2:=b,@val3:=c from t1 where pk=1;
let $val= `select @end > @val1 || @end > @val2 || @end > @val3`;
+ dec $maxwait;
+
+ if (!$maxwait)
+ {
+ let $val = 0;
+ }
}
--enable_result_log
--enable_query_log
+select * from t1;
+
--echo
--echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--echo ~ Alter table t1 and try to add partitions
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_gap_event.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_gap_event.test 2011-04-08 11:06:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_gap_event.test 2011-05-12 09:52:16 +0000
@@ -22,6 +22,13 @@ enable_query_log;
--connection slave
select count(*) from t1;
+# Add suppression for the LOST_EVENTS error message
+# which will occur on slave when master is restarted while
+# slave is running
+--disable_query_log
+call mtr.add_suppression("Slave.*: The incident LOST_EVENTS occured on the master");
+--enable_query_log
+
--connection master
--echo Restarting mysqld
=== modified file 'storage/ndb/src/common/portlib/NdbTCP.cpp'
--- a/storage/ndb/src/common/portlib/NdbTCP.cpp 2011-05-11 19:12:56 +0000
+++ b/storage/ndb/src/common/portlib/NdbTCP.cpp 2011-05-12 12:53:51 +0000
@@ -19,6 +19,13 @@
#include <ndb_global.h>
#include <NdbTCP.h>
+
+/* On some operating systems (e.g. Solaris) INADDR_NONE is not defined */
+#ifndef INADDR_NONE
+#define INADDR_NONE -1 /* Error value from inet_addr */
+#endif
+
+
extern "C"
int
Ndb_getInAddr(struct in_addr * dst, const char *address)
=== modified file 'storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp 2011-05-04 11:45:33 +0000
+++ b/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp 2011-05-13 08:38:01 +0000
@@ -1150,7 +1150,7 @@ Dbspj::batchComplete(Signal* signal, Ptr
/**
* Locate next TreeNode(s) to retrieve more rows from.
*
- * Calcule set of 'm_active_nodes' we will receive from in NEXTREQ.
+ * Calculate set of the 'm_active_nodes' we will receive from in NEXTREQ.
* Add these TreeNodes to the cursor list to be iterated.
*/
void
@@ -1168,7 +1168,7 @@ Dbspj::prepareNextBatch(Signal* signal,
if (requestPtr.p->m_bits & Request::RT_REPEAT_SCAN_RESULT)
{
/**
- * If REPEAT_SCAN_RESULT we handle byshy scans by return more *new* rows
+ * If REPEAT_SCAN_RESULT we handle bushy scans by return more *new* rows
* from only one of the active child scans. If there are multiple
* bushy scans not being able to return their current result set in
* a single batch, result sets from the other child scans are repeated
@@ -1239,7 +1239,7 @@ Dbspj::prepareNextBatch(Signal* signal,
{
/**
* If not REPEAT_SCAN_RESULT multiple active TreeNodes may return their
- * remaining result simultaneously. In case of byshy-scans, these
+ * remaining result simultaneously. In case of bushy-scans, these
* concurrent result streams are cross joins of each other
* in SQL terms. In order to produce the cross joined result, it is
* the responsibility of the API-client to buffer these streams and
@@ -1415,7 +1415,13 @@ Dbspj::releaseScanBuffers(Ptr<Request> r
releaseNodeRows(requestPtr, treeNodePtr);
}
- if (treeNodePtr.p->m_state == TreeNode::TN_ACTIVE)
+ /**
+ * Cleanup ACTIVE nodes fetching more rows in a NEXTREQ,
+ * or nodes being in 'm_active_nodes' as they will 'repeat'.
+ * (and then become active)
+ */
+ if (treeNodePtr.p->m_state == TreeNode::TN_ACTIVE ||
+ requestPtr.p->m_active_nodes.get(treeNodePtr.p->m_node_no))
{
jam();
cleanupChildBranch(requestPtr, treeNodePtr);
@@ -1423,9 +1429,11 @@ Dbspj::releaseScanBuffers(Ptr<Request> r
}
/**
- * Build Bitmask of all nodes having TN_ACTIVE childs
+ * Collect ancestors of all nodes which are, or will
+ * become active in NEXTREQ (possibly repeated)
*/
- if (treeNodePtr.p->m_state == TreeNode::TN_ACTIVE)
+ if (treeNodePtr.p->m_state == TreeNode::TN_ACTIVE ||
+ requestPtr.p->m_active_nodes.get(treeNodePtr.p->m_node_no))
{
ancestors_of_active.bitOR(treeNodePtr.p->m_ancestors);
}
No bundle (reason: revision is a merge).
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.1 branch (jonas:4194) | jonas oreland | 13 May |