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

php.internals

Hans-Peter Oeri

18 years ago
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

Marcus Börger

18 years ago
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

Hans-Peter Oeri

18 years ago
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

Marcus Börger

18 years ago
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: >> 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
Best regards, Marcus

Nuno Lopes

18 years ago
> 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

Lars Westermann

18 years ago
Hi! Well actually there is a maintainer ... I signed up for this about a month ago. I have already fixed bug #43271 - it was an error in firebird_statement_execute() which didn't close an open cursor before making additional attempts to call isc_dsql_execute(). It is fixed in PHP_5_3 branch. closecúrsor() isn't really needed for that, but it IS implemented anyway, as it might come in handy if one uses named cursors, and one wants to close them explicitely. /Lars W "Marcus Boerger" <helly@php.net> skrev i en meddelelse news:456934827.20071114164100@marcus-boerger.de...