+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
* column. */
if (colsize < 256 && !S->going_long) {
S->cols[colno].data = emalloc(colsize+1);
+ S->cols[colno].is_long = 0;
rc = SQLBindCol(S->stmt, colno+1, SQL_C_CHAR, S->cols[colno].data,
S->cols[colno].datalen+1, &S->cols[colno].fetched_len);
* "long" columns */
S->cols[colno].data = emalloc(256);
S->going_long = 1;
+ S->cols[colno].is_long = 1;
}
return 1;
pdo_odbc_column *C = &S->cols[colno];
/* if it is a column containing "long" data, perform late binding now */
- if (C->datalen > 255) {
+ if (C->is_long) {
unsigned long alloced = 4096;
unsigned long used = 0;
char *buf;
if (rc == SQL_NO_DATA) {
/* we got the lot */
break;
+ } else if (rc != SQL_SUCCESS) {
+ pdo_odbc_stmt_error("SQLGetData");
+ if (rc != SQL_SUCCESS_WITH_INFO) {
+ break;
+ }
}
if (C->fetched_len == SQL_NO_TOTAL) {
used += C->fetched_len;
}
+ if (rc == SQL_SUCCESS) {
+ /* this was the final fetch */
+ break;
+ }
+
/* we need to fetch another chunk; resize the
* buffer */
alloced *= 2;
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
long fetched_len;
SWORD coltype;
char colname[128];
+ unsigned is_long;
} pdo_odbc_column;
typedef struct {