]> git.mxchange.org Git - mailer.git/blobdiff - inc/db/lib-mysql3.php
Earning subscriptions introduced (unfinished):
[mailer.git] / inc / db / lib-mysql3.php
index 473159e03d5b3a3b8fe0b2fd85e994e77f9dfd3c..a86d391cd93988d3f24674d3c130a2a36f2a6c05 100644 (file)
@@ -363,16 +363,16 @@ function SQL_ALTER_TABLE ($sql, $F, $L, $enableCodes = true) {
        $result = false;
 
        // Determine index/fulltext/unique word
-       $noIndex = (
-       (
-               isInStringIgnoreCase('INDEX', $sql)
-       ) && (
-               isInStringIgnoreCase('KEY', $sql)
-       ) && (
-               isInStringIgnoreCase('FULLTEXT', $sql)
-       ) && (
-               isInStringIgnoreCase('UNIQUE', $sql)
-       )
+       $isAlterIndex = (
+               (
+                       isInString('INDEX', $sql)
+               ) && (
+                       isInString('KEY', $sql)
+               ) && (
+                       isInString('FULLTEXT', $sql)
+               ) && (
+                       isInString('UNIQUE', $sql)
+               )
        );
 
        // Extract table name
@@ -380,10 +380,10 @@ function SQL_ALTER_TABLE ($sql, $F, $L, $enableCodes = true) {
        $tableName = str_replace('`', '', $tableArray[2]);
 
        // Debug log
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sql . ',tableName=' . $tableName . ',tableArray=<pre>' . print_r($tableArray, true) . '</pre>');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sql . ',tableName=' . $tableName . ',tableArray=<pre>' . print_r($tableArray, true) . '</pre>,isAlterIndex=' . intval($isAlterIndex));
 
        // Shall we add/drop?
-       if (((isInString('ADD', $sql)) || (isInString('DROP', $sql)) || (isInString('CHANGE', $sql))) && ($noIndex === true)) {
+       if (((isInString('ADD', $sql)) || (isInString('DROP', $sql)) || (isInString('CHANGE', $sql))) && ($isAlterIndex === false)) {
                // Try two columns, one should fix
                foreach (array(4,5) as $idx) {
                        // If an entry is not set, abort here
@@ -423,7 +423,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L, $enableCodes = true) {
        } elseif ((getTableType() == 'InnoDB') && (isInString('FULLTEXT', $sql))) {
                // Skip this query silently because InnoDB does not understand fulltext indexes
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Skipped FULLTEXT: sql=%s,tableName=%s,hasZeroNums=%d,file=%s,line=%s", $sql, $tableName, intval((is_bool($result)) ? 0 : isSqlTableColumnFound($columnName)), $F, $L));
-       } elseif ($noIndex === false) {
+       } elseif ($isAlterIndex === true) {
                // And column name as well without backticks
                $keyName = str_replace('`', '', $tableArray[5]);
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keyName=' . $keyName . ',tableArray=<pre>' . print_r($tableArray, true) . '</pre>');