create table test1 (x integer not null);
-- @ins1
insert into test1 values;
-- @ins2
insert into test1 (x) values;
Then I generate some.ml:
sqlgg -gen caml -name Make some.sql > some.ml
Both functions are wrong:
let ins1 db ~ =
let set_params stmt =
let p = T.start_params stmt 1 in
T.set_param_Int p 0 ;
T.finish_params p
in
T.execute db "insert into test1 values (@)" set_params
let ins2 db ~ =
let set_params stmt =
let p = T.start_params stmt 1 in
T.set_param_Int p 0 ;
T.finish_params p
in
T.execute db "insert into test1 (x) values (@)" set_params
This bug appears when insert statement has one column, and it doesn't matter how many columns has table actually.
I have some.sql:
Then I generate some.ml:
Both functions are wrong:
This bug appears when
insert
statement has one column, and it doesn't matter how many columns has table actually.