question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support client side (emulated) prepared statements

See original GitHub issue

My team is using Vitess as a solution for scaling MySql horizontality, of course with the help of mysql jdbc. We are going in the direction of switching to a reactive stack and we tested spring-data-r2dbc + r2dbc-mysql. Vitess has a mysql server implementation, but not completely.

Communication between this driver and Vitess was very good until we tested the prepared statements. Vitess doesn’t support server-side prepared statements, as I can see, they were implemented here https://github.com/mirromutth/r2dbc-mysql/issues/4.

Vitess team had a similar report, and it looks like this feture will not be supported by them. https://github.com/vitessio/vitess/issues/4386

I also think it would be useful to have a configuration option, similar to existing mysql jdbc useServerPrepStmts configuration option. It’s left to the user to choose whether to use server side, or to save one database roundtrip and use client side prepared statements. https://vladmihalcea.com/how-does-the-mysql-jdbc-driver-handle-prepared-statements/

Also useServerPrepStmts is false by default for mysql jdbc, apparently here is equal to true, which is a change in behaviour for users who make migration from jdbc to reactive stack.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mirromutthcommented, Jan 10, 2020

Roadmap:

  • Add more unit tests for this feature and #96 .
  • Refactor integration tests, simplify those and split each MySQL version to each script instead of a large CI (it’s named build now).
  • Finish #87 , not sure, but it seems like a bug.
  • The next release is supposed to be early February, when there are no more major bugs.
0reactions
vuck3ocommented, Jan 18, 2020

Great, I can confirm that it works, thanks 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are client-side prepared statements? - Stack Overflow
Obviously, client-side prepared statements are statements that are prepared by the client, rather than the server.
Read more >
Using Prepared Statements - SingleStore Documentation
This configuration option may also be referred to as client-side prepared statement emulation or parameter interpolation. You can use the same ...
Read more >
sql - How can I create server-side prepared statements?
Prepared statements are the ability to set up a statement once, and then execute it many times with different parameters. They are designed...
Read more >
Emulated prepared statements VS prepared statements - PHP
Emulated Statements are as safe as real prepared statements. ... name, phone, address, email FROM client WHERE name LIKE :searchKey OR phone ...
Read more >
Prepared Statements - Manual - PHP
The MySQL database supports prepared statements. A prepared statement ... The API does not include emulation for client-side prepared statement emulation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found