From: Janusz Dobrowolski Date: Sat, 24 Oct 2009 09:04:33 +0000 (+0000) Subject: Fixed table selection query in sanitize_database(). X-Git-Tag: v2.4.2~19^2~1083 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=fd08c9b8f9c2afaa2563e8cb35fd9d07170394cd;p=fa-stable.git Fixed table selection query in sanitize_database(). --- 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];