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

ERROR 1429 (base) versus crash [SIGSEGV in spider_create_conn] (28856 patch) and ERROR 12719 infinite loop (base) versus ERROR 12518 table is read only (patch) on optimized builds in CLI

    XMLWordPrintable

Details

    Description

      Relates to MDEV-32492. This testcase:

      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE SERVER srv FOREIGN DATA WRAPPER mysql OPTIONS (SOCKET '../socket.sock',DATABASE 'test',user 'Spider',PASSWORD '');
      CREATE TABLE t1 (a INT,b VARCHAR(255),PRIMARY KEY(a)) ENGINE=Spider COMMENT="srv 'srv', table 't1', read_only_mode '1'";
      INSERT INTO t1 VALUES (1,'aaa'),(2,'bbb'),(3,'ccc'),(4,'ddd');
      SHOW CREATE TABLE t1;
      DROP TABLE t1;
      CREATE TABLE t1 (a INT) ENGINE=Spider COMMENT='port "123 456"';
      INSERT IGNORE INTO t1 VALUES (42),(42);
      

      When executed at the CLI has different outcomes when executed on the latest MDEV-28856 patch versus the base (pre-patch). Base:

      preview-11.3-preview 465f9beea1c43a1dad74330aa2dc30927bc224f5 (Optimized)

      11.3.0-opt>INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      Query OK, 0 rows affected, 1 warning (0.007 sec)
       
      11.3.0-opt>CREATE SERVER srv FOREIGN DATA WRAPPER mysql OPTIONS (SOCKET '../socket.sock',DATABASE 'test',user 'Spider',PASSWORD '');
      Query OK, 0 rows affected (0.001 sec)
       
      11.3.0-opt>CREATE TABLE t1 (a INT,b VARCHAR(255),PRIMARY KEY(a)) ENGINE=Spider COMMENT="srv 'srv', table 't1', read_only_mode '1'";
      Query OK, 0 rows affected (0.300 sec)
       
      11.3.0-opt>INSERT INTO t1 VALUES (1,'aaa'),(2,'bbb'),(3,'ccc'),(4,'ddd');
       
      ERROR 12719 (HY000): An infinite loop is detected when opening table test.t1
      11.3.0-opt>SHOW CREATE TABLE t1;
      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                                                                                                                                |
      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `a` int(11) NOT NULL,
        `b` varchar(255) DEFAULT NULL,
        PRIMARY KEY (`a`)
      ) ENGINE=SPIDER DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='srv ''srv'', table ''t1'', read_only_mode ''1''' |
      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      1 row in set, 1 warning (0.034 sec)
       
      11.3.0-opt>DROP TABLE t1;
      Query OK, 0 rows affected (0.005 sec)
       
      11.3.0-opt>CREATE TABLE t1 (a INT) ENGINE=Spider COMMENT='port "123 456"';
      Query OK, 0 rows affected (0.007 sec)
       
      11.3.0-opt>INSERT IGNORE INTO t1 VALUES (42),(42);
      ERROR 1429 (HY000): Unable to connect to foreign data source: localhost
      

      Versus patch:

      bb-11.3-mdev-28856-and-fixes cc08a83ef4225960dccb46bd68fc549160d21841 (Optimized)

      11.3.0-opt>INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      Query OK, 0 rows affected, 1 warning (0.006 sec)
       
      11.3.0-opt>CREATE SERVER srv FOREIGN DATA WRAPPER mysql OPTIONS (SOCKET '../socket.sock',DATABASE 'test',user 'Spider',PASSWORD '');
      Query OK, 0 rows affected (0.002 sec)
       
      11.3.0-opt>CREATE TABLE t1 (a INT,b VARCHAR(255),PRIMARY KEY(a)) ENGINE=Spider COMMENT="srv 'srv', table 't1', read_only_mode '1'";
       
      Query OK, 0 rows affected (0.291 sec)
       
      11.3.0-opt>INSERT INTO t1 VALUES (1,'aaa'),(2,'bbb'),(3,'ccc'),(4,'ddd');
      ERROR 12518 (HY000): Table 'test.t1' is read only
      11.3.0-opt>SHOW CREATE TABLE t1;
      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                                                                                                                                |
      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `a` int(11) NOT NULL,
        `b` varchar(255) DEFAULT NULL,
        PRIMARY KEY (`a`)
      ) ENGINE=SPIDER DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='srv ''srv'', table ''t1'', read_only_mode ''1''' |
      +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      1 row in set, 1 warning (0.033 sec)
       
      11.3.0-opt>DROP TABLE t1;
      Query OK, 0 rows affected (0.005 sec)
       
      11.3.0-opt>CREATE TABLE t1 (a INT) ENGINE=Spider COMMENT='port "123 456"';
      Query OK, 0 rows affected (0.005 sec)
       
      11.3.0-opt>INSERT IGNORE INTO t1 VALUES (42),(42);
      ERROR 2026 (HY000): TLS/SSL error: The TLS connection was non-properly terminated.
      # i.e. crashed instance
      

      Besides the SIGSEGV in spider_create_conn crash on Optimized builds in the feature tree, please note the following difference:

      ERROR 12719 (HY000): An infinite loop is detected when opening table test.t1
      

      Versus

      ERROR 12518 (HY000): Table 'test.t1' is read only
      

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              Roel Roel Van de Paar
              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.