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

DISTINCT not consistently passed to Item_func_collect

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 12.0.0
    • 12.2
    • GIS
    • None

    Description

      In the following test case, the DISTINCT flag isn't handled properly, resulting in the mysqltest_tmp_v view generating non-distinct values:

      CREATE TABLE simple_table ( running_number INTEGER NOT NULL AUTO_INCREMENT ,
      geo GEOMETRY, PRIMARY KEY ( RUNNING_NUMBER));
      INSERT INTO simple_table ( geo) VALUES
      (ST_GEOMFROMTEXT('GEOMETRYCOLLECTION EMPTY')),
      (ST_GEOMFROMTEXT('GEOMETRYCOLLECTION EMPTY'));
       
      CREATE OR REPLACE VIEW mysqltest_tmp_v AS SELECT ST_ASTEXT(ST_COLLECT(DISTINCT geo) OVER( ORDER BY running_number ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)) AS geocollect FROM simple_table;
      

      If we query with the SELECT directly, as given below, then the correct query result is given:

      SELECT ST_ASTEXT(ST_COLLECT(DISTINCT geo) OVER( ORDER BY running_number ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)) AS geocollect FROM simple_table;
      

      Attachments

        Issue Links

          Activity

            People

              Gosselin Dave Gosselin
              Gosselin Dave Gosselin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.