MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Guangbao Ni Date:August 12 2008 3:36pm
Subject:bzr commit into mysql-5.1 branch (gni:2707) Bug#35599
View as plain text  
#At file:///home/ngb/mysql/bzr/telco6.4-bug35599/

 2707 Guangbao Ni	2008-08-12 [merge]
      BUG#35599 Mysqld crash after delete records from table (with constraint violation)
modified:
  mysql-test/suite/ndb/r/ndb_alter_table3.result
  mysql-test/suite/ndb/t/ndb_alter_table3.test
  sql/ha_ndbcluster.cc

per-file messages:
  mysql-test/suite/ndb/r/ndb_alter_table3.result
    constraint violation test result
  mysql-test/suite/ndb/t/ndb_alter_table3.test
    constraint violation test
  sql/ha_ndbcluster.cc
    share shouldn't be freed in alter_frm(),
    it should be freed and have freed at the end of alter_table_phase2() function.
=== modified file 'mysql-test/suite/ndb/r/ndb_alter_table3.result'
--- a/mysql-test/suite/ndb/r/ndb_alter_table3.result	2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/ndb/r/ndb_alter_table3.result	2008-08-12 15:35:47 +0000
@@ -33,3 +33,14 @@ a
 drop table t4;
 show tables;
 Tables_in_test
+drop table if exists 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;
+drop table t6;

=== modified file 'mysql-test/suite/ndb/t/ndb_alter_table3.test'
--- a/mysql-test/suite/ndb/t/ndb_alter_table3.test	2007-11-29 10:29:35 +0000
+++ b/mysql-test/suite/ndb/t/ndb_alter_table3.test	2008-08-12 15:35:47 +0000
@@ -45,3 +45,20 @@ select * from t4;
 drop table t4;
 show tables;
 connection server1;
+
+--disable_warnings
+drop table if exists t6;
+--enable_warnings
+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;
+--disable_result_log
+insert into t6 values(1,12), (2,12);
+--enable_result_log
+--error 1169
+alter table t6 add unique key ui_t(b);
+delete from t6;
+drop table t6;
+

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2008-08-07 13:17:36 +0000
+++ b/sql/ha_ndbcluster.cc	2008-08-12 15:35:47 +0000
@@ -11930,7 +11930,6 @@ 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
 
   DBUG_RETURN(error);
 }
@@ -11992,8 +11991,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
bzr commit into mysql-5.1 branch (gni:2707) Bug#35599Guangbao Ni12 Aug