bug [export] Exporting results of a query which contains a LIMIT clause inside a subquery

This commit is contained in:
Marc Delisle
2009-08-29 11:41:26 +00:00
parent 3d519b86f9
commit b4f776e34c
17 changed files with 602 additions and 507 deletions

View File

@@ -5,7 +5,16 @@ phpMyAdmin - ChangeLog
$Id$ $Id$
$HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/ChangeLog $ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/ChangeLog $
3.2.1.0 (not yet released) 3.2.2.0 (not yet released)
- bug #2825293 [structure] Default value for a BIT column
- bug [display] Red arrows were reversed in the list of tables
- bug #2813879 [export] Duplicate empty lines when exporting without comments
- bug #2825919 [export] Trigger export with database name
- bug #2823996 [data] Cannot edit row with no PK and a BIT field
- bug [export] Exporting results of a query which contains a LIMIT clause
inside a subquery
3.2.1.0 (2009-08-09)
- bug #2799009 Login with ipv6 IP address breaks redirect - bug #2799009 Login with ipv6 IP address breaks redirect
- bug #2796066 [priv] Inconsistent display of databases list - bug #2796066 [priv] Inconsistent display of databases list
- bug #2802870 [display] Incorrect overhead value for InnoDB - bug #2802870 [display] Incorrect overhead value for InnoDB
@@ -24,6 +33,15 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- bug #2819944 [setup] Incorrect mention of designer_coords - bug #2819944 [setup] Incorrect mention of designer_coords
- bug #2821757 [insert] "Insert another new row" no longer worked - bug #2821757 [insert] "Insert another new row" no longer worked
+ [lang] Norwegian update, thanks to Sven-Erik Andersen + [lang] Norwegian update, thanks to Sven-Erik Andersen
- bug [core] PMA_pow() can support negative exponents in the pow() case
+ [lang] Brazilian Portuguese update, thanks to Fabio Bucior - fabiobucior
- patch #2822384 [docs] Missing auth_type in docs-example,
thanks to Jürgen Wind - windkiel
- patch #2819728 [display] Slider effect jumping to top of page,
thanks to Jan Radem - summsel
- bug [display] Incorrect computation of overhead stats in server view
for tables under the InnoDB engine
+ [lang] Swedish update, thanks to Björn T. Hallberg
3.2.0.1 (2009-06-30) 3.2.0.1 (2009-06-30)
- [security] XSS: Insufficient output sanitizing in bookmarks - [security] XSS: Insufficient output sanitizing in bookmarks

View File

@@ -10,7 +10,7 @@
<link rel="icon" href="./favicon.ico" type="image/x-icon" /> <link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>phpMyAdmin 3.2.1-dev - Documentation</title> <title>phpMyAdmin 3.2.2-dev - Documentation</title>
<link rel="stylesheet" type="text/css" href="docs.css" /> <link rel="stylesheet" type="text/css" href="docs.css" />
</head> </head>
@@ -18,7 +18,7 @@
<div id="header"> <div id="header">
<h1> <h1>
<a href="http://www.phpmyadmin.net/">php<span class="myadmin">MyAdmin</span></a> <a href="http://www.phpmyadmin.net/">php<span class="myadmin">MyAdmin</span></a>
3.2.1-dev 3.2.2-dev
Documentation Documentation
</h1> </h1>
</div> </div>
@@ -235,6 +235,7 @@ $i=0;
$i++; $i++;
$cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'cbb74bc'; // use here your password $cfg['Servers'][$i]['password'] = 'cbb74bc'; // use here your password
$cfg['Servers'][$i]['auth_type'] = 'config';
?&gt; ?&gt;
</pre> </pre>
For a full explanation of possible configuration values, see the For a full explanation of possible configuration values, see the

2
README
View File

@@ -5,7 +5,7 @@ phpMyAdmin - Readme
A set of PHP-scripts to manage MySQL over the web. A set of PHP-scripts to manage MySQL over the web.
Version 3.2.1-dev Version 3.2.2-dev
----------------- -----------------
http://www.phpmyadmin.net/ http://www.phpmyadmin.net/

View File

