-
Notifications
You must be signed in to change notification settings - Fork 8k
Mysqli: fix missing error for invalid mysqli_options() option #20971
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
Merged
Merged
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
a401699
Fix bug gh20968
arshidkv12 217b19b
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 66fbc0a
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 54a8e06
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 0716f97
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 d7dd938
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 1aa360a
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 04f8006
Update ext/mysqli/mysqli_api.c
arshidkv12 9ba4bf2
Update ext/mysqli/tests/gh20968.phpt
arshidkv12 2db6e98
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 29ed278
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 1647ae8
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 0a98c9c
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 8193542
Update ext/mysqli/mysqli_api.c
arshidkv12 3a633b3
Update ext/mysqli/tests/mysqli_options.phpt
arshidkv12 072d1a4
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 a188868
Update ext/mysqli/tests/mysqli_set_opt.phpt
arshidkv12 e102967
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 6a71d4f
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 d1df211
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 d335402
Update ext/mysqli/mysqli_api.c
arshidkv12 69f0924
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 81bd296
Update ext/mysqli/mysqli_api.c
arshidkv12 e754b49
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 b16f994
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 357164e
mysqli: raise ValueError for invalid option in mysqli_options() respe…
arshidkv12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --TEST-- | ||
| GH-20968 mysqli_options() with invalid option should triggers ValueError | ||
| --EXTENSIONS-- | ||
| mysqli | ||
| --CONFLICTS-- | ||
| mysqli | ||
| --SKIPIF-- | ||
| <?php | ||
| require_once 'skipifconnectfailure.inc'; | ||
| ?> | ||
| --FILE-- | ||
| <?php | ||
| require_once 'connect.inc'; | ||
|
|
||
| $mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket); | ||
|
|
||
| try { | ||
| $value = $mysqli->options(10, 'invalid_option'); | ||
| var_dump($value); | ||
| } catch (ValueError $exception) { | ||
| echo $exception->getMessage() . "\n"; | ||
| } | ||
|
|
||
| ?> | ||
| --EXPECTF-- | ||
| mysqli::options(): Argument #%d ($option) must be MYSQLI_INIT_COMMAND, MYSQLI_SET_CHARSET_NAME, MYSQLI_SERVER_PUBLIC_KEY, or one of the MYSQLI_OPT_* constants | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: EOL before EOF. |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.