Commit f1b37d3e authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/home/bk/mysql-4.1/

into serg.mylan:/usr/home/serg/Abk/mysql-4.1


client/mysqltest.c:
  Auto merged
parents 68aec1e4 b5f66b02
...@@ -1568,6 +1568,7 @@ int do_connect(struct st_query* q) ...@@ -1568,6 +1568,7 @@ int do_connect(struct st_query* q)
if (opt_compress) if (opt_compress)
mysql_options(&next_con->mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(&next_con->mysql,MYSQL_OPT_COMPRESS,NullS);
mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0); mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME, "latin1");
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
if (opt_use_ssl) if (opt_use_ssl)
...@@ -2632,6 +2633,8 @@ int main(int argc, char **argv) ...@@ -2632,6 +2633,8 @@ int main(int argc, char **argv)
if (opt_compress) if (opt_compress)
mysql_options(&cur_con->mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(&cur_con->mysql,MYSQL_OPT_COMPRESS,NullS);
mysql_options(&cur_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0); mysql_options(&cur_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_NAME, "latin1");
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
if (opt_use_ssl) if (opt_use_ssl)
mysql_ssl_set(&cur_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(&cur_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
......
...@@ -111,3 +111,28 @@ SET character_set_connection=cp1251; ...@@ -111,3 +111,28 @@ SET character_set_connection=cp1251;
SELECT hex(''); SELECT hex('');
hex('') hex('')
F2E5F1F2 F2E5F1F2
USE test;
SET NAMES binary;
CREATE TABLE `тест` (`тест` int);
SHOW CREATE TABLE `тест`;
Table Create Table
тест CREATE TABLE `тест` (
`тест` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SET NAMES utf8;
SHOW CREATE TABLE `тест`;
Table Create Table
тест CREATE TABLE `тест` (
`тест` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE `тест`;
SET NAMES binary;
SET character_set_connection=utf8;
SELECT 'тест' as s;
s
тест
SET NAMES utf8;
SET character_set_connection=binary;
SELECT 'тест' as s;
s
тест
...@@ -78,3 +78,22 @@ SET NAMES koi8r; ...@@ -78,3 +78,22 @@ SET NAMES koi8r;
SELECT hex(''); SELECT hex('');
SET character_set_connection=cp1251; SET character_set_connection=cp1251;
SELECT hex(''); SELECT hex('');
USE test;
# Bug#4417
# Check that identifiers and strings are not converted
# when the client character set is binary.
SET NAMES binary;
CREATE TABLE `тест` (`тест` int);
SHOW CREATE TABLE `тест`;
SET NAMES utf8;
SHOW CREATE TABLE `тест`;
DROP TABLE `тест`;
SET NAMES binary;
SET character_set_connection=utf8;
SELECT 'тест' as s;
SET NAMES utf8;
SET character_set_connection=binary;
SELECT 'тест' as s;
...@@ -533,21 +533,23 @@ bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs) ...@@ -533,21 +533,23 @@ bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
return FALSE; return FALSE;
} }
/* /*
Update some cache variables when character set changes Update some cache variables when character set changes
*/ */
void THD::update_charset() void THD::update_charset()
{ {
charset_is_system_charset= my_charset_same(charset(),system_charset_info); uint32 not_used;
charset_is_collation_connection= my_charset_same(charset(), charset_is_system_charset= !String::needs_conversion(0,charset(),
variables. system_charset_info,
collation_connection); &not_used);
charset_is_collation_connection=
!String::needs_conversion(0,charset(),variables.collation_connection,
&not_used);
} }
/* routings to adding tables to list of changed in transaction tables */ /* routings to adding tables to list of changed in transaction tables */
inline static void list_include(CHANGED_TABLE_LIST** prev, inline static void list_include(CHANGED_TABLE_LIST** prev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment