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

Assertion `old_part_id == m_last_part' failed in ha_partition::update_row on UPDATE

    XMLWordPrintable

    Details

      Description

      Possibly related to MDEV-22413 and MDEV-25364 but different versions than the latter and 10.2 does not produce any warnings (except on the alter). Also, this bug is InnoDB only. Not sporadic.

      SET sql_mode='';
      CREATE TABLE t (c INT) ENGINE=InnoDB PARTITION BY KEY(c) PARTITIONS 2;
      INSERT INTO t() VALUES();
      ALTER TABLE t MODIFY c INT NOT NULL;  # 1265 Data truncated for column 'c' at row 1
      UPDATE t SET c=-1 LIMIT 2;
      

      Leads to:

      10.8.0 ccdf5711a8fff0cd610a91fdcf37c8ff1182878c (Debug)

      mysqld: /test/10.8_dbg/sql/ha_partition.cc:4545: virtual int ha_partition::update_row(const uchar*, const uchar*): Assertion `old_part_id == m_last_part' failed.
      

      10.8.0 ccdf5711a8fff0cd610a91fdcf37c8ff1182878c (Debug)

      Core was generated by `/test/MD121221-mariadb-10.8.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x153815817700 (LWP 2054107))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x00001538344a1859 in __GI_abort () at abort.c:79
      #2  0x00001538344a1729 in __assert_fail_base (fmt=0x153834637588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55e17cfcceb9 "old_part_id == m_last_part", file=0x55e17cfc8460 "/test/10.8_dbg/sql/ha_partition.cc", line=4545, function=<optimized out>) at assert.c:92
      #3  0x00001538344b2f36 in __GI___assert_fail (assertion=assertion@entry=0x55e17cfcceb9 "old_part_id == m_last_part", file=file@entry=0x55e17cfc8460 "/test/10.8_dbg/sql/ha_partition.cc", line=line@entry=4545, function=function@entry=0x55e17cfcb7c8 "virtual int ha_partition::update_row(const uchar*, const uchar*)") at assert.c:101
      #4  0x000055e17c6e7423 in ha_partition::update_row (this=0x1537a802c280, old_data=0x1537a80aaea8 "\377", new_data=0x1537a80aaea0 "\377\377\377\377\377\245\245\245\377") at /test/10.8_dbg/sql/ha_partition.cc:4545
      #5  0x000055e17c408db3 in handler::ha_update_row (this=0x1537a802c280, old_data=0x1537a80aaea8 "\377", new_data=0x1537a80aaea0 "\377\377\377\377\377\245\245\245\377") at /test/10.8_dbg/sql/handler.cc:7569
      #6  0x000055e17c213304 in mysql_update (thd=thd@entry=0x1537a8000db8, table_list=<optimized out>, fields=@0x1537a8005c58: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1537a8014740, last = 0x1537a8014740, elements = 1}, <No data fields>}, values=@0x1537a8006090: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1537a8014750, last = 0x1537a8014750, elements = 1}, <No data fields>}, conds=<optimized out>, order_num=<optimized out>, order=<optimized out>, limit=2, ignore=<optimized out>, found_return=<optimized out>, updated_return=<optimized out>) at /test/10.8_dbg/sql/sql_update.cc:1087
      #7  0x000055e17c0f8e7c in mysql_execute_command (thd=thd@entry=0x1537a8000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.8_dbg/sql/sql_limit.h:83
      #8  0x000055e17c0e3e0f in mysql_parse (thd=thd@entry=0x1537a8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x153815816400) at /test/10.8_dbg/sql/sql_parse.cc:8028
      #9  0x000055e17c0f2aab in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1537a8000db8, packet=packet@entry=0x1537a800b879 "UPDATE t SET c=-1 LIMIT 2", packet_length=packet_length@entry=25, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_class.h:1360
      #10 0x000055e17c0f5eea in do_command (thd=0x1537a8000db8, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_parse.cc:1402
      #11 0x000055e17c26f89c in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55e17e7d6a18, put_in_cache=put_in_cache@entry=true) at /test/10.8_dbg/sql/sql_connect.cc:1418
      #12 0x000055e17c26fea1 in handle_one_connection (arg=arg@entry=0x55e17e7d6a18) at /test/10.8_dbg/sql/sql_connect.cc:1312
      #13 0x000055e17c6f1442 in pfs_spawn_thread (arg=0x55e17e6e89b8) at /test/10.8_dbg/storage/perfschema/pfs.cc:2201
      #14 0x00001538349b0609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #15 0x000015383459e293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.33 (dbg), 10.4.23 (dbg), 10.5.14 (dbg), 10.6.6 (dbg), 10.7.2 (dbg), 10.8.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.42 (dbg), 10.2.42 (opt), 10.3.33 (opt), 10.4.23 (opt), 10.5.14 (opt), 10.6.6 (opt), 10.7.2 (opt), 10.8.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.36 (dbg), 5.7.36 (opt), 8.0.27 (dbg), 8.0.27 (opt)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nayuta-yanagisawa Nayuta Yanagisawa
              Reporter:
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration

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