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

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5, 10.0, 10.1
    • Fix Version/s: 10.1.8
    • Component/s: OTHER
    • Labels:
      None
    • Sprint:
      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

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: