Do not fail on non analyzed query (eg. because of parser failure).

This commit is contained in:
Michal Čihař
2010-08-30 16:11:46 +02:00
parent 61fe92976f
commit 1d67babd52
2 changed files with 6 additions and 3 deletions

View File

@@ -1039,6 +1039,9 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
} else {
// Parse SQL if needed
$parsed_sql = PMA_SQP_parse($query_base);
if (PMA_SQP_isError()) {
unset($parsed_sql);
}
}
// Analyze it
@@ -1242,8 +1245,8 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
}
echo '</div><br />' . "\n";
// If we are in an Ajax request, we have most probably been called in
// PMA_ajaxResponse(). Hence, collect the buffer contents and return it
// If we are in an Ajax request, we have most probably been called in
// PMA_ajaxResponse(). Hence, collect the buffer contents and return it
// to PMA_ajaxResponse(), which will encode it for JSON.
if( $GLOBALS['is_ajax_request'] == true && !isset($GLOBALS['buffer_message']) ) {
$buffer_contents = ob_get_contents();

View File

@@ -2090,7 +2090,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
'submit_mult_change', __('Change'), 'b_edit.png');
PMA_buttonOrImage('submit_mult', 'mult_submit',
'submit_mult_delete', $delete_text, 'b_drop.png');
if ($analyzed_sql[0]['querytype'] == 'SELECT') {
if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == 'SELECT') {
PMA_buttonOrImage('submit_mult', 'mult_submit',
'submit_mult_export', __('Export'),
'b_tblexport.png');