List:Commits« Previous MessageNext Message »
From:tomas Date:February 27 2006 5:05pm
Subject:bk commit into 5.1 tree (tomas:1.2185) BUG#17499
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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
  1.2185 06/02/27 17:04:49 tomas@stripped +2 -0
  Bug #17499  	Alter table of ndb partitioned tables causes mysqld to core

  sql/sql_table.cc
    1.311 06/02/27 17:04:41 tomas@stripped +2 -0
    Bug #17499  	Alter table of ndb partitioned tables causes mysqld to core
    - used_partitions not set during copy of data

  mysql-test/t/ndb_partition_range.test
    1.4 06/02/27 17:04:41 tomas@stripped +104 -0
    Bug #17499  	Alter table of ndb partitioned tables causes mysqld to core

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-new

--- 1.310/sql/sql_table.cc	2006-02-25 22:22:06 +01:00
+++ 1.311/sql/sql_table.cc	2006-02-27 17:04:41 +01:00
@@ -5183,6 +5183,8 @@
   */
   to->file->ha_set_all_bits_in_write_set();
   from->file->ha_retrieve_all_cols();
+  if (from->part_info)
+    bitmap_set_all(&(from->part_info->used_partitions));
   init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1,1);
   if (ignore ||
       handle_duplicates == DUP_REPLACE)

--- 1.3/mysql-test/t/ndb_partition_range.test	2006-01-10 16:42:19 +01:00
+++ 1.4/mysql-test/t/ndb_partition_range.test	2006-02-27 17:04:41 +01:00
@@ -93,3 +93,107 @@
 
 drop table t1;
 
+#
+# Bug #17499, #17687
+#  Alter partitioned NDB table causes mysqld to core
+#
+
+CREATE TABLE t1
+       (id MEDIUMINT NOT NULL,
+        b1 BIT(8),
+        vc VARCHAR(255),
+        bc CHAR(255),
+        d DECIMAL(10,4) DEFAULT 0,
+        f FLOAT DEFAULT 0,
+        total BIGINT UNSIGNED,
+        y YEAR,
+        t DATE) ENGINE=NDB
+   PARTITION BY RANGE (YEAR(t))
+       (PARTITION p0 VALUES LESS THAN (1901),
+        PARTITION p1 VALUES LESS THAN (1946),
+        PARTITION p2 VALUES LESS THAN (1966),
+        PARTITION p3 VALUES LESS THAN (1986),
+        PARTITION p4 VALUES LESS THAN (2005),
+        PARTITION p5 VALUES LESS THAN MAXVALUE);
+
+INSERT INTO t1 VALUES (0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+SELECT * FROM t1;
+ALTER TABLE t1 ENGINE=MYISAM;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE LOGFILE GROUP lg1
+  ADD UNDOFILE 'undofile.dat'
+  INITIAL_SIZE 16M
+  UNDO_BUFFER_SIZE=1M
+  ENGINE=NDB;
+
+CREATE TABLESPACE ts1
+  ADD DATAFILE 'datafile.dat'
+  USE LOGFILE GROUP lg1
+  INITIAL_SIZE 12M
+  ENGINE NDB;
+
+CREATE TABLE test.t1 (
+  a1 INT,
+  a2 TEXT NOT NULL,
+  a3 BIT NOT NULL,
+  a4 DECIMAL(8,3),
+  a5 INT NOT NULL,
+  a6 VARCHAR(255),
+  PRIMARY KEY(a1))
+  TABLESPACE ts1 STORAGE DISK ENGINE=NDB
+  PARTITION BY LIST (a1)
+ (PARTITION p0 VALUES IN (1,2,3,4,5),
+  PARTITION p1 VALUES IN (6,7,8,9, 10),
+  PARTITION p2 VALUES IN (11, 12, 13, 14, 15));
+
+let $j= 15;
+--disable_query_log
+while ($j)
+{
+eval INSERT INTO test.t1 VALUES ($j, "Tested Remotely from Texas, USA",
+b'1',$j.00,$j+1,"By NIK $j");
+dec $j;
+}
+--enable_query_log
+SELECT COUNT(*) FROM test.t1;
+
+ALTER TABLE test.t1 DROP COLUMN a4;
+SELECT COUNT(*) FROM test.t1;
+
+DROP TABLE t1;
+
+CREATE TABLE test.t1 (
+  a1 INT,
+  a2 TEXT NOT NULL,
+  a3 BIT NOT NULL,
+  a4 DECIMAL(8,3),
+  a5 INT NOT NULL,
+  a6 VARCHAR(255),
+  PRIMARY KEY(a1))
+  TABLESPACE ts1 STORAGE DISK ENGINE=NDB
+  PARTITION BY HASH(a1)
+  PARTITIONS 4;
+
+let $j= 15;
+--disable_query_log
+while ($j)
+{
+eval INSERT INTO test.t1 VALUES ($j, "Tested Remotely from Texas, USA",
+b'1',$j.00,$j+1,"By NIK $j");
+dec $j;
+}
+--enable_query_log
+SELECT COUNT(*) FROM test.t1;
+
+ALTER TABLE test.t1 DROP COLUMN a4;
+SELECT COUNT(*) FROM test.t1;
+
+DROP TABLE t1;
+
+ALTER TABLESPACE ts1 
+  DROP DATAFILE 'datafile.dat' 
+  ENGINE=NDB;
+DROP TABLESPACE ts1 ENGINE=NDB;
+DROP LOGFILE GROUP lg1 ENGINE=NDB;
Thread
bk commit into 5.1 tree (tomas:1.2185) BUG#17499tomas27 Feb