Bug #107862 clone failed when table with special name
Submitted: 13 Jul 2022 10:29 Modified: 13 Jul 2022 11:46
Reporter: phoenix Zhang (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Clone Plugin Severity:S3 (Non-critical)
Version:8.0.25 OS:Any
Assigned to: CPU Architecture:Any
Tags: clone plugin, Contribution

[13 Jul 2022 10:29] phoenix Zhang
Description:
If the recipient node has a table: test.t`1, then clone will failed.

How to repeat:
connect server1:
mysql> create table test.`t``1` (c1 int primary key);
Query OK, 0 rows affected (0.10 sec)

mysql> clone instance from 'root'@'127.0.0.1':13002 identified by '';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1`' at line 1

Suggested fix:
When build DROP TABLE sql when cleanup data, it should formatted the table_name and schema name
[13 Jul 2022 10:38] phoenix Zhang
adding the patch as contribution  (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am au

Attachment: clone_special_table.diff (text/x-patch), 1.18 KiB.

[13 Jul 2022 10:38] phoenix Zhang
adding the patch as contribution  (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am au

Attachment: clone_special_table.diff (text/x-patch), 1.18 KiB.

[13 Jul 2022 10:46] phoenix Zhang
Here is my little patch

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: clone_special_table.diff (text/x-patch), 1.18 KiB.

[13 Jul 2022 11:46] MySQL Verification Team
Hello phoenix Zhang!

Thank you for the report and contribution.

regards,
Umesh
[14 Jul 2022 2:57] phoenix Zhang
fix for tablespace, database, and table_name with special char. and add mgr test

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: clone_special_table_2.diff (text/x-patch), 7.38 KiB.

[14 Jul 2022 10:26] phoenix Zhang
change the patch, use more safe c_ptr_safe

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: clone_special_table_3.diff (text/x-patch), 7.40 KiB.