From 942130047397032295e34fe9a328e59efee0936f Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Mon, 8 Nov 2010 12:52:12 +0000 Subject: [PATCH] 2010-11-08 Sergio Martin * util/pandora_recode_db.pl: Checked if the tables exists to avoid the recodification in case of purely open installations git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3553 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 6 ++++++ pandora_server/util/pandora_recode_db.pl | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index fa6e456829..fafb47a766 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2010-11-08 Sergio Martin + + * util/pandora_recode_db.pl: Checked if the tables exists + to avoid the recodification in case of purely open + installations + 2010-11-08 Sergio Martin * util/pandora_sync_db.pl: Changed from DELETE to diff --git a/pandora_server/util/pandora_recode_db.pl b/pandora_server/util/pandora_recode_db.pl index ad07300abb..73735c9af9 100755 --- a/pandora_server/util/pandora_recode_db.pl +++ b/pandora_server/util/pandora_recode_db.pl @@ -110,6 +110,13 @@ sub recode_store_tables() { sub recode_table ($$$) { my ($dbh, $table, $column) = @_; my $encoded_values = 0; + + my @tablestatus = get_db_rows ($dbh, "SHOW TABLE STATUS WHERE name = '$table'"); + + if($#tablestatus == -1) { + return 0; + } + my @rows = get_db_rows ($dbh, "SELECT $column FROM $table"); foreach my $row (@rows) {