Skip to content

Commit

Permalink
Fixed a serious bug in table_column() that modified column not having…
Browse files Browse the repository at this point in the history
… NOT NULL for postgres (merged from 15_STABLE)
  • Loading branch information
patrickslee committed Aug 11, 2005
1 parent 2a37498 commit 7c56e42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/datalib.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function table_column($table, $oldfield, $field, $type='integer', $size='10',
if ($dbver >= '7.3') {
// modifying 'not null' is posible before 7.3
//update default values to table
if ($null == 'NOT NULL') {
if (strtoupper($null) == 'NOT NULL') {
execute_sql('UPDATE '. $CFG->prefix . $table .' SET '. $field .'='. $default .' WHERE '. $field .' IS NULL');
execute_sql('ALTER TABLE '. $CFG->prefix . $table .' ALTER COLUMN '. $field .' SET '. $null);
} else {
Expand Down

0 comments on commit 7c56e42

Please sign in to comment.