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

Copying from DECIMAL to YEAR is not consistent about warnings

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5, 10.0, 10.1, 10.2
    • Fix Version/s: 10.2.0
    • Component/s: Temporal Types
    • Labels:
      None

      Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a YEAR);
      INSERT INTO t1 VALUES (-0.1);
      SHOW WARNINGS;

      correctly reports warnings:

      +---------+------+--------------------------------------------+
      | Level   | Code | Message                                    |
      +---------+------+--------------------------------------------+
      | Warning | 1264 | Out of range value for column 'a' at row 1 |
      +---------+------+--------------------------------------------+

      So does copying:

      DROP TABLE IF EXISTS t1,t2;
      CREATE TABLE t1 (a YEAR);
      CREATE TABLE t2 (a DECIMAL(10,1));
      INSERT INTO t2 VALUES (-0.1);
      INSERT INTO t1 SELECT * FROM t2;
      SHOW WARNINGS;

      While ALTER does not return any warnings:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a DECIMAL(10,1));
      INSERT INTO t1 VALUES (-0.1);
      ALTER TABLE t1 MODIFY a YEAR;
      SHOW 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: