tryQuery($sql_query)) {
include_once './libraries/tbl_views.lib.php';
// If different column names defined for VIEW
$view_columns = array();
if (isset($_REQUEST['view']['column_names'])) {
$view_columns = explode(',', $_REQUEST['view']['column_names']);
}
$column_map = PMA_getColumnMap($_REQUEST['view']['as'], $view_columns);
$pma_tranformation_data = PMA_getExistingTranformationData($GLOBALS['db']);
if ($pma_tranformation_data !== false) {
// SQL for store new transformation details of VIEW
$new_transformations_sql = PMA_getNewTransformationDataSql(
$pma_tranformation_data, $column_map, $_REQUEST['view']['name'],
$GLOBALS['db']
);
// Store new transformations
if ($new_transformations_sql != '') {
$GLOBALS['dbi']->tryQuery($new_transformations_sql);
}
}
unset($pma_tranformation_data);
if (! isset($_REQUEST['ajax_dialog'])) {
$message = PMA_Message::success();
include 'tbl_structure.php';
} else {
$response = PMA_Response::getInstance();
$response->addJSON(
'message',
PMA_Util::getMessage(
PMA_Message::success(), $sql_query
)
);
$response->isSuccess(true);
}
exit;
} else {
if (! isset($_REQUEST['ajax_dialog'])) {
$message = PMA_Message::rawError($GLOBALS['dbi']->getError());
} else {
$response = PMA_Response::getInstance();
$response->addJSON(
'message',
PMA_Message::error(
"" . htmlspecialchars($sql_query) . "
"
. $GLOBALS['dbi']->getError()
)
);
$response->isSuccess(false);
exit;
}
}
}
// prefill values if not already filled from former submission
$view = array(
'operation' => 'create',
'or_replace' => '',
'algorithm' => '',
'definer' => '',
'sql_security' => '',
'name' => '',
'column_names' => '',
'as' => $sql_query,
'with' => '',
);
if (PMA_isValid($_REQUEST['view'], 'array')) {
$view = array_merge($view, $_REQUEST['view']);
}
$url_params['db'] = $GLOBALS['db'];
$url_params['reload'] = 1;
/**
* Displays the page
*/
$htmlString = ''
. '