Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Delisle <marc@infomarc.info>2005-04-01 21:08:04 +0400
committerMarc Delisle <marc@infomarc.info>2005-04-01 21:08:04 +0400
commit5dc8c5152c951bea943428fad40ea58d076c6e11 (patch)
tree0c33f5ae3c804c61ef8b7b06e0c237adcaf2bcf3
parent0cddbb2cd42e38c0b28cb2757f3fa4b2ab332455 (diff)
TIMESTAMP options and addfield
-rwxr-xr-xChangeLog7
-rw-r--r--tbl_addfield.php12
2 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f14c924058..bb63185c74 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$
$Source$
+2005-04-01 Marc Delisle <lem9@users.sourceforge.net>
+ * tbl_addfield.php: TIMESTAMP options support
+
2005-03-31 Alexander M. Turek <me@derrabus.de>
* left.php: Undefined offset (Bug #1174045).
@@ -15,7 +18,6 @@ $Source$
* tbl_properties.inc.php: TIMESTAMP default CURRENT_TIMESTAMP checkbox
made dynamic, depending on the field's type
* tbl_create.php, libraries/relation.lib.php: TIMESTAMP options support
- TODO: (work in progress) support those options in tbl_addfield
2005-03-30 Alexander M. Turek <me@derrabus.de>
* server_databases.php: Bug #1172782 (Don't allow to drop
@@ -31,8 +33,7 @@ $Source$
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.
+ was shown without the new options.
2005-03-29 Marc Delisle <lem9@users.sourceforge.net>
* libraries/common.lib.php: XSS vulnerability on convcharset
diff --git a/tbl_addfield.php b/tbl_addfield.php
index 541dd1b9cc..8c25a28318 100644
--- a/tbl_addfield.php
+++ b/tbl_addfield.php
@@ -50,8 +50,13 @@ if (isset($submit_num_fields)) {
} // end if
} // end for
// Builds the field creation statement and alters the table
+
+ // TODO: check to see if this logic is exactly the same
+ // as in tbl_create.php, and move to an include file
+
for ($i = 0; $i < $field_cnt; ++$i) {
- if (empty($field_name[$i])) {
+ // '0' is also empty for php :-(
+ if (empty($field_name[$i]) && $field_name[$i] != '0') {
continue;
}
@@ -67,7 +72,10 @@ if (isset($submit_num_fields)) {
$query .= ' CHARACTER SET ' . $tmp_charset . ' COLLATE ' . $field_collation[$i];
unset($tmp_charset);
}
- if ($field_default[$i] != '') {
+
+ if (isset($field_default_current_timestamp[$i]) && $field_default_current_timestamp[$i]) {
+ $query .= ' DEFAULT CURRENT_TIMESTAMP';
+ } elseif ($field_default[$i] != '') {
if (strtoupper($field_default[$i]) == 'NULL') {
$query .= ' DEFAULT NULL';
} else {