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

Commands out of sync after OPTIMIZE on FEDERATED table

    XMLWordPrintable

Details

    Description

      Notes:
      On some reason, select from INFORMATION_SCHEMA.TABLE_CONSTRAINTS is important here.
      have_innodb.inc is not particularly important, it's just there to avoid warnings upon select from the information schema. The failure happens regardless whether the test runs with InnoDB or not.

      --source include/have_innodb.inc
       
      INSTALL SONAME 'ha_federatedx';
       
      eval create server s foreign data wrapper mysql options (host "127.0.0.1", database "test", user "root", port $MASTER_MYPORT);
       
      CREATE TABLE t1 (a INT);
      CREATE TABLE t1_fed ENGINE=FEDERATED CONNECTION = 's/t1';
      SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS;
      CREATE TABLE t2 (a INT);
      CREATE TABLE t2_fed ENGINE=FEDERATED CONNECTION = 's/t2';
      OPTIMIZE TABLE t2_fed;
      SELECT * FROM t2_fed;
       
      # Cleanup
      DROP TABLE t2_fed, t2, t1_fed, t1;
      DROP SERVER s;
      UNINSTALL SONAME 'ha_federatedx';
      

      10.4 f5dceafd

      OPTIMIZE TABLE t2_fed;
      Table	Op	Msg_type	Msg_text
      test.t2_fed	optimize	status	OK
      SELECT * FROM t2_fed;
      bug.t 'innodb'                           [ fail ]
              Test ended at 2023-06-17 01:23:12
       
      CURRENT_TEST: bug.t
      mysqltest: At line 13: query 'SELECT * FROM t2_fed' failed: 2014: Received error: 2014 : Commands out of sync; you can't run this command now
      

      Reproducible on all existing versions, debug- and non-debug alike.
      Debug builds further abort with

      mysqld: /data/src/10.4/sql/sql_class.cc:1735: virtual THD::~THD(): Assertion `status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory' failed
      

      but I assume it's just an aftermath of the problem above.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.