Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4.12, 10.4.13, 10.4(EOL), 10.5, 10.6
-
None
-
Windows 10 64-bit
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
- is duplicated by
-
MDEV-26846 SQL Error: Field 'DB_ROW_HASH_1' doesn't have a default value
-
- Closed
-
- relates to
-
MDEV-371 Unique indexes for blobs
-
- Closed
-
-
MDEV-31072 InnoDB is USING HASH and Optimizer is confused
-
- Open
-
Activity
Field | Original Value | New Value |
---|---|---|
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}} |
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 |
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 |
For the following table:
{code:sql} 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 ; {code} When I run the following query: {code:sql} INSERT INTO demo_upsert (Url, LastListID) SELECT Url, 10 FROM demo_upsert ON DUPLICATE KEY UPDATE LastListID=10 {code} I get the following error: SQL Error (1364): Field 'DB_ROW_HASH_1' doesn't have a default value |
Affects Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.5 [ 23123 ] |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Assignee | Sachin Setiya [ sachin.setiya.007 ] |
Affects Version/s | 10.6 [ 24028 ] |
Fix Version/s | 10.6 [ 24028 ] |
Link |
This issue is duplicated by |
Assignee | Sachin Setiya [ sachin.setiya.007 ] | Oleksandr Byelkin [ sanja ] |
Workflow | MariaDB v3 [ 109327 ] | MariaDB v4 [ 144258 ] |
Link | This issue relates to MDEV-31072 [ MDEV-31072 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Sergei Golubchik [ serg ] |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Testing [ 10301 ] |
Component/s | Data Definition - Create Table [ 14503 ] | |
Fix Version/s | 10.4.29 [ 28510 ] | |
Fix Version/s | 10.5.20 [ 28512 ] | |
Fix Version/s | 10.6.13 [ 28514 ] | |
Fix Version/s | 10.9.6 [ 28520 ] | |
Fix Version/s | 10.10.4 [ 28522 ] | |
Fix Version/s | 10.11.3 [ 28524 ] | |
Fix Version/s | 10.8.8 [ 28518 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Testing [ 10301 ] | Closed [ 6 ] |
Component/s | Data Manipulation - Insert [ 10101 ] | |
Component/s | Data Definition - Create Table [ 14503 ] |
Thanks for the report! I repeated on 10.4-10.5
CREATE TABLE t1 (url TEXT NOT NULL, UNIQUE INDEX url (url) USING hash);
INSERT INTO t1 (url) SELECT url FROM t1;
mysqltest: At line 2: query 'INSERT INTO t1 (url) SELECT url FROM t1' failed: 1364: Field 'DB_ROW_HASH_1' doesn't have a default value