Skip to content

Commit

Permalink
fix issue related to SELECT FOR UPDATE
Browse files Browse the repository at this point in the history
  • Loading branch information
sijms committed Mar 19, 2024
1 parent 495e7c6 commit 800bce3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion v2/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,9 @@ func (stmt *Stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (dr
dataSet := &DataSet{}
err = stmt.read(dataSet)
if !errors.Is(err, network.ErrConnReset) {
if isBadConn(err) {
stmt.connection.setBad()
}
return nil, err
}
}
Expand All @@ -1294,7 +1297,6 @@ func (stmt *Stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (dr
if isBadConn(err) {
//tracer.Print("Error: ", err)
stmt.connection.setBad()
return nil, err
}
return nil, err
}
Expand Down
5 changes: 4 additions & 1 deletion v2/data_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ func (dataSet *DataSet) load(session *network.Session) error {
return err
}
columnCount += num * 0x100
if columnCount > dataSet.columnCount {
if dataSet.columnCount == 0 {
dataSet.columnCount = columnCount
}
//if columnCount > dataSet.columnCount {
// dataSet.columnCount = columnCount
//}
if len(dataSet.currentRow) != dataSet.columnCount {
dataSet.currentRow = make(Row, dataSet.columnCount)
}
Expand Down

0 comments on commit 800bce3

Please sign in to comment.