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

No datatype validation for indexed column on UPDATE

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.2, 10.3, 10.4, 10.5, 10.6
    • None
    • Parser
    • None

    Description

      The server is behaving differently regarding the validation of data types for indexed and non indexed columns.

      MariaDB [test]> CREATE TABLE `tc4091` (
          ->     `int_1` int,
          ->     `int_2` int,
          ->     KEY (`int_1`)
          ->     );
      Query OK, 0 rows affected (0.017 sec)
       
      MariaDB [test]>     INSERT INTO tc4091 (int_1,int_2) values (1,1);
      Query OK, 1 row affected (0.001 sec)
       
      MariaDB [test]>     UPDATE tc4091 SET int_2 = 4 WHERE int_1 = 'a';
      Query OK, 0 rows affected (0.000 sec)
      Rows matched: 0  Changed: 0  Warnings: 0
       
      MariaDB [test]>     UPDATE tc4091 SET int_2 = 4 WHERE int_2 = 'a';
      ERROR 1292 (22007): Truncated incorrect DOUBLE value: 'a'
      MariaDB [test]>     DROP TABLE tc4091;
      Query OK, 0 rows affected (0.007 sec)

      Attachments

        Activity

          People

            Unassigned Unassigned
            ralf.gebhardt Ralf Gebhardt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.