Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix affected rows conversoin bug when the number of row is large #34

Conversation

takaidohigasi
Copy link
Contributor

related issue

#29

#16 ?

how to reproduce error

execute query which affected rows is over 2 byte-integer

taka-h@127.0.0.1 [sbtest] > desc sbtest1;
+-------+-----------+------+-----+---------+----------------+
| Field | Type      | Null | Key | Default | Extra          |
+-------+-----------+------+-----+---------+----------------+
| id    | int(11)   | NO   | PRI | NULL    | auto_increment |
| c     | char(120) | NO   |     |         |                |
+-------+-----------+------+-----+---------+----------------+
4 rows in set (0.00 sec)

taka-h@127.0.0.1 [sbtest] > update sbtest1 set c='fuga' where id<100000;
Query OK, 99999 rows affected (0.24 sec)
Rows matched: 99999  Changed: 99999  Warnings: 0

Note

the type of 'affected rows' is packet-Protocol::LengthEncodedInteger, LengthEncodedInt is appropriate

refs.
https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::LengthEncodedInteger
https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html

@takaidohigasi
Copy link
Contributor Author

@40t I'm glad if you take a look! thanks.

@40t 40t merged commit ad0e00a into 40t:master Mar 27, 2020
@40t
Copy link
Owner

40t commented Mar 27, 2020

thx ^_^

liu2178855 pushed a commit to liu2178855/go-sniffer that referenced this pull request Oct 26, 2020
…sion-bug-when-the-numbers-of-row-is-large

fix affected rows conversoin bug when the number of row is large
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants