From fd08c9b8f9c2afaa2563e8cb35fd9d07170394cd Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sat, 24 Oct 2009 09:04:33 +0000 Subject: [PATCH] Fixed table selection query in sanitize_database(). --- sql/alter2.2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/alter2.2.php b/sql/alter2.2.php index e94187d3..c5345233 100644 --- a/sql/alter2.2.php +++ b/sql/alter2.2.php @@ -287,7 +287,7 @@ function sanitize_database($pref, $test = false) { if ($test) error_log('Sanitizing database ...'); - $tsql = "SHOW TABLES LIKE '{$pref}%'"; + $tsql = "SHOW TABLES LIKE '".($pref=='' ? '' : substr($pref,0,-1).'\\_')."%'"; $tresult = db_query($tsql, "Cannot select all tables with prefix '$pref'"); while($tbl = db_fetch($tresult)) { $table = $tbl[0]; -- 2.30.2