From ef9360d28532cf04b99a7c352b8897b79587ba37 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 9 Aug 2014 14:13:42 +0200 Subject: [ticket/12710] Pass the original column data to the create function PHPBB3-12710 --- phpBB/phpbb/db/tools.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/tools.php') diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index 69c6f17416..72bc7d72f1 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -2291,6 +2291,7 @@ class tools */ function sql_column_change($table_name, $column_name, $column_data, $inline = false) { + $original_column_data = $column_data; $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data); $statements = array(); @@ -2379,7 +2380,7 @@ class tools $temp_column_name = substr(md5($column_name), 0, 30); // Add a temporary table with the new type - $result = $this->sql_column_add($table_name, $temp_column_name, $column_data); + $result = $this->sql_column_add($table_name, $temp_column_name, $original_column_data); $statements = array_merge($statements, $result); // Copy the data to the new column @@ -2390,7 +2391,7 @@ class tools $statements = array_merge($statements, $result); // Recreate the original column with the new type - $result = $this->sql_column_add($table_name, $column_name, $column_data); + $result = $this->sql_column_add($table_name, $column_name, $original_column_data); $statements = array_merge($statements, $result); if (!empty($indexes)) -- cgit v1.2.1