Re: cvs: php4 /ext/odbc php_odbc.c
| From: | Adam Trachtenberg | Date: | Tue, 05 Dec 2000 16:21:16 +0000 |
| Subject: | Re: cvs: php4 /ext/odbc php_odbc.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-2956@lists.php.net to get a copy of this message | ||
On Tue, 5 Dec 2000, Stig Bakken wrote:
> ssb Tue Dec 5 04:11:32 2000 EDT
>
> Modified files:
> /php4/ext/odbc php_odbc.c
> Log:
> Applied IBM DB2 patch by Walter Franzini <walter@sys-net.it>
> @ext/odbc: IBM DB2 patch by Walter Franzini <walter@sys-net.it>
>
>
> Index: php4/ext/odbc/php_odbc.c
> diff -u php4/ext/odbc/php_odbc.c:1.65 php4/ext/odbc/php_odbc.c:1.66
> --- php4/ext/odbc/php_odbc.c:1.65 Fri Nov 17 07:48:09 2000
> +++ php4/ext/odbc/php_odbc.c Tue Dec 5 04:11:30 2000
> @@ -18,7 +18,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: php_odbc.c,v 1.65 2000/11/17 15:48:09 kalowsky Exp $ */
> +/* $Id: php_odbc.c,v 1.66 2000/12/05 12:11:30 ssb Exp $ */
>
> #include "php.h"
> #include "php_globals.h"
> @@ -774,11 +774,17 @@
> }
> #endif
>
> - if ((rc = SQLPrepare(result->stmt, query, SQL_NTS)) != SQL_SUCCESS) {
> - odbc_sql_error(conn->henv, conn->hdbc, result->stmt, "SQLPrepare");
> - SQLFreeStmt(result->stmt, SQL_DROP);
> - RETURN_FALSE;
> - }
> + rc = SQLPrepare(result->stmt, query, SQL_NTS);
> + switch (rc) {
> + case SQL_SUCCESS:
> + break;
> + case SQL_SUCCESS_WITH_INFO:
> + odbc_sql_error(conn->henv, conn->hdbc, result->stmt, "SQLPrepare");
> + break;
> + default:
> + odbc_sql_error(conn->henv, conn->hdbc, result->stmt, "SQLPrepare");
> + RETURN_FALSE;
> + }
I noticed we lost a call to SQLFreeStmt() here. Is that correct? I don't
know if it was intensional or not.
-adam
--
/ adam maccabee trachtenberg | visit college life online \
\ adam@student.net | http://www.student.com /