If multiple queries are submitted, save the commulative bookmark only once

Fix #12179

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
This commit is contained in:
Deven Bansod 2016-09-23 12:20:53 +05:30
parent 2f0ec14993
commit 54c81312a9

View File

@ -785,6 +785,7 @@ if ($go_sql) {
}
$html_output = '';
foreach ($sql_queries as $sql_query) {
// parse sql query
@ -820,7 +821,7 @@ if ($go_sql) {
$db, // db
$table, // table
null, // find_real_end
$_REQUEST['sql_query'], // sql_query_for_bookmark
null, // sql_query_for_bookmark - see below
null, // extra_data
null, // message_to_show
null, // message
@ -836,6 +837,18 @@ if ($go_sql) {
);
}
// sql_query_for_bookmark is not included in PMA_executeQueryAndGetQueryResponse
// since only one bookmark has to be added for all the queries submitted through
// the SQL tab
if (! empty($_POST['bkm_label']) && ! empty($import_text)) {
$cfgBookmark = PMA_Bookmark_getParams();
PMA_storeTheQueryAsBookmark(
$db, $cfgBookmark['user'],
$_REQUEST['sql_query'], $_POST['bkm_label'],
isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null
);
}
$response = PMA\libraries\Response::getInstance();
$response->addJSON('ajax_reload', $ajax_reload);
$response->addHTML($html_output);