X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=UpdateDatabase%2FMysqlEngineCharset.php;h=ba81c6361b8648ad4fdeac6ce989e19a0cb77c96;hb=3dfa28ee12e72e27f69a7734bef807c2628e5d53;hp=0d3d872fd2daacd1d03a4f2c2831bfa39353d0bb;hpb=f453b1150ec58d676e7ce2a005041ff62927e667;p=Pman.Core diff --git a/UpdateDatabase/MysqlEngineCharset.php b/UpdateDatabase/MysqlEngineCharset.php index 0d3d872f..ba81c636 100644 --- a/UpdateDatabase/MysqlEngineCharset.php +++ b/UpdateDatabase/MysqlEngineCharset.php @@ -13,10 +13,15 @@ class Pman_Core_UpdateDatabase_MysqlEngineCharset { function __construct() { - + // this might get run before we have imported the database + // and hence not have any db. $this->loadIniFiles(); //?? shared??? + $dbo = DB_DataObject::factory('core_enum'); + + + if (is_a($dbo, 'PDO_DataObject')) { $this->views = $dbo->generator()->introspection()->getListOf('views'); @@ -28,10 +33,9 @@ class Pman_Core_UpdateDatabase_MysqlEngineCharset { // update the engine first - get's around 1000 character limit on indexes..cd // however - Innodb does not support fulltext indexes, so this may fail... $this->updateEngine(); - + $this->updateCharacterSet(); - - + } function loadIniFiles() @@ -113,6 +117,7 @@ class Pman_Core_UpdateDatabase_MysqlEngineCharset { { $db = DB_DataObject::factory('core_enum'); $db->query("show variables like 'innodb_file_per_table'"); + $db->fetch(); $pg = HTML_FlexyFramework::get()->page; @@ -133,12 +138,13 @@ class Pman_Core_UpdateDatabase_MysqlEngineCharset { $views = $this->views; - + echo "a3\n"; foreach (array_keys($this->schema) as $tbl){ if(strpos($tbl, '__keys') !== false ){ continue; } + if(in_array($tbl , $views)) { continue; } @@ -159,12 +165,14 @@ class Pman_Core_UpdateDatabase_MysqlEngineCharset { if (!$ce->fetch()) { continue; } + //AWS is returning captials? + $engine = isset($ce->engine) ? $ce->engine : $ce->ENGINE; - if($ce->engine == 'InnoDB' ){ + if($engine == 'InnoDB' ){ echo "InnoDB: SKIP $tbl\n"; continue; } - if($ce->engine == 'ndbcluster' ){ + if($engine == 'ndbcluster' ){ echo "ndbcluster: SKIP $tbl\n"; continue; }