[MDEV-12579] Incorrect arguments to mysqld_stmt_execute when using LOBs Created: 2017-04-24 Updated: 2017-09-26 Resolved: 2017-06-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Prepared Statements |
| Affects Version/s: | 10.2.5 |
| Fix Version/s: | 10.2.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | FLAESCH Sebastien | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux Debian 8.6 |
||
| Attachments: |
|
| Sprint: | 10.2.7-1 |
| Description |
|
When binding LOBs with MYSQL_TYPE_VAR_STRING or MYSQL_TYPE_LONG_BLOB and providing data with mysql_stmt_send_long_data(), we get the following error:
The same C code works find with Oracle MySQL client. |
| Comments |
| Comment by FLAESCH Sebastien [ 2017-04-24 ] | |||||||||||||||||||||||
|
Server debug log:
| |||||||||||||||||||||||
| Comment by Georg Richter [ 2017-04-25 ] | |||||||||||||||||||||||
|
Hi, I cannot repeat the bug (for testcase see mdev12579.c) in attachments. | |||||||||||||||||||||||
| Comment by FLAESCH Sebastien [ 2017-04-25 ] | |||||||||||||||||||||||
|
A quick gdb session shows that we set buffer_type at first call of mysql_stmt_bind_param():
Anything else I could check? Is there a way to produce some client API debug log to make sure we use it properly? I will check with older versions of MariaDB... I am quite sure this code was working find before 10.2.5 | |||||||||||||||||||||||
| Comment by Georg Richter [ 2017-04-25 ] | |||||||||||||||||||||||
|
Ok, it is reproducable when specifying MYSQL_TYPE_VAR_STRING. Works fine with MYSQL_TYPE_STRING, and MYSQL_TYPE_BLOB. | |||||||||||||||||||||||
| Comment by FLAESCH Sebastien [ 2017-04-25 ] | |||||||||||||||||||||||
|
This is good news. | |||||||||||||||||||||||
| Comment by Georg Richter [ 2017-04-25 ] | |||||||||||||||||||||||
|
The bug is in server. Client sends correctly type MYSQL_TYPE_VAR_STRING, server converts it internally to MYSQL_TYPE_VARCHAR sql_type.cc line 145:
and afterwards function is_param_long_data_type function fails:
| |||||||||||||||||||||||
| Comment by Georg Richter [ 2017-04-26 ] | |||||||||||||||||||||||
|
attached test case passes with MySQL 5.7.15 and MariaDB 10.1.21 | |||||||||||||||||||||||
| Comment by FLAESCH Sebastien [ 2017-05-23 ] | |||||||||||||||||||||||
|
Any news on this one? Was expecting to get a fix in 10.2.6 ... | |||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2017-06-22 ] | |||||||||||||||||||||||
|
revision-id: 1d90a8304bf0983a91044ca451129552388b026d (mariadb-10.2.6-54-g1d90a8304bf)
Parameters can be MYSQL_TYPE_VARCHAR for long data load. — | |||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2017-06-22 ] | |||||||||||||||||||||||
|
github branch is bb-10.2- | |||||||||||||||||||||||
| Comment by Alexander Barkov [ 2017-06-22 ] | |||||||||||||||||||||||
|
Ok to push! Thanks. | |||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2017-06-22 ] | |||||||||||||||||||||||
|
10.3 has it already fixed, so only test suite should be merged. | |||||||||||||||||||||||
| Comment by FLAESCH Sebastien [ 2017-09-26 ] | |||||||||||||||||||||||
|
Verified with 10.2.8 |