mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
hopefully fixing bug #14890 - need to test later
git-svn-id: file:///svn/phpbb/trunk@8247 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -1913,7 +1913,6 @@ function prepare_column_data($dbms, $column_data, $table_name, $column_name)
|
||||
}
|
||||
|
||||
$sql = '';
|
||||
|
||||
$return_array = array();
|
||||
|
||||
switch ($dbms)
|
||||
@@ -1938,22 +1937,26 @@ function prepare_column_data($dbms, $column_data, $table_name, $column_name)
|
||||
|
||||
case 'mssql':
|
||||
$sql .= " {$column_type} ";
|
||||
$sql_default = " {$column_type} ";
|
||||
|
||||
// we do not support MSSQL DEFAULTs for the near future
|
||||
/*if (!is_null($column_data[1]))
|
||||
// For adding columns we need the default definition
|
||||
if (!is_null($column_data[1]))
|
||||
{
|
||||
// For hexadecimal values do not use single quotes
|
||||
if (strpos($column_data[1], '0x') === 0)
|
||||
{
|
||||
$sql .= 'DEFAULT (' . $column_data[1] . ') ';
|
||||
$sql_default .= 'DEFAULT (' . $column_data[1] . ') ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql .= 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
|
||||
$sql_default .= 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
$sql .= 'NOT NULL';
|
||||
$sql_default .= 'NOT NULL';
|
||||
|
||||
$return_array['column_type_sql_default'] = $sql_default;
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
@@ -2059,7 +2062,7 @@ function sql_column_add($dbms, $table_name, $column_name, $column_data)
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
$sql = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql'];
|
||||
$sql = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default'];
|
||||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user