Translated using Weblate (Slovenian)
[phpmyadmin.git] / import.php
blob42d967dd906d0d28e6cd9b2ef0e94b4b29f0ff53
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Core script for import, this is just the glue around all other stuff
6 * @package PhpMyAdmin
7 */
8 use PMA\libraries\Response;
9 use PMA\libraries\Encoding;
10 use PMA\libraries\plugins\ImportPlugin;
11 use PMA\libraries\File;
12 use PMA\libraries\URL;
13 use PMA\libraries\Bookmark;
15 /* Enable LOAD DATA LOCAL INFILE for LDI plugin */
16 if (isset($_POST['format']) && $_POST['format'] == 'ldi') {
17 define('PMA_ENABLE_LDI', 1);
20 /**
21 * Get the variables sent or posted to this script and a core script
23 require_once 'libraries/common.inc.php';
24 require_once 'libraries/sql.lib.php';
25 //require_once 'libraries/display_import_functions.lib.php';
27 if (isset($_REQUEST['show_as_php'])) {
28 $GLOBALS['show_as_php'] = $_REQUEST['show_as_php'];
31 // Import functions.
32 require_once 'libraries/import.lib.php';
34 // If there is a request to 'Simulate DML'.
35 if (isset($_REQUEST['simulate_dml'])) {
36 PMA_handleSimulateDMLRequest();
37 exit;
40 $response = Response::getInstance();
42 // If it's a refresh console bookmarks request
43 if (isset($_REQUEST['console_bookmark_refresh'])) {
44 $response->addJSON(
45 'console_message_bookmark', PMA\libraries\Console::getBookmarkContent()
47 exit;
49 // If it's a console bookmark add request
50 if (isset($_REQUEST['console_bookmark_add'])) {
51 if (isset($_REQUEST['label']) && isset($_REQUEST['db'])
52 && isset($_REQUEST['bookmark_query']) && isset($_REQUEST['shared'])
53 ) {
54 $cfgBookmark = Bookmark::getParams();
55 $bookmarkFields = array(
56 'bkm_database' => $_REQUEST['db'],
57 'bkm_user' => $cfgBookmark['user'],
58 'bkm_sql_query' => $_REQUEST['bookmark_query'],
59 'bkm_label' => $_REQUEST['label']
61 $isShared = ($_REQUEST['shared'] == 'true' ? true : false);
62 $bookmark = Bookmark::createBookmark($bookmarkFields, $isShared);
63 if ($bookmark !== false && $bookmark->save()) {
64 $response->addJSON('message', __('Succeeded'));
65 $response->addJSON('data', $bookmarkFields);
66 $response->addJSON('isShared', $isShared);
67 } else {
68 $response->addJSON('message', __('Failed'));
70 die();
71 } else {
72 $response->addJSON('message', __('Incomplete params'));
73 die();
77 $format = '';
79 /**
80 * Sets globals from $_POST
82 $post_params = array(
83 'charset_of_file',
84 'format',
85 'import_type',
86 'is_js_confirmed',
87 'MAX_FILE_SIZE',
88 'message_to_show',
89 'noplugin',
90 'skip_queries',
91 'local_import_file'
94 foreach ($post_params as $one_post_param) {
95 if (isset($_POST[$one_post_param])) {
96 $GLOBALS[$one_post_param] = $_POST[$one_post_param];
100 // reset import messages for ajax request
101 $_SESSION['Import_message']['message'] = null;
102 $_SESSION['Import_message']['go_back_url'] = null;
103 // default values
104 $GLOBALS['reload'] = false;
106 // Use to identify current cycle is executing
107 // a multiquery statement or stored routine
108 if (!isset($_SESSION['is_multi_query'])) {
109 $_SESSION['is_multi_query'] = false;
112 $ajax_reload = array();
113 // Are we just executing plain query or sql file?
114 // (eg. non import, but query box/window run)
115 if (! empty($sql_query)) {
117 // apply values for parameters
118 if (! empty($_REQUEST['parameterized'])
119 && ! empty($_REQUEST['parameters'])
120 && is_array($_REQUEST['parameters'])
122 $parameters = $_REQUEST['parameters'];
123 foreach ($parameters as $parameter => $replacement) {
124 $quoted = preg_quote($parameter, '/');
125 // making sure that :param does not apply values to :param1
126 $sql_query = preg_replace(
127 '/' . $quoted . '([^a-zA-Z0-9_])/',
128 $GLOBALS['dbi']->escapeString($replacement) . '${1}',
129 $sql_query
131 // for parameters the appear at the end of the string
132 $sql_query = preg_replace(
133 '/' . $quoted . '$/',
134 $GLOBALS['dbi']->escapeString($replacement),
135 $sql_query
140 // run SQL query
141 $import_text = $sql_query;
142 $import_type = 'query';
143 $format = 'sql';
144 $_SESSION['sql_from_query_box'] = true;
146 // If there is a request to ROLLBACK when finished.
147 if (isset($_REQUEST['rollback_query'])) {
148 PMA_handleRollbackRequest($import_text);
151 // refresh navigation and main panels
152 if (preg_match('/^(DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $sql_query)) {
153 $GLOBALS['reload'] = true;
154 $ajax_reload['reload'] = true;
157 // refresh navigation panel only
158 if (preg_match(
159 '/^(CREATE|ALTER)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i',
160 $sql_query
161 )) {
162 $ajax_reload['reload'] = true;
165 // do a dynamic reload if table is RENAMED
166 // (by sending the instruction to the AJAX response handler)
167 if (preg_match(
168 '/^RENAME\s+TABLE\s+(.*?)\s+TO\s+(.*?)($|;|\s)/i',
169 $sql_query,
170 $rename_table_names
171 )) {
172 $ajax_reload['reload'] = true;
173 $ajax_reload['table_name'] = PMA\libraries\Util::unQuote(
174 $rename_table_names[2]
178 $sql_query = '';
179 } elseif (! empty($sql_file)) {
180 // run uploaded SQL file
181 $import_file = $sql_file;
182 $import_type = 'queryfile';
183 $format = 'sql';
184 unset($sql_file);
185 } elseif (! empty($_REQUEST['id_bookmark'])) {
186 // run bookmark
187 $import_type = 'query';
188 $format = 'sql';
191 // If we didn't get any parameters, either user called this directly, or
192 // upload limit has been reached, let's assume the second possibility.
193 if ($_POST == array() && $_GET == array()) {
194 $message = PMA\libraries\Message::error(
196 'You probably tried to upload a file that is too large. Please refer ' .
197 'to %sdocumentation%s for a workaround for this limit.'
200 $message->addParam('[doc@faq1-16]');
201 $message->addParam('[/doc]');
203 // so we can obtain the message
204 $_SESSION['Import_message']['message'] = $message->getDisplay();
205 $_SESSION['Import_message']['go_back_url'] = $GLOBALS['goto'];
207 $response->setRequestStatus(false);
208 $response->addJSON('message', $message);
210 exit; // the footer is displayed automatically
213 // Add console message id to response output
214 if (isset($_POST['console_message_id'])) {
215 $response->addJSON('console_message_id', $_POST['console_message_id']);
219 * Sets globals from $_POST patterns, for import plugins
220 * We only need to load the selected plugin
223 if (! in_array(
224 $format,
225 array(
226 'csv',
227 'ldi',
228 'mediawiki',
229 'ods',
230 'shp',
231 'sql',
232 'xml'
236 // this should not happen for a normal user
237 // but only during an attack
238 PMA_fatalError('Incorrect format parameter');
241 $post_patterns = array(
242 '/^force_file_/',
243 '/^' . $format . '_/'
246 PMA_setPostAsGlobal($post_patterns);
248 // Check needed parameters
249 PMA\libraries\Util::checkParameters(array('import_type', 'format'));
251 // We don't want anything special in format
252 $format = PMA_securePath($format);
254 // Create error and goto url
255 if ($import_type == 'table') {
256 $err_url = 'tbl_import.php' . URL::getCommon(
257 array(
258 'db' => $db, 'table' => $table
261 $_SESSION['Import_message']['go_back_url'] = $err_url;
262 $goto = 'tbl_import.php';
263 } elseif ($import_type == 'database') {
264 $err_url = 'db_import.php' . URL::getCommon(array('db' => $db));
265 $_SESSION['Import_message']['go_back_url'] = $err_url;
266 $goto = 'db_import.php';
267 } elseif ($import_type == 'server') {
268 $err_url = 'server_import.php' . URL::getCommon();
269 $_SESSION['Import_message']['go_back_url'] = $err_url;
270 $goto = 'server_import.php';
271 } else {
272 if (empty($goto) || !preg_match('@^(server|db|tbl)(_[a-z]*)*\.php$@i', $goto)) {
273 if (strlen($table) > 0 && strlen($db) > 0) {
274 $goto = 'tbl_structure.php';
275 } elseif (strlen($db) > 0) {
276 $goto = 'db_structure.php';
277 } else {
278 $goto = 'server_sql.php';
281 if (strlen($table) > 0 && strlen($db) > 0) {
282 $common = URL::getCommon(array('db' => $db, 'table' => $table));
283 } elseif (strlen($db) > 0) {
284 $common = URL::getCommon(array('db' => $db));
285 } else {
286 $common = URL::getCommon();
288 $err_url = $goto . $common
289 . (preg_match('@^tbl_[a-z]*\.php$@', $goto)
290 ? '&amp;table=' . htmlspecialchars($table)
291 : '');
292 $_SESSION['Import_message']['go_back_url'] = $err_url;
294 // Avoid setting selflink to 'import.php'
295 // problem similar to bug 4276
296 if (basename($_SERVER['SCRIPT_NAME']) === 'import.php') {
297 $_SERVER['SCRIPT_NAME'] = $goto;
301 if (strlen($db) > 0) {
302 $GLOBALS['dbi']->selectDb($db);
305 @set_time_limit($cfg['ExecTimeLimit']);
306 if (! empty($cfg['MemoryLimit'])) {
307 @ini_set('memory_limit', $cfg['MemoryLimit']);
310 $timestamp = time();
311 if (isset($_REQUEST['allow_interrupt'])) {
312 $maximum_time = ini_get('max_execution_time');
313 } else {
314 $maximum_time = 0;
317 // set default values
318 $timeout_passed = false;
319 $error = false;
320 $read_multiply = 1;
321 $finished = false;
322 $offset = 0;
323 $max_sql_len = 0;
324 $file_to_unlink = '';
325 $sql_query = '';
326 $sql_query_disabled = false;
327 $go_sql = false;
328 $executed_queries = 0;
329 $run_query = true;
330 $charset_conversion = false;
331 $reset_charset = false;
332 $bookmark_created = false;
334 // Bookmark Support: get a query back from bookmark if required
335 if (! empty($_REQUEST['id_bookmark'])) {
336 $id_bookmark = (int)$_REQUEST['id_bookmark'];
337 switch ($_REQUEST['action_bookmark']) {
338 case 0: // bookmarked query that have to be run
339 $bookmark = Bookmark::get(
340 $db,
341 $id_bookmark,
342 'id',
343 isset($_REQUEST['action_bookmark_all'])
346 if (! empty($_REQUEST['bookmark_variable'])) {
347 $import_text = $bookmark->applyVariables(
348 $_REQUEST['bookmark_variable']
350 } else {
351 $import_text = $bookmark->getQuery();
354 // refresh navigation and main panels
355 if (preg_match(
356 '/^(DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i',
357 $import_text
358 )) {
359 $GLOBALS['reload'] = true;
360 $ajax_reload['reload'] = true;
363 // refresh navigation panel only
364 if (preg_match(
365 '/^(CREATE|ALTER)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i',
366 $import_text
369 $ajax_reload['reload'] = true;
371 break;
372 case 1: // bookmarked query that have to be displayed
373 $bookmark = Bookmark::get($db, $id_bookmark);
374 $import_text = $bookmark->getQuery();
375 if ($response->isAjax()) {
376 $message = PMA\libraries\Message::success(__('Showing bookmark'));
377 $response->setRequestStatus($message->isSuccess());
378 $response->addJSON('message', $message);
379 $response->addJSON('sql_query', $import_text);
380 $response->addJSON('action_bookmark', $_REQUEST['action_bookmark']);
381 exit;
382 } else {
383 $run_query = false;
385 break;
386 case 2: // bookmarked query that have to be deleted
387 $bookmark = Bookmark::get($db, $id_bookmark);
388 if (! empty($bookmark)) {
389 $bookmark->delete();
390 if ($response->isAjax()) {
391 $message = PMA\libraries\Message::success(
392 __('The bookmark has been deleted.')
394 $response->setRequestStatus($message->isSuccess());
395 $response->addJSON('message', $message);
396 $response->addJSON('action_bookmark', $_REQUEST['action_bookmark']);
397 $response->addJSON('id_bookmark', $id_bookmark);
398 exit;
399 } else {
400 $run_query = false;
401 $error = true; // this is kind of hack to skip processing the query
405 break;
407 } // end bookmarks reading
409 // Do no run query if we show PHP code
410 if (isset($GLOBALS['show_as_php'])) {
411 $run_query = false;
412 $go_sql = true;
415 // We can not read all at once, otherwise we can run out of memory
416 $memory_limit = trim(@ini_get('memory_limit'));
417 // 2 MB as default
418 if (empty($memory_limit)) {
419 $memory_limit = 2 * 1024 * 1024;
421 // In case no memory limit we work on 10MB chunks
422 if ($memory_limit == -1) {
423 $memory_limit = 10 * 1024 * 1024;
426 // Calculate value of the limit
427 $memoryUnit = mb_strtolower(substr($memory_limit, -1));
428 if ('m' == $memoryUnit) {
429 $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024;
430 } elseif ('k' == $memoryUnit) {
431 $memory_limit = (int)substr($memory_limit, 0, -1) * 1024;
432 } elseif ('g' == $memoryUnit) {
433 $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024;
434 } else {
435 $memory_limit = (int)$memory_limit;
438 // Just to be sure, there might be lot of memory needed for uncompression
439 $read_limit = $memory_limit / 8;
441 // handle filenames
442 if (isset($_FILES['import_file'])) {
443 $import_file = $_FILES['import_file']['tmp_name'];
445 if (! empty($local_import_file) && ! empty($cfg['UploadDir'])) {
447 // sanitize $local_import_file as it comes from a POST
448 $local_import_file = PMA_securePath($local_import_file);
450 $import_file = PMA\libraries\Util::userDir($cfg['UploadDir'])
451 . $local_import_file;
454 * Do not allow symlinks to avoid security issues
455 * (user can create symlink to file he can not access,
456 * but phpMyAdmin can).
458 if (@is_link($import_file)) {
459 $import_file = 'none';
462 } elseif (empty($import_file) || ! is_uploaded_file($import_file)) {
463 $import_file = 'none';
466 // Do we have file to import?
468 if ($import_file != 'none' && ! $error) {
470 * Handle file compression
472 $import_handle = new File($import_file);
473 $import_handle->checkUploadedFile();
474 if ($import_handle->isError()) {
475 PMA_stopImport($import_handle->getError());
477 $import_handle->setDecompressContent(true);
478 $import_handle->open();
479 if ($import_handle->isError()) {
480 PMA_stopImport($import_handle->getError());
482 } elseif (! $error) {
483 if (! isset($import_text) || empty($import_text)) {
484 $message = PMA\libraries\Message::error(
486 'No data was received to import. Either no file name was ' .
487 'submitted, or the file size exceeded the maximum size permitted ' .
488 'by your PHP configuration. See [doc@faq1-16]FAQ 1.16[/doc].'
491 PMA_stopImport($message);
495 // so we can obtain the message
496 //$_SESSION['Import_message'] = $message->getDisplay();
498 // Convert the file's charset if necessary
499 if (Encoding::isSupported() && isset($charset_of_file)) {
500 if ($charset_of_file != 'utf-8') {
501 $charset_conversion = true;
503 } elseif (isset($charset_of_file) && $charset_of_file != 'utf-8') {
504 $GLOBALS['dbi']->query('SET NAMES \'' . $charset_of_file . '\'');
505 // We can not show query in this case, it is in different charset
506 $sql_query_disabled = true;
507 $reset_charset = true;
510 // Something to skip? (because timeout has passed)
511 if (! $error && isset($_POST['skip'])) {
512 $original_skip = $skip = intval($_POST['skip']);
513 while ($skip > 0 && ! $finished) {
514 PMA_importGetNextChunk($skip < $read_limit ? $skip : $read_limit);
515 // Disable read progressivity, otherwise we eat all memory!
516 $read_multiply = 1;
517 $skip -= $read_limit;
519 unset($skip);
522 // This array contain the data like numberof valid sql queries in the statement
523 // and complete valid sql statement (which affected for rows)
524 $sql_data = array('valid_sql' => array(), 'valid_queries' => 0);
526 if (! $error) {
527 // Check for file existence
528 include_once "libraries/plugin_interface.lib.php";
529 /* @var $import_plugin ImportPlugin */
530 $import_plugin = PMA_getPlugin(
531 "import",
532 $format,
533 'libraries/plugins/import/',
534 $import_type
536 if ($import_plugin == null) {
537 $message = PMA\libraries\Message::error(
538 __('Could not load import plugins, please check your installation!')
540 PMA_stopImport($message);
541 } else {
542 // Do the real import
543 try {
544 $default_fk_check = PMA\libraries\Util::handleDisableFKCheckInit();
545 $import_plugin->doImport($sql_data);
546 PMA\libraries\Util::handleDisableFKCheckCleanup($default_fk_check);
547 } catch (Exception $e) {
548 PMA\libraries\Util::handleDisableFKCheckCleanup($default_fk_check);
549 throw $e;
554 if (isset($import_handle)) {
555 $import_handle->close();
558 // Cleanup temporary file
559 if ($file_to_unlink != '') {
560 unlink($file_to_unlink);
563 // Reset charset back, if we did some changes
564 if ($reset_charset) {
565 $GLOBALS['dbi']->query('SET CHARACTER SET utf8');
566 $GLOBALS['dbi']->query(
567 'SET SESSION collation_connection =\'' . $collation_connection . '\''
571 // Show correct message
572 if (! empty($id_bookmark) && $_REQUEST['action_bookmark'] == 2) {
573 $message = PMA\libraries\Message::success(__('The bookmark has been deleted.'));
574 $display_query = $import_text;
575 $error = false; // unset error marker, it was used just to skip processing
576 } elseif (! empty($id_bookmark) && $_REQUEST['action_bookmark'] == 1) {
577 $message = PMA\libraries\Message::notice(__('Showing bookmark'));
578 } elseif ($bookmark_created) {
579 $special_message = '[br]' . sprintf(
580 __('Bookmark %s has been created.'),
581 htmlspecialchars($_POST['bkm_label'])
583 } elseif ($finished && ! $error) {
584 // Do not display the query with message, we do it separately
585 $display_query = ';';
586 if ($import_type != 'query') {
587 $message = PMA\libraries\Message::success(
588 '<em>'
589 . _ngettext(
590 'Import has been successfully finished, %d query executed.',
591 'Import has been successfully finished, %d queries executed.',
592 $executed_queries
594 . '</em>'
596 $message->addParam($executed_queries);
598 if ($import_notice) {
599 $message->addHtml($import_notice);
601 if (! empty($local_import_file)) {
602 $message->addText('(' . $local_import_file . ')');
603 } else {
604 $message->addText('(' . $_FILES['import_file']['name'] . ')');
609 // Did we hit timeout? Tell it user.
610 if ($timeout_passed) {
611 $importUrl = $err_url .= '&timeout_passed=1&offset=' . urlencode(
612 $GLOBALS['offset']
614 if (isset($local_import_file)) {
615 $importUrl .= '&local_import_file=' . urlencode($local_import_file);
617 $message = PMA\libraries\Message::error(
619 'Script timeout passed, if you want to finish import,'
620 . ' please %sresubmit the same file%s and import will resume.'
623 $message->addParamHtml('<a href="' . $importUrl . '">');
624 $message->addParamHtml('</a>');
626 if ($offset == 0 || (isset($original_skip) && $original_skip == $offset)) {
627 $message->addText(
629 'However on last run no data has been parsed,'
630 . ' this usually means phpMyAdmin won\'t be able to'
631 . ' finish this import unless you increase php time limits.'
637 // if there is any message, copy it into $_SESSION as well,
638 // so we can obtain it by AJAX call
639 if (isset($message)) {
640 $_SESSION['Import_message']['message'] = $message->getDisplay();
642 // Parse and analyze the query, for correct db and table name
643 // in case of a query typed in the query window
644 // (but if the query is too large, in case of an imported file, the parser
645 // can choke on it so avoid parsing)
646 $sqlLength = mb_strlen($sql_query);
647 if ($sqlLength <= $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
648 include_once 'libraries/parse_analyze.lib.php';
650 list(
651 $analyzed_sql_results,
652 $db,
653 $table_from_sql
654 ) = PMA_parseAnalyze($sql_query, $db);
655 // @todo: possibly refactor
656 extract($analyzed_sql_results);
658 if ($table != $table_from_sql && !empty($table_from_sql)) {
659 $table = $table_from_sql;
663 // There was an error?
664 if (isset($my_die)) {
665 foreach ($my_die as $key => $die) {
666 PMA\libraries\Util::mysqlDie(
667 $die['error'], $die['sql'], false, $err_url, $error
672 if ($go_sql) {
674 if (! empty($sql_data) && ($sql_data['valid_queries'] > 1)) {
675 $_SESSION['is_multi_query'] = true;
676 $sql_queries = $sql_data['valid_sql'];
677 } else {
678 $sql_queries = array($sql_query);
681 $html_output = '';
683 foreach ($sql_queries as $sql_query) {
685 // parse sql query
686 include_once 'libraries/parse_analyze.lib.php';
687 list(
688 $analyzed_sql_results,
689 $db,
690 $table_from_sql
691 ) = PMA_parseAnalyze($sql_query, $db);
692 // @todo: possibly refactor
693 extract($analyzed_sql_results);
695 // Check if User is allowed to issue a 'DROP DATABASE' Statement
696 if (PMA_hasNoRightsToDropDatabase(
697 $analyzed_sql_results, $cfg['AllowUserDropDatabase'], $GLOBALS['is_superuser']
698 )) {
699 PMA\libraries\Util::mysqlDie(
700 __('"DROP DATABASE" statements are disabled.'),
702 false,
703 $_SESSION['Import_message']['go_back_url']
705 return;
706 } // end if
708 if ($table != $table_from_sql && !empty($table_from_sql)) {
709 $table = $table_from_sql;
712 $html_output .= PMA_executeQueryAndGetQueryResponse(
713 $analyzed_sql_results, // analyzed_sql_results
714 false, // is_gotofile
715 $db, // db
716 $table, // table
717 null, // find_real_end
718 null, // sql_query_for_bookmark - see below
719 null, // extra_data
720 null, // message_to_show
721 null, // message
722 null, // sql_data
723 $goto, // goto
724 $pmaThemeImage, // pmaThemeImage
725 null, // disp_query
726 null, // disp_message
727 null, // query_type
728 $sql_query, // sql_query
729 null, // selectedTables
730 null // complete_query
734 // sql_query_for_bookmark is not included in PMA_executeQueryAndGetQueryResponse
735 // since only one bookmark has to be added for all the queries submitted through
736 // the SQL tab
737 if (! empty($_POST['bkm_label']) && ! empty($import_text)) {
738 $cfgBookmark = Bookmark::getParams();
739 PMA_storeTheQueryAsBookmark(
740 $db, $cfgBookmark['user'],
741 $_REQUEST['sql_query'], $_POST['bkm_label'],
742 isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null
746 $response->addJSON('ajax_reload', $ajax_reload);
747 $response->addHTML($html_output);
748 exit();
750 } else if ($result) {
751 // Save a Bookmark with more than one queries (if Bookmark label given).
752 if (! empty($_POST['bkm_label']) && ! empty($import_text)) {
753 $cfgBookmark = Bookmark::getParams();
754 PMA_storeTheQueryAsBookmark(
755 $db, $cfgBookmark['user'],
756 $_REQUEST['sql_query'], $_POST['bkm_label'],
757 isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null
761 $response->setRequestStatus(true);
762 $response->addJSON('message', PMA\libraries\Message::success($msg));
763 $response->addJSON(
764 'sql_query',
765 PMA\libraries\Util::getMessage($msg, $sql_query, 'success')
767 } else if ($result == false) {
768 $response->setRequestStatus(false);
769 $response->addJSON('message', PMA\libraries\Message::error($msg));
770 } else {
771 $active_page = $goto;
772 include '' . $goto;
775 // If there is request for ROLLBACK in the end.
776 if (isset($_REQUEST['rollback_query'])) {
777 $GLOBALS['dbi']->query('ROLLBACK');