@@ -117,7 +117,6 @@ function PMA_TableHeader($db_is_information_schema = false)
$GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3; $GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3;
} // end function PMA_TableHeader() } // end function PMA_TableHeader()
/** /**
* Creates a clickable column header for table information * Creates a clickable column header for table information
* *
@@ -130,7 +129,7 @@ function PMA_SortableTableHeader($title, $sort)
// Set some defaults // Set some defaults
$requested_sort = 'table'; $requested_sort = 'table';
$requested_sort_order = 'ASC'; $requested_sort_order = 'ASC';
$sort_order = 'ASC'; $future_sort_order = 'ASC';
// If the user requested a sort // If the user requested a sort
if (isset($_REQUEST['sort'])) { if (isset($_REQUEST['sort'])) {
@@ -148,14 +147,20 @@ function PMA_SortableTableHeader($title, $sort)
// If this column was requested to be sorted. // If this column was requested to be sorted.
if ($requested_sort == $sort) { if ($requested_sort == $sort) {
if ($requested_sort_order == 'ASC') { if ($requested_sort_order == 'ASC') {
$sort_order = 'DESC'; $future_sort_order = 'DESC';
$order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_desc.png" width="11" height="9" alt="'. $GLOBALS['strDescending'] . '" title="'. $GLOBALS['strDescending'] . '" id="sort_arrow" />'; // current sort order is ASC
$order_link_params['onmouseover'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_asc.png\'; }';
$order_link_params['onmouseout'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
} else {
$order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_asc.png" width="11" height="9" alt="'. $GLOBALS['strAscending'] . '" title="'. $GLOBALS['strAscending'] . '" id="sort_arrow" />'; $order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_asc.png" width="11" height="9" alt="'. $GLOBALS['strAscending'] . '" title="'. $GLOBALS['strAscending'] . '" id="sort_arrow" />';
// but on mouse over, show the reverse order (DESC)
$order_link_params['onmouseover'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }'; $order_link_params['onmouseover'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
// on mouse out, show current sort order (ASC)
$order_link_params['onmouseout'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_asc.png\'; }'; $order_link_params['onmouseout'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_asc.png\'; }';
} else {
// current sort order is DESC
$order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_desc.png" width="11" height="9" alt="'. $GLOBALS['strDescending'] . '" title="'. $GLOBALS['strDescending'] . '" id="sort_arrow" />';
// but on mouse over, show the reverse order (ASC)
$order_link_params['onmouseover'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_asc.png\'; }';
// on mouse out, show current sort order (DESC)
$order_link_params['onmouseout'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
} }
} }
@@ -165,10 +170,11 @@ function PMA_SortableTableHeader($title, $sort)
$url = 'db_structure.php'.PMA_generate_common_url($_url_params); $url = 'db_structure.php'.PMA_generate_common_url($_url_params);
// We set the position back to 0 every time they sort. // We set the position back to 0 every time they sort.
$url .= "&amp;pos=0&amp;sort=$sort&amp;sort_order=$sort_order"; $url .= "&amp;pos=0&amp;sort=$sort&amp;sort_order=$future_sort_order";
return PMA_linkOrButton($url, $title . $order_img, $order_link_params); return PMA_linkOrButton($url, $title . $order_img, $order_link_params);
} } // end function PMA_SortableTableHeader()
$titles = array(); $titles = array();
if (true == $cfg['PropertiesIconic']) { if (true == $cfg['PropertiesIconic']) {

File diff suppressed because it is too large Load Diff

View File

@@ -1026,9 +1026,9 @@ $strSetupServers_auth_swekey_config_desc = 'Sökväg till konfigurationsfilen f
$strSetupServers_auth_swekey_config_name = 'SweKey konfigurationsfil'; $strSetupServers_auth_swekey_config_name = 'SweKey konfigurationsfil';
$strSetupServers_auth_type_desc = 'Autentiseringsmetod att använda'; $strSetupServers_auth_type_desc = 'Autentiseringsmetod att använda';
$strSetupServers_auth_type_name = 'Typ av autentisering'; $strSetupServers_auth_type_name = 'Typ av autentisering';
$strSetupServers_bookmarktable_desc = 'Lämna tomt för inget stöd för [a@http://wiki.phpmyadmin.net/pma/bookmark]bokmärken[/a], standard: [kbd]pma_bookmark[/kbd]'; $strSetupServers_bookmarktable_desc = 'Lämna tomt för inget stöd för [a@http://wiki.phpmyadmin.net/pma/bookmark]bokmärken[/a], förslag: [kbd]pma_bookmark[/kbd]';
$strSetupServers_bookmarktable_name = 'Tabell för bokmärken'; $strSetupServers_bookmarktable_name = 'Tabell för bokmärken';
$strSetupServers_column_info_desc = 'Lämna tomt för inget stöd för kolumnkommentarer/mime-typer, standard: [kbd]pma_column_info[/kbd]'; $strSetupServers_column_info_desc = 'Lämna tomt för inget stöd för kolumnkommentarer/mime-typer, förslag: [kbd]pma_column_info[/kbd]';
$strSetupServers_column_info_name = 'Tabell för kolumninformation'; $strSetupServers_column_info_name = 'Tabell för kolumninformation';
$strSetupServers_compress_desc = 'Komprimera anslutning till MySQL-servern'; $strSetupServers_compress_desc = 'Komprimera anslutning till MySQL-servern';
$strSetupServers_compress_name = 'Komprimera anslutning'; $strSetupServers_compress_name = 'Komprimera anslutning';
@@ -1039,7 +1039,7 @@ $strSetupServers_controluser_desc = 'En speciell MySQL-användare konfigurerad m
$strSetupServers_controluser_name = 'Kontrollanvändare'; $strSetupServers_controluser_name = 'Kontrollanvändare';
$strSetupServers_CountTables_desc = 'Räkna tabeller vid visning av databaslista'; $strSetupServers_CountTables_desc = 'Räkna tabeller vid visning av databaslista';
$strSetupServers_CountTables_name = 'Räkna tabeller'; $strSetupServers_CountTables_name = 'Räkna tabeller';
$strSetupServers_designer_coords_desc = 'Lämna tomt för inget stöd för Designer, standard: [kbd]pma_designer_coords[/kbd]'; $strSetupServers_designer_coords_desc = 'Lämna tomt för inget stöd för Designer, förslag: [kbd]pma_designer_coords[/kbd]';
$strSetupServers_designer_coords_name = 'Tabell för Designer'; $strSetupServers_designer_coords_name = 'Tabell för Designer';
$strSetupServers_DisableIS_desc = 'Mer information på [a@http://sf.net/support/tracker.php?aid=1849494]PMA bug tracker[/a] och [a@http://bugs.mysql.com/19588]MySQL Bugs[/a]'; $strSetupServers_DisableIS_desc = 'Mer information på [a@http://sf.net/support/tracker.php?aid=1849494]PMA bug tracker[/a] och [a@http://bugs.mysql.com/19588]MySQL Bugs[/a]';
$strSetupServers_DisableIS_name = 'Inaktivera användning av INFORMATION_SCHEMA'; $strSetupServers_DisableIS_name = 'Inaktivera användning av INFORMATION_SCHEMA';
@@ -1049,7 +1049,7 @@ $strSetupServers_extension_desc = 'Vilket PHP-tillägg som ska användas; du bö
$strSetupServers_extension_name = 'PHP-tillägg att använda'; $strSetupServers_extension_name = 'PHP-tillägg att använda';
$strSetupServers_hide_db_desc = 'Dölj databaser som matchar reguljärt uttryck (PCRE)'; $strSetupServers_hide_db_desc = 'Dölj databaser som matchar reguljärt uttryck (PCRE)';
$strSetupServers_hide_db_name = 'Dölj databaser'; $strSetupServers_hide_db_name = 'Dölj databaser';
$strSetupServers_history_desc = 'Lämna tomt för inget stöd för SQL-frågehistorik, standard: [kbd]pma_history[/kbd]'; $strSetupServers_history_desc = 'Lämna tomt för inget stöd för SQL-frågehistorik, förslag: [kbd]pma_history[/kbd]';
$strSetupServers_history_name = 'Tabell för SQL-frågehistorik'; $strSetupServers_history_name = 'Tabell för SQL-frågehistorik';
$strSetupServers_host_desc = 'Värdnamn där MySQL-servern körs'; $strSetupServers_host_desc = 'Värdnamn där MySQL-servern körs';
$strSetupServers_host_name = 'Serverns värdnamn'; $strSetupServers_host_name = 'Serverns värdnamn';
@@ -1060,13 +1060,13 @@ $strSetupServers_only_db_desc = 'Du kan använda MySQL:s jokertecken (% och _),
$strSetupServers_only_db_name = 'Visa endast listade databaser'; $strSetupServers_only_db_name = 'Visa endast listade databaser';
$strSetupServers_password_desc = 'Lämna tomt om inte autentisering config används'; $strSetupServers_password_desc = 'Lämna tomt om inte autentisering config används';
$strSetupServers_password_name = 'Löseenord för autentisering config'; $strSetupServers_password_name = 'Löseenord för autentisering config';
$strSetupServers_pdf_pages_desc = 'Lämna tomt för inget stöd för PDF-schema, standard: [kbd]pma_pdf_pages[/kbd]'; $strSetupServers_pdf_pages_desc = 'Lämna tomt för inget stöd för PDF-schema, förslag: [kbd]pma_pdf_pages[/kbd]';
$strSetupServers_pdf_pages_name = 'PDF-schema: Tabell för sidor'; $strSetupServers_pdf_pages_name = 'PDF-schema: Tabell för sidor';
$strSetupServers_pmadb_desc = 'Databas som används för relationer, bokmärken och PDF-funktioner. Se [a@http://wiki.phpmyadmin.net/pma/pmadb]pmadb[/a] för komplett information. Lämna tomt för utan stöd. Standard: [kbd]phpmyadmin[/kbd]'; $strSetupServers_pmadb_desc = 'Databas som används för relationer, bokmärken och PDF-funktioner. Se [a@http://wiki.phpmyadmin.net/pma/pmadb]pmadb[/a] för komplett information. Lämna tomt för utan stöd. Förslag: [kbd]phpmyadmin[/kbd]';
$strSetupServers_pmadb_name = 'PMA databas'; $strSetupServers_pmadb_name = 'PMA databas';
$strSetupServers_port_desc = 'Port som MySQL-servern lyssnar på, lämna tomt för standard'; $strSetupServers_port_desc = 'Port som MySQL-servern lyssnar på, lämna tomt för standard';
$strSetupServers_port_name = 'Serverport'; $strSetupServers_port_name = 'Serverport';
$strSetupServers_relation_desc = 'Lämna tomt för inget stöd för [a@http://wiki.phpmyadmin.net/pma/relation]relationslänkar[/a], standard: [kbd]pma_relation[/kbd]'; $strSetupServers_relation_desc = 'Lämna tomt för inget stöd för [a@http://wiki.phpmyadmin.net/pma/relation]relationslänkar[/a], förslag: [kbd]pma_relation[/kbd]';
$strSetupServers_relation_name = 'Tabell för relationer'; $strSetupServers_relation_name = 'Tabell för relationer';
$strSetupServers_ShowDatabasesCommand_desc = 'SQL-kommando för att hämta tillgängliga databaser'; $strSetupServers_ShowDatabasesCommand_desc = 'SQL-kommando för att hämta tillgängliga databaser';
$strSetupServers_ShowDatabasesCommand_name = 'SHOW DATABASES-kommando'; $strSetupServers_ShowDatabasesCommand_name = 'SHOW DATABASES-kommando';
@@ -1078,9 +1078,9 @@ $strSetupServers_socket_desc = 'Sockel som MySQL-servern lyssnar på, lämna tom
$strSetupServers_socket_name = 'Serversockel'; $strSetupServers_socket_name = 'Serversockel';
$strSetupServers_ssl_desc = ''; $strSetupServers_ssl_desc = '';
$strSetupServers_ssl_name = 'Använd SSL'; $strSetupServers_ssl_name = 'Använd SSL';
$strSetupServers_table_coords_desc = 'Lämna tomt för inget stöd för PDF-schema, standard: [kbd]pma_table_coords[/kbd]'; $strSetupServers_table_coords_desc = 'Lämna tomt för inget stöd för PDF-schema, förslag: [kbd]pma_table_coords[/kbd]';
$strSetupServers_table_coords_name = 'PDF-schema: tabellkoordinater'; $strSetupServers_table_coords_name = 'PDF-schema: tabellkoordinater';
$strSetupServers_table_info_desc = 'Tabell för att beskriva fält att visa, lämna tomt för inget stöd; standard: [kbd]pma_table_info[/kbd]'; $strSetupServers_table_info_desc = 'Tabell för att beskriva fält att visa, lämna tomt för inget stöd; förslag: [kbd]pma_table_info[/kbd]';
$strSetupServers_table_info_name = 'Tabell för visa fält'; $strSetupServers_table_info_name = 'Tabell för visa fält';
$strSetupServers_user_desc = 'Lämna tomt om inte autentisering config används'; $strSetupServers_user_desc = 'Lämna tomt om inte autentisering config används';
$strSetupServers_user_name = 'Användare för autentisering config'; $strSetupServers_user_name = 'Användare för autentisering config';
@@ -1457,5 +1457,4 @@ $strYes = 'Ja';
$strZeroRemovesTheLimit = 'Anm: Genom att sätta dessa alternativ till 0 (noll) tas begränsningarna bort.'; $strZeroRemovesTheLimit = 'Anm: Genom att sätta dessa alternativ till 0 (noll) tas begränsningarna bort.';
$strZip = '"zippad"'; $strZip = '"zippad"';
?> ?>

View File

@@ -92,7 +92,7 @@ class PMA_Config
*/ */
function checkSystem() function checkSystem()
{ {
$this->set('PMA_VERSION', '3.2.1-dev'); $this->set('PMA_VERSION', '3.2.2-dev');
/** /**
* @deprecated * @deprecated
*/ */

View File

@@ -24,10 +24,6 @@ function PMA_pow($base, $exp, $use_function = false)
{ {
static $pow_function = null; static $pow_function = null;
if ($exp < 0) {
return false;
}
if (null == $pow_function) { if (null == $pow_function) {
if (function_exists('bcpow')) { if (function_exists('bcpow')) {
// BCMath Arbitrary Precision Mathematics Function // BCMath Arbitrary Precision Mathematics Function
@@ -44,6 +40,9 @@ function PMA_pow($base, $exp, $use_function = false)
if (! $use_function) { if (! $use_function) {
$use_function = $pow_function; $use_function = $pow_function;
} }
if ($exp < 0 && 'pow' != $use_function) {
return false;
}
switch ($use_function) { switch ($use_function) {
case 'bcpow' : case 'bcpow' :
@@ -1449,8 +1448,9 @@ function PMA_formatNumber($value, $length = 3, $comma = 0, $only_down = false)
} // end for } // end for
} elseif (!$only_down && (float) $value !== 0.0) { } elseif (!$only_down && (float) $value !== 0.0) {
for ($d = -8; $d <= 8; $d++) { for ($d = -8; $d <= 8; $d++) {
if (isset($units[$d]) && $value <= $li * PMA_pow(1000, $d-1)) { // force using pow() because of the negative exponent
$value = round($value / (PMA_pow(1000, $d) / $dh)) /$dh; if (isset($units[$d]) && $value <= $li * PMA_pow(1000, $d-1, 'pow')) {
$value = round($value / (PMA_pow(1000, $d, 'pow') / $dh)) /$dh;
$unit = $units[$d]; $unit = $units[$d];
break 1; break 1;
} // end if } // end if
@@ -1899,6 +1899,7 @@ function PMA_checkParameters($params, $die = true, $request = true)
* @uses PMA_DBI_field_flags() * @uses PMA_DBI_field_flags()
* @uses PMA_backquote() * @uses PMA_backquote()
* @uses PMA_sqlAddslashes() * @uses PMA_sqlAddslashes()
* @uses PMA_printable_bit_value()
* @uses stristr() * @uses stristr()
* @uses bin2hex() * @uses bin2hex()
* @uses preg_replace() * @uses preg_replace()
@@ -1990,6 +1991,8 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force
// this blob won't be part of the final condition // this blob won't be part of the final condition
$condition = ''; $condition = '';
} }
} elseif ($meta->type == 'bit') {
$condition .= "= b'" . PMA_printable_bit_value($row[$i], $meta->length) . "' AND";
} else { } else {
$condition .= '= \'' $condition .= '= \''
. PMA_sqlAddslashes($row[$i], false, true) . '\' AND'; . PMA_sqlAddslashes($row[$i], false, true) . '\' AND';
@@ -2419,7 +2422,7 @@ window.addEvent('domready', function(){
var anchor<?php echo $id; ?> = new Element('a', { var anchor<?php echo $id; ?> = new Element('a', {
'id': 'toggle_<?php echo $id; ?>', 'id': 'toggle_<?php echo $id; ?>',
'href': '#', 'href': 'javascript:void(0)',
'events': { 'events': {
'click': function(){ 'click': function(){
mySlide<?php echo $id; ?>.toggle(); mySlide<?php echo $id; ?>.toggle();
@@ -2546,6 +2549,18 @@ function PMA_printable_bit_value($value, $length) {
return $printable; return $printable;
} }
/**
* Converts a BIT type default value
* for example, b'010' becomes 010
*
* @uses strtr()
* @param string $bit_default_value
* @return string the converted value
*/
function PMA_convert_bit_default_value($bit_default_value) {
return strtr($bit_default_value, array("b" => "", "'" => ""));
}
/** /**
* Extracts the various parts from a field type spec * Extracts the various parts from a field type spec
* *

View File

@@ -616,8 +616,13 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false,
+= $row['Max_data_length']; += $row['Max_data_length'];
$databases[$database_name]['SCHEMA_INDEX_LENGTH'] $databases[$database_name]['SCHEMA_INDEX_LENGTH']
+= $row['Index_length']; += $row['Index_length'];
$databases[$database_name]['SCHEMA_DATA_FREE']
+= $row['Data_free']; // for InnoDB, this does not contain the number of
// overhead bytes but the total free space
if ('InnoDB' != $row['Engine']) {
$databases[$database_name]['SCHEMA_DATA_FREE']
+= $row['Data_free'];
}
$databases[$database_name]['SCHEMA_LENGTH'] $databases[$database_name]['SCHEMA_LENGTH']
+= $row['Data_length'] + $row['Index_length']; += $row['Data_length'] + $row['Index_length'];
} }
@@ -1330,9 +1335,11 @@ function PMA_DBI_get_triggers($db, $table)
$one_result['action_timing'] = $trigger['ACTION_TIMING']; $one_result['action_timing'] = $trigger['ACTION_TIMING'];
$one_result['event_manipulation'] = $trigger['EVENT_MANIPULATION']; $one_result['event_manipulation'] = $trigger['EVENT_MANIPULATION'];
$one_result['full_trigger_name'] = PMA_backquote($trigger['TRIGGER_SCHEMA']) . '.' . PMA_backquote($trigger['TRIGGER_NAME']); // do not prepend the schema name; this way, importing the
// definition into another schema will work
$one_result['full_trigger_name'] = PMA_backquote($trigger['TRIGGER_NAME']);
$one_result['drop'] = 'DROP TRIGGER IF EXISTS ' . $one_result['full_trigger_name']; $one_result['drop'] = 'DROP TRIGGER IF EXISTS ' . $one_result['full_trigger_name'];
$one_result['create'] = 'CREATE TRIGGER ' . $one_result['full_trigger_name'] . ' ' . $trigger['ACTION_TIMING']. ' ' . $trigger['EVENT_MANIPULATION'] . ' ON ' . PMA_backquote($trigger['EVENT_OBJECT_SCHEMA']) . '.' . PMA_backquote($trigger['EVENT_OBJECT_TABLE']) . "\n" . ' FOR EACH ROW ' . $trigger['ACTION_STATEMENT'] . "\n" . $delimiter . "\n"; $one_result['create'] = 'CREATE TRIGGER ' . $one_result['full_trigger_name'] . ' ' . $trigger['ACTION_TIMING']. ' ' . $trigger['EVENT_MANIPULATION'] . ' ON ' . PMA_backquote($trigger['EVENT_OBJECT_TABLE']) . "\n" . ' FOR EACH ROW ' . $trigger['ACTION_STATEMENT'] . "\n" . $delimiter . "\n";
$result[] = $one_result; $result[] = $one_result;
} }

View File

@@ -131,7 +131,7 @@ if (! isset($sql_backquotes)) {
} }
/** /**
* Outputs comment * Possibly outputs comment
* *
* @param string Text of comment * @param string Text of comment
* *
@@ -139,7 +139,7 @@ if (! isset($sql_backquotes)) {
*/ */
function PMA_exportComment($text = '') function PMA_exportComment($text = '')
{ {
if ($GLOBALS['sql_include_comments']) { if (isset($GLOBALS['sql_include_comments']) && $GLOBALS['sql_include_comments']) {
// see http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html // see http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html
return '--' . (empty($text) ? '' : ' ') . $text . $GLOBALS['crlf']; return '--' . (empty($text) ? '' : ' ') . $text . $GLOBALS['crlf'];
} else { } else {
@@ -147,6 +147,21 @@ function PMA_exportComment($text = '')
} }
} }
/**
* Possibly outputs CRLF
*
* @return string $crlf or nothing
*/
function PMA_possibleCRLF()
{
if (isset($GLOBALS['sql_include_comments']) && $GLOBALS['sql_include_comments']) {
return $GLOBALS['crlf'];
} else {
return '';
}
}
/** /**
* Outputs export footer * Outputs export footer
* *
@@ -162,11 +177,11 @@ function PMA_exportFooter()
$foot = ''; $foot = '';
if (isset($GLOBALS['sql_disable_fk'])) { if (isset($GLOBALS['sql_disable_fk'])) {
$foot .= $crlf . 'SET FOREIGN_KEY_CHECKS=1;' . $crlf; $foot .= 'SET FOREIGN_KEY_CHECKS=1;' . $crlf;
} }
if (isset($GLOBALS['sql_use_transaction'])) { if (isset($GLOBALS['sql_use_transaction'])) {
$foot .= $crlf . 'COMMIT;' . $crlf; $foot .= 'COMMIT;' . $crlf;
} }
// restore connection settings // restore connection settings
@@ -211,7 +226,8 @@ function PMA_exportHeader()
$head .= PMA_exportComment($GLOBALS['strGenTime'] $head .= PMA_exportComment($GLOBALS['strGenTime']
. ': ' . PMA_localisedDate()) . ': ' . PMA_localisedDate())
. PMA_exportComment($GLOBALS['strServerVersion'] . ': ' . substr(PMA_MYSQL_INT_VERSION, 0, 1) . '.' . (int) substr(PMA_MYSQL_INT_VERSION, 1, 2) . '.' . (int) substr(PMA_MYSQL_INT_VERSION, 3)) . PMA_exportComment($GLOBALS['strServerVersion'] . ': ' . substr(PMA_MYSQL_INT_VERSION, 0, 1) . '.' . (int) substr(PMA_MYSQL_INT_VERSION, 1, 2) . '.' . (int) substr(PMA_MYSQL_INT_VERSION, 3))
. PMA_exportComment($GLOBALS['strPHPVersion'] . ': ' . phpversion()); . PMA_exportComment($GLOBALS['strPHPVersion'] . ': ' . phpversion())
. PMA_possibleCRLF();
if (isset($GLOBALS['sql_header_comment']) && !empty($GLOBALS['sql_header_comment'])) { if (isset($GLOBALS['sql_header_comment']) && !empty($GLOBALS['sql_header_comment'])) {
// '\n' is not a newline (like "\n" would be), it's the characters // '\n' is not a newline (like "\n" would be), it's the characters
@@ -225,20 +241,20 @@ function PMA_exportHeader()
} }
if (isset($GLOBALS['sql_disable_fk'])) { if (isset($GLOBALS['sql_disable_fk'])) {
$head .= $crlf . 'SET FOREIGN_KEY_CHECKS=0;' . $crlf; $head .= 'SET FOREIGN_KEY_CHECKS=0;' . $crlf;
} }
/* We want exported AUTO_INCREMENT fields to have still same value, do this only for recent MySQL exports */ /* We want exported AUTO_INCREMENT fields to have still same value, do this only for recent MySQL exports */
if (!isset($GLOBALS['sql_compatibility']) || $GLOBALS['sql_compatibility'] == 'NONE') { if (!isset($GLOBALS['sql_compatibility']) || $GLOBALS['sql_compatibility'] == 'NONE') {
$head .= $crlf . 'SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";' . $crlf; $head .= 'SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";' . $crlf;
} }
if (isset($GLOBALS['sql_use_transaction'])) { if (isset($GLOBALS['sql_use_transaction'])) {
$head .= $crlf .'SET AUTOCOMMIT=0;' . $crlf $head .= 'SET AUTOCOMMIT=0;' . $crlf
. 'START TRANSACTION;' . $crlf; . 'START TRANSACTION;' . $crlf;
} }
$head .= $crlf; $head .= PMA_possibleCRLF();
if (! empty($GLOBALS['asfile'])) { if (! empty($GLOBALS['asfile'])) {
// we are saving as file, therefore we provide charset information // we are saving as file, therefore we provide charset information
@@ -684,7 +700,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_mim
} }
if (isset($mime_map) && count($mime_map) > 0) { if (isset($mime_map) && count($mime_map) > 0) {
$schema_create .= $crlf $schema_create .= PMA_possibleCRLF()
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strMIMETypesForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':'); . PMA_exportComment($GLOBALS['strMIMETypesForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':');
@reset($mime_map); @reset($mime_map);
@@ -696,7 +712,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_mim
} }
if ($have_rel) { if ($have_rel) {
$schema_create .= $crlf $schema_create .= PMA_possibleCRLF()
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strRelationsForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':'); . PMA_exportComment($GLOBALS['strRelationsForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':');
foreach ($res_rel AS $rel_field => $rel) { foreach ($res_rel AS $rel_field => $rel) {
@@ -737,9 +753,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = FALSE,
$formatted_table_name = (isset($GLOBALS['sql_backquotes'])) $formatted_table_name = (isset($GLOBALS['sql_backquotes']))
? PMA_backquote($table) ? PMA_backquote($table)
: '\'' . $table . '\''; : '\'' . $table . '\'';
$dump = $crlf $dump = PMA_possibleCRLF()
. PMA_exportComment(str_repeat('-', 56)) . PMA_exportComment(str_repeat('-', 56))
. $crlf . PMA_possibleCRLF()
. PMA_exportComment(); . PMA_exportComment();
switch($export_mode) { switch($export_mode) {
@@ -749,7 +765,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = FALSE,
$dump .= PMA_getTableDef($db, $table, $crlf, $error_url, $dates); $dump .= PMA_getTableDef($db, $table, $crlf, $error_url, $dates);
$triggers = PMA_DBI_get_triggers($db, $table); $triggers = PMA_DBI_get_triggers($db, $table);
if ($triggers) { if ($triggers) {
$dump .= $crlf $dump .= PMA_possibleCRLF()
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strTriggers'] . ' ' . $formatted_table_name) . PMA_exportComment($GLOBALS['strTriggers'] . ' ' . $formatted_table_name)
. PMA_exportComment(); . PMA_exportComment();
@@ -822,12 +838,12 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
// Do not export data for a VIEW // Do not export data for a VIEW
// (For a VIEW, this is called only when exporting a single VIEW) // (For a VIEW, this is called only when exporting a single VIEW)
if (PMA_Table::isView($db, $table)) { if (PMA_Table::isView($db, $table)) {
$head = $crlf $head = PMA_possibleCRLF()
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment('VIEW ' . ' ' . $formatted_table_name) . PMA_exportComment('VIEW ' . ' ' . $formatted_table_name)
. PMA_exportComment($GLOBALS['strData'] . ': ' . $GLOBALS['strNone']) . PMA_exportComment($GLOBALS['strData'] . ': ' . $GLOBALS['strNone'])
. PMA_exportComment() . PMA_exportComment()
. $crlf; . PMA_possibleCRLF();
if (! PMA_exportOutputHandler($head)) { if (! PMA_exportOutputHandler($head)) {
return FALSE; return FALSE;
@@ -836,11 +852,10 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
} }
// it's not a VIEW // it's not a VIEW
$head = $crlf $head = PMA_possibleCRLF()
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strDumpingData'] . ' ' . $formatted_table_name) . PMA_exportComment($GLOBALS['strDumpingData'] . ' ' . $formatted_table_name)
. PMA_exportComment() . PMA_exportComment();
. $crlf;
if (! PMA_exportOutputHandler($head)) { if (! PMA_exportOutputHandler($head)) {
return FALSE; return FALSE;
@@ -861,6 +876,13 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
} }
if ($result != FALSE) { if ($result != FALSE) {
// emit a single CRLF before the first data statement (produces
// an unintended CRLF when there is no data, but I don't see how it
// can be avoided, as we are in UNBUFFERED mode)
if (! PMA_exportOutputHandler($crlf)) {
return FALSE;
}
$fields_cnt = PMA_DBI_num_fields($result); $fields_cnt = PMA_DBI_num_fields($result);
// Get field information // Get field information

View File

@@ -1455,6 +1455,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$first_reserved_word = ''; $first_reserved_word = '';
$current_identifier = ''; $current_identifier = '';
$unsorted_query = $arr['raw']; // in case there is no ORDER BY $unsorted_query = $arr['raw']; // in case there is no ORDER BY
$number_of_brackets = 0;
$in_subquery = false;
for ($i = 0; $i < $size; $i++) { for ($i = 0; $i < $size; $i++) {
//DEBUG echo "Loop2 <strong>" . $arr[$i]['data'] . "</strong> (" . $arr[$i]['type'] . ")<br />"; //DEBUG echo "Loop2 <strong>" . $arr[$i]['data'] . "</strong> (" . $arr[$i]['type'] . ")<br />";
@@ -1471,8 +1473,24 @@ if (! defined('PMA_MINIMUM_COMMON')) {
// //
// this code is not used for confirmations coming from functions.js // this code is not used for confirmations coming from functions.js
if ($arr[$i]['type'] == 'punct_bracket_open_round') {
$number_of_brackets++;
}
if ($arr[$i]['type'] == 'punct_bracket_close_round') {
$number_of_brackets--;
if ($number_of_brackets == 0) {
$in_subquery = false;
}
}
if ($arr[$i]['type'] == 'alpha_reservedWord') { if ($arr[$i]['type'] == 'alpha_reservedWord') {
$upper_data = strtoupper($arr[$i]['data']); $upper_data = strtoupper($arr[$i]['data']);
if ($upper_data == 'SELECT' && $number_of_brackets > 0) {
$in_subquery = true;
}
if (!$seen_reserved_word) { if (!$seen_reserved_word) {
$first_reserved_word = $upper_data; $first_reserved_word = $upper_data;
$subresult['querytype'] = $upper_data; $subresult['querytype'] = $upper_data;
@@ -1496,7 +1514,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
} }
} }
if ($upper_data == 'LIMIT') { if ($upper_data == 'LIMIT' && ! $in_subquery) {
$section_before_limit = substr($arr['raw'], 0, $arr[$i]['pos'] - 5); $section_before_limit = substr($arr['raw'], 0, $arr[$i]['pos'] - 5);
$in_limit = TRUE; $in_limit = TRUE;
$seen_limit = TRUE; $seen_limit = TRUE;

View File

@@ -241,7 +241,7 @@ for ($i = 0; $i < $num_fields; $i++) {
if (isset($row['Type'])) { if (isset($row['Type'])) {
$extracted_fieldspec = PMA_extractFieldSpec($row['Type']); $extracted_fieldspec = PMA_extractFieldSpec($row['Type']);
if ($extracted_fieldspec['type'] == 'bit') { if ($extracted_fieldspec['type'] == 'bit') {
$row['Default'] = PMA_printable_bit_value($row['Default'], $extracted_fieldspec['spec_in_brackets']); $row['Default'] = PMA_convert_bit_default_value($row['Default']);
} }
} }
// Cell index: If certain fields get left out, the counter shouldn't change. // Cell index: If certain fields get left out, the counter shouldn't change.
@@ -396,6 +396,10 @@ for ($i = 0; $i < $num_fields; $i++) {
$row['Default'] = ''; $row['Default'] = '';
} }
if ($type_upper == 'BIT') {
$row['DefaultValue'] = PMA_convert_bit_default_value($row['DefaultValue']);
}
$content_cells[$i][$ci] = '<select name="field_default_type[' . $i . ']">'; $content_cells[$i][$ci] = '<select name="field_default_type[' . $i . ']">';
foreach ($default_options as $key => $value) { foreach ($default_options as $key => $value) {
$content_cells[$i][$ci] .= '<option value="' . $key . '"'; $content_cells[$i][$ci] .= '<option value="' . $key . '"';

View File

@@ -155,15 +155,6 @@ echo "------"
ls -la *.gz *.zip *.bz2 *.7z ls -la *.gz *.zip *.bz2 *.7z
echo
echo "MD5 sums:"
echo "--------"
md5sum *.{gz,zip,bz2,7z} | sed "s/\([^ ]*\)[ ]*\([^ ]*\)/md5sum['\2'] = '\1'/"
echo
echo "Add these to website/data/md5sums.py in SVN"
cat <<END cat <<END
@@ -177,10 +168,8 @@ Todo now:
2. upload the files to SF (procedure explained on the sf.net Admin/File Releases page) 2. upload the files to SF (procedure explained on the sf.net Admin/File Releases page)
3. add files to SF files page (cut and paste changelog since last release) 3. add files to SF files page (cut and paste changelog since last release)
4. add SF news item to phpMyAdmin project 4. add SF news item to phpMyAdmin project
5. update web page: 5. announce release on freshmeat (http://freshmeat.net/projects/phpmyadmin/)
- add MD5s to website/data/md5sums.py in SVN 6. send a short mail (with list of major changes) to
6. announce release on freshmeat (http://freshmeat.net/projects/phpmyadmin/)
7. send a short mail (with list of major changes) to
phpmyadmin-devel@lists.sourceforge.net phpmyadmin-devel@lists.sourceforge.net
phpmyadmin-news@lists.sourceforge.net phpmyadmin-news@lists.sourceforge.net
phpmyadmin-users@lists.sourceforge.net phpmyadmin-users@lists.sourceforge.net
@@ -188,7 +177,7 @@ Todo now:
Don't forget to update the Description section in the announcement, Don't forget to update the Description section in the announcement,
based on Documentation.html. based on Documentation.html.
8. increment rc count or version in subversion : 7. increment rc count or version in subversion :
- in libraries/Config.class.php PMA_Config::__constructor() the line - in libraries/Config.class.php PMA_Config::__constructor() the line
" $this->set( 'PMA_VERSION', '2.7.1-dev' ); " " $this->set( 'PMA_VERSION', '2.7.1-dev' ); "
- in Documentation.html the 2 lines - in Documentation.html the 2 lines
@@ -196,17 +185,11 @@ Todo now:
" <h1>phpMyAdmin 2.2.2-rc1 Documentation</h1> " " <h1>phpMyAdmin 2.2.2-rc1 Documentation</h1> "
- in translators.html - in translators.html
9. add a group for bug tracking this new version, at 8. add a group for bug tracking this new version, at
https://sourceforge.net/tracker/admin/index.php?group_id=23067&atid=377408&add_group=1 https://sourceforge.net/tracker/admin/index.php?group_id=23067&atid=377408&add_group=1
10. the end :-) 9. the end :-)
END END
fi fi
# Removed due to not needed thanks to clever scripting by Robbat2
# 9. update the demo subdirectory:
# - in htdocs, cvs update phpMyAdmin
# - and don't forget to give write rights for the updated scripts to the
# whole group

View File

@@ -806,14 +806,18 @@ if ($server_master_status_run || $server_slave_status_run)
</td> </td>
<td class="value"> <td class="value">
<?php <?php
if (${"{$type}_variables_alerts"}[$variable] == ${"server_{$type}_status"}[0][$variable]) if (isset(${"{$type}_variables_alerts"}[$variable])
echo '<span class="attention">'; && ${"{$type}_variables_alerts"}[$variable] == ${"server_{$type}_status"}[0][$variable]) {
if (${"{$type}_variables_oks"}[$variable] == ${"server_{$type}_status"}[0][$variable]) echo '<span class="attention">';
} elseif (isset(${"{$type}_variables_oks"}[$variable])
&& ${"{$type}_variables_oks"}[$variable] == ${"server_{$type}_status"}[0][$variable]) {
echo '<span class="allfine">'; echo '<span class="allfine">';
else } else {
echo '<span>'; echo '<span>';
echo ${"server_{$type}_status"}[0][$variable]; }
echo '</span>'; echo ${"server_{$type}_status"}[0][$variable];
echo '</span>';
?> ?>
</td> </td>
</tr> </tr>

View File

@@ -464,7 +464,7 @@ foreach ($rows as $row_id => $vrow) {
$data = $field['Default']; $data = $field['Default'];
} }
if ($field['True_Type'] == 'bit') { if ($field['True_Type'] == 'bit') {
$special_chars = PMA_printable_bit_value($field['Default'], $extracted_fieldspec['spec_in_brackets']); $special_chars = PMA_convert_bit_default_value($field['Default']);
} else { } else {
$special_chars = htmlspecialchars($field['Default']); $special_chars = htmlspecialchars($field['Default']);
} }

View File

@@ -337,7 +337,8 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
<td nowrap="nowrap"><?php <td nowrap="nowrap"><?php
if (isset($row['Default'])) { if (isset($row['Default'])) {
if ($extracted_fieldspec['type'] == 'bit') { if ($extracted_fieldspec['type'] == 'bit') {
echo PMA_printable_bit_value($row['Default'], $extracted_fieldspec['spec_in_brackets']); // here, $row['Default'] contains something like b'010'
echo PMA_convert_bit_default_value($row['Default']);
} else { } else {
echo $row['Default']; echo $row['Default'];
} }

View File

@@ -8,7 +8,7 @@
<link rel="icon" href="./favicon.ico" type="image/x-icon" /> <link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>phpMyAdmin 3.2.1-dev - Official translators</title> <title>phpMyAdmin 3.2.2-dev - Official translators</title>
<link rel="stylesheet" type="text/css" href="docs.css" /> <link rel="stylesheet" type="text/css" href="docs.css" />
</head> </head>
@@ -16,7 +16,7 @@
<div id="header"> <div id="header">
<h1> <h1>
<a href="http://www.phpmyadmin.net/">php<span class="myadmin">MyAdmin</span></a> <a href="http://www.phpmyadmin.net/">php<span class="myadmin">MyAdmin</span></a>
3.2.1-dev 3.2.2-dev
official translators list official translators list
</h1> </h1>
</div> </div>