Bug #23717 Character set introducers do not work as documented
Submitted: 27 Oct 2006 13:38 Modified: 29 Nov 2006 18:42
Reporter: Domas Mituzas Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:4.1, 5.0, 5.1 OS:
Assigned to: Paul DuBois CPU Architecture:Any
Tags: bfsm_2006_11_02

[27 Oct 2006 13:38] Domas Mituzas
Description:
The http://dev.mysql.com/doc/refman/5.0/en/charset-literal.html states that:
"
The _charset_name expression is formally called an introducer. It tells the parser, “the string that is about to follow uses character set X.” 
"

That is not really true - if you specify multibyte character set, say _sjis"Character sets rock", parser won't use multibyte escaping routines for the string, but rather will use what is set for connection. So the introducer tells not parser, but something behind the parser. 

How to repeat:
Take a look at the attached testcase. 

Suggested fix:
Either specify clearly in documentation, how introducers affect query parsing or execution, or make the behavior proper.
[29 Nov 2006 18:42] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

I will update http://dev.mysql.com/doc/refman/5.0/en/charset-literal.html
to indicate that escape processing is done per character_set_connection,
even in the presence of an introducer.