Skip to content

Commit

Permalink
bugfix: check if options exist before using
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <andres@planetscale.com>
  • Loading branch information
systay committed Dec 17, 2024
1 parent 5ada428 commit fbc3dbb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions go/vt/proto/query/query_extra.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions go/vt/vttablet/tabletserver/query_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ func (qre *QueryExecutor) execDBConn(conn *connpool.Conn, sql string, wantfields
if err != nil {
return nil, err
}
if qre.options.FetchLastInsertId {
if qre.options.ShouldFetchLastInsertID() {
err := qre.fetchLastInsertID(ctx, conn, exec)
if err != nil {
return nil, err
Expand All @@ -1151,7 +1151,7 @@ func (qre *QueryExecutor) execStatefulConn(conn *StatefulConnection, sql string,
if err != nil {
return nil, err
}
if qre.options.FetchLastInsertId {
if qre.options.ShouldFetchLastInsertID() {
err = qre.fetchLastInsertID(ctx, conn.UnderlyingDBConn().Conn, exec)
if err != nil {
return nil, err
Expand Down

0 comments on commit fbc3dbb

Please sign in to comment.