List:Commits« Previous MessageNext Message »
From:Tomas Ulin Date:December 5 2008 11:46am
Subject:bzr push into mysql-5.1 branch (tomas.ulin:3138 to 3139)
View as plain text  
 3139 Tomas Ulin	2008-12-05 [merge]
      merge
modified:
  mysql-test/suite/ndb/r/ndb_update.result
  mysql-test/suite/ndb/r/ndb_update_no_read.result
  mysql-test/suite/ndb/t/ndb_update.test
  mysql-test/suite/ndb/t/ndb_update_no_read.test
  sql/table.cc

 3138 Tomas Ulin	2008-12-05 [merge]
      merge
modified:
  mysql-test/mysql-test-run.pl
  storage/ndb/src/mgmsrv/ConfigManager.cpp
  storage/ndb/src/mgmsrv/ConfigManager.hpp
  storage/ndb/src/mgmsrv/MgmtSrvr.cpp
  storage/ndb/src/mgmsrv/MgmtSrvr.hpp
  storage/ndb/src/mgmsrv/main.cpp
  storage/ndb/test/run-test/setup.cpp

=== modified file 'mysql-test/suite/ndb/r/ndb_update.result'
--- a/mysql-test/suite/ndb/r/ndb_update.result	2007-12-07 10:05:19 +0000
+++ b/mysql-test/suite/ndb/r/ndb_update.result	2008-12-05 10:59:32 +0000
@@ -93,4 +93,22 @@ a	b
 DROP TABLE IF EXISTS t1;
 DROP TABLE IF EXISTS t2;
 DROP TABLE IF EXISTS t3;
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT,
+mytext CHAR(30) DEFAULT NULL,
+PRIMARY KEY (`id`) ) ENGINE=ndbcluster;
+insert into t1 values(NULL,"hello"),(NULL,"world"),(NULL,"hello"),(NULL,"world");
+select * from t1 order by id;
+id	mytext
+1	hello
+2	world
+3	hello
+4	world
+update t1 set mytext = "goodbye" where mytext = "world" order by mytext;
+select * from t1 order by id;
+id	mytext
+1	hello
+2	goodbye
+3	hello
+4	goodbye
+DROP TABLE IF EXISTS t1;
 End of 5.1 tests

=== modified file 'mysql-test/suite/ndb/r/ndb_update_no_read.result'
--- a/mysql-test/suite/ndb/r/ndb_update_no_read.result	2008-09-26 13:40:55 +0000
+++ b/mysql-test/suite/ndb/r/ndb_update_no_read.result	2008-12-05 09:46:39 +0000
@@ -39,6 +39,23 @@ select * from t1 where a = 1 order by a;
 a	b	c
 affected rows: 0
 
+# expected result 1 roundtrips
+# 0 - info call
+# 0 - read the rows
+# 0 - update the row (deferred to commit)
+# 1 - update + commit the transaction
+
+update t1 set c = 1111 where b = 2;
+affected rows: 1
+info: Rows matched: 1  Changed: 1  Warnings: 0
+@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
+1
+affected rows: 1
+select * from t1 where b = 2 order by a;
+a	b	c
+9	2	1111
+affected rows: 1
+
 # expected result 2 roundtrips
 # 0 - info call
 # 1 - read the rows

=== modified file 'mysql-test/suite/ndb/t/ndb_update.test'
--- a/mysql-test/suite/ndb/t/ndb_update.test	2007-11-29 10:29:35 +0000
+++ b/mysql-test/suite/ndb/t/ndb_update.test	2008-12-05 10:59:32 +0000
@@ -89,5 +89,18 @@ DROP TABLE IF EXISTS t2;
 DROP TABLE IF EXISTS t3;
 --enable_warnings
 
+# Bug#40081 UPDATE....ORDER BY cannot find rows in cluster
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT,
+                 mytext CHAR(30) DEFAULT NULL,
+                 PRIMARY KEY (`id`) ) ENGINE=ndbcluster;
+insert into t1 values(NULL,"hello"),(NULL,"world"),(NULL,"hello"),(NULL,"world");
+select * from t1 order by id;
+update t1 set mytext = "goodbye" where mytext = "world" order by mytext;
+select * from t1 order by id;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
 --echo End of 5.1 tests
 

=== modified file 'mysql-test/suite/ndb/t/ndb_update_no_read.test'
--- a/mysql-test/suite/ndb/t/ndb_update_no_read.test	2008-09-26 13:40:55 +0000
+++ b/mysql-test/suite/ndb/t/ndb_update_no_read.test	2008-12-05 09:46:39 +0000
@@ -54,6 +54,19 @@ delete from t1 where a = 1;
 select * from t1 where a = 1 order by a;
 
 --echo
+--echo # expected result 1 roundtrips
+--echo # 0 - info call
+--echo # 0 - read the rows
+--echo # 0 - update the row (deferred to commit)
+--echo # 1 - update + commit the transaction
+--echo
+--source include/ndb_init_execute_count.inc
+update t1 set c = 1111 where b = 2;
+--source include/ndb_execute_count.inc
+
+select * from t1 where b = 2 order by a;
+
+--echo
 --echo # expected result 2 roundtrips
 --echo # 0 - info call
 --echo # 1 - read the rows

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2008-11-27 19:51:35 +0000
+++ b/sql/ha_ndbcluster.cc	2008-12-05 09:09:17 +0000
@@ -647,6 +647,24 @@ Thd_ndb::Thd_ndb()
 
 Thd_ndb::~Thd_ndb()
 {
+  if (ndb_extra_logging > 1)
+  {
+    /*
+      print some stats about the connection at disconnect
+    */
+    for (int i= 0; i < MAX_NDB_NODES; i++)
+    {
+      if (m_transaction_hint_count[i] > 0 ||
+          m_transaction_no_hint_count[i] > 0)
+      {
+        sql_print_information("tid %u: node[%u] "
+                              "transaction_hint=%u, transaction_no_hint=%u",
+                              (unsigned)current_thd->thread_id, i,
+                              m_transaction_hint_count[i],
+                              m_transaction_no_hint_count[i]);
+      }
+    }
+  }
   if (ndb)
   {
     delete ndb;

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2008-12-02 15:07:57 +0000
+++ b/sql/table.cc	2008-12-05 11:44:00 +0000
@@ -4375,15 +4375,12 @@ void st_table::prepare_for_position()
   
   if (s->primary_key < MAX_KEY)
   {
-    if (file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX)
+    if (file->ha_table_flags() & (HA_PRIMARY_KEY_IN_READ_INDEX |
+                                  HA_PRIMARY_KEY_REQUIRED_FOR_POSITION))
     {
       mark_columns_used_by_index_no_reset(s->primary_key, read_set);
-    }
-    if ((file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) ||
-        (file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION))
-    {
       /* signal change */
-      file->column_bitmaps_signal(HA_COMPLETE_TABLE_READ_BITMAP);
+      file->column_bitmaps_signal(HA_CHANGE_TABLE_READ_BITMAP);
     }
   }
   DBUG_VOID_RETURN;

Thread
bzr push into mysql-5.1 branch (tomas.ulin:3138 to 3139) Tomas Ulin5 Dec