diff options
author | unknown <bar@bar.mysql.r18.ru> | 2003-05-21 17:44:12 +0500 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2003-05-21 17:44:12 +0500 |
commit | 4637832fa19b2866929c1e5cb7c9dd0a40db15c9 (patch) | |
tree | c1d41d9ae86450c3c93a4424253c8553ffcec322 /sql/protocol.cc | |
parent | 01add721927cf92ec3368cb56d685777aacbfe42 (diff) | |
download | mariadb-git-4637832fa19b2866929c1e5cb7c9dd0a40db15c9.tar.gz |
Some SHOW VARIABLES have been renamed:
collation_client -> character_set_client
collation_results -> character_set_results
character_set -> character_set_server
SET NAMES now doesn't start client->server conversion
SET CHARACTER SET now starts both client->server and server->client conversion
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r-- | sql/protocol.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index d00ecb5dbc4..09531f0922c 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -709,7 +709,7 @@ bool Protocol_simple::store(const char *from, uint length, field_types[field_pos] <= MYSQL_TYPE_GEOMETRY)); field_pos++; #endif - if (!my_charset_same(fromcs, tocs) && + if (tocs && !my_charset_same(fromcs, tocs) && (fromcs != &my_charset_bin) && (tocs != &my_charset_bin)) { @@ -724,7 +724,7 @@ bool Protocol_simple::store(const char *from, uint length, bool Protocol_simple::store(const char *from, uint length, CHARSET_INFO *fromcs) { - CHARSET_INFO *tocs= this->thd->variables.collation_results; + CHARSET_INFO *tocs= this->thd->variables.character_set_results; #ifndef DEBUG_OFF DBUG_ASSERT(field_types == 0 || field_types[field_pos] == MYSQL_TYPE_DECIMAL || @@ -732,7 +732,7 @@ bool Protocol_simple::store(const char *from, uint length, field_types[field_pos] <= MYSQL_TYPE_GEOMETRY)); field_pos++; #endif - if (!my_charset_same(fromcs, tocs) && + if (tocs && !my_charset_same(fromcs, tocs) && (fromcs != &my_charset_bin) && (tocs != &my_charset_bin)) { @@ -831,12 +831,14 @@ bool Protocol_simple::store(Field *field) #endif char buff[MAX_FIELD_WIDTH]; String str(buff,sizeof(buff), &my_charset_bin); + CHARSET_INFO *tocs= this->thd->variables.character_set_results; + field->val_str(&str,&str); - if (!my_charset_same(field->charset(), this->thd->charset()) && + if (tocs && !my_charset_same(field->charset(), tocs) && (field->charset() != &my_charset_bin) && - (this->thd->charset() != &my_charset_bin)) + (tocs != &my_charset_bin)) { - convert.copy(str.ptr(), str.length(), str.charset(), this->thd->charset()); + convert.copy(str.ptr(), str.length(), str.charset(), tocs); return net_store_data(convert.ptr(), convert.length()); } else |