[CONC-354] mysql_stmt_fetch_column fails when truncated data is first Created: 2018-08-21  Updated: 2018-08-21

Status: Open
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Octavian Dima Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None
Environment:

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



 Description   

When using MariaDB Connector/C 3.0.1 or newer and there is truncated data (in first row) it will fail to fetch the column because

stmt->state == MYSQL_STMT_USE_OR_STORE_CALLED

When

stmt->mysql->methods->db_stmt_fetch_to_bind(stmt, row)

is called it won't set the state to MYSQL_STMT_USER_FETCHING (https://github.com/MariaDB/mariadb-connector-c/blob/master/libmariadb/mariadb_stmt.c#L1412).

First I thought it is a bug in the library I use (sqlpp11) but Roland played with it a little bit and considered it a bug in C Connector which later I tested it and had the same results.

In version 3.0.0-alpha calling

mysql_stmt_fetch

would set stmt->state to MYSQL_STMT_USER_FETCHING but newer versions won't do that and let it set to MYSQL_STMT_USE_OR_STORE_CALLED.

Original issue is on GitHub (https://github.com/rbock/sqlpp11-connector-mysql/issues/39).


Generated at Thu Feb 08 03:04:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.