shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Incorrect integer value: 'NULL' for column

Open michaeljinxq opened this issue 7 years ago • 3 comments

【 int 】 (1)create table tb1 (id int);

(2)insert into tb1 values (null); ERROR 1366 (HY000): Incorrect integer value: 'NULL' for column 'id' at row 1

michaeljinxq avatar Apr 17 '19 05:04 michaeljinxq

apache-shardingsphere-incubating-4.0.0-RC1-SNAPSHOT-sharding-proxy-bin.tar

michaeljinxq avatar Apr 17 '19 05:04 michaeljinxq

check null value for sharding column

codefairy08 avatar Apr 17 '19 09:04 codefairy08

@codefairy08 below is my sql , my sharding column is user_id

insert into log_user_key_action_1 (id, user_id,exchange_id ) 
values (575292640792121344, 112243515, null ) ;

the exchange_id is Int in mysql , and got an error message 'Incorrect integer value: 'null' for column 'exchange_id' at row 1' , but I can execute in my Sub-table like this :

insert into log_user_key_action_1 (id, user_id,exchange_id ) 
values (575292640792121344, 112243515, null ) ;

cjj137783 avatar May 07 '19 05:05 cjj137783