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

Copying from DECIMAL to YEAR is not consistent about warnings

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5, 10.0, 10.1, 10.2
    • 10.2.0
    • Temporal Types
    • 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

              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.