Skip to content

Commit

Permalink
Install: pgsql bool check now handles nullable columns
Browse files Browse the repository at this point in the history
Issue #16392
  • Loading branch information
dregad committed Mar 24, 2014
1 parent e2e0a9d commit ddba1d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions admin/install.php
Expand Up @@ -868,11 +868,12 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
# Convert the columns
foreach( $ret as $row ) {
extract( $row );
$t_null = $is_nullable ? 'NULL' : 'NOT NULL';
$t_default = is_null( $column_default ) ? 'NULL' : $column_default;
$sqlarray = $dict->AlterColumnSQL(
$table_name,
"$column_name L NOTNULL DEFAULT '$column_default'"
"$column_name L $t_null DEFAULT $t_default"
);

print_test(
"Converting column $table_name.$column_name to BOOLEAN",
2 == $dict->ExecuteSQLArray( $sqlarray, false ),
Expand Down
2 changes: 1 addition & 1 deletion core/install_helper_functions_api.php
Expand Up @@ -122,7 +122,7 @@ function check_pgsql_bool_columns() {
. implode($t_columns, "', '")
. "' ) OR\n";
}
$sql = "SELECT table_name, column_name, data_type, column_default
$sql = "SELECT table_name, column_name, data_type, column_default, is_nullable
FROM information_schema.columns
WHERE
table_catalog = '$f_database_name' AND
Expand Down

0 comments on commit ddba1d9

Please sign in to comment.