backporte some bugfixes from trunk intp QA_2_10:

- bug #1567317 [sqp] Syntax highlighter: extra spaces
- bug #1239401 [sqp] table dot numeric field name
- bug #1672789 [sqp] Undefined offset: 4 in sqlparser.lib.php #1674
- bug #1682044 [export] Export file even if file not selected
- bug #1664212 querywindow loses url encoded characters
+ [config] clean cookies on phpMyAdmin upgrade
- bug #1674972 [export] no export with %afm%
- bug #1667887 HTML maxlength
- bug #1679055 #1050 - Table '<table name>' already exists
This commit is contained in:
Sebastian Mendel
2007-03-20 11:22:31 +00:00
parent 34ad4cdd3b
commit f1378fcbf1
9 changed files with 162 additions and 86 deletions

View File

@@ -39,16 +39,21 @@ if (isset($sql_query)) {
$sql_query .= ' FROM ' . $analyzed_sql[0]['from_clause'];
}
if (isset($primary_key) && is_array($primary_key)) {
$sql_query .= ' WHERE ';
$conj = '';
foreach ($primary_key AS $i => $key) {
$sql_query .= $conj . '( ' . $key . ' ) ';
$conj = 'OR ';
}
} elseif (!empty($analyzed_sql[0]['where_clause'])) {
$sql_query .= ' WHERE ' . $analyzed_sql[0]['where_clause'];
$wheres = array();
if (isset($primary_key) && is_array($primary_key)
&& count($primary_key) > 0) {
$wheres[] = '(' . implode(') OR (',$primary_key) . ')';
}
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'])) {
$sql_query .= ' GROUP BY ' . $analyzed_sql[0]['group_by_clause'];
}