Skip to content

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
Collaborator

@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