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

fix fetch args #34

Merged
merged 2 commits into from Apr 15, 2024
Merged

fix fetch args #34

merged 2 commits into from Apr 15, 2024

Conversation

ashnazg
Copy link
Member

@ashnazg ashnazg commented Jan 28, 2024

Issue #33 . This fixes the args for oci_fetch_array. I tried to keep the same $moredata logic, based on (what I think is) original ocifetchinto return behavior of integer of rows fetched.

@schengawegga , I'll need you to test this since I don't have the right environment.

@schengawegga
Copy link
Collaborator

Thank @ashnazg for der PR.
I will look at it soon.

"Argument pear#1 ($value) must be of type Countable|array, bool given" at the end of the query
@schengawegga
Copy link
Collaborator

@ashnazg Thanks for your PR. I pushed a second commit, becuase at the end of the query dataset, oci_fetch_array returns a false value, to end a while loop, that is not acceptable by count(). I will doublecheck all other changed functions, on my last PHP8.2 release, if there any other functions with the same issue than oci_fetch_array. Could you do a review of my comitted change, please?

@schengawegga schengawegga added this to the Version 1.12.2 milestone Apr 7, 2024
@@ -383,14 +383,24 @@ function fetchInto($result, &$arr, $fetchmode, $rownum = null)
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$moredata = @oci_fetch_array($result,$arr,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS);
$arr = @oci_fetch_array($result,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS);
Copy link
Member

@till till Apr 8, 2024

Choose a reason for hiding this comment

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

Why silence?

Copy link
Collaborator

Choose a reason for hiding this comment

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

i think, because of all other PHP oci functions are silent, too. Maybe the DBMS should handle the error messages on its own?
@ashnazg is that right? or what do you thought by silence that function?

There is also another check, if the oci_fetch_array returns an array and not false.
i don´t have a strong opinion on call it silence or not.
@ashnazg @till what do you suggest?

Copy link
Member

Choose a reason for hiding this comment

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

@schengawegga No, that sounds plausible. Otherwise LGTM!

@schengawegga schengawegga merged commit 0d5e7d4 into pear:trunk Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants