bug #3540922 [edit] Error searching table with many fields

This commit is contained in:
Madhura Jayaratne 2012-08-06 21:44:16 +05:30
parent 2d639ab573
commit 7e0028e4af
3 changed files with 37 additions and 4 deletions

View File

@ -14,6 +14,7 @@ phpMyAdmin - ChangeLog
- bug #3553551 [GUI] Invalid HTML code in multi submits confirmation form
- [interface] Designer sometimes places tables on the top menu
- bug #3546277 [core] Call to undefined function __() when config file has wrong permissions
- bug #3540922 [edit] Error searching table with many fields
3.5.2.1 (2012-08-03)
- [security] Fixed local path disclosure vulnerability, see PMASA-2012-3

View File

@ -53,7 +53,39 @@ $(document).ready(function() {
PMA_prepareForAjaxRequest($search_form);
$.post($search_form.attr('action'), $search_form.serialize(), function(response) {
var values = {};
$search_form.find(':input').each(function() {
var $input = $(this);
if ($input.attr('type') == 'checkbox' || $input.attr('type') == 'radio') {
if ($input.is(':checked')) {
values[this.name] = $input.val();
}
} else {
values[this.name] = $input.val();
}
});
var columnCount = $('select[name="param[]"] option').length;
// Submit values only for the columns that have a search criteria
for (var a = 0; a < columnCount; a++) {
if (values['fields[' + a + ']'] == '') {
delete values['fields[' + a + ']'];
delete values['func[' + a + ']'];
delete values['names[' + a + ']'];
delete values['types[' + a + ']'];
delete values['collations[' + a + ']'];
}
}
// If all columns are selected, use a single parameter to indicate that
if (values['param[]'] != null) {
if (values['param[]'].length == columnCount) {
delete values['param[]'];
values['displayAllColumns'] = true;
}
} else {
values['displayAllColumns'] = true;
}
$.post($search_form.attr('action'), values, function(response) {
PMA_ajaxRemoveMessage($msgbox);
if (typeof response == 'string') {
// found results

View File

@ -33,7 +33,7 @@ $geom_types = PMA_getGISDatatypes();
/**
* Not selection yet required -> displays the selection form
*/
if (! isset($param) || $param[0] == '') {
if ((! isset($param) || $param[0] == '') && ! isset($displayAllColumns)) {
// Gets some core libraries
include_once './libraries/tbl_common.php';
//$err_url = 'tbl_select.php' . $err_url;
@ -117,7 +117,7 @@ echo PMA_generate_html_tabs(PMA_tbl_getSubTabs(), $url_params, '', 'topmenu2');
<th><?php echo htmlspecialchars($fields_list[$i]); ?></th>
<td><?php echo htmlspecialchars($fields_type[$i]); ?></td>
<td><?php echo $fields_collation[$i]; ?></td>
<td><select name="func[]">
<td><select name="func[<?php echo $i; ?>]">
<?php
if (strncasecmp($fields_type[$i], 'enum', 4) == 0) {
foreach ($GLOBALS['cfg']['EnumOperators'] as $fc) {
@ -258,7 +258,7 @@ echo PMA_generate_html_tabs(PMA_tbl_getSubTabs(), $url_params, '', 'topmenu2');
// (more efficient and this helps prevent a problem in IE
// if one of the rows is edited and we come back to the Select results)
if (count($param) == $max_number_of_fields) {
if (! empty($displayAllColumns) || count($param) == $max_number_of_fields) {
$sql_query .= '* ';
} else {
$param = PMA_backquote($param);