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

Minor fixes to avoid PHP warnings in v8.2+ #952

Closed
wants to merge 2 commits into from

Conversation

Mike-Benoit
Copy link
Contributor

Minor fixes to avoid PHP warnings in v8.2+.

See comments in code for further details if its not a simple object property initialization.

adodb.inc.php Outdated Show resolved Hide resolved
adodb.inc.php Show resolved Hide resolved
adodb.inc.php Outdated
//If the _queryID is bogus, calling Close() may cause an error in the database driver.
if($this->_queryID != -1) {
$this->Close();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be more appropriate to add this fix in ADORecordSet::Close() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, that would make more sense.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not sure that is the right fix actually, as this will prevent execution of cleanup tasks (e.g. freeing additional result sets in the mysql driver).

I believe that each driver should handle this specifically to ensure they don't break when _queryID == -1. At least some of them already do that (but I didn't check them all):

DB2 and firebird don't have such checks.

Was this just preventive maintenance, or did you run into an actual error or warning ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We definitely hit an error here, passing a string where a connection object is required.

Our internal ADODB branch has been out-of-sync with upstream for over a decade now. It's possible we missed some upstream changes that resolved some of our issues in other ways.

These are some of the last bits to bring it back in sync though, so that will be nice. We can leave this out for now and we will run further tests and let you know if there still a problem.

Thanks for your prompt response with these PR's.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're welcome. So should I close this PR then ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

drivers/adodb-postgres64.inc.php Show resolved Hide resolved
@dregad dregad added this to the v5.22.6 milestone Apr 15, 2023
@dregad dregad added bug PHP8.2 PHP8.2 Compatibility Issues labels Apr 15, 2023
Copy link
Member

@dregad dregad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK with the csvlib and postgres driver changes, I'll go ahead commit those separately.

As for bogus queryID, more discussion is needed

adodb.inc.php Outdated
//If the _queryID is bogus, calling Close() may cause an error in the database driver.
if($this->_queryID != -1) {
$this->Close();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not sure that is the right fix actually, as this will prevent execution of cleanup tasks (e.g. freeing additional result sets in the mysql driver).

I believe that each driver should handle this specifically to ensure they don't break when _queryID == -1. At least some of them already do that (but I didn't check them all):

DB2 and firebird don't have such checks.

Was this just preventive maintenance, or did you run into an actual error or warning ?

drivers/adodb-postgres64.inc.php Show resolved Hide resolved
@dregad
Copy link
Member

dregad commented Apr 16, 2023

You might want to update your branch to fix the conflict I introduced by modifying the comment in the postgres64 driver.

@dregad
Copy link
Member

dregad commented Apr 16, 2023

Sorry Mike, I just realized that when I cherry-picked the changes (059ffc2 and b881dea) I forgot to update the commits' author to credit you for them. My apologies.

@Mike-Benoit
Copy link
Contributor Author

No worries at all.

@dregad dregad removed bug PHP8.2 PHP8.2 Compatibility Issues labels Apr 16, 2023
@dregad dregad removed this from the v5.22.6 milestone Apr 16, 2023
@dregad dregad closed this Apr 16, 2023
@dregad
Copy link
Member

dregad commented Apr 16, 2023

Closing this, as 3 of the changes have been covered separately (see #954, #956, #957).
The remaining point will be remain as-is for now (see discussion #952 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants