Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / share / phpmyadmin / libraries / | server ip : 104.21.89.46 your ip : 172.69.17.106 H O M E |
Filename | /usr/share/phpmyadmin/libraries/parse_analyze.lib.php |
Size | 1.78 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 10:12 |
Last modified | 05-Dec-2013 01:44 |
Last accessed | 05-Jul-2025 20:21 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Parse and analyse a SQL query
*
* @package PhpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*
*/
$GLOBALS['unparsed_sql'] = $sql_query;
$parsed_sql = PMA_SQP_parse($sql_query);
$analyzed_sql = PMA_SQP_analyze($parsed_sql);
// for bug 780516: now that we use case insensitive preg_match
// or flags from the analyser, do not put back the reformatted query
// into $sql_query, to make this kind of query work without
// capitalizing keywords:
//
// CREATE TABLE SG_Persons (
// id int(10) unsigned NOT NULL auto_increment,
// first varchar(64) NOT NULL default '',
// PRIMARY KEY (`id`)
// )
// check for a real SELECT ... FROM
$is_select = isset($analyzed_sql[0]['queryflags']['select_from']);
// If the query is a Select, extract the db and table names and modify
// $db and $table, to have correct page headers, links and left frame.
// db and table name may be enclosed with backquotes, db is optionnal,
// query may contain aliases.
/**
* @todo if there are more than one table name in the Select:
* - do not extract the first table name
* - do not show a table name in the page header
* - do not display the sub-pages links)
*/
if ($is_select) {
$prev_db = $db;
if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name'])) {
$table = $analyzed_sql[0]['table_ref'][0]['table_true_name'];
}
if (isset($analyzed_sql[0]['table_ref'][0]['db'])
&& strlen($analyzed_sql[0]['table_ref'][0]['db'])
) {
$db = $analyzed_sql[0]['table_ref'][0]['db'];
} else {
$db = $prev_db;
}
// Nijel: don't change reload, if we already decided to reload in import
if (empty($reload) && empty($GLOBALS['is_ajax_request'])) {
$reload = ($db == $prev_db) ? 0 : 1;
}
}
?>
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Parse and analyse a SQL query
*
* @package PhpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*
*/
$GLOBALS['unparsed_sql'] = $sql_query;
$parsed_sql = PMA_SQP_parse($sql_query);
$analyzed_sql = PMA_SQP_analyze($parsed_sql);
// for bug 780516: now that we use case insensitive preg_match
// or flags from the analyser, do not put back the reformatted query
// into $sql_query, to make this kind of query work without
// capitalizing keywords:
//
// CREATE TABLE SG_Persons (
// id int(10) unsigned NOT NULL auto_increment,
// first varchar(64) NOT NULL default '',
// PRIMARY KEY (`id`)
// )
// check for a real SELECT ... FROM
$is_select = isset($analyzed_sql[0]['queryflags']['select_from']);
// If the query is a Select, extract the db and table names and modify
// $db and $table, to have correct page headers, links and left frame.
// db and table name may be enclosed with backquotes, db is optionnal,
// query may contain aliases.
/**
* @todo if there are more than one table name in the Select:
* - do not extract the first table name
* - do not show a table name in the page header
* - do not display the sub-pages links)
*/
if ($is_select) {
$prev_db = $db;
if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name'])) {
$table = $analyzed_sql[0]['table_ref'][0]['table_true_name'];
}
if (isset($analyzed_sql[0]['table_ref'][0]['db'])
&& strlen($analyzed_sql[0]['table_ref'][0]['db'])
) {
$db = $analyzed_sql[0]['table_ref'][0]['db'];
} else {
$db = $prev_db;
}
// Nijel: don't change reload, if we already decided to reload in import
if (empty($reload) && empty($GLOBALS['is_ajax_request'])) {
$reload = ($db == $prev_db) ? 0 : 1;
}
}
?>