diff options
author | unknown <monty@mysql.com> | 2004-12-31 00:50:30 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-12-31 00:50:30 +0200 |
commit | 12a215b0833d9aa688ba16fe56eb3411a83e7d4f (patch) | |
tree | d4dfebc9b9c93790a9be3f9e6807f3923a6b3d3e /strings | |
parent | cdf70f2ede108267ce492abada82ca753f269e25 (diff) | |
parent | 2e8d13c73ec986dde580c9c840f421af4279611a (diff) | |
download | mariadb-git-12a215b0833d9aa688ba16fe56eb3411a83e7d4f.tar.gz |
Merge with global tree
BitKeeper/etc/logging_ok:
auto-union
client/mysqltest.c:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/include/dict0dict.h:
Auto merged
libmysql/errmsg.c:
Auto merged
myisam/mi_open.c:
Auto merged
myisam/mi_write.c:
Auto merged
mysql-test/r/grant.result:
Auto merged
mysql-test/r/merge.result:
Auto merged
mysql-test/r/show_check.result:
Auto merged
mysql-test/t/derived.test:
Auto merged
mysql-test/t/merge.test:
Auto merged
mysql-test/t/show_check.test:
Auto merged
mysql-test/t/system_mysql_db_fix.test:
Auto merged
scripts/mysql_install_db.sh:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
sql/tztime.h:
Auto merged
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-czech.c | 3 | ||||
-rw-r--r-- | strings/ctype-ucs2.c | 3 | ||||
-rw-r--r-- | strings/ctype-ujis.c | 44 | ||||
-rw-r--r-- | strings/ctype-win1250ch.c | 3 | ||||
-rw-r--r-- | strings/xml.c | 2 |
5 files changed, 49 insertions, 6 deletions
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index 07c45788d30..76981200a4d 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -277,7 +277,8 @@ static int my_strnncollsp_czech(CHARSET_INFO * cs, const uchar *s, uint slen, const uchar *t, uint tlen, - my_bool diff_if_only_endspace_difference) + my_bool diff_if_only_endspace_difference + __attribute__((unused))) { for ( ; slen && s[slen-1] == ' ' ; slen--); for ( ; tlen && t[tlen-1] == ' ' ; tlen--); diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index d3fb16aa52e..d21b340e768 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1360,7 +1360,8 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs, static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs, const uchar *s, uint slen, const uchar *t, uint tlen, - my_bool diff_if_only_endspace_difference) + my_bool diff_if_only_endspace_difference + __attribute__((unused))) { /* TODO: Needs to be fixed to handle end space! */ return my_strnncoll_ucs2_bin(cs,s,slen,t,tlen,0); diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 94673a20795..fc1496df280 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -8243,7 +8243,6 @@ my_jisx0212_uni_onechar(int code){ } - /* EUC-JP encoding subcomponents: [x00-x7F] # ASCII/JIS-Roman (one-byte/character) @@ -8253,6 +8252,47 @@ my_jisx0212_uni_onechar(int code){ */ static +uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)), + const char *beg, const char *end, uint pos) +{ + const uchar *b= (uchar *) beg; + + for ( ; pos && b < (uchar*) end; pos--, b++) + { + char *chbeg; + uint ch= *b; + + if (ch <= 0x7F) /* one byte */ + continue; + + chbeg= (char *) b++; + if (b >= (uchar *) end) /* need more bytes */ + return chbeg - beg; /* unexpected EOL */ + + if (ch == 0x8E) /* [x8E][xA0-xDF] */ + { + if (*b >= 0xA0 && *b <= 0xDF) + continue; + return chbeg - beg; /* invalid sequence */ + } + + if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */ + { + ch= *b++; + if (b >= (uchar*) end) + return chbeg - beg; /* unexpected EOL */ + } + + if (ch >= 0xA1 && ch <= 0xFE && + *b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */ + continue; + return chbeg - beg; /* invalid sequence */ + } + return b - (uchar *) beg; +} + + +static uint my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)), const char *str, const char *strend) { @@ -8475,7 +8515,7 @@ static MY_CHARSET_HANDLER my_charset_handler= mbcharlen_ujis, my_numchars_mb, my_charpos_mb, - my_well_formed_len_mb, + my_well_formed_len_ujis, my_lengthsp_8bit, my_numcells_eucjp, my_mb_wc_euc_jp, /* mb_wc */ diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index 896aef775cf..397dcd6f2f2 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -480,7 +480,8 @@ static int my_strnncollsp_win1250ch(CHARSET_INFO * cs, const uchar *s, uint slen, const uchar *t, uint tlen, - my_bool diff_if_only_endspace_difference) + my_bool diff_if_only_endspace_difference + __attribute__((unused))) { for ( ; slen && s[slen-1] == ' ' ; slen--); for ( ; tlen && t[tlen-1] == ' ' ; tlen--); diff --git a/strings/xml.c b/strings/xml.c index 6ba52ea41a8..d19c3dab241 100644 --- a/strings/xml.c +++ b/strings/xml.c @@ -135,7 +135,7 @@ static int my_xml_value(MY_XML_PARSER *st, const char *str, uint len) static int my_xml_enter(MY_XML_PARSER *st, const char *str, uint len) { - if ( (st->attrend-st->attr+len+1)>sizeof(st->attr)) + if ((uint) (st->attrend-st->attr+len+1) > sizeof(st->attr)) { sprintf(st->errstr,"To deep XML"); return MY_XML_ERROR; |