Permalink
Browse files

Fixed a serious bug in table_column() that modified column not having…

… NOT NULL for postgres
  • Loading branch information...
1 parent 4fd1373 commit 83847ae5b171a2d9ef63c2c482d0d017dc675899 patrickslee committed Aug 11, 2005
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/datalib.php
View
@@ -303,7 +303,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 {

0 comments on commit 83847ae

Please sign in to comment.