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

Invalid SQL state for error 1366

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 10.4.13
    • N/A
    • Data types
    • None
    • 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

            serg Sergei Golubchik
            Dharman Kamil Tekiela
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.