Using virtual columns with (M)aria storage engines causes easy memory corruptions with various stack traces including
#5 0x00c23424 in __kernel_vsyscall ()
#6 0x0089ed71 in raise () from /lib/libc.so.6
#7 0x008a064a in abort () from /lib/libc.so.6
#8 0x008dcd9d in __libc_message () from /lib/libc.so.6
#9 0x008e31e1 in malloc_printerr () from /lib/libc.so.6
#10 0x086fc3ff in my_no_flags_free (ptr=0xb5d6b3b0) at my_malloc.c:62
#11 0x086fcde3 in free_root (root=0x9fae860, MyFlags=1) at my_alloc.c:348
#12 0x0827cf7a in dispatch_command (command=COM_QUERY, thd=0x9fac8a8, packet=0x9fae889 "", packet_length=13) at sql_parse.cc:1633
#13 0x0827b288 in do_command (thd=0x9fac8a8) at sql_parse.cc:890
#14 0x08278420 in handle_one_connection (arg=0x9fac8a8) at sql_connect.cc:1153
#15 0x00a08919 in start_thread () from /lib/libpthread.so.0
#16 0x00951e5e in clone () from /lib/libc.so.6
Test case:
CREATE TABLE IF NOT EXISTS X (
f1 CHAR(255) BINARY ,
f2 CHAR(255) BINARY NOT NULL DEFAULT '0',
f3 CHAR(255) BINARY NOT NULL ,
f4 CHAR(255) BINARY NOT NULL DEFAULT '0' ,
v3 CHAR(255) BINARY AS ( ( f1 NOT LIKE '%' ) ) PERSISTENT ,
KEY (v3)
) ENGINE=Maria;
INSERT INTO X ( f1 , f2 , f3 , f4 ) SELECT f1 , f4 , f1 , f4 FROM X;
DELETE FROM X;