diff --git a/ChangeLog b/ChangeLog index 5e7d0bf06..1e610155b 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,8 @@ $Source$ * libraries/Table.class.php: *NEW* class PMA_Table * tbl_addfield.php, tbl_create.php: use Table.class.php + * libraries/common.lib.php: + moved PMA_generateFieldSpec() into PMA_Table 2006-02-20 Marc Delisle ### 2.8.0-rc1 released diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 77e12337d..8593cf1f8 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2505,75 +2505,6 @@ window.parent.updateTableTitle('', '= 40100 && !empty($collation) - && $collation != 'NULL' - && preg_match('@^(TINYTEXT|TEXT|MEDIUMTEXT|LONGTEXT|VARCHAR|CHAR|ENUM|SET)$@i', $type)) { - $query .= PMA_generateCharsetQueryPart($collation); - } - - if (!($null === false)) { - if (!empty($null)) { - $query .= ' NOT NULL'; - } else { - $query .= ' NULL'; - } - } - - if ($default_current_timestamp && strpos(' ' . strtoupper($type), 'TIMESTAMP') == 1) { - $query .= ' DEFAULT CURRENT_TIMESTAMP'; - // 0 is empty in PHP - // auto_increment field cannot have a default value - } elseif ($extra !== 'AUTO_INCREMENT' && (!empty($default) || $default == '0' || $default != $default_orig)) { - if (strtoupper($default) == 'NULL') { - $query .= ' DEFAULT NULL'; - } else { - $query .= ' DEFAULT \'' . PMA_sqlAddslashes($default) . '\''; - } - } - - if (!empty($extra)) { - $query .= ' ' . $extra; - // An auto_increment field must be use as a primary key - if ($extra == 'AUTO_INCREMENT' && isset($field_primary)) { - $primary_cnt = count($field_primary); - for ($j = 0; $j < $primary_cnt && $field_primary[$j] != $index; $j++) { - // void - } // end for - if (isset($field_primary[$j]) && $field_primary[$j] == $index) { - $query .= ' PRIMARY KEY'; - unset($field_primary[$j]); - } // end if - } // end if (auto_increment) - } - if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($comment)) { - $query .= " COMMENT '" . PMA_sqlAddslashes($comment) . "'"; - } - return $query; - } // end function - /** * @TODO add documentation */