[CONJ-22] Java Client library does not support useServerPrepStmts Created: 2013-02-06 Updated: 2016-05-12 Resolved: 2015-09-15 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 1.1.0, 1.2.0 |
| Fix Version/s: | 1.3.0 |
| Type: | Epic | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Epic Name: | Use server prepareStatement | ||||||||||||||||||||
| Sprint: | Sprint connector/j 1.3.0 | ||||||||||||||||||||
| Description |
|
To enable prepared statements on the server side, MySQL Connector/J provides useServerPrepStmts parameter. The provided test case checks the global value of Prepared_stmt_count status variable, then attempts to prepare a statement on a connection with useServerPrepStmts, then checks the variable value again. Output with MariaDB client library 1.1.0:
With MySQL Connector/J 5.1.23:
Test case:
|
| Comments |
| Comment by Vladislav Vaintroub [ 2013-02-06 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is a feature request, a rather big feature (i.e connector-big , not server-big The driver documentation https://kb.askmonty.org/en/about-the-mariadb-java-client/ lists all supported parameters and also states This is basically what this bug is all about. The only unique feature that server side prepared statement allows is possibility to get result set metadata of the prepared statement without execution ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-02-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Strictly speaking, apart from the unique feature, there is probably also performance at stake (I didn't run benchmarks, but I expect server-side prepared statements to be faster); but otherwise I agree, it's a feature request, and not even a critical one, considering the number of problems with prepared statements on the server side. Sorry for not finding it on the KB page. Unfortunately, the lack of the feature described in | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andy Shulman [ 2013-11-03 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I'd just like to +1 this issue. I just switched from the Oracle JDBC driver because it didn't support PreparedStatement rewriting. I'm sad to lose server-side PreparedStatements as they are quite a bit faster for my application (though rewriting is a much bigger increase). Getting both features in one driver would be fantastic. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Paolo Bazzi [ 2015-07-06 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Using the new MariaDB JDBC Driver 1.1.9 I'm still not able to show that server-prepared statements are working. Using the attached test case from above still prints out the following: If I switch the testcase and use the mysql-connector-java-5.1.32-bin.jar JDBC driver, the output is as expected: Could you check again, if this issues was really solved with 1.1.9? | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by diego dupin (Inactive) [ 2015-07-06 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The PreparedStatement rewriting has been fixed, but that doesn't include this issue. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marcel Schneider [ 2016-01-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I verified this with version 1.3.3, and it seems that the useServerPrepStmts parameter still does not work. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marcel Schneider [ 2016-01-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Shall i make a new ticket? | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2016-01-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi, some tests case i've run:
console result is : | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marcel Schneider [ 2016-01-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I can reproduce your test cases: they work as intended. So I went back to my case which doesn't work. After some analyses I found this: | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marcel Schneider [ 2016-05-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Were you able to reproduce my results (using literals instead of binds)? Showing that the issue is still open? |