aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-06-13 16:04:54 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-06-13 16:04:54 +0000
commite69fe56634225d771d4d47c2151d9828b1be2b5d (patch)
tree79c71561d2286966fb0ac1b36aa9d50a469a5870 /phpBB/install
parentd8e78c766b0f14f5d53e1916c341cbaccb012b4f (diff)
downloadforums-e69fe56634225d771d4d47c2151d9828b1be2b5d.tar
forums-e69fe56634225d771d4d47c2151d9828b1be2b5d.tar.gz
forums-e69fe56634225d771d4d47c2151d9828b1be2b5d.tar.bz2
forums-e69fe56634225d771d4d47c2151d9828b1be2b5d.tar.xz
forums-e69fe56634225d771d4d47c2151d9828b1be2b5d.zip
- fix sql_column_exists for firebird (had same problem as oracle)
- fix sql_column_change for firebird (interbase6 only supports TYPE and SET DEFAULT, but not the same syntax ass ADD COLUMN) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9586 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/database_update.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 948087dd3b..7f1edf2e28 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -497,7 +497,7 @@ function _sql($sql, &$errored, &$error_ary, $echo_dot = true)
{
$errored = true;
$error_ary['sql'][] = $db->sql_error_sql;
- $error_ary['error_code'][] = $db->_sql_error();
+ $error_ary['error_code'][] = $db->sql_error_returned;
}
$db->sql_return_on_error(false);
@@ -1671,7 +1671,7 @@ class updater_db_tools
case 'firebird':
$sql = "SELECT RDB\$FIELD_NAME as FNAME
FROM RDB\$RELATION_FIELDS
- WHERE RDB\$RELATION_NAME = '{$table}'";
+ WHERE RDB\$RELATION_NAME = '" . strtoupper($table) . "'";
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result))
{
@@ -1824,10 +1824,12 @@ class updater_db_tools
{
case 'firebird':
$sql .= " {$column_type} ";
+ $return_array['column_type_sql_type'] = " {$column_type} ";
if (!is_null($column_data[1]))
{
$sql .= 'DEFAULT ' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' ';
+ $return_array['column_type_sql_default'] = ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' ';
}
$sql .= 'NOT NULL';
@@ -2344,7 +2346,15 @@ class updater_db_tools
{
case 'firebird':
// Change type...
- $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql'];
+ if (!empty($column_data['column_type_sql_default']))
+ {
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql_type'];
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" SET DEFAULT ' . ' ' . $column_data['column_type_sql_default'];
+ }
+ else
+ {
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql'];
+ }
break;
case 'mssql':