mirror of
https://github.com/MariaDB/server.git
synced 2025-02-07 06:12:18 +01:00
![Sergei Golubchik](/assets/img/avatar_default.png)
This fixes a bug where handler::read_range_first (for example) needed to compare vcol values that were not calculated yet. As a bonus it fixes few cases where vcols were calculated twice
25 lines
650 B
Text
25 lines
650 B
Text
CREATE TABLE t1 (
|
|
pk INT AUTO_INCREMENT PRIMARY KEY,
|
|
col_int_nokey INT NULL,
|
|
col_int_key INT AS (col_int_nokey) VIRTUAL,
|
|
KEY (col_int_key)
|
|
);
|
|
INSERT INTO t1 (col_int_nokey)
|
|
VALUES (0), (5), (4), (3), (7), (42), (5), (0), (3);
|
|
SELECT * FROM t1 WHERE col_int_key IN (3, 4) AND col_int_key <= 83 ORDER BY 1;
|
|
pk col_int_nokey col_int_key
|
|
3 4 4
|
|
4 3 3
|
|
9 3 3
|
|
set optimizer_switch='index_condition_pushdown=off';
|
|
SELECT * FROM t1 WHERE col_int_key IN (3, 4) ORDER BY 1;
|
|
pk col_int_nokey col_int_key
|
|
3 4 4
|
|
4 3 3
|
|
9 3 3
|
|
SELECT * FROM t1 WHERE col_int_key IN (3, 4) AND col_int_key <= 83 ORDER BY 1;
|
|
pk col_int_nokey col_int_key
|
|
3 4 4
|
|
4 3 3
|
|
9 3 3
|
|
DROP TABLE t1;
|