diff --git a/ChangeLog b/ChangeLog index a67822c63..f9ab16e5b 100755 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,8 @@ $Source$ this case. * libraries/export/excel.php: Fix MIME type and extension to state before plugins were introduced (patch #1570742, thanks to ssevennm - ssevennm). + * libraries/sqlparser.lib.php: Fix parsing of CHAR column type (bug + #1573502). 2006-10-09 Michal Čihař * lang/german: Fix typo (translation #1570611). diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php index b5e0d07f8..8043b6af0 100644 --- a/libraries/sqlparser.lib.php +++ b/libraries/sqlparser.lib.php @@ -602,8 +602,13 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) { * found here and the token is wrongly marked as alpha_functionName. * But we compensate for this when analysing for timestamp_not_null * later in this script. + * + * Same applies to CHAR vs. CHAR() function. */ $t_suffix = '_functionName'; + /* There are functions which might be as well column types */ + if (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_column_type, $PMA_SQPdata_column_type_cnt)) { + } } elseif (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_column_type, $PMA_SQPdata_column_type_cnt)) { $t_suffix = '_columnType'; @@ -713,7 +718,7 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) { * * @access public */ - function PMA_SQP_analyze($arr) + function PMA_SQP_analyze(&$arr) { if ($arr == array()) { return array(); @@ -1738,9 +1743,13 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) { if ($seen_create_table && $in_create_table_fields && isset($current_identifier)) { $create_table_fields[$current_identifier]['type'] = $upper_data; if ($upper_data == 'TIMESTAMP') { + $arr[$i]['type'] = 'alpha_columnType'; $in_timestamp_options = TRUE; } else { $in_timestamp_options = FALSE; + if ($upper_data == 'CHAR') { + $arr[$i]['type'] = 'alpha_columnType'; + } } } }