[PATCH] pdo_odbc: fix pdo_odbc_error's use of SQLGetDiagRec()
| From: | Joe Orton | Date: | Wed, 18 Jul 2012 15:48:07 +0000 |
| Subject: | [PATCH] pdo_odbc: fix pdo_odbc_error's use of SQLGetDiagRec() | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-61410@lists.php.net to get a copy of this message | ||
The "state" parameter passed to SQLGetDiagRec() needs to be six bytes
not 5; the attached patch fixes this, from Martin Osvald.
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index 84a147b..ca2808c 100755 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -114,7 +114,7 @@ void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, * diagnostic records (which can be generated by PRINT statements * in the query, for instance). */ while (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) { - char discard_state[5]; + char discard_state[6]; char discard_buf[1024]; SQLINTEGER code; rc = SQLGetDiagRec(htype, eh, recno++, discard_state, &code,
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index 84a147b..ca2808c 100755 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -114,7 +114,7 @@ void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, * diagnostic records (which can be generated by PRINT statements * in the query, for instance). */ while (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) { - char discard_state[5]; + char discard_state[6]; char discard_buf[1024]; SQLINTEGER code; rc = SQLGetDiagRec(htype, eh, recno++, discard_state, &code,