bug #1674972 no export with %afm%

This commit is contained in:
Sebastian Mendel
2007-03-15 17:15:59 +00:00
parent cf6de45646
commit d4164091ff
3 changed files with 23 additions and 17 deletions

View File

@@ -15,6 +15,7 @@ $HeadURL$
- bug #1666657 Cookie password delete on timeout / inactivity - bug #1666657 Cookie password delete on timeout / inactivity
- bug #1648802 different mysql library and server version - bug #1648802 different mysql library and server version
- bug #1239401 table dot numeric field name - bug #1239401 table dot numeric field name
- bug #1674972 no export with %afm%
- [gui] avoid displaying a wide selector in server selection - [gui] avoid displaying a wide selector in server selection
+ [core] added PMA_fatalError() and made use of it + [core] added PMA_fatalError() and made use of it
. [i18n] use generic $strOptions . [i18n] use generic $strOptions

View File

@@ -39,16 +39,21 @@ if (isset($sql_query)) {
$sql_query .= ' FROM ' . $analyzed_sql[0]['from_clause']; $sql_query .= ' FROM ' . $analyzed_sql[0]['from_clause'];
} }
if (isset($primary_key) && is_array($primary_key)) { $wheres = array();
$sql_query .= ' WHERE ';
$conj = ''; if (isset($primary_key) && is_array($primary_key)
foreach ($primary_key AS $i => $key) { && count($primary_key) > 0) {
$sql_query .= $conj . '( ' . $key . ' ) '; $wheres[] = '(' . implode(') OR (',$primary_key) . ')';
$conj = 'OR ';
}
} elseif (!empty($analyzed_sql[0]['where_clause'])) {
$sql_query .= ' WHERE ' . $analyzed_sql[0]['where_clause'];
} }
if (!empty($analyzed_sql[0]['where_clause'])) {
$wheres[] = $analyzed_sql[0]['where_clause'];
}
if (count($wheres) > 0 ) {
$sql_query .= ' WHERE (' . implode(') AND (', $wheres) . ')';
}
if (!empty($analyzed_sql[0]['group_by_clause'])) { if (!empty($analyzed_sql[0]['group_by_clause'])) {
$sql_query .= ' GROUP BY ' . $analyzed_sql[0]['group_by_clause']; $sql_query .= ' GROUP BY ' . $analyzed_sql[0]['group_by_clause'];
} }
@@ -72,20 +77,20 @@ if (isset($sql_query)) {
} }
if (!$inside_bracket && $parsed_sql[$i]['type'] == 'alpha_reservedWord' && strtoupper($parsed_sql[$i]['data']) == 'LIMIT') { if (!$inside_bracket && $parsed_sql[$i]['type'] == 'alpha_reservedWord' && strtoupper($parsed_sql[$i]['data']) == 'LIMIT') {
// We found LIMIT to remove // We found LIMIT to remove
$sql_query = ''; $sql_query = '';
// Concatenate parts before // Concatenate parts before
for ($j = 0; $j < $i; $j++) { for ($j = 0; $j < $i; $j++) {
$sql_query .= $parsed_sql[$j]['data'] . ' '; $sql_query .= $parsed_sql[$j]['data'] . ' ';
} }
// Skip LIMIT // Skip LIMIT
$i++; $i++;
while ($i < $parsed_sql['len'] && while ($i < $parsed_sql['len'] &&
($parsed_sql[$i]['type'] != 'alpha_reservedWord' || ($parsed_sql[$i]['type'] != 'alpha_reservedWord' ||
($parsed_sql[$i]['type'] == 'alpha_reservedWord' && $parsed_sql[$i]['data'] == 'OFFSET'))) { ($parsed_sql[$i]['type'] == 'alpha_reservedWord' && $parsed_sql[$i]['data'] == 'OFFSET'))) {
$i++; $i++;
} }
// Add remaining parts // Add remaining parts

View File

@@ -81,7 +81,7 @@ if (!empty($submit_mult)) {
foreach ($rows_to_delete AS $i_primary_key => $del_query) { foreach ($rows_to_delete AS $i_primary_key => $del_query) {
$primary_key[] = urldecode($i_primary_key); $primary_key[] = urldecode($i_primary_key);
} }
$active_page = 'tbl_change.php'; $active_page = 'tbl_change.php';
include './tbl_change.php'; include './tbl_change.php';
break; break;
@@ -91,7 +91,7 @@ if (!empty($submit_mult)) {
$single_table = TRUE; $single_table = TRUE;
$primary_key = array(); $primary_key = array();
$sql_query = urldecode($sql_query); //$sql_query = urldecode($sql_query);
// garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the // garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the
// indicating primary key. Then we built the array which is used for the tbl_change.php script. // indicating primary key. Then we built the array which is used for the tbl_change.php script.
foreach ($rows_to_delete AS $i_primary_key => $del_query) { foreach ($rows_to_delete AS $i_primary_key => $del_query) {