[CONC-388] unpack_fields does not set def_length Created: 2019-01-28 Updated: 2019-02-05 Resolved: 2019-02-05 |
|
| Status: | Closed |
| Project: | MariaDB Connector/C |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Sylvain Falardeau | Assignee: | Georg Richter |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | crash | ||
| Environment: |
ArchLinux, mariadb-libs 10.3.12-4 |
||
| Description |
|
I was having problems after upgrading my system. It was using libmysqlclient.so.18 and This function sets multiple char* and length fields. At the end (https://github.com/MariaDB/mariadb-connector-c/blob/3.1/libmariadb/mariadb_lib.c#L810), it handles the default_value |
| Comments |
| Comment by Georg Richter [ 2019-02-05 ] | |
|
default value and length are only used for api function
| |
| Comment by Georg Richter [ 2019-02-05 ] | |
|
Update: In C/C 3.0.9 values for def and def_length will be NULL/zero. | |
| Comment by Sylvain Falardeau [ 2019-02-05 ] | |
|
Having def=NULL and def_length=0 will be fine for the code in Haskell that was causing the problem: https://github.com/paul-rouse/mysql/blob/master/Database/MySQL/Base/Types.hsc#L221 The peekS function was calling memcpy to simply copy the char* as an Haskell ByteString. This will simply Thank you. |