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

Out-of-range error with CREATE..SELECT..TO_SECONDS(NOW())

    XMLWordPrintable

Details

    Description

      SET sql_mode=STRICT_ALL_TABLES;
      CREATE OR REPLACE TABLE t1 AS SELECT TO_SECONDS(NOW());
      

      ERROR 1264 (22003): Out of range value for column 'TO_SECONDS(NOW())' at row 1
      

      The problem is in this code:

        void fix_length_and_dec()
        {
          decimals=0;
          max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
          maybe_null= 1;
        }
      

      max_length is set to a too small value, which makes it create an INT rather than BIGINT column.

      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.