mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
BUG#26881 - Large MERGE tables report incorrect specification when no
differences in tables Certain merge tables were wrongly reported as having incorrect definition: - Some fields that are 1 byte long (e.g. TINYINT, CHAR(1)), might be internally casted (in certain cases) to a different type on a storage engine layer. (affects 4.1 and up) - If tables in a merge (and a MERGE table itself) had short VARCHAR column (less than 4 bytes) and at least one (but not all) tables were ALTER'ed (even to an identical table: ALTER TABLE xxx ENGINE=yyy), table definitions went ouf of sync. (affects 4.1 only) This is fixed by relaxing a check for underlying conformance and setting field type to FIELD_TYPE_STRING in case varchar is shorter than 4 when a table is created.
This commit is contained in:
@ -806,3 +806,16 @@ CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1);
|
||||
INSERT DELAYED INTO t2 VALUES(1);
|
||||
ERROR HY000: Table storage engine for 't2' doesn't have this option
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1(c1 VARCHAR(1));
|
||||
CREATE TABLE m1 LIKE t1;
|
||||
ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
|
||||
SELECT * FROM m1;
|
||||
c1
|
||||
DROP TABLE t1, m1;
|
||||
CREATE TABLE t1(c1 VARCHAR(4), c2 TINYINT, c3 TINYINT, c4 TINYINT,
|
||||
c5 TINYINT, c6 TINYINT, c7 TINYINT, c8 TINYINT, c9 TINYINT);
|
||||
CREATE TABLE m1 LIKE t1;
|
||||
ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
|
||||
SELECT * FROM m1;
|
||||
c1 c2 c3 c4 c5 c6 c7 c8 c9
|
||||
DROP TABLE t1, m1;
|
||||
|
@ -437,4 +437,21 @@ CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1);
|
||||
INSERT DELAYED INTO t2 VALUES(1);
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# BUG#26881 - Large MERGE tables report incorrect specification when no
|
||||
# differences in tables
|
||||
#
|
||||
CREATE TABLE t1(c1 VARCHAR(1));
|
||||
CREATE TABLE m1 LIKE t1;
|
||||
ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
|
||||
SELECT * FROM m1;
|
||||
DROP TABLE t1, m1;
|
||||
|
||||
CREATE TABLE t1(c1 VARCHAR(4), c2 TINYINT, c3 TINYINT, c4 TINYINT,
|
||||
c5 TINYINT, c6 TINYINT, c7 TINYINT, c8 TINYINT, c9 TINYINT);
|
||||
CREATE TABLE m1 LIKE t1;
|
||||
ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
|
||||
SELECT * FROM m1;
|
||||
DROP TABLE t1, m1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
Reference in New Issue
Block a user