MySQL Forums
Forum List  »  General

Re: Strange behavior between mysql versions with binary
Posted by: Laurent MINOST
Date: April 30, 2012 01:35AM

Hi Rick,

Thanks for your reply and support.

I do not have access today to my Toad client to do the test so I will do it later but here are the results from mysql client (command line on each server) and from phpMyAdmin, these are the same results :

mysql> select hex(binary 'Précaution'), length(binary 'Précaution');
+---------------------------+------------------------------+
| hex(binary 'Précaution') | length(binary 'Précaution') |
+---------------------------+------------------------------+
| 5072C3A963617574696F6E | 11 |
+---------------------------+------------------------------+
1 row in set (0.00 sec)

So I believe that UTF8 is properly selected/used as charset event if this output seems pretty strange to me, same results on two servers:

mysql> show variables like '%char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

mysql> show global variables like '%char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

For the dump, as I was using mysqldump, it normally encloses the charset of the source database in the dump to set it back to the new database when import on the other server but it could be a good thing to verify.
Could you please tell me what would be the good syntax to query the hex output of each column for the row that is normally matching on each server please ? Below is the initial query :

SELECT * FROM redonline_foodsafety.theme WHERE name like 'Précaution';

Where should I put the HEX() please ?

Thanks,
Regards.

Laurent

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.