From: Date: August 20 2008 8:58pm Subject: bzr push into mysql-6.0 branch (mattiasj:2790 to 2792) Bug#34604 List-Archive: http://lists.mysql.com/commits/52085 X-Bug: 34604 Message-Id: <20080820185854.69050F8685B@witty.localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 2792 Mattias Jonsson 2008-08-20 pre push fix of test case for bug#34604 (needed change in 6.0 from 5.1) modified: mysql-test/suite/parts/r/partition_special_innodb.result mysql-test/suite/parts/t/partition_special_innodb.test 2791 Mattias Jonsson 2008-08-20 [merge] merge (manual mysql-5.1-bugteam + bug#34604 + post push fix for bug#20129 -> mysql-6.0-bugteam) added: mysql-test/suite/parts/t/partition_special_innodb-master.opt modified: mysql-test/Makefile.am mysql-test/r/metadata.result mysql-test/r/sp.result mysql-test/suite/parts/r/partition_special_innodb.result mysql-test/suite/parts/t/partition_special_innodb.test mysql-test/t/sp.test sql/item.cc tests/mysql_client_test.c 2790 Ramil Kalimullin 2008-08-20 Merge error in federated.result fixed. modified: mysql-test/r/federated.result === modified file 'mysql-test/Makefile.am' --- a/mysql-test/Makefile.am 2008-06-30 08:43:39 +0000 +++ b/mysql-test/Makefile.am 2008-08-20 18:05:57 +0000 @@ -83,6 +83,7 @@ dist-hook: $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_d2_be/BACKUP* $(distdir)/std_data/ndb_backup51_d2_be $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_d2_le/BACKUP* $(distdir)/std_data/ndb_backup51_d2_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/*.txt $(distdir)/std_data/funcs_1 $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib $(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(distdir)/lib/My @@ -144,6 +145,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_d2_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_d2_be $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_d2_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_d2_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/*.txt $(DESTDIR)$(testdir)/std_data/funcs_1 $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib $(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(DESTDIR)$(testdir)/lib/My === modified file 'mysql-test/r/metadata.result' --- a/mysql-test/r/metadata.result 2007-11-13 13:24:48 +0000 +++ b/mysql-test/r/metadata.result 2008-08-20 11:42:01 +0000 @@ -108,11 +108,11 @@ id 1 select * from v1 group by id limit 0; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 v1 id id 3 10 0 Y 32768 0 63 +def test v1 v1 id id 3 10 0 Y 32768 0 63 id select * from v1 where id=1000 group by id; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 v1 id id 3 10 0 Y 32768 0 63 +def test v1 v1 id id 3 10 0 Y 32768 0 63 id select * from v1 where id=1 group by id; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -126,7 +126,7 @@ renamed 1 select * from v3 where renamed=1 group by renamed; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def v3 renamed 8 12 0 Y 32896 0 63 +def v3 v3 renamed renamed 8 12 0 Y 32896 0 63 renamed drop table t1; drop view v1,v2,v3; @@ -156,8 +156,8 @@ c1 3 SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 v1 c1 c1 254 1 1 Y 0 0 8 -def test t2 v2 c2 c2 254 1 1 Y 0 0 8 +def test v1 v1 c1 c1 254 1 1 Y 0 0 8 +def test v2 v2 c2 c2 254 1 1 Y 0 0 8 c1 c2 1 1 2 2 === modified file 'mysql-test/r/sp.result' --- a/mysql-test/r/sp.result 2008-06-26 18:56:36 +0000 +++ b/mysql-test/r/sp.result 2008-08-20 18:05:57 +0000 @@ -6802,6 +6802,22 @@ ttt 2 drop function func30787; drop table t1; +create table t1(c1 INT); +create function f1(p1 int) returns varchar(32) +return 'aaa'; +create view v1 as select f1(c1) as parent_control_name from t1; +create procedure p1() +begin +select parent_control_name as c1 from v1; +end // +call p1(); +c1 +call p1(); +c1 +drop procedure p1; +drop function f1; +drop view v1; +drop table t1; # ------------------------------------------------------------------ # -- End of 5.0 tests # ------------------------------------------------------------------ === modified file 'mysql-test/suite/parts/r/partition_special_innodb.result' --- a/mysql-test/suite/parts/r/partition_special_innodb.result 2008-02-06 14:13:56 +0000 +++ b/mysql-test/suite/parts/r/partition_special_innodb.result 2008-08-20 18:34:53 +0000 @@ -180,3 +180,19 @@ a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 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; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +INSERT INTO t1 VALUES (NULL, 'second row t2'); +DROP TABLE t1; === added file 'mysql-test/suite/parts/t/partition_special_innodb-master.opt' --- a/mysql-test/suite/parts/t/partition_special_innodb-master.opt 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/parts/t/partition_special_innodb-master.opt 2008-08-20 15:29:14 +0000 @@ -0,0 +1 @@ +--innodb_lock_wait_timeout=2 === modified file 'mysql-test/suite/parts/t/partition_special_innodb.test' --- a/mysql-test/suite/parts/t/partition_special_innodb.test 2007-11-20 15:04:07 +0000 +++ b/mysql-test/suite/parts/t/partition_special_innodb.test 2008-08-20 18:34:53 +0000 @@ -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,36 @@ 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; +--error ER_LOCK_WAIT_TIMEOUT +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; === modified file 'mysql-test/t/sp.test' --- a/mysql-test/t/sp.test 2008-06-26 18:56:36 +0000 +++ b/mysql-test/t/sp.test 2008-08-20 18:05:57 +0000 @@ -7996,6 +7996,30 @@ drop table t1; ########################################################################### +# +# Bug#38291 memory corruption and server crash with view/sp/function +# + +create table t1(c1 INT); +create function f1(p1 int) returns varchar(32) + return 'aaa'; +create view v1 as select f1(c1) as parent_control_name from t1; + +delimiter //; +create procedure p1() +begin + select parent_control_name as c1 from v1; +end // +delimiter ;// + +call p1(); +call p1(); + +drop procedure p1; +drop function f1; +drop view v1; +drop table t1; + --echo # ------------------------------------------------------------------ --echo # -- End of 5.0 tests --echo # ------------------------------------------------------------------ === modified file 'sql/item.cc' --- a/sql/item.cc 2008-08-07 03:05:33 +0000 +++ b/sql/item.cc 2008-08-20 18:05:57 +0000 @@ -5946,6 +5946,10 @@ void Item_ref::make_field(Send_field *fi field->table_name= table_name; if (db_name) field->db_name= db_name; + if (orig_field_name) + field->org_col_name= orig_field_name; + if (orig_table_name) + field->org_table_name= orig_table_name; } === modified file 'tests/mysql_client_test.c' --- a/tests/mysql_client_test.c 2008-08-20 10:29:58 +0000 +++ b/tests/mysql_client_test.c 2008-08-20 18:05:57 +0000 @@ -16261,7 +16261,7 @@ static void test_bug32265() metadata= mysql_stmt_result_metadata(stmt); field= mysql_fetch_field(metadata); DIE_UNLESS(strcmp(field->table, "v1") == 0); - DIE_UNLESS(strcmp(field->org_table, "t1") == 0); + DIE_UNLESS(strcmp(field->org_table, "v1") == 0); DIE_UNLESS(strcmp(field->db, "client_test_db") == 0); mysql_free_result(metadata); mysql_stmt_close(stmt); @@ -16273,7 +16273,7 @@ static void test_bug32265() metadata= mysql_stmt_result_metadata(stmt); field= mysql_fetch_field(metadata); DIE_UNLESS(strcmp(field->table, "v1") == 0); - DIE_UNLESS(strcmp(field->org_table, "t1") == 0); + DIE_UNLESS(strcmp(field->org_table, "v1") == 0); DIE_UNLESS(strcmp(field->db, "client_test_db") == 0); mysql_free_result(metadata); mysql_stmt_close(stmt);