From 36a1167150a81ca2a7a3c576e87862cd8c917c23 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 30 May 2003 14:17:13 +0000 Subject: [PATCH] Experimental MySQL 4.1 support (RFE #623665) and some small fixes. --- ChangeLog | 14 +++++++++++ Documentation.html | 47 +++++++++++++++++++---------------- tbl_change.php3 | 22 ++++++++-------- tbl_properties_structure.php3 | 36 +++++++++++++++++++++++---- 4 files changed, 81 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index eb9741f97..f06f6cfd8 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,20 @@ $Source$ 2003-05-30 Alexander M. Turek * lang/bulgarian-*.inc.php3: Updates, thanks to Stanislav Yordanov (stanprog). + * tbl_properties_structure.inc.php3: + - Fixed display for tables with few indexes; + - BLOBs are always binary; + - RFE #623665 (MySQL 4.1 support): + - Fixed display of field charsets; + - The table charset is now displayed. + * libraries/sqlparser.data.php3: Added CHARSET. + * tbl_change.php3: binary fields with CHARACTER SET definition were treated + as SET fields (again RFE #623665). + * Documentation.html: + - Declared MySQL 4.1 support as experimental; + - Added some notes about MySQL 4.1 / 5.0; + - php 5.0.0-dev should work fine with phpMyAdmin - it has been doing so at + least on my test machines for a couple of months. 2003-05-29 Michal Cihar * lang/czech: Updated. diff --git a/Documentation.html b/Documentation.html index 992b6d804..5adb60a10 100755 --- a/Documentation.html +++ b/Documentation.html @@ -62,8 +62,8 @@
  • - PHP3 or PHP4: phpMyAdmin widely uses the 'str_replace()' PHP function - that was added in PHP 3.0.6, but was buggy up until + PHP3, PHP4 or PHP5: phpMyAdmin widely uses the 'str_replace()' PHP + function that was added in PHP 3.0.6, but was buggy up until PHP 3.0.8. Then you should not run this script with PHP3 < 3.0.8.
    @@ -73,10 +73,10 @@ GD2 support in PHP.
  • - MySQL (tested with 3.21.x, 3.22.x, 3.23.x and 4.0.x);
    - Note: Because of a major change in the definition - syntax of string field types, this version of phpMyAdmin probably won't - work correctly with MySQL >= 4.1.0! + MySQL (tested with 3.21.x, 3.22.x, 3.23.x, 4.0.x and 4.1.x);
    + + Note: The implemented MySQL 4.1.x support is experimental! +
  • a web-browser (doh!). @@ -427,8 +427,8 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' The port-number of your $i-th MySQL-server. Default is 3306 (leave blank). If you use "localhost" as the hostname, MySQL ignores this port number and connects with the socket, so if you want - to connect to a port different from the default port, use - "127.0.0.1" or the real hostname in + to connect to a port different from the default port, use + "127.0.0.1" or the real hostname in $cfg['Servers'][$i]['host'].

    @@ -1075,7 +1075,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' up tables by the above Separator.

    - +
    $cfg['ShowTooltip'] boolean
    Defines whether to display table comment as tool-tip in left frame or @@ -1336,7 +1336,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
    $cfg['IconvExtraParams'] string
    - Specify some parameters for iconv used in charset conversion. See + Specify some parameters for iconv used in charset conversion. See iconv documentation for details. @@ -1619,10 +1619,10 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
    $cfg['MaxExactCount'] integer
    - Determines for how large tables phpMyAdmin should get exact row count by - SELECT COUNT. If approximate row count is smaller than this - value, SELECT COUNT will be used, otherwise only value - returned by SHOW TABLE STATUS. + Determines for how large tables phpMyAdmin should get exact row count by + SELECT COUNT. If approximate row count is smaller than this + value, SELECT COUNT will be used, otherwise only value + returned by SHOW TABLE STATUS.

    @@ -2176,13 +2176,16 @@ To create a new, empty mimetype please see libraries/transformations/template_ge

    - [1.17] Does phpMyAdmin support MySQL 4.1? + [1.17] Does phpMyAdmin support MySQL 4.1 and 5.0?

    - Because of a major change in the definition syntax of string field types, - this version of phpMyAdmin probably won't work correctly with - MySQL >= 4.1.0! We will work on the support as soon as - MySQL 4.1.0 is released. + phpMyAdmin provides limited support for MySQL 4.1. That means that you + can neither assign character sets to a table or field on create nor change + the (automatically) assigned character set.
    + When compiling php, we strongly recommend that you manually link it to a + MySQL 4.1 client library since the one that is currently bundled with + php is rather old and might cause problems.
    + MySQL 5 is not yet supported.

    @@ -3014,12 +3017,12 @@ To create a new, empty mimetype please see libraries/transformations/template_ge

    - [6.10] When creating a privilege, what happens with underscores in + [6.10] When creating a privilege, what happens with underscores in the database name?

    - If you do not put a backslash before the underscore, this is a wildcard - grant, and the underscore means "any character". So, if the + If you do not put a backslash before the underscore, this is a wildcard + grant, and the underscore means "any character". So, if the database name is "john_db", the user would get rights to john1db, john2db...

    If you put a backslash before the underscore, it means that the database diff --git a/tbl_change.php3 b/tbl_change.php3 index 87b0c8e89..905c6d109 100755 --- a/tbl_change.php3 +++ b/tbl_change.php3 @@ -84,7 +84,7 @@ if (isset($primary_key)) { $local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key; $result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url); $row = PMA_mysql_fetch_array($result); - + // No row returned if (!$row) { unset($row); @@ -212,7 +212,7 @@ for ($i = 0; $i < $fields_cnt; $i++) { } else { $rowfield = $field; } - + // loic1: current date should not be set as default if the field is NULL // for the current row // lem9: but do not put here the current datetime if there is a default @@ -336,7 +336,7 @@ for ($i = 0; $i < $fields_cnt; $i++) { ' . "\n"; unset($disp); } - else if ($cfg['LongtextDoubleTextarea'] && strstr($row_table_def['True_Type'], 'longtext')) { + else if ($cfg['LongtextDoubleTextarea'] && strstr($type, 'longtext')) { ?>   @@ -463,7 +463,7 @@ for ($i = 0; $i < $fields_cnt; $i++) { @@ -476,7 +476,7 @@ for ($i = 0; $i < $fields_cnt; $i++) { echo ' ' . $strTextAreaLength . '' . "\n"; } } - else if (strstr($row_table_def['True_Type'], 'enum')) { + else if ($type == 'enum') { $enum = str_replace('enum(', '', $row_table_def['Type']); $enum = ereg_replace('\\)$', '', $enum); $enum = explode('\',\'', substr($enum, 1, -1)); @@ -537,7 +537,7 @@ for ($i = 0; $i < $fields_cnt; $i++) { '; } - + if ($cfg['UploadDir'] != '') { if ($handle = @opendir($cfg['UploadDir'])) { $is_first = 0; @@ -650,7 +650,7 @@ for ($i = 0; $i < $fields_cnt; $i++) { echo ' ' . $strWebServerUploadDirectoryError . "\n"; } } // end if (web-server upload directory) - + echo ''; } // end else if ( binary or blob) diff --git a/tbl_properties_structure.php3 b/tbl_properties_structure.php3 index cd8f55fcb..9368623d5 100755 --- a/tbl_properties_structure.php3 +++ b/tbl_properties_structure.php3 @@ -134,14 +134,26 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) { $type = ' '; } - $binary = eregi('BINARY', $row['Type'], $test); + $binary = eregi('BLOB', $row['Type'], $test) || eregi('BINARY', $row['Type'], $test); $unsigned = eregi('UNSIGNED', $row['Type'], $test); $zerofill = eregi('ZEROFILL', $row['Type'], $test); } // rabus: Devide charset from the rest of the type definition (MySQL >= 4.1) - if (strpos($type, ' character set ')) { - list($type, $field_charset) = explode(' character set ', $type); + if (PMA_MYSQL_INT_VERSION >= 40100 && ( + substr($type, 0, 4) == 'char' + || substr($type, 0, 7) == 'varchar' + || substr($type, 0, 4) == 'text' + || substr($type, 0, 8) == 'tinytext' + || substr($type, 0, 10) == 'mediumtext' + || substr($type, 0, 8) == 'longtext' + ) && !$binary) { + if (strpos($type, ' character set ')) { + $type = substr($type, 0, strpos($type, ' character set ')); + } + if (!empty($row['Collation'])) { + $field_charset = $row['Collation']; + } } // garvin: Display basic mimetype [MIME] @@ -191,7 +203,7 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) {    > -= 40100 ? ' ' . (empty($field_charset) ? '---' : $field_charset) . '' . "\n" : '' ?> += 40100 ? ' ' . (empty($field_charset) ? ' ' : $field_charset) . '' . "\n" : '' ?>     @@ -283,6 +295,7 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) { ?> - + + + +
    + = 40100) { + $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); + ?> +
    + +