Skip to content

Commit

Permalink
Don't use NTS for returned values via env attr
Browse files Browse the repository at this point in the history
User issue on IBM i may involve the driver not returning properly null
terminating strings correctly. The get_col handler seems to handle this
case, so let's do a CI run to see how badly this explodes on LUW.
  • Loading branch information
NattyNarwhal committed Dec 16, 2024
1 parent 660e8cd commit 64dae60
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ibm_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,8 @@ static int dbh_connect(pdo_dbh_t *dbh, zval *driver_options)
rc = SQLSetEnvAttr((SQLHENV)conn_res->henv, SQL_ATTR_UTF8, (SQLPOINTER)(intptr_t)SQL_TRUE, 0);
}
#endif /* PASE */
/* forced fixed length strings to be returned */
rc = SQLSetEnvAttr((SQLHENV)conn_res->henv, SQL_ATTR_OUTPUT_NTS, (SQLPOINTER)(intptr_t)SQL_FALSE, SQL_IS_INTEGER);

/* now an actual connection handle */
rc = SQLAllocHandle(SQL_HANDLE_DBC, conn_res->henv, &(conn_res->hdbc));
Expand Down

0 comments on commit 64dae60

Please sign in to comment.