summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-02-17 01:35:17 +0200
committerunknown <monty@mysql.com>2004-02-17 01:35:17 +0200
commit709356d47343af2951cdcd02419c71fc49c35f85 (patch)
tree7e3324032ecc97c6af3771a6904e8ae32dbf7a48 /strings
parent0c259c54b062f065e375fa185556cdf7fd419c13 (diff)
downloadmariadb-git-709356d47343af2951cdcd02419c71fc49c35f85.tar.gz
Changed wellformedlen to well_formed_len
Fixed that blobs >16M can be inserted/updated Fixed bug when doing CREATE TEMPORARY TABLE ... LIKE include/m_ctype.h: Changed wellformedlen to well_formed_len include/mysql.h: Fixed comment libmysql/libmysql.c: Fixed indentation libmysqld/lib_sql.cc: Fixed indentation mysql-test/r/ctype_utf8.result: updated warning numbers mysql-test/r/innodb.result: Moved test to right place mysql-test/r/myisam-blob.result: More test for blobs mysql-test/r/rpl000002.result: Move test to better place mysql-test/r/rpl_log.result: Move test to better place mysql-test/r/union.result: Move test to better place mysql-test/t/innodb.test: Moved test to right place mysql-test/t/myisam-blob.test: More test of blobs mysql-test/t/rpl000002.test: Move test to better place mysql-test/t/rpl_log.test: Move test to better place mysql-test/t/union.test: Move test to better place sql/field.cc: Changed wellformedlen to well_formed_len. Fixed that blobs >16M can be inserted/updated (new bug) sql/field.h: Code optimization sql/sql_lex.cc: Changed short variable names sql/sql_show.cc: Optimized quote handling sql/sql_table.cc: Fixed bug when doing CREATE TEMPORARY TABLE ... LIKE sql/sql_union.cc: Added comment strings/ctype-big5.c: Changed wellformedlen to well_formed_len strings/ctype-bin.c: Changed wellformedlen to well_formed_len strings/ctype-euc_kr.c: Changed wellformedlen to well_formed_len strings/ctype-gb2312.c: Changed wellformedlen to well_formed_len strings/ctype-gbk.c: Changed wellformedlen to well_formed_len strings/ctype-latin1.c: Changed wellformedlen to well_formed_len strings/ctype-mb.c: Changed wellformedlen to well_formed_len strings/ctype-simple.c: Changed wellformedlen to well_formed_len strings/ctype-sjis.c: Changed wellformedlen to well_formed_len strings/ctype-tis620.c: Changed wellformedlen to well_formed_len strings/ctype-ucs2.c: Changed wellformedlen to well_formed_len Indentation changes strings/ctype-ujis.c: Changed wellformedlen to well_formed_len strings/ctype-utf8.c: Changed wellformedlen to well_formed_len
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-big5.c2
-rw-r--r--strings/ctype-bin.c2
-rw-r--r--strings/ctype-euc_kr.c2
-rw-r--r--strings/ctype-gb2312.c2
-rw-r--r--strings/ctype-gbk.c2
-rw-r--r--strings/ctype-latin1.c2
-rw-r--r--strings/ctype-mb.c8
-rw-r--r--strings/ctype-simple.c17
-rw-r--r--strings/ctype-sjis.c2
-rw-r--r--strings/ctype-tis620.c2
-rw-r--r--strings/ctype-ucs2.c52
-rw-r--r--strings/ctype-ujis.c2
-rw-r--r--strings/ctype-utf8.c2
13 files changed, 60 insertions, 37 deletions
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index 1b0a235ed57..712f909ae47 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -6245,7 +6245,7 @@ static MY_CHARSET_HANDLER my_charset_big5_handler=
mbcharlen_big5,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_big5, /* mb_wc */
my_wc_mb_big5, /* wc_mb */
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index 35382b05c88..ea7777aabc0 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -350,7 +350,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_mbcharlen_8bit, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
- my_wellformedlen_8bit,
+ my_well_formed_len_8bit,
my_lengthsp_8bit,
my_mb_wc_bin,
my_wc_mb_bin,
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index 278e8529e83..ce6f695059f 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -8653,7 +8653,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_euc_kr,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_euc_kr, /* mb_wc */
my_wc_mb_euc_kr, /* wc_mb */
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index 722f00f0f7a..9f663f0b1ce 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -5704,7 +5704,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_gb2312,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_gb2312, /* mb_wc */
my_wc_mb_gb2312, /* wc_mb */
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index 2ebf145f840..f49bc5d360b 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -9900,7 +9900,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_gbk,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_gbk,
my_wc_mb_gbk,
diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c
index 00d49f40ee4..eaef5441a65 100644
--- a/strings/ctype-latin1.c
+++ b/strings/ctype-latin1.c
@@ -180,7 +180,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_mbcharlen_8bit,
my_numchars_8bit,
my_charpos_8bit,
- my_wellformedlen_8bit,
+ my_well_formed_len_8bit,
my_lengthsp_8bit,
my_mb_wc_latin1,
my_wc_mb_latin1,
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index b35162c8fb6..2f7cf698664 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -274,12 +274,12 @@ uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
return pos ? e+2-b0 : b-b0;
}
-uint my_wellformedlen_mb(CHARSET_INFO *cs,
- const char *b, const char *e, uint pos)
+uint my_well_formed_len_mb(CHARSET_INFO *cs,
+ const char *b, const char *e, uint pos)
{
my_wc_t wc;
int mblen;
- const char *b0= b;
+ const char *b_start= b;
while (pos)
{
@@ -288,7 +288,7 @@ uint my_wellformedlen_mb(CHARSET_INFO *cs,
b+= mblen;
pos--;
}
- return b - b0;
+ return b - b_start;
}
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index baefe17c32f..719ae14f653 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1001,18 +1001,21 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
}
}
+
void my_fill_8bit(CHARSET_INFO *cs __attribute__((unused)),
char *s, uint l, int fill)
{
bfill(s,l,fill);
}
+
uint my_numchars_8bit(CHARSET_INFO *cs __attribute__((unused)),
const char *b, const char *e)
{
return e-b;
}
+
uint my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)),
const char *b __attribute__((unused)),
const char *e __attribute__((unused)),
@@ -1021,15 +1024,17 @@ uint my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)),
return pos;
}
-uint my_wellformedlen_8bit(CHARSET_INFO *cs __attribute__((unused)),
- const char *start,
- const char *end,
- uint nchars)
+
+uint my_well_formed_len_8bit(CHARSET_INFO *cs __attribute__((unused)),
+ const char *start,
+ const char *end,
+ uint nchars)
{
uint nbytes= (uint) (end-start);
- return nbytes < nchars ? nbytes : nchars;
+ return min(nbytes, nchars);
}
+
uint my_lengthsp_8bit(CHARSET_INFO *cs __attribute__((unused)),
const char *ptr, uint length)
{
@@ -1106,7 +1111,7 @@ MY_CHARSET_HANDLER my_charset_8bit_handler=
my_mbcharlen_8bit, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
- my_wellformedlen_8bit,
+ my_well_formed_len_8bit,
my_lengthsp_8bit,
my_mb_wc_8bit,
my_wc_mb_8bit,
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 09bd12dcdeb..a4a8b3d4b2c 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -4489,7 +4489,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_sjis,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_sjis, /* mb_wc */
my_wc_mb_sjis, /* wc_mb */
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index b9856799add..abe9972cfd6 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -873,7 +873,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_mbcharlen_8bit, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
- my_wellformedlen_8bit,
+ my_well_formed_len_8bit,
my_lengthsp_8bit,
my_mb_wc_tis620, /* mb_wc */
my_wc_mb_tis620, /* wc_mb */
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index ec306d9af35..908d27859ff 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -985,6 +985,7 @@ cnv:
return (int) (dst-db);
}
+
static
uint my_numchars_ucs2(CHARSET_INFO *cs __attribute__((unused)),
const char *b, const char *e)
@@ -992,6 +993,7 @@ uint my_numchars_ucs2(CHARSET_INFO *cs __attribute__((unused)),
return (e-b)/2;
}
+
static
uint my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)),
const char *b __attribute__((unused)),
@@ -1001,17 +1003,19 @@ uint my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)),
return pos*2;
}
+
static
-uint my_wellformedlen_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- const char *b,
- const char *e,
- uint nchars)
+uint my_well_formed_len_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b,
+ const char *e,
+ uint nchars)
{
uint nbytes= (e-b) & ~ (uint)1;
nchars*= 2;
- return nbytes < nchars ? nbytes : nchars;
+ return min(nbytes, nchars);
}
+
static
void my_fill_ucs2(CHARSET_INFO *cs __attribute__((unused)),
char *s, uint l, int fill)
@@ -1019,6 +1023,7 @@ void my_fill_ucs2(CHARSET_INFO *cs __attribute__((unused)),
for ( ; l >= 2; s[0]= 0, s[1]= fill, s+=2, l-=2);
}
+
static
uint my_lengthsp_ucs2(CHARSET_INFO *cs __attribute__((unused)),
const char *ptr, uint length)
@@ -1029,6 +1034,7 @@ uint my_lengthsp_ucs2(CHARSET_INFO *cs __attribute__((unused)),
return (uint) (end-ptr);
}
+
/*
** Compare string against string with wildcard
** 0 if matched
@@ -1043,7 +1049,7 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
int escape, int w_one, int w_many,
MY_UNICASE_INFO **weights)
{
- int result= -1; /* Not found, using wildcards */
+ int result= -1; /* Not found, using wildcards */
my_wc_t s_wc, w_wc;
int scan, plane;
@@ -1052,21 +1058,23 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
while (1)
{
- scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr, (const uchar*)wildend);
+ scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend);
if (scan <= 0)
return 1;
if (w_wc == (my_wc_t)escape)
{
wildstr+= scan;
- scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr, (const uchar*)wildend);
+ scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend);
if (scan <= 0)
return 1;
}
if (w_wc == (my_wc_t)w_many)
{
- result= 1; /* Found an anchor char */
+ result= 1; /* Found an anchor char */
break;
}
@@ -1078,7 +1086,7 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
if (w_wc == (my_wc_t)w_one)
{
- result= 1; /* Found an anchor char */
+ result= 1; /* Found an anchor char */
}
else
{
@@ -1103,7 +1111,8 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
/* Remove any '%' and '_' from the wild search string */
for ( ; wildstr != wildend ; )
{
- scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr, (const uchar*)wildend);
+ scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend);
if (scan <= 0)
return 1;
@@ -1116,7 +1125,8 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
if (w_wc == (my_wc_t)w_one)
{
wildstr+= scan;
- scan= my_ucs2_uni(cs, &s_wc, (const uchar*)str, (const uchar*)str_end);
+ scan= my_ucs2_uni(cs, &s_wc, (const uchar*)str,
+ (const uchar*)str_end);
if (scan <=0)
return 1;
str+= scan;
@@ -1131,14 +1141,16 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
if (str == str_end)
return -1;
- scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr, (const uchar*)wildend);
+ scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend);
if (scan <= 0)
return 1;
if (w_wc == (my_wc_t)escape)
{
wildstr+= scan;
- scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr, (const uchar*)wildend);
+ scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend);
if (scan <= 0)
return 1;
}
@@ -1148,7 +1160,8 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
/* Skip until the first character from wildstr is found */
while (str != str_end)
{
- scan= my_ucs2_uni(cs,&s_wc, (const uchar*)str, (const uchar*)str_end);
+ scan= my_ucs2_uni(cs,&s_wc, (const uchar*)str,
+ (const uchar*)str_end);
if (scan <= 0)
return 1;
if (weights)
@@ -1190,6 +1203,7 @@ int my_wildcmp_ucs2_ci(CHARSET_INFO *cs,
escape,w_one,w_many,uni_plane);
}
+
static
int my_wildcmp_ucs2_bin(CHARSET_INFO *cs,
const char *str,const char *str_end,
@@ -1232,6 +1246,7 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
return ( (se-s) - (te-t) );
}
+
static
int my_strcasecmp_ucs2_bin(CHARSET_INFO *cs, const char *s, const char *t)
{
@@ -1241,6 +1256,7 @@ int my_strcasecmp_ucs2_bin(CHARSET_INFO *cs, const char *s, const char *t)
return my_strncasecmp_ucs2(cs, s, t, len);
}
+
static
int my_strnxfrm_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
uchar *dst, uint dstlen,
@@ -1251,6 +1267,7 @@ int my_strnxfrm_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
return srclen;
}
+
static
void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
const uchar *key, uint len,ulong *nr1, ulong *nr2)
@@ -1280,6 +1297,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler =
my_hash_sort_ucs2
};
+
static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler =
{
my_strnncoll_ucs2_bin,
@@ -1292,13 +1310,14 @@ static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler =
my_hash_sort_ucs2_bin
};
+
static MY_CHARSET_HANDLER my_charset_ucs2_handler=
{
my_ismbchar_ucs2, /* ismbchar */
my_mbcharlen_ucs2, /* mbcharlen */
my_numchars_ucs2,
my_charpos_ucs2,
- my_wellformedlen_ucs2,
+ my_well_formed_len_ucs2,
my_lengthsp_ucs2,
my_ucs2_uni, /* mb_wc */
my_uni_ucs2, /* wc_mb */
@@ -1319,7 +1338,6 @@ static MY_CHARSET_HANDLER my_charset_ucs2_handler=
};
-
CHARSET_INFO my_charset_ucs2_general_ci=
{
35,0,0, /* number */
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index f27ddcf3e30..acb1d049a03 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -8444,7 +8444,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_ujis,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_euc_jp, /* mb_wc */
my_wc_mb_euc_jp, /* wc_mb */
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 64956c872aa..cafc43f3f70 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1969,7 +1969,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_mbcharlen_utf8,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_utf8_uni,
my_uni_utf8,