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

Assertion `table->insert_values' failed in write_record upon REPLACE into a view with underlying versioned table

    XMLWordPrintable

Details

    Description

      Note: the assertion failure is probably not specific to 10.3, as I've seen it happen on 10.2; but for this particular scenario versioning is somehow important, I can't get rid of it.

      CREATE OR REPLACE TABLE t1 (a INT, b INT, PRIMARY KEY (a), UNIQUE(b)) WITH SYSTEM VERSIONING;
      INSERT IGNORE INTO t1 VALUES (1,1),(2,2);
       
      CREATE OR REPLACE TABLE t2 (c INT);
       
      CREATE OR REPLACE VIEW v AS SELECT t1.* FROM t1 JOIN t2;
      REPLACE INTO v (a, b) SELECT a, b FROM t1;
       
      # Cleanup
      DROP VIEW v;
      DROP TABLE t1, t2;
      

      10.3 560743198604c

      mysqld: /data/src/10.3/sql/sql_insert.cc:1974: int write_record(THD*, TABLE*, COPY_INFO*): Assertion `table->insert_values' failed.
      180417 21:08:08 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f8fb93cbee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000559213f4b954 in write_record (thd=0x7f8f98000b00, table=0x7f8f9800e260, info=0x7f8f9801ab58) at /data/src/10.3/sql/sql_insert.cc:1974
      #9  0x0000559213f50e3d in select_insert::send_data (this=0x7f8f9801ab18, values=...) at /data/src/10.3/sql/sql_insert.cc:3853
      #10 0x0000559213ffa76e in end_send (join=0x7f8f9803a348, join_tab=0x7f8f9803c898, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:20364
      #11 0x0000559213ff80d3 in evaluate_join_record (join=0x7f8f9803a348, join_tab=0x7f8f9803c4e8, error=0) at /data/src/10.3/sql/sql_select.cc:19415
      #12 0x000055921400cd5e in AGGR_OP::end_send (this=0x7f8f9803cf60) at /data/src/10.3/sql/sql_select.cc:27217
      #13 0x0000559213ff748a in sub_select_postjoin_aggr (join=0x7f8f9803a348, join_tab=0x7f8f9803c4e8, end_of_records=true) at /data/src/10.3/sql/sql_select.cc:18910
      #14 0x0000559213ff77bc in sub_select (join=0x7f8f9803a348, join_tab=0x7f8f9803c138, end_of_records=true) at /data/src/10.3/sql/sql_select.cc:19146
      #15 0x0000559213ff6fa2 in do_select (join=0x7f8f9803a348, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:18737
      #16 0x0000559213fcff9c in JOIN::exec_inner (this=0x7f8f9803a348) at /data/src/10.3/sql/sql_select.cc:3953
      #17 0x0000559213fcf434 in JOIN::exec (this=0x7f8f9803a348) at /data/src/10.3/sql/sql_select.cc:3747
      #18 0x0000559213fd0675 in mysql_select (thd=0x7f8f98000b00, tables=0x7f8f98015988, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489925888, result=0x7f8f9801ab18, unit=0x7f8f98004948, select_lex=0x7f8f980050c0) at /data/src/10.3/sql/sql_select.cc:4152
      #19 0x0000559213fc2bcf in handle_select (thd=0x7f8f98000b00, lex=0x7f8f98004880, result=0x7f8f9801ab18, setup_tables_done_option=1073741824) at /data/src/10.3/sql/sql_select.cc:382
      #20 0x0000559213f87b51 in mysql_execute_command (thd=0x7f8f98000b00) at /data/src/10.3/sql/sql_parse.cc:4831
      #21 0x0000559213f91ad8 in mysql_parse (thd=0x7f8f98000b00, rawbuf=0x7f8f98014d58 "REPLACE INTO v (a, b) SELECT a, b FROM t1", length=41, parser_state=0x7f8faf54b5d0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8001
      #22 0x0000559213f7f2bb in dispatch_command (command=COM_QUERY, thd=0x7f8f98000b00, packet=0x7f8f9808ff81 "REPLACE INTO v (a, b) SELECT a, b FROM t1", packet_length=41, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1846
      #23 0x0000559213f7dcfa in do_command (thd=0x7f8f98000b00) at /data/src/10.3/sql/sql_parse.cc:1391
      #24 0x00005592140e078b in do_handle_one_connection (connect=0x559216c50260) at /data/src/10.3/sql/sql_connect.cc:1402
      #25 0x00005592140e0518 in handle_one_connection (arg=0x559216c50260) at /data/src/10.3/sql/sql_connect.cc:1308
      #26 0x0000559214563b43 in pfs_spawn_thread (arg=0x559216d126d0) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #27 0x00007f8fbb0a2494 in start_thread (arg=0x7f8faf54c700) at pthread_create.c:333
      #28 0x00007f8fb948893f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.