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

MariaDB 11.4.4 Crashes when querying a Spider table on a remote system with a distinct selection that is not a primary key.

Details

    Description

      When using MariaDB 11.4.4 with a link to a remote Spider table it will crash the DB when running a select distinct(non primary key field) from spider.table.

      I have tested this on 11.4.3 and the query runs without any problem. I have found that the table you are querying needs to have more than 10K rows in order for the crash to occur.

      To reproduce create a table on the spider database

      Create table db1.tab1 (
      id int(4) not null auto_increment,
      status varchar(25) default null,
      primary key (id) )
      engine=InnoDB default charset=latin1;

      Insert into the table a ten thousand entries. For my test I used a script to put an incrementing number into the status field.

      On the main DB server create spider server entry

      create or replace server dataNode1 foreign data wrapper mysql options (PORT 3306, HOST 'spiderDBhost', USER 'spideruser', PASSWORD 'password123');

      Create the spider table.

      create table db1.tab1 engine=SPIDER comment='wrapper "mysql", srv "dataNode1", table "tab1";

      Running this query will cause 11.4.4 to crash:

      Select distinct(status) from db1.tab1

      It will error out with [ERROR] mysqld got signal 11;
      Looking at /var/log/messages there is an entry reporting a segfault on ha_spider.so

      Attachments

        Issue Links

          Activity

            ycp Yuchen Pei added a comment - - edited

            It could be MDEV-35422 which is fixed in the upcoming release 11.4.5.

            Indeed, the following testcase passes at MDEV-35422 d0fcac44501b93593219ef2210032d06458d5410 but crashes at its parent commit 5c86f3df33dc972acfc3665025c25d6430887569. I'm therefore marking this issue as a duplicate of that one. A workaround would be set spider_disable_use_group_by_handler= 1; - please let me know if it doesn't work.

            --disable_query_log
            --disable_result_log
            --source ../../t/test_init.inc
            --enable_result_log
            --enable_query_log
             
            --source include/have_innodb.inc
             
            set spider_same_server_link= 1;
            evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
            OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
             
            Create table tab1 (
            id int(4) not null auto_increment,
            status varchar(25) default null,
            primary key (id) )
            engine=InnoDB default charset=latin1;
             
            create table tab1_s engine=SPIDER
            comment='wrapper "mysql", srv "srv", table "tab1"';
             
            select distinct(status) from tab1_s;
             
            drop server srv;
             
            --disable_query_log
            --disable_result_log
            --source ../../t/test_deinit.inc
            --enable_result_log
            --enable_query_log

            ycp Yuchen Pei added a comment - - edited It could be MDEV-35422 which is fixed in the upcoming release 11.4.5. Indeed, the following testcase passes at MDEV-35422 d0fcac44501b93593219ef2210032d06458d5410 but crashes at its parent commit 5c86f3df33dc972acfc3665025c25d6430887569. I'm therefore marking this issue as a duplicate of that one. A workaround would be set spider_disable_use_group_by_handler= 1; - please let me know if it doesn't work. --disable_query_log --disable_result_log --source ../../t/test_init.inc --enable_result_log --enable_query_log   --source include/have_innodb.inc   set spider_same_server_link= 1; evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql OPTIONS (SOCKET "$MASTER_1_MYSOCK" , DATABASE 'test' , user 'root' );   Create table tab1 ( id int (4) not null auto_increment, status varchar (25) default null , primary key (id) ) engine=InnoDB default charset=latin1;   create table tab1_s engine=SPIDER comment= 'wrapper "mysql", srv "srv", table "tab1"' ;   select distinct (status) from tab1_s;   drop server srv;   --disable_query_log --disable_result_log --source ../../t/test_deinit.inc --enable_result_log --enable_query_log

            I couldn't find spider_disable_use_group_by_handler= 1; but I tried spider_disable_group_by_handler= 1; and that did resolve the issue.

            Thanks for the quick follow up!

            jmyrna Uncle Walter23 added a comment - I couldn't find spider_disable_use_group_by_handler= 1; but I tried spider_disable_group_by_handler= 1; and that did resolve the issue. Thanks for the quick follow up!
            ycp Yuchen Pei added a comment -

            Yes, should be spider_disable_group_by_handler - sorry about the typo. Glad it worked.

            ycp Yuchen Pei added a comment - Yes, should be spider_disable_group_by_handler - sorry about the typo. Glad it worked.

            People

              ycp Yuchen Pei
              jmyrna Uncle Walter23
              Votes:
              1 Vote for this issue
              Watchers:
              4 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.