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

Different sort order regarding NULLs

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • N/A
    • PL/SQL
    • None

    Description

      There is different sort order behavior regarding NULLS in MariaDB and Oracle.

      In Oracle:

      SELECT * from
      (SELECT To_Date(NULL) bt FROM dual UNION ALL SELECT sysdate bt FROM DUAL)
      ORDER BY bt
      
      

      first not null rows retrieved.

      In Maria;

      SELECT * from
      (SELECT CAST(\N AS DATETIME) bt FROM dual UNION ALL SELECT sysdate bt FROM DUAL)
      ORDER BY bt
      

      first null rows retrieved.
      And also in analytic funkctions where "order by" used.
      Is there some setting to change behavior to Oracle manner?
      Is it possible to consider sql_mode=oracle?
      Now developers are forced to alter application queries while porting from Oracle to Maria. So this is an additional obstacle.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              balta Tadas Balaišis
              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.