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

SQL Error (1364): Field 'DB_ROW_HASH_1' doesn't have a default value

    XMLWordPrintable

Details

    Description

      For the following table:

      CREATE TABLE `demo_upsert` (
          `ID` BIGINT(20) NOT NULL AUTO_INCREMENT,
          `Url` TEXT NOT NULL COLLATE 'utf8mb4_unicode_ci',
          `LastListID` BIGINT(20) NULL DEFAULT NULL,
          `Statistics` BIGINT(20) NOT NULL DEFAULT '0',
          PRIMARY KEY (`ID`) USING BTREE,
          UNIQUE INDEX `Url` (`Url`) USING HASH
      )
      COLLATE='utf8mb4_unicode_ci'
      ENGINE=InnoDB
      ;
      

      When I run the following query:

      INSERT INTO demo_upsert (Url, LastListID) SELECT Url, 10 FROM demo_upsert ON DUPLICATE KEY UPDATE LastListID=10
      

      I get the following error:
      SQL Error (1364): Field 'DB_ROW_HASH_1' doesn't have a default value

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              rserge Serge Rogatch
              Votes:
              1 Vote for this issue
              Watchers:
              6 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.