Bug #83020 Table creation with binary type column is resulting in Assert condition failure.
Submitted: 16 Sep 2016 9:47 Modified: 21 Jun 2017 16:19
Reporter: Praveenkumar Hulakund Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:8.0.1 OS:Any
Assigned to: CPU Architecture:Any

[16 Sep 2016 9:47] Praveenkumar Hulakund
Description:
Creating a table with binary type column having default value resulted
in following assert condition failure in dd::Raw_record::store().

Thread 1 (Thread 0x7f97593f9700 (LWP 14417)):
#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
#1  0x000000000267a34e in my_write_core (sig=6) at /export/home2/tmp/phulakun/bug22700385/mysql/mysys/stacktrace.cc:275
#2  0x0000000001d811b5 in handle_fatal_signal (sig=6) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/signal_handler.cc:219
#3  <signal handler called>
#4  0x00007f975f7b7267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#5  0x00007f975f7b8eca in __GI_abort () at abort.c:89
#6  0x00007f975f7b003d in __assert_fail_base (fmt=0x7f975f911fe8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x329299f "rc == TYPE_OK", file=file@entry=0x3292930 "/export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/impl/raw/raw_record.cc", line=line@entry=162, function=function@entry=0x3292a60 <dd::Raw_record::store(int, std::__cxx11::basic_string<char, std::char_traits<char>, Stateless_allocator<char, dd::String_type_alloc, My_free_functor> > const&, bool)::__PRETTY_FUNCTION__> "bool dd::Raw_record::store(int, const String_type&, bool)") at assert.c:92
#7  0x00007f975f7b00f2 in __GI___assert_fail (assertion=0x329299f "rc == TYPE_OK", file=0x3292930 "/export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/impl/raw/raw_record.cc", line=162, function=0x3292a60 <dd::Raw_record::store(int, std::__cxx11::basic_string<char, std::char_traits<char>, Stateless_allocator<char, dd::String_type_alloc, My_free_functor> > const&, bool)::__PRETTY_FUNCTION__> "bool dd::Raw_record::store(int, const String_type&, bool)") at assert.c:101
#8  0x0000000001ceb0c2 in dd::Raw_record::store (this=0x7f96d02fc090, field_no=15, s="�", '\000' <repeats 30 times>, is_null=false) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/impl/raw/raw_record.cc:162
#9  0x0000000001d1cb91 in dd::Column_impl::store_attributes (this=0x7f96d0335290, r=0x7f96d02fc090) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/impl/types/column_impl.cc:337
#10 0x0000000001d56a47 in dd::Weak_object_impl::store (this=0x7f96d0335290, otx=0x7f97593f4bb0) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/impl/types/weak_object_impl.cc:122
#11 0x0000000001b92292 in dd::Collection<dd::Column*>::store_items (this=0x7f96d0176d90, otx=0x7f97593f4bb0) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/collection.cc:195
#12 0x0000000001d1603f in dd::Abstract_table_impl::store_children (this=0x7f96d0176d40, otx=0x7f97593f4bb0) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/impl/types/abstract_table_impl.cc:126
#13 0x0000000001d428cd in dd::Table_impl::store_children (this=0x7f96d0176d40, otx=0x7f97593f4bb0) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/impl/types/table_impl.cc:280
#14 0x0000000001d56b60 in dd::Weak_object_impl::store (this=0x7f96d0176d40, otx=0x7f97593f4bb0) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/impl/types/weak_object_impl.cc:141
#15 0x0000000001cd7966 in dd::cache::Storage_adapter::store<dd::Table> (thd=0x7f96d0323ff0, object=0x7f96d0176dc8) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/impl/cache/storage_adapter.cc:211
#16 0x0000000001c173b5 in dd::cache::Dictionary_client::store<dd::Table> (this=0x7f96d032b250, object=0x7f96d0176dc8) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/impl/cache/dictionary_client.cc:1844
#17 0x0000000001bcdf20 in dd::create_dd_user_table (thd=0x7f96d0323ff0, schema_name="test", table_name="t1", create_info=0x7f97593f7270, create_fields=..., keyinfo=0x7f96d032ee98, keys=0, keys_onoff=Alter_info::ENABLE, fk_keyinfo=0x7f96d032ee98, fk_keys=0, file=0x7f96d027ec28) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/dd_table.cc:2231
#18 0x0000000001bce133 in dd::create_table (thd=0x7f96d0323ff0, schema_name="test", table_name="t1", create_info=0x7f97593f7270, create_fields=..., keyinfo=0x7f96d032ee98, keys=0, keys_onoff=Alter_info::ENABLE, fk_keyinfo=0x7f96d032ee98, fk_keys=0, file=0x7f96d027ec28) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/dd/dd_table.cc:2266
#19 0x0000000001b00a0b in rea_create_table (thd=0x7f96d0323ff0, path=0x7f97593f6ef0 "./test/t1", db=0x7f96d032e9f0 "test", table_name=0x7f96d032e360 "t1", create_info=0x7f97593f7270, create_fields=..., keys=0, key_info=0x7f96d032ee98, keys_onoff=Alter_info::ENABLE, fk_keys=0, fk_key_info=0x7f96d032ee98, file=0x7f96d027ec28, no_ha_table=false, tmp_table_def=0x7f97593f6ea0) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/sql_table.cc:2032
#20 0x0000000001b0b208 in create_table_impl (thd=0x7f96d0323ff0, db=0x7f96d032e9f0 "test", table_name=0x7f96d032e360 "t1", error_table_name=0x7f96d032e360 "t1", path=0x7f97593f6ef0 "./test/t1", create_info=0x7f97593f7270, alter_info=0x7f97593f7360, internal_tmp_table=false, select_field_count=0, no_ha_table=false, is_trans=0x7f97593f717a, key_info=0x7f97593f6e90, key_count=0x7f97593f6e88, keys_onoff=Alter_info::ENABLE, fk_key_info=0x7f97593f6e98, fk_key_count=0x7f97593f6e8c, existing_fk_info=0x0, existing_fk_count=0, tmp_table_def=0x7f97593f6ea0) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/sql_table.cc:5969
#21 0x0000000001b0babb in mysql_create_table_no_lock (thd=0x7f96d0323ff0, db=0x7f96d032e9f0 "test", table_name=0x7f96d032e360 "t1", create_info=0x7f97593f7270, alter_info=0x7f97593f7360, select_field_count=0, is_trans=0x7f97593f717a) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/sql_table.cc:6146
#22 0x0000000001b0bc2c in mysql_create_table (thd=0x7f96d0323ff0, create_table=0x7f96d027e4e0, create_info=0x7f97593f7270, alter_info=0x7f97593f7360) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/sql_table.cc:6192
#23 0x00000000025179e4 in Sql_cmd_create_table::execute (this=0x7f96d032e9d8, thd=0x7f96d0323ff0) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/sql_cmd_ddl_table.cc:287
#24 0x0000000001a73a67 in mysql_execute_command (thd=0x7f96d0323ff0, first_level=true) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/sql_parse.cc:3231
#25 0x0000000001a795d7 in mysql_parse (thd=0x7f96d0323ff0, parser_state=0x7f97593f84f0) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/sql_parse.cc:5198
#26 0x0000000001a6f4ac in dispatch_command (thd=0x7f96d0323ff0, com_data=0x7f97593f8de0, command=COM_QUERY) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/sql_parse.cc:1424
#27 0x0000000001a6e532 in do_command (thd=0x7f96d0323ff0) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/sql_parse.cc:1047
#28 0x0000000001d72028 in handle_connection (arg=0x637ab90) at /export/home2/tmp/phulakun/bug22700385/mysql/sql/conn_handler/connection_handler_per_thread.cc:301
#29 0x0000000002b3ee11 in pfs_spawn_thread (arg=0x66e9ca0) at /export/home2/tmp/phulakun/bug22700385/mysql/storage/perfschema/pfs.cc:2286
#30 0x00007f9760e456aa in start_thread (arg=0x7f97593f9700) at pthread_create.c:333
#31 0x00007f975f888e9d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

How to repeat:

CREATE TABLE t1 (f1 int(11) NOT NULL DEFAULT '0', f2 binary(32) NOT NULL DEFAULT 0xAA);

Suggested fix:
Table creation should be successful.
[21 Jun 2017 16:19] Paul DuBois
Posted by developer:
 
Fixed in 8.0.3.

For debug builds, a CREATE TABLE statement with a VARBINARY or BINARY
column having a default value in hexadecimal format caused a server
exit.