[CONJ-141] Batch Statement Rewrite: Support for ON DUPLICATE KEY ... Created: 2015-02-25 Updated: 2015-09-02 Resolved: 2015-07-22 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 1.1.8 |
| Fix Version/s: | 1.2.2 |
| Type: | Task | Priority: | Minor |
| Reporter: | Ben Rowland | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Long network delay between client and server. |
||
| Attachments: |
|
| Sprint: | Sprint connector/j 1.3.0 |
| Description |
|
This works fine for INSERT statements which do not specify an ON DUPLICATE KEY UPDATE clause. However for statements which do, the generated SQL cannot be parsed because the ON DUPLICATE ... clause is repeated for each set of values. E.g. for a prepared statement such as:
after setting the parameters multiple times and calling addBatch() then executeBatch(), the generated SQL looks like this:
I've written a small patch with a test case to duplicate the issue, along with a suggested fix. The test will fail against 1.1.8 but should pass with the suggested fix. |
| Comments |
| Comment by Diego Dupin [ 2015-07-22 ] | ||||||||||||||||||||||||||||||||
|
adding test case that handle different possibilities :
Resulting query send to database : |