-
Notifications
You must be signed in to change notification settings - Fork 63
Data is truncated with MariaDB Connector/C 3.0.1+ #39
Comments
That is a surprise! I will need a few days to look into that. It would be great if you could provide a pull request with a test that demonstrates the current failure. |
I forgot to add the response, I added 1 test with 3 cases (see #40), first 2 should pass and the last one should fail. |
Thanks a lot! |
No problem :) |
Good news: I can reproduce the effect on my local machine. |
Nice! <3 |
After playing around with this a bit, I tend to consider this a bug in the client library. Using mysql, after calling Using the mariadb connector, if there is
The latter is an invalid state for calling Maybe you can double check and file an issue for the connector library, in case you come to the same conclusion? |
Sure, I will do that and let you know. I will need few days to do it, I am a little bit busy this week. |
I played around with it too and it is as you said. When I use MySQL When using MariaDB
I created a bug report on MariaDB Connector/C bug tracker (https://jira.mariadb.org/browse/CONC-354). |
Thanks for testing and the bug report! |
No problem :) |
When using MariaDB Connector/C 3.0.1 or newer the data is truncated because of this line
meta_data.bound_text_buffer.resize(8);
in bind_result_t::_bind_text_result, which will get just 8 characters from database and later will fail at
mysql_stmt_fetch_column(_handle->mysql_stmt, _handle->result_params.data() + r.index, r.index, 0);
in bind_result_t::next_impl() with error
MySQL: Fetch column after reallocate failed: error-code: 1, stmt-error: , stmt-errno: 2051
A possible fix would be to resize it to the cloumn's length
OS: Windows
Arch: x64
Compiler: MSVC++ 2017 (latest)
Standard: C++17
MariaDB version: 10.3.8 (Dockerized container, image mariadb:latest)
MariaDB Connector/C: 3.0.6
The text was updated successfully, but these errors were encountered: