Mysql4.1 specific fix in function PMA_displayTableBody() (character set convertions).

This commit is contained in:
Marcel Tschopp
2004-03-26 19:09:09 +00:00
parent 736b182dad
commit 19c9f98a04
3 changed files with 21 additions and 1 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2004-03-25 Marcel Tschopp <marcel.tschopp@gmx.net>
* libraries/display_tpl.lib.php, mysqli.dbi.lib.php:
Mysql4.1 specific fix in function PMA_displayTableBody() (character set
conversions).
2004-03-25 Marcel Tschopp <marcel.tschopp@gmx.net> 2004-03-25 Marcel Tschopp <marcel.tschopp@gmx.net>
* tbl_change.php, libraries/dbi/mysql.inc.php, libraries/dbi/mysqli.inc.php: * tbl_change.php, libraries/dbi/mysql.inc.php, libraries/dbi/mysqli.inc.php:
Added wrapping function PMA_DBI_field_len. Added wrapping function PMA_DBI_field_len.

View File

@@ -267,6 +267,7 @@ function PMA_DBI_get_fields_meta($result) {
} }
if (floor($f / 32768)) { if (floor($f / 32768)) {
$flags .= 'num '; $flags .= 'num ';
$fields[$k]->numeric = 1;
$f -= 32768; $f -= 32768;
continue; continue;
} }
@@ -301,36 +302,43 @@ function PMA_DBI_get_fields_meta($result) {
} }
if (floor($f / 64)) { if (floor($f / 64)) {
$flags .= 'zerofill '; $flags .= 'zerofill ';
$fields[$k]->zerofill = 1;
$f -= 64; $f -= 64;
continue; continue;
} }
if (floor($f / 32)) { if (floor($f / 32)) {
$flags .= 'unsigned '; $flags .= 'unsigned ';
$fields[$k]->unsigned = 1;
$f -= 32; $f -= 32;
continue; continue;
} }
if (floor($f / 16)) { if (floor($f / 16)) {
$flags .= 'blob '; $flags .= 'blob ';
$fields[$k]->blob = 1;
$f -= 16; $f -= 16;
continue; continue;
} }
if (floor($f / 8)) { if (floor($f / 8)) {
$flags .= 'multiple_key '; $flags .= 'multiple_key ';
$fields[$k]->multiple_key = 1;
$f -= 8; $f -= 8;
continue; continue;
} }
if (floor($f / 4)) { if (floor($f / 4)) {
$flags .= 'unique_key '; $flags .= 'unique_key ';
$fields[$k]->unique_key = 1;
$f -= 4; $f -= 4;
continue; continue;
} }
if (floor($f / 2)) { if (floor($f / 2)) {
$flags .= 'primary_key '; $flags .= 'primary_key ';
$fields[$k]->primary_key = 1;
$f -= 2; $f -= 2;
continue; continue;
} }
if (floor($f / 1)) { if (floor($f / 1)) {
$flags .= 'not_null '; $flags .= 'not_null ';
$fields[$k]->not_null = 1;
$f -= 1; $f -= 1;
continue; continue;
} }

View File

@@ -1059,7 +1059,14 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
if ($meta->type == 'real') { if ($meta->type == 'real') {
$condition = ' CONCAT(' . PMA_backquote($column_for_condition) . ') '; $condition = ' CONCAT(' . PMA_backquote($column_for_condition) . ') ';
} else { } else {
$condition = ' ' . PMA_backquote($column_for_condition) . ' '; // string and blob fields have to be converted using
// the system character set (always utf8) since
// mysql4.1 can use different charset for fields.
if (PMA_MYSQL_INT_VERSION >= 40100 && ($meta->type == 'string' || $meta->type == 'blob')) {
$condition = ' CONVERT(' . PMA_backquote($column_for_condition) . ' USING utf8) ';
} else {
$condition = ' ' . PMA_backquote($column_for_condition) . ' ';
}
} // end if... else... } // end if... else...
// loic1: To fix bug #474943 under php4, the row // loic1: To fix bug #474943 under php4, the row