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:
authorChristian Foellmann <foellmann@foe-services.de>2014-07-28 14:13:10 +0400
committerChristian Foellmann <foellmann@foe-services.de>2014-07-28 14:13:10 +0400
commit276394119dfbe117acd411a3862de597ba35a2ad (patch)
tree3dc394a15f459d6324e3452e15e9446e47fe3bd0 /libraries/create_addfield.lib.php
parentc8c2e72886de1b71f5abcaa295075da9666096b5 (diff)
UPDATE phpmyadmin 4.2.6 multilanguage
Diffstat (limited to 'libraries/create_addfield.lib.php')
-rw-r--r--libraries/create_addfield.lib.php58
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 ' .