Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions mysql-test/suite/innodb/r/default_row_format_16k.result
Original file line number Diff line number Diff line change
Expand Up @@ -839,3 +839,19 @@ CREATE INDEX idx1 ON t1(a);
ALTER TABLE t1 ROW_FORMAT=COMPACT;
ERROR 42000: Specified key was too long; max key length is 767 bytes
DROP TABLE t1;
#
# Bug#25579578 - FAILING ASSERTION: !FIELD->PREFIX_LEN ||
# FIELD->FIXED_LEN == FIELD->PREFIX_LEN
#
CREATE TABLE t1(a CHAR(255) CHARACTER SET UTF32,KEY k1(a(195))) ENGINE=INNODB;
INSERT INTO t1 VALUES(-233);
DROP TABLE t1;
CREATE TABLE t1(a CHAR(255) CHARACTER SET UTF32,KEY k1(a(195)));
INSERT INTO t1 VALUES('x');
DROP TABLE t1;
CREATE TABLE t1(a CHAR(255) CHARACTER SET latin1,KEY k1(a(195)));
INSERT INTO t1 VALUES('x');
DROP TABLE t1;
CREATE TABLE t1(a CHAR(255), KEY k1(a(195)));
INSERT INTO t1 VALUES('x');
DROP TABLE t1;
236 changes: 236 additions & 0 deletions mysql-test/suite/innodb/r/innodb_bug120323.result

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions mysql-test/suite/innodb/r/innodb_bug39129182.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
SET GLOBAL innodb_adaptive_hash_index = false;
SET GLOBAL innodb_stats_persistent = false;
SET GLOBAL innodb_flush_log_at_trx_commit = 0;
#
# Case 1: Fixed-length PK columns (fast path in estimation).
# CHAR(255) latin1 -- dict_col_get_fixed_size() returns 255,
# field->fixed_len = 255 (correctly set, below 768 threshold).
#
CREATE TABLE t1 (
a00 CHAR(255) NOT NULL DEFAULT 'a',
a01 CHAR(255) NOT NULL DEFAULT 'a',
a02 CHAR(255) NOT NULL DEFAULT 'a',
b INT NOT NULL DEFAULT 0,
CONSTRAINT pkey PRIMARY KEY(a00, a01, a02)
) charset latin1 ENGINE = InnoDB COMMENT='MERGE_THRESHOLD=45';
SET GLOBAL innodb_limit_optimistic_insert_debug = 3;
SET GLOBAL innodb_limit_optimistic_insert_debug = 0;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
SET GLOBAL DEBUG = "+d,check_node_ptr_size_estimation";
DELETE FROM t1 WHERE a00 = 'cnm';
SET GLOBAL DEBUG = "-d,check_node_ptr_size_estimation";
# Case 1 passed: fixed-length PK estimation is correct
#
# Case 2: Variable-length PK columns (slow path in estimation).
# CHAR(255) utf8 -- dict_col_get_fixed_size() returns 0 in
# COMPACT format (mbminlen != mbmaxlen), so the estimation
# takes the slow path using dict_col_get_max_size().
#
CREATE TABLE t2 (
a00 CHAR(255) NOT NULL DEFAULT 'a',
a01 CHAR(255) NOT NULL DEFAULT 'a',
b INT NOT NULL DEFAULT 0,
CONSTRAINT pkey PRIMARY KEY(a00, a01)
) charset utf8 ENGINE = InnoDB COMMENT='MERGE_THRESHOLD=45';
Warnings:
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
SET GLOBAL innodb_limit_optimistic_insert_debug = 3;
SET GLOBAL innodb_limit_optimistic_insert_debug = 0;
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
SET GLOBAL DEBUG = "+d,check_node_ptr_size_estimation";
SET GLOBAL DEBUG = "-d,check_node_ptr_size_estimation";
# Case 2 passed: variable-length PK estimation is correct
#
# Case 3: CHAR(255) CHARACTER SET utf32 PK -- missing COMPACT overhead.
# utf32 has mbminlen == mbmaxlen == 4, so dtype_get_fixed_size_low()
# returns 255*4=1020 in COMPACT format. But dict_index_add_col() zeros
# field->fixed_len because 1020 > DICT_MAX_FIXED_COL_LEN (768).
#
# The fast path in dict_index_node_ptr_max_size() adds 1020 but skips
# the 2-byte variable-length header that COMPACT actually encodes.
# Underestimation: 2 bytes per such column in the PK.
#
# CHAR(193) utf32 = 772 bytes is the minimum to exceed the 768 threshold.
# We use CHAR(255) utf32 = 1020 bytes for the maximum effect.
#
CREATE TABLE t3 (
a CHAR(255) NOT NULL,
b CHAR(255) NOT NULL,
c INT NOT NULL DEFAULT 0,
PRIMARY KEY (a, b)
) CHARACTER SET utf32 ENGINE=InnoDB COMMENT='MERGE_THRESHOLD=45';
SET GLOBAL innodb_limit_optimistic_insert_debug = 3;
SET GLOBAL innodb_limit_optimistic_insert_debug = 0;
ANALYZE TABLE t3;
Table Op Msg_type Msg_text
test.t3 analyze status OK
SET GLOBAL DEBUG = "+d,check_node_ptr_size_estimation";
DELETE FROM t3 WHERE c BETWEEN 10 AND 20;
# Case 3 passed: utf32 PK estimation is correct
SET GLOBAL DEBUG = "-d,check_node_ptr_size_estimation";
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
32 changes: 32 additions & 0 deletions mysql-test/suite/innodb/r/innodb_bug39129182_spatial.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
DROP TABLE IF EXISTS t1;
SET GLOBAL innodb_adaptive_hash_index = false;
SET GLOBAL innodb_stats_persistent = false;
SET GLOBAL innodb_flush_log_at_trx_commit = 0;
#
# Case 1: GEOMETRY column with SPATIAL KEY -- ULINT_MAX overflow.
# dtype_get_max_size_low() returns ULINT_MAX for DATA_GEOMETRY.
# dict_index_node_ptr_max_size() adds ULINT_MAX to rec_max_size,
# causing unsigned integer wrap-around. The resulting tiny value
# is caught by the debug assertion during purge traversal.
#
# Uses LINESTRING (not POINT) because POINT has its own data type
# (DATA_POINT) with a known fixed size -- only GEOMETRY returns
# ULINT_MAX from dtype_get_max_size_low().
#
CREATE TABLE t1 (
id INT AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL,
SPATIAL KEY idx_g (g)
) ENGINE=InnoDB COMMENT='MERGE_THRESHOLD=45';
Warnings:
Warning 3674 The spatial index on column 'g' will not be used by the query optimizer since the column does not have an SRID attribute. Consider adding an SRID attribute to the column.
SET GLOBAL innodb_limit_optimistic_insert_debug = 3;
SET GLOBAL innodb_limit_optimistic_insert_debug = 0;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
SET GLOBAL DEBUG = "+d,check_node_ptr_size_estimation";
DELETE FROM t1 WHERE id BETWEEN 100 AND 500;
# Case 1 passed: spatial index node pointer estimation is correct
SET GLOBAL DEBUG = "-d,check_node_ptr_size_estimation";
DROP TABLE t1;
74 changes: 74 additions & 0 deletions mysql-test/suite/innodb/r/innodb_bug39129182_too_big_row.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
DROP TABLE IF EXISTS t1;
#
# Case1: Primary key is large
#
CREATE TABLE t1 (
a CHAR(255) NOT NULL,
b CHAR(255) NOT NULL,
c CHAR(255) NOT NULL,
d CHAR(175) NOT NULL,
g GEOMETRY NOT NULL,
PRIMARY KEY (a, b, c, d),
SPATIAL KEY idx_g (g)
) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=latin1;
Warnings:
Warning 3674 The spatial index on column 'g' will not be used by the query optimizer since the column does not have an SRID attribute. Consider adding an SRID attribute to the column.
INSERT INTO t1(a,b,c,d,g) VALUES ('a', 'b', 'c', 'd', ST_GeomFromText('POINT(37.7749 -122.4194)', 4326));
ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
SELECT a,b,c,d FROM t1;
a b c d
DROP TABLE t1;
#
# Case2: Primary key is small, row is big (we use index on GEOMETRY)
#
CREATE TABLE t1 (
a CHAR(255) NOT NULL,
b CHAR(255) NOT NULL,
c CHAR(255) NOT NULL,
d CHAR(175) NOT NULL,
g GEOMETRY NOT NULL,
PRIMARY KEY (a),
SPATIAL KEY idx_g (g)
) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=latin1;
Warnings:
Warning 3674 The spatial index on column 'g' will not be used by the query optimizer since the column does not have an SRID attribute. Consider adding an SRID attribute to the column.
INSERT INTO t1(a,b,c,d,g) VALUES ('a', 'b', 'c', 'd', ST_GeomFromText('POINT(37.7749 -122.4194)', 4326));
SELECT a,b,c,d FROM t1;
a b c d
a b c d
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (a,b,c,d);
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
SELECT a,b,c,d FROM t1;
a b c d
a b c d
SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression
t1 0 PRIMARY 1 a A 1 NULL NULL BTREE YES NULL
t1 1 idx_g 1 g A 1 32 NULL SPATIAL YES NULL
DROP TABLE t1;
#
# Case3: Primary key is small, row is big (we use index on POINT)
#
CREATE TABLE t1 (
a CHAR(255) NOT NULL,
b CHAR(255) NOT NULL,
c CHAR(255) NOT NULL,
d CHAR(175) NOT NULL,
p POINT NOT NULL SRID 4326,
PRIMARY KEY (a),
SPATIAL KEY idx_p (p)
) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=latin1;
INSERT INTO t1(a,b,c,d,p) VALUES ('a', 'b', 'c', 'd', ST_GeomFromText('POINT(37.7749 -122.4194)', 4326));
SELECT a,b,c,d FROM t1;
a b c d
a b c d
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (a,b,c,d);
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
SELECT a,b,c,d FROM t1;
a b c d
a b c d
SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression
t1 0 PRIMARY 1 a A 1 NULL NULL BTREE YES NULL
t1 1 idx_p 1 p A 1 32 NULL SPATIAL YES NULL
DROP TABLE t1;
20 changes: 20 additions & 0 deletions mysql-test/suite/innodb/t/default_row_format_16k.test
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,23 @@ CREATE INDEX idx1 ON t1(a);
ALTER TABLE t1 ROW_FORMAT=COMPACT;
DROP TABLE t1;

--echo #
--echo # Bug#25579578 - FAILING ASSERTION: !FIELD->PREFIX_LEN ||
--echo # FIELD->FIXED_LEN == FIELD->PREFIX_LEN
--echo #

CREATE TABLE t1(a CHAR(255) CHARACTER SET UTF32,KEY k1(a(195))) ENGINE=INNODB;
INSERT INTO t1 VALUES(-233);
DROP TABLE t1;

CREATE TABLE t1(a CHAR(255) CHARACTER SET UTF32,KEY k1(a(195)));
INSERT INTO t1 VALUES('x');
DROP TABLE t1;

CREATE TABLE t1(a CHAR(255) CHARACTER SET latin1,KEY k1(a(195)));
INSERT INTO t1 VALUES('x');
DROP TABLE t1;

CREATE TABLE t1(a CHAR(255), KEY k1(a(195)));
INSERT INTO t1 VALUES('x');
DROP TABLE t1;
Loading
Loading