Commit 44ca4993 authored by Sergei Golubchik's avatar Sergei Golubchik

bugfix: partitioning and keyread on an indexed vcol

parent 2a0f7a34
CREATE TABLE t1 (
id INT NOT NULL,
store_id INT NOT NULL,
x INT GENERATED ALWAYS AS (id + store_id)
)
PARTITION BY RANGE (store_id) (
PARTITION p0 VALUES LESS THAN (6),
PARTITION p1 VALUES LESS THAN (11),
PARTITION p2 VALUES LESS THAN (16),
PARTITION p3 VALUES LESS THAN (21)
);
INSERT t1 (id, store_id) VALUES(1, 2), (3, 4), (3, 12), (4, 18);
CREATE INDEX idx ON t1(x);
SELECT x FROM t1;
x
3
7
15
22
DROP TABLE t1;
#
# test keyread on an indexed vcol
#
--source include/have_partition.inc
CREATE TABLE t1 (
id INT NOT NULL,
store_id INT NOT NULL,
x INT GENERATED ALWAYS AS (id + store_id)
)
PARTITION BY RANGE (store_id) (
PARTITION p0 VALUES LESS THAN (6),
PARTITION p1 VALUES LESS THAN (11),
PARTITION p2 VALUES LESS THAN (16),
PARTITION p3 VALUES LESS THAN (21)
);
INSERT t1 (id, store_id) VALUES(1, 2), (3, 4), (3, 12), (4, 18);
CREATE INDEX idx ON t1(x);
SELECT x FROM t1;
DROP TABLE t1;
......@@ -3434,7 +3434,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
}
m_start_key.length= 0;
m_rec0= table->record[0];
m_rec_length= table_share->stored_rec_length;
m_rec_length= table_share->reclength;
if (!m_part_ids_sorted_by_num_of_records)
{
if (!(m_part_ids_sorted_by_num_of_records=
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment