Skip to content

Commit bec7578

Browse files
author
James Cor
committed
always unwrap db
1 parent e48937b commit bec7578

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sql/planbuilder/select.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package planbuilder
1717
import (
1818
"fmt"
1919

20+
2021
ast "github.com/dolthub/vitess/go/vt/sqlparser"
2122

2223
"github.com/dolthub/go-mysql-server/sql"
@@ -211,12 +212,11 @@ func (b *Builder) currentDb() sql.Database {
211212
if err != nil {
212213
b.handleErr(err)
213214
}
214-
215-
if privilegedDatabase, ok := database.(mysql_db.PrivilegedDatabase); ok {
216-
database = privilegedDatabase.Unwrap()
217-
}
218215
b.currentDatabase = database
219216
}
217+
if privilegedDatabase, ok := b.currentDatabase.(mysql_db.PrivilegedDatabase); ok {
218+
b.currentDatabase = privilegedDatabase.Unwrap()
219+
}
220220
return b.currentDatabase
221221
}
222222

0 commit comments

Comments
 (0)