UpdateDatabase/MysqlLinks.php
[Pman.Core] / UpdateDatabase / MysqlLinks.php
index 0e0cc64..c25851e 100644 (file)
@@ -439,13 +439,32 @@ class Pman_Core_UpdateDatabase_MysqlLinks {
     {
         foreach (array_keys($this->schema) as $tbl){
             
-            print_R(strpos('__keys', $tbl));
-            if(strpos('__keys', $tbl) !== false ){
+            if(strpos($tbl, '__keys') !== false ){
                 continue;
             }
             
-            echo "CALL mysql_change_charset('{$tbl}') \n";
-            DB_DataObject::factory('core_enum')->query("CALL mysql_change_charset('{$tbl}')");
+            $ce = DB_DataObject::factory('core_enum');
+            
+            $ce->query("
+                SELECT
+                        CCSA.character_set_name csname,
+                        CCSA.collation_name collatename
+                FROM
+                        information_schema.`TABLES` T,
+                        information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA
+                WHERE
+                        CCSA.collation_name = T.table_collation
+                    AND
+                        T.table_schema = '{$ce->database()}' COLLATE utf8_unicode_ci
+                    AND
+                        T.table_name = '{$tbl}' COLLATE utf8_unicode_ci
+            ");
+                     
+            
+            
+            
+            
+            
         }
     }