Debugging where does the difference come from, I end up here
(gdb) wher
#0 THD::really_abort_on_warning (this=0x7fffe9416070) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_class.h:3559
#1 0x0000555555bd1b58 in THD::raise_condition (this=0x7fffe9416070, sql_errno=1071, sqlstate=0x555556a26f9b "42000", level=Sql_condition::WARN_LEVEL_WARN, msg=0x7ffff7efedf0 "Specified key was too long; max key length is 2048 bytes") at /home/psergey/dev-git/10.2-mariarocks/sql/sql_class.cc:1250
#2 0x0000555555beef2d in push_warning (thd=0x7fffe9416070, level=Sql_condition::WARN_LEVEL_WARN, code=1071, msg=0x7ffff7efedf0 "Specified key was too long; max key length is 2048 bytes") at /home/psergey/dev-git/10.2-mariarocks/sql/sql_error.cc:753
#3 0x0000555555bef103 in push_warning_printf (thd=0x7fffe9416070, level=Sql_condition::WARN_LEVEL_WARN, code=1071, format=0x7ffff4dadb68 "Specified key was too long; max key length is %d bytes") at /home/psergey/dev-git/10.2-mariarocks/sql/sql_error.cc:788
#4 0x0000555555cdb237 in mysql_prepare_create_table (thd=0x7fffe9416070, create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270, db_options=0x7ffff7eff6ec, file=0x7fffe9461230, key_info_buffer=0x7ffff7f00cb0, key_count=0x7ffff7f00ca4, create_table_mode=0) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:3995
#5 0x0000555555cdd175 in mysql_create_frm_image (thd=0x7fffe9416070, db=0x7fffe94607f8 "test", table_name=0x7fffe94601b8 "t1", create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270, create_table_mode=0, key_info=0x7ffff7f00cb0, key_count=0x7ffff7f00ca4, frm=0x7ffff7f00cc0) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:4673
#7 0x0000555555cde1da in mysql_create_table_no_lock (thd=0x7fffe9416070, db=0x7fffe94607f8 "test", table_name=0x7fffe94601b8 "t1", create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270, is_trans=0x7ffff7f00f3e, create_table_mode=0) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:5030
#8 0x0000555555cde453 in mysql_create_table (thd=0x7fffe9416070, create_table=0x7fffe94601f0, create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:5093
#9 0x0000555555c1b3bd in mysql_execute_command (thd=0x7fffe9416070) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_parse.cc:3872
#10 0x0000555555c27df9 in mysql_parse (thd=0x7fffe9416070, rawbuf=0x7fffe9460088 "create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(2255))) engine=rocksdb", length=92, parser_state=0x7ffff7f01c20, is_com_multi=false, is_next_command=false) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_parse.cc:7790
#11 0x0000555555c15b8d in dispatch_command (command=COM_QUERY, thd=0x7fffe9416070, packet=0x7fffe9454071 "create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(2255))) engine=rocksdb", packet_length=92, is_com_multi=false, is_next_command=false) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_parse.cc:1805
MariaDB has thd->abort_on_warning=false
facebook/mysql-5.6 has thd->abort_on_warning=true
Looking where thd->abort_on_warning becomes true, I find this in mysql_create_table():
/* We can abort create table for any table type */
BUG#11747847 - 34280: Create table fails if in NO_ZERO_DATE SQL mode.
Sergei Petrunia
added a comment - - edited Debugging where does the difference come from, I end up here
(gdb) wher
#0 THD::really_abort_on_warning (this=0x7fffe9416070) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_class.h:3559
#1 0x0000555555bd1b58 in THD::raise_condition (this=0x7fffe9416070, sql_errno=1071, sqlstate=0x555556a26f9b "42000", level=Sql_condition::WARN_LEVEL_WARN, msg=0x7ffff7efedf0 "Specified key was too long; max key length is 2048 bytes") at /home/psergey/dev-git/10.2-mariarocks/sql/sql_class.cc:1250
#2 0x0000555555beef2d in push_warning (thd=0x7fffe9416070, level=Sql_condition::WARN_LEVEL_WARN, code=1071, msg=0x7ffff7efedf0 "Specified key was too long; max key length is 2048 bytes") at /home/psergey/dev-git/10.2-mariarocks/sql/sql_error.cc:753
#3 0x0000555555bef103 in push_warning_printf (thd=0x7fffe9416070, level=Sql_condition::WARN_LEVEL_WARN, code=1071, format=0x7ffff4dadb68 "Specified key was too long; max key length is %d bytes") at /home/psergey/dev-git/10.2-mariarocks/sql/sql_error.cc:788
#4 0x0000555555cdb237 in mysql_prepare_create_table (thd=0x7fffe9416070, create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270, db_options=0x7ffff7eff6ec, file=0x7fffe9461230, key_info_buffer=0x7ffff7f00cb0, key_count=0x7ffff7f00ca4, create_table_mode=0) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:3995
#5 0x0000555555cdd175 in mysql_create_frm_image (thd=0x7fffe9416070, db=0x7fffe94607f8 "test", table_name=0x7fffe94601b8 "t1", create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270, create_table_mode=0, key_info=0x7ffff7f00cb0, key_count=0x7ffff7f00ca4, frm=0x7ffff7f00cc0) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:4673
#6 0x0000555555cddb6c in create_table_impl (thd=0x7fffe9416070, orig_db=0x7fffe94607f8 "test", orig_table_name=0x7fffe94601b8 "t1", db=0x7fffe94607f8 "test", table_name=0x7fffe94601b8 "t1", path=0x7ffff7f00cd0 "./test/t1", options=..., create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270, create_table_mode=0, is_trans=0x7ffff7f00f3e, key_info=0x7ffff7f00cb0, key_count=0x7ffff7f00ca4, frm=0x7ffff7f00cc0) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:4915
#7 0x0000555555cde1da in mysql_create_table_no_lock (thd=0x7fffe9416070, db=0x7fffe94607f8 "test", table_name=0x7fffe94601b8 "t1", create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270, is_trans=0x7ffff7f00f3e, create_table_mode=0) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:5030
#8 0x0000555555cde453 in mysql_create_table (thd=0x7fffe9416070, create_table=0x7fffe94601f0, create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:5093
#9 0x0000555555c1b3bd in mysql_execute_command (thd=0x7fffe9416070) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_parse.cc:3872
#10 0x0000555555c27df9 in mysql_parse (thd=0x7fffe9416070, rawbuf=0x7fffe9460088 "create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(2255))) engine=rocksdb", length=92, parser_state=0x7ffff7f01c20, is_com_multi=false, is_next_command=false) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_parse.cc:7790
#11 0x0000555555c15b8d in dispatch_command (command=COM_QUERY, thd=0x7fffe9416070, packet=0x7fffe9454071 "create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(2255))) engine=rocksdb", packet_length=92, is_com_multi=false, is_next_command=false) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_parse.cc:1805
MariaDB has thd->abort_on_warning=false
facebook/mysql-5.6 has thd->abort_on_warning=true
Looking where thd->abort_on_warning becomes true, I find this in mysql_create_table():
/* We can abort create table for any table type */
thd->abort_on_warning= thd->is_strict_mode();
This code comes from https://github.com/facebook/mysql-5.6/commit/0780e1a69d002daf4cc0152cd010ceb8868345ca
BUG#11747847 - 34280: Create table fails if in NO_ZERO_DATE SQL mode.
Debugging where does the difference come from, I end up here
(gdb) wher
#0 THD::really_abort_on_warning (this=0x7fffe9416070) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_class.h:3559
#1 0x0000555555bd1b58 in THD::raise_condition (this=0x7fffe9416070, sql_errno=1071, sqlstate=0x555556a26f9b "42000", level=Sql_condition::WARN_LEVEL_WARN, msg=0x7ffff7efedf0 "Specified key was too long; max key length is 2048 bytes") at /home/psergey/dev-git/10.2-mariarocks/sql/sql_class.cc:1250
#2 0x0000555555beef2d in push_warning (thd=0x7fffe9416070, level=Sql_condition::WARN_LEVEL_WARN, code=1071, msg=0x7ffff7efedf0 "Specified key was too long; max key length is 2048 bytes") at /home/psergey/dev-git/10.2-mariarocks/sql/sql_error.cc:753
#3 0x0000555555bef103 in push_warning_printf (thd=0x7fffe9416070, level=Sql_condition::WARN_LEVEL_WARN, code=1071, format=0x7ffff4dadb68 "Specified key was too long; max key length is %d bytes") at /home/psergey/dev-git/10.2-mariarocks/sql/sql_error.cc:788
#4 0x0000555555cdb237 in mysql_prepare_create_table (thd=0x7fffe9416070, create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270, db_options=0x7ffff7eff6ec, file=0x7fffe9461230, key_info_buffer=0x7ffff7f00cb0, key_count=0x7ffff7f00ca4, create_table_mode=0) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:3995
#5 0x0000555555cdd175 in mysql_create_frm_image (thd=0x7fffe9416070, db=0x7fffe94607f8 "test", table_name=0x7fffe94601b8 "t1", create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270, create_table_mode=0, key_info=0x7ffff7f00cb0, key_count=0x7ffff7f00ca4, frm=0x7ffff7f00cc0) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:4673
#6 0x0000555555cddb6c in create_table_impl (thd=0x7fffe9416070, orig_db=0x7fffe94607f8 "test", orig_table_name=0x7fffe94601b8 "t1", db=0x7fffe94607f8 "test", table_name=0x7fffe94601b8 "t1", path=0x7ffff7f00cd0 "./test/t1", options=..., create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270, create_table_mode=0, is_trans=0x7ffff7f00f3e, key_info=0x7ffff7f00cb0, key_count=0x7ffff7f00ca4, frm=0x7ffff7f00cc0) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:4915
#7 0x0000555555cde1da in mysql_create_table_no_lock (thd=0x7fffe9416070, db=0x7fffe94607f8 "test", table_name=0x7fffe94601b8 "t1", create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270, is_trans=0x7ffff7f00f3e, create_table_mode=0) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:5030
#8 0x0000555555cde453 in mysql_create_table (thd=0x7fffe9416070, create_table=0x7fffe94601f0, create_info=0x7ffff7f01320, alter_info=0x7ffff7f01270) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_table.cc:5093
#9 0x0000555555c1b3bd in mysql_execute_command (thd=0x7fffe9416070) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_parse.cc:3872
#10 0x0000555555c27df9 in mysql_parse (thd=0x7fffe9416070, rawbuf=0x7fffe9460088 "create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(2255))) engine=rocksdb", length=92, parser_state=0x7ffff7f01c20, is_com_multi=false, is_next_command=false) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_parse.cc:7790
#11 0x0000555555c15b8d in dispatch_command (command=COM_QUERY, thd=0x7fffe9416070, packet=0x7fffe9454071 "create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(2255))) engine=rocksdb", packet_length=92, is_com_multi=false, is_next_command=false) at /home/psergey/dev-git/10.2-mariarocks/sql/sql_parse.cc:1805
Looking where thd->abort_on_warning becomes true, I find this in mysql_create_table():
/* We can abort create table for any table type */
thd->abort_on_warning= thd->is_strict_mode();
This code comes from https://github.com/facebook/mysql-5.6/commit/0780e1a69d002daf4cc0152cd010ceb8868345ca
BUG#11747847 - 34280: Create table fails if in NO_ZERO_DATE SQL mode.