DatabaseInterface->getDefinition() can return false

Related to https://github.com/phpmyadmin/website/issues/81

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2018-10-08 13:26:43 -03:00 committed by Isaac Bennetch
parent 539724df1d
commit 399f25a52e

View File

@ -353,10 +353,12 @@ class Operations
$tmp_query = $GLOBALS['dbi']->getDefinition(
$db, 'PROCEDURE', $procedure_name
);
// collect for later display
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
$GLOBALS['dbi']->selectDb($_REQUEST['newname']);
$GLOBALS['dbi']->query($tmp_query);
if ($tmp_query !== false) {
// collect for later display
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
$GLOBALS['dbi']->selectDb($_REQUEST['newname']);
$GLOBALS['dbi']->query($tmp_query);
}
}
}
@ -367,10 +369,12 @@ class Operations
$tmp_query = $GLOBALS['dbi']->getDefinition(
$db, 'FUNCTION', $function_name
);
// collect for later display
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
$GLOBALS['dbi']->selectDb($_REQUEST['newname']);
$GLOBALS['dbi']->query($tmp_query);
if ($tmp_query !== false) {
// collect for later display
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
$GLOBALS['dbi']->selectDb($_REQUEST['newname']);
$GLOBALS['dbi']->query($tmp_query);
}
}
}
}