replaced MYSQL_MAJOR_VERSION and MYSQL_MINOR_VERSION constants by MYSQL_INT_VERSION
This commit is contained in:
@@ -27,6 +27,11 @@ $Source$
|
|||||||
* lib.inc.php3; db_readdump.php3, line 82: restored the use of the
|
* lib.inc.php3; db_readdump.php3, line 82: restored the use of the
|
||||||
remove_remarks function that is required (else sql dump files starting
|
remove_remarks function that is required (else sql dump files starting
|
||||||
with comments won't be successfully splitted into single queries).
|
with comments won't be successfully splitted into single queries).
|
||||||
|
* defines.inc.php3; db_details.php3; ldi_check.php3; lib.inc.php3;
|
||||||
|
tbl_copy.php3; tbl_create.php3; tbl_dump.php3; tbl_printview.php3;
|
||||||
|
tbl_properties.inc.php3; tbl_properties.php3; user_details.php3:
|
||||||
|
replaced MYSQL_MAJOR_VERSION and MYSQL_MINOR_VERSION constants by
|
||||||
|
MYSQL_INT_VERSION.
|
||||||
|
|
||||||
2001-08-20 Olivier M<>ller <om@omnis.ch>
|
2001-08-20 Olivier M<>ller <om@omnis.ch>
|
||||||
* db_stats.php3: new file and feature (sorry :) : simply display an
|
* db_stats.php3: new file and feature (sorry :) : simply display an
|
||||||
|
@@ -39,9 +39,9 @@ if (mysql_error() != '') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// speedup view on locked tables - staybyte - 11 June 2001
|
// speedup view on locked tables - staybyte - 11 June 2001
|
||||||
if ($num_tables > 0 && MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 3) {
|
if ($num_tables > 0 && MYSQL_INT_VERSION >= 32303) {
|
||||||
// Special speedup for newer MySQL Versions (in 4.0 format changed)
|
// Special speedup for newer MySQL Versions (in 4.0 format changed)
|
||||||
if ($cfgSkipLockedTables == TRUE && MYSQL_MAJOR_VERSION == 3.23 && intval(MYSQL_MINOR_VERSION) >= 30) {
|
if ($cfgSkipLockedTables == TRUE && MYSQL_INT_VERSION >= 32330) {
|
||||||
$query = 'SHOW OPEN TABLES FROM ' . backquote($db);
|
$query = 'SHOW OPEN TABLES FROM ' . backquote($db);
|
||||||
$result = mysql_query($query);
|
$result = mysql_query($query);
|
||||||
// Blending out tables in use
|
// Blending out tables in use
|
||||||
@@ -89,7 +89,7 @@ if ($num_tables == 0) {
|
|||||||
echo $strNoTablesFound . "\n";
|
echo $strNoTablesFound . "\n";
|
||||||
}
|
}
|
||||||
// show table size on mysql >= 3.23 - staybyte - 11 June 2001
|
// show table size on mysql >= 3.23 - staybyte - 11 June 2001
|
||||||
else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) {
|
else if (MYSQL_INT_VERSION >= 32300 && isset($tbl_cache)) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
@@ -466,7 +466,7 @@ if ($num_tables > 0) {
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
// Add backquotes checkbox
|
// Add backquotes checkbox
|
||||||
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 6) {
|
if (MYSQL_INT_VERSION >= 32306) {
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td<?php echo $colspan; ?>>
|
<td<?php echo $colspan; ?>>
|
||||||
|
@@ -5,13 +5,12 @@
|
|||||||
/**
|
/**
|
||||||
* DEFINES VARIABLES & CONSTANTS
|
* DEFINES VARIABLES & CONSTANTS
|
||||||
* Overview:
|
* Overview:
|
||||||
* MYSQL_MAJOR_VERSION (double) - eg: 3.23
|
|
||||||
* MYSQL_MINOR_VERSION (double) - eg: 39
|
|
||||||
* PHPMYADMIN_VERSION (string) - phpMyAdmin version string
|
* PHPMYADMIN_VERSION (string) - phpMyAdmin version string
|
||||||
* PHP_INT_VERSION (int) - eg: 30017 instead of 3.0.17 or
|
* PHP_INT_VERSION (int) - eg: 30017 instead of 3.0.17 or
|
||||||
* 40006 instead of 4.0.6RC3
|
* 40006 instead of 4.0.6RC3
|
||||||
* PMA_WINDOWS (bool) - mark if phpMyAdmin running on windows
|
* PMA_WINDOWS (bool) - mark if phpMyAdmin running on windows
|
||||||
* server
|
* server
|
||||||
|
* MYSQL_INT_VERSION (int) - eg: 32339 instead of 3.23.39
|
||||||
*/
|
*/
|
||||||
// phpMyAdmin release
|
// phpMyAdmin release
|
||||||
if (!defined('PHPMYADMIN_VERSION')) {
|
if (!defined('PHPMYADMIN_VERSION')) {
|
||||||
@@ -52,20 +51,27 @@ if (!defined('MYSQL_MAJOR_VERSION') && isset($link)) {
|
|||||||
$result = mysql_query('SELECT VERSION() AS version');
|
$result = mysql_query('SELECT VERSION() AS version');
|
||||||
if ($result != FALSE && @mysql_num_rows($result) > 0) {
|
if ($result != FALSE && @mysql_num_rows($result) > 0) {
|
||||||
$row = mysql_fetch_array($result);
|
$row = mysql_fetch_array($result);
|
||||||
define('MYSQL_MAJOR_VERSION', (double)substr($row['version'], 0, 4));
|
$match = explode('.', $row['version']);
|
||||||
define('MYSQL_MINOR_VERSION', (double)substr($row['version'], 5));
|
|
||||||
} else {
|
} else {
|
||||||
$result = @mysql_query('SHOW VARIABLES LIKE \'version\'');
|
$result = @mysql_query('SHOW VARIABLES LIKE \'version\'');
|
||||||
if ($result != FALSE && @mysql_num_rows($result) > 0){
|
if ($result != FALSE && @mysql_num_rows($result) > 0){
|
||||||
$row = mysql_fetch_row($result);
|
$row = mysql_fetch_row($result);
|
||||||
define('MYSQL_MAJOR_VERSION', (double)substr($row[1], 0, 4));
|
$match = explode('.', $row[1]);
|
||||||
define('MYSQL_MINOR_VERSION', (double)substr($row[1], 5));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end server id is defined case
|
} // end server id is defined case
|
||||||
if (!defined('MYSQL_MAJOR_VERSION')) {
|
|
||||||
define('MYSQL_MAJOR_VERSION', 3.21);
|
if (!isset($match) || !isset($match[0])) {
|
||||||
define('MYSQL_MINOR_VERSION', 0);
|
$match[0] = 3;
|
||||||
} // end if
|
}
|
||||||
|
if (!isset($match[1])) {
|
||||||
|
$match[1] = 21;
|
||||||
|
}
|
||||||
|
if (!isset($match[2])) {
|
||||||
|
$match[2] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
define('MYSQL_INT_VERSION', (int)sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2])));
|
||||||
|
unset($match);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@@ -65,7 +65,7 @@ if (isset($btnLDI) && ($textfile != 'none')) {
|
|||||||
$query .= ' LINES TERMINATED BY \'' . $line_terminator . '\'';
|
$query .= ' LINES TERMINATED BY \'' . $line_terminator . '\'';
|
||||||
}
|
}
|
||||||
if (strlen($column_name) > 0) {
|
if (strlen($column_name) > 0) {
|
||||||
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 6) {
|
if (MYSQL_INT_VERSION >= 32306) {
|
||||||
$query .= ' (';
|
$query .= ' (';
|
||||||
$tmp = split(',( ?)', $column_name);
|
$tmp = split(',( ?)', $column_name);
|
||||||
for ($i = 0; $i < count($tmp); $i++) {
|
for ($i = 0; $i < count($tmp); $i++) {
|
||||||
|
@@ -130,8 +130,6 @@ if (!defined('__LIB_INC__')){
|
|||||||
*/
|
*/
|
||||||
function mysql_die($error_message = '', $the_query = '')
|
function mysql_die($error_message = '', $the_query = '')
|
||||||
{
|
{
|
||||||
global $sql_query;
|
|
||||||
|
|
||||||
if (!$error_message) {
|
if (!$error_message) {
|
||||||
$error_message = mysql_error();
|
$error_message = mysql_error();
|
||||||
}
|
}
|
||||||
@@ -424,7 +422,7 @@ if (!defined('__LIB_INC__')){
|
|||||||
function backquote($a_name, $do_it = TRUE)
|
function backquote($a_name, $do_it = TRUE)
|
||||||
{
|
{
|
||||||
if ($do_it
|
if ($do_it
|
||||||
&& MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 6
|
&& MYSQL_INT_VERSION >= 32306
|
||||||
&& !empty($a_name) && $a_name != '*') {
|
&& !empty($a_name) && $a_name != '*') {
|
||||||
return '`' . $a_name . '`';
|
return '`' . $a_name . '`';
|
||||||
} else {
|
} else {
|
||||||
@@ -1279,7 +1277,7 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
|
|||||||
|
|
||||||
// Steve Alberty's patch for complete table dump,
|
// Steve Alberty's patch for complete table dump,
|
||||||
// modified by Lem9 to allow older MySQL versions to continue to work
|
// modified by Lem9 to allow older MySQL versions to continue to work
|
||||||
if (MYSQL_MAJOR_VERSION == 3.23 && intval(MYSQL_MINOR_VERSION) > 20) {
|
if (MYSQL_MAJOR_VERSION >= 32321) {
|
||||||
// Whether to quote table and fields names or not
|
// Whether to quote table and fields names or not
|
||||||
if ($use_backquotes) {
|
if ($use_backquotes) {
|
||||||
mysql_query('SET SQL_QUOTE_SHOW_CREATE = 1');
|
mysql_query('SET SQL_QUOTE_SHOW_CREATE = 1');
|
||||||
|
@@ -56,7 +56,7 @@ if (isset($new_name) && trim($new_name) != '') {
|
|||||||
// Copy the data
|
// Copy the data
|
||||||
if ($result != FALSE && $what == 'data') {
|
if ($result != FALSE && $what == 'data') {
|
||||||
// speedup copy table - staybyte - 22. Juni 2001
|
// speedup copy table - staybyte - 22. Juni 2001
|
||||||
if (MYSQL_MAJOR_VERSION >= 3.23) {
|
if (MYSQL_INT_VERSION >= 32300) {
|
||||||
$sql_insert_data = 'INSERT INTO ' . backquote($new_name) . ' SELECT * FROM ' . backquote($table);
|
$sql_insert_data = 'INSERT INTO ' . backquote($new_name) . ' SELECT * FROM ' . backquote($table);
|
||||||
$result = mysql_query($sql_insert_data) or mysql_die();
|
$result = mysql_query($sql_insert_data) or mysql_die();
|
||||||
} // end MySQL >= 3.23
|
} // end MySQL >= 3.23
|
||||||
|
@@ -121,7 +121,7 @@ if (isset($submit)) {
|
|||||||
if (!empty($tbl_type) && ($tbl_type != 'Default')) {
|
if (!empty($tbl_type) && ($tbl_type != 'Default')) {
|
||||||
$sql_query .= ' TYPE = ' . $tbl_type;
|
$sql_query .= ' TYPE = ' . $tbl_type;
|
||||||
}
|
}
|
||||||
if (MYSQL_MAJOR_VERSION == 3.23 && !empty($comment)) {
|
if (MYSQL_INT_VERSION >= 32300 && !empty($comment)) {
|
||||||
$sql_query .= ' comment = \'' . sql_addslashes($comment) . '\'';
|
$sql_query .= ' comment = \'' . sql_addslashes($comment) . '\'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -170,7 +170,7 @@ else {
|
|||||||
: '\'' . $db . '\'';
|
: '\'' . $db . '\'';
|
||||||
$dump_buffer .= $crlf
|
$dump_buffer .= $crlf
|
||||||
. '# ' . $strGenTime . ': ' . date('F j, Y, g:i a') . $crlf
|
. '# ' . $strGenTime . ': ' . date('F j, Y, g:i a') . $crlf
|
||||||
. '# ' . $strServerVersion . ': ' . MYSQL_MAJOR_VERSION . '.' . MYSQL_MINOR_VERSION . $crlf
|
. '# ' . $strServerVersion . ': ' . substr(MYSQL_INT_VERSION, 0, 1) . '.' . substr(MYSQL_INT_VERSION, 1, 2) . '.' . substr(MYSQL_INT_VERSION, 3) . $crlf
|
||||||
. '# ' . $strPHPVersion . ': ' . phpversion() . $crlf
|
. '# ' . $strPHPVersion . ': ' . phpversion() . $crlf
|
||||||
. '# ' . $strDatabase . ': ' . $formatted_db_name . $crlf;
|
. '# ' . $strDatabase . ': ' . $formatted_db_name . $crlf;
|
||||||
|
|
||||||
|
@@ -23,7 +23,7 @@ mysql_select_db($db);
|
|||||||
/**
|
/**
|
||||||
* Displays the comments of the table is MySQL >= 3.23
|
* Displays the comments of the table is MySQL >= 3.23
|
||||||
*/
|
*/
|
||||||
if (MYSQL_MAJOR_VERSION >= 3.23) {
|
if (MYSQL_INT_VERSION >= 32300) {
|
||||||
$result = mysql_query('SHOW TABLE STATUS LIKE \'' . sql_addslashes($table, TRUE) . '\'') or mysql_die();
|
$result = mysql_query('SHOW TABLE STATUS LIKE \'' . sql_addslashes($table, TRUE) . '\'') or mysql_die();
|
||||||
$row = mysql_fetch_array($result);
|
$row = mysql_fetch_array($result);
|
||||||
if (!empty($row['Comment'])) {
|
if (!empty($row['Comment'])) {
|
||||||
|
@@ -216,7 +216,7 @@ for ($i = 0 ; $i < $num_fields; $i++) {
|
|||||||
<br />
|
<br />
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($action == 'tbl_create.php3' && MYSQL_MAJOR_VERSION >= 3.23) {
|
if ($action == 'tbl_create.php3' && MYSQL_INT_VERSION >= 32300) {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
<table>
|
<table>
|
||||||
|
@@ -67,7 +67,7 @@ $url_query = 'lang=' . $lang
|
|||||||
* Gets table informations
|
* Gets table informations
|
||||||
*/
|
*/
|
||||||
// 1. Get table type and comments ('show table' works correct since 3.23.03)
|
// 1. Get table type and comments ('show table' works correct since 3.23.03)
|
||||||
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 3) {
|
if (MYSQL_INT_VERSION >= 32303) {
|
||||||
// Update table type, comment and order if required by the user
|
// Update table type, comment and order if required by the user
|
||||||
if (isset($submitcomment)) {
|
if (isset($submitcomment)) {
|
||||||
if (get_magic_quotes_gpc()) {
|
if (get_magic_quotes_gpc()) {
|
||||||
@@ -326,7 +326,7 @@ $nonisam = FALSE;
|
|||||||
if (!eregi('ISAM|HEAP', $showtable['Type'])) {
|
if (!eregi('ISAM|HEAP', $showtable['Type'])) {
|
||||||
$nonisam = TRUE;
|
$nonisam = TRUE;
|
||||||
}
|
}
|
||||||
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $nonisam == FALSE && isset($showtable)) {
|
if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE && isset($showtable)) {
|
||||||
// Gets some sizes
|
// Gets some sizes
|
||||||
$mergetable = FALSE;
|
$mergetable = FALSE;
|
||||||
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
|
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
|
||||||
@@ -625,7 +625,7 @@ while (list($junk, $fieldname) = each($aryFields)) {
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (MYSQL_MAJOR_VERSION >= 3.23 && MYSQL_MINOR_VERSION >= 34) {
|
if (MYSQL_INT_VERSION >= 32334) {
|
||||||
?>
|
?>
|
||||||
<!-- Order the table -->
|
<!-- Order the table -->
|
||||||
<li>
|
<li>
|
||||||
@@ -695,7 +695,7 @@ echo "\n";
|
|||||||
<?php echo $strExtendedInserts; ?><br />
|
<?php echo $strExtendedInserts; ?><br />
|
||||||
<?php
|
<?php
|
||||||
// Add backquotes checkbox
|
// Add backquotes checkbox
|
||||||
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 6) {
|
if (MYSQL_INT_VERSION >= 32306) {
|
||||||
?>
|
?>
|
||||||
<input type="checkbox" name="use_backquotes" value="1" />
|
<input type="checkbox" name="use_backquotes" value="1" />
|
||||||
<?php echo $strUseBackquotes; ?><br />
|
<?php echo $strUseBackquotes; ?><br />
|
||||||
@@ -820,7 +820,7 @@ echo "\n";
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 22) {
|
if (MYSQL_INT_VERSION >= 32322) {
|
||||||
if ($tbl_type == 'MYISAM' or $tbl_type == 'BDB') {
|
if ($tbl_type == 'MYISAM' or $tbl_type == 'BDB') {
|
||||||
?>
|
?>
|
||||||
<!-- Table maintenance -->
|
<!-- Table maintenance -->
|
||||||
|
@@ -235,16 +235,12 @@ function grant_operations()
|
|||||||
}
|
}
|
||||||
|
|
||||||
function protect_name(db_or_table) {
|
function protect_name(db_or_table) {
|
||||||
var js_mysql_major_version, js_mysql_minor_version;
|
var js_mysql_version = <?php echo MYSQL_INT_VERSION ?>;
|
||||||
js_mysql_major_version = <?php echo MYSQL_MAJOR_VERSION ?>;
|
|
||||||
js_mysql_minor_version = <?php echo MYSQL_MINOR_VERSION ?>;
|
|
||||||
|
|
||||||
if (js_mysql_major_version >= "3.23") {
|
if (js_mysql_version >= 32306) {
|
||||||
if (js_mysql_minor_version >= "6") {
|
|
||||||
<!-- return "`" + db_or_table + "`"; -->
|
<!-- return "`" + db_or_table + "`"; -->
|
||||||
return db_or_table;
|
return db_or_table;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
return db_or_table;
|
return db_or_table;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user