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

Queries against spider tables return wrong values for columns following constant declarations.

    XMLWordPrintable

Details

    Description

      On source server:

      CREATE TABLE simple (
      id int(10) unsigned NOT NULL AUTO_INCREMENT,  
      val int(10) unsigned DEFAULT NULL, 
      PRIMARY KEY (id),   ENGINE=InnoDB;
       
      insert into simple(val) values(1);
      

      On spider server:

      create server s31689 foreign data wrapper mysql options (
      host '10.0.0.241' ,
      database 'd31689' ,
      user 'spider' ,
      password 'spider' ,
      port 3306 );
       
      CREATE TABLE simple (
      id int(10) unsigned NOT NULL AUTO_INCREMENT,  
      val int(10) unsigned DEFAULT NULL, 
      PRIMARY KEY (id),   ENGINE=SPIDER 
      DEFAULT CHARSET=utf8
      COMMENT='srv "s31689", table "simple"'
       
      Query OK, 0 rows affected (0.026 sec)
       
      MariaDB [d31689]> select * from simple;
      +----+------+
      | id | val  |
      +----+------+
      |  1 |    1 |
      +----+------+
      1 row in set (0.015 sec)
       
      MariaDB [d31689]> select id, 0 as const, val from simple;
      +----+-------+------+
      | id | const | val  |
      +----+-------+------+
      |  1 |     0 |    0 |
      +----+-------+------+
      1 row in set (0.002 sec)
      

      Attachments

        Issue Links

          Activity

            People

              Kentoku Kentoku Shiba (Inactive)
              juan.vera Juan
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.