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

into teton.kitebird.com:/home/paul/mysql-4.1
This commit is contained in:
unknown 2004-01-02 11:21:15 -06:00
commit 12ba773bb9
32 changed files with 926 additions and 48 deletions

View file

@ -15,6 +15,7 @@ arjen@george.bitbike.com
bar@bar.intranet.mysql.r18.ru
bar@bar.mysql.r18.ru
bar@bar.udmsearch.izhnet.ru
bar@deer.(none)
bar@gw.udmsearch.izhnet.ru
bell@laptop.sanja.is.com.ua
bell@sanja.is.com.ua

View file

@ -227,11 +227,12 @@ typedef struct {
} COMMANDS;
static COMMANDS commands[] = {
{ "help", 'h', com_help, 1, "Display this help." },
{ "?", '?', com_help, 1, "Synonym for `help'." },
{ "clear", 'c', com_clear, 0, "Clear command."},
{ "connect",'r', com_connect,1,
"Reconnect to the server. Optional arguments are db and host." },
{ "delimiter", 'd', com_delimiter, 1,
"Set query delimiter. " },
#ifdef USE_POPEN
{ "edit", 'e', com_edit, 0, "Edit command with $EDITOR."},
#endif
@ -239,6 +240,7 @@ static COMMANDS commands[] = {
"Send command to mysql server, display result vertically."},
{ "exit", 'q', com_quit, 0, "Exit mysql. Same as quit."},
{ "go", 'g', com_go, 0, "Send command to mysql server." },
{ "help", 'h', com_help, 1, "Display this help." },
#ifdef USE_POPEN
{ "nopager",'n', com_nopager,0, "Disable pager, print to stdout." },
#endif
@ -261,8 +263,6 @@ static COMMANDS commands[] = {
"Set outfile [to_outfile]. Append everything into given outfile." },
{ "use", 'u', com_use, 1,
"Use another database. Takes database name as argument." },
{ "delimiter", 'd', com_delimiter, 1,
"Set query delimiter. " },
/* Get bash-like expansion for some commands */
{ "create table", 0, 0, 0, ""},
{ "create database", 0, 0, 0, ""},
@ -1577,8 +1577,8 @@ static int
com_help(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
reg1 int i;
char * help_arg= strchr(line,' ');
reg1 int i, j;
char * help_arg= strchr(line,' '), buff[32], *end;
if (help_arg)
return com_server_help(buffer,line,help_arg+1);
@ -1591,8 +1591,11 @@ com_help(String *buffer __attribute__((unused)),
put_info("Note that all text commands must be first on line and end with ';'",INFO_INFO);
for (i = 0; commands[i].name; i++)
{
end= strmov(buff, commands[i].name);
for (j= strlen(commands[i].name); j < 10; j++)
end= strmov(end, " ");
if (commands[i].func)
tee_fprintf(stdout, "%s\t(\\%c)\t%s\n", commands[i].name,
tee_fprintf(stdout, "%s(\\%c) %s\n", buff,
commands[i].cmd_char, commands[i].doc);
}
if (connected && mysql_get_server_version(&mysql) >= 40100)

View file

@ -15,6 +15,8 @@ Created 9/20/1997 Heikki Tuuri
#include "hash0hash.h"
#include "log0log.h"
extern ibool recv_replay_file_ops;
/***********************************************************************
Reads the checkpoint info needed in hot backup. */

View file

@ -34,6 +34,11 @@ Created 9/20/1997 Heikki Tuuri
#include "dict0boot.h"
#include "fil0fil.h"
/* This is set to FALSE if the backup was originally taken with the
ibbackup --include regexp option: then we do not want to create tables in
directories which were not included */
ibool recv_replay_file_ops = TRUE;
/* Log records are stored in the hash table in chunks at most of this size;
this must be less than UNIV_PAGE_SIZE as it is stored in the buffer pool */
#define RECV_DATA_BLOCK_SIZE (MEM_MAX_ALLOC_IN_BUF - sizeof(recv_data_t))
@ -1974,18 +1979,21 @@ loop:
|| type == MLOG_FILE_RENAME
|| type == MLOG_FILE_DELETE)) {
#ifdef UNIV_HOTBACKUP
/* In ibbackup --apply-log, replay an .ibd file
operation, if possible; note that
fil_path_to_mysql_datadir is set in ibbackup to
point to the datadir we should use there */
if (recv_replay_file_ops) {
/* In ibbackup --apply-log, replay an .ibd file
operation, if possible; note that
fil_path_to_mysql_datadir is set in ibbackup to
point to the datadir we should use there */
if (NULL == fil_op_log_parse_or_replay(body, end_ptr,
type, TRUE, space)) {
fprintf(stderr,
if (NULL == fil_op_log_parse_or_replay(body,
end_ptr, type, TRUE, space)) {
fprintf(stderr,
"InnoDB: Error: file op log record of type %lu space %lu not complete in\n"
"InnoDB: the replay phase. Path %s\n", (ulint)type, space, (char*)(body + 2));
ut_a(0);
ut_a(0);
}
}
#endif
/* In normal mysqld crash recovery we do not try to

View file

@ -534,6 +534,8 @@ row_purge_parse_undo_rec(
node->table = NULL;
row_mysql_unfreeze_data_dictionary(trx);
return(FALSE);
}

View file

@ -81,28 +81,6 @@ static void end_server(MYSQL *mysql)
DBUG_VOID_RETURN;
}
/**************************************************************************
** Connect to sql server
** If host == 0 then use localhost
**************************************************************************/
MYSQL * STDCALL
mysql_connect(MYSQL *mysql,const char *host,
const char *user, const char *passwd)
{
MYSQL *res;
mysql=mysql_init(mysql); /* Make it thread safe */
{
DBUG_ENTER("mysql_connect");
if (!(res=mysql_real_connect(mysql,host,user,passwd,NullS,0,NullS,0)))
{
if (mysql->free_me)
my_free((gptr) mysql,MYF(0));
}
DBUG_RETURN(res);
}
}
static inline int mysql_init_charset(MYSQL *mysql)
{
char charset_name_buff[16], *charset_name;

View file

@ -0,0 +1,4 @@
-- require r/have_big5.require
disable_query_log;
show collation like "big5_chinese_ci";
enable_query_log;

View file

@ -0,0 +1,4 @@
-- require r/have_tis620.require
disable_query_log;
show collation like "tis620_thai_ci";
enable_query_log;

View file

@ -66,7 +66,7 @@ if [ x$BINARY_DIST = x1 ] ; then
basedir=..
else
basedir=.
EXTRA_ARG="--language=../sql/share/english/"
EXTRA_ARG="--language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/"
fi
mysqld_boot=" $execdir/mysqld --no-defaults --bootstrap --skip-grant-tables \

View file

@ -101,6 +101,21 @@ t1 CREATE TABLE `t1` (
`c5` char(2) character set utf8 NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a binary(10), b char(10) character set koi8r);
insert into t1 values (_binary'ÔÅÓÔ',_binary'ÔÅÓÔ');
select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
a b cast(a as char character set cp1251) cast(b as binary)
ÔÅÓÔ ÔÅÓÔ ÔÅÓÔ ÔÅÓÔ
set names koi8r;
select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
a b cast(a as char character set cp1251) cast(b as binary)
ÔÅÓÔ ÔÅÓÔ æåõæ ÔÅÓÔ
set names cp1251;
select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
a b cast(a as char character set cp1251) cast(b as binary)
ÔÅÓÔ òåñò ÔÅÓÔ ÔÅÓÔ
drop table t1;
set names binary;
select cast("2001-1-1" as date) = "2001-01-01";
cast("2001-1-1" as date) = "2001-01-01"
1

View file

@ -0,0 +1,10 @@
drop table if exists t1;
SET NAMES big5;
CREATE TABLE t1 (c CHAR(10) CHARACTER SET big5, KEY(c));
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
SELECT * FROM t1 WHERE c LIKE 'aaa%';
c
aaa
aaaa
aaaaa
DROP TABLE t1;

View file

@ -0,0 +1,113 @@
drop table if exists t1;
SET @pl0= _tis620 0x000102030405060708090A0B0C0D0E0F;
SET @pl1= _tis620 0x101112131415161718191A1B1C1D1E1F;
SET @pl2= _tis620 0x202122232425262728292A2B2C2D2E2F;
SET @pl3= _tis620 0x303132333435363738393A3B3C3D3E3F;
SET @pl4= _tis620 0x404142434445464748494A4B4C4D4E4F;
SET @pl5= _tis620 0x505152535455565758595A5B5C5D5E5F;
SET @pl6= _tis620 0x606162636465666768696A6B6C6D6E6F;
SET @pl7= _tis620 0x707172737475767778797A7B7C7D7E7F;
SET @pl8= _tis620 0x808182838485868788898A8B8C8D8E8F;
SET @pl9= _tis620 0x909192939495969798999A9B9C9D9E9F;
SET @plA= _tis620 0xA0A1A2A3A4A5A6A7A8A9AAABACADAEAF;
SET @plB= _tis620 0xB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF;
SET @plC= _tis620 0xC0C1C2C3C4C5C6C7C8C9CACBCCCDCECF;
SET @plD= _tis620 0xD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF;
SET @plE= _tis620 0xE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF;
SET @plF= _tis620 0xF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF;
SELECT hex(@u0:=convert(@pl0 using utf8));
hex(@u0:=convert(@pl0 using utf8))
000102030405060708090A0B0C0D0E0F
SELECT hex(@u1:=convert(@pl1 using utf8));
hex(@u1:=convert(@pl1 using utf8))
101112131415161718191A1B1C1D1E1F
SELECT hex(@u2:=convert(@pl2 using utf8));
hex(@u2:=convert(@pl2 using utf8))
202122232425262728292A2B2C2D2E2F
SELECT hex(@u3:=convert(@pl3 using utf8));
hex(@u3:=convert(@pl3 using utf8))
303132333435363738393A3B3C3D3E3F
SELECT hex(@u4:=convert(@pl4 using utf8));
hex(@u4:=convert(@pl4 using utf8))
404142434445464748494A4B4C4D4E4F
SELECT hex(@u5:=convert(@pl5 using utf8));
hex(@u5:=convert(@pl5 using utf8))
505152535455565758595A5B5C5D5E5F
SELECT hex(@u6:=convert(@pl6 using utf8));
hex(@u6:=convert(@pl6 using utf8))
606162636465666768696A6B6C6D6E6F
SELECT hex(@u7:=convert(@pl7 using utf8));
hex(@u7:=convert(@pl7 using utf8))
707172737475767778797A7B7C7D7E7F
SELECT hex(@u8:=convert(@pl8 using utf8));
hex(@u8:=convert(@pl8 using utf8))
C280C281C282C283C284C285C286C287C288C289C28AC28BC28CC28DC28EC28F
SELECT hex(@u9:=convert(@pl9 using utf8));
hex(@u9:=convert(@pl9 using utf8))
C290C291C292C293C294C295C296C297C298C299C29AC29BC29CC29DC29EC29F
SELECT hex(@uA:=convert(@plA using utf8));
hex(@uA:=convert(@plA using utf8))
EFBFBDE0B881E0B882E0B883E0B884E0B885E0B886E0B887E0B888E0B889E0B88AE0B88BE0B88CE0B88DE0B88EE0B88F
SELECT hex(@uB:=convert(@plB using utf8));
hex(@uB:=convert(@plB using utf8))
E0B890E0B891E0B892E0B893E0B894E0B895E0B896E0B897E0B898E0B899E0B89AE0B89BE0B89CE0B89DE0B89EE0B89F
SELECT hex(@uC:=convert(@plC using utf8));
hex(@uC:=convert(@plC using utf8))
E0B8A0E0B8A1E0B8A2E0B8A3E0B8A4E0B8A5E0B8A6E0B8A7E0B8A8E0B8A9E0B8AAE0B8ABE0B8ACE0B8ADE0B8AEE0B8AF
SELECT hex(@uD:=convert(@plD using utf8));
hex(@uD:=convert(@plD using utf8))
E0B8B0E0B8B1E0B8B2E0B8B3E0B8B4E0B8B5E0B8B6E0B8B7E0B8B8E0B8B9E0B8BAEFBFBDEFBFBDEFBFBDEFBFBDE0B8BF
SELECT hex(@uE:=convert(@plE using utf8));
hex(@uE:=convert(@plE using utf8))
E0B980E0B981E0B982E0B983E0B984E0B985E0B986E0B987E0B988E0B989E0B98AE0B98BE0B98CE0B98DE0B98EE0B98F
SELECT hex(@uF:=convert(@plF using utf8));
hex(@uF:=convert(@plF using utf8))
E0B990E0B991E0B992E0B993E0B994E0B995E0B996E0B997E0B998E0B999E0B99AE0B99BEFBFBDEFBFBDEFBFBDEFBFBD
SELECT hex(convert(@u0 USING tis620));
hex(convert(@u0 USING tis620))
000102030405060708090A0B0C0D0E0F
SELECT hex(convert(@u1 USING tis620));
hex(convert(@u1 USING tis620))
101112131415161718191A1B1C1D1E1F
SELECT hex(convert(@u2 USING tis620));
hex(convert(@u2 USING tis620))
202122232425262728292A2B2C2D2E2F
SELECT hex(convert(@u3 USING tis620));
hex(convert(@u3 USING tis620))
303132333435363738393A3B3C3D3E3F
SELECT hex(convert(@u4 USING tis620));
hex(convert(@u4 USING tis620))
404142434445464748494A4B4C4D4E4F
SELECT hex(convert(@u5 USING tis620));
hex(convert(@u5 USING tis620))
505152535455565758595A5B5C5D5E5F
SELECT hex(convert(@u6 USING tis620));
hex(convert(@u6 USING tis620))
606162636465666768696A6B6C6D6E6F
SELECT hex(convert(@u7 USING tis620));
hex(convert(@u7 USING tis620))
707172737475767778797A7B7C7D7E7F
SELECT hex(convert(@u8 USING tis620));
hex(convert(@u8 USING tis620))
808182838485868788898A8B8C8D8E8F
SELECT hex(convert(@u9 USING tis620));
hex(convert(@u9 USING tis620))
909192939495969798999A9B9C9D9E9F
SELECT hex(convert(@uA USING tis620));
hex(convert(@uA USING tis620))
FFA1A2A3A4A5A6A7A8A9AAABACADAEAF
SELECT hex(convert(@uB USING tis620));
hex(convert(@uB USING tis620))
B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF
SELECT hex(convert(@uC USING tis620));
hex(convert(@uC USING tis620))
C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF
SELECT hex(convert(@uD USING tis620));
hex(convert(@uD USING tis620))
D0D1D2D3D4D5D6D7D8D9DAFFFFFFFFDF
SELECT hex(convert(@uE USING tis620));
hex(convert(@uE USING tis620))
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
SELECT hex(convert(@uF USING tis620));
hex(convert(@uF USING tis620))
F0F1F2F3F4F5F6F7F8F9FAFBFFFFFFFF

View file

@ -0,0 +1,2 @@
Collation Charset Id Default Compiled Sortlen
big5_chinese_ci big5 1 Yes Yes 1

View file

@ -0,0 +1,2 @@
Collation Charset Id Default Compiled Sortlen
tis620_thai_ci tis620 18 Yes Yes 4

View file

@ -120,3 +120,45 @@ select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
1 3 2 0
3 6 3 0
drop table t1;
set @a=_latin2'test';
select charset(@a),collation(@a),coercibility(@a);
charset(@a) collation(@a) coercibility(@a)
latin2 latin2_general_ci 3
select @a=_latin2'TEST';
@a=_latin2'TEST'
1
select @a=_latin2'TEST' collate latin2_bin;
@a=_latin2'TEST' collate latin2_bin
0
set @a=_latin2'test' collate latin2_general_ci;
select charset(@a),collation(@a),coercibility(@a);
charset(@a) collation(@a) coercibility(@a)
latin2 latin2_general_ci 0
select @a=_latin2'TEST';
@a=_latin2'TEST'
1
select @a=_latin2'TEST' collate latin2_bin;
ERROR HY000: Illegal mix of collations (latin2_general_ci,EXPLICIT) and (latin2_bin,EXPLICIT) for operation '='
select charset(@a:=_latin2'test');
charset(@a:=_latin2'test')
latin2
select collation(@a:=_latin2'test');
collation(@a:=_latin2'test')
latin2_general_ci
select coercibility(@a:=_latin2'test');
coercibility(@a:=_latin2'test')
3
select collation(@a:=_latin2'test' collate latin2_bin);
collation(@a:=_latin2'test' collate latin2_bin)
latin2_bin
select coercibility(@a:=_latin2'test' collate latin2_bin);
coercibility(@a:=_latin2'test' collate latin2_bin)
0
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST';
(@a:=_latin2'test' collate latin2_bin) = _latin2'TEST'
0
select charset(@a),collation(@a),coercibility(@a);
charset(@a) collation(@a) coercibility(@a)
latin2 latin2_bin 0
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci;
ERROR HY000: Illegal mix of collations (latin2_bin,EXPLICIT) and (latin2_general_ci,EXPLICIT) for operation '='

View file

@ -64,6 +64,19 @@ select * from t1;
show create table t1;
drop table t1;
#
# Bug 2202
# CAST from BINARY to non-BINARY and from non-BINARY to BINARY
#
create table t1 (a binary(10), b char(10) character set koi8r);
insert into t1 values (_binary'ÔÅÓÔ',_binary'ÔÅÓÔ');
select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
set names koi8r;
select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
set names cp1251;
select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
drop table t1;
set names binary;
#
# The following should be fixed in 4.1

View file

@ -0,0 +1,18 @@
-- source include/have_big5.inc
#
# Tests with the big5 character set
#
--disable_warnings
drop table if exists t1;
--enable_warnings
SET NAMES big5;
#
# Bug 1883: LIKE did not work in some cases with a key.
#
CREATE TABLE t1 (c CHAR(10) CHARACTER SET big5, KEY(c));
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
SELECT * FROM t1 WHERE c LIKE 'aaa%';
DROP TABLE t1;

View file

@ -0,0 +1,64 @@
-- source include/have_tis620.inc
#
# Tests with the big5 character set
#
--disable_warnings
drop table if exists t1;
--enable_warnings
#
# Bug 1552: tis620 <-> unicode conversion crashed
# Check tis620 -> utf8 -> tis620 round trip conversion
#
SET @pl0= _tis620 0x000102030405060708090A0B0C0D0E0F;
SET @pl1= _tis620 0x101112131415161718191A1B1C1D1E1F;
SET @pl2= _tis620 0x202122232425262728292A2B2C2D2E2F;
SET @pl3= _tis620 0x303132333435363738393A3B3C3D3E3F;
SET @pl4= _tis620 0x404142434445464748494A4B4C4D4E4F;
SET @pl5= _tis620 0x505152535455565758595A5B5C5D5E5F;
SET @pl6= _tis620 0x606162636465666768696A6B6C6D6E6F;
SET @pl7= _tis620 0x707172737475767778797A7B7C7D7E7F;
SET @pl8= _tis620 0x808182838485868788898A8B8C8D8E8F;
SET @pl9= _tis620 0x909192939495969798999A9B9C9D9E9F;
SET @plA= _tis620 0xA0A1A2A3A4A5A6A7A8A9AAABACADAEAF;
SET @plB= _tis620 0xB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF;
SET @plC= _tis620 0xC0C1C2C3C4C5C6C7C8C9CACBCCCDCECF;
SET @plD= _tis620 0xD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF;
SET @plE= _tis620 0xE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF;
SET @plF= _tis620 0xF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF;
SELECT hex(@u0:=convert(@pl0 using utf8));
SELECT hex(@u1:=convert(@pl1 using utf8));
SELECT hex(@u2:=convert(@pl2 using utf8));
SELECT hex(@u3:=convert(@pl3 using utf8));
SELECT hex(@u4:=convert(@pl4 using utf8));
SELECT hex(@u5:=convert(@pl5 using utf8));
SELECT hex(@u6:=convert(@pl6 using utf8));
SELECT hex(@u7:=convert(@pl7 using utf8));
SELECT hex(@u8:=convert(@pl8 using utf8));
SELECT hex(@u9:=convert(@pl9 using utf8));
SELECT hex(@uA:=convert(@plA using utf8));
SELECT hex(@uB:=convert(@plB using utf8));
SELECT hex(@uC:=convert(@plC using utf8));
SELECT hex(@uD:=convert(@plD using utf8));
SELECT hex(@uE:=convert(@plE using utf8));
SELECT hex(@uF:=convert(@plF using utf8));
SELECT hex(convert(@u0 USING tis620));
SELECT hex(convert(@u1 USING tis620));
SELECT hex(convert(@u2 USING tis620));
SELECT hex(convert(@u3 USING tis620));
SELECT hex(convert(@u4 USING tis620));
SELECT hex(convert(@u5 USING tis620));
SELECT hex(convert(@u6 USING tis620));
SELECT hex(convert(@u7 USING tis620));
SELECT hex(convert(@u8 USING tis620));
SELECT hex(convert(@u9 USING tis620));
SELECT hex(convert(@uA USING tis620));
SELECT hex(convert(@uB USING tis620));
SELECT hex(convert(@uC USING tis620));
SELECT hex(convert(@uD USING tis620));
SELECT hex(convert(@uE USING tis620));
SELECT hex(convert(@uF USING tis620));

View file

@ -71,3 +71,31 @@ select @a:=0; select @a, @a:=@a+count(*), count(*), @a from t1 group by i;
select @a:=0; select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
drop table t1;
#
# Bug #2244: User variables didn't copy collation and derivation
# attributes from values they were initialized to.
#
set @a=_latin2'test';
select charset(@a),collation(@a),coercibility(@a);
select @a=_latin2'TEST';
select @a=_latin2'TEST' collate latin2_bin;
set @a=_latin2'test' collate latin2_general_ci;
select charset(@a),collation(@a),coercibility(@a);
select @a=_latin2'TEST';
--error 1266
select @a=_latin2'TEST' collate latin2_bin;
#
# Check the same invoking Item_set_user_var
#
select charset(@a:=_latin2'test');
select collation(@a:=_latin2'test');
select coercibility(@a:=_latin2'test');
select collation(@a:=_latin2'test' collate latin2_bin);
select coercibility(@a:=_latin2'test' collate latin2_bin);
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST';
select charset(@a),collation(@a),coercibility(@a);
--error 1266
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci;

View file

@ -539,8 +539,8 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
{
strxmov(get_charsets_dir(buf), cs->csname, ".xml", NullS);
my_read_charset_file(buf,flags);
cs= (cs->state & MY_CS_LOADED) ? cs : NULL;
}
cs= (cs->state & MY_CS_AVAILABLE) ? cs : NULL;
pthread_mutex_unlock(&THR_LOCK_charset);
return cs;
}

View file

@ -2163,6 +2163,7 @@ bool Item_func_set_user_var::fix_fields(THD *thd, TABLE_LIST *tables,
is different from query_id).
*/
entry->update_query_id= thd->query_id;
entry->collation.set(args[0]->collation);
cached_result_type= args[0]->result_type();
return 0;
}
@ -2174,6 +2175,7 @@ Item_func_set_user_var::fix_length_and_dec()
maybe_null=args[0]->maybe_null;
max_length=args[0]->max_length;
decimals=args[0]->decimals;
collation.set(args[0]->collation);
}
@ -2488,7 +2490,9 @@ void Item_func_get_user_var::fix_length_and_dec()
if (!(var_entry= get_variable(&thd->user_vars, name, 0)))
null_value= 1;
else
collation.set(var_entry->collation);
if (!(opt_bin_log && is_update_query(thd->lex->sql_command)))
return;

View file

@ -2104,8 +2104,8 @@ String *Item_func_conv_charset::val_str(String *str)
null_value=1;
return 0;
}
null_value= str->copy(arg->ptr(),arg->length(),arg->charset(),conv_charset);
return null_value ? 0 : str;
null_value= str_value.copy(arg->ptr(),arg->length(),arg->charset(),conv_charset);
return null_value ? 0 : &str_value;
}
void Item_func_conv_charset::fix_length_and_dec()

View file

@ -1848,6 +1848,8 @@ String *Item_char_typecast::val_str(String *str)
}
res= str;
}
res->set_charset(cast_cs);
/*
Cut the tail if cast with length

View file

@ -2148,8 +2148,12 @@ static int init_common_variables(const char *conf_file_name, int argc,
{
CHARSET_INFO *default_collation;
default_collation= get_charset_by_name(default_collation_name, MYF(0));
if (!default_collation || !my_charset_same(default_charset_info,
default_collation))
if (!default_collation)
{
sql_print_error(ER(ER_UNKNOWN_COLLATION), default_collation_name);
return 1;
}
if (!my_charset_same(default_charset_info, default_collation))
{
sql_print_error(ER(ER_COLLATION_CHARSET_MISMATCH),
default_collation_name,

View file

@ -1,6 +1,6 @@
<?xml version='1.0' encoding="utf-8"?>
<charsets max-id="93">
<charsets max-id="94">
<description>
This file lists all of the available character sets.
@ -100,6 +100,7 @@ To make maintaining easier please:
<collation name="latin1_swedish_ci" id="8" order="Finnish, Swedish" flag="primary"/>
<collation name="latin1_danish_ci" id="15" order="Danish"/>
<collation name="latin1_german2_ci" id="31" order="German Phonebook" flag="compiled"/>
<collation name="latin1_spanish_ci" id="94" order="Spanish"/>
<collation name="latin1_bin" id="47" order="Binary">
<flag>binary</flag>
<flag>compiled</flag>

View file

@ -0,0 +1,257 @@
#!/bin/sh
#<pre>
(
echo "DROP TABLE lang;"
echo "CREATE TABLE lang (lang varchar(128), letters text character set utf8);"
(
grep -v "^#" << END
#
Greenlandic &#x00C1;&#x00C2;&#x00C3;&#x00CA;&#x00CD;&#x00CE;&#x00D4;&#x00DA;&#x00DB;&#x00E1;&#x00E2;&#x00E3;&#x00EA;&#x00ED;&#x00EE;&#x00F4;&#x00FA;&#x00FB;&#x0128;&#x0129;&#x0138;&#x0168;&#x0169;
#Use of these letters was abolished in a spelling reform in 1973:
#Greenlandic &#x00C5;&#x00C6;&#x00D8;&#x00E5;&#x00E6;&#x00F8;
#Characters not found in the UCS:
# K LATIN CAPITAL LETTER KRA
#############################################################
#Basque &#x00D1;&#x00DC;&#x00F1;&#x00FC;&#x0154;&#x0155;
#Characters not found in the UCS:
# D LATIN CAPITAL LETTER D WITH MACRON
# d LATIN SMALL LETTER D WITH MACRON
# L LATIN CAPITAL LETTER L WITH MACRON
# l LATIN SMALL LETTER L WITH MACRON
# T LATIN CAPITAL LETTER T WITH MACRON
# t LATIN SMALL LETTER T WITH MACRON
#############################################################
#Maltese #&#x00C0;&#x00C1;&#x00C2;&#x00C8;&#x00C9;&#x00CA;&#x00CC;&#x00CD;&#x00CE;&#x00D2;&#x00D3;&#x00D4;&#x00D9;&#x00DA;&#x00DB;#&#x00E0;&#x00E1;&#x00E2;&#x00E8;&#x00E9;&#x00EA;&#x00EC;&#x00ED;&#x00EE;&#x00F2;&#x00D3;&#x00F4;&#x00F9;&#x00FA;&#x00FB;#&#x010A;&#x010B;&#x0120;&#x0121;&#x0126;&#x0127;&#x017B;&#x017C;&#x02BC;
#BosnianCyr &#x0402;&#x0408;&#x0409;&#x040A;&#x040B;&#x040F;&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0430;&#x0431;&#x0432;&#x0433;&#x0434;&#x0435;&#x0436;&#x0437;&#x0438;&#x043A;&#x043B;&#x043C;&#x043D;&#x043E;&#x043F;&#x0440;&#x0441;&#x0442;&#x0443;&#x0444;&#x0445;&#x0446;&#x0447;&#x0448;&#x0452;&#x0458;&#x0459;&#x045A;&#x045B;&#x045F;
#Scots &#x0041;
#Scots1 &#x01B7;&#x021C;&#x021D;&#x0292;
###########################################
#### Hiragana 3040-309F
Hiragana &#x3041;&#x3042;&#x3043;&#x3044;&#x3045;&#x3046;&#x3047;&#x3048;&#x3049;&#x304A;&#x304B;&#x304C;&#x304D;&#x304E;&#x304F;&#x3050;&#x3051;&#x3052;&#x3053;&#x3054;&#x3055;&#x3056;&#x3057;&#x3058;&#x3059;&#x305A;&#x305B;&#x305C;&#x305D;&#x305E;&#x305F;&#x3060;&#x3061;&#x3062;&#x3063;&#x3064;&#x3065;&#x3066;&#x3067;&#x3068;&#x3069;&#x306A;&#x306B;&#x306C;&#x306D;&#x306E;&#x306F;&#x3070;&#x3071;&#x3072;&#x3073;&#x3074;&#x3075;&#x3076;&#x3077;&#x3078;&#x3079;&#x307A;&#x307B;&#x307C;&#x307D;&#x307E;&#x307F;&#x3080;&#x3081;&#x3082;&#x3083;&#x3084;&#x3085;&#x3086;&#x3087;&#x3088;&#x3089;&#x308A;&#x308B;&#x308C;&#x308D;&#x308E;&#x308F;&#x3090;&#x3091;&#x3092;&#x3093;
Hiragana1 &#x3094;&#x3099;&#x309A;
Hiragana2 &#x309B;&#x309C;&#x309D;&#x309E;
#### Katakana 30A0-30FF
Katakana &#x30A1;&#x30A2;&#x30A3;&#x30A4;&#x30A5;&#x30A6;&#x30A7;&#x30A8;&#x30A9;&#x30AA;&#x30AB;&#x30AC;&#x30AD;&#x30AE;&#x30AF;&#x30B0;&#x30B1;&#x30B2;&#x30B3;&#x30B4;&#x30B5;&#x30B6;&#x30B7;&#x30B8;&#x30B9;&#x30BA;&#x30BB;&#x30BC;&#x30BD;&#x30BE;&#x30BF;&#x30C0;&#x30C1;&#x30C2;&#x30C3;&#x30C4;&#x30C5;&#x30C6;&#x30C7;&#x30C8;&#x30C9;&#x30CA;&#x30CB;&#x30CC;&#x30CD;&#x30CE;&#x30CF;&#x30D0;&#x30D1;&#x30D2;&#x30D3;&#x30D4;&#x30D5;&#x30D6;&#x30D7;&#x30D8;&#x30D9;&#x30DA;&#x30DB;&#x30DC;&#x30DD;&#x30DE;&#x30DF;&#x30E0;&#x30E1;&#x30E2;&#x30E3;&#x30E4;&#x30E5;&#x30E6;&#x30E7;&#x30E8;&#x30E9;&#x30EA;&#x30EB;&#x30EC;&#x30ED;&#x30EE;&#x30EF;&#x30F0;&#x30F1;&#x30F2;&#x30F3;&#x30F4;&#x30F5;&#x30F6;
Katakana1 &#x30F7;&#x30F8;&#x30F9;&#x30FA;
Katakana2 &#x30FB;&#x30FC;&#x30FD;&#x30FE;
############################################
Albanian &#x00C2;&#x00C7;&#x00CB;&#x00E2;&#x00E7;&#x00EB;
Bosnian &#x0106;&#x0107;&#x010C;&#x010D;&#x0110;&#x0111;&#x0160;&#x0161;&#x017D;&#x017E;
Breton &#x00C2;&#x00CA;&#x00D1;&#x00D9;&#x00DC;&#x00E2;&#x00EA;&#x00F1;&#x00F9;&#x00FC;
Catalan &#x00C0;&#x00C7;&#x00C8;&#x00C9;&#x00CD;&#x00CF;&#x00D2;&#x00D3;&#x00DA;&#x00DC;&#x00E0;&#x00E7;&#x00E8;&#x00E9;&#x00ED;&#x00EF;&#x00F2;&#x00F3;&#x00FA;&#x00FC;
#Catalan1 &#x00B7;&#x013F;&#x0140;
Croatian &#x0106;&#x0107;&#x010C;&#x010D;&#x0110;&#x0111;&#x0160;&#x0161;&#x017D;&#x017E;
CroatianLig &#x01F1;&#x01F2;&#x01F3;&#x01C4;&#x01C5;&#x01C6;&#x01C7;&#x01C8;&#x01C9;&#x01CA;&#x01CB;&#x01CC;
Czech &#x00C1;&#x00C9;&#x00CD;&#x00D3;&#x00DA;&#x00DD;&#x00E1;&#x00E9;&#x00ED;&#x00F3;&#x00FA;&#x00FD;&#x010C;&#x010D;&#x010E;&#x010F;&#x011A;&#x011B;&#x0147;&#x0148;&#x0158;&#x0159;&#x0160;&#x0161;&#x0164;&#x0165;&#x016E;&#x016F;&#x017D;&#x017E;
Danish &#x00C1;&#x00C4;&#x00C5;&#x00C6;&#x00C9;&#x00D3;&#x00D6;&#x00D8;&#x00DC;&#x00E1;&#x00E4;&#x00E5;&#x00E6;&#x00E9;&#x00F3;&#x00F6;&#x00F8;&#x00FC;
Dutch &#x00C0;&#x00C2;&#x00C4;&#x00C6;&#x00C7;&#x00C8;&#x00C9;&#x00CA;&#x00CB;&#x00CE;&#x00CF;&#x00D1;&#x00D2;&#x00D3;&#x00D4;&#x00D6;&#x00D9;&#x00DA;&#x00DB;&#x00DC;&#x00E0;&#x00E2;&#x00E4;&#x00E6;&#x00E7;&#x00E8;&#x00E9;&#x00EA;&#x00EB;&#x00EE;&#x00EF;&#x00F1;&#x00F2;&#x00F3;&#x00F4;&#x00F6;&#x00F9;&#x00FA;&#x00FB;&#x00FC;
Esperanto &#x0108;&#x0109;&#x011C;&#x011D;&#x0124;&#x0125;&#x0134;&#x0135;&#x015C;&#x015D;&#x016C;&#x016D;
Estonian &#x00C4;&#x00D5;&#x00D6;&#x00DC;&#x00E4;&#x00F5;&#x00F6;&#x00FC;&#x0160;&#x0161;&#x017D;&#x017E;
Faroese &#x00C5;&#x00C6;&#x00D0;&#x00D3;&#x00D6;&#x00D8;&#x00DA;&#x00DD;&#x00E5;&#x00E6;&#x00F0;&#x00F3;&#x00F6;&#x00F8;&#x00FA;&#x00FD;
Finnish &#x00C4;&#x00C5;&#x00D6;&#x00DC;&#x00E4;&#x00E5;&#x00F6;&#x00FC;
#Finnish1 &#x0160;&#x0161;&#x017D;&#x017E;
French(limited) &#x00C0;&#x00C2;&#x00C6;&#x00C7;&#x00C8;&#x00C9;&#x00CA;&#x00CB;&#x00CE;&#x00CF;&#x00D1;&#x00D4;&#x00D9;&#x00DB;&#x00E0;&#x00E2;&#x00E6;&#x00E7;&#x00E8;&#x00E9;&#x00EA;&#x00EB;&#x00EE;&#x00EF;&#x00F1;&#x00F4;&#x00F9;&#x00FB;&#x00FF;
French &#x0152;&#x0153;&#x0178;
German &#x00C4;&#x00D6;&#x00DC;&#x00DF;&#x00E4;&#x00F6;&#x00FC;
Hungarian &#x00C1;&#x00C9;&#x00CD;&#x00D3;&#x00D6;&#x00DA;&#x00DC;&#x00E1;&#x00E9;&#x00ED;&#x00F3;&#x00F6;&#x00FA;&#x00FC;&#x0150;&#x0151;&#x0170;&#x0171;
Icelandic &#x00C1;&#x00C6;&#x00C9;&#x00CD;&#x00D0;&#x00D3;&#x00D6;&#x00DA;&#x00DD;&#x00DE;&#x00E1;&#x00E6;&#x00E9;&#x00ED;&#x00F0;&#x00F3;&#x00F6;&#x00FA;&#x00FD;&#x00FE;
Italian &#x00C0;&#x00C8;&#x00C9;&#x00CC;&#x00CD;&#x00CF;&#x00D2;&#x00D3;&#x00D9;&#x00DA;&#x00E0;&#x00E8;&#x00E9;&#x00EC;&#x00ED;&#x00EF;&#x00F2;&#x00F3;&#x00F9;&#x00FA;
#Latin &#x0041;
Latvian &#x0100;&#x0101;&#x010C;&#x010D;&#x0112;&#x0113;&#x0122;&#x0123;&#x012A;&#x012B;&#x0136;&#x0137;&#x013B;&#x013C;&#x0145;&#x0146;&#x0160;&#x0161;&#x016A;&#x016B;&#x017D;&#x017E;
Lithuanian &#x0104;&#x0105;&#x010C;&#x010D;&#x0116;&#x0117;&#x0118;&#x0119;&#x012E;&#x012F;&#x0160;&#x0161;&#x016A;&#x016B;&#x0172;&#x0173;&#x017D;&#x017E;
Norwegian &#x00C5;&#x00C6;&#x00D8;&#x00E5;&#x00E6;&#x00F8;
Polish &#x00D3;&#x00F3;&#x0104;&#x0105;&#x0106;&#x0107;&#x0118;&#x0119;&#x0141;&#x0142;&#x0143;&#x0144;&#x015A;&#x015B;&#x0179;&#x017A;&#x017B;&#x017C;
Portuguese &#x00C0;&#x00C1;&#x00C2;&#x00C3;&#x00C7;&#x00C9;&#x00CA;&#x00CD;&#x00D3;&#x00D4;&#x00D5;&#x00DA;&#x00DC;&#x00E0;&#x00E1;&#x00E2;&#x00E3;&#x00E7;&#x00E9;&#x00EA;&#x00ED;&#x00F3;&#x00F4;&#x00F5;&#x00FA;&#x00FC;
#http://en.wikipedia.org/wiki/Special_Romanian_Unicode_characters
Romanian &#x00C2;&#x00CE;&#x00E2;&#x00EE;&#x0102;&#x0103;&#x0218;&#x0219;&#x021A;&#x021B;
Romanian(ErrorST) &#x00C2;&#x00CE;&#x00E2;&#x00EE;&#x0102;&#x0103;&#x015E;&#x015F;&#x0162;&#x0163;
Slovak &#x00C1;&#x00C4;&#x00C9;&#x00CD;&#x00D3;&#x00D4;&#x00DA;&#x00DD;&#x00E1;&#x00E4;&#x00E9;&#x00ED;&#x00F3;&#x00F4;&#x00FA;&#x00FD;&#x010C;&#x010D;&#x010E;&#x010F;&#x0139;&#x013A;&#x013D;&#x013E;&#x0147;&#x0148;&#x0154;&#x0155;&#x0160;&#x0161;&#x0164;&#x0165;&#x017D;&#x017E;
Slovene &#x010C;&#x010D;&#x0160;&#x0161;&#x017D;&#x017E
Sorbian-Lower &#x0106;&#x0107;&#x010C;&#x010D;&#x011A;&#x011B;&#x0141;&#x0142;&#x0143;&#x0144;&#x0158;&#x0159;&#x015A;&#x015B;&#x0160;&#x0161;&#x0179;&#x017A;&#x017D;&#x017E;
Sorbian-Upper &#x00D3;&#x00F3;&#x0106;&#x0107;&#x010C;&#x010D;&#x011A;&#x011B;&#x0141;&#x0142;&#x0143;&#x0144;&#x0158;&#x0159;&#x0160;&#x0161;&#x017D;&#x017E;
Spanish &#x00C1;&#x00C9;&#x00CD;&#x00D1;&#x00D3;&#x00DA;&#x00DC;&#x00E1;&#x00E9;&#x00ED;&#x00F1;&#x00F3;&#x00FA;&#x00FC;
Swedish &#x00C4;&#x00C5;&#x00D6;&#x00E4;&#x00E5;&#x00F6;
Turkish &#x00C2;&#x00C7;&#x00D6;&#x00DB;&#x00DC;&#x00E2;&#x00E7;&#x00F6;&#x00FB;&#x00FC;&#x011E;&#x011F;&#x0130;&#x0131;
Welsh &#x00C0;&#x00C1;&#x00C2;&#x00C4;&#x00C8;&#x00C9;&#x00CA;&#x00CB;&#x00CC;&#x00CD;&#x00CE;&#x00CF;&#x00D2;&#x00D3;&#x00D4;&#x00D6;&#x00D9;&#x00DA;&#x00DB;&#x00DC;&#x00DD;&#x00E0;&#x00E1;&#x00E2;&#x00E4;&#x00E8;&#x00E9;&#x00EA;&#x00EB;&#x00EC;&#x00ED;&#x00EE;&#x00EF;&#x00F2;&#x00F3;&#x00F4;&#x00F6;&#x00F9;&#x00FA;&#x00FB;&#x00FC;&#x00FD;&#x00FF;&#x0174;&#x0175;&#x0176;&#x0177;&#x0178;&#x1E80;&#x1E81;&#x1E82;&#x1E83;&#x1E84;&#x1E85;&#x1EF2;&#x1EF3;
##################################
Belarusian &#x0401;&#x0406;&#x040E;&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;&#x042A;&#x042B;&#x042C;&#x042D;&#x042E;&#x042F;&#x0430;&#x0431;&#x0432;&#x0433;&#x0434;&#x0435;&#x0436;&#x0437;&#x0438;&#x0439;&#x043A;&#x043B;&#x043C;&#x043D;&#x043E;&#x043F;&#x0440;&#x0441;&#x0442;&#x0443;&#x0444;&#x0445;&#x0446;&#x0447;&#x0448;&#x0449;&#x044A;&#x044B;&#x044C;&#x044D;&#x044E;&#x044F;&#x0451;&#x0456;&#x045E;
Bulgarian &#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;&#x042A;&#x042C;&#x042E;&#x042F;&#x0430;&#x0431;&#x0432;&#x0433;&#x0434;&#x0435;&#x0436;&#x0437;&#x0438;&#x0439;&#x043A;&#x043B;&#x043C;&#x043D;&#x043E;&#x043F;&#x0440;&#x0441;&#x0442;&#x0443;&#x0444;&#x0445;&#x0446;&#x0447;&#x0448;&#x0449;&#x044A;&#x044C;&#x044E;&#x044F;
Bulgarian1 &#x0400;&#x04AD;&#x0450;&#x045D;&#x0462;&#x0463;&#x046A;&#x046B;
Macedonian &#x0403;&#x0405;&#x0408;&#x0409;&#x040A;&#x040C;&#x040F;&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0430;&#x0431;&#x0432;&#x0433;&#x0434;&#x0435;&#x0436;&#x0437;&#x0438;&#x043A;&#x043B;&#x043C;&#x043D;&#x043E;&#x043F;&#x0440;&#x0441;&#x0442;&#x0443;&#x0444;&#x0445;&#x0446;&#x0447;&#x0448;&#x0453;&#x0455;&#x0458;&#x0459;&#x045A;&#x045C;&#x045F;
Russian &#x0401;&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;&#x042A;&#x042B;&#x042C;&#x042D;&#x042E;&#x042F;&#x0430;&#x0431;&#x0432;&#x0433;&#x0434;&#x0435;&#x0436;&#x0437;&#x0438;&#x0439;&#x043A;&#x043B;&#x043C;&#x043D;&#x043E;&#x043F;&#x0440;&#x0441;&#x0442;&#x0443;&#x0444;&#x0445;&#x0446;&#x0447;&#x0448;&#x0449;&#x044A;&#x044B;&#x044C;&#x044D;&#x044E;&#x044F;&#x0451;
RussianOLD &#x0406;&#x0456;&#x0462;&#x0463;&#x0472;&#x0473;&#x0474;&#x0475;
Serbian &#x0402;&#x0408;&#x0409;&#x040A;&#x040B;&#x040F;&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0430;&#x0431;&#x0432;&#x0433;&#x0434;&#x0435;&#x0436;&#x0437;&#x0438;&#x043A;&#x043B;&#x043C;&#x043D;&#x043E;&#x043F;&#x0440;&#x0441;&#x0442;&#x0443;&#x0444;&#x0445;&#x0446;&#x0447;&#x0448;&#x0452;&#x0458;&#x0459;&#x045A;&#x045B;&#x045F;
Ukrainian &#x0404;&#x0406;&#x0407;&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;&#x042C;&#x042D;&#x042E;&#x042F;&#x0430;&#x0431;&#x0432;&#x0433;&#x0434;&#x0435;&#x0436;&#x0437;&#x0438;&#x0439;&#x043A;&#x043B;&#x043C;&#x043D;&#x043E;&#x043F;&#x0440;&#x0441;&#x0442;&#x0443;&#x0444;&#x0445;&#x0446;&#x0447;&#x0448;&#x0449;&#x044C;&#x044D;&#x044E;&#x044F;&#x0454;&#x0456;&#x0457;&#x0490;&#x0491;
##################################
Armenian &#x0531;&#x0532;&#x0533;&#x0534;&#x0535;&#x0536;&#x0537;&#x0538;&#x0539;&#x053A;&#x053B;&#x053C;&#x053D;&#x053E;&#x053F;&#x0541;&#x0542;&#x0543;&#x0544;&#x0545;&#x0546;&#x0547;&#x0548;&#x0549;&#x054A;&#x054B;&#x054C;&#x054D;&#x054E;&#x054F;&#x0551;&#x0552;&#x0553;&#x0554;&#x0555;&#x0556;&#x055B;&#x055C;&#x055D;&#x055E;&#x055F;&#x0561;&#x0562;&#x0563;&#x0564;&#x0565;&#x0586;&#x0589;
#Armenian1 &#x055A;&#x058A;
#Characters not found in the UCS:
# ARMENIAN ETERNITY SIGN
#
GeorgianOld &#x10A0;&#x10A1;&#x10A2;&#x10A3;&#x10A4;&#x10A5;&#x10A6;&#x10A7;&#x10A8;&#x10A9;&#x10AA;&#x10AB;&#x10AC;&#x10AD;&#x10AE;&#x10AF;&#x10B0;&#x10B1;&#x10B2;&#x10B3;&#x10B4;&#x10B5;&#x10B6;&#x10B7;&#x10B8;&#x10B9;&#x10BA;&#x10BB;&#x10BC;&#x10BD;&#x10BE;&#x10BF;&#x10C0;&#x10C1;&#x10C2;&#x10C3;&#x10C4;&#x10C5;
Georgian &#x10D0;&#x10D1;&#x10D2;&#x10D3;&#x10D4;&#x10D5;&#x10D6;&#x10D7;&#x10D8;&#x10D9;&#x10DA;&#x10DB;&#x10DC;&#x10DD;&#x10DE;&#x10DF;&#x10E0;&#x10E1;&#x10E2;&#x10E3;&#x10E4;&#x10E5;&#x10E6;&#x10E7;&#x10E8;&#x10E9;&#x10EA;&#x10EB;&#x10EC;&#x10ED;&#x10EE;&#x10EF;&#x10F0;
GeorgianArc &#x10F1;&#x10F2;&#x10F3;&#x10F4;&#x10F5;&#x10F6;
GeorgianPunc &#x10FB;
#
GreekExt1 &#x0384;&#x0385;&#x0386;&#x00B7;&#x0388;&#x0389;&#x038A;&#x00BB;&#x038C;&#x00BD;&#x038E;&#x038F;&#x0390;
Greek &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;&#x039F;&#x03A0;&#x03A1;&#x03A3;&#x03A4;&#x03A5;&#x03A6;&#x03A7;&#x03A8;&#x03A9;&#x03B1;&#x03B2;&#x03B3;&#x03B4;&#x03B5;&#x03B6;&#x03B7;&#x03B8;&#x03B9;&#x03BA;&#x03BB;&#x03BC;&#x03BD;&#x03BE;&#x03BF;&#x03C0;&#x03C1;&#x03C3;&#x03C4;&#x03C5;&#x03C6;&#x03C7;&#x03C8;&#x03C9;
GreekExt2 &#x03AA;&#x03AB;&#x03AC;&#x03AD;&#x03AE;&#x03AF;&#x03B0;&#x03CA;&#x03CB;&#x03CC;&#x03CD;&#x03CE;
GreekExt4 &#x03C2;
#
Hebrew &#x05D0;&#x05D1;&#x05D2;&#x05D3;&#x05D4;&#x05D5;&#x05D6;&#x05D7;&#x05D8;&#x05D9;&#x05DA;&#x05DB;&#x05DC;&#x05DD;&#x05DE;&#x05DF;&#x05E0;&#x05E1;&#x05E2;&#x05E3;&#x05E4;&#x05E5;&#x05E6;&#x05E7;&#x05E8;&#x05E9;&#x05EA;
##################################
#Abaza
#Abkhaz
#Adyghe
#Agul *
#(Aisor)
#Akhvakh *
#(?lvdalska)
#(Andi) *
#(Aragonese)
#Archi *
#Arumanian
#(Arvanite)
#Asturian
#Avar
#Azerbaijani
#(Bagulal) *
#Balkar
#Bashkir
#Basque !
#Bats *
#Bezhta *
#(Botlikh) *
#Budukh *
#(Chamalal)
#Chechen
#Chuvash
#Cornish !
#(Corsican)
#Dargwa
#Erzya
#(Franco-Proven?al)
#(Frisian, East)
#(Frisian, North)
#Frisian, West
#Friulian
#Gagauz
#Gaelic, Irish !
#Gaelic, Manx !
#Gaelic, Scottish !
#Galician !
#(German, Low) !
#(German, Swiss) !
#Godoberi *
#(Hinukh) *
#(Hunzib) *
#Ingrian
#Ingush
#Istro-Romanian
#(Judeo-Georgian)
#(Judeo-Kurdish)
#(Judeo-Tati)
#Kabardian
#Kalmyk
#Karachay
#(Karaim)
#(Karata) *
#Karelian
#Kashubian
#Kazakh
#Khinalug
#(Khvarshi) *
#(Kirmanji)
#Komi
#Komi-Permyak
#(Kryts)
#Kumyk
#(Kurdish)
#(Ladin)
#(Ladino)
#Lak
#Laz
#Lezgian
#Livonian
#(Ludian)
#Luxemburgish !
#Mari, Hill
#Mari, Meadow
#Megleno-Romanian
#(Mingrelian)
#Moksha
#Moldavian
#Nenets, Tundra
#Nogai
#Occitan
#Old Church Slavonic
#(Olonets)
#Ossetian
#(Romani)
#Romansch
#(Rusyn)
#Rutul
#Sami, Inari
#Sami, Kildin
#Sami, Lule
#Sami, Northern
#Sami, Skolt
#Sami, Southern
#(Sami, Ter) *
#(Sami, Ume) *
#(Sardinian) *
#Scots !
#Svan
#Tabasaran
#(Talysh)
#Tatar, Crimean
#Tatar, Kazan
#Tati
#(Tindi) *
#(Tsakonian) *
#Tsakhur *
#(Tsez) *
#(Turkish, Crimean)
#Ubykh *
#Udi
#Udmurt
#(V?mhusm?l)
#Vepsian
#Votic
#(Walloon)
#(Yiddish)
################################
# 4 Gaelic-new-orthography
# 4 Frisian
# 3 Rhaeto-Romanic
# 2 S&AACUTEmi-with-restrictions
# 1 Rhjaeto-Romanic
# 1 Gaelic-old-and-new-orthographies
END
) |
while read a b
do
c=`echo $b | replace "&#x" "" ";" ""`
printf "INSERT INTO lang VALUES ('$a',_ucs2 X'$c');\n"
done
) | mysql -f test
#mysql test << END
#SELECT * FROM lang WHERE CONVERT(letters USING latin1) NOT LIKE _binary'%?%';
#SELECT * FROM lang WHERE CONVERT(letters USING latin2) NOT LIKE _binary'%?%';
#END
list="big5 dec8 cp850 hp8 koi8r latin1 latin2 swe7 ascii ujis sjis hebrew euckr koi8u gb2312 greek cp1250 gbk latin5 armscii8 cp866 keybcs2 macce macroman cp852 latin7 cp1251 cp1256 cp1257 geostd8"
for p in $list
do
echo "-----------------"
echo $p:
mysql -sss test << END
SELECT lang FROM lang WHERE CONVERT(letters USING $p) NOT LIKE _binary'%?%' ORDER BY lang;
END
done

View file

@ -209,6 +209,27 @@
</collation>
<collation name="latin1_spanish_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
40 41 51 53 57 5B 65 67 69 6B 75 77 79 7B 7D 81
8F 91 93 95 98 9A A4 A6 A8 AA AF B3 B4 B5 B6 B7
B8 41 51 53 57 5B 65 67 69 6B 75 77 79 7B 7D 81
8F 91 93 95 98 9A A4 A6 A8 AA AF B9 BA BB BC BF
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
41 41 41 41 41 41 41 53 5B 5B 5B 5B 6B 6B 6B 6B
57 7F 81 81 81 81 81 BD 81 9A 9A 9A 9A AA B1 97
41 41 41 41 41 41 41 53 5B 5B 5B 5B 6B 6B 6B 6B
57 7F 81 81 81 81 81 BE 81 9A 9A 9A 9A AA B1 AA
</map>
</collation>
</charset>
</charsets>

View file

@ -834,6 +834,7 @@ static int check_connection(THD *thd)
char *passwd= strend(user)+1;
char *db= passwd;
char db_buff[NAME_LEN+1]; // buffer to store db in utf8
char user_buff[USERNAME_LENGTH+1]; // buffer to store user in utf8
/*
Old clients send null-terminated string as password; new clients send
the size (1 byte) + string (not null-terminated). Hence in case of empty
@ -854,6 +855,14 @@ static int check_connection(THD *thd)
db= db_buff;
}
if (user)
{
user_buff[copy_and_convert(user_buff, sizeof(user_buff)-1,
system_charset_info, user, strlen(user),
thd->charset())]= '\0';
user= user_buff;
}
if (thd->user)
x_free(thd->user);
if (!(thd->user= my_strdup(user, MYF(0))))

View file

@ -235,7 +235,7 @@ bool String::copy(const char *str, uint32 arg_length,
{
if ((from_cs == &my_charset_bin) || (to_cs == &my_charset_bin))
{
return copy(str, arg_length, &my_charset_bin);
return copy(str, arg_length, to_cs);
}
uint32 new_length= to_cs->mbmaxlen*arg_length;
if (alloc(new_length))

View file

@ -377,7 +377,7 @@ static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)),
*min_length= (uint) (min_str-min_org);
*max_length= res_length;
do {
*min_str++ = '\0'; /* Because if key compression */
*min_str++ = ' '; /* Because if key compression */
*max_str++ = max_sort_char;
} while (min_str != min_end);
return 0;

