diff options
author | Christian Foellmann <foellmann@foe-services.de> | 2014-07-28 14:13:10 +0400 |
---|---|---|
committer | Christian Foellmann <foellmann@foe-services.de> | 2014-07-28 14:13:10 +0400 |
commit | 276394119dfbe117acd411a3862de597ba35a2ad (patch) | |
tree | 3dc394a15f459d6324e3452e15e9446e47fe3bd0 /libraries/create_addfield.lib.php | |
parent | c8c2e72886de1b71f5abcaa295075da9666096b5 (diff) |
UPDATE phpmyadmin 4.2.6 multilanguage
Diffstat (limited to 'libraries/create_addfield.lib.php')
-rw-r--r-- | libraries/create_addfield.lib.php | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/libraries/create_addfield.lib.php b/libraries/create_addfield.lib.php index 1323b7ae81..aed0251073 100644 --- a/libraries/create_addfield.lib.php +++ b/libraries/create_addfield.lib.php @@ -117,24 +117,29 @@ function PMA_setColumnCreationStatementSuffix($current_field_num, ) { // no suffix is needed if request is a table creation $sql_suffix = " "; - if (! $is_create_tbl) { - if ($_REQUEST['field_where'] != 'last') { - // Only the first field can be added somewhere other than at the end - if ($current_field_num == 0) { - if ($_REQUEST['field_where'] == 'first') { - $sql_suffix .= ' FIRST'; - } else { - $sql_suffix .= ' AFTER ' - . PMA_Util::backquote($_REQUEST['after_field']); - } - } else { - $sql_suffix .= ' AFTER ' - . PMA_Util::backquote( - $_REQUEST['field_name'][$current_field_num - 1] - ); - } + if ($is_create_tbl) { + return $sql_suffix; + } + + if ($_REQUEST['field_where'] == 'last') { + return $sql_suffix; + } + + // Only the first field can be added somewhere other than at the end + if ($current_field_num == 0) { + if ($_REQUEST['field_where'] == 'first') { + $sql_suffix .= ' FIRST'; + } else { + $sql_suffix .= ' AFTER ' + . PMA_Util::backquote($_REQUEST['after_field']); } + } else { + $sql_suffix .= ' AFTER ' + . PMA_Util::backquote( + $_REQUEST['field_name'][$current_field_num - 1] + ); } + return $sql_suffix; } @@ -153,15 +158,17 @@ function PMA_buildIndexStatements($indexed_fields, $index_type, $is_create_tbl = true ) { $statement = array(); - if (count($indexed_fields)) { - $fields = array(); - foreach ($indexed_fields as $field_nr) { - $fields[] = PMA_Util::backquote($_REQUEST['field_name'][$field_nr]); - } - $statement[] = PMA_getStatementPrefix($is_create_tbl) - .' '.$index_type.' (' . implode(', ', $fields) . ') '; - unset($fields); + if (!count($indexed_fields)) { + return $statement; + } + + $fields = array(); + foreach ($indexed_fields as $field_nr) { + $fields[] = PMA_Util::backquote($_REQUEST['field_name'][$field_nr]); } + $statement[] = PMA_getStatementPrefix($is_create_tbl) + . ' ' . $index_type . ' (' . implode(', ', $fields) . ') '; + unset($fields); return $statement; } @@ -315,7 +322,8 @@ function PMA_tryColumnCreationQuery($db, $table, $err_url) $GLOBALS['dbi']->selectDb($db) or PMA_Util::mysqlDie( $GLOBALS['dbi']->getError(), - 'USE ' . PMA_Util::backquote($db), '', + 'USE ' . PMA_Util::backquote($db), + false, $err_url ); $sql_query = 'ALTER TABLE ' . |