-
Notifications
You must be signed in to change notification settings - Fork 977
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
ProxySQL does not propagate database warnings #1751
Comments
This problem can be also demonstrated by
Welcome to the MariaDB monitor. Commands end with ; or \g. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [test]> \W MariaDB [test]> INSERT INTO t VALUES ("a"); Warning (Code 1366): Incorrect integer value: 'a' for column 'value' at row 1
MariaDB [test]> SHOW WARNINGS;
1 row in set (0.00 sec)
Welcome to the MariaDB monitor. Commands end with ; or \g. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [test]> \W MySQL [test]> INSERT INTO t VALUES ("a"); MySQL [test]> SELECT @@warning_count;
MySQL [test]> SHOW WARNINGS; As can be seen ProxySQL on port 6033 does not return warnings via |
This still seems to be an issue in 2.4.2 Thanks |
When SQL command cause warning on database server, then server sends in response packet indication with number of warnings. MySQL C library provides function
mysql_warning_count
which returns number of warnings from that response packet: https://dev.mysql.com/doc/refman/8.0/en/mysql-warning-count.htmlIf user's application wants to fetch those warnings, it needs to issue
SHOW WARNINGS
SQL command.But ProxySQL always returns empty list of warnings when warning was issued from server. Basically
SHOW WARNINGS
from ProxySQL always returns empty result set, which means that number of rows returned bySHOW WARNINGS
andmysql_warning_count()
does not match.Incorrect number is handled by SQL applications as server problem and close connection. In attachment test-warnings.c.gz is a testing C program. It passes when running directly against MySQL or MariaDB server and fails when running against ProxySQL. So problem is in ProxySQL.
Problem was detected by Perl's DBI database driver DBD::MariaDB used for connecting to the MySQL or MariaDB server.
DBD::MariaDB is not able to retrieve warning or errors from MySQL or MariaDB server when DBD::MariaDB is running against ProxySQL as ProxySQL does not propagate
SHOW WARNINGS
correctly.Test result of the test-warnings.c.gz program:
When running directly against MariaDB server:
Number of warnings reported by
mysql_warning_count
andSHOW WARNINGS
matches. And list of warnings really contain one warning.When running against ProxySQL behind which is MariaDB server:
Number of warnings reported by
mysql_warning_count
andSHOW WARNINGS
are different (0 vs 1) and list of warnings is empty. But there should be one generated warning.The text was updated successfully, but these errors were encountered: