Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"PHP Notice" in mapi_execute() #2939

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

"PHP Notice" in mapi_execute() #2939

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working Client interfaces normal

Comments

@monetdb-team
Copy link

Date: 2011-12-06 12:26:21 +0100
From: manuela <<m.sagona>>
To: clients devs <>
Version: 11.3.3 (Apr2011-SP1) [obsolete]

Last updated: 2012-01-26 15:31:57 +0100

Comment 16589

Date: 2011-12-06 12:26:21 +0100
From: manuela <<m.sagona>>

User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2
Build Identifier:

we notice that a "PHP Notice" was rised every time the mapi_execute() returns a FALSE

Reproducible: Always

Only variable references should be returned by reference in .../php_mapi.inc on line 96) due to the by reference return behaviour of the function;
we suggest to remove that behaviour since it does not increase performance (see http://php.net/manual/en/language.references.return.php).
Finally note that pass-by-reference has been deprecated (Deprecated: Call-time pass-by-reference has been deprecated in php_monetdb.php on line 302)

Comment 16597

Date: 2011-12-06 13:26:06 +0100
From: @grobian

Do you mean something like this?

diff --git a/clients/php/lib/php_mapi.inc b/clients/php/lib/php_mapi.inc
--- a/clients/php/lib/php_mapi.inc
+++ b/clients/php/lib/php_mapi.inc
@@ -64,7 +64,7 @@
/**
* Execute an SQL query and return the resulting handle by reference.
*/

  •   function &mapi_execute($conn=NULL, $query) {
    
  •   function mapi_execute($conn=NULL, $query) {
              global $connection_pool;
              global $rows;
              /**
    

Comment 16630

Date: 2011-12-08 14:35:51 +0100
From: @grobian

Changeset 6c59acf6021e made by Fabian Groffen fabian@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=6c59acf6021e

Changeset description:

mapi_execute: don't return a reference, since we can return FALSE

Bug #2939, PHP spits a notice mapi_execute tries to return FALSE.  Since
there is no performance improvement by actually returning a reference,
just don't do it.

Comment 16631

Date: 2011-12-08 14:36:15 +0100
From: @grobian

Change seems to work fine, committed.

Comment 16817

Date: 2012-01-26 15:31:57 +0100
From: @sjoerdmullender

The Dec2011 version has been release, so declaring this bug as FIXED.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Client interfaces normal
Projects
None yet
Development

No branches or pull requests

2 participants