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
18 changes: 18 additions & 0 deletions mysql-test/suite/vcol/r/vcol_misc.result
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,21 @@ DROP TABLE t;
#
# End of 10.5 tests
#
#
# MDEV-26820 Assertion `marked_for_read()' failed upon SELECT with VALUE(virtual column)
#
CREATE TABLE t1 (a VARCHAR(8), b VARCHAR(8) AS (REPEAT(a,1)) VIRTUAL) ENGINE=MyISAM;
INSERT INTO t1 (a) VALUES ('foo'),('bar');
SELECT VALUE(b) FROM (SELECT * FROM t1) sq;
VALUE(b)
NULL
NULL
DROP TABLE t1;
CREATE TABLE t1 ( id uuid, vid varchar(255) GENERATED always AS (id)) engine=aria;
INSERT INTO t1 (id) values (uuid()),(uuid()),(uuid());
SELECT VALUE( vid ) FROM (select * from t1)dt;
VALUE( vid )
NULL
NULL
NULL
DROP TABLE t1;
16 changes: 16 additions & 0 deletions mysql-test/suite/vcol/t/vcol_misc.test
Original file line number Diff line number Diff line change
Expand Up @@ -560,3 +560,19 @@ DROP TABLE t;
--echo #
--echo # End of 10.5 tests
--echo #

--echo #
--echo # MDEV-26820 Assertion `marked_for_read()' failed upon SELECT with VALUE(virtual column)
--echo #

CREATE TABLE t1 (a VARCHAR(8), b VARCHAR(8) AS (REPEAT(a,1)) VIRTUAL) ENGINE=MyISAM;
INSERT INTO t1 (a) VALUES ('foo'),('bar');
SELECT VALUE(b) FROM (SELECT * FROM t1) sq;

DROP TABLE t1;

CREATE TABLE t1 ( id uuid, vid varchar(255) GENERATED always AS (id)) engine=aria;
INSERT INTO t1 (id) values (uuid()),(uuid()),(uuid());
SELECT VALUE( vid ) FROM (select * from t1)dt;

DROP TABLE t1;
1 change: 1 addition & 0 deletions sql/item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10232,6 +10232,7 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items)
set_field(tmp_field);
// the index is important when read bits set
tmp_field->field_index= field_arg->field->field_index;
tmp_field->vcol_info= field_arg->field->vcol_info;
}
}
return FALSE;
Expand Down