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

sql_mode=ORACLE: Incompatibility with CAST(number AS CHAR)

    XMLWordPrintable

Details

    Description

      Oracle removes insignificant fractional digits when converting a number to char:

      SQL> select cast(10/10 as char) from dual;
      

      C
      -
      1
      

      while MariaDB preserves zeros:

      MariaDB [test]> select cast(10/10 as char);
      

      +---------------------+
      | cast(10/10 as char) |
      +---------------------+
      | 1.0000              |
      +---------------------+
      

      As a result, Oracle returns one row in all these queries:

      select 'X' from dual where  1 like 10/10;
      select 'X' from dual where 1 like 1.00;
      select 'x' from dual where 1.000 like 1.00;
      

      MariaDB returns empty set.

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            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.