Experimental MySQL 4.1 support (RFE #623665) and some small fixes.

This commit is contained in:
Alexander M. Turek
2003-05-30 14:17:13 +00:00
parent d5b8e45e2c
commit 36a1167150
4 changed files with 81 additions and 38 deletions

View File

@@ -8,6 +8,20 @@ $Source$
2003-05-30 Alexander M. Turek <rabus@users.sourceforge.net>
* 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 <nijel@users.sourceforge.net>
* lang/czech: Updated.

View File

@@ -62,8 +62,8 @@
<ul>
<li>
PHP3 or PHP4: phpMyAdmin widely uses the 'str_replace()' PHP function
that was added in PHP&nbsp;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&nbsp;3.0.6, but was buggy up until
PHP&nbsp;3.0.8.
Then <span class="important">you should not run this script with
PHP3&nbsp;&lt;&nbsp;3.0.8</span>.<br />
@@ -73,10 +73,10 @@
GD2 support in PHP.
</li>
<li>
MySQL (tested with 3.21.x, 3.22.x, 3.23.x and 4.0.x);<br />
<span class="important">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&nbsp;&gt;=&nbsp;4.1.0!</span>
MySQL (tested with 3.21.x, 3.22.x, 3.23.x, 4.0.x and 4.1.x);<br />
<span class="important">
Note: The implemented MySQL&nbsp;4.1.x support is experimental!
</span>
</li>
<li>
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 &quot;localhost&quot; 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
&quot;127.0.0.1&quot; or the real hostname in
to connect to a port different from the default port, use
&quot;127.0.0.1&quot; or the real hostname in
$cfg['Servers'][$i]['host'].
<br /><br />
</dd>
@@ -1075,7 +1075,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
up tables by the above Separator.
<br /><br />
</dd>
<dt><b>$cfg['ShowTooltip'] </b>boolean</dt>
<dd>
Defines whether to display table comment as tool-tip in left frame or
@@ -1336,7 +1336,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
<dt><b>$cfg['IconvExtraParams'] </b>string</dt>
<dd>
Specify some parameters for iconv used in charset conversion. See
Specify some parameters for iconv used in charset conversion. See
<a
href="http://www.gnu.org/software/libiconv/documentation/libiconv/iconv_open.3.html">iconv
documentation</a> for details.
@@ -1619,10 +1619,10 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
<dt><b>$cfg['MaxExactCount'] </b>integer</dt>
<dd>
Determines for how large tables phpMyAdmin should get exact row count by
<code>SELECT COUNT</code>. If approximate row count is smaller than this
value, <code>SELECT COUNT</code> will be used, otherwise only value
returned by <code>SHOW TABLE STATUS</code>.
Determines for how large tables phpMyAdmin should get exact row count by
<code>SELECT COUNT</code>. If approximate row count is smaller than this
value, <code>SELECT COUNT</code> will be used, otherwise only value
returned by <code>SHOW TABLE STATUS</code>.
<br /><br />
</dd>
@@ -2176,13 +2176,16 @@ To create a new, empty mimetype please see libraries/transformations/template_ge
</p>
<h4>
[1.17] Does phpMyAdmin support MySQL&nbsp;4.1?
[1.17] Does phpMyAdmin support MySQL&nbsp;4.1 and 5.0?
</h4>
<p>
Because of a major change in the definition syntax of string field types,
this version of phpMyAdmin probably won't work correctly with
MySQL&nbsp;&gt;=&nbsp;4.1.0! We will work on the support as soon as
MySQL&nbsp;4.1.0 is released.
phpMyAdmin provides limited support for MySQL&nbsp;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.<br />
When compiling php, we strongly recommend that you manually link it to a
MySQL&nbsp;4.1 client library since the one that is currently bundled with
php is rather old and might cause problems.<br />
MySQL 5 is not yet supported.
</p>
<h4>
@@ -3014,12 +3017,12 @@ To create a new, empty mimetype please see libraries/transformations/template_ge
<a name="underscore"></a><br />
<h4>
[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?
</h4>
<p>
If you do not put a backslash before the underscore, this is a wildcard
grant, and the underscore means &quot;any character&quot;. So, if the
If you do not put a backslash before the underscore, this is a wildcard
grant, and the underscore means &quot;any character&quot;. So, if the
database name is &quot;john_db&quot;, the user would get rights to john1db,
john2db...<br /><br />
If you put a backslash before the underscore, it means that the database

View File

@@ -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++) {
<?php
echo "\n";
$selected = '';
// garvin: Find the current type in the RestrictColumnTypes. Will result in 'FUNC_CHAR'
// or something similar. Then directly look up the entry in the RestrictFunctions array,
// which will then reveal the available dropdown options
@@ -345,7 +345,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
} else {
$dropdown = array();
}
$dropdown_built = array();
$op_spacing_needed = FALSE;
@@ -361,7 +361,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
$dropdown_built[$dropdown[$j]] = 'TRUE';
$op_spacing_needed = TRUE;
}
// garvin: For compatibility's sake, do not let out all other functions. Instead
// print a seperator (blank) and then show ALL functions which weren't shown
// yet.
@@ -451,7 +451,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
echo ' </td>' . "\n";
unset($disp);
}
else if ($cfg['LongtextDoubleTextarea'] && strstr($row_table_def['True_Type'], 'longtext')) {
else if ($cfg['LongtextDoubleTextarea'] && strstr($type, 'longtext')) {
?>
<td bgcolor="<?php echo $bgcolor; ?>">&nbsp;</td>
</tr>
@@ -463,7 +463,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
</td>
<?php
}
else if (strstr($row_table_def['True_Type'], 'text')) {
else if (strstr($type, 'text')) {
?>
<td bgcolor="<?php echo $bgcolor; ?>">
<?php echo $backup_field . "\n"; ?>
@@ -476,7 +476,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
echo ' <td bgcolor="' . $bgcolor . '">' . $strTextAreaLength . '</td>' . "\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++) {
<?php
echo "\n";
}
else if (strstr($row_table_def['Type'], 'set')) {
else if ($type == 'set') {
$set = str_replace('set(', '', $row_table_def['Type']);
$set = ereg_replace('\)$', '', $set);
$set = explode(',', $set);
@@ -625,7 +625,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
if ($is_upload && $is_blob) {
echo '<input type="file" name="fields_upload_' . urlencode($field) . '" class="textfield" id="field_' . $i . '_3" />';
}
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 '</td>';
} // end else if ( binary or blob)

View File

@@ -134,14 +134,26 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) {
$type = '&nbsp;';
}
$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)) {
</td>
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">&nbsp;<label for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label>&nbsp;</td>
<td bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '">' . (empty($field_charset) ? '---' : $field_charset) . '</td>' . "\n" : '' ?>
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '">' . (empty($field_charset) ? '&nbsp;' : $field_charset) . '</td>' . "\n" : '' ?>
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td>
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td>
@@ -283,6 +295,7 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) {
?>
</tr>
<?php
unset($field_charset);
} // end while
echo "\n";
@@ -341,7 +354,7 @@ echo "\n\n";
<br />
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<td valign="top">
<?php
define('PMA_IDX_INCLUDED', 1);
require ('./tbl_indexes.php3');
@@ -488,6 +501,19 @@ if ($cfg['ShowStats']) {
</tr>
<?php
}
if (PMA_MYSQL_INT_VERSION >= 40100) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
?>
<tr>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strCharset; ?></td>
<td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
<?php
echo $showtable['Charset'];
?>
</td>
</tr>
<?php
}
if (!$is_innodb && isset($showtable['Rows'])) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n";