From d2debd7c207833c631e7bfd5977fd0f1605fe181 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 29 Feb 2004 22:22:36 +0000 Subject: [PATCH] bug #887505 --- ChangeLog | 3 +++ tbl_select.php | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c929b06d6..370689e64 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-02-29 Alexander M. Turek + * tbl_select.php: Fixed bug #887505 (PMA does not add MySQL charsets to + WHERE clauses). 2004-02-27 Michal Cihar * config.inc.php, libraries/config_import.lib.php, diff --git a/tbl_select.php b/tbl_select.php index 297823d3e..be5c07a05 100644 --- a/tbl_select.php +++ b/tbl_select.php @@ -9,6 +9,7 @@ require_once('./libraries/grab_globals.lib.php'); require_once('./libraries/common.lib.php'); require_once('./libraries/relation.lib.php'); // foreign keys +require_once('./libraries/mysql_charsets.lib.php'); if ($cfg['PropertiesIconic'] == true) { // We need to copy the value or else the == 'both' check will always return true @@ -55,7 +56,7 @@ if (!isset($param) || $param[0] == '') { $err_url = $goto . '?' . PMA_generate_common_url($db, $table); // Gets the list and number of fields - $result = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($db) . ';'); + $result = PMA_DBI_query('SHOW' . (PMA_MYSQL_INT_VERSION >= 40100 ? ' FULL' : '') . ' FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($db) . ';'); $fields_cnt = PMA_DBI_num_rows($result); while ($row = PMA_DBI_fetch_assoc($result)) { $fields_list[] = $row['Field']; @@ -73,8 +74,17 @@ if (!isset($param) || $param[0] == '') { $type = ' '; } $fields_type[] = $type; + if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($row['Collation']) && $row['Collation'] != 'NULL') { + $fields_collation[] = $row['Collation']; + $tmp_charset = explode('_', $row['Collation']); + $fields_charset[] = $tmp_charset[0]; + unset($tmp_charset); + } else { + $fields_collation[] = $fields_charset[] = ''; + } } // end while PMA_DBI_free_result($result); + unset($result, $type); // // retrieve keys into foreign fields, if any @@ -117,6 +127,7 @@ if (!isset($param) || $param[0] == '') { + = 40100 ? '' . $strCollation . '' . "\n" : ''; ?> @@ -128,6 +139,7 @@ if (!isset($param) || $param[0] == '') { + = 40100 ? '' . $fields_collation[$i] . '' . "\n" : ''; ?> +