Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions enginetest/queries/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -4996,6 +4996,20 @@ Select * from (
{"version_comment", "Dolt"}, {"version_compile_machine", ""}, {"version_compile_os", ""}, {"version_compile_zlib", ""}, {"wait_timeout", 28800}, {"windowing_use_high_precision", 1},
},
},
{
Query: `SHOW VARIABLES WHERE "1" and variable_name = 'autocommit'`,
Expected: []sql.Row{
{"autocommit", 1},
},
},
{
Query: `SHOW VARIABLES WHERE "0" and variable_name = 'autocommit'`,
Expected: []sql.Row{},
},
{
Query: `SHOW VARIABLES WHERE "abc" and variable_name = 'autocommit'`,
Expected: []sql.Row{},
},
{
Query: `SHOW GLOBAL VARIABLES LIKE '%mode'`,
Expected: []sql.Row{
Expand Down
7 changes: 6 additions & 1 deletion sql/rowexec/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,12 @@ func (b *BaseBuilder) buildShowVariables(ctx *sql.Context, n *plan.ShowVariables
if err != nil {
return nil, err
}
if !res.(bool) {
res, _, err = types.Boolean.Convert(res)
if err != nil {
ctx.Warn(1292, err.Error())
continue
}
if res.(int8) == 0 {
continue
}
}
Expand Down