From 19c9f98a04bbc14f413b7194e320e2400a8381e6 Mon Sep 17 00:00:00 2001 From: Marcel Tschopp Date: Fri, 26 Mar 2004 19:09:09 +0000 Subject: [PATCH] Mysql4.1 specific fix in function PMA_displayTableBody() (character set convertions). --- ChangeLog | 5 +++++ libraries/dbi/mysqli.dbi.lib.php | 8 ++++++++ libraries/display_tbl.lib.php | 9 ++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4b620c6b6..2928d8b58 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-03-25 Marcel Tschopp + * 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 * tbl_change.php, libraries/dbi/mysql.inc.php, libraries/dbi/mysqli.inc.php: Added wrapping function PMA_DBI_field_len. diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index fee123732..2cc63f200 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -267,6 +267,7 @@ function PMA_DBI_get_fields_meta($result) { } if (floor($f / 32768)) { $flags .= 'num '; + $fields[$k]->numeric = 1; $f -= 32768; continue; } @@ -301,36 +302,43 @@ function PMA_DBI_get_fields_meta($result) { } if (floor($f / 64)) { $flags .= 'zerofill '; + $fields[$k]->zerofill = 1; $f -= 64; continue; } if (floor($f / 32)) { $flags .= 'unsigned '; + $fields[$k]->unsigned = 1; $f -= 32; continue; } if (floor($f / 16)) { $flags .= 'blob '; + $fields[$k]->blob = 1; $f -= 16; continue; } if (floor($f / 8)) { $flags .= 'multiple_key '; + $fields[$k]->multiple_key = 1; $f -= 8; continue; } if (floor($f / 4)) { $flags .= 'unique_key '; + $fields[$k]->unique_key = 1; $f -= 4; continue; } if (floor($f / 2)) { $flags .= 'primary_key '; + $fields[$k]->primary_key = 1; $f -= 2; continue; } if (floor($f / 1)) { $flags .= 'not_null '; + $fields[$k]->not_null = 1; $f -= 1; continue; } diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 520d781ad..5b7241244 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -1059,7 +1059,14 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) if ($meta->type == 'real') { $condition = ' CONCAT(' . PMA_backquote($column_for_condition) . ') '; } 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... // loic1: To fix bug #474943 under php4, the row