List:Commits« Previous MessageNext Message »
From:gni Date:April 24 2008 3:30am
Subject:bk commit into 5.1 tree (gni:1.2584) BUG#35599
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of gni.  When gni does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-04-24 09:30:16+08:00, gni@stripped +3 -0
  BUG#35599 Mysqld crash after delete records from table (with constraint violation)

  mysql-test/suite/ndb/r/ndb_alter_table3.result@stripped, 2008-04-24 09:29:45+08:00,
gni@stripped +24 -0
    test result for new test case

  mysql-test/suite/ndb/t/ndb_alter_table3.test@stripped, 2008-04-24 09:29:45+08:00,
gni@stripped +21 -0
    new test case for bug#35599

  sql/ha_ndbcluster.cc@stripped, 2008-04-24 09:29:51+08:00, gni@stripped +2 -2
    share shouldn't be freed in alter_frm(), 
    It should be freed and have freed at the end of alter_table_phase2 funcrtion

diff -Nrup a/mysql-test/suite/ndb/r/ndb_alter_table3.result
b/mysql-test/suite/ndb/r/ndb_alter_table3.result
--- a/mysql-test/suite/ndb/r/ndb_alter_table3.result	2007-06-27 20:27:28 +08:00
+++ b/mysql-test/suite/ndb/r/ndb_alter_table3.result	2008-04-24 09:29:45 +08:00
@@ -33,3 +33,27 @@ a
 drop table t4;
 show tables;
 Tables_in_test
+drop table if exists t6;
+Warnings:
+Note	1051	Unknown table 't6'
+create table t6 (a int primary key ,b int) engine=ndbcluster;
+insert into t6 values(1,12), (2,12);
+alter table t6 add unique key ui_t(b);
+ERROR 23000: Can't write, because of unique constraint, to table 't6'
+delete from t6;
+insert into t6 values(1,12), (2,12);
+alter table t6 add unique key ui_t(b);
+ERROR 23000: Can't write, because of unique constraint, to table 't6'
+delete from t6;
+insert into t6 values(1,12), (2,12);
+alter table t6 add unique key ui_t(b);
+ERROR 23000: Can't write, because of unique constraint, to table 't6'
+alter table t6 add unique key ui_t(b);
+ERROR 23000: Can't write, because of unique constraint, to table 't6'
+update t6 set b = 16;
+select * from t6 order by a;
+a	b
+1	16
+2	16
+delete from t6;
+drop table t6;
diff -Nrup a/mysql-test/suite/ndb/t/ndb_alter_table3.test
b/mysql-test/suite/ndb/t/ndb_alter_table3.test
--- a/mysql-test/suite/ndb/t/ndb_alter_table3.test	2007-11-29 18:29:31 +08:00
+++ b/mysql-test/suite/ndb/t/ndb_alter_table3.test	2008-04-24 09:29:45 +08:00
@@ -45,3 +45,24 @@ select * from t4;
 drop table t4;
 show tables;
 connection server1;
+
+drop table if exists t6;
+create table t6 (a int primary key ,b int) engine=ndbcluster;
+insert into t6 values(1,12), (2,12);
+--error 1169
+alter table t6 add unique key ui_t(b);
+delete from t6;
+insert into t6 values(1,12), (2,12);
+--error 1169
+alter table t6 add unique key ui_t(b);
+delete from t6;
+
+insert into t6 values(1,12), (2,12);
+--error 1169
+alter table t6 add unique key ui_t(b);
+--error 1169
+alter table t6 add unique key ui_t(b);
+update t6 set b = 16;
+select * from t6 order by a;
+delete from t6;
+drop table t6;
diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
--- a/sql/ha_ndbcluster.cc	2008-04-11 00:54:36 +08:00
+++ b/sql/ha_ndbcluster.cc	2008-04-24 09:29:51 +08:00
@@ -11796,7 +11796,7 @@ int ha_ndbcluster::alter_frm(THD *thd, c
   /* ndb_share reference schema(?) free */
   DBUG_PRINT("NDB_SHARE", ("%s binlog schema(?) free  use_count: %u",
                            m_share->key, m_share->use_count));
-  free_share(&m_share); // Decrease ref_count
+//  free_share(&m_share); // Decrease ref_count
 
   DBUG_RETURN(error);
 }
@@ -11858,8 +11858,8 @@ err:
     /* ndb_share reference schema free */
     DBUG_PRINT("NDB_SHARE", ("%s binlog schema free  use_count: %u",
                              m_share->key, m_share->use_count));
-    free_share(&m_share); // Decrease ref_count
   }
+  free_share(&m_share); // Decrease ref_count
   delete alter_data;
   DBUG_RETURN(error);
 }
Thread
bk commit into 5.1 tree (gni:1.2584) BUG#35599gni24 Apr 2008