-
Notifications
You must be signed in to change notification settings - Fork 122
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
Tests are not passed #7
Comments
Ok, I have updated to 5.6.19 and I see the same error. (If you saw my [now] deleted message, I was still running the old 5.5.40 version, I had to actually restart my machine not just the MySQL server to switch versions). Please hold on, I'll see what's going on... |
* Fixes error message posted in #7 * Reveals new error message for MySQL 5.6
I just committed a fix for the first error you have posted and now the test reveals the errors related to the different row format of MySQL 5.6. Now the error I receive is:
Something has changed in the log format and the parser is reading past the end of the buffer. Will continue debugging tomorrow... |
Also, I did try using the |
@numtel Great, keep going! 👍 |
Okay, the error about access beyond buffer length is directly related to the I am working on a commit that makes it possible to have the checksum turned on (although it won't verify it being correct). It appears that there is also a different version of some field types in 5.6. So expect another commit regarding that. |
Oh, it recalls me that, I intended to detect |
No worries, skipping past the checksum is not too complicated. There's a javascript implementation of the crc32 algorithm but I'm not going to implement that right now. This commit makes almost all of the tests pass now!
Looks like something going on in one of the time data types. 😎 Then onto testing other versions of MySQL I guess... |
MySQL provides, in the internals manual, the Date and Time Data Type Representation. For MySQL >= 5.6.4,
The following is output from the test suite:
MySQL < 5.6.4 values are very easy to parse: (flip the bits and subtract 1 for negatives) > parseInt('011111111111010110100111', 2)
< 8385959 // 838:59:59
> parseInt('000000000010100111010100', 2)
< 10708 // 01:07:08 It is strange though that this does not match the documentation linked above.
What is appearing is: HH×10000 + MM×100 + SS I am not able to see how the new data corresponds with the documentation. The 10 bit set for the number 838 seems completely missing from the value for > 838..toString(2)
< "1101000110" That documentation page may not be applicable to the binary log though. It's hard to tell exactly. @nevill This is where I am right now with the type differences. The With this fix complete, all MySQL versions > 5.1.15 should be compatible according to the ROWS_EVENT documentation. Right now I've got MySQL 5.6.19 running locally and 5.5.40 in a Vagrant instance. I haven't used Docker yet but in order to test more versions, I'm thinking I'll look into seeing if it's possible to configure Docker instances to run the tests with each minor version of MySQL from 5.1 -> 5.6. (and maybe 5.7?) |
Woo! 😺 Found the original functions in the MySQL source: |
* Used instead of TIME in MySQL > 5.6.4 * Fractional second support * DATETIME2, TIMESTAMP2 still todo #7
* Used instead of TIME in MySQL > 5.6.4 * Fractional second support * DATETIME2, TIMESTAMP2 still todo #7
* Used instead of TIME in MySQL > 5.6.4 * Fractional second support * DATETIME2, TIMESTAMP2 still todo #7
* Used instead of TIME in MySQL > 5.6.4 * Fractional second support * DATETIME2, TIMESTAMP2 still todo #7
Got the Commands to run the new time tests: $ node_modules/.bin/nodeunit --reporter=minimal test/types.js -t time_fraction
$ node_modules/.bin/nodeunit --reporter=minimal test/types.js -t time_no_fraction
|
* Used instead of TIME in MySQL > 5.6.4 * Fractional second support * DATETIME2, TIMESTAMP2 still todo #7
* Used instead of DATETIME in MySQL >= 5.6.4 * Fractional second support to milliseconds * TIMESTAMP2 still todo * Related issue: #7
* Used instead of DATETIME in MySQL >= 5.6.4 * Fractional second support to milliseconds * TIMESTAMP2 still todo * Related issue: #7
* All tests now pass with MySQL server 5.6.19 and 5.5.40 * Wrap up #7
@nevill With that last commit, you should have no problem using |
@nevill Travis CI support will be ready soon, I will make it run the tests using all of the latest patch releases:
I just got it working with 5.1.73: Time to sleep now but the other versions will be very much the same. And, I have to make the tests actually quit on success. Right now, the process keeps running because ZongJi does not close its connection after the last test. |
@numtel Awesome, wish you good luck on travis. 👍 But, the tests are still not passed on my MySQL 5.6.13.
|
* Tested 5.6.13 in process, should work * querySequence timeout increased from 200ms=>800ms * nevill#7
* Tested 5.6.13 in process, should work * querySequence timeout increased from 200ms=>800ms * nevill#7
* Tested 5.6.13 in process, should work * querySequence timeout increased from 200ms=>800ms * #7
Check out these test results: https://travis-ci.org/nevill/zongji/builds/47205912 The tests should probably now pass for you on your machine. I did run 5.6.13 on Travis successfully but for some reason Travis would not work with 4 MySQL servers running at the same time (see these results) so I have limited the test to 5.1.73, 5.5.41, and 5.6.22 (newest patch versions of each minor release). The output you posted about the undefined variable is due to the test looking for the events in ZongJi too soon after running the query in MySQL. Before this commit, the interval was 200ms. In order to make the tests run smoothly on Travis CI, the new default is 800ms. If you still experience the same error, you may specify this delay using an environment variable when running the tests. Like this: $ QUERY_DELAY=1200 npm test |
…eout * Max wait: 3000ms * Removed QUERY_DELAY environment variable configuration #7
@nevill With the commit I just posted, the delay has been replaced with simply waiting (up to 3000ms) for the events to appear. You should no longer see that error at all and the tests run about 3x faster than before. |
Finally, I see why I cannot have tests passed. It relates to Since there is one gotcha on this option, I would remove it from |
When I try to run with
npm test
, it's failedI also try to run them one by one. For example,
@numtel Is there anything missing? Or MySQL version matters? (I'm testing against 5.6.13)
The text was updated successfully, but these errors were encountered: