From: Roland Häder Date: Mon, 12 Nov 2012 18:39:00 +0000 (+0000) Subject: Fixes for installation phase X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=13d49e2e460309945446feacde3c9e6c91a34172;p=mailer.git Fixes for installation phase --- diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 4b8c5a299a..428f262bfd 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -639,6 +639,18 @@ function ifSqlTableExists ($tableName) { $result = SQL_QUERY_ESC("SHOW TABLES FROM `{?__DB_NAME?}` WHERE `Tables_in_{?__DB_NAME?}`='{?_MYSQL_PREFIX?}_%s'", array($tableName), __FILE__, __LINE__); + // Is a link there? + if (!is_resource($result)) { + // Is installation phase? + if (isInstallationPhase()) { + // Then silently abort here + return FALSE; + } else { + // Please report this + reportBug(__FUNCTION__, __LINE__, 'result[]=' . gettype($result) . ' is not a resource.'); + } + } // END - if + // Is there an entry? $GLOBALS[__FUNCTION__][$tableName] = (SQL_NUMROWS($result) == 1); //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',numRows=' . intval($GLOBALS[__FUNCTION__][$tableName])); @@ -664,6 +676,18 @@ function ifSqlColumnExists ($tableName, $columnName) { $columnName ), __FUNCTION__, __LINE__); + // Is a link there? + if (!is_resource($result)) { + // Is installation phase? + if (isInstallationPhase()) { + // Then silently abort here + return FALSE; + } else { + // Please report this + reportBug(__FUNCTION__, __LINE__, 'result[]=' . gettype($result) . ' is not a resource.'); + } + } // END - if + // Determine it $GLOBALS[__FUNCTION__][$tableName][$columnName] = (!SQL_HASZERONUMS($result)); //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $columnName . ',hasZeroNums=' . intval(SQL_HASZERONUMS($result)) . ',numRows=' . intval($GLOBALS[__FUNCTION__][$tableName][$columnName])); @@ -685,6 +709,18 @@ function isSqlTableIndexFound ($tableName, $keyName) { // Show indexes $result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`", array($tableName), __FUNCTION__, __LINE__); + // Is a link there? + if (!is_resource($result)) { + // Is installation phase? + if (isInstallationPhase()) { + // Then silently abort here + return FALSE; + } else { + // Please report this + reportBug(__FUNCTION__, __LINE__, 'result[]=' . gettype($result) . ' is not a resource.'); + } + } // END - if + // The column is not found by default $GLOBALS[__FUNCTION__][$tableName][$keyName] = FALSE;