MySQL Forums
Forum List  »  Stored Procedures

What encoding is used for the text in the mysql.proc table param_list and body columns?
Posted by: Hans Bergsten
Date: October 28, 2008 03:58PM

Hi,

I've searched the documentation and the forums for information about the encoding used for the param_list and body columns in the mysql.proc table, but I come up empty.

These columns are of type BLOB and LONGBLOB, but contain the text for the SP. Without knowing the encoding, it is of course impossible to present the data correctly as text, so I'm looking for how to find the encoding in a generic way so it works for any MySQL installation and configuration.

Experimenting with MySQL 5.0.45-community-nt (running on Windows Vista) and a client using Connector/J 5.1.6 (on Mac OS X), it appears as if the "characterEncoding" JDBC driver property determines the encoding; if I set it to "UTF-8", I can successfully decode the bytes from the body column as "UTF-8", and if I set it to "ISO-8859-1", I can decode it as "ISO-8859-1." However, if the "characterEncoding" property determines the encoding, there is a risk that different procedures are stored in the proc table using different encodings, so this behavior seems a bit suspect.

If it helps, here are all my charset variables:
Variable_name Value
------------------------ -------------------------------------------------------
character_set_client utf8
character_set_connection utf8
character_set_database latin1
character_set_filesystem binary
character_set_results
character_set_server latin1
character_set_system utf8
character_sets_dir C:\Program Files\MySQL\MySQL Server 5.0\share\charsets\

I'd really appreciate an authoritative response about what the rules are for encoding and decoding these two binary column values.

Best Regards,
Hans Bergsten

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.