interconnectit / Search-Replace-DB

This script was made to aid the process of migrating PHP and MySQL based websites. Works with most common CMSes.
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
GNU General Public License v3.0
3.99k stars 850 forks source link

table name 'wp_mmp_rechnung_history_2014-05-19' crashes srdb #382

Open Martin-Eckleben opened 1 year ago

Martin-Eckleben commented 1 year ago

Hi,

first let me thank you for your great work! I LOVE srdb and use it a lot!

I called: php srdb.cli.php --host 127.0.0.1 --name <dbname> --user <user> --pass <password> --search <string> --replace <string> --dry-run on a Wordpress 4.9.5 DB.

It stated a lot of tables and finds as usual i.e.:

wp_em_rechnungen_710: replacing <string> with <string>
wp_em_rechnungen_710: 31157 rows, 0 changes found, 0 updates made in 0.22814703 seconds

But then it crashes with: SQLSTATE[42000]: Syntax error or access violation: 1064 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 '-05-19' at line 1 on a table wp_mmp_rechnung_history_2014-05-19

(web client crashes with ajax error as well)

mysql Ver 8.0.31-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))

No Problem for me I'll simply rename the table. Just thought I'd tell you to do some good in the world :) Is a a PR wanted?

MadtownLems commented 11 months ago

The web client halts execution, reporting an AJAX error, if it encounters any table with a dash (-) in its name.