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

Wrong results for queries with row constructors and information_schema

    XMLWordPrintable

Details

    • 10.2.10

    Description

      Basically, MariaDB is affected by the upstream https://bugs.mysql.com/bug.php?id=86930, but our case is even worse, as a workaround with subquery does not work:

      openxs@ao756:~/dbs/maria10.2$ bin/mysql --host=127.0.0.1 --port=3308 -uroot testReading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A
       
      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 8
      Server version: 10.2.7-MariaDB Source distribution
       
      Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      MariaDB [test]> create table tt1(c1 int);
      Query OK, 0 rows affected (0.31 sec)
       
      MariaDB [test]> create table tt2(c2 int);
      Query OK, 0 rows affected (0.22 sec)
       
      MariaDB [test]> select count(*) from information_schema.columns where table_schema='test' and (table_name, column_name) in (('tt1', 'c1'));
      +----------+
      | count(*) |
      +----------+
      |        1 |
      +----------+
      1 row in set (0.04 sec)
       
      MariaDB [test]> select count(*) from information_schema.columns where table_schema='test' and (table_name, column_name) in (('tt2', 'c2'));
      +----------+
      | count(*) |
      +----------+
      |        1 |
      +----------+
      1 row in set (0.00 sec)
       
      MariaDB [test]> select count(*) from information_schema.columns where table_schema='test' and (table_name, column_name) in (('tt1','c1'),('tt2', 'c2'));
      +----------+
      | count(*) |
      +----------+
      |        0 |
      +----------+
      1 row in set (0.01 sec)
       
      MariaDB [test]> select count(*) from information_schema.columns where table_schema='test' and (table_name, column_name) in (select 'tt1','c1' from dual union select 'tt2', 'c2' from dual);
      +----------+
      | count(*) |
      +----------+
      |        0 |
      +----------+
      1 row in set (0.02 sec)
       
      MariaDB [test]> select count(*) from information_schema.columns where table_schema='test' and (table_name='tt1' and column_name='c1') or (table_name='tt2' and column_name='c2');
      +----------+
      | count(*) |
      +----------+
      |        2 |
      +----------+
      1 row in set (0.00 sec)
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            valerii Valerii Kravchuk
            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.