[MDEV-11267] connect jdbc null value problem remains Created: 2016-11-10  Updated: 2016-12-17  Resolved: 2016-11-14

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Connect
Affects Version/s: 10.1.19
Fix Version/s: 10.0.29, 10.1.21, 10.2.3

Type: Bug Priority: Major
Reporter: Robert Dyas Assignee: Olivier Bertrand
Resolution: Fixed Votes: 0
Labels: None
Environment:

centos 7



 Description   

I just upgraded to 10.1.19 and recompiled the Java code for the JdbcInterface and ApacheInterface. The null behavior is different than 10.1.18 but still not correct.

In 10.1.19 when you INSERT a row with NULL values specified for numeric or date/time column datatypes (all of their various forms) and then SELECT the result back, you will see that 0 was INSERTed.

Note however that now in 10.1.19 if you issue an UPDATE statement with null values the behavior is now correct (when you select back you get NULLs for numbers and dates).



 Comments   
Comment by Olivier Bertrand [ 2016-11-14 ]

The difference is that UPDATE commands are just sent to the driver while INSERT are prepared statements. And the set parameter function did not test for null values.

Waiting for the fix, a turnaround is to replace:

insert into t1(col1,col2) values('hello',NULL);

by:

insert into t1(col1) values('hello');

Comment by Robert Dyas [ 2016-11-15 ]

Great. Thank you!

Comment by Robert Dyas [ 2016-12-17 ]

I just installed 10.1.20 and the problem with inserting null values remains.

INSERT INTO atable (mynumericcol) VALUES (null);
SELECT mynumericcol FROM atable

the SELECT returns zero not null.

Generated at Thu Feb 08 07:48:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.