-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Multiple Statement Execution (SERVER_MORE_RESULTS_EXISTS) #59
Comments
I think I want to support this. The main difficulty is that I don't know how many statements are contained in such a multiple statement query. Just counting the |
Do you need to know the number of statements in prior? As long as there are more packets, the |
I haven't come across that in the protocol documentation yet, do you know if it's documented somewhere? |
MySQL's website does not seem to document the flag at all. mysql_com.h defines the flag as follows: In my tests SERVER_MORE_RESULTS_EXISTS was set for all packets but those of the last “packet block” (i.e. the respective |
1 similar comment
MySQL's website does not seem to document the flag at all. mysql_com.h defines the flag as follows: In my tests SERVER_MORE_RESULTS_EXISTS was set for all packets but those of the last “packet block” (i.e. the respective |
Sorry, I closed the issue by accident and now I can not re-open it. :-/ |
Awesome, that's exactly what I needed for implementing this : ). I don't expect to find time for this right away, but it's certainly coming. |
I think https://github.com/Kijewski/node-mysql/commit/bbc107515311e146bfa0bf34b3d3e9898e035d27 should do the trick. I did a few tests and it worked for me. BUT I did neither use TDD nor even wrote any unit tests, yet. My commit would let |
Thanks. I'm quite the TDD nazi, so this won't make it into the driver without proper test coverage. So if you want to use it for now, I'd suggest you to use your own fork. However, the work is much appreciated regardless, I will use it as the base when setting out to bring this into the driver and give you credit for it. |
Thanks! Your code base was very well structured, so implementing this was quite easy. :) |
Is this for |
Yes, it is. For the same reason I needed this feature as well. |
Any progress on this? Supporting transactions in this way would be a big step forward, IMO. |
aarong: I haven't had a chance to adjust and test Kijewski's patch yet, but you can probably use it? |
Noticed that multiQuery is in the source... got a quick example on how to use it properly? |
Has anybody gotten multiple statements to work correctly? I haven't had any success... |
@aarong: My fork implements multiQuery. As I write my bachelor thesis atm, I won't find time to write a proper documentation or provide a proper patch for Felix. Have a look at the implementation to understand the callback value. |
Works great and easy to figure out -- thank you. Hopefully this can be pulled into the main code base some time soon. Best of luck with the thesis. |
+1 it would be super awesome to see this in the main code base. Named queues might be another way to implement multiple statements and transactions. For example, |
Check out this implementation... https://github.com/bminer/node-mysql-queues I like constructive criticism. :) |
I have added transaction support to node-mysql. Check out this project: |
Implemented in 2.0.0-alpha, see: http://debuggable.com/posts/releasing-node-mysql-2-0-0-alpha:4fb21c18-7f84-4e8c-a1ef-599bcbdd56cb |
Add NullTime struct Fixes mysqljs#59
Hello Felix,
how difficult would it be to support multiple statements in one query, like
BEGIN; SELECT 1; SELECT 2; COMMIT
?I think both having
query(...)
invoke the callback function multiple times and introduce something likemultiQuery(...)
, where the callback gets arrays of rows and fields, would work fine.Best regards,
René
The text was updated successfully, but these errors were encountered: