-
Notifications
You must be signed in to change notification settings - Fork 102
Large array is parsed as an object #59
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
Comments
Hi, good catch its should be array. Funny thing is that in php you can decide when unserialising json is array|object so event if I decode as object still you can do json_encode($json, true) and get array... Fix and test should be soon tx! |
Also, be informed that in-place updates make empty holes between keys and values as described in the spec Steps to reproduce (redproduced from MySQL 8.0.16+):
This will create 3-byte hole in the "name" value so you need to advance the stream. |
hmm even is you do
it will work but you get strange json
its take from Monica - ca and add to types 🙄 raw binary data
|
I don't see any other way to skip unused offset like it was done here johnyang007/mysql-binlog-connector-java@2fdea43 furthermore I don't see any solution even in mysql-server code https://github.com/mysql/mysql-server/blob/8.0/sql/json_binary.cc
Its should work as we read binary data and still it's not cutting correctly. |
Hi, In my lib I calculate unused space and skip it using Advance method I think we don't see it in mysql-server code because it is written in C and it accesses memory directly using offsets(it doesn't read the stream in cursor-like style like our libraries do). |
Ok its fixed now, added new test based on yangkun code to verified this and looks good. Also I redone all code based on mysql server code. |
php-mysql-replication/src/MySQLReplication/JsonBinaryDecoder/JsonBinaryDecoderService.php
Line 74 in 064a987
Hi, again.
I think I spotted a bug when looking at the class.
Since mysql-binlog-connector-java hasn't been supported for a while I was looking for how different libraries handle empty holes made by partial updates in JSON(some complain it occurs in MySQL 8.0.16+).
The text was updated successfully, but these errors were encountered: