Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No profiling output when the result has no rows #15465

Closed
mvorisek opened this issue Sep 8, 2019 · 7 comments
Closed

No profiling output when the result has no rows #15465

mvorisek opened this issue Sep 8, 2019 · 7 comments
Assignees
Labels
Bug A problem or regression with an existing feature good first issue has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
Milestone

Comments

@mvorisek
Copy link
Contributor

mvorisek commented Sep 8, 2019

When the result has zero rows, the profiling data is not displayed.

More specificaly only the #15209 MySQL deprecation warning is displayed

@williamdes williamdes added the Bug A problem or regression with an existing feature label Sep 8, 2019
@williamdes williamdes added this to Needs triage in issues via automation Sep 8, 2019
@williamdes williamdes moved this from Needs triage to to be fixed soon in issues Sep 8, 2019
@williamdes
Copy link
Member

select null from dual where false;

Source: https://stackoverflow.com/a/38586825/5155484

Reproduced.

@williamdes
Copy link
Member

If someone wants to find a fix, the starting point is:

if ((0 == $num_rows && 0 == $unlim_num_rows)
|| $analyzed_sql_results['is_affected']
) {
$html_output = $this->getQueryResponseForNoResultsReturned(
$analyzed_sql_results, $db, $table,
isset($message_to_show) ? $message_to_show : null,
$num_rows, $displayResultsObject, $extra_data,
$pmaThemeImage, isset($result) ? $result : null,
$sql_query, isset($complete_query) ? $complete_query : null
);
} else {
// At least one row is returned -> displays a table with results
$html_output = $this->getQueryResponseForResultsReturned(
isset($result) ? $result : null,
$analyzed_sql_results,
$db,
$table,
isset($message) ? $message : null,
isset($sql_data) ? $sql_data : null,
$displayResultsObject,
$pmaThemeImage,
$unlim_num_rows,
$num_rows,
isset($disp_query) ? $disp_query : null,
isset($disp_message) ? $disp_message : null,
$profiling_results,
isset($query_type) ? $query_type : null,
isset($selectedTables) ? $selectedTables : null,
$sql_query,
isset($complete_query) ? $complete_query : null
);
}

$profiling_results is sent only if there is one or more rows to display

@anksh1997
Copy link
Contributor

anksh1997 commented Nov 14, 2019

Hie I am not clear about profiling output, what kind of profile output do we want..
I am getting
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0005 seconds.)
is this one?
My bad :) Didn't understand at first .. what was the root

@ShailuJain
Copy link
Contributor

I have solved this issue @williamdes do review my pr #15573

@williamdes
Copy link
Member

@ShailuJain your PR looks okay, I will have to rebase it before merging
But it will be merged if my final test shows that you successfully solved the issue :)

@williamdes williamdes self-assigned this Nov 18, 2019
@williamdes williamdes added the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Nov 18, 2019
@williamdes williamdes added this to the 4.9.2 milestone Nov 18, 2019
@ShailuJain
Copy link
Contributor

Okay, Thanks. I will love to contribute more to phpmyadmin.

williamdes added a commit that referenced this issue Nov 18, 2019
Pull-request: #15573
Ref: #15465

Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from to be fixed soon to Closed Nov 18, 2019
@williamdes
Copy link
Member

@ShailuJain we will be very happy to have your contributions ;) !

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature good first issue has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
issues
  
Closed
Development

No branches or pull requests

4 participants