Skip to content

Commit

Permalink
fix: init Resultset in Result when handling ddl statement
Browse files Browse the repository at this point in the history
  • Loading branch information
romberli authored and atercattus committed Jun 10, 2021
1 parent 689ccc2 commit 1a8a45a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/resp.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (c *Conn) handleOKPacket(data []byte) (*Result, error) {
var n int
var pos = 1

r := new(Result)
r := &Result{Resultset: &Resultset{}}

r.AffectedRows, _, n = LengthEncodedInt(data[pos:])
pos += n
Expand Down

3 comments on commit 1a8a45a

@pretty66
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why modify this line of code, it will cause mysql protocol parsing error!

@lance6716
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why modify this line of code, it will cause mysql protocol parsing error!

sorry for the inconvenience. could you open an issue to describe your problems?

@pretty66
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a pr to explain and fix this problem in detail
pr

Please sign in to comment.