This commit is contained in:
Marc Delisle 2005-03-30 21:27:06 +00:00
parent ae6d93e77c
commit 845061368e
2 changed files with 13 additions and 5 deletions

View File

@ -15,6 +15,10 @@ $Source$
* lang/english: improvements, thanks to Ryan Schmidt - ryandesign
* lang/*: removed unused message and modified strCheckOverhead
where still untranslated
* tbl_properties.inc.php: bug #1163595 (problem #5): after an error
modifying TIMESTAMP options, the table structure editing form
was shown without the new options. Still having an issue with
a default value for a TIMESTAMP not generated in the ALTER TABLE.
2005-03-29 Marc Delisle <lem9@users.sourceforge.net>
* libraries/common.lib.php: XSS vulnerability on convcharset

View File

@ -175,7 +175,9 @@ for ($i = 0 ; $i < $num_fields; $i++) {
$submit_length = (isset($field_length) && isset($field_length[$i]) ? $field_length[$i] : FALSE);
$submit_attribute = (isset($field_attribute) && isset($field_attribute[$i]) ? $field_attribute[$i] : FALSE);
$submit_default_current_timestamp = (isset($field_default_current_timestamp) && isset($field_default_current_timestamp[$i]) ? TRUE : FALSE);
if (isset($field_comments) && isset($field_comments[$i])) {
$comments_map[$row['Field']] = $field_comments[$i];
}
@ -257,11 +259,12 @@ for ($i = 0 ; $i < $num_fields; $i++) {
// rtrim the type, for cases like "float unsigned"
$type = rtrim($type);
$type_upper = strtoupper($type);
$cnt_column_types = count($cfg['ColumnTypes']);
for ($j = 0; $j < $cnt_column_types; $j++) {
$content_cells[$i][$ci] .= ' <option value="'. $cfg['ColumnTypes'][$j] . '"';
if (strtoupper($type) == strtoupper($cfg['ColumnTypes'][$j])) {
if ($type_upper == strtoupper($cfg['ColumnTypes'][$j])) {
$content_cells[$i][$ci] .= ' selected="selected"';
}
$content_cells[$i][$ci] .= '>' . $cfg['ColumnTypes'][$j] . '</option>' . "\n";
@ -322,7 +325,8 @@ for ($i = 0 ; $i < $num_fields; $i++) {
if (isset($row['Field']) && isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['on_update_current_timestamp'])) {
$attribute = 'ON UPDATE CURRENT_TIMESTAMP';
}
if (isset($row['Field']) && isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['default_current_timestamp'])) {
if ((isset($row['Field']) && isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['default_current_timestamp']))
|| $submit_default_current_timestamp ) {
$default_current_timestamp = TRUE;
} else {
$default_current_timestamp = FALSE;
@ -377,7 +381,7 @@ for ($i = 0 ; $i < $num_fields; $i++) {
// for a TIMESTAMP, do not show CURRENT_TIMESTAMP as a default value
if (PMA_MYSQL_INT_VERSION >= 40102
&& $type == 'timestamp'
&& $type_upper == 'TIMESTAMP'
&& $default_current_timestamp
&& isset($row)
&& isset($row['Default'])) {
@ -385,7 +389,7 @@ for ($i = 0 ; $i < $num_fields; $i++) {
}
$content_cells[$i][$ci] .= '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_default[]" size="12" value="' . (isset($row) && isset($row['Default']) ? str_replace('"', '&quot;', $row['Default']) : '') . '" class="textfield" />';
if (PMA_MYSQL_INT_VERSION >= 40102 && $type == 'timestamp') {
if (PMA_MYSQL_INT_VERSION >= 40102 && $type_upper == 'TIMESTAMP') {
$content_cells[$i][$ci] .= '<br /><input id="field_' . $i . '_' . ($ci - $ci_offset) . 'a" type="checkbox" name="field_default_current_timestamp[' . $i . ']"';
if ($default_current_timestamp) {
$content_cells[$i][$ci] .= ' checked="checked" ';