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

UPDATE table_name SET column1 = value1 and column2 = value2 does not throw error

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.5, 10.6
    • N/A
    • Parser
    • None

    Description

      In MariaDB, the following statement does not throw an error, but it is executed successfully

      • intended query

        UPDATE table_name SET column1 = value1 and column2 = value2;
        

      • should return an error

        UPDATE table_name SET column1 = value1 and column2 = value2;
        

      Here is the example:

      CREATE TABLE tbl(a INT, b INT);
       
      INSERT INTO tbl VALUES(1,1),(2,2);
       
      SELECT * FROM tbl;
      ----------------------
           a       b  
      ------  --------
           1         1
           2         2
           
      UPDATE tbl SET a = 3 AND b = 3;
       
       
      SELECT * FROM tbl;
      -------------------------
           a       b  
      ------  --------
           0         1
           0         2
      
      

      Above, a was updated with 0, which is incompatible with other databases such as SQL server or Oracle.

      Attachments

        Activity

          People

            Unassigned Unassigned
            allen.lee@mariadb.com Allen Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.