Bug #114152 | Invalid mysqldump file generated for some views with collate statements | ||
---|---|---|---|
Submitted: | 28 Feb 2024 7:53 | Modified: | 29 Feb 2024 1:11 |
Reporter: | Timothy Evetts | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S2 (Serious) |
Version: | mysqldump Ver 8.0.36-0ubuntu0.22.04.1 | OS: | Ubuntu (Pop!_OS 22.04 LTS) |
Assigned to: | CPU Architecture: | x86 (Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz) | |
Tags: | collate, mysqldump, reference, Views |
[28 Feb 2024 7:53]
Timothy Evetts
[28 Feb 2024 11:58]
MySQL Verification Team
HI Mr. Evetts, Thank you so much for your bug report. However, we were not able to repeat it. Here it is what we have got: mysql> SHOW VARIABLES LIKE '%char%'; +--------------------------+---------------------------------------------------------------------------+ | Variable_name | Value | +--------------------------+---------------------------------------------------------------------------+ | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_database | utf8mb4 | | character_set_filesystem | binary | | character_set_results | utf8mb4 | | character_set_server | utf8mb4 | | character_set_system | utf8mb3 | | character_sets_dir | ..... | +--------------------------+---------------------------------------------------------------------------+ 8 rows in set (0.05 sec) mysql> SHOW VARIABLES LIKE '%coll%'; +-------------------------------+--------------------+ | Variable_name | Value | +-------------------------------+--------------------+ | collation_connection | utf8mb4_0900_ai_ci | | collation_database | utf8mb4_0900_ai_ci | | collation_server | utf8mb4_0900_ai_ci | | default_collation_for_utf8mb4 | utf8mb4_0900_ai_ci | +-------------------------------+--------------------+ 4 rows in set (0.00 sec) mysql> SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME IN ( 'character_set_client', 'character_set_connection', 'character_set_results', 'collation_connection' ) ORDER BY VARIABLE_NAME; +--------------------------+--------------------+ | VARIABLE_NAME | VARIABLE_VALUE | +--------------------------+--------------------+ | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_results | utf8mb4 | | collation_connection | utf8mb4_0900_ai_ci | +--------------------------+--------------------+ 4 rows in set (0.01 sec) mysqldump --defaults-extra-file='test.cnf' --default-character-set=utf8mb4 test > collation_test.sql OK mysql --defaults-extra-file='test.cnf' --default-character-set=utf8mb4 test < collation_test.sql OK Then, a check once again: mysql> SHOW VARIABLES LIKE '%char%'; +--------------------------+---------------------------------------------------------------------------+ | Variable_name | Value | +--------------------------+---------------------------------------------------------------------------+ | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_database | utf8mb4 | | character_set_filesystem | binary | | character_set_results | utf8mb4 | | character_set_server | utf8mb4 | | character_set_system | utf8mb3 | | character_sets_dir | ... | +--------------------------+---------------------------------------------------------------------------+ 8 rows in set (0.00 sec) mysql> SHOW VARIABLES LIKE '%coll%'; +-------------------------------+--------------------+ | Variable_name | Value | +-------------------------------+--------------------+ | collation_connection | utf8mb4_0900_ai_ci | | collation_database | utf8mb4_0900_ai_ci | | collation_server | utf8mb4_0900_ai_ci | | default_collation_for_utf8mb4 | utf8mb4_0900_ai_ci | +-------------------------------+--------------------+ 4 rows in set (0.00 sec) mysql> SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME IN ( 'character_set_client', 'character_set_connection', 'character_set_results', 'collation_connection' ) ORDER BY VARIABLE_NAME; +--------------------------+--------------------+ | VARIABLE_NAME | VARIABLE_VALUE | +--------------------------+--------------------+ | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_results | utf8mb4 | | collation_connection | utf8mb4_0900_ai_ci | +--------------------------+--------------------+ 4 rows in set (0.00 sec) mysql> show tables; +----------------+ | Tables_in_test | +----------------+ | foo | | view_a | | view_b | +----------------+ 3 rows in set (0.00 sec) Table foo and views view_a and view_b were exactly the same as they were created. Let us know if this has helped you ....... Please, especially try the above query from the Performance Schema.
[29 Feb 2024 1:11]
Timothy Evetts
Thank you for attempting to replicate it. The fact that it worked for you hinted to me there must be something different about my setup. Digging further I realised it's because even though I'm running mysql-client locally and therefore using the MySQL version of mysqldump, the server I was connecting to is actually running MariaDB. I have now re-tested importing the generated dump file into an actual MySQL server and it works as expected. This is obviously a bug with MariaDB server and not with mysqldump.
[29 Feb 2024 10:50]
MySQL Verification Team
Hi Mr. Evetts, Thank you for your feedback. We suppose that the company that makes the server that you are using has it's own site for bug reporting.