From 6f2bd8c5437b2833427504e8cc3832e6b3e33dfd Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 27 Jul 2004 11:39:40 +0000 Subject: [PATCH] bug 981343 CURRENT_TIMESTAMP --- ChangeLog | 4 ++++ libraries/sqlparser.data.php | 3 ++- libraries/sqlparser.lib.php | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b829fa430..e7a3c6e11 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-07-27 Marc Delisle + * libraries/sqlparser.lib.php /sqlparser.data.php: bug 981343, + cannot copy a table with a timestamp (MySQL 4.1.2) + 2004-07-25 Marc Delisle * main.php, libraries/common.lib.php: bug 997682: illegal mix of collations diff --git a/libraries/sqlparser.data.php b/libraries/sqlparser.data.php index 5bb97d1dd..27d315852 100644 --- a/libraries/sqlparser.data.php +++ b/libraries/sqlparser.data.php @@ -232,6 +232,7 @@ $PMA_SQPdata_reserved_word = array ( 'CONSTRAINT', 'CREATE', 'CROSS', + 'CURRENT_TIMESTAMP', 'DATA', 'DATABASE', 'DATABASES', @@ -455,7 +456,7 @@ $PMA_SQPdata_reserved_word = array ( 'YEAR_MONTH' ); //$PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word); -$PMA_SQPdata_reserved_word_cnt = 260; +$PMA_SQPdata_reserved_word_cnt = 261; $PMA_SQPdata_column_type = array ( 'BIGINT', diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php index 274588a7f..f445523e2 100644 --- a/libraries/sqlparser.lib.php +++ b/libraries/sqlparser.lib.php @@ -1461,8 +1461,14 @@ if ($is_minimum_common == FALSE) { if ($arr[$i+3]['type'] == 'alpha_reservedWord') { $value = $third_upper_data . '_' . strtoupper($arr[$i+3]['data']); } + } else { + // for example: ON UPDATE CURRENT_TIMESTAMP + // which is not for a foreign key + $value = ''; + } + if (!empty($value)) { + $foreign[$foreign_key_number][$clause] = $value; } - $foreign[$foreign_key_number][$clause] = $value; } } }