summaryrefslogtreecommitdiff
path: root/mysql-test/r/merge.result
diff options
context:
space:
mode:
authorAnurag Shekhar <anurag.shekhar@sun.com>2009-03-04 14:48:07 +0530
committerAnurag Shekhar <anurag.shekhar@sun.com>2009-03-04 14:48:07 +0530
commitaa13f72b9083f9a5abe80f4fddd0e2259cea8580 (patch)
treed25340ee73462531e64ce48b206680b6342c3d1c /mysql-test/r/merge.result
parent16c0631f0b785e82aef63429b5a4e7179b8aa52e (diff)
downloadmariadb-git-aa13f72b9083f9a5abe80f4fddd0e2259cea8580.tar.gz
Bug#41305 server crashes when inserting duplicate row into a merge table
This problem comes while inserting a duplicate row in merge table without key but the child table has a primary key. While forming the error message handler tries to locate the key field which is creating this problem but as there is no key on the merge table there is a segmentation fault. mysql-test/r/merge.result: Updated results with new test for this bug. mysql-test/t/merge.test: Added new test to test error generated from a key on child table where merge table doesn't have any key. storage/myisammrg/ha_myisammrg.cc: Added a new check to see if the value of error key is higher than the number of key in merge table and if it is the error key set to MAX_KEY. The error message generation routine treats MAX_KEY as unknown key and doesn't tries to access this in key_info.
Diffstat (limited to 'mysql-test/r/merge.result')
-rw-r--r--mysql-test/r/merge.result12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 3910536ee5d..d844abc1847 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -2103,4 +2103,16 @@ a
UNLOCK TABLES;
# drop the created tables
DROP TABLE t1, t2, t3;
+# insert duplicate value in child table while merge table doesn't have key
+create table t1 (
+col1 int(10),
+primary key (col1)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+CREATE TABLE m1 (
+col1 int(10) NOT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(t1);
+insert into m1 (col1) values (1);
+insert into m1 (col1) values (1);
+ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
+drop table m1, t1;
End of 5.1 tests