The branch, master has been updated
via 8e6843061099e68c667c4a53a20b568ef3722690 (commit)
via 76ae26376edca589cf98475d84bfb854e71905e6 (commit)
from ffaee32052bbcb57aa41a2a7a2e34a883447e97f (commit)
- Log -----------------------------------------------------------------
commit 8e6843061099e68c667c4a53a20b568ef3722690
Author: Michal Čihař <mcihar(a)novell.com>
Date: Mon Apr 12 09:55:58 2010 +0200
[edit] CURRENT_TIMESTAMP is also valid for datetime fields.
commit 76ae26376edca589cf98475d84bfb854e71905e6
Author: Michal Čihař <mcihar(a)novell.com>
Date: Mon Apr 12 09:55:11 2010 +0200
Fix folding expression.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 3 ++-
libraries/tbl_replace_fields.inc.php | 4 ++--
tbl_change.php | 21 +++++++++++++--------
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 978695d..b2f9da9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -65,6 +65,7 @@ $Id$
to sutharshan.
+ patch #2984337 [interface] Convert loading of export/import to jQuery ready
event, thanks to sutharshan.
+- [edit] CURRENT_TIMESTAMP is also valid for datetime fields.
3.3.3.0 (not yet released)
- patch #2982480 [navi] Do not group if there would be one table in group,
@@ -193,5 +194,5 @@ $Id$
# vim: et ts=4 sw=4 sts=4
# vim: ft=changelog fenc=utf-8 encoding=utf-8
-# vim:
fde=getline(v\:lnum-1)=~'^\\s*$'&&getline(v\:lnum)=~'\\S'?'>1'\:1&&v\:lnum>8&&getline(v\:lnum)!~'^#'
+# vim:
fde=getline(v\:lnum-1)=~'^\\s*$'&&getline(v\:lnum)=~'\\S'?'>1'\:1&&v\:lnum>6&&getline(v\:lnum)!~'^#'
# vim: fdn=1 fdm=expr
diff --git a/libraries/tbl_replace_fields.inc.php b/libraries/tbl_replace_fields.inc.php
index 2d5b8e7..dd24882 100644
--- a/libraries/tbl_replace_fields.inc.php
+++ b/libraries/tbl_replace_fields.inc.php
@@ -113,8 +113,8 @@ if (false !== $possibly_uploaded_val) {
} elseif ($type == 'bit') {
$val = preg_replace('/[^01]/', '0', $val);
$val = "b'" . PMA_sqlAddslashes($val) . "'";
- } elseif (! ($type == 'timestamp' && $val ==
'CURRENT_TIMESTAMP')) {
- $val = "'" . PMA_sqlAddslashes($val) . "'";
+ } elseif (! (($type == 'datetime' || $type == 'timestamp') &&
$val == 'CURRENT_TIMESTAMP')) {
+ $val = "'" . PMA_sqlAddslashes($val) . "' /*" . $type
. " */";
}
// Was the Null checkbox checked for this field?
diff --git a/tbl_change.php b/tbl_change.php
index 835ccf6..631b8f6 100644
--- a/tbl_change.php
+++ b/tbl_change.php
@@ -183,7 +183,7 @@ if (isset($where_clause)) {
} else { // end if (no row returned)
$meta = PMA_DBI_get_fields_meta($result[$key_id]);
list($unique_condition, $tmp_clause_is_unique) =
PMA_getUniqueCondition($result[$key_id], count($meta), $meta, $rows[$key_id], true);
- if (! empty($unique_condition)) {
+ if (! empty($unique_condition)) {
$found_unique_key = true;
}
unset($unique_condition, $tmp_clause_is_unique);
@@ -304,7 +304,7 @@ foreach ($rows as $row_id => $vrow) {
<thead>
<tr>
<th><?php echo $strField; ?></th>
-
+
<?php
if ($cfg['ShowFieldTypesInDataEditView']) {
$this_url_params = array_merge($url_params,
@@ -345,8 +345,8 @@ foreach ($rows as $row_id => $vrow) {
// d a t e t i m e
//
// Current date should not be set as default if the field is NULL
- // for the current row, but do not put here the current datetime
- // if there is a default value (the real default value will be set
+ // for the current row, 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,
@@ -439,7 +439,7 @@ foreach ($rows as $row_id => $vrow) {
<td align="center"<?php echo $field['wrap'];
?>>
<?php echo $field['pma_type']; ?>
</td>
-
+
<?php } //End if
// Prepares the field value
@@ -562,12 +562,12 @@ foreach ($rows as $row_id => $vrow) {
) {
$default_function =
$cfg['DefaultFunctions']['pk_char36'];
}
-
+
// this is set only when appropriate and is always true
if (isset($field['display_binary_as_hex'])) {
$default_function = 'UNHEX';
}
-
+
// loop on the dropdown array and print all available options for that
field.
foreach ($dropdown as $each_dropdown){
echo '<option';
@@ -639,7 +639,7 @@ foreach ($rows as $row_id => $vrow) {
// foreign key in a drop-down
$onclick .= '4, ';
} elseif ($foreigners && isset($foreigners[$field['Field']])
&& $foreignData['foreign_link'] == true) {
- // foreign key with a browsing icon
+ // foreign key with a browsing icon
$onclick .= '6, ';
} else {
$onclick .= '5, ';
@@ -1069,6 +1069,11 @@ foreach ($rows as $row_id => $vrow) {
<input type="hidden" name="fields_type<?php echo
$field_name_appendix; ?>" value="timestamp" />
<?php
}
+ if (substr($field['pma_type'], 0, 8) == 'datetime') {
+ ?>
+ <input type="hidden" name="fields_type<?php echo
$field_name_appendix; ?>" value="datetime" />
+ <?php
+ }
if ($field['True_Type'] == 'bit') {
?>
<input type="hidden" name="fields_type<?php echo
$field_name_appendix; ?>" value="bit" />
hooks/post-receive
--
phpMyAdmin
Show replies by date