-
Notifications
You must be signed in to change notification settings - Fork 7.9k
mysql related test cases are failing on big endian system #5380
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here again, libmysql specifies STMT_ATTR_CURSOR_TYPE (and also STMT_ATTR_PREFETCH_ROWS below) as
unsigned long *
(see https://dev.mysql.com/doc/refman/8.0/en/mysql-stmt-attr-set.html). We should use that type here, in theattr_get
method directly below, and inphp-src/ext/mysqli/mysqli_api.c
Line 2374 in fd5dc55
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikic Kindly correct me if my understanding is wrong.
*(unsigned long * ) value
for both the cases i.e STMT_ATTR_CURSOR_TYPE & STMT_ATTR_PREFETCH_ROWS in both the function i.eattr_set
andattr_get
.zend_ulong
tounsigned long
inPHP_FUNCTION(mysqli_stmt_attr_get)
function to and its function return type accordingly.Updating diff changes below. Do let me know if any change is required. I have build and tested following changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those changes look right to me. However, there is one more place that needs to be adjusted:
php-src/ext/mysqli/mysqli_api.c
Lines 2349 to 2360 in fd5dc55
The
mode
variable used there should also beunsigned long
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikic but
mode_in
variable is of typezend_long
used during assignment?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but that's fine (can add an explicit cast if you like). The actual values involved here are small, it's just important that the type of the variable whose address we take is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikic kindly ignore my above comment, I had not covered the implementation for same. I will update earlier said change and raise new commit after testing.Thanks.