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

UDF + ORDER BY returns twice the value in view

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
    • 10.10.3
    • Views

    Description

      Test:

      --replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
      eval CREATE FUNCTION udf_sequence RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES (4),(3),(2),(1);
       
      SELECT udf_sequence() AS seq FROM t1 ORDER BY seq ;
      CREATE VIEW v1 as SELECT udf_sequence() AS seq FROM t1 ORDER BY seq ;
      SELECT * FROM v1;
      DROP VIEW v1;
       
      DROP FUNCTION udf_sequence;
      DROP TABLE t1;
      

      Actual value:

      seq
      2
      4
      6
      8
      

      Expected value:

      seq
      1
      2
      3
      4
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.