From bec7578680aafc30fde37553436839d1b376c71a Mon Sep 17 00:00:00 2001 From: James Cor Date: Tue, 5 Nov 2024 15:07:16 -0800 Subject: [PATCH 1/2] always unwrap db --- sql/planbuilder/select.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/planbuilder/select.go b/sql/planbuilder/select.go index 511bde12a2..af180f28d0 100644 --- a/sql/planbuilder/select.go +++ b/sql/planbuilder/select.go @@ -17,6 +17,7 @@ package planbuilder import ( "fmt" + ast "github.com/dolthub/vitess/go/vt/sqlparser" "github.com/dolthub/go-mysql-server/sql" @@ -211,12 +212,11 @@ func (b *Builder) currentDb() sql.Database { if err != nil { b.handleErr(err) } - - if privilegedDatabase, ok := database.(mysql_db.PrivilegedDatabase); ok { - database = privilegedDatabase.Unwrap() - } b.currentDatabase = database } + if privilegedDatabase, ok := b.currentDatabase.(mysql_db.PrivilegedDatabase); ok { + b.currentDatabase = privilegedDatabase.Unwrap() + } return b.currentDatabase } From 5f497078195ee86d3de658b9989653e21f87bc08 Mon Sep 17 00:00:00 2001 From: jycor Date: Tue, 5 Nov 2024 23:09:22 +0000 Subject: [PATCH 2/2] [ga-format-pr] Run ./format_repo.sh to fix formatting --- sql/planbuilder/select.go | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/planbuilder/select.go b/sql/planbuilder/select.go index af180f28d0..d3c3cec402 100644 --- a/sql/planbuilder/select.go +++ b/sql/planbuilder/select.go @@ -17,7 +17,6 @@ package planbuilder import ( "fmt" - ast "github.com/dolthub/vitess/go/vt/sqlparser" "github.com/dolthub/go-mysql-server/sql"