diff --git a/ChangeLog b/ChangeLog index 90b57873f..cfaef239d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-07-15 Marc Delisle + * tbl_change.php: bug 990959, undefined index for DATETIME + field (problem in UTF-8 only!) + 2004-07-14 Marc Delisle * index.php, libraries/common.lib.php: bug 989581 and left panel display problems when switching themes diff --git a/tbl_change.php b/tbl_change.php index 0177993ce..bd9e11e13 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -1,7 +1,7 @@ $vrow) { // lem9: but do not put here the current datetime if there is a default // value (the real default value will be set in the // Default value logic below) + + // Note: (tested in MySQL 4.0.16): when lang is some UTF-8, + // $row_table_def['Default'] is not set if it contains NULL: + // Array ( [Field] => d [Type] => datetime [Null] => YES [Key] => [Extra] => [True_Type] => datetime ) + // but, look what we get if we switch to iso: (Default is NULL) + // Array ( [Field] => d [Type] => datetime [Null] => YES [Key] => [Default] => [Extra] => [True_Type] => datetime ) + // so I force a NULL into it (I don't think it's possible + // to have an empty default value for DATETIME) + // then, the "if" after this one will work + if ($row_table_def['Type'] == 'datetime' + && !isset($row_table_def['Default']) + && isset($row_table_def['Null']) + && $row_table_def['Null'] == 'YES') { + $row_table_def['Default'] = NULL; + } + if ($row_table_def['Type'] == 'datetime' && (!isset($row_table_def['Default'])) && (!is_null($row_table_def['Default']))) { @@ -387,7 +403,6 @@ foreach ($loop_array AS $vrowcount => $vrow) { $row_table_def['Default'] = ''; $real_null_value = TRUE; $data = ''; - //$data = 'NULL'; } else { $data = $row_table_def['Default']; } @@ -485,7 +500,6 @@ foreach ($loop_array AS $vrowcount => $vrow) { && $row_table_def['Null'] == 'YES') { echo '