# pdo_firebird: "RETURNING" queries/closeCursor (#43246/43271)

- Thread: https://externals.io/message/33102
- Original archive: https://news-web.php.net/php.internals/33102
- Started by Hans-Peter Oeri on 2007-11-12T23:20:57+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #33102 — Hans-Peter Oeri — 2007-11-12T23:20:57+00:00

URL: https://externals.io/message/33102#33102

Hi!

According to the archive, this might be the list for concrete diffs - if
not, please excuse me.

I tried pdo_firebird (CVS PHP_5_3) and quickly ran across to bugs:

a) RETURNING queries fail
pdo_firebird - against the published docs - wants to return stored
procedure return values by the "execute" call. As it is, RETURNING
queries (for the lower level library) go in the same bucket; big nono.
My proposed change removes "special" handling of stored procedure calls
alltogether - as it seems not only undocumented, but against the docs.
As a "side effect", RETURNING queries work again.

b) PDOStatement->closeCursor not implemented
Whenever I tried to re-use a prepared statement, I got an error msg
about reusing an open cursor. As it seems, mere cursor closing is not
currently implemented (discarding the statement closes the cursor).
My proposed change adds a minimal "cursor_closer".

Please excuse form and/or function of my diffs (or human language
mistake). I'm neither a C nor a PHP guru. Nevertheless I humbly present
those for your consideration.

HPO

---

## #33136 — Marcus Boerger — 2007-11-14T15:20:41+00:00

URL: https://externals.io/message/33102#33136 · In reply to: #33102

Hello Hans-Peter,

  please avoid '#if 0' instead follow the CODING_STYLE and use your cvs
account name, '#if ACCOUNT_0' but oh wait you have none. Both these patches
as well as thew table stuff patch look fine. Care to get a cvs account for
pdo_firebird?

marcus

Tuesday, November 13, 2007, 12:20:57 AM, you wrote:

> diff -u php5-orig/ext/pdo_firebird/firebird_statement.c
> php5/ext/pdo_firebird/firebird_statement.c
> --- php5-orig/ext/pdo_firebird/firebird_statement.c     2007-11-12 16:59:34.000000000 +0100
> +++ php5/ext/pdo_firebird/firebird_statement.c  2007-11-12 16:58:46.000000000 +0100
> @@ -99,11 +99,15 @@

>                 /* assume all params have been bound */

> +#if 0
>                 if ((S->statement_type == isc_info_sql_stmt_exec_procedure &&
>                                 isc_dsql_execute2(H->isc_status, &H->tr, &S->stmt,
> PDO_FB_SQLDA_VERSION,
>                                         S->in_sqlda, &S->out_sqlda))
>                                 || isc_dsql_execute(H->isc_status, &H->tr, &S->stmt,
> PDO_FB_SQLDA_VERSION,
>                                         S->in_sqlda)) {
> +#else
> +               if (isc_dsql_execute(H->isc_status, &H->tr, &S->stmt, PDO_FB_SQLDA_VERSION,
S->>in_sqlda)) {
> +#endif
>                         break;
>                 }

> @@ -138,9 +142,11 @@

>                 /* an EXECUTE PROCEDURE statement can be fetched from once, without calling
> the API, because
>                  * the result was returned in the execute call */
> +#if 0
>                 if (S->statement_type == isc_info_sql_stmt_exec_procedure) {
>                         S->exhausted = 1;
>                 } else {
> +#endif
>                         if (isc_dsql_fetch(H->isc_status, &S->stmt, PDO_FB_SQLDA_VERSION,
> &S->out_sqlda)) {
>                                 if (H->isc_status[0] && H->isc_status[1]) {
>                                         RECORD_ERROR(stmt);
> @@ -148,7 +154,9 @@
>                                 S->exhausted = 1;
>                                 return 0;
>                         }
> +#if 0
>                 }
> +#endif
>                 return 1;
>         }
>         return 0;



Best regards,
 Marcus

---

## #33138 — Hans-Peter Oeri — 2007-11-14T15:24:50+00:00

URL: https://externals.io/message/33102#33138 · In reply to: #33136

Hi!

Marcus Boerger wrote:
> account name, '#if ACCOUNT_0' but oh wait you have none.
;)
> Both these patches
> as well as thew table stuff patch look fine. Care to get a cvs account for
> pdo_firebird?
>   
If it is that easy to get one: yes please.

But before I enter (possible) pdo_firebird politics, could you tell me
if there is currently an active maintainer?

Thanks
HPO

---

## #33142 — Marcus Boerger — 2007-11-14T15:41:00+00:00

URL: https://externals.io/message/33102#33142 · In reply to: #33138

Hello Hans-Peter,

  not that I am aware of. EXTENSIONS file doesn't list any and Ard who is
listed in CREDITS didn't show up in the last couple of months. Read this:
php.net/cvs-php.php and be also prepared to be asked to take care of
firebird installation on http://gcov.php.net :-)

marcus

Wednesday, November 14, 2007, 4:24:50 PM, you wrote:

> Hi!

> Marcus Boerger wrote:
> > […]
> ;)
> > […]
> If it is that easy to get one: yes please.

> But before I enter (possible) pdo_firebird politics, could you tell me
> if there is currently an active maintainer?

> Thanks
> HPO




Best regards,
 Marcus

---

## #33145 — Nuno Lopes — 2007-11-14T21:42:47+00:00

URL: https://externals.io/message/33102#33145 · In reply to: #33142

> Hello Hans-Peter,
>
>  not that I am aware of. EXTENSIONS file doesn't list any and Ard who is
> listed in CREDITS didn't show up in the last couple of months. Read this:
> php.net/cvs-php.php and be also prepared to be asked to take care of
> firebird installation on http://gcov.php.net :-)

Ah, sure! Last time I tried to setup firebird I gave up... I really need 
some pointers to get that working..

Nuno


> marcus
>
> Wednesday, November 14, 2007, 4:24:50 PM, you wrote:
>
> > […]
>
> > […]
>
> > […]
>
> > […]
