Date: 08/11/00
- Next message: Björn Schotte: "Re: [PHP-DEV] First PHP conference on 10/05/2000 - 10/06/2000"
- Previous message: David Croft: "Re: [PHP-DEV] Towards 4.0.2"
- In reply to: Andi Gutmans: "[PHP-DEV] Towards 4.0.2"
- Next in thread: Andi Gutmans: "Re: [PHP-DEV] Towards 4.0.2"
- Reply: Andi Gutmans: "Re: [PHP-DEV] Towards 4.0.2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Andi,
On Fri, Aug 11, 2000 at 01:05:28PM +0300, Andi Gutmans wrote:
> I think feature wise 4.0.2 is pretty much set now unless someone has
> anything important to add.
> I have fixed two lingering bugs (switch() and foreach()) and we have
> finished with the major Zend patch we wanted to get in for 4.0.2.
> I think the current CVS tree needs quite a lot of testing now so it would
> be great if within the next few days people will test the CVS in their
> development environments.
> I will try and post new Windows binaries tomorrow evening (in about 36 hours)
Please could the following patch go in? It fixes ODBC access to
Access datasources. The Access ODBC driver doesn't support
SQLDescribeParam, so the source as shipped fails to work with
parameterised queries. Tested here on NT 4.0 sp 6a.
--- /home/jevans/share/src/cvs/php4/ext/odbc/php_odbc.c Thu Jul 6 09:38:12 2000
+++ php_odbc.c Thu Aug 10 11:03:08 2000
@@ -805,7 +805,7 @@
UDWORD precision;
odbc_result *result;
int numArgs, i, ne;
- RETCODE rc;
+ RETCODE rc, desc_param;
numArgs = ZEND_NUM_ARGS();
if (numArgs == 1) {
@@ -854,8 +854,13 @@
RETURN_FALSE;
}
- SQLDescribeParam(result->stmt, (UWORD)i, &sqltype, &precision,
+ sqltype=SQL_CHAR;
+ scale=0;
+ precision=params[i-1].vallen;
+
+ desc_param = SQLDescribeParam(result->stmt, (UWORD)i, &sqltype, &precision,
&scale, &nullable);
+
params[i-1].vallen = (*tmp)->value.str.len;
params[i-1].fp = -1;
@@ -882,15 +887,33 @@
}
params[i-1].vallen = SQL_LEN_DATA_AT_EXEC(0);
+
+ if (desc_param != SQL_SUCCESS) {
+ /* SQLDescribeParameter failed - not supported? */
+ sqltype = SQL_LONGVARCHAR;
+ precision = lseek(params[i-1].fp, 0L, SEEK_END);
+ lseek(params[i-1].fp, 0L, SEEK_SET);
+ scale=0;
+ }
rc = SQLBindParameter(result->stmt, (UWORD)i, SQL_PARAM_INPUT,
ctype, sqltype, precision, scale,
(void *)params[i-1].fp, 0,
¶ms[i-1].vallen);
} else {
+
+ if (desc_param != SQL_SUCCESS) {
+ /* SQLDescribeParameter failed - not supported? */
+ sqltype = SQL_CHAR;
+ precision = params[i-1].vallen;
+ scale=0;
+ }
+
#ifdef HAVE_DBMAKER
precision = params[i-1].vallen;
#endif
+
+
rc = SQLBindParameter(result->stmt, (UWORD)i, SQL_PARAM_INPUT,
ctype, sqltype, precision, scale,
(*tmp)->value.str.val, 0,
Jon.
-- Jon Evans / Red Internet Ltd. / +44 1869 337977
- application/pgp-signature attachment: stored
- Next message: Björn Schotte: "Re: [PHP-DEV] First PHP conference on 10/05/2000 - 10/06/2000"
- Previous message: David Croft: "Re: [PHP-DEV] Towards 4.0.2"
- In reply to: Andi Gutmans: "[PHP-DEV] Towards 4.0.2"
- Next in thread: Andi Gutmans: "Re: [PHP-DEV] Towards 4.0.2"
- Reply: Andi Gutmans: "Re: [PHP-DEV] Towards 4.0.2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

