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 @@ -575,6 +575,36 @@ var VariableQueries = []ScriptTest{
575575 },
576576 },
577577 },
578+ {
579+ Name : "locked warnings stay after query" ,
580+ SetUpScript : []string {
581+ "set @@lock_warnings = 1" ,
582+ "select 1/0,1/0" ,
583+ "select 1/1" ,
584+ },
585+ Assertions : []ScriptTestAssertion {
586+ {
587+ Query : "show warnings" ,
588+ Expected : []sql.Row {
589+ {"Warning" , 1365 , "Division by 0" },
590+ {"Warning" , 1365 , "Division by 0" }},
591+ },
592+ },
593+ },
594+ {
595+ Name : "unlocked warnings clear after query" ,
596+ SetUpScript : []string {
597+ "set @@lock_warnings = 0" ,
598+ "select 1/0,1/0" ,
599+ "select 1/1" ,
600+ },
601+ Assertions : []ScriptTestAssertion {
602+ {
603+ Query : "show warnings" ,
604+ Expected : []sql.Row {},
605+ },
606+ },
607+ },
578608 //TODO: do not override tables with user-var-like names...but why would you do this??
579609 //{
580610 // Name: "user var table name no conflict",
You can’t perform that action at this time.
0 commit comments