diff options
| author | Dan Kalowsky <kalowsky@php.net> | 2004-08-13 19:33:24 +0000 |
|---|---|---|
| committer | Dan Kalowsky <kalowsky@php.net> | 2004-08-13 19:33:24 +0000 |
| commit | 206c05dc47fc65d45c38be2de4a6c583050cd632 (patch) | |
| tree | dfbc0c89a7b45a9eff01e370d2b87da2e2263356 /ext/odbc | |
| parent | 1593aa0e5e962067887caa277752454adabb4a0f (diff) | |
| download | php-git-206c05dc47fc65d45c38be2de4a6c583050cd632.tar.gz | |
Checking in a patch by Dave Lawson (dlawson@masterytech.com) to correct
some of the behavior found in the odbc_fetch_*() functions. This patch
NEEDS to be tested on MS Access before a release is done with it. This
submission is to get it into the daily builds for testing.
Diffstat (limited to 'ext/odbc')
| -rw-r--r-- | ext/odbc/php_odbc.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 7e98b1cf05..c7eedc5c84 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -846,7 +846,7 @@ PHP_FUNCTION(odbc_prepare) convert_to_string_ex(pv_query); query = Z_STRVAL_PP(pv_query); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); result->numparams = 0; @@ -1269,7 +1269,7 @@ PHP_FUNCTION(odbc_exec) convert_to_string_ex(pv_query); query = Z_STRVAL_PP(pv_query); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { @@ -2797,7 +2797,7 @@ PHP_FUNCTION(odbc_tables) ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { @@ -2881,7 +2881,7 @@ PHP_FUNCTION(odbc_columns) ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { @@ -2961,7 +2961,7 @@ PHP_FUNCTION(odbc_columnprivileges) ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { @@ -3038,7 +3038,7 @@ PHP_FUNCTION(odbc_foreignkeys) fschema = Z_STRVAL_PP(pv_fschema); convert_to_string_ex(pv_ftable); ftable = Z_STRVAL_PP(pv_ftable); -#if defined(HAVE_DBMAKER) || defined (HAVE_IBMDB2) +#if defined(HAVE_DBMAKER) || defined(HAVE_IBMDB2) #define EMPTY_TO_NULL(xstr) \ if ((int)strlen((xstr)) == 0) (xstr) = NULL @@ -3055,7 +3055,7 @@ PHP_FUNCTION(odbc_foreignkeys) ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { @@ -3130,7 +3130,7 @@ PHP_FUNCTION(odbc_gettypeinfo) ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { @@ -3198,7 +3198,7 @@ PHP_FUNCTION(odbc_primarykeys) ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { @@ -3276,7 +3276,7 @@ PHP_FUNCTION(odbc_procedurecolumns) ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { @@ -3354,7 +3354,7 @@ PHP_FUNCTION(odbc_procedures) ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { @@ -3436,7 +3436,7 @@ PHP_FUNCTION(odbc_specialcolumns) ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { @@ -3517,7 +3517,7 @@ PHP_FUNCTION(odbc_statistics) ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { @@ -3591,7 +3591,7 @@ PHP_FUNCTION(odbc_tableprivileges) ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn); - result = (odbc_result *)emalloc(sizeof(odbc_result)); + result = (odbc_result *)ecalloc(1, sizeof(odbc_result)); rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { |
