[MDEV-22756] SQL Error (1364): Field 'DB_ROW_HASH_1' doesn't have a default value Created: 2020-05-30 Updated: 2023-04-28 Resolved: 2023-04-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Insert |
| Affects Version/s: | 10.4.12, 10.4.13, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.11.3, 10.4.29, 10.5.20, 10.6.13, 10.8.8, 10.9.6, 10.10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Serge Rogatch | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Windows 10 64-bit |
||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
For the following table:
When I run the following query:
I get the following error: |
| Comments |
| Comment by Alice Sherepa [ 2020-06-03 ] | ||||
|
Thanks for the report! I repeated on 10.4-10.5
| ||||
| Comment by Bastian Waidelich [ 2023-04-05 ] | ||||
|
I'm puzzled that this bug still exists after such a long time, but for anyone that comes across the same issue:
| ||||
| Comment by James Kevin O'Halloran [ 2023-04-28 ] | ||||
|
I just encountered this bug on 4/27/23 on @@version 10.4.27-MariaDB-1:10.4.27+maria~ubu2004. I really don't want to add nullable columns to the unique index! ugh. | ||||
| Comment by James Kevin O'Halloran [ 2023-04-28 ] | ||||
|
Sergei, I see you closed this bug after adding an update entitled exclude generated columns from the "has default value" check. Just in case it is useful, I encountered this bug on a table with no generated columns. | ||||
| Comment by Sergei Golubchik [ 2023-04-28 ] | ||||
|
DB_ROW_HASH_1 is the name of the hidden generated column which is internally created to implement the unique constraint. You can see that the test case in the commit does not use any generated columns either. | ||||
| Comment by James Kevin O'Halloran [ 2023-04-28 ] | ||||
|
ah thank you for explaining that! cheers. |