[ODBC-19] Using same pointer as StrLen_Or_IndPtr for several coulmns, may cause errors if one of columns bound as SQL_C_WCHAR Created: 2015-03-11 Updated: 2015-05-30 Resolved: 2015-03-12 |
|
| Status: | Closed |
| Project: | MariaDB Connector/ODBC |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Lawrin Novitsky | Assignee: | Lawrin Novitsky |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The testcase. In this case strings get truncated. , c_ref[]= {'S', 'k', 'y', 0}; a[0]= b[0]= c[0]= 0; OK_SIMPLE_STMT(Stmt, "DROP table IF EXISTS t_odbc19"); OK_SIMPLE_STMT(Stmt, "CREATE table t_odbc19(a varchar(10), b varchar(10), c varchar(10))"); OK_SIMPLE_STMT(Stmt, "insert into t_odbc19(a, c) values( 'MariaDB', 'Sky')"); OK_SIMPLE_STMTW(Stmt, L"select a, b, c from t_odbc19"); CHECK_STMT_RC(Stmt, SQLBindCol(Stmt, 1, SQL_C_WCHAR, a, sizeof(a), &lenPtr)); CHECK_STMT_RC(Stmt, SQLFetch(Stmt)); IS_WSTR(a, a_ref, sizeof(a_ref)/sizeof(SQLWCHAR)); CHECK_STMT_RC(Stmt, SQLFreeStmt(Stmt, SQL_CLOSE)); OK_SIMPLE_STMT(Stmt, "DROP table t_odbc19"); return OK; |
| Comments |
| Comment by Lawrin Novitsky [ 2015-03-12 ] |
|
The testcase and the fix have been pushed to the master branch, commit dc3068121a9115e9a7a0ba20a0ebef2d60790986 |