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

Inconsistent warnings when converting string to decimal

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.0.9
    • N/A
    • Data types
    • None

    Description

      mysql> select cast('' as decimal(30,1)), cast(concat('') as decimal(30,1)); show warnings;
      +---------------------------+-----------------------------------+
      | cast('' as decimal(30,1)) | cast(concat('') as decimal(30,1)) |
      +---------------------------+-----------------------------------+
      |                       0.0 |                               0.0 |
      +---------------------------+-----------------------------------+
      1 row in set, 2 warnings (0.00 sec)
       
      +---------+------+---------------------------------------------------------+
      | Level   | Code | Message                                                 |
      +---------+------+---------------------------------------------------------+
      | Warning | 1292 | Truncated incorrect DECIMAL value: ''                   |
      | Warning | 1918 | Encountered illegal value '' when converting to DECIMAL |
      +---------+------+---------------------------------------------------------+
      2 rows in set (0.00 sec)

      The warnings should probably be the same for both values.

      Attachments

        Issue Links

          Activity

            People

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