diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index e7cdf2c3469..4d321f53ffa 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -77,6 +77,7 @@ dist-hook: $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(distdir)/std_data/ndb_backup51_data_be $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(distdir)/std_data/ndb_backup51_data_le $(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(distdir)/std_data/parts + $(INSTALL_DATA) $(srcdir)/std_data/parts/*.MY* $(distdir)/std_data/parts $(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(distdir)/std_data/funcs_1 $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib $(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(distdir)/lib/My @@ -132,6 +133,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le $(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(DESTDIR)$(testdir)/std_data/parts + $(INSTALL_DATA) $(srcdir)/std_data/parts/*.MY* $(DESTDIR)$(testdir)/std_data/parts $(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(DESTDIR)$(testdir)/std_data/funcs_1 $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib $(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(DESTDIR)$(testdir)/lib/My diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result index fa1d2eb9994..35954c0f66a 100644 --- a/mysql-test/suite/parts/r/partition_special_innodb.result +++ b/mysql-test/suite/parts/r/partition_special_innodb.result @@ -180,3 +180,18 @@ a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 c2 d2 e2 f2 g2 h2 a3 b3 c3 d3 e3 f 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 liuugbzvdmrlti b itiortudirtfgtibm dfi 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 tbhth nrzh ztfghgfh fzh ftzhj fztjh drop table t1; +# Bug#34604 - Assertion 'inited==RND' failed in handler::ha_rnd_end +CREATE TABLE t1 ( +a INT AUTO_INCREMENT, +b VARCHAR(255), +PRIMARY KEY (a)) +ENGINE = InnoDB +PARTITION BY HASH (a) +PARTITIONS 2; +SET autocommit=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (NULL, 'first row t2'); +SET autocommit=OFF; +ALTER TABLE t1 AUTO_INCREMENT = 10; +INSERT INTO t1 VALUES (NULL, 'second row t2'); +DROP TABLE t1; diff --git a/mysql-test/suite/parts/t/partition_special_innodb-master.opt b/mysql-test/suite/parts/t/partition_special_innodb-master.opt new file mode 100644 index 00000000000..e76299453d3 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_special_innodb-master.opt @@ -0,0 +1 @@ +--innodb_lock_wait_timeout=2 diff --git a/mysql-test/suite/parts/t/partition_special_innodb.test b/mysql-test/suite/parts/t/partition_special_innodb.test index 598dfea1e27..b9fc8bdcd56 100644 --- a/mysql-test/suite/parts/t/partition_special_innodb.test +++ b/mysql-test/suite/parts/t/partition_special_innodb.test @@ -1,5 +1,5 @@ ################################################################################ -# t/partition_special_innodb.test # +# t/partition_special_innodb.test # # # # Purpose: # # different Tests # @@ -8,9 +8,9 @@ #------------------------------------------------------------------------------# # Original Author: HH # # Original Date: 2006-08-01 # -# Change Author: # -# Change Date: # -# Change: # +# Change Author: MattiasJ # +# Change Date: 2008-08-20 # +# Change: added test for bug#34604 # ################################################################################ # @@ -44,3 +44,35 @@ let $engine= 'InnoDB'; --source suite/parts/inc/partition_key_8col.inc --source suite/parts/inc/partition_key_16col.inc --source suite/parts/inc/partition_key_32col.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +--echo # Bug#34604 - Assertion 'inited==RND' failed in handler::ha_rnd_end + +CREATE TABLE t1 ( + a INT AUTO_INCREMENT, + b VARCHAR(255), + PRIMARY KEY (a)) +ENGINE = InnoDB +PARTITION BY HASH (a) +PARTITIONS 2; + +connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (con2,127.0.0.1,root,,test,$MASTER_MYPORT,); + +--connection con1 +SET autocommit=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (NULL, 'first row t2'); + +--connection con2 +SET autocommit=OFF; +ALTER TABLE t1 AUTO_INCREMENT = 10; + +--connection con1 +INSERT INTO t1 VALUES (NULL, 'second row t2'); +--disconnect con2 +--disconnect con1 +--connection default +DROP TABLE t1; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index d2497081893..34cd160e7e4 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3389,6 +3389,8 @@ int ha_partition::rnd_next(uchar *buf) result= HA_ERR_END_OF_FILE; break; } + m_last_part= part_id; + m_part_spec.start_part= part_id; file= m_file[part_id]; DBUG_PRINT("info", ("rnd_init on partition %d", part_id)); if ((result= file->ha_rnd_init(1)))