Date: 08/12/00
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6129 Updated: IIS Hangs when trying loading a missing dll"
- Previous message: Andi Gutmans: "Re: [PHP-DEV] Towards 4.0.2"
- In reply to: Jon Evans: "Re: [PHP-DEV] Towards 4.0.2"
- Next in thread: Mike Robinson: "RE: [PHP-DEV] Towards 4.0.2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I think bug fixes should still go into the current tree.
It's probably best if someone else who is more familiar with ODBC takes a
look at your patch.
Andi
At 05:26 PM 8/11/00 +0100, Jon Evans wrote:
>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
--- Andi Gutmans <andi <email protected>> http://www.zend.com/-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6129 Updated: IIS Hangs when trying loading a missing dll"
- Previous message: Andi Gutmans: "Re: [PHP-DEV] Towards 4.0.2"
- In reply to: Jon Evans: "Re: [PHP-DEV] Towards 4.0.2"
- Next in thread: Mike Robinson: "RE: [PHP-DEV] Towards 4.0.2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

