iodbc           Fri Aug 29 16:44:29 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/odbc   php_odbc.c php_odbc.h php_odbc_includes.h 
  Log:
  - MFH: Fixed code to use ODBC 3.52 datatypes for 64bit systems (bug #43666)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.c?r1=1.189.2.4.2.7.2.6&r2=1.189.2.4.2.7.2.7&diff_format=u
Index: php-src/ext/odbc/php_odbc.c
diff -u php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.6 
php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.7
--- php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.6       Sun Aug 24 20:50:41 2008
+++ php-src/ext/odbc/php_odbc.c Fri Aug 29 16:44:29 2008
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.6 2008/08/24 20:50:41 felipe Exp $ */
+/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.7 2008/08/29 16:44:29 iodbc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -64,7 +64,7 @@
 
 static int le_result, le_conn, le_pconn;
 
-#define SAFE_SQL_NTS(n) ((SWORD) ((n)?(SQL_NTS):0))
+#define SAFE_SQL_NTS(n) ((SQLSMALLINT) ((n)?(SQL_NTS):0))
 
 /* {{{ arginfo */
 static
@@ -477,7 +477,7 @@
                if (res->stmt) {
 #if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35)
                        SQLTransact(res->conn_ptr->henv, res->conn_ptr->hdbc,
-                                               (UWORD)SQL_COMMIT);
+                                               (SQLUSMALLINT) SQL_COMMIT);
 #endif
                        rc = SQLFreeStmt(res->stmt,SQL_DROP);
                        /* We don't want the connection to be closed after the 
last statment has been closed
@@ -861,10 +861,10 @@
 /* {{{ odbc_sql_error */
 void odbc_sql_error(ODBC_SQL_ERROR_PARAMS)
 {
-       char    state[6];
-       SDWORD  error;        /* Not used */
-       char    errormsg[SQL_MAX_MESSAGE_LENGTH];
-       SWORD   errormsgsize; /* Not used */
+       char        state[6];
+       SQLINTEGER      error;        /* Not used */
+       char        errormsg[SQL_MAX_MESSAGE_LENGTH];
+       SQLSMALLINT     errormsgsize; /* Not used */
        RETCODE rc;
        ODBC_SQL_ENV_T henv;
        ODBC_SQL_CONN_T conn;
@@ -940,8 +940,8 @@
 {
        RETCODE rc;
        int i;
-       SWORD       colnamelen; /* Not used */
-       SDWORD      displaysize;
+       SQLSMALLINT colnamelen; /* Not used */
+       SQLLEN      displaysize;
 
        result->values = (odbc_result_value *) 
safe_emalloc(sizeof(odbc_result_value), result->numcols, 0);
 
@@ -949,9 +949,9 @@
        result->binmode = ODBCG(defaultbinmode);
 
        for(i = 0; i < result->numcols; i++) {
-               rc = SQLColAttributes(result->stmt, (UWORD)(i+1), 
SQL_COLUMN_NAME, 
+               rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), 
SQL_COLUMN_NAME, 
                                result->values[i].name, 
sizeof(result->values[i].name), &colnamelen, 0);
-               rc = SQLColAttributes(result->stmt, (UWORD)(i+1), 
SQL_COLUMN_TYPE, 
+               rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), 
SQL_COLUMN_TYPE, 
                                NULL, 0, NULL, &result->values[i].coltype);
                
                /* Don't bind LONG / BINARY columns, so that fetch behaviour can
@@ -969,17 +969,17 @@
 #ifdef HAVE_ADABAS
                        case SQL_TIMESTAMP:
                                result->values[i].value = (char *)emalloc(27);
-                               SQLBindCol(result->stmt, (UWORD)(i+1), 
SQL_C_CHAR, result->values[i].value,
+                               SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), 
SQL_C_CHAR, result->values[i].value,
                                                        27, 
&result->values[i].vallen);
                                break;
 #endif /* HAVE_ADABAS */
                        default:
-                               rc = SQLColAttributes(result->stmt, 
(UWORD)(i+1), SQL_COLUMN_DISPLAY_SIZE,
+                               rc = SQLColAttributes(result->stmt, 
(SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE,
                                                                        NULL, 
0, NULL, &displaysize);
                                displaysize = displaysize <= 
result->longreadlen ? displaysize : 
                                                                
result->longreadlen;
                                result->values[i].value = (char 
*)emalloc(displaysize + 1);
-                               rc = SQLBindCol(result->stmt, (UWORD)(i+1), 
SQL_C_CHAR, result->values[i].value,
+                               rc = SQLBindCol(result->stmt, 
(SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value,
                                                        displaysize + 1, 
&result->values[i].vallen);
                                break;
                }
@@ -1001,7 +1001,7 @@
 
        ZEND_FETCH_RESOURCE2(conn, odbc_connection *, &pv_conn, -1, 
"ODBC-Link", le_conn, le_pconn);
        
-       rc = SQLTransact(conn->henv, conn->hdbc, 
(UWORD)((type)?SQL_COMMIT:SQL_ROLLBACK));
+       rc = SQLTransact(conn->henv, conn->hdbc, 
(SQLUSMALLINT)((type)?SQL_COMMIT:SQL_ROLLBACK));
        if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
                odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLTransact");
                RETURN_FALSE;
@@ -1026,7 +1026,7 @@
 void odbc_column_lengths(INTERNAL_FUNCTION_PARAMETERS, int type)
 {
        odbc_result *result;
-#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_OPENLINK)
+#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30)
        /* this seems to be necessary for Solid2.3 ( tested by 
         * [EMAIL PROTECTED]) and Solid 3.0 (tested by [EMAIL PROTECTED])
         * Solid does not seem to declare a SQLINTEGER, but it does declare a
@@ -1035,7 +1035,7 @@
         */
        SDWORD len;
 #else
-       SQLINTEGER len;
+       SQLLEN len;
 #endif
        zval *pv_res;
        long pv_num;
@@ -1061,7 +1061,7 @@
                RETURN_FALSE;
        }
 
-       SQLColAttributes(result->stmt, (UWORD)pv_num, (SQLUSMALLINT) 
(type?SQL_COLUMN_SCALE:SQL_COLUMN_PRECISION), NULL, 0, NULL, &len);
+       SQLColAttributes(result->stmt, (SQLUSMALLINT)pv_num, (SQLUSMALLINT) 
(type?SQL_COLUMN_SCALE:SQL_COLUMN_PRECISION), NULL, 0, NULL, &len);
 
        RETURN_LONG(len);
 }
@@ -1138,7 +1138,7 @@
        odbc_connection *conn;
        RETCODE rc;
 #ifdef HAVE_SQL_EXTENDED_FETCH
-       UDWORD      scrollopts;
+       SQLUINTEGER      scrollopts;
 #endif
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pv_conn, 
&query, &query_len) == FAILURE) {
@@ -1225,16 +1225,16 @@
 { 
        zval *pv_res, *pv_param_arr, **tmp;
        typedef struct params_t {
-               SDWORD vallen;
+               SQLLEN vallen;
                int fp;
        } params_t;
        params_t *params = NULL;
        char *filename;
        unsigned char otype;
-       SWORD sqltype, ctype, scale;
-       SWORD nullable;
-       UDWORD precision;
-       odbc_result *result;
+       SQLSMALLINT sqltype, ctype, scale;
+       SQLSMALLINT nullable;
+       SQLULEN precision;
+       odbc_result *result;
        int numArgs, i, ne;
        RETCODE rc;
        
@@ -1278,7 +1278,7 @@
                                RETURN_FALSE;
                        }
                        
-                       SQLDescribeParam(result->stmt, (UWORD)i, &sqltype, 
&precision, &scale, &nullable);
+                       SQLDescribeParam(result->stmt, (SQLUSMALLINT)i, 
&sqltype, &precision, &scale, &nullable);
                        params[i-1].vallen = Z_STRLEN_PP(tmp);
                        params[i-1].fp = -1;
 
@@ -1325,7 +1325,7 @@
 
                                params[i-1].vallen = SQL_LEN_DATA_AT_EXEC(0);
 
-                               rc = SQLBindParameter(result->stmt, (UWORD)i, 
SQL_PARAM_INPUT,
+                               rc = SQLBindParameter(result->stmt, 
(SQLUSMALLINT)i, SQL_PARAM_INPUT,
                                                                          
ctype, sqltype, precision, scale,
                                                                          (void 
*)params[i-1].fp, 0,
                                                                          
&params[i-1].vallen);
@@ -1337,7 +1337,7 @@
                                        params[i-1].vallen = SQL_NULL_DATA;
                                }
 
-                               rc = SQLBindParameter(result->stmt, (UWORD)i, 
SQL_PARAM_INPUT,
+                               rc = SQLBindParameter(result->stmt, 
(SQLUSMALLINT)i, SQL_PARAM_INPUT,
                                                                          
ctype, sqltype, precision, scale,
                                                                          
Z_STRVAL_PP(tmp), 0,
                                                                          
&params[i-1].vallen);
@@ -1414,7 +1414,8 @@
 PHP_FUNCTION(odbc_cursor)
 {
        zval *pv_res;
-       SWORD len, max_len;
+       SQLUSMALLINT max_len;
+       SQLSMALLINT len;
        char *cursorname;
        odbc_result *result;
        RETCODE rc;
@@ -1432,12 +1433,12 @@
        
        if (max_len > 0) {
                cursorname = emalloc(max_len + 1);
-               rc = 
SQLGetCursorName(result->stmt,cursorname,(SWORD)max_len,&len);
+               rc = 
SQLGetCursorName(result->stmt,cursorname,(SQLSMALLINT)max_len,&len);
                if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
-                       char    state[6];     /* Not used */
-                       SDWORD  error;        /* Not used */
-                       char    errormsg[255];
-                       SWORD   errormsgsize; /* Not used */
+                       char        state[6];     /* Not used */
+                       SQLINTEGER  error;        /* Not used */
+                       char        errormsg[SQL_MAX_MESSAGE_LENGTH];
+                       SQLSMALLINT errormsgsize; /* Not used */
 
                        SQLError( result->conn_ptr->henv, 
result->conn_ptr->hdbc,
                                                result->stmt, state, &error, 
errormsg,
@@ -1532,7 +1533,7 @@
        odbc_connection *conn;
        RETCODE rc;
 #ifdef HAVE_SQL_EXTENDED_FETCH
-       UDWORD      scrollopts;
+       SQLUINTEGER      scrollopts;
 #endif
 
        numArgs = ZEND_NUM_ARGS();
@@ -1618,12 +1619,12 @@
        int i;
        odbc_result *result;
        RETCODE rc;
-       SWORD sql_c_type;
+       SQLSMALLINT sql_c_type;
        char *buf = NULL;
 #ifdef HAVE_SQL_EXTENDED_FETCH
-       UDWORD crow;
-       UWORD  RowStatus[1];
-       SDWORD rownum = -1;
+       SQLULEN crow;
+       SQLUSMALLINT RowStatus[1];
+       SQLLEN rownum = -1;
        zval *pv_res, *tmp;
        long pv_row;
 
@@ -1699,7 +1700,7 @@
                                        buf = emalloc(result->longreadlen + 1);
                                }
                                
-                               rc = SQLGetData(result->stmt, (UWORD)(i + 1), 
sql_c_type, buf, result->longreadlen + 1, &result->values[i].vallen);
+                               rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i 
+ 1), sql_c_type, buf, result->longreadlen + 1, &result->values[i].vallen);
 
                                if (rc == SQL_ERROR) {
                                        odbc_sql_error(result->conn_ptr, 
result->stmt, "SQLGetData");
@@ -1772,14 +1773,14 @@
        int i;
        odbc_result *result;
        RETCODE rc;
-       SWORD sql_c_type;
+       SQLSMALLINT sql_c_type;
        char *buf = NULL;
        zval *pv_res, **pv_res_arr, *tmp;
 #ifdef HAVE_SQL_EXTENDED_FETCH
        long pv_row = 0;
-       UDWORD crow;
-       UWORD  RowStatus[1];
-       SDWORD rownum = 0;
+       SQLULEN crow;
+       SQLUSMALLINT RowStatus[1];
+       SQLLEN rownum = -1;
 #endif /* HAVE_SQL_EXTENDED_FETCH */
 
 #ifdef HAVE_SQL_EXTENDED_FETCH
@@ -1851,7 +1852,7 @@
                                if (buf == NULL) {
                                        buf = emalloc(result->longreadlen + 1);
                                }
-                               rc = SQLGetData(result->stmt, (UWORD)(i + 
1),sql_c_type, buf, result->longreadlen + 1, &result->values[i].vallen);
+                               rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i 
+ 1),sql_c_type, buf, result->longreadlen + 1, &result->values[i].vallen);
 
                                if (rc == SQL_ERROR) {
                                        odbc_sql_error(result->conn_ptr, 
result->stmt, "SQLGetData");
@@ -1922,14 +1923,14 @@
    Fetch a row */
 PHP_FUNCTION(odbc_fetch_row)
 {
-       SDWORD rownum = 1;
+       SQLLEN rownum = 1;
        odbc_result *result;
        RETCODE rc;
        zval *pv_res;
        long pv_row;
 #ifdef HAVE_SQL_EXTENDED_FETCH
-       UDWORD crow;
-       UWORD RowStatus[1];
+       SQLULEN crow;
+       SQLUSMALLINT RowStatus[1];
 #endif
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_res, 
&pv_row) == FAILURE) {
@@ -1978,15 +1979,15 @@
 {
        char *field;
        int field_ind;
-       SWORD sql_c_type = SQL_C_CHAR;
+       SQLSMALLINT sql_c_type = SQL_C_CHAR;
        odbc_result *result;
        int i = 0;
        RETCODE rc;
-       SDWORD  fieldsize;
+       SQLLEN  fieldsize;
        zval *pv_res, **pv_field;
 #ifdef HAVE_SQL_EXTENDED_FETCH
-       UDWORD crow;
-       UWORD RowStatus[1];
+       SQLULEN crow;
+       SQLUSMALLINT RowStatus[1];
 #endif
 
        field_ind = -1;
@@ -2070,8 +2071,8 @@
                                   fieldsize = result->longreadlen;
                                }
                        } else {
-                          SQLColAttributes(result->stmt, (UWORD)(field_ind + 
1), 
-                                                               
(UWORD)((sql_c_type == SQL_C_BINARY) ? SQL_COLUMN_LENGTH :
+                          SQLColAttributes(result->stmt, 
(SQLUSMALLINT)(field_ind + 1), 
+                                                               
(SQLUSMALLINT)((sql_c_type == SQL_C_BINARY) ? SQL_COLUMN_LENGTH :
                                                                
SQL_COLUMN_DISPLAY_SIZE),
                                                                NULL, 0, NULL, 
&fieldsize);
                        }
@@ -2082,7 +2083,7 @@
                /* SQLGetData will truncate CHAR data to fieldsize - 1 bytes 
and append \0.
                 * For binary data it is truncated to fieldsize bytes. 
                 */
-                       rc = SQLGetData(result->stmt, (UWORD)(field_ind + 1), 
sql_c_type,
+                       rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind 
+ 1), sql_c_type,
                                                        field, fieldsize, 
&result->values[field_ind].vallen);
 
                        if (rc == SQL_ERROR) {
@@ -2126,7 +2127,7 @@
        
        /* Call SQLGetData() until SQL_SUCCESS is returned */
        while(1) {
-               rc = SQLGetData(result->stmt, (UWORD)(field_ind + 
1),sql_c_type, field, fieldsize, &result->values[field_ind].vallen);
+               rc = SQLGetData(result->stmt, (SQLUSMALLINT)(field_ind + 
1),sql_c_type, field, fieldsize, &result->values[field_ind].vallen);
 
                if (rc == SQL_ERROR) {
                        odbc_sql_error(result->conn_ptr, result->stmt, 
"SQLGetData");
@@ -2160,10 +2161,10 @@
        zval *pv_res;
        char *pv_format = NULL;
        int i, pv_format_len = 0;
-       SWORD sql_c_type;
+       SQLSMALLINT sql_c_type;
 #ifdef HAVE_SQL_EXTENDED_FETCH
-       UDWORD crow;
-       UWORD RowStatus[1];
+       SQLULEN crow;
+       SQLUSMALLINT RowStatus[1];
 #endif
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s", &pv_res, 
&pv_format, &pv_format_len) == FAILURE) {
@@ -2226,7 +2227,7 @@
                                                buf = 
emalloc(result->longreadlen);
                                        }
 
-                                       rc = SQLGetData(result->stmt, (UWORD)(i 
+ 1),sql_c_type, buf, result->longreadlen, &result->values[i].vallen);
+                                       rc = SQLGetData(result->stmt, 
(SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen, 
&result->values[i].vallen);
  
                                        php_printf("<td>");
 
@@ -2387,7 +2388,7 @@
        }
 /*  Possible fix for bug #10250
  *  Needs testing on UnixODBC < 2.0.5 though. */
-#if defined(HAVE_EMPRESS) || defined(HAVE_UNIXODBC) || defined(PHP_WIN32)
+#if defined(HAVE_EMPRESS) || defined(HAVE_UNIXODBC) || defined(PHP_WIN32) || 
defined (HAVE_IODBC)
 /* *  Uncomment the line above, and comment line below to fully test 
  * #ifdef HAVE_EMPRESS */
        {
@@ -2541,7 +2542,7 @@
                        if(ODBCG(check_persistent)){
                                RETCODE ret;
                                UCHAR d_name[32];
-                               SWORD len;
+                               SQLSMALLINT len;
 
                                ret = SQLGetInfo(db_conn->hdbc, 
                                        SQL_DATA_SOURCE_READ_ONLY, 
@@ -2658,7 +2659,7 @@
 PHP_FUNCTION(odbc_num_rows)
 {
        odbc_result *result;
-       SDWORD rows;
+       SQLLEN rows;
        zval *pv_res;
        
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == 
FAILURE) {
@@ -2774,7 +2775,7 @@
 {
        odbc_result     *result;
        char            tmp[32];
-       SWORD           tmplen;
+       SQLSMALLINT     tmplen;
        zval            *pv_res;
        long            pv_num;
 
@@ -2799,7 +2800,7 @@
                RETURN_FALSE;
        }
 
-       SQLColAttributes(result->stmt, (UWORD)pv_num, SQL_COLUMN_TYPE_NAME, 
tmp, 31, &tmplen, NULL);
+       SQLColAttributes(result->stmt, (SQLUSMALLINT)pv_num, 
SQL_COLUMN_TYPE_NAME, tmp, 31, &tmplen, NULL);
        RETURN_STRING(tmp,1)
 }
 /* }}} */
@@ -2878,7 +2879,7 @@
                }
                RETVAL_TRUE;
        } else {
-               SDWORD status;
+               SQLINTEGER status;
 
                rc = SQLGetConnectOption(conn->hdbc, SQL_AUTOCOMMIT, 
(PTR)&status);
                if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
@@ -3126,10 +3127,10 @@
        }
 
        rc = SQLColumns(result->stmt, 
-                       cat, (SWORD) cat_len,
-                       schema, (SWORD) schema_len,
-                       table, (SWORD) table_len,
-                       column, (SWORD) column_len);
+                       cat, (SQLSMALLINT) cat_len,
+                       schema, (SQLSMALLINT) schema_len,
+                       table, (SQLSMALLINT) table_len,
+                       column, (SQLSMALLINT) column_len);
 
        if (rc == SQL_ERROR) {
                odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLColumns");
@@ -3305,14 +3306,14 @@
        odbc_result *result = NULL;
        odbc_connection *conn;
        RETCODE rc;
-       SWORD data_type = SQL_ALL_TYPES;
+       SQLSMALLINT data_type = SQL_ALL_TYPES;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_conn, 
&pv_data_type) == FAILURE) {
                return;
        }
        
        if (ZEND_NUM_ARGS() > 1) {
-               data_type = (SWORD) pv_data_type;
+               data_type = (SQLSMALLINT) pv_data_type;
        }
 
        ZEND_FETCH_RESOURCE2(conn, odbc_connection *, &pv_conn, -1, 
"ODBC-Link", le_conn, le_pconn);
@@ -3562,7 +3563,7 @@
        odbc_connection *conn;
        char *cat = NULL, *schema = NULL, *name = NULL;
        int cat_len, schema_len, name_len;
-       UWORD type, scope, nullable;
+       SQLUSMALLINT type, scope, nullable;
        RETCODE rc;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlsssll", 
&pv_conn, &vtype, &cat, &cat_len, &schema, &schema_len,
@@ -3570,9 +3571,9 @@
                return;
        }
        
-       type = (UWORD) vtype;
-       scope = (UWORD) vscope;
-       nullable = (UWORD) vnullable;
+       type = (SQLUSMALLINT) vtype;
+       scope = (SQLUSMALLINT) vscope;
+       nullable = (SQLUSMALLINT) vnullable;
 
        ZEND_FETCH_RESOURCE2(conn, odbc_connection *, &pv_conn, -1, 
"ODBC-Link", le_conn, le_pconn);
 
@@ -3632,7 +3633,7 @@
        odbc_connection *conn;
        char *cat, *schema, *name;
        int cat_len, schema_len, name_len;
-       UWORD unique, reserved;
+       SQLUSMALLINT unique, reserved;
        RETCODE rc;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsssll", 
&pv_conn, &cat, &cat_len, &schema, &schema_len,
@@ -3640,8 +3641,8 @@
                return;
        }
        
-       unique = (UWORD) vunique;
-       reserved = (UWORD) vreserved;
+       unique = (SQLUSMALLINT) vunique;
+       reserved = (SQLUSMALLINT) vreserved;
 
        ZEND_FETCH_RESOURCE2(conn, odbc_connection *, &pv_conn, -1, 
"ODBC-Link", le_conn, le_pconn);
 
http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.h?r1=1.60.2.1.2.1.2.1&r2=1.60.2.1.2.1.2.2&diff_format=u
Index: php-src/ext/odbc/php_odbc.h
diff -u php-src/ext/odbc/php_odbc.h:1.60.2.1.2.1.2.1 
php-src/ext/odbc/php_odbc.h:1.60.2.1.2.1.2.2
--- php-src/ext/odbc/php_odbc.h:1.60.2.1.2.1.2.1        Mon Dec 31 07:17:11 2007
+++ php-src/ext/odbc/php_odbc.h Fri Aug 29 16:44:29 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_odbc.h,v 1.60.2.1.2.1.2.1 2007/12/31 07:17:11 sebastian Exp $ */
+/* $Id: php_odbc.h,v 1.60.2.1.2.1.2.2 2008/08/29 16:44:29 iodbc Exp $ */
 
 #ifndef PHP_ODBC_H
 #define PHP_ODBC_H
@@ -33,7 +33,7 @@
 extern zend_module_entry odbc_module_entry;
 #define odbc_module_ptr &odbc_module_entry
 
-#if defined(HAVE_DBMAKER) || defined(PHP_WIN32) || defined(HAVE_IBMDB2) || 
defined(HAVE_UNIXODBC) || defined(HAVE_BIRDSTEP)
+#if defined(HAVE_DBMAKER) || defined(PHP_WIN32) || defined(HAVE_IBMDB2) || 
defined(HAVE_UNIXODBC) || defined(HAVE_BIRDSTEP) || defined(HAVE_IODBC)
 # define PHP_ODBC_HAVE_FETCH_HASH 1
 #endif
 
http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc_includes.h?r1=1.12.2.1.2.4.2.1&r2=1.12.2.1.2.4.2.2&diff_format=u
Index: php-src/ext/odbc/php_odbc_includes.h
diff -u php-src/ext/odbc/php_odbc_includes.h:1.12.2.1.2.4.2.1 
php-src/ext/odbc/php_odbc_includes.h:1.12.2.1.2.4.2.2
--- php-src/ext/odbc/php_odbc_includes.h:1.12.2.1.2.4.2.1       Mon Dec 31 
07:17:11 2007
+++ php-src/ext/odbc/php_odbc_includes.h        Fri Aug 29 16:44:29 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_odbc_includes.h,v 1.12.2.1.2.4.2.1 2007/12/31 07:17:11 sebastian 
Exp $ */
+/* $Id: php_odbc_includes.h,v 1.12.2.1.2.4.2.2 2008/08/29 16:44:29 iodbc Exp $ 
*/
 
 #ifndef PHP_ODBC_INCLUDES_H
 #define PHP_ODBC_INCLUDES_H
@@ -90,19 +90,19 @@
 
 #elif defined(HAVE_IODBC) /* iODBC library */
 
+#ifdef CHAR
+#undef CHAR
+#endif
+
+#ifdef SQLCHAR
+#undef SQLCHAR
+#endif
+
 #define ODBC_TYPE "iODBC"
-#include <isql.h>
-#include <isqlext.h>
+#include <sql.h>
+#include <sqlext.h>
+#include <iodbcext.h>
 #define HAVE_SQL_EXTENDED_FETCH 1
-#define SQL_FD_FETCH_ABSOLUTE   0x00000010L
-#define SQL_CURSOR_DYNAMIC      2UL
-#define SQL_NO_TOTAL            (-4)
-#define SQL_SO_DYNAMIC          0x00000004L
-#define SQL_LEN_DATA_AT_EXEC_OFFSET  (-100)
-#define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)
-#ifndef SQL_SUCCEEDED
-#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
-#endif
 
 #elif defined(HAVE_UNIXODBC) /* unixODBC library */
 
@@ -148,8 +148,12 @@
 #include <isqlext.h>
 #include <udbcext.h>
 #define HAVE_SQL_EXTENDED_FETCH 1
+#ifndef SQLSMALLINT
 #define SQLSMALLINT SWORD
+#endif
+#ifndef SQLUSMALLINT
 #define SQLUSMALLINT UWORD
+#endif
 
 #elif defined(HAVE_BIRDSTEP) /* Raima Birdstep */
 
@@ -204,7 +208,7 @@
 
 /* Common defines */
 
-#if defined( HAVE_IBMDB2 ) || defined( HAVE_UNIXODBC )
+#if defined( HAVE_IBMDB2 ) || defined( HAVE_UNIXODBC ) || defined (HAVE_IODBC)
 #define ODBC_SQL_ENV_T SQLHANDLE
 #define ODBC_SQL_CONN_T SQLHANDLE
 #define ODBC_SQL_STMT_T SQLHANDLE
@@ -230,15 +234,15 @@
 typedef struct odbc_result_value {
        char name[32];
        char *value;
-       SDWORD vallen;
-       SDWORD coltype;
+       SQLLEN vallen;
+       SQLLEN coltype;
 } odbc_result_value;
 
 typedef struct odbc_result {
        ODBC_SQL_STMT_T stmt;
        odbc_result_value *values;
-       SWORD numcols;
-       SWORD numparams;
+       SQLSMALLINT numcols;
+       SQLSMALLINT numparams;
 # if HAVE_SQL_EXTENDED_FETCH
        int fetch_abs;
 # endif

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to