From dc203af8a08b82e4d456fdf4d31450fb9f746e9b Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Fri, 15 Apr 2011 17:51:14 +0400 Subject: [PATCH] Fix check of existance of tables indexes during database upgrade process --- src/messenger/webim/install/dbperform.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/messenger/webim/install/dbperform.php b/src/messenger/webim/install/dbperform.php index c5e5d118..9d091438 100644 --- a/src/messenger/webim/install/dbperform.php +++ b/src/messenger/webim/install/dbperform.php @@ -154,12 +154,12 @@ if ($act == "silentcreateall") { runsql("ALTER TABLE ${mysqlprefix}chatgroup ADD vcemail varchar(64)", $link); } - $res = mysql_query("select null from information_schema.statistics where table_name = '${mysqlprefix}chatmessage' and index_name = 'idx_agentid'", $link); + $res = mysql_query("select null from information_schema.statistics where table_schema = '$mysqldb' and table_name = '${mysqlprefix}chatmessage' and index_name = 'idx_agentid'", $link); if ($res && mysql_num_rows($res) == 0) { runsql("ALTER TABLE ${mysqlprefix}chatmessage ADD INDEX idx_agentid (agentid)", $link); } - $res = mysql_query("select null from information_schema.statistics where table_name = '${mysqlprefix}chatsitevisitor' and index_name = 'threadid'", $link); + $res = mysql_query("select null from information_schema.statistics where table_schema = '$mysqldb' and table_name = '${mysqlprefix}chatsitevisitor' and index_name = 'threadid'", $link); if ($res && mysql_num_rows($res) == 0) { runsql("ALTER TABLE ${mysqlprefix}chatsitevisitor ADD INDEX (threadid)", $link); }