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
10 changes: 10 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,13 @@ DROP TABLE t;
#
# End of 10.5 tests
#
#
# Start of 10.11 tests
#
SET character_set_connection=ucs2;
CREATE TABLE t1 (d1 date not null, d2 date, gd text as (concat(d1,if(d1 <> d2, date_format(d2, 'to %y-%m-%d '), ''))) );
SELECT (SELECT 1 FROM foo) FROM t1;
ERROR 42S02: Table 'test.foo' doesn't exist
INSERT INTO t1 (d1) VALUES ('2009-07-02');
DROP TABLE t1;
# End of 10.11 tests
21 changes: 21 additions & 0 deletions mysql-test/suite/vcol/t/vcol_misc.test
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ SELECT COUNT(*) FROM t1;
INSERT INTO t1 (a,tsv) VALUES (5,DEFAULT);
INSERT DELAYED INTO t1 (a,tsv) VALUES (6,DEFAULT);
FLUSH TABLES WITH READ LOCK;
# Under view protocol the following SELECT is issued as CREATE VIEW on a
# separate connection. That statement blocks on the global read lock held
# here and would not return until the UNLOCK TABLES below, which the same
# client cannot reach while it waits. Run it directly to avoid the deadlock.
--disable_view_protocol
SELECT COUNT(*) FROM t1;
--enable_view_protocol
set GLOBAL debug_dbug= @old_debug;
unlock tables;
DROP TABLE t1;
Expand Down Expand Up @@ -560,3 +566,18 @@ DROP TABLE t;
--echo #
--echo # End of 10.5 tests
--echo #

--echo #
--echo # Start of 10.11 tests
--echo #

# Charset difference required which inserts a charset converter, forcing the column value read later.
SET character_set_connection=ucs2;
CREATE TABLE t1 (d1 date not null, d2 date, gd text as (concat(d1,if(d1 <> d2, date_format(d2, 'to %y-%m-%d '), ''))) );
# Necessary to get table t1 into the cache. Without this SELECT, the crash is not evident.
--ERROR ER_NO_SUCH_TABLE
SELECT (SELECT 1 FROM foo) FROM t1;
INSERT INTO t1 (d1) VALUES ('2009-07-02');
DROP TABLE t1;

--echo # End of 10.11 tests
1 change: 1 addition & 0 deletions sql/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3723,6 +3723,7 @@ bool Vcol_expr_context::init()
thd->set_n_backup_active_arena(table->expr_arena, &backup_arena);
thd->stmt_arena= thd;

table->map= 1;
inited= true;
return false;
}
Expand Down