[ODBC-58] Any field going after a TEXT field in the selecion list, is fetched incorrectly Created: 2016-09-30  Updated: 2016-10-27  Resolved: 2016-10-27

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: None
Affects Version/s: None
Fix Version/s: 3.0.0, 2.0.13

Type: Bug Priority: Major
Reporter: Lawrin Novitsky Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by CONC-205 Any field going after a TEXT field in... Closed

 Description   

To repeat:

ODBC_TEST(t_odbc58)

{ SQLLEN len1, len2, len3; SQLCHAR text_col[96001]; SQLINTEGER int_col; SQLSMALLINT smint_col; OK_SIMPLE_STMT(Stmt, "DROP table if exists t_odbc58"); OK_SIMPLE_STMT(Stmt, "CREATE TABLE t_odbc58 (text_col TEXT, smint_col SMALLINT, int_col INT)"); OK_SIMPLE_STMT(Stmt, "INSERT INTO t_odbc58 VALUES('data01', 21893, 1718038908), ('data2', -25734, -1857802040)"); CHECK_STMT_RC(Stmt, SQLBindCol(Stmt, 1, SQL_C_CHAR, (SQLPOINTER)text_col, 96000, &len1)); CHECK_STMT_RC(Stmt, SQLBindCol(Stmt, 2, SQL_C_SHORT, (SQLPOINTER)&smint_col, 4, &len2)); CHECK_STMT_RC(Stmt, SQLBindCol(Stmt, 3, SQL_C_LONG, (SQLPOINTER)&int_col, 4, &len3)); OK_SIMPLE_STMT(Stmt, "SELECT text_col, smint_col, int_col FROM t_odbc58"); CHECK_STMT_RC(Stmt, SQLFetch(Stmt)); is_num(len1, 6); IS_STR(text_col, "data01", len1 + 1); is_num(len2, 2); is_num(smint_col, 21893); is_num(len3, 4); is_num(int_col, 1718038908); CHECK_STMT_RC(Stmt, SQLFetch(Stmt)); is_num(len1, 5); IS_STR(text_col, "data2", len1 + 1); is_num(len2, 2); is_num(smint_col, -25734); is_num(len3, 4); is_num(int_col, -1857802040); CHECK_STMT_RC(Stmt, SQLFreeStmt(Stmt, SQL_CLOSE)); OK_SIMPLE_STMT(Stmt, "DROP table if exists t_odbc58"); return OK; }

But the bug is in the Connector/C in fact.



 Comments   
Comment by Lawrin Novitsky [ 2016-10-27 ]

The bug in C/C has been fixed, and fix pushed

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