File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -3148,4 +3148,34 @@ var InsertBrokenScripts = []ScriptTest{
31483148 },
31493149 },
31503150 },
3151+ {
3152+ Name : "no cols empty val insert" ,
3153+ SetUpScript : []string {
3154+ "create table t_auto (id int auto_increment primary key, name varchar(10) default null)" ,
3155+ "create table t_default_null (id int default null, name varchar(10) default null)" ,
3156+ "create table t_not_null (id int not null, name varchar(10) not null)" ,
3157+ },
3158+ Assertions : []ScriptTestAssertion {
3159+ {
3160+ Query : "insert into t_auto values ()" ,
3161+ Expected : []sql.Row {{types .NewOkResult (1 )}},
3162+ },
3163+ {
3164+ Query : "select * from t_auto" ,
3165+ Expected : []sql.Row {{1 , nil }},
3166+ },
3167+ {
3168+ Query : "insert into t_default_null values ()" ,
3169+ Expected : []sql.Row {{types .NewOkResult (1 )}},
3170+ },
3171+ {
3172+ Query : "select * from t_default_null" ,
3173+ Expected : []sql.Row {{nil , nil }},
3174+ },
3175+ {
3176+ Query : "insert into t_not_null values ()" ,
3177+ ExpectedErr : sql .ErrInsertIntoNonNullableDefaultNullColumn ,
3178+ },
3179+ },
3180+ },
31513181}
You can’t perform that action at this time.
0 commit comments