com php-src: migrate SQLAllocStmt for ODBC 3.0 compliance: ext/odbc/php_odbc.c ext/odbc/php_odbc_includes.h
| From: | Anatol Belski | Date: | Fri, 17 Apr 2015 15:06:00 +0000 |
| Subject: | com php-src: migrate SQLAllocStmt for ODBC 3.0 compliance: ext/odbc/php_odbc.c ext/odbc/php_odbc_includes.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86351@lists.php.net to get a copy of this message | ||
Commit: db1596c8b14aca00938c7b301db377f6355a5127
Author: Anatol Belski <ab@php.net> Fri, 17 Apr 2015 16:09:35 +0200
Parents: b75e30c6675ef41e5e90140a1eacffa19c16ba2d
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=db1596c8b14aca00938c7b301db377f6355a5127
Log:
migrate SQLAllocStmt for ODBC 3.0 compliance
Changed paths:
M ext/odbc/php_odbc.c
M ext/odbc/php_odbc_includes.h
Diff:
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 0606eba..6945b50 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -1181,7 +1181,7 @@ PHP_FUNCTION(odbc_prepare)
result->numparams = 0;
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
@@ -1609,7 +1609,7 @@ PHP_FUNCTION(odbc_exec)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
efree(result);
@@ -3110,7 +3110,7 @@ PHP_FUNCTION(odbc_tables)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
@@ -3177,7 +3177,7 @@ PHP_FUNCTION(odbc_columns)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
@@ -3247,7 +3247,7 @@ PHP_FUNCTION(odbc_columnprivileges)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
@@ -3323,7 +3323,7 @@ PHP_FUNCTION(odbc_foreignkeys)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
@@ -3389,7 +3389,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
@@ -3446,7 +3446,7 @@ PHP_FUNCTION(odbc_primarykeys)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
@@ -3512,7 +3512,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
@@ -3579,7 +3579,7 @@ PHP_FUNCTION(odbc_procedures)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
@@ -3647,7 +3647,7 @@ PHP_FUNCTION(odbc_specialcolumns)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
@@ -3716,7 +3716,7 @@ PHP_FUNCTION(odbc_statistics)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
@@ -3779,7 +3779,7 @@ PHP_FUNCTION(odbc_tableprivileges)
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
- rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
+ rc = PHP_ODBC_SQLALLOCSTMT(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid
Handle'");
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h
index 5f0c205..5b61fc3 100644
--- a/ext/odbc/php_odbc_includes.h
+++ b/ext/odbc/php_odbc_includes.h
@@ -283,12 +283,14 @@ void odbc_sql_error(ODBC_SQL_ERROR_PARAMS);
#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR || x == SQL_WLONGVARCHAR)
#define PHP_ODBC_SQLCOLATTRIBUTE SQLColAttribute
+#define PHP_ODBC_SQLALLOCSTMT(hdbc, phstmt) SQLAllocHandle(SQL_HANDLE_STMT, hdbc, phstmt)
#define PHP_ODBC_DESC_BASE_COLUMN_NAME SQL_DESC_BASE_COLUMN_NAME
#else
#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR)
#define PHP_ODBC_SQLCOLATTRIBUTE SQLColAttributes
+#define PHP_ODBC_SQLALLOCSTMT SQLAllocStmt
#define PHP_ODBC_DESC_BASE_COLUMN_NAME SQL_COLUMN_NAME
#endif