Re: How can I get LocaleID / LANGID for current thread (thd) / query?

Sergei Golubchik <[email protected]> Fri, 30 Nov 2012 17:26:38 +0100
Newsgroups gmane.comp.db.mysql.devel
Message-ID <[email protected]>
Hi, Shaukat!

On Nov 30, Shaukat Mahmood Ahmad wrote:
> Thanks Sergei for your very helpful and valuable reply, It will be
> great if you can you explain following points,
>   * Is thd->variables.lc_messages->number aligned with microsoft
> defined locale Ids ()

No. Or may be. Not necessarily.
Check the file sql_locale.cc in the source tree. It defines locales and
numbers.  You'll see whether these numbers were chosen to match LocaleID
or not.  But I doubt that they were.

> (http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx).
>   * Can  thd->variables.lc_messages be personalized for current
> connect to mysql.

Yes. thd->variables is the storage for session variables, those that you
see in SHOW SESSION VARIABLES and set with SET SESSION variable_name.

So if it's in thd->variables, you almost always can set it with SET
SESSION.
 
Regards,
Sergei

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals