Skip to content
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

PoC: Pipelining support #197

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

casperisfine
Copy link
Contributor

Ref: #189

This is the most basic API possible and uses a hack, but it demonstrate that it's possible to do pipelining with MySQL API.

Ref: trilogy-libraries#189

This is the most basic API possible and uses a hack, but it demonstrate
that it's possible to do pipelining with MySQL API.

VALUE results = rb_ary_new2(count);
for (index = 0; index < count; index++) {
ctx->conn.packet_parser.sequence_number = 1; // HACK
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if the sequence number can really be assumed to be always 1. From what I could see it's the case, but we could also record the sequence number of each query.

Copy link
Contributor

@composerinteralia composerinteralia Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't be 1 if the query is long enough to span multiple MySQL packets (e.g. connection.query('x' * 0xFFFFFE) will write 2 MySQL packets, so we'd need the sequence number here to be 2).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I think we need to store these values in an array somewhere to restore them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants