1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-34305 Redundant truncation errors/warnings with optimizer_trace enabled

my_like_range*() can create longer keys than Field::char_length().
This caused warnings during print_range().

Fix:

Suppressing warnings in print_range().
This commit is contained in:
Alexander Barkov
2024-06-11 13:49:08 +04:00
parent df35072c8d
commit d1e5fa8917
3 changed files with 64 additions and 0 deletions

View File

@ -971,5 +971,40 @@ select QUERY, LENGTH(trace)>1 from information_schema.optimizer_trace;
drop table t1, t2;
--echo #
--echo # MDEV-34305 Redundant truncation errors/warnings with optimizer_trace enabled
--echo #
SET @@optimizer_trace='enabled=on';
CREATE TABLE t1 (
a CHAR(2) NOT NULL PRIMARY KEY,
b VARCHAR(20) NOT NULL,
KEY (b)
) CHARSET=utf8mb4;
CREATE TABLE t2 (
a CHAR(2) NOT NULL PRIMARY KEY,
b VARCHAR(20) NOT NULL,
KEY (b)
) CHARSET=utf8mb4;
INSERT INTO t1 VALUES
('AB','MySQLAB'),
('JA','Sun Microsystems'),
('MS','Microsoft'),
('IB','IBM- Inc.'),
('GO','Google Inc.');
INSERT IGNORE INTO t2 VALUES
('AB','Sweden'),
('JA','USA'),
('MS','United States'),
('IB','North America'),
('GO','South America');
UPDATE t1,t2 SET t1.b=UPPER(t1.b) WHERE t1.b LIKE 'Unknown%';
DROP TABLE t1, t2;
--echo # End of 10.5 tests
set optimizer_trace='enabled=off';