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

LP:724942 - Wrong result with views and ranges in maria-5.3

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Views and ranges are altogether broken in maria-5.3. Not repeatable with maria-5.1, 5.2 , mysql-5.1 and 5.5.

      Test case:

      CREATE TABLE t1 ( f1 varchar(10), KEY (f1)) ;
      INSERT IGNORE INTO t1 VALUES ('DD'),('ZZ'),('ZZ'),('KK'),('FF'),('HH'),('MM');

      CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;

      --let $query = SELECT * FROM v1 WHERE f1 > 'i' OR f1 AND f1 IN ( 'VV' )

      --eval $query
      --eval EXPLAIN EXTENDED $query
      SHOW WARNINGS;

      returns a column of VV VV VV , while such values are nowhere to be found in the underlying table.

      EXPLAIN EXTENDED reports:

      select 'VV' AS `f1` from `test`.`t1` where (('VV' > 'i') or ((`test`.`t1`.`f1` = 'VV') and 'VV'))

      which means the VV has been propagated all the way to the select list

      explain:

      id select_type table type possible_keys key key_len ref rows filtered Extra
      1 SIMPLE t1 range f1 f1 13 NULL 5 100.00 Using where; Using index

      bzr version-info:

      revision-id: <email address hidden>
      date: 2011-02-23 14:46:16 +0200
      build-date: 2011-02-25 14:17:06 +0200
      revno: 2919
      branch-nick: maria-5.3

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            igor Igor Babaev added a comment -

            Re: Wrong result with views and ranges in maria-5.3
            This bug relates to bug #717577, though not a duplicate.
            Both bugs will be fixed with the same patch containing test cases for both of them.

            Show
            igor Igor Babaev added a comment - Re: Wrong result with views and ranges in maria-5.3 This bug relates to bug #717577, though not a duplicate. Both bugs will be fixed with the same patch containing test cases for both of them.
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 724942

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 724942

              People

              • Assignee:
                igor Igor Babaev
                Reporter:
                philipstoev Philip Stoev
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: