Skip to content

Fix bug #80837 #6755

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

Conversation

kamil-tekiela
Copy link
Member

@kamil-tekiela kamil-tekiela marked this pull request as draft March 5, 2021 21:52
@kamil-tekiela kamil-tekiela force-pushed the Fix-stmt_store_result-error branch from 4951305 to e168109 Compare March 5, 2021 21:55
@kamil-tekiela kamil-tekiela marked this pull request as ready for review March 5, 2021 21:55
@cmb69
Copy link
Member

cmb69 commented Mar 10, 2021

Unless the bugfix would break reasonably written code or is considered somewhat unsafe/experimental, the fix should target PHP-7.4 or maybe 8.0.

@cmb69 cmb69 added the Bug label Mar 10, 2021
@kamil-tekiela kamil-tekiela force-pushed the Fix-stmt_store_result-error branch from e168109 to 086f16b Compare March 12, 2021 20:30
@kamil-tekiela kamil-tekiela changed the base branch from master to PHP-7.4 March 12, 2021 20:30
@kamil-tekiela
Copy link
Member Author

@cmb69 I did git rebase --onto php/php-7.4 master Fix-stmt_store_result-error and then changed in the PR to merge into PHP-7.4. Is this what you meant?

@@ -92,7 +92,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s)

/* Nothing to store for UPSERT/LOAD DATA*/
if (!mysqlnd_stmt_check_state(stmt)) {
SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync);
SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync);
Copy link
Member

Choose a reason for hiding this comment

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

Something that's not really clear to me is when we should be setting the error on the stmt only, and when we should be setting it on stmt and conn both. It seems like in this code we often set both, but it's not really consistent.

Copy link
Member Author

Choose a reason for hiding this comment

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

These errors are an absolute mess. It should be that when a function starts with mysql_stmt_ we set stmt->error_info only. For everything else we set conn->error_info. There is a problem with out of memory errors. There are also some exceptions to this rule e.g. prepare method which needs to set both errors as it can be called in both ways.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, that makes sense.

@cmb69
Copy link
Member

cmb69 commented Mar 15, 2021

@kamil-tekiela, yes, that is basically what I meant. But for some reason AppVeyor did still pick the master dependencies. I'm not quite sure regarding the rebase command; is "master" the remote?

@nikic
Copy link
Member

nikic commented Mar 15, 2021

Merged as c93b461.

@nikic nikic closed this Mar 15, 2021
@kamil-tekiela kamil-tekiela deleted the Fix-stmt_store_result-error branch March 15, 2021 13:44
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.

3 participants