Bug #92888 CREATE TABLE ... Assertion `rc == TYPE_OK' failed.
Submitted: 22 Oct 2018 20:43 Modified: 22 Oct 2018 22:13
Reporter: George Lorch Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any
Tags: debug

[22 Oct 2018 20:43] George Lorch
Description:
mysqld: /home/glorch/dev/8.0/mysql/sql/dd/impl/raw/raw_record.cc:158: bool dd::Raw_record::store(int, const String_type&, bool): Assertion `rc == TYPE_OK' failed.

Thread 43 "mysqld" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffdc1c0700 (LWP 24506)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff61cd801 in __GI_abort () at abort.c:79
#2  0x00007ffff61bd39a in __assert_fail_base (fmt=0x7ffff63447d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55555ab6f345 "rc == TYPE_OK", file=file@entry=0x55555ab6f2e8 "/home/glorch/dev/8.0/mysql/sql/dd/impl/raw/raw_record.cc", 
    line=line@entry=158, 
    function=function@entry=0x55555ab6f460 <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
#3  0x00007ffff61bd412 in __GI___assert_fail (assertion=0x55555ab6f345 "rc == TYPE_OK", file=0x55555ab6f2e8 "/home/glorch/dev/8.0/mysql/sql/dd/impl/raw/raw_record.cc", line=158, 
    function=0x55555ab6f460 <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
#4  0x000055555944e4de in dd::Raw_record::store (this=0x7fff34122da0, field_no=5, s="'\005g\211'", is_null=false) at /home/glorch/dev/8.0/mysql/sql/dd/impl/raw/raw_record.cc:158
#5  0x00005555594ce2e1 in dd::Partition_impl::store_attributes (this=0x7fff34121b00, r=0x7fff34122da0) at /home/glorch/dev/8.0/mysql/sql/dd/impl/types/partition_impl.cc:272
#6  0x00005555594f9894 in dd::Weak_object_impl::store (this=0x7fff34121b00, otx=0x7fffdc1bc210) at /home/glorch/dev/8.0/mysql/sql/dd/impl/types/weak_object_impl.cc:119
#7  0x00005555592a0ab8 in dd::Collection<dd::Partition*>::store_items (this=0x7fff34190a40, otx=0x7fffdc1bc210) at /home/glorch/dev/8.0/mysql/sql/dd/collection.cc:220
#8  0x00005555594df687 in dd::Table_impl::store_children (this=0x7fff34190840, otx=0x7fffdc1bc210) at /home/glorch/dev/8.0/mysql/sql/dd/impl/types/table_impl.cc:362
#9  0x00005555594f99cd in dd::Weak_object_impl::store (this=0x7fff34190840, otx=0x7fffdc1bc210) at /home/glorch/dev/8.0/mysql/sql/dd/impl/types/weak_object_impl.cc:147
#10 0x0000555559436d78 in dd::cache::Storage_adapter::store<dd::Table> (thd=0x7fff34000e40, object=0x7fff34190ac8) at /home/glorch/dev/8.0/mysql/sql/dd/impl/cache/storage_adapter.cc:296
#11 0x000055555932a3ab in dd::cache::Dictionary_client::store<dd::Table> (this=0x7fff34004460, object=0x7fff34190ac8) at /home/glorch/dev/8.0/mysql/sql/dd/impl/cache/dictionary_client.cc:2418
#12 0x00005555581808a0 in rea_create_base_table (thd=0x7fff34000e40, path=0x7fffdc1bd950 "./TEST/t2", sch_obj=..., db=0x7fff34033e40 "TEST", table_name=0x7fff34030720 "t2", create_info=0x7fffdc1bde30, create_fields=..., keys=2, key_info=0x7fff3416efb0, 
    keys_onoff=Alter_info::ENABLE, fk_keys=0, fk_key_info=0x7fff3416f190, file=0x7fff3416d7c0, no_ha_table=false, do_not_store_in_dd=false, part_info=0x7fff3416ceb8, binlog_to_trx_cache=0x7fffdc1bdbd0, table_def_ptr=0x7fffdc1bd888, post_ddl_ht=0x7fffdc1bdbd8)
    at /home/glorch/dev/8.0/mysql/sql/sql_table.cc:929
#13 0x0000555558195124 in create_table_impl (thd=0x7fff34000e40, schema=..., db=0x7fff34033e40 "TEST", table_name=0x7fff34030720 "t2", error_table_name=0x7fff34030720 "t2", path=0x7fffdc1bd950 "./TEST/t2", create_info=0x7fffdc1bde30, alter_info=0x7fffdc1bdf30, 
    internal_tmp_table=false, select_field_count=0, find_parent_keys=true, no_ha_table=false, do_not_store_in_dd=false, is_trans=0x7fffdc1bdbd0, key_info=0x7fffdc1bd878, key_count=0x7fffdc1bd870, keys_onoff=Alter_info::ENABLE, fk_key_info=0x7fffdc1bd880, 
    fk_key_count=0x7fffdc1bd874, existing_fk_info=0x0, existing_fk_count=0, existing_fk_table=0x0, fk_max_generated_name_number=0, table_def=0x7fffdc1bd888, post_ddl_ht=0x7fffdc1bdbd8) at /home/glorch/dev/8.0/mysql/sql/sql_table.cc:7906
#14 0x00005555581957a5 in mysql_create_table_no_lock (thd=0x7fff34000e40, db=0x7fff34033e40 "TEST", table_name=0x7fff34030720 "t2", create_info=0x7fffdc1bde30, alter_info=0x7fffdc1bdf30, select_field_count=0, find_parent_keys=true, is_trans=0x7fffdc1bdbd0, 
    post_ddl_ht=0x7fffdc1bdbd8) at /home/glorch/dev/8.0/mysql/sql/sql_table.cc:7988
#15 0x0000555558198d87 in mysql_create_table (thd=0x7fff34000e40, create_table=0x7fff340338a8, create_info=0x7fffdc1bde30, alter_info=0x7fffdc1bdf30) at /home/glorch/dev/8.0/mysql/sql/sql_table.cc:8754
#16 0x0000555558694730 in Sql_cmd_create_table::execute (this=0x7fff3416c9f8, thd=0x7fff34000e40) at /home/glorch/dev/8.0/mysql/sql/sql_cmd_ddl_table.cc:319
#17 0x00005555580e7823 in mysql_execute_command (thd=0x7fff34000e40, first_level=true) at /home/glorch/dev/8.0/mysql/sql/sql_parse.cc:3325
#18 0x00005555580ed3b6 in mysql_parse (thd=0x7fff34000e40, parser_state=0x7fffdc1bf360, force_primary_storage_engine=false) at /home/glorch/dev/8.0/mysql/sql/sql_parse.cc:5041
#19 0x00005555580e2d41 in dispatch_command (thd=0x7fff34000e40, com_data=0x7fffdc1bfcd0, command=COM_QUERY) at /home/glorch/dev/8.0/mysql/sql/sql_parse.cc:1687
#20 0x00005555580e13c3 in do_command (thd=0x7fff34000e40) at /home/glorch/dev/8.0/mysql/sql/sql_parse.cc:1260
#21 0x000055555828d75e in handle_connection (arg=0x55555c31df20) at /home/glorch/dev/8.0/mysql/sql/conn_handler/connection_handler_per_thread.cc:308
#22 0x0000555559cb597a in pfs_spawn_thread (arg=0x55555c34d990) at /home/glorch/dev/8.0/mysql/storage/perfschema/pfs.cc:2836
#23 0x00007ffff7bbd6db in start_thread (arg=0x7fffdc1c0700) at pthread_create.c:463
#24 0x00007ffff62ae88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

How to repeat:
mysql> SELECT @@VERSION;
+--------------+
| @@VERSION    |
+--------------+
| 8.0.13-debug |
+--------------+
1 row in set (0.00 sec)

mysql> CREATE DATABASE TEST; USE TEST;
Query OK, 1 row affected (0.04 sec)

Database changed
mysql> CREATE TABLE `t2` (
    ->   `col1` bigint(20) NOT NULL,
    ->   `col2` varbinary(64) NOT NULL,
    ->   `col3` varbinary(256) NOT NULL,
    ->   `col4` bigint(20) NOT NULL,
    ->   `col5` mediumblob NOT NULL,
    ->   PRIMARY KEY (`col1`,`col2`,`col3`) COMMENT 'custom_p0_cfname=test_cf0;custom_p1_cfname=test_cf1',
    ->   UNIQUE KEY (`col2`, `col4`) COMMENT 'custom_p5_cfname=unique_test_cf5'
    -> ) ENGINE=INNODB DEFAULT CHARSET=latin1
    ->   PARTITION BY LIST COLUMNS (`col2`) (
    ->     PARTITION custom_p0 VALUES IN (0x12345),
    ->     PARTITION custom_p1 VALUES IN (0x23456),
    ->     PARTITION custom_p2 VALUES IN (0x34567),
    ->     PARTITION custom_p3 VALUES IN (0x45678),
    ->     PARTITION custom_p4 VALUES IN (0x56789),
    ->     PARTITION custom_p5 VALUES IN (0x6789A),
    ->     PARTITION custom_p6 VALUES IN (0x789AB),
    ->     PARTITION custom_p7 VALUES IN (0x89ABC)
    -> );
[22 Oct 2018 22:13] MySQL Verification Team
Thank you for the bug report. Repeatable with released version8.0.13-debug but not anymore with most recent source server then somewhat already fixed on source.

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.13-debug MySQL Community Server - GPL - Debug

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT @@VERSION;
+--------------+
| @@VERSION    |
+--------------+
| 8.0.13-debug |
+--------------+
1 row in set (0,00 sec)

mysql> CREATE DATABASE TEST; USE TEST;

Database changed
mysql> CREATE TABLE `t2` (
    -> `col1` bigint(20) NOT NULL,
    -> `col2` varbinary(64) NOT NULL,
    -> `col3` varbinary(256) NOT NULL,
    -> `col4` bigint(20) NOT NULL,
    -> `col5` mediumblob NOT NULL,
    -> PRIMARY KEY (`col1`,`col2`,`col3`) COMMENT 'custom_p0_cfname=test_cf0;custom_p1_cfname=test_cf1',
    -> UNIQUE KEY (`col2`, `col4`) COMMENT 'custom_p5_cfname=unique_test_cf5'
    -> ) ENGINE=INNODB DEFAULT CHARSET=latin1
    -> PARTITION BY LIST COLUMNS (`col2`) (
    -> PARTITION custom_p0 VALUES IN (0x12345),
    -> PARTITION custom_p1 VALUES IN (0x23456),
    -> PARTITION custom_p2 VALUES IN (0x34567),
    -> PARTITION custom_p3 VALUES IN (0x45678),
    -> PARTITION custom_p4 VALUES IN (0x56789),
    -> PARTITION custom_p5 VALUES IN (0x6789A),
    -> PARTITION custom_p6 VALUES IN (0x789AB),
    -> PARTITION custom_p7 VALUES IN (0x89ABC)
    -> );
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
*******************************************************************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.14-debug Source distribution BUILD: 2018-OCT-04

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql 8.0 > drop database test;
Query OK, 1 row affected (1,33 sec)

mysql 8.0 > SELECT @@VERSION;
+--------------+
| @@VERSION    |
+--------------+
| 8.0.14-debug |
+--------------+
1 row in set (0,00 sec)

mysql 8.0 > CREATE DATABASE TEST; USE TEST;
Database changed
mysql 8.0 > CREATE TABLE `t2` (
    -> `col1` bigint(20) NOT NULL,
    -> `col2` varbinary(64) NOT NULL,
    -> `col3` varbinary(256) NOT NULL,
    -> `col4` bigint(20) NOT NULL,
    -> `col5` mediumblob NOT NULL,
    -> PRIMARY KEY (`col1`,`col2`,`col3`) COMMENT 'custom_p0_cfname=test_cf0;custom_p1_cfname=test_cf1',
    -> UNIQUE KEY (`col2`, `col4`) COMMENT 'custom_p5_cfname=unique_test_cf5'
    -> ) ENGINE=INNODB DEFAULT CHARSET=latin1
    -> PARTITION BY LIST COLUMNS (`col2`) (
    -> PARTITION custom_p0 VALUES IN (0x12345),
    -> PARTITION custom_p1 VALUES IN (0x23456),
    -> PARTITION custom_p2 VALUES IN (0x34567),
    -> PARTITION custom_p3 VALUES IN (0x45678),
    -> PARTITION custom_p4 VALUES IN (0x56789),
    -> PARTITION custom_p5 VALUES IN (0x6789A),
    -> PARTITION custom_p6 VALUES IN (0x789AB),
    -> PARTITION custom_p7 VALUES IN (0x89ABC)
    -> );
Query OK, 0 rows affected (14,55 sec)

mysql 8.0 > SHOW VARIABLES LIKE "%VERSION%";
+--------------------------+----------------------------------------+
| Variable_name            | Value                                  |
+--------------------------+----------------------------------------+
| immediate_server_version | 999999                                 |
| innodb_version           | 8.0.14                                 |
| original_server_version  | 999999                                 |
| protocol_version         | 10                                     |
| slave_type_conversions   |                                        |
| tls_version              | TLSv1,TLSv1.1,TLSv1.2                  |
| version                  | 8.0.14-debug                           |
| version_comment          | Source distribution BUILD: 2018-OCT-04 |
| version_compile_machine  | x86_64                                 |
| version_compile_os       | Linux                                  |
| version_compile_zlib     | 1.2.11                                 |
+--------------------------+----------------------------------------+
11 rows in set (0,06 sec)

mysql 8.0 >