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

Invalid SQL state for error 1366

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 10.4.13
    • Fix Version/s: N/A
    • Component/s: Data types
    • Labels:
      None
    • Environment:
      Windows 10

      Description

      When trying to insert an incorrect value into for example integer field an error is throw with code 1366. According to https://mariadb.com/kb/en/mariadb-error-codes/ and MySQL 8 the SQL status should be HY000 (General issue), however for MariaDB it is showing 22007 which is slightly misleading and not compatible with MySQL.

      CREATE TABLE IF NOT EXISTS `testnum` (
        `col1` integer NOT NULL
      ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4;
       
      INSERT INTO `testnum` (`col1`) VALUES ('DEU');
      

      In MySQL this produces:

      ERROR 1366 (HY000): Incorrect integer value: 'DEU' for column 'col1' at row 1

      and in MariaDB:

      ERROR 1366 (22007): Incorrect integer value: 'DEU' for column `test`.`testnum`.`col1` at row 1

        Attachments

          Activity

            People

            Assignee:
            serg Sergei Golubchik
            Reporter:
            Dharman Kamil Tekiela
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration