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

federatedx crashes on SELECT ... INTO query in select_handler code

    XMLWordPrintable

Details

    Description

      Attempts to run a SELECT ... INTO query over a federatedx table will crash

      diff -urp '--exclude=.*' 10.5-orig/mysql-test/suite/federated/federatedx_create_handlers.test 10.5-clustrix-noc/mysql-test/suite/federated/federatedx_create_handlers.test
      --- 10.5-orig/mysql-test/suite/federated/federatedx_create_handlers.test       2020-03-06 21:40:17.439601036 +0300
      +++ 10.5-noc/mysql-test/suite/federated/federatedx_create_handlers.test        2020-03-04 14:59:44.533465056 +0300
      @@ -147,6 +147,22 @@ FROM federated.t3,
              SELECT * FROM federated.t1 WHERE id >= 5) t
       WHERE federated.t3.name=t.name;
       
      +--echo # More tests
      +CREATE TABLE federated.t_local (
      +  id int(20) NOT NULL,
      +  name varchar(16) NOT NULL default ''
      +) engine=myisam;
      +
      +insert into federated.t_local select * from federated.t1;
      +--sorted_result
      +select * from federated.t_local;
      +
      +select name into @var from federated.t1 where id=3 limit 1 ;
      +select @var;
      +select name into outfile 'tmp.txt' from federated.t1;
      +
      +let $path=`select concat(@@datadir, 'test/tmp.txt')`;
      +remove_file $path;
      

      will crash like so:

      Thread 7 "mysqld" received signal SIGABRT, Aborted.
      [Switching to Thread 0x7ffff05f5700 (LWP 20531)]
      __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
      (gdb) wher
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #1  0x00007ffff56bd801 in __GI_abort () at abort.c:79
      #2  0x00007ffff56ad39a in __assert_fail_base (fmt=0x7ffff58347d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x555556af7ab0 "0", file=file@entry=0x555556af7788 "/home/psergey/dev-git2/10.5/sql/protocol.cc", line=line@entry=617, 
          function=function@entry=0x555556af8130 <Protocol::end_statement()::__PRETTY_FUNCTION__> "void Protocol::end_statement()") at assert.c:92
      #3  0x00007ffff56ad412 in __GI___assert_fail (assertion=0x555556af7ab0 "0", file=0x555556af7788 "/home/psergey/dev-git2/10.5/sql/protocol.cc", line=617, function=0x555556af8130 <Protocol::end_statement()::__PRETTY_FUNCTION__> "void Protocol::end_statement()") at assert.c:101
      #4  0x0000555555cae830 in Protocol::end_statement (this=0x7fffd8001328) at /home/psergey/dev-git2/10.5/sql/protocol.cc:617
      #5  0x0000555555ddaee2 in dispatch_command (command=COM_QUERY, thd=0x7fffd8000d60, packet=0x7fffd8008801 "select name into @var from federated.t1 where id=3 limit 1 ", packet_length=59, is_com_multi=false, is_next_command=false) at /home/psergey/dev-git2/10.5/sql/sql_parse.cc:2435
      #6  0x0000555555dd75a8 in do_command (thd=0x7fffd8000d60) at /home/psergey/dev-git2/10.5/sql/sql_parse.cc:1363
      #7  0x0000555555f775c9 in do_handle_one_connection (connect=0x555558436320, put_in_cache=true) at /home/psergey/dev-git2/10.5/sql/sql_connect.cc:1422
      #8  0x0000555555f772f8 in handle_one_connection (arg=0x555558436320) at /home/psergey/dev-git2/10.5/sql/sql_connect.cc:1319
      #9  0x00005555564d60ce in pfs_spawn_thread (arg=0x5555584363f0) at /home/psergey/dev-git2/10.5/storage/perfschema/pfs.cc:1869
      #10 0x00007ffff65b86db in start_thread (arg=0x7ffff05f5700) at pthread_create.c:463
      #11 0x00007ffff579e88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            psergei Sergei Petrunia
            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.