Re: [PATCH] mysqli #35203 / #48065 Eliminate special case for calling procedures in mysqli

From: Date: Thu, 14 May 2009 23:04:13 +0000
Subject: Re: [PATCH] mysqli #35203 / #48065 Eliminate special case for calling procedures in mysqli
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-43964@lists.php.net to get a copy of this message
Ping? There's a fully formed patch here, with tests, to fix a mysqli bug. I haven't gotten any feedback. Here's the original message with the patch. http://news.php.net/php.internals/43773 Michael G Schwern wrote: > This is a patch against 5.2.9 to fix mysqli::query so a user can call stored > procedures the same as they do any other statement. No more multi_query() and > next_result() work arounds necessary to avoid a "Commands out of sync" error. > > I note this has been rejected several times in the tracker as not being a bug. > I feel its a clear encapsulation violation making the user special case a > query just because it's calling a stored procedure. Aside from just being > very inconvenient, some API wrappers around mysqli, Drupal 6 for example, > leave the user with no way to get at mysqli::multi_query(). > > Anyhow, here's a complete patch with a test. The technique and code is lifted > from Perl's DBD::mysql driver, which you can see here as > mysql_st_free_result_sets() > > http://cpansearch.perl.org/src/CAPTTOFU/DBD-mysql-4.011/dbdimp.c > > Before each query it frees any results still hanging around on the connection, > which is essentially what a user has to do. I'm not really a C programmer so > I left most of the code as is, do/while loop and all. > > I'm not sure how mysqli normally handles errors so I just went with a printf() > and return trusting that you'll fix that up. It causes test 057 to fail > because that test deliberately generates an out of sync error, which my code > diligently prints. So that should go away with fixed error handling. > > Thanks, > Schwern > > -- ROCKS FALL! EVERYONE DIES! http://www.somethingpositive.net/sp05032002.shtml

« previous php.internals (#43964) next »