From 34f3c8bf1f36bcb0d88fa7c6c7354ef011cfc2aa Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 21 Jan 2013 09:49:59 +0000 Subject: [PATCH] * Admin/Setup: fixed restore always converted longtext columns to text and therefore truncating them to 64k on MySQL, also fixed backup to report them correctly in backup of schema --- phpgwapi/inc/class.db_backup.inc.php | 2 +- phpgwapi/inc/class.schema_proc.inc.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.db_backup.inc.php b/phpgwapi/inc/class.db_backup.inc.php index 3ecc954e0c..2e55469562 100644 --- a/phpgwapi/inc/class.db_backup.inc.php +++ b/phpgwapi/inc/class.db_backup.inc.php @@ -455,7 +455,7 @@ class db_backup // if column is longtext in current schema, convert text to longtext, in case user already updated column foreach($schema['fd'] as $col => &$def) { - if ($def['type'] == 'text' && $this->db->get_column_attribute($col, $table, true, 'type') == 'longtext') + if ($def['type'] == 'text' && $this->db->get_column_attribute($col, $table_name, true, 'type') == 'longtext') { $def['type'] = 'longtext'; } diff --git a/phpgwapi/inc/class.schema_proc.inc.php b/phpgwapi/inc/class.schema_proc.inc.php index 40ae7e9b3b..3ef6c2581a 100644 --- a/phpgwapi/inc/class.schema_proc.inc.php +++ b/phpgwapi/inc/class.schema_proc.inc.php @@ -1184,6 +1184,9 @@ class schema_proc $type = method_exists($this->dict,'MetaType') ? $this->dict->MetaType($column) : strtoupper($column->type); + // fix longtext not correctly handled by ADOdb + if ($type == 'X' && $column->type == 'longtext') $type = 'XL'; + static $ado_type2egw = array( 'C' => 'varchar', 'C2' => 'varchar',