sniper Thu Aug 28 12:35:33 2003 EDT Modified files: /php-src/ext/odbc php_odbc.c php_odbc_includes.h Log: Revert the patch per Dan\īs request Index: php-src/ext/odbc/php_odbc.c diff -u php-src/ext/odbc/php_odbc.c:1.173 php-src/ext/odbc/php_odbc.c:1.174 --- php-src/ext/odbc/php_odbc.c:1.173 Thu Aug 28 05:55:11 2003 +++ php-src/ext/odbc/php_odbc.c Thu Aug 28 12:35:32 2003 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.173 2003/08/28 09:55:11 sniper Exp $ */ +/* $Id: php_odbc.c,v 1.174 2003/08/28 16:35:32 sniper Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -460,7 +460,6 @@ REGISTER_LONG_CONSTANT("SQL_CHAR", SQL_CHAR, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("SQL_VARCHAR", SQL_VARCHAR, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("SQL_LONGVARCHAR", SQL_LONGVARCHAR, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("SQL_BLOB", SQL_LONGVARBINARY, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("SQL_DECIMAL", SQL_DECIMAL, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("SQL_NUMERIC", SQL_NUMERIC, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("SQL_BIT", SQL_BIT, CONST_PERSISTENT | CONST_CS); @@ -654,7 +653,6 @@ case SQL_BINARY: case SQL_VARBINARY: case SQL_LONGVARBINARY: - case SQL_BLOB: case SQL_LONGVARCHAR: result->values[i].value = NULL; break; @@ -669,7 +667,7 @@ default: rc = SQLColAttributes(result->stmt, (UWORD)(i+1), SQL_COLUMN_DISPLAY_SIZE, NULL, 0, NULL, &displaysize); - displaysize = displaysize <= result->longreadlen ? 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, @@ -1419,19 +1417,7 @@ Z_STRVAL_P(tmp) = empty_string; break; } - - if (result->binmode == 1) { - sql_c_type = SQL_C_BINARY; - } - case SQL_BLOB: - if (result->binmode <= 0) { - Z_STRVAL_P(tmp) = empty_string; - break; - } - - if (result->binmode == 1) { - sql_c_type = SQL_C_BINARY; - } + if (result->binmode == 1) sql_c_type = SQL_C_BINARY; case SQL_LONGVARCHAR: if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { Z_STRVAL_P(tmp) = empty_string; @@ -1590,19 +1576,7 @@ Z_STRVAL_P(tmp) = empty_string; break; } - - if (result->binmode == 1) { - sql_c_type = SQL_C_BINARY; - } - case SQL_BLOB: - if (result->binmode <= 0) { - Z_STRVAL_P(tmp) = empty_string; - break; - } - - if (result->binmode == 1) { - sql_c_type = SQL_C_BINARY; - } + if (result->binmode == 1) sql_c_type = SQL_C_BINARY; case SQL_LONGVARCHAR: if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { Z_STRVAL_P(tmp) = empty_string; @@ -1820,15 +1794,8 @@ case SQL_BINARY: case SQL_VARBINARY: case SQL_LONGVARBINARY: - if (result->binmode <= 1) - sql_c_type = SQL_C_BINARY; - if (result->binmode <= 0) - break; - case SQL_BLOB: - if (result->binmode <= 1) - sql_c_type = SQL_C_BINARY; - if (result->binmode <= 0) - break; + if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; + if (result->binmode <= 0) break; case SQL_LONGVARCHAR: if (IS_SQL_LONG(result->values[field_ind].coltype)) { if (result->longreadlen <= 0) @@ -1985,15 +1952,7 @@ php_printf("<td>Not printable</td>"); break; } - if (result->binmode <= 1) - sql_c_type = SQL_C_BINARY; - case SQL_BLOB: - if (result->binmode <= 0) { - php_printf("<td>Not printable</td>"); - break; - } - if (result->binmode <= 1) - sql_c_type = SQL_C_BINARY; + if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; case SQL_LONGVARCHAR: if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { @@ -2152,7 +2111,7 @@ if (direct) { rc = SQLDriverConnect((*conn)->hdbc, NULL, ldb, strlen(ldb), dsnbuf, - sizeof(dsnbuf) - 1, &dsnbuflen, SQL_DRIVER_NOPROMPT); + sizeof(dsnbuf) - 1, &dsnbuflen, SQL_DRIVER_NOPROMPT); } else { rc = SQLConnect((*conn)->hdbc, db, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS); } Index: php-src/ext/odbc/php_odbc_includes.h diff -u php-src/ext/odbc/php_odbc_includes.h:1.7 php-src/ext/odbc/php_odbc_includes.h:1.8 --- php-src/ext/odbc/php_odbc_includes.h:1.7 Wed Aug 27 14:21:52 2003 +++ php-src/ext/odbc/php_odbc_includes.h Thu Aug 28 12:35:32 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc_includes.h,v 1.7 2003/08/27 18:21:52 kalowsky Exp $ */ +/* $Id: php_odbc_includes.h,v 1.8 2003/08/28 16:35:32 sniper Exp $ */ #ifndef PHP_ODBC_INCLUDES_H #define PHP_ODBC_INCLUDES_H @@ -266,8 +266,8 @@ void odbc_sql_error(ODBC_SQL_ERROR_PARAMS); -#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR || x == SQL_BLOB) -#define IS_SQL_BINARY(x) (x == SQL_BINARY || x == SQL_VARBINARY || x == SQL_LONGVARBINARY || x == SQL_BLOB) +#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR) +#define IS_SQL_BINARY(x) (x == SQL_BINARY || x == SQL_VARBINARY || x == SQL_LONGVARBINARY) #ifdef ZTS # define ODBCG(v) TSRMG(odbc_globals_id, php_odbc_globals *, v)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php