-
Notifications
You must be signed in to change notification settings - Fork 986
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
Added warnings handling #4365
Merged
Merged
Added warnings handling #4365
Conversation
This file contains 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
* Implemented 'SHOW WARNINGS' and 'SHOW COUNT(*) FROM WARNINGS' query handling. * When a query produces warnings, the warning count is now included in the query response. Additionally, a new variable 'mysql-query_cache_with_warnings_support' has been introduced for the query cache feature: * A value of '0' means that if a query execution produces warnings, the resultset will not be saved in the query cache. * A value of '1' indicates that if a query produces warnings, the resultset will be saved in the query cache, but the warning count in that resultset will be set to '0'. ** Note: * Warning handling is dependent on the query digest and 'mysql-query_digests' must be enabled for it to work. * Warnings saved in logfile ['mysql-log_mysql_warnings_enabled'] and the current feature can work in conjunction with each other.
renecannao
requested changes
Oct 29, 2023
…' to 'mysql-query_cache_handle_warnings' * Introduced global variable 'mysql-handle_warnings' to control warning support in ProxySQL * Included 'handling_warnings' flag in the 'mysql_hostgroup_attributes' table (hostgroup_settings). This flag holds top priority and can override the value of the global variable 'mysql_handle_warnings'.
* 'MySQL_Connection::warning_count' will be globally employed for managing multiplexing control and transmitting the warning count to the client * Fixed prepare statement bug: When preparing, if the digest matches, the result set is retrieved from the cache and sent to the client. Note: Currently using 'mysql_warning_count' to retrieve the warning count for prepared statement.
I'm not in a position to review this, but just wanted to say we tripped over this issue recently and this fix is exactly what we are looking for. So thank you. 🙏 |
… disabled. * Introduced 'ps_type' enum to differentiate between preparing a statement and executing a statement * Fixed issue where the warning count fails to reset when the SET statement generates a warning. * Resolved the issue where the 'server_status' and 'warning count' were not accurately represented in the statement. * Replaced 'mysql_warning_count' with 'mysql_stmt_warning_count' for retrieving the warning count in statements. * Added 'handle_warning' field in hostgroup_attributes TAP test * Updated warnings TAP test
rahim-kanji
force-pushed
the
v2.x_warning_support
branch
from
November 16, 2023 08:48
b993db3
to
045d6bc
Compare
retest this please |
1 similar comment
retest this please |
…ent does not support CLIENT_DEPRECATE_EOF, warning_count will be '0' in intermediate EOF packet. * Suppress the display of warning counts in the "SHOW WARNINGS" statement.
rahim-kanji
force-pushed
the
v2.x_warning_support
branch
from
November 20, 2023 19:58
24c6395
to
e1c489a
Compare
retest this please |
1 similar comment
retest this please |
…d print it in the log. This override will apply to all TAP tests, except when the TAP test is linked with the MySQL client library (LIBMYSQL_HELPER defined). * Avoid closing of same mysql connection twice on error. * Disabled warning count logging on few TAP tests * Enable CLIENT_DEPRECATE_EOF on 20% of total mysql connections
…final # Conflicts: # test/tap/tests/set_testing-240-t.cpp
rahim-kanji
force-pushed
the
v2.x_warning_support
branch
from
November 26, 2023 20:05
1ef3534
to
8606742
Compare
retest this please |
retest this please |
1 similar comment
retest this please |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves Issue#1751
Summary:
When a query is executed, and it generates a warning, the multiplexing feature is temporarily disabled. The status is set to
'has_warnings'
and the'warning_in_hg'
is assigned the current host group. If the next query happens to be either'SHOW WARNINGS'
or'SHOW COUNT(*) FROM WARNINGS'
, it will be executed on the host group specified in'warning_in_hg'
. However, if any other type of query is executed, multiplexing is re-enabled, and'warning_in_hg'
is reset to -1.Changes:
'SHOW WARNINGS'
and'SHOW COUNT(*) FROM WARNINGS'
query handling.For more granular control, a new variable
'mysql-handle_warnings'
and'handling_warnings'
flag in the'mysql_hostgroup_attributes'
table ('hostgroup_settings'
) has been introduced to control warnings handling in ProxySQL:'0'
means warnings handling is completely disabled.'1'
enables warnings handling as described above.Additionally, a new variable
'mysql-query_cache_handle_warnings'
has been introduced for the query cache feature:'0'
means that if a query execution produces warnings, the resultset will not be saved in the query cache.'1'
indicates that if a query produces warnings, the resultset will be saved in the query cache, but the warning count in that result set will be set to'0'
.Note:
'mysql-query_digests'
must be enabled for it to work.'mysql-log_mysql_warnings_enabled'
] and the current feature can work in conjunction with each other.'mysql-query_digests_keep_comment'
is enabled, and'SHOW WARNINGS'
or'SHOW COUNT(*) FROM WARNINGS'
is used with comments.'SELECT @@warning_count'
. If this query is executed, multiplexing will be disabled and will remain disabled for that connection.