Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-16240

Assertion `0' failed in row_sel_convert_mysql_key_to_innobase

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      set sql_mode='';
       
      CREATE TABLE `DD` ( 
      	`col_varchar_nokey` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), 
          `col_varchar_key` datetime DEFAULT '2000-01-01 00:00:00' ON UPDATE current_timestamp(), 
          `col_int_nokey` TIMESTAMP NULL DEFAULT '2000-01-01 00:00:00', 
          `pk` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 
          `col_int_key` datetime DEFAULT current_timestamp(), 
                         PRIMARY KEY (`pk`), 
                         UNIQUE KEY `col_varchar_key` (`col_varchar_key`),
                         KEY `col_int_key` (`col_int_key`)
          ) ENGINE=InnoDB;
       
      INSERT INTO `DD` VALUES ('2018-05-18 15:08:07','2018-05-18 17:08:07','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00'),('0000-00-00 00:00:00','0000-00-00 00:00:00','1999-12-31 23:00:00','2002-07-03 23:04:40','0000-00-00 00:00:00');
       
      CREATE VIEW `view_DD` AS 
      SELECT `DD`.`pk` AS `pk`,
             `DD`.`col_int_nokey` AS `col_int_nokey`,
             `DD`.`col_int_key` AS `col_int_key`,
             `DD`.`col_varchar_key` AS `col_varchar_key`,
             `DD`.`col_varchar_nokey` AS `col_varchar_nokey`
      FROM `DD`;
       
      CREATE TABLE `C` (
        `col_varchar_nokey` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
        `col_int_nokey` timestamp NULL DEFAULT NULL,
        `col_varchar_key` timestamp NULL DEFAULT '1999-12-31 23:00:00' ON UPDATE current_timestamp(),
        `pk` int(11) NOT NULL,
        `col_int_key` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
        PRIMARY KEY (`pk`)
      ) ENGINE=InnoDB;
       
      INSERT INTO `C` VALUES ('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,1,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,3,'2018-05-18 15:08:06'),('0000-00-00 00:00:00','0000-00-00 00:00:00',NULL,1976,'0000-00-00 00:00:00'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2000,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2001,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2002,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2003,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2004,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2005,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2018,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2019,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2024,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','1999-12-31 23:00:00',2025,'2018-05-18 15:08:06'),('0000-00-00 00:00:00',NULL,'2018-05-18 15:08:06',2026,'2018-05-18 15:08:06'),('2018-05-18 17:08:07','0000-00-00 00:00:00','0000-00-00 00:00:00',2027,'0000-00-00 00:00:00');
       
      UPDATE `view_DD` t1, `C` t2
      SET t1.`col_varchar_key` = 6452736 WHERE t1.`col_int_key` = 6272000;
      

       10.2  afe5a51c2df9
      Thread 1 (Thread 0x7f142058c700 (LWP 27097)):
      #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
      #1  0x000055b9f3f8d68d in my_write_core (sig=6) at /home/alice/git/10.2/mysys/stacktrace.c:477
      #2  0x000055b9f382716b in handle_fatal_signal (sig=6) at /home/alice/git/10.2/sql/signal_handler.cc:305
      #3  <signal handler called>
      #4  0x00007f142d948428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
      #5  0x00007f142d94a02a in __GI_abort () at abort.c:89
      #6  0x00007f142d940bd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55b9f41fdc3b "0", file=file@entry=0x55b9f41fd8b0 "/home/alice/git/10.2/storage/innobase/row/row0sel.cc", line=line@entry=2725, function=function@entry=0x55b9f42016e0 <row_sel_convert_mysql_key_to_innobase(dtuple_t*, unsigned char*, unsigned long, dict_index_t*, unsigned char const*, unsigned long, trx_t*)::__PRETTY_FUNCTION__> "void row_sel_convert_mysql_key_to_innobase(dtuple_t*, byte*, ulint, dict_index_t*, const byte*, ulint, trx_t*)") at assert.c:92
      #7  0x00007f142d940c82 in __GI___assert_fail (assertion=0x55b9f41fdc3b "0", file=0x55b9f41fd8b0 "/home/alice/git/10.2/storage/innobase/row/row0sel.cc", line=2725, function=0x55b9f42016e0 <row_sel_convert_mysql_key_to_innobase(dtuple_t*, unsigned char*, unsigned long, dict_index_t*, unsigned char const*, unsigned long, trx_t*)::__PRETTY_FUNCTION__> "void row_sel_convert_mysql_key_to_innobase(dtuple_t*, byte*, ulint, dict_index_t*, const byte*, ulint, trx_t*)") at assert.c:101
      #8  0x000055b9f3cd9d9b in row_sel_convert_mysql_key_to_innobase (tuple=0x7f13d411ce88, buf=0x0, buf_len=0, index=0x7f13d4133a58, key_ptr=0x7f13d4130876 "\245\245\245\245\245\245\245\245\245\245", '\217' <repeats 190 times>..., key_len=5, trx=0x7f14280b0400) at /home/alice/git/10.2/storage/innobase/row/row0sel.cc:2725
      #9  0x000055b9f3b6f136 in ha_innobase::index_read (this=0x7f13d411a9b8, buf=0x7f13d4006638 "\361Z\376\320\067\231\237\345\022\a", key_ptr=0x7f13d4130870 "\200", key_len=5, find_flag=HA_READ_KEY_EXACT) at /home/alice/git/10.2/storage/innobase/handler/ha_innodb.cc:9449
      #10 0x000055b9f3b70817 in ha_innobase::rnd_pos (this=0x7f13d411a9b8, buf=0x7f13d4006638 "\361Z\376\320\067\231\237\345\022\a", pos=0x7f13d4130870 "\200") at /home/alice/git/10.2/storage/innobase/handler/ha_innodb.cc:10029
      #11 0x000055b9f382dcbb in handler::ha_rnd_pos (this=0x7f13d411a9b8, buf=0x7f13d4006638 "\361Z\376\320\067\231\237\345\022\a", pos=0x7f13d4130870 "\200") at /home/alice/git/10.2/sql/handler.cc:2605
      #12 0x000055b9f369f9b1 in prepare_record_for_error_message (error=121, table=0x7f13d41490c0) at /home/alice/git/10.2/sql/sql_update.cc:215
      #13 0x000055b9f36a5917 in multi_update::send_data (this=0x7f13d4017470, not_used_values=...) at /home/alice/git/10.2/sql/sql_update.cc:2165
      #14 0x000055b9f36281f0 in end_send (join=0x7f13d4017538, join_tab=0x7f13d4040ea8, end_of_records=false) at /home/alice/git/10.2/sql/sql_select.cc:19878
      #15 0x000055b9f3625cca in evaluate_join_record (join=0x7f13d4017538, join_tab=0x7f13d4040af8, error=0) at /home/alice/git/10.2/sql/sql_select.cc:18930
      #16 0x000055b9f36255bb in sub_select (join=0x7f13d4017538, join_tab=0x7f13d4040af8, end_of_records=false) at /home/alice/git/10.2/sql/sql_select.cc:18710
      #17 0x000055b9f3625cca in evaluate_join_record (join=0x7f13d4017538, join_tab=0x7f13d4040748, error=0) at /home/alice/git/10.2/sql/sql_select.cc:18930
      #18 0x000055b9f36255bb in sub_select (join=0x7f13d4017538, join_tab=0x7f13d4040748, end_of_records=false) at /home/alice/git/10.2/sql/sql_select.cc:18710
      #19 0x000055b9f3624b56 in do_select (join=0x7f13d4017538, procedure=0x0) at /home/alice/git/10.2/sql/sql_select.cc:18254
      #20 0x000055b9f35ff6e7 in JOIN::exec_inner (this=0x7f13d4017538) at /home/alice/git/10.2/sql/sql_select.cc:3585
      #21 0x000055b9f35feb96 in JOIN::exec (this=0x7f13d4017538) at /home/alice/git/10.2/sql/sql_select.cc:3380
      #22 0x000055b9f35ffd58 in mysql_select (thd=0x7f13d4000b00, tables=0x7f13d40125d8, wild_num=0, fields=..., conds=0x7f13d4013640, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=1342177408, result=0x7f13d4017470, unit=0x7f13d40046a0, select_lex=0x7f13d4004dd8) at /home/alice/git/10.2/sql/sql_select.cc:3780
      #23 0x000055b9f36a392d in mysql_multi_update (thd=0x7f13d4000b00, table_list=0x7f13d40125d8, fields=0x7f13d4004f00, values=0x7f13d40053d0, conds=0x7f13d4013640, options=0, handle_duplicates=DUP_ERROR, ignore=false, unit=0x7f13d40046a0, select_lex=0x7f13d4004dd8, result=0x7f142058a910) at /home/alice/git/10.2/sql/sql_update.cc:1604
      #24 0x000055b9f35b80f0 in mysql_execute_command (thd=0x7f13d4000b00) at /home/alice/git/10.2/sql/sql_parse.cc:4347
      #25 0x000055b9f35c38c9 in mysql_parse (thd=0x7f13d4000b00, rawbuf=0x7f13d4012448 "UPDATE `view_DD` t1, `C` t2\nSET t1.`col_varchar_key` = 6452736 WHERE t1.`col_int_key` = 6272000", length=95, parser_state=0x7f142058b200, is_com_multi=false, is_next_command=false) at /home/alice/git/10.2/sql/sql_parse.cc:7941
      #26 0x000055b9f35b12a0 in dispatch_command (command=COM_QUERY, thd=0x7f13d4000b00, packet=0x7f13d40088a1 "UPDATE `view_DD` t1, `C` t2\nSET t1.`col_varchar_key` = 6452736 WHERE t1.`col_int_key` = 6272000", packet_length=95, is_com_multi=false, is_next_command=false) at /home/alice/git/10.2/sql/sql_parse.cc:1820
      #27 0x000055b9f35afbfc in do_command (thd=0x7f13d4000b00) at /home/alice/git/10.2/sql/sql_parse.cc:1374
      #28 0x000055b9f36febb9 in do_handle_one_connection (connect=0x55b9f69307b0) at /home/alice/git/10.2/sql/sql_connect.cc:1335
      #29 0x000055b9f36fe939 in handle_one_connection (arg=0x55b9f69307b0) at /home/alice/git/10.2/sql/sql_connect.cc:1241
      #30 0x000055b9f3f2adbe in pfs_spawn_thread (arg=0x55b9f6913980) at /home/alice/git/10.2/storage/perfschema/pfs.cc:1862
      #31 0x00007f142e5856ba in start_thread (arg=0x7f142058c700) at pthread_create.c:333
      #32 0x00007f142da1a41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
      

       [Warning] InnoDB: Using a partial-field key prefix in search, index `col_int_key` of table `test`.`DD`. Last data field length 6 bytes, key ptr now exceeds key end by 1 bytes. Key value in the MySQL format:
       len 5; hex 8000000000; asc      ;
      mysqld: /home/alice/git/10.2/storage/innobase/row/row0sel.cc:2725: void row_sel_convert_mysql_key_to_innobase(dtuple_t*, byte*, ulint, dict_index_t*, const byte*, ulint, trx_t*): Assertion `0' failed.
       
      Server version: 10.2.16-MariaDB-debug-log
      Thread pointer: 0x7f13d4000b00
      stack_bottom = 0x7f142058be70 thread_stack 0x49000
      mysys/stacktrace.c:267(my_print_stacktrace)[0x55b9f3f8d59b]
      sql/signal_handler.cc:168(handle_fatal_signal)[0x55b9f3826d43]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f142e58f390]
      linux/raise.c:54(__GI_raise)[0x7f142d948428]
      stdlib/abort.c:91(__GI_abort)[0x7f142d94a02a]
      assert/assert.c:92(__assert_fail_base)[0x7f142d940bd7]
      /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f142d940c82]
      row/row0sel.cc:2728(row_sel_convert_mysql_key_to_innobase(dtuple_t*, unsigned char*, unsigned long, dict_index_t*, unsigned char const*, unsigned long, trx_t*))[0x55b9f3cd9d9b]
      handler/ha_innodb.cc:9449(ha_innobase::index_read(unsigned char*, unsigned char const*, unsigned int, ha_rkey_function))[0x55b9f3b6f136]
      handler/ha_innodb.cc:10029(ha_innobase::rnd_pos(unsigned char*, unsigned char*))[0x55b9f3b70817]
      sql/handler.cc:2605(handler::ha_rnd_pos(unsigned char*, unsigned char*))[0x55b9f382dcbb]
      sql/sql_update.cc:217(prepare_record_for_error_message(int, TABLE*))[0x55b9f369f9b1]
      sql/sql_update.cc:2166(multi_update::send_data(List<Item>&))[0x55b9f36a5917]
      sql/sql_select.cc:19878(end_send(JOIN*, st_join_table*, bool))[0x55b9f36281f0]
      sql/sql_select.cc:18930(evaluate_join_record(JOIN*, st_join_table*, int))[0x55b9f3625cca]
      sql/sql_select.cc:18710(sub_select(JOIN*, st_join_table*, bool))[0x55b9f36255bb]
      sql/sql_select.cc:18930(evaluate_join_record(JOIN*, st_join_table*, int))[0x55b9f3625cca]
      sql/sql_select.cc:18710(sub_select(JOIN*, st_join_table*, bool))[0x55b9f36255bb]
      sql/sql_select.cc:18254(do_select(JOIN*, Procedure*))[0x55b9f3624b56]
      sql/sql_select.cc:3585(JOIN::exec_inner())[0x55b9f35ff6e7]
      sql/sql_select.cc:3381(JOIN::exec())[0x55b9f35feb96]
      sql/sql_select.cc:3782(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x55b9f35ffd58]
      sql/sql_update.cc:1604(mysql_multi_update(THD*, TABLE_LIST*, List<Item>*, List<Item>*, Item*, unsigned long long, enum_duplicates, bool, st_select_lex_unit*, st_select_lex*, multi_update**))[0x55b9f36a392d]
      sql/sql_parse.cc:4347(mysql_execute_command(THD*))[0x55b9f35b80f0]
      sql/sql_parse.cc:7941(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55b9f35c38c9]
      sql/sql_parse.cc:1822(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55b9f35b12a0]
      sql/sql_parse.cc:1374(do_command(THD*))[0x55b9f35afbfc]
      sql/sql_connect.cc:1335(do_handle_one_connection(CONNECT*))[0x55b9f36febb9]
      sql/sql_connect.cc:1242(handle_one_connection)[0x55b9f36fe939]
      perfschema/pfs.cc:1864(pfs_spawn_thread)[0x55b9f3f2adbe]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f142e5856ba]
      x86_64/clone.S:111(clone)[0x7f142da1a41d]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f13d4012448): UPDATE `view_DD` t1, `C` t2 SET t1.`col_varchar_key` = 6452736 WHERE t1.`col_int_key` = 6272000
      Connection ID (thread ID): 9
      Status: NOT_KILLED
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.