[MDEV-29470] MariaDB Community Server 10.8.4 ERROR 1048 (23000): Column 'FIELDID' cannot be null Created: 2022-09-06  Updated: 2023-01-20  Resolved: 2023-01-20

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.6.9, 10.7.5, 10.8.4, 10.9.2, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.5.18, 10.6.11, 10.7.7, 10.8.6, 10.9.4, 10.10.2

Type: Bug Priority: Critical
Reporter: ZhiChao Wang Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: regression
Environment:

MariaDB Community Server 10.8.4 and operating system Windows Server 2019 X64-based


Attachments: Text File mariadb column ‘column_name’ cannot be null.txt     PNG File screenshot-1.png    
Issue Links:
Problem/Incident
is caused by MDEV-26585 Wrong query results when `using index... Closed

 Description   

My current MariaDB version is MariaDB Community Server 10.8.4 and operating system Windows Server 2019 X64-based
A business table was created and an error was reported when using the following SQL:
INSERT INTO meeting (fielDID,fieldorder) SELECT MAX(fielDID)+1 AS fielDID, MAX(fieldorder)+1 AS fieldorder FROM meeting

ERROR 1048 (23000): Column 'FIELDID' cannot be null



 Comments   
Comment by Elena Stepanova [ 2022-09-06 ]

Thanks for the report. Reproducible as described.

MTR-friendly, otherwise the same test case:

CREATE TABLE meeting (fieldid int NOT NULL, fieldorder int DEFAULT NULL, PRIMARY KEY (fieldid));
INSERT INTO meeting (fieldid,fieldorder) values (1,1),(2,1),(3,1),(4,1);
INSERT INTO meeting (fielDID,fieldorder) SELECT MAX(fieldid)+1 AS fieldid, MAX(fieldorder)+1 AS fieldorder FROM meeting;
 
DROP TABLE meeting;

10.5 ba987a46

query 'INSERT INTO meeting (fielDID,fieldorder) SELECT MAX(fieldid)+1 AS fieldid, MAX(fieldorder)+1 AS fieldorder FROM meeting' failed: 1048: Column 'fieldid' cannot be null

The failure started happening after this commit in 10.5.15:

commit 38058c04a4fc021f381f8000e40ed23bd4fb8d75
Author: Monty
Date:   Wed Feb 2 14:25:25 2022 +0200
 
    MDEV-26585 Wrong query results when `using index for group-by`

Comment by ZhiChao Wang [ 2022-09-22 ]

Version 10.9.3 did not fix this problem, and my test failed again, Which version will be fixed? thanks

Comment by Sergei Golubchik [ 2023-01-20 ]

Cannot repeat it in the latest 10.5. Closing as fixed. Please comment if this is wrong and you still see it

Generated at Thu Feb 08 10:08:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.