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

Implicit or explicit CAST from MAX(string) to INT,DOUBLE,DECIMAL does not produce warnings

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5(EOL), 10.0(EOL), 10.1(EOL)
    • 10.1.8
    • OTHER
    • None
    • 10.1.8-3

    Description

      This SQL script:

      SELECT 'x' << 1, CAST('x' AS DOUBLE), CAST('x' AS DECIMAL);
      SHOW WARNINGS;

      returns the following warnings:

      +---------+------+----------------------------------------+
      | Level   | Code | Message                                |
      +---------+------+----------------------------------------+
      | Warning | 1292 | Truncated incorrect INTEGER value: 'x' |
      | Warning | 1292 | Truncated incorrect DOUBLE value: 'x'  |
      | Warning | 1292 | Truncated incorrect DECIMAL value: 'x' |
      +---------+------+----------------------------------------+

      Now if I use MAX:

      SELECT MAX('x') << 1, CAST(MAX('x') AS DOUBLE), CAST(MAX('x') AS DECIMAL);

      it returns no warnings.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.