Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-1155

NOT with null safe operator fails

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.2
    • 1.1.6
    • None
    • 2018-10, 2018-11, 2018-12, 2018-13, 2018-14

    Description

      I can work around with colum1 is not null and column2 is null... but should it work with NOT (column1 <=> column2)? Here's an example.

      MariaDB> CREATE TABLE cs1 (
          ->     id              INT(10) UNSIGNED NOT NULL,
          ->     `timestamp_`    DATETIME,
          ->     numeric_val     DOUBLE DEFAULT NULL
          -> ) ENGINE=columnstore;
      Query OK, 0 rows affected (0.44 sec)
       
      MariaDB> CREATE TABLE cs2 (
          ->     id              INT(10) UNSIGNED NOT NULL,
          ->     `timestamp_`    DATETIME,
          ->     numeric_val     DOUBLE DEFAULT NULL
          -> ) ENGINE=columnstore;
      Query OK, 0 rows affected (0.25 sec)
       
      MariaDB> SELECT @@version,@@version_comment;
      +---------------------+---------------------+
      | @@version           | @@version_comment   |
      +---------------------+---------------------+
      | 10.2.10-MariaDB-log | Columnstore 1.1.2-1 |
      +---------------------+---------------------+
      1 row in set (0.00 sec)
       
      MariaDB]> INSERT INTO cs1 VALUES (1, '2018-01-09 21:59:02', 11.11);
      Query OK, 1 row affected (0.11 sec)
       
      MariaDB> INSERT INTO cs2 VALUES (1, '2018-01-09 21:59:02', 22.22);
      Query OK, 1 row affected (0.10 sec)
       
      MariaDB> SELECT * FROM cs1
          ->     JOIN cs2 USING(id,timestamp_)
          -> ;
      +----+---------------------+-------------+-------------+
      | id | timestamp_          | numeric_val | numeric_val |
      +----+---------------------+-------------+-------------+
      |  1 | 2018-01-09 21:59:02 |       11.11 |       22.22 |
      +----+---------------------+-------------+-------------+
      1 row in set (0.04 sec)
       
      MariaDB> SELECT * FROM cs1
          ->     JOIN cs2 USING(id,timestamp_)
          ->     WHERE cs1.numeric_val <=> cs2.numeric_val
          -> ;
      Empty set (0.02 sec)
       
      MariaDB> SELECT * FROM cs1
          ->     JOIN cs2 USING(id,timestamp_)
          ->     WHERE NOT (cs1.numeric_val = cs2.numeric_val)
          -> ;
      +----+---------------------+-------------+-------------+
      | id | timestamp_          | numeric_val | numeric_val |
      +----+---------------------+-------------+-------------+
      |  1 | 2018-01-09 21:59:02 |       11.11 |       22.22 |
      +----+---------------------+-------------+-------------+
      1 row in set (0.02 sec)
       
      MariaDB> SELECT * FROM cs1
          ->     JOIN cs2 USING(id,timestamp_)
          ->     WHERE NOT (cs1.numeric_val <=> cs2.numeric_val)
          -> ;
      ERROR 1815 (HY000): Internal error: IDB-2030: Predicate and Logic operators can not be used where an expression is expected.
      

      Attachments

        1. q1.sql
          0.9 kB
        2. setup.sql
          1 kB
        3. t1.sql
          0.5 kB
        4. q1.out
          2 kB
        5. t1.out
          0.6 kB

        Activity

          People

            dleeyh Daniel Lee (Inactive)
            dthompson David Thompson (Inactive)
            Votes:
            1 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.