mariadb/mysql-test/suite/vcol
Aleksey Midenkov f7552313d4 MDEV-29932 Invalid expr in cleanup_session_expr() upon INSERT DELAYED
There are two TABLE objects in each thread: first one is created in
delayed thread by Delayed_insert::open_and_lock_table(), second one is
created in connection thread by Delayed_insert::get_local_table(). It
is copied from the delayed thread table.

When the second table is copied copy-assignment operator copies
vcol_refix_list which is already filled with an item from delayed
thread. Then get_local_table() adds its own item. Thus both tables
contains the same list with two items which is wrong. Then connection
thread finishes and its item freed. Then delayed thread tries to
access it in vcol_cleanup_expr().

The fix just clears vcol_refix_list in the copied table.

Another problem is that copied table contains the same mem_root, any
allocations on it will be invalid if the original table is freed (and
that is indeterministic as it is done in another thread). Since copied
table is allocated in connection THD and lives not longer than
thd->mem_root we may assign its mem_root from thd->mem_root.

Third, it doesn't make sense to do open_and_lock_tables() on NULL
pointer.
2023-11-10 15:46:15 +03:00
..
inc MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
r MDEV-29932 Invalid expr in cleanup_session_expr() upon INSERT DELAYED 2023-11-10 15:46:15 +03:00
t MDEV-29932 Invalid expr in cleanup_session_expr() upon INSERT DELAYED 2023-11-10 15:46:15 +03:00
disabled.def MDEV-11836 vcol.vcol_keys_myisam fails in buildbot and outside 2017-02-13 18:12:04 +01:00