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

crash during inserting binary value in Connect table

    Details

      Description

      Mysqld exits without anything in error log when trying to insert binary value in varchar field in CONNECT table, but only if table has primary key.

      This works:

      CREATE TABLE `s` (
        `id` int unsigned NOT NULL,
        `name` varchar(255) default NULL
      ) engine=connect;
      INSERT INTO `s`  VALUES (1,'\0');
      

      The same, except primary key on id field was added:

      CREATE TABLE `s` (
        `id` int unsigned NOT NULL,
        `name` varchar(255) default NULL
      ) engine=connect;
       
      alter table s add primary key (id);
      INSERT INTO `s`  VALUES (1,'\0');
      

      I don't have any message in error log, but coredump has this stack

      Thread 1 (Thread 0x7f6be85f9700 (LWP 6543)):
      #0  0x00007f6bec3ab428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
      #1  0x00007f6bec3ad02a in __GI_abort () at abort.c:89
      #2  0x00007f6bec3ed7ea in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7f6bec5062e0 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
      #3  0x00007f6bec3f5e0a in malloc_printerr (ar_ptr=<optimized out>, ptr=<optimized out>, str=0x7f6bec5063a8 "double free or corruption (fasttop)", action=3) at malloc.c:5004
      #4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3865
      #5  0x00007f6bec3f998c in __GI___libc_free (mem=<optimized out>) at malloc.c:2966
      #6  0x0000000000826ac3 in Regexp_processor_pcre::cleanup (this=0x7f6b7c014448) at /home/buildbot/buildbot/build/sql/item_cmpfunc.h:2084
      #7  Item_func_regex::cleanup (this=0x7f6b7c014388) at /home/buildbot/buildbot/build/sql/item_cmpfunc.h:2107
      #8  0x00000000007e16b0 in Item::cleanup_processor (this=0x196b, arg=0x198f) at /home/buildbot/buildbot/build/sql/item.cc:658
      #9  0x0000000000556aad in Item::cleanup_excluding_const_fields_processor (this=0x196b, arg=0x198f) at /home/buildbot/buildbot/build/sql/item.h:1555
      #10 0x000000000059e05e in Item_func_or_sum::walk (this=0x7f6b7c014388, processor=&virtual table offset 784, walk_subquery=40, arg=0x0) at /home/buildbot/buildbot/build/sql/item.h:4116
      #11 0x00000000005c0d2f in pushdown_cond_for_derived (thd=0x7f6b7c0009a8, cond=0x7f6b7c012348, derived=<optimized out>) at /home/buildbot/buildbot/build/sql/sql_derived.cc:1235
      #12 0x0000000000644756 in JOIN::optimize_inner (this=0x7f6b7c012c30) at /home/buildbot/buildbot/build/sql/sql_select.cc:1334
      #13 0x0000000000647c06 in JOIN::optimize (this=0x196b) at /home/buildbot/buildbot/build/sql/sql_select.cc:1085
      #14 0x0000000000647e32 in mysql_select (thd=0x7f6b7c0009a8, tables=0x7f6b7c011b80, wild_num=0, fields=..., conds=0x7f6b7c012348, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748612, result=0x7f6b7c012600, unit=0x7f6b7c004348, select_lex=0x7f6b7c004a80) at /home/buildbot/buildbot/build/sql/sql_select.cc:3652
      #15 0x00000000006489a7 in mysql_explain_union (thd=0x7f6b7c0009a8, unit=0x7f6b7c004348, result=0x7f6b7c012600) at /home/buildbot/buildbot/build/sql/sql_select.cc:24835
      #16 0x00000000005e4ced in execute_sqlcom_select (thd=0x7f6b7c0009a8, all_tables=0x7f6b7c011b80) at /home/buildbot/buildbot/build/sql/sql_parse.cc:6370
      #17 0x00000000005e7f5d in mysql_execute_command (thd=0x7f6b7c0009a8) at /home/buildbot/buildbot/build/sql/sql_parse.cc:3448
      #18 0x00000000005f0e60 in mysql_parse (thd=0x7f6b7c0009a8, rawbuf=0x7f6b7c00eed0 "explain SELECT a\nFROM\n(\nSELECT DISTINCT(gid) a FROM invite_chat\nWHERE date_inv between '2017-03-01' and '2017-04-01'\nUNION\nSELECT DISTINCT(login) a FROM invite_chat\nWHERE date_inv between '2017-03-01'"..., length=251, parser_state=0x7f6be85f8780, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /home/buildbot/buildbot/build/sql/sql_parse.cc:7874
      #19 0x00000000005f38ba in dispatch_command (command=COM_QUERY, thd=0x7f6b7c0009a8, packet=<optimized out>, packet_length=<optimized out>, is_com_multi=false, is_next_command=false) at /home/buildbot/buildbot/build/sql/sql_parse.cc:1812
      #20 0x00000000005f40fd in do_command (thd=0x7f6b7c0009a8) at /home/buildbot/buildbot/build/sql/sql_parse.cc:1362
      #21 0x00000000006d39a5 in do_handle_one_connection (connect=0x1) at /home/buildbot/buildbot/build/sql/sql_connect.cc:1354
      #22 0x00000000006d3b6f in handle_one_connection (arg=0x2cbffe8) at /home/buildbot/buildbot/build/sql/sql_connect.cc:1260
      #23 0x00007f6bed6176ba in start_thread (arg=0x7f6be85f9700) at pthread_create.c:333
      #24 0x00007f6bec47c82d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
      

        Attachments

          Activity

            People

            • Assignee:
              bertrandop Olivier Bertrand
              Reporter:
              alice Alice Sherepa
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: