use @todo tag for todo items, to show up in generated documentation
This commit is contained in:
@@ -238,10 +238,12 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
|
||||
// here, we have a TIMESTAMP that SHOW FULL FIELDS reports as having the
|
||||
// NULL attribute, but SHOW CREATE TABLE says the contrary. Believe
|
||||
// the latter.
|
||||
// TODO: merge this logic with the one in tbl_properties_structure.php
|
||||
// or move it in a function similar to PMA_DBI_get_columns_full()
|
||||
// but based on SHOW CREATE TABLE because information_schema
|
||||
// cannot be trusted in this case (MySQL bug)
|
||||
/**
|
||||
* @todo merge this logic with the one in tbl_properties_structure.php
|
||||
* or move it in a function similar to PMA_DBI_get_columns_full()
|
||||
* but based on SHOW CREATE TABLE because information_schema
|
||||
* cannot be trusted in this case (MySQL bug)
|
||||
*/
|
||||
if (!empty($analyzed_sql[0]['create_table_fields'][$field_name]['type']) && $analyzed_sql[0]['create_table_fields'][$field_name]['type'] == 'TIMESTAMP' && $analyzed_sql[0]['create_table_fields'][$field_name]['timestamp_not_null']) {
|
||||
$row['Null'] = '';
|
||||
}
|
||||
|
@@ -88,10 +88,11 @@ if (isset($db) &&
|
||||
|
||||
// now that all tables exist, create all the accumulated constraints
|
||||
if (isset($GLOBALS['add_constraints'])) {
|
||||
// FIXME: this works with mysqli but not with mysql,
|
||||
// because mysql extension does not accept more than one
|
||||
// statement; maybe interface with the sql import plugin
|
||||
// that handles statement delimiter
|
||||
/**
|
||||
* @todo this works with mysqli but not with mysql, because
|
||||
* mysql extension does not accept more than one statement; maybe
|
||||
* interface with the sql import plugin that handles statement delimiter
|
||||
*/
|
||||
PMA_DBI_query($GLOBALS['sql_constraints_query_full_db']);
|
||||
|
||||
// and prepare to display them
|
||||
|
@@ -384,7 +384,7 @@ class PMA_Config
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO check validity of $_COOKIE['pma_collation_connection']
|
||||
* @todo check validity of $_COOKIE['pma_collation_connection']
|
||||
*/
|
||||
if (! empty($_COOKIE['pma_collation_connection'])) {
|
||||
$this->set('collation_connection',
|
||||
@@ -657,7 +657,7 @@ class PMA_Config
|
||||
|
||||
/**
|
||||
* check selected collation_connection
|
||||
* @TODO check validity of $_REQUEST['collation_connection']
|
||||
* @todo check validity of $_REQUEST['collation_connection']
|
||||
*/
|
||||
function checkCollationConnection()
|
||||
{
|
||||
|
@@ -215,6 +215,7 @@ class PMA_Table {
|
||||
* Checks if this "table" is a view
|
||||
*
|
||||
* @deprecated
|
||||
* @todo see what we could do with the possible existence of $table_is_view
|
||||
* @param string the database name
|
||||
* @param string the table name
|
||||
*
|
||||
@@ -224,8 +225,6 @@ class PMA_Table {
|
||||
*/
|
||||
function _isView($db, $table) {
|
||||
// maybe we already know if the table is a view
|
||||
// TODO: see what we could do with the possible existence
|
||||
// of $table_is_view
|
||||
if (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view']) {
|
||||
return true;
|
||||
}
|
||||
@@ -244,6 +243,8 @@ class PMA_Table {
|
||||
* generates column/field specification for ALTER or CREATE TABLE syntax
|
||||
*
|
||||
* @todo move into class PMA_Column
|
||||
* @todo on the interface, some js to clear the default value when the default
|
||||
* current_timestamp is checked
|
||||
* @static
|
||||
* @param string $name name
|
||||
* @param string $type type ('INT', 'VARCHAR', 'BIT', ...)
|
||||
@@ -269,10 +270,10 @@ class PMA_Table {
|
||||
{
|
||||
|
||||
// $default_current_timestamp has priority over $default
|
||||
// TODO: on the interface, some js to clear the default value
|
||||
// when the default current_timestamp is checked
|
||||
|
||||
// TODO: include db-name
|
||||
/**
|
||||
* @todo include db-name
|
||||
*/
|
||||
$query = PMA_backquote($name) . ' ' . $type;
|
||||
|
||||
if ($length != ''
|
||||
@@ -401,7 +402,7 @@ class PMA_Table {
|
||||
} // end of the 'PMA_Table::countRecords()' function
|
||||
|
||||
/**
|
||||
* @TODO add documentation
|
||||
* @todo add documentation
|
||||
*/
|
||||
function generateAlter($oldcol, $newcol, $type, $length,
|
||||
$attribute, $collation, $null, $default, $default_current_timestamp,
|
||||
@@ -501,7 +502,7 @@ class PMA_Table {
|
||||
|
||||
/**
|
||||
* Copies or renames table
|
||||
* FIXME: use RENAME for move operations
|
||||
* @todo use RENAME for move operations
|
||||
* - works only if the databases are on the same filesystem,
|
||||
* how can we check that? try the operation and
|
||||
* catch an error?
|
||||
@@ -524,7 +525,9 @@ class PMA_Table {
|
||||
|
||||
// Ensure the target is valid
|
||||
if (! $GLOBALS['PMA_List_Database']->exists($source_db, $target_db)) {
|
||||
// @TODO exit really needed here? or just a return?
|
||||
/**
|
||||
* @todo exit really needed here? or just a return?
|
||||
*/
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -716,10 +719,12 @@ class PMA_Table {
|
||||
unset($table_query);
|
||||
}
|
||||
|
||||
// garvin: [TODO] Can't get moving PDFs the right way. The page numbers always
|
||||
// get screwed up independently from duplication because the numbers do not
|
||||
// seem to be stored on a per-database basis. Would the author of pdf support
|
||||
// please have a look at it?
|
||||
/**
|
||||
* @todo garvin: Can't get moving PDFs the right way. The page numbers
|
||||
* always get screwed up independently from duplication because the
|
||||
* numbers do not seem to be stored on a per-database basis. Would
|
||||
* the author of pdf support please have a look at it?
|
||||
*/
|
||||
|
||||
if ($GLOBALS['cfgRelation']['pdfwork']) {
|
||||
$table_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['table_coords'])
|
||||
@@ -799,11 +804,13 @@ class PMA_Table {
|
||||
$new_fields = array('foreign_db' => $target_db, 'foreign_table' => $target_table);
|
||||
PMA_Table::duplicateInfo('relwork', 'relation', $get_fields, $where_fields, $new_fields);
|
||||
|
||||
// garvin: [TODO] Can't get duplicating PDFs the right way. The page numbers always
|
||||
// get screwed up independently from duplication because the numbers do not
|
||||
// seem to be stored on a per-database basis. Would the author of pdf support
|
||||
// please have a look at it?
|
||||
/*
|
||||
/**
|
||||
* @todo garvin: Can't get duplicating PDFs the right way. The
|
||||
* page numbers always get screwed up independently from
|
||||
* duplication because the numbers do not seem to be stored on a
|
||||
* per-database basis. Would the author of pdf support please
|
||||
* have a look at it?
|
||||
*
|
||||
$get_fields = array('page_descr');
|
||||
$where_fields = array('db_name' => $source_db);
|
||||
$new_fields = array('db_name' => $target_db);
|
||||
@@ -815,7 +822,7 @@ class PMA_Table {
|
||||
$new_fields = array('db_name' => $target_db, 'table_name' => $target_table, 'pdf_page_number' => $last_id);
|
||||
PMA_Table::duplicateInfo('pdfwork', 'table_coords', $get_fields, $where_fields, $new_fields);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -893,8 +900,9 @@ class PMA_Table {
|
||||
$this->setName($new_name);
|
||||
$this->setDbName($new_db);
|
||||
|
||||
// TODO move into extra function
|
||||
// PMA_Relation::renameTable($new_name, $old_name, $new_db, $old_db)
|
||||
/**
|
||||
* @todo move into extra function PMA_Relation::renameTable($new_name, $old_name, $new_db, $old_db)
|
||||
*/
|
||||
// garvin: Move old entries from comments to new table
|
||||
require_once './libraries/relation.lib.php';
|
||||
$GLOBALS['cfgRelation'] = PMA_getRelationsParam();
|
||||
|
@@ -99,10 +99,12 @@ function PMA_auth_fails()
|
||||
echo "\n";
|
||||
$GLOBALS['is_header_sent'] = TRUE;
|
||||
|
||||
//TODO: I have included this div from libraries/header.inc.php to work around
|
||||
// an undefined variable in tooltip.js, when the server
|
||||
// is not responding. Work has to be done to merge all code that
|
||||
// starts the page (DOCTYPE and this div) to one place
|
||||
/**
|
||||
* @todo I have included this div from libraries/header.inc.php to work around
|
||||
* an undefined variable in tooltip.js, when the server is not responding.
|
||||
* Work has to be done to merge all code that starts the page (DOCTYPE and
|
||||
* this div) to one place
|
||||
*/
|
||||
?>
|
||||
<div id="TooltipContainer" onmouseover="holdTooltip();" onmouseout="swapTooltip('default');"></div>
|
||||
<?php
|
||||
|
@@ -52,18 +52,20 @@ function PMA_analyseShowGrant($rs_usr, &$is_create_db_priv, &$db_to_create, &$is
|
||||
$dbname_to_test = $show_grants_dbname;
|
||||
}
|
||||
|
||||
if ( (ereg($re0 . '%|_', $show_grants_dbname)
|
||||
&& !ereg('\\\\%|\\\\_', $show_grants_dbname))
|
||||
// does this db exist?
|
||||
|| (!PMA_DBI_try_query('USE ' . ereg_replace($re1 .'(%|_)', '\\1\\3', $dbname_to_test), null, PMA_DBI_QUERY_STORE) && substr(PMA_DBI_getError(), 1, 4) != 1044)
|
||||
) {
|
||||
$db_to_create = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $show_grants_dbname));
|
||||
$db_to_create = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create);
|
||||
$is_create_db_priv = true;
|
||||
if ((ereg($re0 . '%|_', $show_grants_dbname)
|
||||
&& !ereg('\\\\%|\\\\_', $show_grants_dbname))
|
||||
// does this db exist?
|
||||
|| (!PMA_DBI_try_query('USE ' . ereg_replace($re1 .'(%|_)', '\\1\\3', $dbname_to_test), null, PMA_DBI_QUERY_STORE)
|
||||
&& substr(PMA_DBI_getError(), 1, 4) != 1044)
|
||||
) {
|
||||
$db_to_create = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $show_grants_dbname));
|
||||
$db_to_create = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create);
|
||||
$is_create_db_priv = true;
|
||||
|
||||
// TODO: collect $db_to_create into an array, to display a drop-down
|
||||
// in the "Create new database" dialog
|
||||
//
|
||||
/**
|
||||
* @todo collect $db_to_create into an array, to display a
|
||||
* drop-down in the "Create new database" dialog
|
||||
*/
|
||||
// we don't break, we want all possible databases
|
||||
//break;
|
||||
} // end if
|
||||
|
@@ -800,9 +800,11 @@ if (!defined('PMA_MINIMUM_COMMON')) {
|
||||
// get the duplicate entry
|
||||
|
||||
// get table name
|
||||
// TODO: what would be the best delimiter, while avoiding
|
||||
// special characters that can become high-ascii after editing,
|
||||
// depending upon which editor is used by the developer?
|
||||
/**
|
||||
* @todo what would be the best delimiter, while avoiding special
|
||||
* characters that can become high-ascii after editing, depending
|
||||
* upon which editor is used by the developer?
|
||||
*/
|
||||
$error_table = array();
|
||||
if (preg_match('@ALTER\s*TABLE\s*\`([^\`]+)\`@iu', $the_query, $error_table)) {
|
||||
$error_table = $error_table[1];
|
||||
@@ -1121,7 +1123,9 @@ if (!defined('PMA_MINIMUM_COMMON')) {
|
||||
if (is_string($a_string)) {
|
||||
$a_string = htmlspecialchars($a_string);
|
||||
$a_string = PMA_escapeJsString($a_string);
|
||||
// TODO: what is this good for?
|
||||
/**
|
||||
* @todo what is this good for?
|
||||
*/
|
||||
$a_string = str_replace('#', '\\#', $a_string);
|
||||
}
|
||||
|
||||
@@ -1325,8 +1329,10 @@ window.parent.updateTableTitle('<?php echo $uni_tbl; ?>', '<?php echo PMA_jsForm
|
||||
|
||||
// Only append it on SELECTs.
|
||||
|
||||
// FIXME: what would be the best to do when someone
|
||||
// hits Refresh: use the current LIMITs ?
|
||||
/**
|
||||
* @todo what would be the best to do when someone hits Refresh:
|
||||
* use the current LIMITs ?
|
||||
*/
|
||||
|
||||
if (isset($analyzed_display_query[0]['queryflags']['select_from'])
|
||||
&& isset($GLOBALS['sql_limit_to_append'])) {
|
||||
@@ -2308,7 +2314,7 @@ window.parent.updateTableTitle('<?php echo $uni_tbl; ?>', '<?php echo PMA_jsForm
|
||||
} // end function
|
||||
|
||||
/**
|
||||
* @TODO add documentation
|
||||
* @todo add documentation
|
||||
*/
|
||||
function PMA_userDir($dir)
|
||||
{
|
||||
@@ -2521,17 +2527,20 @@ if (empty($__redirect) && !defined('PMA_NO_VARIABLES_IMPORT')) {
|
||||
*/
|
||||
|
||||
/**
|
||||
* @global array $GLOBALS['PMA_errors'] holds errors
|
||||
* holds errors
|
||||
* @global array $GLOBALS['PMA_errors']
|
||||
*/
|
||||
$GLOBALS['PMA_errors'] = array();
|
||||
|
||||
/**
|
||||
* @global array $GLOBALS['url_params'] holds params to be passed to next page
|
||||
* holds params to be passed to next page
|
||||
* @global array $GLOBALS['url_params']
|
||||
*/
|
||||
$GLOBALS['url_params'] = array();
|
||||
|
||||
/**
|
||||
* @global array $goto_whitelist the whitelist for $GLOBALS['goto']
|
||||
* the whitelist for $GLOBALS['goto']
|
||||
* @global array $goto_whitelist
|
||||
*/
|
||||
$goto_whitelist = array(
|
||||
//'browse_foreigners.php',
|
||||
@@ -2605,7 +2614,8 @@ if (! PMA_checkPageValidity($__redirect, $goto_whitelist)) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @global string $GLOBALS['goto'] holds page that should be displayed
|
||||
* holds page that should be displayed
|
||||
* @global string $GLOBALS['goto']
|
||||
*/
|
||||
// Security fix: disallow accessing serious server files via "?goto="
|
||||
if (PMA_checkPageValidity($_REQUEST['goto'], $goto_whitelist)) {
|
||||
@@ -2617,7 +2627,8 @@ if (PMA_checkPageValidity($_REQUEST['goto'], $goto_whitelist)) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @global string $GLOBALS['back'] returning page
|
||||
* returning page
|
||||
* @global string $GLOBALS['back']
|
||||
*/
|
||||
if (PMA_checkPageValidity($_REQUEST['back'], $goto_whitelist)) {
|
||||
$GLOBALS['back'] = $_REQUEST['back'];
|
||||
@@ -2633,7 +2644,7 @@ if (PMA_checkPageValidity($_REQUEST['back'], $goto_whitelist)) {
|
||||
* could acces this variables before we reach this point
|
||||
* f.e. PMA_Config: fontsize
|
||||
*
|
||||
* @todo: variables should be handled by their respective owners (objects)
|
||||
* @todo variables should be handled by their respective owners (objects)
|
||||
* f.e. lang, server, convcharset, collation_connection in PMA_Config
|
||||
*/
|
||||
if (! isset($_REQUEST['token']) || $_SESSION['PMA_token'] != $_REQUEST['token']) {
|
||||
@@ -2662,14 +2673,15 @@ if (! isset($_REQUEST['token']) || $_SESSION['PMA_token'] != $_REQUEST['token'])
|
||||
|
||||
/**
|
||||
* @global string $convcharset
|
||||
* @see also select_lang.lib.php
|
||||
* @see select_lang.lib.php
|
||||
*/
|
||||
if (isset($_REQUEST['convcharset'])) {
|
||||
$convcharset = strip_tags($_REQUEST['convcharset']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @global string $GLOBALS['db'] current selected database
|
||||
* current selected database
|
||||
* @global string $GLOBALS['db']
|
||||
*/
|
||||
if (isset($_REQUEST['db'])) {
|
||||
// can we strip tags from this?
|
||||
@@ -2681,7 +2693,8 @@ if (isset($_REQUEST['db'])) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @global string $GLOBALS['table'] current selected table
|
||||
* current selected table
|
||||
* @global string $GLOBALS['table']
|
||||
*/
|
||||
if (isset($_REQUEST['table'])) {
|
||||
// can we strip tags from this?
|
||||
@@ -2693,7 +2706,8 @@ if (isset($_REQUEST['table'])) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @global string $GLOBALS['sql_query'] sql query to be executed
|
||||
* sql query to be executed
|
||||
* @global string $GLOBALS['sql_query']
|
||||
*/
|
||||
if (isset($_REQUEST['sql_query'])) {
|
||||
$GLOBALS['sql_query'] = $_REQUEST['sql_query'];
|
||||
@@ -2730,7 +2744,7 @@ if (empty($_SESSION['PMA_Config'])) {
|
||||
|
||||
} elseif (version_compare(phpversion(), '5', 'lt')) {
|
||||
/**
|
||||
* @todo: move all __wakeup() functionality into session.inc.php
|
||||
* @todo move all __wakeup() functionality into session.inc.php
|
||||
*/
|
||||
$_SESSION['PMA_Config']->__wakeup();
|
||||
}
|
||||
@@ -2850,7 +2864,7 @@ if (! isset($_SESSION['PMA_Theme_Manager'])) {
|
||||
$_SESSION['PMA_Theme_Manager'] = new PMA_Theme_Manager;
|
||||
} else {
|
||||
/**
|
||||
* @todo: move all __wakeup() functionality into session.inc.php
|
||||
* @todo move all __wakeup() functionality into session.inc.php
|
||||
*/
|
||||
$_SESSION['PMA_Theme_Manager']->checkConfig();
|
||||
}
|
||||
@@ -2866,7 +2880,7 @@ if (isset($_REQUEST['server']) && !isset($_REQUEST['set_theme'])) {
|
||||
unset($tmp);
|
||||
}
|
||||
/**
|
||||
* @todo: move into PMA_Theme_Manager::__wakeup()
|
||||
* @todo move into PMA_Theme_Manager::__wakeup()
|
||||
*/
|
||||
if (isset($_REQUEST['set_theme'])) {
|
||||
// if user selected a theme
|
||||
@@ -2885,7 +2899,9 @@ $GLOBALS['pmaThemeImage'] = $_SESSION['PMA_Theme']->getImgPath();
|
||||
*/
|
||||
if (@file_exists($_SESSION['PMA_Theme']->getLayoutFile())) {
|
||||
include $_SESSION['PMA_Theme']->getLayoutFile();
|
||||
// @todo remove if all themes are update use Navi instead of Left as frame name
|
||||
/**
|
||||
* @todo remove if all themes are update use Navi instead of Left as frame name
|
||||
*/
|
||||
if (! isset($GLOBALS['cfg']['NaviWidth'])
|
||||
&& isset($GLOBALS['cfg']['LeftWidth'])) {
|
||||
$GLOBALS['cfg']['NaviWidth'] = $GLOBALS['cfg']['LeftWidth'];
|
||||
@@ -3080,7 +3096,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
|
||||
/**
|
||||
* save some settings in cookies
|
||||
* @todo: should be done in PMA_Config
|
||||
* @todo should be done in PMA_Config
|
||||
*/
|
||||
PMA_setCookie('pma_lang', $GLOBALS['lang']);
|
||||
PMA_setCookie('pma_charset', $GLOBALS['convcharset']);
|
||||
|
@@ -535,8 +535,9 @@ $cfg['NaturalOrder'] = TRUE; // Sort table and database in natura
|
||||
//-----------------------------------------------------------------------------
|
||||
// custom-setup by mkkeck: 2004-05-04
|
||||
// some specials for new icons and scrollings
|
||||
// FIXME:
|
||||
// 2004-05-08 rabus: We need to rearrange these variables.
|
||||
/**
|
||||
* @todo 2004-05-08 rabus: We need to rearrange these variables.
|
||||
*/
|
||||
|
||||
// Window title settings
|
||||
$cfg['TitleTable'] = '@HTTP_HOST@ / @VSERVER@ / @DATABASE@ / @TABLE@ | @PHPMYADMIN@';
|
||||
|
@@ -38,8 +38,10 @@ if ( ! PMA_DBI_checkAndLoadMysqlExtension( $GLOBALS['cfg']['Server']['extension'
|
||||
// if it fails try alternative extension ...
|
||||
// and display an error ...
|
||||
|
||||
// TODO 2.7.1: add different messages for alternativ extension
|
||||
// and complete fail (no alternativ extension too)
|
||||
/**
|
||||
* @todo 2.7.1: add different messages for alternativ extension
|
||||
* and complete fail (no alternativ extension too)
|
||||
*/
|
||||
$GLOBALS['PMA_errors'][] =
|
||||
sprintf( PMA_sanitize( $GLOBALS['strCantLoad'] ),
|
||||
$GLOBALS['cfg']['Server']['extension'] )
|
||||
@@ -165,8 +167,9 @@ function PMA_DBI_convert_message( $message ) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// lang not found, try all
|
||||
// what TODO ?
|
||||
/**
|
||||
* @todo lang not found, try all, what TODO ?
|
||||
*/
|
||||
}
|
||||
|
||||
return $message;
|
||||
@@ -334,8 +337,9 @@ function PMA_DBI_get_tables_full($database, $table = false,
|
||||
if ( strtoupper( $each_tables[$table_name]['Comment'] ) === 'VIEW' ) {
|
||||
$each_tables[$table_name]['TABLE_TYPE'] = 'VIEW';
|
||||
} else {
|
||||
// TODO difference between 'TEMPORARY' and 'BASE TABLE'
|
||||
// but how to detect?
|
||||
/**
|
||||
* @todo difference between 'TEMPORARY' and 'BASE TABLE' but how to detect?
|
||||
*/
|
||||
$each_tables[$table_name]['TABLE_TYPE'] = 'BASE TABLE';
|
||||
}
|
||||
}
|
||||
@@ -650,9 +654,13 @@ function PMA_DBI_get_columns_full($database = null, $table = null,
|
||||
$columns[$column_name]['DATA_TYPE'] =
|
||||
substr($columns[$column_name]['COLUMN_TYPE'], 0,
|
||||
strpos($columns[$column_name]['COLUMN_TYPE'], '('));
|
||||
// @TODO guess CHARACTER_MAXIMUM_LENGTH from COLUMN_TYPE
|
||||
/**
|
||||
* @todo guess CHARACTER_MAXIMUM_LENGTH from COLUMN_TYPE
|
||||
*/
|
||||
$columns[$column_name]['CHARACTER_MAXIMUM_LENGTH'] = null;
|
||||
// @TODO guess CHARACTER_OCTET_LENGTH from CHARACTER_MAXIMUM_LENGTH
|
||||
/**
|
||||
* @todo guess CHARACTER_OCTET_LENGTH from CHARACTER_MAXIMUM_LENGTH
|
||||
*/
|
||||
$columns[$column_name]['CHARACTER_OCTET_LENGTH'] = null;
|
||||
$columns[$column_name]['NUMERIC_PRECISION'] = null;
|
||||
$columns[$column_name]['NUMERIC_SCALE'] = null;
|
||||
@@ -673,7 +681,7 @@ function PMA_DBI_get_columns_full($database = null, $table = null,
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO should only return columns names, for more info use PMA_DBI_get_columns_full()
|
||||
* @todo should only return columns names, for more info use PMA_DBI_get_columns_full()
|
||||
*
|
||||
* @deprecated by PMA_DBI_get_columns() or PMA_DBI_get_columns_full()
|
||||
* @param string $database name of database
|
||||
|
@@ -47,7 +47,9 @@ if (empty($is_table) && !defined('PMA_SUBMIT_MULT')) {
|
||||
// (as it can happen just in case temporary table, it should be
|
||||
// fast):
|
||||
|
||||
// @todo should this check really only happen if IS_TRANSFORMATION_WRAPPER?
|
||||
/**
|
||||
* @todo should this check really only happen if IS_TRANSFORMATION_WRAPPER?
|
||||
*/
|
||||
$_result = PMA_DBI_try_query(
|
||||
'SELECT COUNT(*) FROM `' . PMA_sqlAddslashes($table, true) . '`;',
|
||||
null, PMA_DBI_QUERY_STORE);
|
||||
|
@@ -342,7 +342,7 @@ function PMA_DBI_affected_rows($link = null)
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO add missing keys like in from mysqli_query (orgname, orgtable, flags, decimals)
|
||||
* @todo add missing keys like in from mysqli_query (orgname, orgtable, flags, decimals)
|
||||
*/
|
||||
function PMA_DBI_get_fields_meta($result) {
|
||||
$fields = array();
|
||||
|
@@ -171,7 +171,9 @@ function PMA_DBI_try_query($query, $link = null, $options = 0)
|
||||
$result = mysqli_query($link, $query, $method);
|
||||
|
||||
if (mysqli_warning_count($link)) {
|
||||
// TODO: check $method ?
|
||||
/**
|
||||
* @todo check $method ?
|
||||
*/
|
||||
$warning_result = mysqli_query($link, 'SHOW WARNINGS');
|
||||
if ($warning_result) {
|
||||
$warning_row = mysqli_fetch_row($warning_result);
|
||||
@@ -520,7 +522,7 @@ function PMA_DBI_affected_rows($link = null)
|
||||
/**
|
||||
* returns metainfo for fields in $result
|
||||
*
|
||||
* @TODO preserve orignal flags value
|
||||
* @todo preserve orignal flags value
|
||||
* @uses PMA_DBI_field_flags()
|
||||
* @uses MYSQLI_TYPE_*
|
||||
* @uses MYSQLI_MULTIPLE_KEY_FLAG
|
||||
|
@@ -104,7 +104,10 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
||||
}
|
||||
// 2.2 Statement is a "SHOW..."
|
||||
elseif ($GLOBALS['is_show']) {
|
||||
// 2.2.1 TODO : defines edit/delete links depending on show statement
|
||||
/**
|
||||
* 2.2.1
|
||||
* @todo defines edit/delete links depending on show statement
|
||||
*/
|
||||
$tmp = preg_match('@^SHOW[[:space:]]+(VARIABLES|(FULL[[:space:]]+)?PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS|DATABASES|FIELDS)@i', $GLOBALS['sql_query'], $which);
|
||||
if (isset($which[1]) && strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0) {
|
||||
$do_display['edit_lnk'] = 'nn'; // no edit link
|
||||
@@ -138,8 +141,9 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
||||
&& ($fields_meta[$i]->table == '' || $fields_meta[$i]->table != $prev_table)) {
|
||||
$do_display['edit_lnk'] = 'nn'; // don't display links
|
||||
$do_display['del_lnk'] = 'nn';
|
||||
// TODO: May be problematic with same fields names in
|
||||
// two joined table.
|
||||
/**
|
||||
* @todo May be problematic with same fields names in two joined table.
|
||||
*/
|
||||
// $do_display['sort_lnk'] = (string) '0';
|
||||
$do_display['ins_row'] = (string) '0';
|
||||
if ($do_display['text_btn'] == '1') {
|
||||
@@ -219,8 +223,10 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $encoded_query)
|
||||
global $is_innodb;
|
||||
global $showtable;
|
||||
|
||||
// FIXME: move this to a central place
|
||||
// FIXME: for other future table types
|
||||
/**
|
||||
* @todo move this to a central place
|
||||
* @todo for other future table types
|
||||
*/
|
||||
$is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB');
|
||||
|
||||
?>
|
||||
@@ -479,7 +485,10 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
|
||||
$sort_expression = trim(str_replace(' ', ' ', $analyzed_sql[0]['order_by_clause']));
|
||||
|
||||
// Get rid of ASC|DESC (TODO: analyzer)
|
||||
/**
|
||||
* Get rid of ASC|DESC
|
||||
* @todo analyzer
|
||||
*/
|
||||
preg_match('@(.*)([[:space:]]*(ASC|DESC))@si', $sort_expression, $matches);
|
||||
$sort_expression_nodir = isset($matches[1]) ? trim($matches[1]) : $sort_expression;
|
||||
|
||||
|
@@ -217,8 +217,10 @@ class PMA_PDF extends PMA_FPDF
|
||||
$this->$key = $val ;
|
||||
}
|
||||
|
||||
// Pass 1 for column widths
|
||||
// TODO: force here a LIMIT to speed up pass 1 ?
|
||||
/**
|
||||
* Pass 1 for column widths
|
||||
* @todo force here a LIMIT to speed up pass 1 ?
|
||||
*/
|
||||
$this->results = PMA_DBI_query($query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$this->numFields = PMA_DBI_num_fields($this->results);
|
||||
$this->fields = PMA_DBI_get_fields_meta($this->results);
|
||||
@@ -248,8 +250,10 @@ class PMA_PDF extends PMA_FPDF
|
||||
case 'tinyblob':
|
||||
case 'mediumblob':
|
||||
case 'longblob':
|
||||
//TODO: do not deactivate completely the display
|
||||
// but show the field's name and [BLOB]
|
||||
/**
|
||||
* @todo do not deactivate completely the display
|
||||
* but show the field's name and [BLOB]
|
||||
*/
|
||||
if (stristr($this->fields[$i]->flags, 'BINARY')) {
|
||||
$this->display_column[$i] = false;
|
||||
unset($this->colTitles[$i]);
|
||||
@@ -396,6 +400,7 @@ function PMA_exportDBCreate($db)
|
||||
/**
|
||||
* Outputs the content of a table in PDF format
|
||||
*
|
||||
* @todo user-defined page orientation, paper size
|
||||
* @param string the database name
|
||||
* @param string the table name
|
||||
* @param string the end of line sequence
|
||||
@@ -411,7 +416,6 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
||||
global $what;
|
||||
global $pdf_report_title;
|
||||
|
||||
// TODO: user-defined page orientation, paper size
|
||||
$pdf = new PMA_PDF('L', 'pt', 'A3');
|
||||
|
||||
$pdf->AddFont('FreeSans', '', 'FreeSans.php');
|
||||
|
@@ -177,7 +177,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
||||
if (!isset($row[$j]) || is_null($row[$j])) {
|
||||
$worksheet->write($col, $j, $GLOBALS['xls_null']);
|
||||
} elseif ($row[$j] == '0' || $row[$j] != '') {
|
||||
// FIXME: we should somehow handle character set here!
|
||||
/**
|
||||
* @todo we should somehow handle character set here!
|
||||
*/
|
||||
$worksheet->write($col, $j, $row[$j]);
|
||||
} else {
|
||||
$worksheet->write($col, $j, '');
|
||||
|
@@ -252,10 +252,13 @@ function PMA_importGetNextChunk($size = 32768)
|
||||
if ($charset_conversion) {
|
||||
return PMA_convert_string($charset_of_file, $charset, $result);
|
||||
} else {
|
||||
// Skip possible byte order marks (I do not think we need more
|
||||
// charsets, but feel free to add more, you can use wikipedia for
|
||||
// reference: <http://en.wikipedia.org/wiki/Byte_Order_Mark>)
|
||||
// @TODO: BOM could be used for charset autodetection
|
||||
/**
|
||||
* Skip possible byte order marks (I do not think we need more
|
||||
* charsets, but feel free to add more, you can use wikipedia for
|
||||
* reference: <http://en.wikipedia.org/wiki/Byte_Order_Mark>)
|
||||
*
|
||||
* @todo BOM could be used for charset autodetection
|
||||
*/
|
||||
if ($offset == $size) {
|
||||
// UTF-8
|
||||
if (strncmp($result, "\xEF\xBB\xBF", 3) == 0) {
|
||||
|
@@ -258,7 +258,9 @@ if ($plugin_param == 'table') {
|
||||
}
|
||||
$sql .= ')';
|
||||
|
||||
// FIXME: maybe we could add original line to verbose SQL in comment
|
||||
/**
|
||||
* @todo maybe we could add original line to verbose SQL in comment
|
||||
*/
|
||||
PMA_importRunQuery($sql, $sql);
|
||||
$line++;
|
||||
$csv_finish = FALSE;
|
||||
|
@@ -25,11 +25,12 @@ $is_select = isset($analyzed_sql[0]['queryflags']['select_from']);
|
||||
// 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)
|
||||
|
||||
/**
|
||||
* @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'])) {
|
||||
|
@@ -69,7 +69,9 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
|
||||
// value, displaying such informations may not be a so good
|
||||
// idea
|
||||
if (!empty($server['only_db'])) {
|
||||
// TODO FIXME this can become a really big/long/wide selectbox ...
|
||||
/**
|
||||
* @todo this can become a really big/long/wide selectbox ...
|
||||
*/
|
||||
$label .= ' - ' . (is_array($server['only_db']) ? implode(', ', $server['only_db']) : $server['only_db']);
|
||||
}
|
||||
if (!empty($server['user']) && $server['auth_type'] == 'config') {
|
||||
|
@@ -4,8 +4,8 @@
|
||||
/**
|
||||
* session handling
|
||||
*
|
||||
* @TODO add failover or warn if sessions are not configured properly
|
||||
* @TODO add an option to use mm-module for session handler
|
||||
* @todo add failover or warn if sessions are not configured properly
|
||||
* @todo add an option to use mm-module for session handler
|
||||
* @see http://www.php.net/session
|
||||
* @uses session_name()
|
||||
* @uses session_start()
|
||||
|
@@ -381,10 +381,11 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
if (PMA_STR_isSqlIdentifier($c, FALSE) || ($c == '@') || ($c == '.' && PMA_STR_isDigit(PMA_substr($sql, $count2 + 1, 1)))) {
|
||||
$count2 ++;
|
||||
|
||||
//TODO: a @ can also be present in expressions like
|
||||
// FROM 'user'@'%'
|
||||
// or TO 'user'@'%'
|
||||
// in this case, the @ is wrongly marked as alpha_variable
|
||||
/**
|
||||
* @todo a @ can also be present in expressions like
|
||||
* FROM 'user'@'%' or TO 'user'@'%'
|
||||
* in this case, the @ is wrongly marked as alpha_variable
|
||||
*/
|
||||
|
||||
$is_sql_variable = ($c == '@');
|
||||
$is_digit = (!$is_sql_variable) && PMA_STR_isDigit($c);
|
||||
@@ -523,9 +524,11 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
} elseif (($last == '-') || ($last == '+') || ($last == '!')) {
|
||||
$count2--;
|
||||
$punct_data = PMA_substr($sql, $count1, $count2 - $count1);
|
||||
// TODO: for negation operator, split in 2 tokens ?
|
||||
// "select x&~1 from t"
|
||||
// becomes "select x & ~ 1 from t" ?
|
||||
/**
|
||||
* @todo for negation operator, split in 2 tokens ?
|
||||
* "select x&~1 from t"
|
||||
* becomes "select x & ~ 1 from t" ?
|
||||
*/
|
||||
|
||||
} elseif ($last != '~') {
|
||||
$debugstr = $GLOBALS['strSQPBugUnknownPunctuation'] . ' @ ' . ($count1+1) . "\n"
|
||||
@@ -593,17 +596,22 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
$t_suffix = '_identifier';
|
||||
} elseif (($t_next == 'punct_bracket_open_round')
|
||||
&& PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_function_name, $PMA_SQPdata_function_name_cnt)) {
|
||||
// FIXME-2005-10-16: in the case of a CREATE TABLE containing a TIMESTAMP,
|
||||
// since TIMESTAMP() is also a function, it's found here and
|
||||
// the token is wrongly marked as alpha_functionName. But we
|
||||
// compensate for this when analysing for timestamp_not_null
|
||||
// later in this script.
|
||||
/**
|
||||
* @todo 2005-10-16: in the case of a CREATE TABLE containing
|
||||
* a TIMESTAMP, since TIMESTAMP() is also a function, it's
|
||||
* found here and the token is wrongly marked as alpha_functionName.
|
||||
* But we compensate for this when analysing for timestamp_not_null
|
||||
* later in this script.
|
||||
*/
|
||||
$t_suffix = '_functionName';
|
||||
} elseif (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_column_type, $PMA_SQPdata_column_type_cnt)) {
|
||||
$t_suffix = '_columnType';
|
||||
|
||||
// Temporary fix for BUG #621357
|
||||
//TODO FIX PROPERLY NEEDS OVERHAUL OF SQL TOKENIZER
|
||||
/**
|
||||
* Temporary fix for BUG #621357
|
||||
*
|
||||
* @todo FIX PROPERLY NEEDS OVERHAUL OF SQL TOKENIZER
|
||||
*/
|
||||
if ($d_cur_upper == 'SET' && $t_next != 'punct_bracket_open_round') {
|
||||
$t_suffix = '_reservedWord';
|
||||
}
|
||||
@@ -915,10 +923,10 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
} // end if (type == punct_queryend)
|
||||
} // end if ($seek_queryend)
|
||||
|
||||
// TODO: when we find a UNION, should we split
|
||||
// in another subresult?
|
||||
// Note: do not split if this is a punct_queryend for the
|
||||
// first and only query
|
||||
/**
|
||||
* Note: do not split if this is a punct_queryend for the first and only query
|
||||
* @todo when we find a UNION, should we split in another subresult?
|
||||
*/
|
||||
if ($arr[$i]['type'] == 'punct_queryend' && ($i + 1 != $size)) {
|
||||
$result[] = $subresult;
|
||||
$subresult = $subresult_empty;
|
||||
@@ -980,7 +988,9 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
|
||||
// upper once
|
||||
$upper_data = strtoupper($arr[$i]['data']);
|
||||
//TODO: reset for each query?
|
||||
/**
|
||||
* @todo reset for each query?
|
||||
*/
|
||||
|
||||
if ($upper_data == 'SELECT') {
|
||||
$seen_from = FALSE;
|
||||
@@ -1011,14 +1021,13 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
switch ($arr[$i]['type']) {
|
||||
case 'alpha_identifier':
|
||||
case 'alpha_reservedWord':
|
||||
// this is not a real reservedWord, because
|
||||
// it's not present in the list of forbidden words,
|
||||
// for example "storage" which can be used as
|
||||
// an identifier
|
||||
//
|
||||
// TODO: avoid the pretty printing in color
|
||||
// in this case
|
||||
|
||||
/**
|
||||
* this is not a real reservedWord, because it's not
|
||||
* present in the list of forbidden words, for example
|
||||
* "storage" which can be used as an identifier
|
||||
*
|
||||
* @todo avoid the pretty printing in color in this case
|
||||
*/
|
||||
$identifier = $arr[$i]['data'];
|
||||
break;
|
||||
|
||||
@@ -1067,7 +1076,9 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
continue;
|
||||
} // end if (punct_qualifier)
|
||||
|
||||
// TODO: check if 3 identifiers following one another -> error
|
||||
/**
|
||||
* @todo check if 3 identifiers following one another -> error
|
||||
*/
|
||||
|
||||
// s a v e a s e l e c t e x p r
|
||||
// finding a list separator or FROM
|
||||
@@ -1122,7 +1133,9 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
} // end if ($size_chain > 2)
|
||||
unset($chain);
|
||||
|
||||
// TODO: explain this:
|
||||
/**
|
||||
* @todo explain this:
|
||||
*/
|
||||
if (($arr[$i]['type'] == 'alpha_reservedWord')
|
||||
&& ($upper_data != 'FROM')) {
|
||||
$previous_was_identifier = TRUE;
|
||||
@@ -1137,9 +1150,11 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
|
||||
// maybe we just saw the end of table refs
|
||||
// but the last table ref has to be saved
|
||||
// or we are at the last token (TODO: there could be another
|
||||
// query after this one)
|
||||
// or we are at the last token
|
||||
// or we just got a reserved word
|
||||
/**
|
||||
* @todo there could be another query after this one
|
||||
*/
|
||||
|
||||
if (isset($chain) && $seen_from && $save_table_ref
|
||||
&& ($arr[$i]['type'] == 'punct_listsep'
|
||||
@@ -1204,62 +1219,65 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
} // end if (set the true names)
|
||||
|
||||
|
||||
// e n d i n g l o o p #1
|
||||
// set the $previous_was_identifier to FALSE if the current
|
||||
// token is not an identifier
|
||||
if (($arr[$i]['type'] != 'alpha_identifier')
|
||||
&& ($arr[$i]['type'] != 'quote_double')
|
||||
&& ($arr[$i]['type'] != 'quote_single')
|
||||
&& ($arr[$i]['type'] != 'quote_backtick')) {
|
||||
$previous_was_identifier = FALSE;
|
||||
} // end if
|
||||
// e n d i n g l o o p #1
|
||||
// set the $previous_was_identifier to FALSE if the current
|
||||
// token is not an identifier
|
||||
if (($arr[$i]['type'] != 'alpha_identifier')
|
||||
&& ($arr[$i]['type'] != 'quote_double')
|
||||
&& ($arr[$i]['type'] != 'quote_single')
|
||||
&& ($arr[$i]['type'] != 'quote_backtick')) {
|
||||
$previous_was_identifier = FALSE;
|
||||
} // end if
|
||||
|
||||
// however, if we are on AS, we must keep the $previous_was_identifier
|
||||
if (($arr[$i]['type'] == 'alpha_reservedWord')
|
||||
&& ($upper_data == 'AS')) {
|
||||
$previous_was_identifier = TRUE;
|
||||
}
|
||||
// however, if we are on AS, we must keep the $previous_was_identifier
|
||||
if (($arr[$i]['type'] == 'alpha_reservedWord')
|
||||
&& ($upper_data == 'AS')) {
|
||||
$previous_was_identifier = TRUE;
|
||||
}
|
||||
|
||||
if (($arr[$i]['type'] == 'alpha_reservedWord')
|
||||
&& ($upper_data =='ON' || $upper_data =='USING')) {
|
||||
$save_table_ref = FALSE;
|
||||
} // end if (data == ON)
|
||||
if (($arr[$i]['type'] == 'alpha_reservedWord')
|
||||
&& ($upper_data =='ON' || $upper_data =='USING')) {
|
||||
$save_table_ref = FALSE;
|
||||
} // end if (data == ON)
|
||||
|
||||
if (($arr[$i]['type'] == 'alpha_reservedWord')
|
||||
&& ($upper_data =='JOIN' || $upper_data =='FROM')) {
|
||||
$save_table_ref = TRUE;
|
||||
} // end if (data == JOIN)
|
||||
if (($arr[$i]['type'] == 'alpha_reservedWord')
|
||||
&& ($upper_data =='JOIN' || $upper_data =='FROM')) {
|
||||
$save_table_ref = TRUE;
|
||||
} // end if (data == JOIN)
|
||||
|
||||
// no need to check the end of table ref if we already did
|
||||
// TODO: maybe add "&& $seen_from"
|
||||
if (!$seen_end_of_table_ref) {
|
||||
// if this is the last token, it implies that we have
|
||||
// seen the end of table references
|
||||
// Check for the end of table references
|
||||
//
|
||||
// Note: if we are analyzing a GROUP_CONCAT clause,
|
||||
// we might find a word that seems to indicate that
|
||||
// we have found the end of table refs (like ORDER)
|
||||
// but it's a modifier of the GROUP_CONCAT so
|
||||
// it's not the real end of table refs
|
||||
if (($i == $size-1)
|
||||
/**
|
||||
* no need to check the end of table ref if we already did
|
||||
*
|
||||
* @todo maybe add "&& $seen_from"
|
||||
*/
|
||||
if (!$seen_end_of_table_ref) {
|
||||
// if this is the last token, it implies that we have
|
||||
// seen the end of table references
|
||||
// Check for the end of table references
|
||||
//
|
||||
// Note: if we are analyzing a GROUP_CONCAT clause,
|
||||
// we might find a word that seems to indicate that
|
||||
// we have found the end of table refs (like ORDER)
|
||||
// but it's a modifier of the GROUP_CONCAT so
|
||||
// it's not the real end of table refs
|
||||
if (($i == $size-1)
|
||||
|| ($arr[$i]['type'] == 'alpha_reservedWord'
|
||||
&& !$in_group_concat
|
||||
&& PMA_STR_binarySearchInArr($upper_data, $words_ending_table_ref, $words_ending_table_ref_cnt))) {
|
||||
$seen_end_of_table_ref = TRUE;
|
||||
// to be able to save the last table ref, but do not
|
||||
// set it true if we found a word like "ON" that has
|
||||
// already set it to false
|
||||
if (isset($save_table_ref) && $save_table_ref != FALSE) {
|
||||
$save_table_ref = TRUE;
|
||||
} //end if
|
||||
$seen_end_of_table_ref = TRUE;
|
||||
// to be able to save the last table ref, but do not
|
||||
// set it true if we found a word like "ON" that has
|
||||
// already set it to false
|
||||
if (isset($save_table_ref) && $save_table_ref != FALSE) {
|
||||
$save_table_ref = TRUE;
|
||||
} //end if
|
||||
|
||||
} // end if (check for end of table ref)
|
||||
} //end if (!$seen_end_of_table_ref)
|
||||
} // end if (check for end of table ref)
|
||||
} //end if (!$seen_end_of_table_ref)
|
||||
|
||||
if ($seen_end_of_table_ref) {
|
||||
$save_table_ref = FALSE;
|
||||
} // end if
|
||||
if ($seen_end_of_table_ref) {
|
||||
$save_table_ref = FALSE;
|
||||
} // end if
|
||||
|
||||
} // end for $i (loop #1)
|
||||
|
||||
@@ -1320,237 +1338,237 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
for ($i = 0; $i < $size; $i++) {
|
||||
//DEBUG echo "trace loop2 <b>" . $arr[$i]['data'] . "</b> (" . $arr[$i]['type'] . ")<br />";
|
||||
|
||||
// need_confirm
|
||||
//
|
||||
// check for reserved words that will have to generate
|
||||
// a confirmation request later in sql.php
|
||||
// the cases are:
|
||||
// DROP TABLE
|
||||
// DROP DATABASE
|
||||
// ALTER TABLE... DROP
|
||||
// DELETE FROM...
|
||||
//
|
||||
// this code is not used for confirmations coming from functions.js
|
||||
// need_confirm
|
||||
//
|
||||
// check for reserved words that will have to generate
|
||||
// a confirmation request later in sql.php
|
||||
// the cases are:
|
||||
// DROP TABLE
|
||||
// DROP DATABASE
|
||||
// ALTER TABLE... DROP
|
||||
// DELETE FROM...
|
||||
//
|
||||
// this code is not used for confirmations coming from functions.js
|
||||
|
||||
// TODO: check for punct_queryend
|
||||
/**
|
||||
* @todo check for punct_queryend
|
||||
* @todo verify C-style comments?
|
||||
*/
|
||||
if ($arr[$i]['type'] == 'comment_ansi') {
|
||||
$collect_section_before_limit = FALSE;
|
||||
}
|
||||
|
||||
if ($arr[$i]['type'] == 'alpha_reservedWord') {
|
||||
$upper_data = strtoupper($arr[$i]['data']);
|
||||
if (!$seen_reserved_word) {
|
||||
$first_reserved_word = $upper_data;
|
||||
$subresult['querytype'] = $upper_data;
|
||||
$seen_reserved_word = TRUE;
|
||||
|
||||
// if the first reserved word is DROP or DELETE,
|
||||
// we know this is a query that needs to be confirmed
|
||||
if ($first_reserved_word=='DROP'
|
||||
|| $first_reserved_word == 'DELETE'
|
||||
|| $first_reserved_word == 'TRUNCATE') {
|
||||
$subresult['queryflags']['need_confirm'] = 1;
|
||||
}
|
||||
|
||||
if ($first_reserved_word=='SELECT'){
|
||||
$position_of_first_select = $i;
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($upper_data=='DROP' && $first_reserved_word=='ALTER') {
|
||||
$subresult['queryflags']['need_confirm'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($upper_data == 'PROCEDURE') {
|
||||
$collect_section_before_limit = FALSE;
|
||||
}
|
||||
/**
|
||||
* @todo set also to FALSE if we find FOR UPDATE or LOCK IN SHARE MODE
|
||||
*/
|
||||
if ($upper_data == 'SELECT') {
|
||||
$in_select_expr = TRUE;
|
||||
$select_expr_clause = '';
|
||||
}
|
||||
if ($upper_data == 'DISTINCT' && !$in_group_concat) {
|
||||
$subresult['queryflags']['distinct'] = 1;
|
||||
}
|
||||
|
||||
if ($upper_data == 'UNION') {
|
||||
$subresult['queryflags']['union'] = 1;
|
||||
}
|
||||
|
||||
if ($upper_data == 'JOIN') {
|
||||
$subresult['queryflags']['join'] = 1;
|
||||
}
|
||||
|
||||
if ($upper_data == 'OFFSET') {
|
||||
$subresult['queryflags']['offset'] = 1;
|
||||
}
|
||||
|
||||
// if this is a real SELECT...FROM
|
||||
if ($upper_data == 'FROM' && isset($subresult['queryflags']['select_from']) && $subresult['queryflags']['select_from'] == 1) {
|
||||
$in_from = TRUE;
|
||||
$from_clause = '';
|
||||
$in_select_expr = FALSE;
|
||||
}
|
||||
|
||||
|
||||
// TODO: verify C-style comments?
|
||||
if ($arr[$i]['type'] == 'comment_ansi') {
|
||||
$collect_section_before_limit = FALSE;
|
||||
}
|
||||
// (we could have less resetting of variables to FALSE
|
||||
// if we trust that the query respects the standard
|
||||
// MySQL order for clauses)
|
||||
|
||||
if ($arr[$i]['type'] == 'alpha_reservedWord') {
|
||||
$upper_data = strtoupper($arr[$i]['data']);
|
||||
if (!$seen_reserved_word) {
|
||||
$first_reserved_word = $upper_data;
|
||||
$subresult['querytype'] = $upper_data;
|
||||
$seen_reserved_word = TRUE;
|
||||
// we use $seen_group and $seen_order because we are looking
|
||||
// for the BY
|
||||
if ($upper_data == 'GROUP') {
|
||||
$seen_group = TRUE;
|
||||
$seen_order = FALSE;
|
||||
$in_having = FALSE;
|
||||
$in_order_by = FALSE;
|
||||
$in_where = FALSE;
|
||||
$in_select_expr = FALSE;
|
||||
$in_from = FALSE;
|
||||
}
|
||||
if ($upper_data == 'ORDER' && !$in_group_concat) {
|
||||
$seen_order = TRUE;
|
||||
$seen_group = FALSE;
|
||||
$in_having = FALSE;
|
||||
$in_group_by = FALSE;
|
||||
$in_where = FALSE;
|
||||
$in_select_expr = FALSE;
|
||||
$in_from = FALSE;
|
||||
}
|
||||
if ($upper_data == 'HAVING') {
|
||||
$in_having = TRUE;
|
||||
$having_clause = '';
|
||||
$seen_group = FALSE;
|
||||
$seen_order = FALSE;
|
||||
$in_group_by = FALSE;
|
||||
$in_order_by = FALSE;
|
||||
$in_where = FALSE;
|
||||
$in_select_expr = FALSE;
|
||||
$in_from = FALSE;
|
||||
}
|
||||
|
||||
// if the first reserved word is DROP or DELETE,
|
||||
// we know this is a query that needs to be confirmed
|
||||
if ($first_reserved_word=='DROP'
|
||||
|| $first_reserved_word == 'DELETE'
|
||||
|| $first_reserved_word == 'TRUNCATE') {
|
||||
$subresult['queryflags']['need_confirm'] = 1;
|
||||
}
|
||||
if ($upper_data == 'WHERE') {
|
||||
$in_where = TRUE;
|
||||
$where_clause = '';
|
||||
$where_clause_identifiers = array();
|
||||
$seen_group = FALSE;
|
||||
$seen_order = FALSE;
|
||||
$in_group_by = FALSE;
|
||||
$in_order_by = FALSE;
|
||||
$in_having = FALSE;
|
||||
$in_select_expr = FALSE;
|
||||
$in_from = FALSE;
|
||||
}
|
||||
|
||||
if ($first_reserved_word=='SELECT'){
|
||||
$position_of_first_select = $i;
|
||||
}
|
||||
if ($upper_data == 'BY') {
|
||||
if ($seen_group) {
|
||||
$in_group_by = TRUE;
|
||||
$group_by_clause = '';
|
||||
}
|
||||
if ($seen_order) {
|
||||
$in_order_by = TRUE;
|
||||
$order_by_clause = '';
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($upper_data=='DROP' && $first_reserved_word=='ALTER') {
|
||||
$subresult['queryflags']['need_confirm'] = 1;
|
||||
}
|
||||
}
|
||||
// if we find one of the words that could end the clause
|
||||
if (PMA_STR_binarySearchInArr($upper_data, $words_ending_clauses, $words_ending_clauses_cnt)) {
|
||||
|
||||
if ($upper_data == 'PROCEDURE') {
|
||||
$collect_section_before_limit = FALSE;
|
||||
}
|
||||
// TODO: set also to FALSE if we find
|
||||
// FOR UPDATE
|
||||
// LOCK IN SHARE MODE
|
||||
$in_group_by = FALSE;
|
||||
$in_order_by = FALSE;
|
||||
$in_having = FALSE;
|
||||
$in_where = FALSE;
|
||||
$in_select_expr = FALSE;
|
||||
$in_from = FALSE;
|
||||
}
|
||||
|
||||
if ($upper_data == 'SELECT') {
|
||||
$in_select_expr = TRUE;
|
||||
$select_expr_clause = '';
|
||||
}
|
||||
if ($upper_data == 'DISTINCT' && !$in_group_concat) {
|
||||
$subresult['queryflags']['distinct'] = 1;
|
||||
}
|
||||
|
||||
if ($upper_data == 'UNION') {
|
||||
$subresult['queryflags']['union'] = 1;
|
||||
}
|
||||
|
||||
if ($upper_data == 'JOIN') {
|
||||
$subresult['queryflags']['join'] = 1;
|
||||
}
|
||||
|
||||
if ($upper_data == 'OFFSET') {
|
||||
$subresult['queryflags']['offset'] = 1;
|
||||
}
|
||||
|
||||
// if this is a real SELECT...FROM
|
||||
if ($upper_data == 'FROM' && isset($subresult['queryflags']['select_from']) && $subresult['queryflags']['select_from'] == 1) {
|
||||
$in_from = TRUE;
|
||||
$from_clause = '';
|
||||
$in_select_expr = FALSE;
|
||||
}
|
||||
} // endif (reservedWord)
|
||||
|
||||
|
||||
// (we could have less resetting of variables to FALSE
|
||||
// if we trust that the query respects the standard
|
||||
// MySQL order for clauses)
|
||||
// do not add a blank after a function name
|
||||
/**
|
||||
* @todo can we combine loop 2 and loop 1? some code is repeated here...
|
||||
*/
|
||||
|
||||
// we use $seen_group and $seen_order because we are looking
|
||||
// for the BY
|
||||
if ($upper_data == 'GROUP') {
|
||||
$seen_group = TRUE;
|
||||
$seen_order = FALSE;
|
||||
$in_having = FALSE;
|
||||
$in_order_by = FALSE;
|
||||
$in_where = FALSE;
|
||||
$in_select_expr = FALSE;
|
||||
$in_from = FALSE;
|
||||
}
|
||||
if ($upper_data == 'ORDER' && !$in_group_concat) {
|
||||
$seen_order = TRUE;
|
||||
$seen_group = FALSE;
|
||||
$in_having = FALSE;
|
||||
$in_group_by = FALSE;
|
||||
$in_where = FALSE;
|
||||
$in_select_expr = FALSE;
|
||||
$in_from = FALSE;
|
||||
}
|
||||
if ($upper_data == 'HAVING') {
|
||||
$in_having = TRUE;
|
||||
$having_clause = '';
|
||||
$seen_group = FALSE;
|
||||
$seen_order = FALSE;
|
||||
$in_group_by = FALSE;
|
||||
$in_order_by = FALSE;
|
||||
$in_where = FALSE;
|
||||
$in_select_expr = FALSE;
|
||||
$in_from = FALSE;
|
||||
}
|
||||
$sep = ' ';
|
||||
if ($arr[$i]['type'] == 'alpha_functionName') {
|
||||
$sep='';
|
||||
$upper_data = strtoupper($arr[$i]['data']);
|
||||
if ($upper_data =='GROUP_CONCAT') {
|
||||
$in_group_concat = TRUE;
|
||||
$number_of_brackets_in_group_concat = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($upper_data == 'WHERE') {
|
||||
$in_where = TRUE;
|
||||
$where_clause = '';
|
||||
$where_clause_identifiers = array();
|
||||
$seen_group = FALSE;
|
||||
$seen_order = FALSE;
|
||||
$in_group_by = FALSE;
|
||||
$in_order_by = FALSE;
|
||||
$in_having = FALSE;
|
||||
$in_select_expr = FALSE;
|
||||
$in_from = FALSE;
|
||||
}
|
||||
if ($arr[$i]['type'] == 'punct_bracket_open_round') {
|
||||
if ($in_group_concat) {
|
||||
$number_of_brackets_in_group_concat++;
|
||||
}
|
||||
}
|
||||
if ($arr[$i]['type'] == 'punct_bracket_close_round') {
|
||||
if ($in_group_concat) {
|
||||
$number_of_brackets_in_group_concat--;
|
||||
if ($number_of_brackets_in_group_concat == 0) {
|
||||
$in_group_concat = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($upper_data == 'BY') {
|
||||
if ($seen_group) {
|
||||
$in_group_by = TRUE;
|
||||
$group_by_clause = '';
|
||||
}
|
||||
if ($seen_order) {
|
||||
$in_order_by = TRUE;
|
||||
$order_by_clause = '';
|
||||
}
|
||||
}
|
||||
if ($in_select_expr && $upper_data != 'SELECT' && $upper_data != 'DISTINCT') {
|
||||
$select_expr_clause .= $arr[$i]['data'] . $sep;
|
||||
}
|
||||
if ($in_from && $upper_data != 'FROM') {
|
||||
$from_clause .= $arr[$i]['data'] . $sep;
|
||||
}
|
||||
if ($in_group_by && $upper_data != 'GROUP' && $upper_data != 'BY') {
|
||||
$group_by_clause .= $arr[$i]['data'] . $sep;
|
||||
}
|
||||
if ($in_order_by && $upper_data != 'ORDER' && $upper_data != 'BY') {
|
||||
// add a space only before ASC or DESC
|
||||
// not around the dot between dbname and tablename
|
||||
if ($arr[$i]['type'] == 'alpha_reservedWord') {
|
||||
$order_by_clause .= $sep;
|
||||
}
|
||||
$order_by_clause .= $arr[$i]['data'];
|
||||
}
|
||||
if ($in_having && $upper_data != 'HAVING') {
|
||||
$having_clause .= $arr[$i]['data'] . $sep;
|
||||
}
|
||||
if ($in_where && $upper_data != 'WHERE') {
|
||||
$where_clause .= $arr[$i]['data'] . $sep;
|
||||
|
||||
// if we find one of the words that could end the clause
|
||||
if (PMA_STR_binarySearchInArr($upper_data, $words_ending_clauses, $words_ending_clauses_cnt)) {
|
||||
if (($arr[$i]['type'] == 'quote_backtick')
|
||||
|| ($arr[$i]['type'] == 'alpha_identifier')) {
|
||||
$where_clause_identifiers[] = $arr[$i]['data'];
|
||||
}
|
||||
}
|
||||
|
||||
$in_group_by = FALSE;
|
||||
$in_order_by = FALSE;
|
||||
$in_having = FALSE;
|
||||
$in_where = FALSE;
|
||||
$in_select_expr = FALSE;
|
||||
$in_from = FALSE;
|
||||
}
|
||||
|
||||
} // endif (reservedWord)
|
||||
|
||||
|
||||
// do not add a blank after a function name
|
||||
// TODO: can we combine loop 2 and loop 1?
|
||||
// some code is repeated here...
|
||||
|
||||
$sep=' ';
|
||||
if ($arr[$i]['type'] == 'alpha_functionName') {
|
||||
$sep='';
|
||||
$upper_data = strtoupper($arr[$i]['data']);
|
||||
if ($upper_data =='GROUP_CONCAT') {
|
||||
$in_group_concat = TRUE;
|
||||
$number_of_brackets_in_group_concat = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($arr[$i]['type'] == 'punct_bracket_open_round') {
|
||||
if ($in_group_concat) {
|
||||
$number_of_brackets_in_group_concat++;
|
||||
}
|
||||
}
|
||||
if ($arr[$i]['type'] == 'punct_bracket_close_round') {
|
||||
if ($in_group_concat) {
|
||||
$number_of_brackets_in_group_concat--;
|
||||
if ($number_of_brackets_in_group_concat == 0) {
|
||||
$in_group_concat = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($in_select_expr && $upper_data != 'SELECT' && $upper_data != 'DISTINCT') {
|
||||
$select_expr_clause .= $arr[$i]['data'] . $sep;
|
||||
}
|
||||
if ($in_from && $upper_data != 'FROM') {
|
||||
$from_clause .= $arr[$i]['data'] . $sep;
|
||||
}
|
||||
if ($in_group_by && $upper_data != 'GROUP' && $upper_data != 'BY') {
|
||||
$group_by_clause .= $arr[$i]['data'] . $sep;
|
||||
}
|
||||
if ($in_order_by && $upper_data != 'ORDER' && $upper_data != 'BY') {
|
||||
// add a space only before ASC or DESC
|
||||
// not around the dot between dbname and tablename
|
||||
if ($arr[$i]['type'] == 'alpha_reservedWord') {
|
||||
$order_by_clause .= $sep;
|
||||
}
|
||||
$order_by_clause .= $arr[$i]['data'];
|
||||
}
|
||||
if ($in_having && $upper_data != 'HAVING') {
|
||||
$having_clause .= $arr[$i]['data'] . $sep;
|
||||
}
|
||||
if ($in_where && $upper_data != 'WHERE') {
|
||||
$where_clause .= $arr[$i]['data'] . $sep;
|
||||
|
||||
if (($arr[$i]['type'] == 'quote_backtick')
|
||||
|| ($arr[$i]['type'] == 'alpha_identifier')) {
|
||||
$where_clause_identifiers[] = $arr[$i]['data'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($subresult['queryflags']['select_from'])
|
||||
if (isset($subresult['queryflags']['select_from'])
|
||||
&& $subresult['queryflags']['select_from'] == 1
|
||||
&& !$seen_order) {
|
||||
$unsorted_query .= $arr[$i]['data'];
|
||||
$unsorted_query .= $arr[$i]['data'];
|
||||
|
||||
if ($arr[$i]['type'] != 'punct_bracket_open_round'
|
||||
&& $arr[$i]['type'] != 'punct_bracket_close_round'
|
||||
&& $arr[$i]['type'] != 'punct') {
|
||||
$unsorted_query .= $sep;
|
||||
}
|
||||
}
|
||||
if ($arr[$i]['type'] != 'punct_bracket_open_round'
|
||||
&& $arr[$i]['type'] != 'punct_bracket_close_round'
|
||||
&& $arr[$i]['type'] != 'punct') {
|
||||
$unsorted_query .= $sep;
|
||||
}
|
||||
}
|
||||
|
||||
// clear $upper_data for next iteration
|
||||
$upper_data='';
|
||||
// clear $upper_data for next iteration
|
||||
$upper_data='';
|
||||
|
||||
if ($collect_section_before_limit && $arr[$i]['type'] != 'punct_queryend') {
|
||||
$section_before_limit .= $arr[$i]['data'] . $sep;
|
||||
} else {
|
||||
$section_after_limit .= $arr[$i]['data'] . $sep;
|
||||
}
|
||||
if ($collect_section_before_limit && $arr[$i]['type'] != 'punct_queryend') {
|
||||
$section_before_limit .= $arr[$i]['data'] . $sep;
|
||||
} else {
|
||||
$section_after_limit .= $arr[$i]['data'] . $sep;
|
||||
}
|
||||
|
||||
|
||||
} // end for $i (loop #2)
|
||||
@@ -1712,8 +1730,9 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
// note: the "or" part here is a workaround for a bug
|
||||
// (see FIXME-2005-10-16)
|
||||
/**
|
||||
* @see @todo 2005-10-16 note: the "or" part here is a workaround for a bug
|
||||
*/
|
||||
if (($arr[$i]['type'] == 'alpha_columnType') || ($arr[$i]['type'] == 'alpha_functionName' && $seen_create_table)) {
|
||||
$upper_data = strtoupper($arr[$i]['data']);
|
||||
if ($seen_create_table && $in_create_table_fields && isset($current_identifier)) {
|
||||
@@ -1835,6 +1854,8 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
/**
|
||||
* Colorizes SQL queries html formatted
|
||||
*
|
||||
* @todo check why adding a "\n" after the </span> would cause extra blanks
|
||||
* to be displayed: SELECT p . person_name
|
||||
* @param array The SQL queries html formatted
|
||||
*
|
||||
* @return array The colorized SQL queries
|
||||
@@ -1851,10 +1872,6 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
|
||||
$class .= 'syntax_' . $arr['type'];
|
||||
|
||||
//TODO: check why adding a "\n" after the </span> would cause extra
|
||||
// blanks to be displayed:
|
||||
// SELECT p . person_name
|
||||
|
||||
return '<span class="' . $class . '">' . htmlspecialchars($arr['data']) . '</span>';
|
||||
} // end of the "PMA_SQP_formatHtml_colorize()" function
|
||||
|
||||
@@ -2137,8 +2154,9 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
// the quote_single exception is there to
|
||||
// catch cases like
|
||||
// GRANT ... TO 'marc'@'domain.com' IDENTIFIED...
|
||||
//
|
||||
// TODO: fix all cases and find why this happens
|
||||
/**
|
||||
* @todo fix all cases and find why this happens
|
||||
*/
|
||||
|
||||
if (!$in_priv_list || $typearr[1] == 'alpha_identifier' || $typearr[1] == 'quote_single' || $typearr[1] == 'white_newline') {
|
||||
$before .= $space_alpha_reserved_word;
|
||||
@@ -2201,7 +2219,9 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
case 'digit_integer':
|
||||
case 'digit_float':
|
||||
case 'digit_hex':
|
||||
//TODO: could there be other types preceding a digit?
|
||||
/**
|
||||
* @todo could there be other types preceding a digit?
|
||||
*/
|
||||
if ($typearr[1] == 'alpha_reservedWord') {
|
||||
$after .= ' ';
|
||||
}
|
||||
@@ -2335,6 +2355,7 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
/**
|
||||
* Gets SQL queries in text format
|
||||
*
|
||||
* @todo WRITE THIS!
|
||||
* @param array The SQL queries list
|
||||
*
|
||||
* @return string The SQL queries in text format
|
||||
@@ -2343,9 +2364,6 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
||||
*/
|
||||
function PMA_SQP_formatText($arr)
|
||||
{
|
||||
/**
|
||||
* TODO WRITE THIS!
|
||||
*/
|
||||
return PMA_SQP_formatNone($arr);
|
||||
} // end of the "PMA_SQP_formatText()" function
|
||||
} // end if: minimal common.lib needed?
|
||||
|
@@ -7,7 +7,7 @@ require_once './libraries/Table.class.php';
|
||||
/**
|
||||
* extracts table properties from create statement
|
||||
*
|
||||
* @TODO this should be recoded as functions,
|
||||
* @todo this should be recoded as functions,
|
||||
* to avoid messing with global variables
|
||||
*/
|
||||
|
||||
|
6
main.php
6
main.php
@@ -191,7 +191,11 @@ if ($server > 0) {
|
||||
PMA_printListItem($strImport, 'li_import',
|
||||
'./server_import.php?' . $common_url_query);
|
||||
|
||||
// Change password (TODO ? needs another message)
|
||||
/**
|
||||
* Change password
|
||||
*
|
||||
* @todo ? needs another message
|
||||
*/
|
||||
if ($cfg['ShowChgPassword']) {
|
||||
PMA_printListItem($strChangePassword, 'li_change_password',
|
||||
'./user_password.php?' . $common_url_query);
|
||||
|
@@ -1265,7 +1265,9 @@ function PMA_RT_DOC($alltables)
|
||||
$comments_width = 67;
|
||||
} else {
|
||||
// this is really intended for 'letter'
|
||||
// TODO: find optimal width for all formats
|
||||
/**
|
||||
* @todo find optimal width for all formats
|
||||
*/
|
||||
$comments_width = 50;
|
||||
}
|
||||
$pdf->Cell($comments_width, 8, ucfirst($GLOBALS['strComments']), 1, 0, 'C');
|
||||
|
@@ -34,10 +34,10 @@ echo '<h2>' . "\n"
|
||||
|
||||
|
||||
/**
|
||||
* Checks the MySQL version
|
||||
* exits if wrong MySQL version
|
||||
* @todo Some nice Message :-)
|
||||
*/
|
||||
if (PMA_MYSQL_INT_VERSION < 40100) {
|
||||
// TODO: Some nice Message :-)
|
||||
require_once('./libraries/footer.inc.php');
|
||||
}
|
||||
|
||||
|
@@ -783,7 +783,9 @@ if (!empty($adduser_submit) || !empty($change_copy)) {
|
||||
$create_user_show = $create_user_real;
|
||||
}
|
||||
}
|
||||
// FIXME: similar code appears twice in this script
|
||||
/**
|
||||
* @todo similar code appears twice in this script
|
||||
*/
|
||||
if ((isset($Grant_priv) && $Grant_priv == 'Y') || (PMA_MYSQL_INT_VERSION >= 40002 && (isset($max_questions) || isset($max_connections) || isset($max_updates) || isset($max_user_connections)))) {
|
||||
$real_sql_query .= 'WITH';
|
||||
$sql_query .= 'WITH';
|
||||
@@ -989,7 +991,9 @@ if (!empty($update_privs)) {
|
||||
. ' ON ' . $db_and_table
|
||||
. ' TO \'' . PMA_sqlAddslashes($username) . '\'@\'' . $hostname . '\'';
|
||||
|
||||
// FIXME: similar code appears twice in this script
|
||||
/**
|
||||
* @todo similar code appears twice in this script
|
||||
*/
|
||||
if ( ( isset($Grant_priv) && $Grant_priv == 'Y')
|
||||
|| ( ( ! isset($dbname) || ! strlen($dbname) ) && PMA_MYSQL_INT_VERSION >= 40002
|
||||
&& ( isset($max_questions) || isset($max_connections)
|
||||
|
@@ -165,7 +165,9 @@ if ($abort == FALSE) {
|
||||
$selected_cnt = count($selected);
|
||||
}
|
||||
|
||||
// TODO: optimize in case of multiple fields to modify
|
||||
/**
|
||||
* @todo optimize in case of multiple fields to modify
|
||||
*/
|
||||
for ($i = 0; $i < $selected_cnt; $i++) {
|
||||
if (!empty($submit_mult)) {
|
||||
$field = PMA_sqlAddslashes(urldecode($selected[$i]), TRUE);
|
||||
@@ -184,8 +186,10 @@ if ($abort == FALSE) {
|
||||
// but later, if the analyser returns more information, it
|
||||
// could be executed for any MySQL version and replace
|
||||
// the info given by SHOW FULL FIELDS FROM.
|
||||
// TODO: put this code into a require()
|
||||
// or maybe make it part of PMA_DBI_get_fields();
|
||||
/**
|
||||
* @todo put this code into a require()
|
||||
* or maybe make it part of PMA_DBI_get_fields();
|
||||
*/
|
||||
|
||||
// We also need this to correctly learn if a TIMESTAMP is NOT NULL, since
|
||||
// SHOW FULL FIELDS says NULL and SHOW CREATE TABLE says NOT NULL (tested
|
||||
|
@@ -80,7 +80,9 @@ if (!empty($disp_message)) {
|
||||
if (empty($goto)) {
|
||||
$goto = 'db_details.php';
|
||||
}
|
||||
// TODO: check if we could replace by "db_details|tbl"
|
||||
/**
|
||||
* @todo check if we could replace by "db_details|tbl"
|
||||
*/
|
||||
if (!preg_match('@^(db_details|tbl_properties|tbl_select|tbl_import)@', $goto)) {
|
||||
$err_url = $goto . "?" . PMA_generate_common_url($db) . "&sql_query=" . urlencode($sql_query);
|
||||
} else {
|
||||
@@ -808,7 +810,10 @@ foreach ($loop_array AS $vrowcount => $vrow) {
|
||||
echo '<input type="file" name="fields_upload_' . urlencode($field) . $vkey . '" class="textfield" id="field_' . ($idindex) . '_3" size="10" /> ';
|
||||
|
||||
// find maximum upload size, based on field type
|
||||
// FIXME: with functions this is not so easy, as you can basically process any data with function like MD5
|
||||
/**
|
||||
* @todo with functions this is not so easy, as you can basically
|
||||
* process any data with function like MD5
|
||||
*/
|
||||
$max_field_sizes = array(
|
||||
'tinyblob' => '256',
|
||||
'blob' => '65536',
|
||||
|
@@ -220,10 +220,12 @@ foreach ($the_tables as $key => $table) {
|
||||
// here, we have a TIMESTAMP that SHOW FULL FIELDS reports as having the
|
||||
// NULL attribute, but SHOW CREATE TABLE says the contrary. Believe
|
||||
// the latter.
|
||||
// TODO: merge this logic with the one in tbl_properties_structure.php
|
||||
// or move it in a function similar to PMA_DBI_get_columns_full()
|
||||
// but based on SHOW CREATE TABLE because information_schema
|
||||
// cannot be trusted in this case (MySQL bug)
|
||||
/**
|
||||
* @todo merge this logic with the one in tbl_properties_structure.php
|
||||
* or move it in a function similar to PMA_DBI_get_columns_full()
|
||||
* but based on SHOW CREATE TABLE because information_schema
|
||||
* cannot be trusted in this case (MySQL bug)
|
||||
*/
|
||||
if (!empty($analyzed_sql[0]['create_table_fields'][$field_name]['type']) && $analyzed_sql[0]['create_table_fields'][$field_name]['type'] == 'TIMESTAMP' && $analyzed_sql[0]['create_table_fields'][$field_name]['timestamp_not_null']) {
|
||||
$row['Null'] = '';
|
||||
}
|
||||
|
@@ -276,8 +276,9 @@ if ($total_affected_rows != 0) {
|
||||
$message .= $last_message;
|
||||
|
||||
if (!empty($warning_message)) {
|
||||
// TODO: use a <div class="warning"> in PMA_showMessage()
|
||||
// for this part of the message
|
||||
/**
|
||||
* @todo use a <div class="warning"> in PMA_showMessage() for this part of the message
|
||||
*/
|
||||
$message .= '[br]' . $warning_message;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user