Skip to content

always pass handshakeInitializationPacket to ChangeUser #618

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

Merged
merged 3 commits into from
Oct 23, 2013

Conversation

seanmonstar
Copy link
Collaborator

If the queue is empty before calling a ChangeUser sequence, the sequence will be started without being passed the handshake packet. This makes sure it gets passed.

Additionally, validateEnqueue now has a test that handeshake() was called before changeUser().

fixes #374

@sidorares
Copy link
Member

LGTM
Can we have a test for this? I guess it would be connect + ChangeUser after some timeout (say, 2s) to make sure queue is empty

If the queue is empty before calling a ChangeUser sequence, the sequence will be started without being passed the handshake packet. This makes sure it gets passed.

Additionally, validateEnqueue now has a test that handeshake() was called before changeUser().

fixes mysqljs#374
@seanmonstar
Copy link
Collaborator Author

added said test.

@sidorares
Copy link
Member

It's actually possible to run it on travis - see https://github.com/sidorares/nodejs-mysql-native/blob/master/.travis.yml

@seanmonstar
Copy link
Collaborator Author

i just copied what was in test-change-user.js.

@seanmonstar
Copy link
Collaborator Author

poke

@dougwilson
Copy link
Member

I believe you really need to alter your test (even though you coped it from another test) so that it runs on Travis CI first.

run changeUser tests on travis
@seanmonstar
Copy link
Collaborator Author

Ok, fixed up the tests so they can run on Travis.

Noticed that changeUser({ user: 'does-not-exist' }) did not cause an error on my branch, or on master. I made it try to change the database instead, and it errored that way.

@sidorares
Copy link
Member

👍

@felixge
Copy link
Collaborator

felixge commented Oct 22, 2013

@seanmonstar LGTM for most parts - thanks! I gave you git/npm push access, feel free to merge release when you're happy with it.

My only nitpick: It seems like there is some code duplication now, as the logic for handling Sequences.ChangeUser exists in two places after this patch.

@seanmonstar
Copy link
Collaborator Author

@felixge good point. i included another commit to consolidate that code into a single method. r?

@felixge
Copy link
Collaborator

felixge commented Oct 23, 2013

LGTM, feel free to merge when you're ready.

seanmonstar added a commit that referenced this pull request Oct 23, 2013
always pass handshakeInitializationPacket to ChangeUser
@seanmonstar seanmonstar merged commit 59fc0d2 into mysqljs:master Oct 23, 2013
@seanmonstar seanmonstar deleted the change-user-packet branch October 23, 2013 17:28
@rwky rwky mentioned this pull request Oct 25, 2013
dveeden pushed a commit to dveeden/mysql that referenced this pull request Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

changeUser: Cannot call method 'scrambleBuff' of undefined
4 participants