Bug #65681 | "character_set_results" and "character_set_connection" poorly documented | ||
---|---|---|---|
Submitted: | 20 Jun 2012 8:21 | Modified: | 6 Sep 2018 16:19 |
Reporter: | Peter Laursen (Basic Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | any | OS: | Any |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
Tags: | qc |
[20 Jun 2012 8:21]
Peter Laursen
[20 Jun 2012 8:43]
Valeriy Kravchuk
Character set introducer is documented elsewhere, http://dev.mysql.com/doc/refman/5.5/en/charset-literal.html: "The _charset_name expression is formally called an introducer. It tells the parser, “the string that is about to follow uses character set X.” Because this has confused people in the past, we emphasize that an introducer does not change the string to the introducer character set like CONVERT() would do. It does not change the string's value, although padding may occur. The introducer is just a signal." and so on. I do agree that link to definition may help, as well as some examples explaining what is character_set_connection used for.
[20 Jun 2012 9:12]
Peter Laursen
As regards docs I suggest a diagram explaning how data (stored string data, data from number-to-string conversion, string literals in queries, whatever) are stepwise being transformed/encoded before sent to the client (or stored). This should tell in what stages c_s_result and c_s_connection have effect. I actually have tried myself to create such diagram for my own understanding but was not able to complete it. (and if the term "character set introducer" is explained elsewhere please link to it).
[6 Sep 2018 16:19]
Paul DuBois
Posted by developer: " Now what does character_set_results do exactly that character_set_connection does not? " It's as described at https://dev.mysql.com/doc/refman/8.0/en/charset-connection.html#charset-connection-system-..., i.e., it's used for returning query results: The character_set_results system variable indicates the character set in which the server returns query results to the client. This includes result data such as column values, result metadata such as column names, and error messages. That section describes the contexts in which the three connection charset variables apply. " What is a "character set introducer"? I find no definition of that term anywhere " I've added a link to the section that explains introducers: https://dev.mysql.com/doc/refman/8.0/en/charset-introducer.html " The bottomline is that nobody really understand what the 2 variables will do precisely and what is the effect of SETting them. People simply SET NAMES and that is it. " That's generally the correct action (or specifying --default-character-set at connect time), so nothing else is needed.