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

Assertion `0' failed -or- Assertion `item->maybe_null()' failed - both in virtual void Type_handler_string_result::make_sort_key_part - on UPDATE ... ORDER BY ... LIMIT 0

    XMLWordPrintable

Details

    Description

      The stack is almost similar to MDEV-28686, but this test case also crashes the 10.3 build.

      CREATE TABLE t(c CHAR (1)KEY ) ENGINE=MYISAM;
      INSERT INTO t VALUES(3);
      UPDATE t SET c= 1 ORDER BY(SELECT c LIMIT 0);
      

      Leads to:

      10.9.2 bfdc4ff22ecf626eb46479e1a0dc1049d61a8d78 (Debug)

      mysqld: /test/10.9_dbg/sql/filesort.cc:1143: virtual void Type_handler_string_result::make_sort_key_part(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*) const: Assertion `0' failed.
      

      10.9.2 bfdc4ff22ecf626eb46479e1a0dc1049d61a8d78 (Debug)

      Core was generated by `/test/MD090822-mariadb-10.9.2-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 0x1535019c6700 (LWP 1158032))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000015351a367859 in __GI_abort () at abort.c:79
      #2  0x000015351a367729 in __assert_fail_base (fmt=0x15351a4fd588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x56214f1e94f8 "0", file=0x56214f1c8760 "/test/10.9_dbg/sql/filesort.cc", line=1143, function=<optimized out>) at assert.c:92
      #3  0x000015351a378fd6 in __GI___assert_fail (assertion=assertion@entry=0x56214f1e94f8 "0", file=file@entry=0x56214f1c8760 "/test/10.9_dbg/sql/filesort.cc", line=line@entry=1143, function=function@entry=0x56214f1c89f8 "virtual void Type_handler_string_result::make_sort_key_part(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*) const") at assert.c:101
      #4  0x000056214e7256d2 in Type_handler_string_result::make_sort_key_part (this=<optimized out>, to=0x1534cc06cdf8 '\245' <repeats 200 times>..., item=0x1534cc015448, sort_field=0x1534cc016560, param=<optimized out>) at /test/10.9_dbg/sql/filesort.cc:1143
      #5  0x000056214e7277ba in make_sortkey (to=0x1534cc06cdf8 '\245' <repeats 200 times>..., param=0x1535019c40d0) at /test/10.9_dbg/sql/filesort.cc:3041
      #6  make_sortkey (param=param@entry=0x1535019c40d0, to=0x1534cc06cdf8 '\245' <repeats 200 times>..., ref_pos=ref_pos@entry=0x1534cc025af0 "3", '\245' <repeats 15 times>, '\217' <repeats 184 times>..., using_packed_sortkeys=using_packed_sortkeys@entry=false) at /test/10.9_dbg/sql/filesort.cc:1363
      #7  0x000056214e72aaf5 in find_all_keys (found_rows=0x1534cc06cd60, pq=0x0, tempfile=0x1535019c4190, buffpek_pointers=0x1535019c4300, fs_info=0x1534cc06cb70, select=0x0, param=0x1535019c40d0, thd=0x1534cc000db8) at /test/10.9_dbg/sql/filesort.cc:978
      #8  filesort (thd=thd@entry=0x1534cc000db8, table=table@entry=0x1534cc025458, filesort=filesort@entry=0x1535019c49f0, tracker=0x1534cc0164d8, join=join@entry=0x0, first_table_bit=first_table_bit@entry=0) at /test/10.9_dbg/sql/filesort.cc:357
      #9  0x000056214e550e29 in mysql_update (thd=thd@entry=0x1534cc000db8, table_list=<optimized out>, fields=@0x1534cc005a78: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1534cc0145c0, last = 0x1534cc0145c0, elements = 1}, <No data fields>}, values=@0x1534cc005ea8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1534cc0145d0, last = 0x1534cc0145d0, elements = 1}, <No data fields>}, conds=<optimized out>, order_num=<optimized out>, order=0x1534cc015628, limit=18446744073709551615, ignore=<optimized out>, found_return=<optimized out>, updated_return=<optimized out>) at /test/10.9_dbg/sql/sql_update.cc:813
      #10 0x000056214e44e6f3 in mysql_execute_command (thd=thd@entry=0x1534cc000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_limit.h:85
      #11 0x000056214e43b23e in mysql_parse (thd=thd@entry=0x1534cc000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1535019c5330) at /test/10.9_dbg/sql/sql_parse.cc:8037
      #12 0x000056214e44880c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1534cc000db8, packet=packet@entry=0x1534cc00b6c9 "UPDATE t SET c= 1 ORDER BY(SELECT c LIMIT 0)", packet_length=packet_length@entry=44, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1364
      #13 0x000056214e44af14 in do_command (thd=0x1534cc000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1407
      #14 0x000056214e5aab68 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x562151418848, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418
      #15 0x000056214e5ab071 in handle_one_connection (arg=0x562151418848) at /test/10.9_dbg/sql/sql_connect.cc:1312
      #16 0x000015351a878609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #17 0x000015351a464133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.36 (dbg), 10.4.26 (dbg), 10.5.17 (dbg), 10.6.9 (dbg), 10.7.5 (dbg), 10.8.4 (dbg), 10.9.2 (dbg), 10.10.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.3.36 (opt), 10.4.26 (opt), 10.5.17 (opt), 10.6.9 (opt), 10.7.5 (opt), 10.8.4 (opt), 10.9.2 (opt), 10.10.0 (opt)

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.