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

CREATE OR REPLACE .. SELECT of Federated table doesn't store selected values

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      install soname 'ha_federatedx';
       
      create table t (a int) engine=InnoDB;
      eval create or replace table tf connection 'mysql://root@127.0.0.1:$MASTER_MYPORT/test/t' engine=Federated as select 1 as a;
      select * from tf;
       
      # Cleanup
      drop table tf, t;
      uninstall soname 'ha_federatedx';
      

      bb-10.11-midenok 6b5f76fcaaf

      select * from tf;
      a
      drop table tf, t;
      

      The expected result is naturally a row 1.

      Also reproducible on 10.11. The problem appeared there with

      commit 93c8252f02faa8ad8dc5f005e52f1990c29d4a0d (HEAD)
      Author: Aleksey Midenkov
      Date:   Wed Aug 31 11:55:04 2022 +0300
       
          MDEV-25292 Atomic CREATE OR REPLACE TABLE
      

      According to the general log, the connection to remote exits too early and without a COMMIT. Before the change, it was doing this:

                           6 Connect  root@localhost on test using TCP/IP
                           6 Query    set time_zone='+00:00'
                           6 Query    SET AUTOCOMMIT=0
                           6 Query    set time_zone='+00:00'
                           6 Query    SAVEPOINT save1
                           6 Query    set time_zone='+00:00'
                           6 Query    INSERT INTO `t` (`a`)  VALUES  (1)
                           6 Query    set time_zone='+00:00'
                           6 Query    COMMIT
                           4 Query    select * from tf
                           6 Query    set time_zone='+00:00'
      ...
      

      Now it's doing this:

                           6 Connect  root@localhost on test using TCP/IP
                           6 Query    set time_zone='+00:00'
                           6 Query    SET AUTOCOMMIT=0
                           6 Query    set time_zone='+00:00'
                           6 Query    SAVEPOINT save1
                           6 Query    set time_zone='+00:00'
                           6 Query    INSERT INTO `t` (`a`)  VALUES  (1)
                           6 Quit     
      

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              elenst Elena Stepanova
              Votes:
              0 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.