Skip to content

Commit aa19071

Browse files
Nathan GabrielsonNathan Gabrielson
authored andcommitted
Tests for @@lock_warnings
1 parent 5d1ea2d commit aa19071

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

enginetest/queries/variable_queries.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff 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",

0 commit comments

Comments
 (0)