View Issue Details

IDProjectCategoryView StatusLast Update
0010056mantisbtupgradepublic2009-06-23 15:28
ReporterKirill Assigned Tojreese  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
PlatformWindowsOSWindows XPOS Version1.1.0
Product Version1.2.0a3 
Target Version1.2.0rc1Fixed in Version1.2.0rc1 
Summary0010056: Category national character
Description

After upgrade I see wrong category name.
See old.png and new.png.

TagsNo tags attached.
Attached Files
old.png (45,189 bytes)   
old.png (45,189 bytes)   
new.png (50,247 bytes)   
new.png (50,247 bytes)   
0001-Fix-10056-Send-the-UTF8-command-to-MySQL-databases.patch (1,012 bytes)   
From d51d0136661c484d551d94e83bdea8637a55e94c Mon Sep 17 00:00:00 2001
From: John Reese <jreese@leetcode.net>
Date: Fri, 30 Jan 2009 10:11:33 -0500
Subject: [PATCH] Fix #10056: Send the UTF8 command to MySQL databases during the installation/upgrade process.

---
 admin/install.php |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/admin/install.php b/admin/install.php
index 292d1c1..5bf409a 100644
--- a/admin/install.php
+++ b/admin/install.php
@@ -693,6 +693,13 @@ if( 3 == $t_install_state ) {
 			echo '<tr><td bgcolor="#ffffff" col_span="2"> Database Creation Suppressed, SQL Queries follow <pre>';
 		}
 
+		# Make sure we do the upgrades using UTF-8 if needed
+		if ( $f_db_type === 'mysql' || $f_db_type === 'mysqli' ) {
+			if( strtolower( lang_get( 'charset' ) ) === 'utf-8' ) {
+				$g_db->execute( 'SET NAMES UTF8' );
+			}
+		}
+
 		if( $f_db_type == 'db2' ) {
 			$result = &$g_db->execute( 'set schema ' . $f_db_schema );
 			if( $result === false ) {
-- 
1.6.1.2

Activities

jreese

jreese

2009-01-16 13:45

reporter   ~0020645

Reminder sent to: grangeway

Paul, can you take a look at this? I assume that something in the install/upgrade process needs to set appropriate database encodings based on the configured language?

Kirill

Kirill

2009-01-17 02:23

reporter   ~0020649

I try research and found, that in $t_category_result in function function install_category_migrate() {
this category with this chars ??????.
May be wrong in db_query_bound

Kirill

Kirill

2009-01-25 09:03

reporter   ~0020704

Any patch exists? I can test...

giallu

giallu

2009-01-25 13:05

reporter   ~0020706

what version did you upgrade from?

giallu

giallu

2009-01-25 13:09

reporter   ~0020707

additionally, does your server include the mbstring extension?
without that, string_lower() is going to create a mess like the one you are experiencing...

Kirill

Kirill

2009-01-25 13:36

reporter   ~0020708

At now I use 1.1.6. UTF-8. DB utf8_general_ci.
I test upgrate to last alpha 1.2.0 a3

additionally, does your server include the mbstring extension
How I can test it?

giallu

giallu

2009-01-25 18:45

reporter   ~0020711

create a info.php file in your server with the single line:

<?php phpinfo();

point your browser to the page and search in the output the "mbstring" section.

if it's not there, you should add it to your installation and retry the upgrade

Kirill

Kirill

2009-01-26 02:00

reporter   ~0020713

mbstring
Multibyte Support enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

Directive Local Value Master Value
mbstring.detect_order no value no value
mbstring.encoding_translation Off Off
mbstring.func_overload 0 0
mbstring.http_input pass pass
mbstring.http_output pass pass
mbstring.internal_encoding UTF-8 UTF-8
mbstring.language Russian Russian
mbstring.strict_detection Off Off
mbstring.substitute_character no value no value

giallu

giallu

2009-01-26 05:35

reporter   ~0020714

Then it seems something else is failing...

Kirill

Kirill

2009-01-26 10:48

reporter   ~0020715

giallu, If you can connect with me jid: krak@jabber.ru. I can test all you version of any ideas.

giallu

giallu

2009-01-26 11:12

reporter   ~0020716

ok. let's check the collation: in the phpmyadmin pages, check both the table's one (it's a new table in 1.2 IIRC) and of the "name" field.

Of course, the collation should be utf8_general_ci

Kirill

Kirill

2009-01-26 13:40

reporter   ~0020719

All tables utf8_general_ci.
Database too.

Kirill

Kirill

2009-01-30 03:56

reporter   ~0020743

What I can test too?

giallu

giallu

2009-01-30 06:18

reporter   ~0020745

I will need to test this stuff locally. BTW, which MySQL version are you using?

jreese

jreese

2009-01-30 09:15

reporter   ~0020750

Note the problem I think is causing this:

in core/database_api.php, the db_connect() call sends a special query to MySQL databases ('SET NAMES UTF8'), but the admin/install.php scripts do not call this function, and therefor do not send that query/command after connecting.

Or am I missing something?

giallu

giallu

2009-01-30 09:24

reporter   ~0020751

heck, it could be...

Kirill

Kirill

2009-01-30 09:35

reporter   ~0020753

Sorry, I see your answer at now...

MySQL

  • Server: localhost via TCP/IP
  • Server version: 5.1.30-community
  • Protocol version: 10
  • MySQL-charset: UTF-8 Unicode (utf8)

jreese may be proove.

giallu, when you made change - I can test it.

jreese

jreese

2009-01-30 10:18

reporter   ~0020755

Can you please try applying the attached patch to your copy, and re-run the upgrade process on your 1.1.x database, and see if this fixes the problem? Thank you.

Kirill

Kirill

2009-01-30 13:32

reporter   ~0020758

Yes. It's work.
Thank you very much.
I can go to new version...
Thanks more.

jreese

jreese

2009-01-30 14:30

reporter   ~0020759

Fix committed to 1.2.x development tree.

Related Changesets

MantisBT: master d51d0136

2009-01-30 10:11

jreese


Details Diff
Fix 0010056: Send the UTF8 command to MySQL databases during the installation/upgrade process. Affected Issues
0010056
mod - admin/install.php Diff File