View file

@ -701,6 +701,205 @@ void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length)
}
#endif /* NOT_NEEDED */
static unsigned short cs_to_uni[256]={
0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
0xFFFD,0x0E01,0x0E02,0x0E03,0x0E04,0x0E05,0x0E06,0x0E07,
0x0E08,0x0E09,0x0E0A,0x0E0B,0x0E0C,0x0E0D,0x0E0E,0x0E0F,
0x0E10,0x0E11,0x0E12,0x0E13,0x0E14,0x0E15,0x0E16,0x0E17,
0x0E18,0x0E19,0x0E1A,0x0E1B,0x0E1C,0x0E1D,0x0E1E,0x0E1F,
0x0E20,0x0E21,0x0E22,0x0E23,0x0E24,0x0E25,0x0E26,0x0E27,
0x0E28,0x0E29,0x0E2A,0x0E2B,0x0E2C,0x0E2D,0x0E2E,0x0E2F,
0x0E30,0x0E31,0x0E32,0x0E33,0x0E34,0x0E35,0x0E36,0x0E37,
0x0E38,0x0E39,0x0E3A,0xFFFD,0xFFFD,0xFFFD,0xFFFD,0x0E3F,
0x0E40,0x0E41,0x0E42,0x0E43,0x0E44,0x0E45,0x0E46,0x0E47,
0x0E48,0x0E49,0x0E4A,0x0E4B,0x0E4C,0x0E4D,0x0E4E,0x0E4F,
0x0E50,0x0E51,0x0E52,0x0E53,0x0E54,0x0E55,0x0E56,0x0E57,
0x0E58,0x0E59,0x0E5A,0x0E5B,0xFFFD,0xFFFD,0xFFFD,0xFFFD
};
static unsigned char pl00[256]={
0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
};
static unsigned char pl0E[256]={
0x0000,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
0x00D8,0x00D9,0x00DA,0x0000,0x0000,0x0000,0x0000,0x00DF,
0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
0x00F8,0x00F9,0x00FA,0x00FB,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
};
static unsigned char plFF[256]={
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x00FF,0x0000,0x0000
};
static unsigned char *uni_to_cs[256]={
pl00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,pl0E,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,plFF
};
static
int my_mb_wc_tis620(CHARSET_INFO *cs,my_wc_t *wc,
const unsigned char *str,
const unsigned char *end __attribute__((unused)))
{
if (str >= end)
return MY_CS_TOOFEW(0);
*wc=cs_to_uni[*str];
return (!wc[0] && str[0]) ? MY_CS_ILSEQ : 1;
}
static
int my_wc_mb_tis620(CHARSET_INFO *cs,my_wc_t wc,
unsigned char *str,
unsigned char *end __attribute__((unused)))
{
unsigned char *pl;
if (str >= end)
return MY_CS_TOOSMALL;
pl= uni_to_cs[(wc>>8) & 0xFF];
str[0]= pl ? pl[wc & 0xFF] : '\0';
return (!str[0] && wc) ? MY_CS_ILUNI : 1;
}
static MY_COLLATION_HANDLER my_collation_ci_handler =
{
@ -721,8 +920,8 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_numchars_8bit,
my_charpos_8bit,
my_lengthsp_8bit,
my_mb_wc_8bit, /* mb_wc */
my_wc_mb_8bit, /* wc_mb */
my_mb_wc_tis620, /* mb_wc */
my_wc_mb_tis620, /* wc_mb */
my_caseup_str_8bit,
my_casedn_str_8bit,
my_caseup_8bit,

72
strings/dump_map.c Normal file
View file

@ -0,0 +1,72 @@
#include <stdio.h>
#include <string.h>
static void print_short_array(unsigned short *a)
{
int i;
printf("{\n");
for (i=0; i<=0xFF; i++)
{
printf("0x%04X%s%s",(int)a[i],i<0xFF?",":"",(i+1) % 8 ? "" :"\n");
}
printf("};\n");
}
int main(void)
{
char str[160];
unsigned short touni[256];
unsigned short fromuni[65536];
unsigned short fromstat[256];
int i;
bzero((void*)touni,sizeof(touni));
bzero((void*)fromuni,sizeof(fromuni));
bzero((void*)fromstat,sizeof(fromstat));
while (fgets(str,sizeof(str),stdin))
{
unsigned int c,u;
if ((str[0]=='#') || (2!=sscanf(str,"%x%x",&c,&u)))
continue;
if (c>0xFF || u>0xFFFF)
continue;
touni[c]= u;
fromuni[u]= c;
}
printf("unsigned short cs_to_uni[256]=");
print_short_array(touni);
for (i=0;i<=0xFF;i++)
{
fromstat[touni[i]>>8]++;
}
for (i=0;i<=256;i++)
{
if (fromstat[i])
{
printf("unsigned char pl%02X[256]=",i);
print_short_array(fromuni+i*256);
}
}
printf("unsigned short *uni_to_cs[256]={\n");
for (i=0;i<=255;i++)
{
if (fromstat[i])
printf("pl%02X",i);
else
printf("NULL");
printf("%s%s",i<255?",":"",((i+1) % 8) ? "":"\n");
}
printf("};\n");
return 0;
}