Date: 04/30/98
- Next message: Andreas Braukmann: "Re: [PHP-DEV] Bug #331: static variables in object methods broken"
- Previous message: johnhowe <email protected>: "[PHP-DEV] Bug #333: Build failure on shared php load"
- Next in thread: zeev: "[PHP-DEV] CVS update: php3/functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thursday April 30, 1998 @ 3:42
Author: kara
Update of /repository/php3/functions
In directory asf:/tmp/cvs-serv25201
Modified Files:
unified_odbc.c
Log Message:
Fixed coredump in odbc_fetch_into() when getting Long columns
Index: php3/functions/unified_odbc.c
diff -c php3/functions/unified_odbc.c:1.56 php3/functions/unified_odbc.c:1.57
*** php3/functions/unified_odbc.c:1.56 Wed Apr 29 09:24:30 1998
--- php3/functions/unified_odbc.c Thu Apr 30 03:42:04 1998
***************
*** 374,380 ****
UODBC_TLS_VARS;
SQLAllocConnect(UODBC_GLOBAL(PHP3_UODBC_MODULE).henv, &new_conn);
! rc = SQLConnect(new_conn, UODBC_GLOBAL(PHP3_UODBC_MODULE).defDB, SQL_NTS, UODBC_GLOBAL(PHP3_UODBC_MODULE).defUser,
SQL_NTS, UODBC_GLOBAL(PHP3_UODBC_MODULE).defPW, SQL_NTS);
if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO){
--- 374,381 ----
UODBC_TLS_VARS;
SQLAllocConnect(UODBC_GLOBAL(PHP3_UODBC_MODULE).henv, &new_conn);
! rc = SQLConnect(new_conn, UODBC_GLOBAL(PHP3_UODBC_MODULE).defDB,
! SQL_NTS, UODBC_GLOBAL(PHP3_UODBC_MODULE).defUser,
SQL_NTS, UODBC_GLOBAL(PHP3_UODBC_MODULE).defPW, SQL_NTS);
if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO){
***************
*** 1030,1036 ****
tmp.type = IS_STRING;
tmp.value.str.len = 0;
sql_c_type = SQL_C_CHAR;
!
switch(result->values[i].coltype){
case SQL_BINARY:
case SQL_VARBINARY:
--- 1031,1037 ----
tmp.type = IS_STRING;
tmp.value.str.len = 0;
sql_c_type = SQL_C_CHAR;
!
switch(result->values[i].coltype){
case SQL_BINARY:
case SQL_VARBINARY:
***************
*** 1047,1069 ****
break;
}
! if(buf == NULL) buf = emalloc(result->longreadlen);
!
rc = SQLGetData(result->stmt, (UWORD)(i + 1),sql_c_type,
! buf, result->longreadlen, &result->values[i].vallen);
if (rc == SQL_ERROR) {
uodbc_sql_error(result->conn_ptr->hdbc, result->stmt, "SQLGetData");
efree(buf);
RETURN_FALSE;
}
! if (rc == SQL_SUCCESS_WITH_INFO)
tmp.value.str.len = result->longreadlen;
! else if(result->values[i].vallen == SQL_NULL_DATA){
! tmp.value.str.val = empty_string;
! break;
}
- tmp.value.str.len = result->values[i].vallen;
tmp.value.str.val = estrndup(buf, tmp.value.str.len);
break;
--- 1048,1070 ----
break;
}
! 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);
if (rc == SQL_ERROR) {
uodbc_sql_error(result->conn_ptr->hdbc, result->stmt, "SQLGetData");
efree(buf);
RETURN_FALSE;
}
! if (rc == SQL_SUCCESS_WITH_INFO){
tmp.value.str.len = result->longreadlen;
! } else if(result->values[i].vallen == SQL_NULL_DATA){
! tmp.value.str.val = empty_string;
! break;
! }else{
! tmp.value.str.len = result->values[i].vallen;
}
tmp.value.str.val = estrndup(buf, tmp.value.str.len);
break;
***************
*** 1171,1179 ****
convert_to_long(arg1);
res_ind = arg1->value.lval;
! if(arg2->type == IS_STRING)
field = arg2->value.str.val;
! else{
convert_to_long(arg2);
field_ind = arg2->value.lval - 1;
}
--- 1172,1180 ----
convert_to_long(arg1);
res_ind = arg1->value.lval;
! if(arg2->type == IS_STRING){
field = arg2->value.str.val;
! }else{
convert_to_long(arg2);
field_ind = arg2->value.lval - 1;
}
***************
*** 1235,1241 ****
if(IS_SQL_LONG(result->values[i].coltype) &&
result->longreadlen <= 0) break;
/* FIXME */
! fieldsize = (result->longreadlen <=0) ? 4096:result->longreadlen;
field = emalloc(fieldsize);
if(!field){
php3_error(E_WARNING,"Out of memory");
--- 1236,1242 ----
if(IS_SQL_LONG(result->values[i].coltype) &&
result->longreadlen <= 0) break;
/* FIXME */
! fieldsize = (result->longreadlen <=0) ? 4096:result->longreadlen + 1;
field = emalloc(fieldsize);
if(!field){
php3_error(E_WARNING,"Out of memory");
***************
*** 1243,1249 ****
}
rc = SQLGetData(result->stmt, (UWORD)(field_ind + 1),sql_c_type,
! field, fieldsize, &result->values[i].vallen);
if (rc == SQL_ERROR) {
uodbc_sql_error(result->conn_ptr->hdbc, result->stmt, "SQLGetData");
--- 1244,1250 ----
}
rc = SQLGetData(result->stmt, (UWORD)(field_ind + 1),sql_c_type,
! field, fieldsize + 1, &result->values[i].vallen);
if (rc == SQL_ERROR) {
uodbc_sql_error(result->conn_ptr->hdbc, result->stmt, "SQLGetData");
- Next message: Andreas Braukmann: "Re: [PHP-DEV] Bug #331: static variables in object methods broken"
- Previous message: johnhowe <email protected>: "[PHP-DEV] Bug #333: Build failure on shared php load"
- Next in thread: zeev: "[PHP-DEV] CVS update: php3/functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

