mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
MySQL: Fix endianness, introduce mysql_eof() event
We were parsing MySQL using bigendian even though the protocol is specified as with "least significant byte first" [1]. This is most problematic when parsing length encoded strings with 2 byte length fields... Further, I think, the EOF_Packet parsing was borked, either due to testing the CLIENT_DEPRECATE_EOF with the wrong endianness, or due to the workaround in Resultset processing raising mysql_ok(). Introduce a new mysql_eof() that triggers for EOF_Packet's and remove the fake mysql_ok() Resultset invocation to fix. Adapt the mysql script and tests to account for the new event. This is a quite backwards incompatible change on the event level, but due to being quite buggy in general, doubt this matters to many. I think there is more buried, but this fixes the violation of the simple "SHOW ENGINE INNODB STATUS" and the existing tests continue to succeed... [1] https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_basic_dt_integers.html
This commit is contained in:
parent
1772a1bd6d
commit
672602dae7
10 changed files with 144 additions and 43 deletions
|
@ -1,31 +1,26 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
mysql ok, 0
|
||||
mysql request, 3, select @@version_comment limit 1
|
||||
mysql ok, 0
|
||||
mysql ok, 0
|
||||
mysql ok, 0
|
||||
mysql eof, T
|
||||
mysql result row, [Gentoo Linux mysql-5.0.54]
|
||||
mysql ok, 0
|
||||
mysql eof, F
|
||||
mysql request, 3, SELECT DATABASE()
|
||||
mysql ok, 0
|
||||
mysql ok, 0
|
||||
mysql eof, T
|
||||
mysql result row, []
|
||||
mysql ok, 0
|
||||
mysql eof, F
|
||||
mysql request, 2, test
|
||||
mysql ok, 0
|
||||
mysql request, 3, show databases
|
||||
mysql ok, 0
|
||||
mysql ok, 0
|
||||
mysql eof, T
|
||||
mysql result row, [information_schema]
|
||||
mysql result row, [test]
|
||||
mysql ok, 0
|
||||
mysql eof, F
|
||||
mysql request, 3, show tables
|
||||
mysql ok, 0
|
||||
mysql ok, 0
|
||||
mysql eof, T
|
||||
mysql result row, [agent]
|
||||
mysql ok, 0
|
||||
mysql eof, F
|
||||
mysql request, 4, agent\x00
|
||||
mysql ok, 0
|
||||
mysql eof, F
|
||||
mysql request, 3, create table foo (id BIGINT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, animal VARCHAR(64) NOT NULL, name VARCHAR(64) NULL DEFAULT NULL) ENGINE = MYISAM
|
||||
mysql ok, 0
|
||||
mysql request, 3, insert into foo (animal, name) values ("dog", "Goofy")
|
||||
|
@ -33,25 +28,22 @@ mysql ok, 1
|
|||
mysql request, 3, insert into foo (animal, name) values ("cat", "Garfield")
|
||||
mysql ok, 1
|
||||
mysql request, 3, select * from foo
|
||||
mysql ok, 0
|
||||
mysql ok, 0
|
||||
mysql eof, T
|
||||
mysql result row, [1, dog, Goofy]
|
||||
mysql result row, [2, cat, Garfield]
|
||||
mysql ok, 0
|
||||
mysql eof, F
|
||||
mysql request, 3, delete from foo where name like '%oo%'
|
||||
mysql ok, 1
|
||||
mysql request, 3, delete from foo where id = 1
|
||||
mysql ok, 0
|
||||
mysql request, 3, select count(*) from foo
|
||||
mysql ok, 0
|
||||
mysql ok, 0
|
||||
mysql eof, T
|
||||
mysql result row, [1]
|
||||
mysql ok, 0
|
||||
mysql eof, F
|
||||
mysql request, 3, select * from foo
|
||||
mysql ok, 0
|
||||
mysql ok, 0
|
||||
mysql eof, T
|
||||
mysql result row, [2, cat, Garfield]
|
||||
mysql ok, 0
|
||||
mysql eof, F
|
||||
mysql request, 3, delete from foo
|
||||
mysql ok, 1
|
||||
mysql request, 3, drop table foo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue