Skip to content

Conversation

@arshidkv12
Copy link

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

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

From what I can see (as somebody who doesn't maintain this code), most arguments are validated without the MYSQLI_REPORT_ERROR guard, and throw a zend_argument_value_error().

But somebody who does maintain this should confirm.

arshidkv12 and others added 3 commits January 19, 2026 21:33
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
@arshidkv12
Copy link
Author

From what I can see (as somebody who doesn't maintain this code), most arguments are validated without the MYSQLI_REPORT_ERROR guard, and throw a zend_argument_value_error().

But somebody who does maintain this should confirm.

- if (MyG(report_mode) & MYSQLI_REPORT_ERROR) {
	zend_value_error("mysqli_options(): Invalid option %d", (int)mysql_option);

Do we need to remove if (MyG(report_mode) & MYSQLI_REPORT_ERROR)? What do you think?

@arshidkv12 arshidkv12 requested a review from iluuu1994 January 19, 2026 16:50
@iluuu1994
Copy link
Member

Somebody else should review this. /cc @Girgias @SakiTakamachi

@kamil-tekiela
Copy link
Member

First of all, I don't know if this should be an error condition. I guess it kind of makes sense. But as you can see in the test, no message was the behaviour by design.

The error should be without the guard and without the function name in the message. It seems to me like you have also put it in the wrong place. Judging by the message and the test, you wanted to put it in the switch statement after that.

The message isn't very descriptive either. What does it mean "invalid option"? What should the user do differently?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants