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

Assertion `table_share->tmp_table || m_lock_type == 1' failed

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Duplicate
    • 12.3
    • N/A
    • Optimizer - CTE
    • None
    • Can result in hang or crash

    Description

      Server crash seen while testing MDEV-37220

      MariaDB [m]> WITH cte AS ( SELECT a from t1 ) update cte set cte.a=(select a from cte limit 1);
      ERROR 2026 (HY000): TLS/SSL error: unexpected eof while reading

      mariadbd: /home/ppandith/wl-12/sql/handler.cc:8300: int handler::ha_update_row(const uchar*, const uchar*): Assertion `table_share->tmp_table || m_lock_type == 1' failed.
      251205 17:14:06 [ERROR] ./sql/mariadbd got signal 6 ;

      Version used:
      ---------------------
      main branch (12.3.0)
      commit e85bc659188be021897e8578aec42becfbb58c27

      Stack Trace:

      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:89
      #3  my_write_core (sig=6) at /home/ppandith/wl-12/mysys/stacktrace.c:424
      #4  handle_fatal_signal (sig=6) at /home/ppandith/wl-12/sql/signal_handler.cc:298
      #5  <signal handler called>
      #6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
      #7  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
      #8  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      #9  __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #10 __GI_abort () at ./stdlib/abort.c:79
      #11 __assert_fail_base (fmt="%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
          assertion=assertion@entry="table_share->tmp_table || m_lock_type == 1", 
          file=file@entry="/home/ppandith/wl-12/sql/handler.cc", line=line@entry=8300, 
          function=function@entry="int handler::ha_update_row(const uchar*, const uchar*)") at ./assert/assert.c:96
      #12 __assert_fail (assertion="table_share->tmp_table || m_lock_type == 1", file="/home/ppandith/wl-12/sql/handler.cc", line=8300, 
          function="int handler::ha_update_row(const uchar*, const uchar*)") at ./assert/assert.c:105
      #13 handler::ha_update_row (this=, old_data="\375\002", new_data="\375\001") at /home/ppandith/wl-12/sql/handler.cc:8300
      #14 multi_update::do_updates (this=) at /home/ppandith/wl-12/sql/sql_update.cc:2779
      #15 multi_update::send_eof (this=) at /home/ppandith/wl-12/sql/sql_update.cc:2891
      #16 do_select (join=, procedure=) at /home/ppandith/wl-12/sql/sql_select.cc:24103
      #17 JOIN::exec_inner (this=) at /home/ppandith/wl-12/sql/sql_select.cc:5134
      #18 JOIN::exec (this=) at /home/ppandith/wl-12/sql/sql_select.cc:4922
      #19 Sql_cmd_dml::execute_inner (this=, thd=) at /home/ppandith/wl-12/sql/sql_select.cc:34876
      #20 Sql_cmd_update::execute_inner (this=, thd=) at /home/ppandith/wl-12/sql/sql_update.cc:3228
      #21 Sql_cmd_dml::execute (this=, thd=) at /home/ppandith/wl-12/sql/sql_select.cc:34810
      #22 mysql_execute_command (thd=, is_called_from_prepared_stmt=false) at /home/ppandith/wl-12/sql/sql_parse.cc:4400
      #23 mysql_parse (thd=, rawbuf="WITH cte AS (     SELECT a from t1  ) update cte set cte.a=(select a from cte limit 1)", 
          length=86, parser_state=) at /home/ppandith/wl-12/sql/sql_parse.cc:7895
      --Type <RET> for more, q to quit, c to continue without paging--c
      #24 dispatch_command (command=COM_QUERY, thd=, 
          packet="WITH cte AS (     SELECT a from t1  ) update cte set cte.a=(select a from cte limit 1)", packet_length=86, 
          blocking=true) at /home/ppandith/wl-12/sql/sql_parse.cc:1878
      #25 do_command (thd=, blocking=true) at /home/ppandith/wl-12/sql/sql_parse.cc:1417
      #26 do_handle_one_connection (connect=, put_in_cache=true) at /home/ppandith/wl-12/sql/sql_connect.cc:1503
      #27 handle_one_connection (arg=) at /home/ppandith/wl-12/sql/sql_connect.cc:1415
      #28 pfs_spawn_thread (arg=) at /home/ppandith/wl-12/storage/perfschema/pfs.cc:2198
      #29 start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      #30 clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      How to reproduce:

      create table t1(a int)
      insert into t1 values (1) ,(2);
      WITH cte AS (     SELECT a from t1  ) update cte set cte.a=(select a from cte limit 1);
      

      Attachments

        Issue Links

          Activity

            People

              Johnston Rex Johnston
              mariadb-pavithrapandith Pavithra Pandith
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.