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

Incorrect SQL result when renaming column in a subquery (possibly with GROUP BY)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.2, 10.3, 10.3.7
    • Fix Version/s: 10.2.16
    • Component/s: Optimizer
    • Labels:
      None
    • Environment:
      Debian Jessie

      Description

      Hi!

      In one of our production installations MariaDB 10.3.7 fails to filter rows correctly after upgrading from 5.5, in a case similar to the following:

      create table tbl (a int, b varchar(255));
      insert into tbl values (1, 'abc');
      select * from (select 'abc' a, a b from tbl) t where a='abc';
      

      It seems that MariaDB pushes the outer 'where' condition inside, takes the value type from tbl.a, thinks ='abc' should be an integer, issues an 'incorrect integer value' and returns 0 rows.

      The issue still reproduces on our installation. However, I can't reproduce it from scratch using the script above.

      So...
      1) can you suggest me how to reproduce it so you could fix it?
      2) did I miss something during the upgrade?

        Attachments

          Activity

            People

            Assignee:
            shagalla Galina Shalygina (Inactive)
            Reporter:
            vitalif Vitaliy Filippov
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: