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

Warning generation is inconsistent when converting from number to string

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.9
    • Fix Version/s: 10.0
    • Component/s: None
    • Labels:
      None

      Description

      mysql> select cast('c1' as signed) as c1,cast(concat('c2') as signed)as c2,cast('c3' as double)as c3,cast(concat('c4') as double) as c4, cast('c5' as decimal) as c5,cast(concat('c6') as decimal) as c6; show warnings;
      +----+----+------+------+----+----+
      | c1 | c2 | c3   | c4   | c5 | c6 |
      +----+----+------+------+----+----+
      |  0 |  0 |    0 |    0 |  0 |  0 |
      +----+----+------+------+----+----+
      1 row in set, 5 warnings (0.00 sec)
      
      +---------+------+---------------------------------------------------------+
      | Level   | Code | Message                                                 |
      +---------+------+---------------------------------------------------------+
      | Warning | 1292 | Truncated incorrect INTEGER value: 'c1'                 |
      | Warning | 1292 | Truncated incorrect INTEGER value: 'c2'                 |
      | Warning | 1292 | Truncated incorrect DOUBLE value: 'c3'                  |
      | Warning | 1292 | Truncated incorrect DECIMAL value: 'c5'                 |
      | Warning | 1918 | Encountered illegal value '' when converting to DECIMAL |
      +---------+------+---------------------------------------------------------+
      5 rows in set (0.00 sec)
      

      Notice, no warning for c4, and a different warning for c6.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              There are no comments yet on this issue.

                People

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

                  Dates

                  • Created:
                    Updated: