summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <hf@deer.mysql.r18.ru>2003-01-15 13:15:35 +0400
committerunknown <hf@deer.mysql.r18.ru>2003-01-15 13:15:35 +0400
commit150a238f033c3e3f8d67dfaa7d1616237738c1cb (patch)
tree937beb6f27e5e7958081a4a5ba13ceb2f5251396 /sql
parent09b79b65f225e7e7f66077f95b00e095cf454c3a (diff)
parent2d6f1c223d94fe874ac7acba089a1678f314dfac (diff)
downloadmariadb-git-150a238f033c3e3f8d67dfaa7d1616237738c1cb.tar.gz
resolving conflicts
BitKeeper/etc/logging_ok: auto-union client/mysql.cc: Auto merged client/mysqltest.c: Auto merged include/mysql.h: Auto merged include/mysql_com.h: Auto merged libmysqld/libmysqld.c: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/log.cc: Auto merged sql/mini_client.cc: Auto merged sql/mysql_priv.h: Auto merged sql/net_serv.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/slave.cc: Auto merged sql/slave.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_db.cc: Auto merged sql/sql_error.cc: Auto merged sql/sql_handler.cc: Auto merged sql/sql_help.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/log_event.cc: Conflicts resolving sql/log_event.h: conflicts sql/mysqld.cc: conflicts sql/opt_range.cc: conflicts sql/protocol.cc: conflicts sql/sql_show.cc: conflicts
Diffstat (limited to 'sql')
-rw-r--r--sql/Makefile.am2
-rw-r--r--sql/field.cc491
-rw-r--r--sql/field.h35
-rw-r--r--sql/filesort.cc6
-rw-r--r--sql/gstream.cc38
-rw-r--r--sql/ha_berkeley.cc28
-rw-r--r--sql/ha_berkeley.h1
-rw-r--r--sql/ha_innodb.cc97
-rw-r--r--sql/ha_innodb.h3
-rw-r--r--sql/ha_myisam.cc33
-rw-r--r--sql/ha_myisammrg.cc11
-rw-r--r--sql/item.cc259
-rw-r--r--sql/item.h250
-rw-r--r--sql/item_buff.cc2
-rw-r--r--sql/item_cmpfunc.cc127
-rw-r--r--sql/item_cmpfunc.h53
-rw-r--r--sql/item_create.cc14
-rw-r--r--sql/item_create.h1
-rw-r--r--sql/item_func.cc32
-rw-r--r--sql/item_func.h18
-rw-r--r--sql/item_row.cc46
-rw-r--r--sql/item_row.h22
-rw-r--r--sql/item_strfunc.cc121
-rw-r--r--sql/item_strfunc.h32
-rw-r--r--sql/item_subselect.cc413
-rw-r--r--sql/item_subselect.h79
-rw-r--r--sql/item_sum.cc44
-rw-r--r--sql/item_sum.h8
-rw-r--r--sql/item_timefunc.cc2
-rw-r--r--sql/key.cc3
-rw-r--r--sql/lex.h3
-rw-r--r--sql/log.cc28
-rw-r--r--sql/log_event.cc97
-rw-r--r--sql/log_event.h11
-rw-r--r--sql/mini_client.cc11
-rw-r--r--sql/mysql_priv.h25
-rw-r--r--sql/mysqld.cc575
-rw-r--r--sql/net_serv.cc233
-rw-r--r--sql/nt_servc.cc32
-rw-r--r--sql/opt_range.cc48
-rw-r--r--sql/opt_sum.cc3
-rw-r--r--sql/password.c2
-rw-r--r--sql/procedure.h5
-rw-r--r--sql/protocol.cc69
-rw-r--r--sql/repl_failsafe.cc2
-rw-r--r--sql/set_var.cc76
-rw-r--r--sql/set_var.h18
-rw-r--r--sql/share/Makefile.am5
-rw-r--r--sql/share/charsets/Index70
-rw-r--r--sql/share/charsets/Index.xml460
-rw-r--r--sql/share/charsets/MacCE.xml (renamed from sql/share/charsets/maccebin.conf)165
-rw-r--r--sql/share/charsets/MacRoman.xml (renamed from sql/share/charsets/macroman.conf)152
-rw-r--r--sql/share/charsets/armscii8.conf93
-rw-r--r--sql/share/charsets/armscii8.xml119
-rw-r--r--sql/share/charsets/ascii.xml (renamed from sql/share/charsets/cp1257bin.conf)109
-rw-r--r--sql/share/charsets/cp1250.xml (renamed from sql/share/charsets/win1250.conf)73
-rw-r--r--sql/share/charsets/cp1251.conf93
-rw-r--r--sql/share/charsets/cp1251.xml (renamed from sql/share/charsets/cp1251cias.conf)175
-rw-r--r--sql/share/charsets/cp1251bin.conf95
-rw-r--r--sql/share/charsets/cp1251csas.conf99
-rw-r--r--sql/share/charsets/cp1256.xml (renamed from sql/share/charsets/cp1256.conf)77
-rw-r--r--sql/share/charsets/cp1257.conf92
-rw-r--r--sql/share/charsets/cp1257.xml229
-rw-r--r--sql/share/charsets/cp1257ltlvciai.conf97
-rw-r--r--sql/share/charsets/cp1257ltlvcias.conf97
-rw-r--r--sql/share/charsets/cp1257ltlvcsas.conf97
-rw-r--r--sql/share/charsets/cp866.xml (renamed from sql/share/charsets/cp866.conf)78
-rw-r--r--sql/share/charsets/croat.conf92
-rw-r--r--sql/share/charsets/danish.conf92
-rw-r--r--sql/share/charsets/dec8.xml (renamed from sql/share/charsets/dec8.conf)73
-rw-r--r--sql/share/charsets/dos.conf93
-rw-r--r--sql/share/charsets/estonia.conf92
-rw-r--r--sql/share/charsets/german1.conf92
-rw-r--r--sql/share/charsets/greek.conf93
-rw-r--r--sql/share/charsets/greek.xml120
-rw-r--r--sql/share/charsets/hebrew.conf93
-rw-r--r--sql/share/charsets/hebrew.xml (renamed from sql/share/charsets/latin1bin.conf)100
-rw-r--r--sql/share/charsets/hp8.conf93
-rw-r--r--sql/share/charsets/hp8.xml120
-rw-r--r--sql/share/charsets/hungarian.conf92
-rw-r--r--sql/share/charsets/keybcs2.xml (renamed from sql/share/charsets/keybcs2.conf)71
-rw-r--r--sql/share/charsets/koi8_ru.conf93
-rw-r--r--sql/share/charsets/koi8r.xml119
-rw-r--r--sql/share/charsets/koi8u.xml (renamed from sql/share/charsets/koi8_ukr.conf)72
-rw-r--r--sql/share/charsets/latin1.conf92
-rw-r--r--sql/share/charsets/latin1.xml233
-rw-r--r--sql/share/charsets/latin1cias.conf97
-rw-r--r--sql/share/charsets/latin1csas.conf97
-rw-r--r--sql/share/charsets/latin2.conf92
-rw-r--r--sql/share/charsets/latin2.xml167
-rw-r--r--sql/share/charsets/latin5.conf96
-rw-r--r--sql/share/charsets/latin5.xml125
-rw-r--r--sql/share/charsets/latin7.xml168
-rw-r--r--sql/share/charsets/latvian.conf95
-rw-r--r--sql/share/charsets/latvian1.conf94
-rw-r--r--sql/share/charsets/macce.conf91
-rw-r--r--sql/share/charsets/macceciai.conf96
-rw-r--r--sql/share/charsets/maccecias.conf96
-rw-r--r--sql/share/charsets/maccecsas.conf96
-rw-r--r--sql/share/charsets/macromanbin.conf96
-rw-r--r--sql/share/charsets/macromanciai.conf97
-rw-r--r--sql/share/charsets/macromancias.conf97
-rw-r--r--sql/share/charsets/macromancsas.conf97
-rw-r--r--sql/share/charsets/pclatin1.xml119
-rw-r--r--sql/share/charsets/pclatin2.xml (renamed from sql/share/charsets/pclatin2.conf)70
-rw-r--r--sql/share/charsets/swe7.xml (renamed from sql/share/charsets/swe7.conf)73
-rw-r--r--sql/share/charsets/usa7.conf92
-rw-r--r--sql/share/charsets/win1251.conf100
-rw-r--r--sql/share/charsets/win1251ukr.conf95
-rw-r--r--sql/share/czech/errmsg.txt5
-rw-r--r--sql/share/danish/errmsg.txt5
-rw-r--r--sql/share/dutch/errmsg.txt5
-rw-r--r--sql/share/english/errmsg.txt9
-rw-r--r--sql/share/estonian/errmsg.txt5
-rw-r--r--sql/share/french/errmsg.txt5
-rw-r--r--sql/share/german/errmsg.txt5
-rw-r--r--sql/share/greek/errmsg.txt5
-rw-r--r--sql/share/hungarian/errmsg.txt5
-rw-r--r--sql/share/italian/errmsg.txt43
-rw-r--r--sql/share/japanese/errmsg.txt5
-rw-r--r--sql/share/korean/errmsg.txt5
-rw-r--r--sql/share/norwegian-ny/errmsg.txt5
-rw-r--r--sql/share/norwegian/errmsg.txt5
-rw-r--r--sql/share/polish/errmsg.txt5
-rw-r--r--sql/share/portuguese/errmsg.txt5
-rw-r--r--sql/share/romanian/errmsg.txt5
-rw-r--r--sql/share/russian/errmsg.txt5
-rw-r--r--sql/share/serbian/errmsg.txt5
-rw-r--r--sql/share/slovak/errmsg.txt5
-rw-r--r--sql/share/spanish/errmsg.txt5
-rw-r--r--sql/share/swedish/errmsg.txt5
-rw-r--r--sql/share/ukrainian/errmsg.txt5
-rw-r--r--sql/slave.cc17
-rw-r--r--sql/slave.h10
-rw-r--r--sql/spatial.cc10
-rw-r--r--sql/sql_acl.cc2
-rw-r--r--sql/sql_analyse.cc1
-rw-r--r--sql/sql_base.cc81
-rw-r--r--sql/sql_cache.cc2
-rw-r--r--sql/sql_class.cc50
-rw-r--r--sql/sql_class.h23
-rw-r--r--sql/sql_db.cc23
-rw-r--r--sql/sql_delete.cc4
-rw-r--r--sql/sql_derived.cc117
-rw-r--r--sql/sql_error.cc32
-rw-r--r--sql/sql_handler.cc12
-rw-r--r--sql/sql_help.cc34
-rw-r--r--sql/sql_insert.cc21
-rw-r--r--sql/sql_lex.cc20
-rw-r--r--sql/sql_lex.h11
-rw-r--r--sql/sql_load.cc15
-rw-r--r--sql/sql_olap.cc12
-rw-r--r--sql/sql_parse.cc222
-rw-r--r--sql/sql_prepare.cc59
-rw-r--r--sql/sql_repl.cc75
-rw-r--r--sql/sql_select.cc164
-rw-r--r--sql/sql_select.h1
-rw-r--r--sql/sql_show.cc54
-rw-r--r--sql/sql_string.cc152
-rw-r--r--sql/sql_string.h3
-rw-r--r--sql/sql_table.cc195
-rw-r--r--sql/sql_test.cc3
-rw-r--r--sql/sql_udf.cc27
-rw-r--r--sql/sql_union.cc7
-rw-r--r--sql/sql_update.cc8
-rw-r--r--sql/sql_yacc.yy220
-rw-r--r--sql/stacktrace.c6
-rw-r--r--sql/structs.h2
-rw-r--r--sql/table.cc2
-rw-r--r--sql/table.h2
170 files changed, 6713 insertions, 5398 deletions
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 245e4c5d258..c4b641f714b 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -52,7 +52,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
field.h handler.h \
ha_isammrg.h ha_isam.h ha_myisammrg.h\
ha_heap.h ha_myisam.h ha_berkeley.h ha_innodb.h \
- opt_range.h opt_ft.h \
+ opt_range.h opt_ft.h protocol.h \
sql_select.h structs.h table.h sql_udf.h hash_filo.h\
lex.h lex_symbol.h sql_acl.h sql_crypt.h \
log_event.h mini_client.h sql_repl.h slave.h \
diff --git a/sql/field.cc b/sql/field.cc
index c3feb0b8826..dfc41f37205 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -34,8 +34,6 @@
// Maximum allowed exponent value for converting string to decimal
#define MAX_EXPONENT 1024
-
-
/*****************************************************************************
Instansiate templates and static variables
*****************************************************************************/
@@ -67,39 +65,44 @@ void Field_num::prepend_zeros(String *value)
/*
Test if given number is a int (or a fixed format float with .000)
- This is only used to give warnings in ALTER TABLE or LOAD DATA...
+
+ SYNOPSIS
+ test_if_int()
+ str String to test
+ end Pointer to char after last used digit
+ cs Character set
+
+ NOTES
+ This is called after one has called my_strntol() or similar function.
+ This is only used to give warnings in ALTER TABLE or LOAD DATA...
+
+ TODO
+ Make this multi-byte-character safe
+
+ RETURN
+ 0 ok
+ 1 error
*/
-bool test_if_int(const char *str,int length, CHARSET_INFO *cs)
+bool test_if_int(const char *str, int length, const char *int_end,
+ CHARSET_INFO *cs)
{
+ if (str == int_end)
+ return 0; // Empty string
const char *end=str+length;
+ if ((str= int_end) == end)
+ return 1; // All digits was used
- cs=system_charset_info; // QQ move test_if_int into CHARSET_INFO struct
-
- // Allow start space
- while (str != end && my_isspace(cs,*str))
- str++; /* purecov: inspected */
- if (str != end && (*str == '-' || *str == '+'))
- str++;
- if (str == end)
- return 0; // Error: Empty string
- for (; str != end ; str++)
+ /* Allow end .0000 */
+ if (*str == '.')
{
- if (!my_isdigit(cs,*str))
- {
- if (*str == '.')
- { // Allow '.0000'
- for (str++ ; str != end && *str == '0'; str++) ;
- if (str == end)
- return 1;
- }
- if (!my_isspace(cs,*str))
- return 0;
- for (str++ ; str != end ; str++)
- if (!my_isspace(cs,*str))
- return 0;
- return 1;
- }
+ for (str++ ; str != end && *str == '0'; str++) ;
+ }
+ /* Allow end space */
+ for (str++ ; str != end ; str++)
+ {
+ if (!my_isspace(cs,*str))
+ return 0;
}
return 1;
}
@@ -107,7 +110,7 @@ bool test_if_int(const char *str,int length, CHARSET_INFO *cs)
static bool test_if_real(const char *str,int length, CHARSET_INFO *cs)
{
- cs=system_charset_info; // QQ move test_if_int into CHARSET_INFO struct
+ cs= system_charset_info; // QQ move test_if_real into CHARSET_INFO struct
while (length && my_isspace(cs,*str))
{ // Allow start space
@@ -207,17 +210,10 @@ bool Field::send_binary(Protocol *protocol)
void Field_num::add_zerofill_and_unsigned(String &res) const
{
- uint oldlen=res.length();
- if (oldlen < res.alloced_length())
- {
- uint len=res.alloced_length()-oldlen;
- char *end=(char*)(res.ptr()+oldlen);
- CHARSET_INFO *cs=res.charset();
- len=cs->snprintf(cs,end,len,"%s%s",
- unsigned_flag ? " unsigned" : "",
- zerofill ? " zerofill" : "");
- res.length(len+oldlen);
- }
+ if (unsigned_flag)
+ res.append(" unsigned");
+ if (zerofill)
+ res.append(" zerofill");
}
void Field_num::make_field(Send_field *field)
@@ -247,19 +243,15 @@ void Field_str::make_field(Send_field *field)
field->decimals=0;
}
+
void Field_str::add_binary_or_charset(String &res) const
{
- uint oldlen=res.length();
- if (oldlen < res.alloced_length())
+ if (binary())
+ res.append(" binary");
+ else if (field_charset != table->table_charset)
{
- CHARSET_INFO *cs=res.charset();
- uint len=res.alloced_length() - oldlen;
- char *end=(char*)(res.ptr()+oldlen);
- if (binary())
- len=cs->snprintf(cs,end,len," binary");
- else
- len=cs->snprintf(cs,end,len," character set %s",field_charset->name);
- res.length(oldlen+len);
+ res.append(" character set ");
+ res.append(field_charset->csname);
}
}
@@ -287,7 +279,7 @@ uint Field::fill_cache_field(CACHE_FIELD *copy)
bool Field::get_date(TIME *ltime,bool fuzzydate)
{
char buff[40];
- String tmp(buff,sizeof(buff),my_charset_latin1),tmp2,*res;
+ String tmp(buff,sizeof(buff),my_charset_bin),tmp2,*res;
if (!(res=val_str(&tmp,&tmp2)) ||
str_to_TIME(res->ptr(),res->length(),ltime,fuzzydate) == TIMESTAMP_NONE)
return 1;
@@ -297,7 +289,7 @@ bool Field::get_date(TIME *ltime,bool fuzzydate)
bool Field::get_time(TIME *ltime)
{
char buff[40];
- String tmp(buff,sizeof(buff),my_charset_latin1),tmp2,*res;
+ String tmp(buff,sizeof(buff),my_charset_bin),tmp2,*res;
if (!(res=val_str(&tmp,&tmp2)) ||
str_to_time(res->ptr(),res->length(),ltime))
return 1;
@@ -311,23 +303,23 @@ void Field::store_time(TIME *ltime,timestamp_type type)
char buff[25];
switch (type) {
case TIMESTAMP_NONE:
- store("",0,my_charset_latin1); // Probably an error
+ store("",0,my_charset_bin); // Probably an error
break;
case TIMESTAMP_DATE:
sprintf(buff,"%04d-%02d-%02d", ltime->year,ltime->month,ltime->day);
- store(buff,10,my_charset_latin1);
+ store(buff,10,my_charset_bin);
break;
case TIMESTAMP_FULL:
sprintf(buff,"%04d-%02d-%02d %02d:%02d:%02d",
ltime->year,ltime->month,ltime->day,
ltime->hour,ltime->minute,ltime->second);
- store(buff,19,my_charset_latin1);
+ store(buff,19,my_charset_bin);
break;
case TIMESTAMP_TIME:
{
ulong length= my_sprintf(buff, (buff, "%02d:%02d:%02d",
ltime->hour,ltime->minute,ltime->second));
- store(buff,(uint) length, my_charset_latin1);
+ store(buff,(uint) length, my_charset_bin);
break;
}
}
@@ -340,15 +332,12 @@ bool Field::optimize_range(uint idx)
}
/****************************************************************************
- Functions for the Field_null
+ Field_null, a field that always return NULL
****************************************************************************/
void Field_null::sql_type(String &res) const
{
- CHARSET_INFO *cs=res.charset();
- uint len;
- len=cs->snprintf(cs,(char*)res.ptr(),res.alloced_length(),"null");
- res.length(len);
+ res.set_latin1("null", 4);
}
@@ -360,7 +349,7 @@ void Field_null::sql_type(String &res) const
void
Field_decimal::reset(void)
{
- Field_decimal::store("0",1,my_charset_latin1);
+ Field_decimal::store("0",1,my_charset_bin);
}
void Field_decimal::overflow(bool negative)
@@ -404,11 +393,16 @@ void Field_decimal::overflow(bool negative)
int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
{
- String l1from;
+ char buff[80];
+ String tmp(buff,sizeof(buff), my_charset_bin);
- l1from.copy(from,len,cs,my_charset_latin1);
- from=l1from.ptr();
- len=l1from.length();
+ /* Convert character set if the old one is multi byte */
+ if (cs->mbmaxlen > 1)
+ {
+ tmp.copy(from, len, cs, my_charset_bin);
+ from= tmp.ptr();
+ len= tmp.length();
+ }
const char *end= from+len;
/* The pointer where the field value starts (i.e., "where to write") */
@@ -461,7 +455,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
There are three steps in this function :
- parse the input string
- modify the position of digits around the decimal dot '.'
- according to the exponent value (if specified)
+ according to the exponent value (if specified)
- write the formatted number
*/
@@ -469,7 +463,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
tmp_dec++;
/* skip pre-space */
- while (from != end && my_isspace(my_charset_latin1,*from))
+ while (from != end && my_isspace(my_charset_bin,*from))
from++;
if (from == end)
{
@@ -506,13 +500,13 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
for (; from!=end && *from == '0'; from++) ; // Read prezeros
pre_zeros_end=int_digits_from=from;
/* Read non zero digits at the left of '.'*/
- for (; from != end && my_isdigit(my_charset_latin1, *from) ; from++) ;
+ for (; from != end && my_isdigit(my_charset_bin, *from) ; from++) ;
int_digits_end=from;
if (from!=end && *from == '.') // Some '.' ?
from++;
frac_digits_from= from;
/* Read digits at the right of '.' */
- for (;from!=end && my_isdigit(my_charset_latin1, *from); from++) ;
+ for (;from!=end && my_isdigit(my_charset_bin, *from); from++) ;
frac_digits_end=from;
// Some exponentiation symbol ?
if (from != end && (*from == 'e' || *from == 'E'))
@@ -528,7 +522,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
exponents will become small (e.g. 1e4294967296 will become 1e0, and the
field will finally contain 1 instead of its max possible value).
*/
- for (;from!=end && my_isdigit(my_charset_latin1, *from); from++)
+ for (;from!=end && my_isdigit(my_charset_bin, *from); from++)
{
exponent=10*exponent+(*from-'0');
if (exponent>MAX_EXPONENT)
@@ -546,7 +540,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
if (current_thd->count_cuted_fields)
{
// Skip end spaces
- for (;from != end && my_isspace(my_charset_latin1, *from); from++) ;
+ for (;from != end && my_isspace(my_charset_bin, *from); from++) ;
if (from != end) // If still something left, warn
{
current_thd->cuted_fields++;
@@ -838,30 +832,29 @@ int Field_decimal::store(longlong nr)
double Field_decimal::val_real(void)
{
- CHARSET_INFO *cs=charset();
- return my_strntod(cs,ptr,field_length,NULL);
+ return my_strntod(my_charset_bin, ptr, field_length, NULL);
}
longlong Field_decimal::val_int(void)
{
- CHARSET_INFO *cs=charset();
if (unsigned_flag)
- return my_strntoull(cs,ptr,field_length,NULL,10);
+ return my_strntoull(my_charset_bin, ptr, field_length, NULL, 10);
else
- return my_strntoll(cs,ptr,field_length,NULL,10);
+ return my_strntoll( my_charset_bin, ptr, field_length, NULL, 10);
}
+
String *Field_decimal::val_str(String *val_buffer __attribute__((unused)),
String *val_ptr)
{
char *str;
- CHARSET_INFO *cs=current_thd->variables.thd_charset;
for (str=ptr ; *str == ' ' ; str++) ;
uint tmp_length=(uint) (str-ptr);
+ val_ptr->set_charset(my_charset_bin);
if (field_length < tmp_length) // Error in data
val_ptr->length(0);
else
- val_ptr->copy((const char*) str,field_length-tmp_length,my_charset_latin1,cs);
+ val_ptr->set_latin1((const char*) str, field_length-tmp_length);
return val_ptr;
}
@@ -878,9 +871,9 @@ int Field_decimal::cmp(const char *a_ptr,const char *b_ptr)
for (end=a_ptr+field_length;
a_ptr != end &&
(*a_ptr == *b_ptr ||
- ((my_isspace(my_charset_latin1,*a_ptr) || *a_ptr == '+' ||
+ ((my_isspace(my_charset_bin,*a_ptr) || *a_ptr == '+' ||
*a_ptr == '0') &&
- (my_isspace(my_charset_latin1,*b_ptr) || *b_ptr == '+' ||
+ (my_isspace(my_charset_bin,*b_ptr) || *b_ptr == '+' ||
*b_ptr == '0')));
a_ptr++,b_ptr++)
{
@@ -908,7 +901,7 @@ void Field_decimal::sort_string(char *to,uint length)
char *str,*end;
for (str=ptr,end=ptr+length;
str != end &&
- ((my_isspace(my_charset_latin1,*str) || *str == '+' ||
+ ((my_isspace(my_charset_bin,*str) || *str == '+' ||
*str == '0')) ;
str++)
*to++=' ';
@@ -920,7 +913,7 @@ void Field_decimal::sort_string(char *to,uint length)
*to++=1; // Smaller than any number
str++;
while (str != end)
- if (my_isdigit(my_charset_latin1,*str))
+ if (my_isdigit(my_charset_bin,*str))
*to++= (char) ('9' - *str++);
else
*to++= *str++;
@@ -933,14 +926,12 @@ void Field_decimal::sql_type(String &res) const
{
CHARSET_INFO *cs=res.charset();
uint tmp=field_length;
- uint len;
if (!unsigned_flag)
tmp--;
if (dec)
tmp--;
- len=cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
- "decimal(%d,%d)",tmp,dec);
- res.length(len);
+ res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
+ "decimal(%d,%d)",tmp,dec));
add_zerofill_and_unsigned(res);
}
@@ -951,7 +942,8 @@ void Field_decimal::sql_type(String &res) const
int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs)
{
- long tmp= my_strntol(cs,from,len,(char **)NULL,10);
+ char *end;
+ long tmp= my_strntol(cs, from, len, &end,10);
int error= 0;
if (unsigned_flag)
@@ -968,7 +960,7 @@ int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs)
current_thd->cuted_fields++;
error= 1;
}
- else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
+ else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs))
{
current_thd->cuted_fields++;
error= 1;
@@ -988,7 +980,7 @@ int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs)
current_thd->cuted_fields++;
error= 1;
}
- else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
+ else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs))
{
current_thd->cuted_fields++;
error= 1;
@@ -1098,7 +1090,7 @@ longlong Field_tiny::val_int(void)
String *Field_tiny::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- CHARSET_INFO *cs=current_thd->variables.thd_charset;
+ CHARSET_INFO *cs= my_charset_bin;
uint length;
uint mlength=max(field_length+1,5*cs->mbmaxlen);
val_buffer->alloc(mlength);
@@ -1140,22 +1132,19 @@ void Field_tiny::sort_string(char *to,uint length __attribute__((unused)))
void Field_tiny::sql_type(String &res) const
{
CHARSET_INFO *cs=res.charset();
- uint len=cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
- "tinyint(%d)",(int) field_length);
- res.length(len);
+ res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
+ "tinyint(%d)",(int) field_length));
add_zerofill_and_unsigned(res);
}
/****************************************************************************
-** short int
+ Field type short int (2 byte)
****************************************************************************/
-
-// Note: Sometimes this should be fixed to check for garbage after number.
-
int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
{
- long tmp= my_strntol(cs,from,len,NULL,10);
+ char *end;
+ long tmp= my_strntol(cs, from, len, &end, 10);
int error= 0;
if (unsigned_flag)
{
@@ -1171,7 +1160,7 @@ int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
current_thd->cuted_fields++;
error= 1;
}
- else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
+ else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs))
{
current_thd->cuted_fields++;
error= 1;
@@ -1191,7 +1180,7 @@ int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
current_thd->cuted_fields++;
error= 1;
}
- else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
+ else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs))
{
current_thd->cuted_fields++;
error= 1;
@@ -1337,7 +1326,7 @@ longlong Field_short::val_int(void)
String *Field_short::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- CHARSET_INFO *cs=current_thd->variables.thd_charset;
+ CHARSET_INFO *cs= my_charset_bin;
uint length;
uint mlength=max(field_length+1,7*cs->mbmaxlen);
val_buffer->alloc(mlength);
@@ -1351,9 +1340,9 @@ String *Field_short::val_str(String *val_buffer,
shortget(j,ptr);
if (unsigned_flag)
- length=(uint) cs->l10tostr(cs,to,mlength, 10, (long) (uint16) j);
+ length=(uint) cs->l10tostr(cs, to, mlength, 10, (long) (uint16) j);
else
- length=(uint) cs->l10tostr(cs,to,mlength,-10, (long) j);
+ length=(uint) cs->l10tostr(cs, to, mlength,-10, (long) j);
val_buffer->length(length);
if (zerofill)
prepend_zeros(val_buffer);
@@ -1414,22 +1403,20 @@ void Field_short::sort_string(char *to,uint length __attribute__((unused)))
void Field_short::sql_type(String &res) const
{
CHARSET_INFO *cs=res.charset();
- uint len=cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
- "smallint(%d)",(int) field_length);
- res.length(len);
+ res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
+ "smallint(%d)",(int) field_length));
add_zerofill_and_unsigned(res);
}
/****************************************************************************
-** medium int
+ Field type medium int (3 byte)
****************************************************************************/
-// Note: Sometimes this should be fixed to check for garbage after number.
-
int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs)
{
- long tmp= my_strntol(cs,from,len,NULL,10);
+ char *end;
+ long tmp= my_strntol(cs, from, len, &end, 10);
int error= 0;
if (unsigned_flag)
@@ -1446,7 +1433,7 @@ int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs)
current_thd->cuted_fields++;
error= 1;
}
- else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
+ else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs))
{
current_thd->cuted_fields++;
error= 1;
@@ -1466,7 +1453,7 @@ int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs)
current_thd->cuted_fields++;
error= 1;
}
- else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
+ else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs))
{
current_thd->cuted_fields++;
error= 1;
@@ -1572,16 +1559,18 @@ double Field_medium::val_real(void)
return (double) j;
}
+
longlong Field_medium::val_int(void)
{
long j= unsigned_flag ? (long) uint3korr(ptr) : sint3korr(ptr);
return (longlong) j;
}
+
String *Field_medium::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- CHARSET_INFO *cs=current_thd->variables.thd_charset;
+ CHARSET_INFO *cs= my_charset_bin;
uint length;
uint mlength=max(field_length+1,10*cs->mbmaxlen);
val_buffer->alloc(mlength);
@@ -1632,9 +1621,8 @@ void Field_medium::sort_string(char *to,uint length __attribute__((unused)))
void Field_medium::sql_type(String &res) const
{
CHARSET_INFO *cs=res.charset();
- uint len=cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
- "mediumint(%d)",(int) field_length);
- res.length(len);
+ res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
+ "mediumint(%d)",(int) field_length));
add_zerofill_and_unsigned(res);
}
@@ -1643,26 +1631,23 @@ void Field_medium::sql_type(String &res) const
****************************************************************************/
-// Note: Sometimes this should be fixed to check for garbage after number.
-
int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
{
+ long tmp;
+ int error= 0;
char *end;
+ /* TODO: Make multi-byte-character safe */
while (len && my_isspace(cs,*from))
{
len--; from++;
}
- long tmp;
- String tmp_str(from, len, cs);
- from= tmp_str.c_ptr(); // Add end null if needed
- int error= 0;
- errno=0;
+ my_errno=0;
if (unsigned_flag)
{
if (!len || *from == '-')
{
tmp=0; // Set negative to 0
- errno=ERANGE;
+ my_errno=ERANGE;
error= 1;
}
else
@@ -1670,9 +1655,9 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
}
else
tmp=my_strntol(cs,from,len,&end,10);
- if (errno ||
+ if (my_errno ||
(from+len != end && current_thd->count_cuted_fields &&
- !test_if_int(from,len,cs)))
+ !test_if_int(from,len,end,cs)))
{
current_thd->cuted_fields++;
error= 1;
@@ -1817,7 +1802,7 @@ longlong Field_long::val_int(void)
String *Field_long::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- CHARSET_INFO *cs=current_thd->variables.thd_charset;
+ CHARSET_INFO *cs= my_charset_bin;
uint length;
uint mlength=max(field_length+1,12*cs->mbmaxlen);
val_buffer->alloc(mlength);
@@ -1896,34 +1881,32 @@ void Field_long::sort_string(char *to,uint length __attribute__((unused)))
void Field_long::sql_type(String &res) const
{
CHARSET_INFO *cs=res.charset();
- uint len=cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
- "int(%d)",(int) field_length);
- res.length(len);
+ res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
+ "int(%d)",(int) field_length));
add_zerofill_and_unsigned(res);
}
/****************************************************************************
-** longlong int
+ Field type longlong int (8 bytes)
****************************************************************************/
int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
{
+ longlong tmp;
+ int error= 0;
char *end;
+ /* TODO: Make multi byte safe */
while (len && my_isspace(cs,*from))
{ // For easy error check
len--; from++;
}
- longlong tmp;
- String tmp_str(from, len, cs);
- from= tmp_str.c_ptr(); // Add end null if needed
- int error= 0;
- errno=0;
+ my_errno=0;
if (unsigned_flag)
{
if (!len || *from == '-')
{
tmp=0; // Set negative to 0
- errno=ERANGE;
+ my_errno= ERANGE;
error= 1;
}
else
@@ -1931,9 +1914,9 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
}
else
tmp=my_strntoll(cs,from,len,&end,10);
- if (errno ||
+ if (my_errno ||
(from+len != end && current_thd->count_cuted_fields &&
- !test_if_int(from,len,cs)))
+ !test_if_int(from,len,end,cs)))
current_thd->cuted_fields++;
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
@@ -2042,7 +2025,7 @@ longlong Field_longlong::val_int(void)
String *Field_longlong::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- CHARSET_INFO *cs=current_thd->variables.thd_charset;
+ CHARSET_INFO *cs= my_charset_bin;
uint length;
uint mlength=max(field_length+1,22*cs->mbmaxlen);
val_buffer->alloc(mlength);
@@ -2128,9 +2111,8 @@ void Field_longlong::sort_string(char *to,uint length __attribute__((unused)))
void Field_longlong::sql_type(String &res) const
{
CHARSET_INFO *cs=res.charset();
- uint len=cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
- "bigint(%d)",(int) field_length);
- res.length(len);
+ res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
+ "bigint(%d)",(int) field_length));
add_zerofill_and_unsigned(res);
}
@@ -2140,8 +2122,8 @@ void Field_longlong::sql_type(String &res) const
int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
{
- errno=0;
- Field_float::store(my_strntod(cs,from,len,(char**)NULL));
+ errno=0; // my_strntod() changes errno
+ Field_float::store(my_strntod(cs,(char*) from,len,(char**)NULL));
if (errno || current_thd->count_cuted_fields && !test_if_real(from,len,cs))
{
current_thd->cuted_fields++;
@@ -2394,18 +2376,16 @@ bool Field_float::send_binary(Protocol *protocol)
void Field_float::sql_type(String &res) const
{
- CHARSET_INFO *cs=res.charset();
- uint len;
if (dec == NOT_FIXED_DEC)
{
- len=cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),"float");
+ res.set_latin1("float", 5);
}
else
{
- len=cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
- "float(%d,%d)",(int) field_length,dec);
+ CHARSET_INFO *cs= res.charset();
+ res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
+ "float(%d,%d)",(int) field_length,dec));
}
- res.length(len);
add_zerofill_and_unsigned(res);
}
@@ -2415,9 +2395,9 @@ void Field_float::sql_type(String &res) const
int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
{
- errno=0;
+ errno=0; // my_strntod() changes errno
int error= 0;
- double j= my_strntod(cs,from,len,(char**)0);
+ double j= my_strntod(cs,(char*) from,len,(char**)0);
if (errno || current_thd->count_cuted_fields && !test_if_real(from,len,cs))
{
current_thd->cuted_fields++;
@@ -2599,7 +2579,7 @@ String *Field_double::val_str(String *val_buffer,
bool Field_double::send_binary(Protocol *protocol)
{
- return protocol->store((float) Field_double::val_real(), dec, (String*) 0);
+ return protocol->store((double) Field_double::val_real(), dec, (String*) 0);
}
@@ -2655,17 +2635,15 @@ void Field_double::sort_string(char *to,uint length __attribute__((unused)))
void Field_double::sql_type(String &res) const
{
CHARSET_INFO *cs=res.charset();
- uint len;
if (dec == NOT_FIXED_DEC)
{
- len=cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),"double");
+ res.set_latin1("double",6);
}
else
{
- len=cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
- "double(%d,%d)",(int) field_length,dec);
+ res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
+ "double(%d,%d)",(int) field_length,dec));
}
- res.length(len);
add_zerofill_and_unsigned(res);
}
@@ -2722,9 +2700,9 @@ int Field_timestamp::store(double nr)
/*
-** Convert a datetime of formats YYMMDD, YYYYMMDD or YYMMDDHHMSS to
-** YYYYMMDDHHMMSS. The high date '99991231235959' is checked before this
-** function.
+ Convert a datetime of formats YYMMDD, YYYYMMDD or YYMMDDHHMSS to
+ YYYYMMDDHHMMSS. The high date '99991231235959' is checked before this
+ function.
*/
static longlong fix_datetime(longlong nr)
@@ -2797,7 +2775,6 @@ double Field_timestamp::val_real(void)
longlong Field_timestamp::val_int(void)
{
- uint len,pos;
int part_time;
uint32 temp;
time_t time_arg;
@@ -2855,9 +2832,10 @@ String *Field_timestamp::val_str(String *val_buffer,
if (temp == 0L)
{ /* Zero time is "000000" */
- strmov(to, "0000-00-00 00:00:00");
- return val_buffer;
+ val_ptr->set("0000-00-00 00:00:00", 19, my_charset_bin);
+ return val_ptr;
}
+ val_buffer->set_charset(my_charset_bin); // Safety
time_arg=(time_t) temp;
localtime_r(&time_arg,&tm_tmp);
l_time=&tm_tmp;
@@ -2996,9 +2974,7 @@ void Field_timestamp::sort_string(char *to,uint length __attribute__((unused)))
void Field_timestamp::sql_type(String &res) const
{
- CHARSET_INFO *cs=res.charset();
- uint len=cs->snprintf(cs,(char*)res.ptr(),res.alloced_length(),"timestamp");
- res.length(len);
+ res.set_latin1("timestamp", 9);
}
@@ -3126,6 +3102,12 @@ longlong Field_time::val_int(void)
return (longlong) sint3korr(ptr);
}
+
+/*
+ This function is multi-byte safe as the result string is always of type
+ my_charset_bin
+*/
+
String *Field_time::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
@@ -3169,7 +3151,7 @@ bool Field_time::send_binary(Protocol *protocol)
Field_time::get_time(&tm);
tm.day= tm.hour/3600; // Move hours to days
tm.hour-= tm.day*3600;
- return protocol->store(&tm);
+ return protocol->store_time(&tm);
}
@@ -3190,9 +3172,7 @@ void Field_time::sort_string(char *to,uint length __attribute__((unused)))
void Field_time::sql_type(String &res) const
{
- CHARSET_INFO *cs=res.charset();
- uint len=cs->snprintf(cs,(char*)res.ptr(),res.alloced_length(),"time");
- res.length(len);
+ res.set_latin1("time", 4);
}
/****************************************************************************
@@ -3203,7 +3183,8 @@ void Field_time::sql_type(String &res) const
int Field_year::store(const char *from, uint len,CHARSET_INFO *cs)
{
- long nr= my_strntol(cs,from,len,NULL,10);
+ char *end;
+ long nr= my_strntol(cs, from, len, &end, 10);
if (nr < 0 || nr >= 100 && nr <= 1900 || nr > 2155)
{
@@ -3211,7 +3192,7 @@ int Field_year::store(const char *from, uint len,CHARSET_INFO *cs)
current_thd->cuted_fields++;
return 1;
}
- else if (current_thd->count_cuted_fields && !test_if_int(from,len,cs))
+ else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs))
current_thd->cuted_fields++;
if (nr != 0 || len != 4)
{
@@ -3254,6 +3235,11 @@ int Field_year::store(longlong nr)
return 0;
}
+bool Field_year::send_binary(Protocol *protocol)
+{
+ ulonglong tmp= Field_year::val_int();
+ return protocol->store_short(tmp);
+}
double Field_year::val_real(void)
{
@@ -3283,9 +3269,8 @@ String *Field_year::val_str(String *val_buffer,
void Field_year::sql_type(String &res) const
{
CHARSET_INFO *cs=res.charset();
- ulong len=cs->snprintf(cs,(char*)res.ptr(),res.alloced_length(),
- "year(%d)",(int) field_length);
- res.length(len);
+ res.length(cs->snprintf(cs,(char*)res.ptr(),res.alloced_length(),
+ "year(%d)",(int) field_length));
}
@@ -3372,6 +3357,17 @@ int Field_date::store(longlong nr)
}
+bool Field_date::send_binary(Protocol *protocol)
+{
+ longlong tmp= Field_date::val_int();
+ TIME tm;
+ tm.year= (uint32) tmp/10000L % 10000;
+ tm.month= (uint32) tmp/100 % 100;
+ tm.day= (uint32) tmp % 100;
+ return protocol->store_date(&tm);
+}
+
+
double Field_date::val_real(void)
{
int32 j;
@@ -3455,9 +3451,7 @@ void Field_date::sort_string(char *to,uint length __attribute__((unused)))
void Field_date::sql_type(String &res) const
{
- CHARSET_INFO *cs=res.charset();
- uint len=cs->snprintf(cs,(char*)res.ptr(),res.alloced_length(),"date");
- res.length(len);
+ res.set_latin1("date", 4);
}
/****************************************************************************
@@ -3544,7 +3538,12 @@ void Field_newdate::store_time(TIME *ltime,timestamp_type type)
int3store(ptr,tmp);
}
-
+bool Field_newdate::send_binary(Protocol *protocol)
+{
+ TIME tm;
+ Field_newdate::get_date(&tm,0);
+ return protocol->store_date(&tm);
+}
double Field_newdate::val_real(void)
{
@@ -3620,9 +3619,7 @@ void Field_newdate::sort_string(char *to,uint length __attribute__((unused)))
void Field_newdate::sql_type(String &res) const
{
- CHARSET_INFO *cs=res.charset();
- uint len=cs->snprintf(cs,(char*)res.ptr(),res.alloced_length(),"date");
- res.length(len);
+ res.set_latin1("date", 4);
}
@@ -3705,6 +3702,13 @@ void Field_datetime::store_time(TIME *ltime,timestamp_type type)
longlongstore(ptr,tmp);
}
+bool Field_datetime::send_binary(Protocol *protocol)
+{
+ TIME tm;
+ Field_datetime::get_date(&tm, 1);
+ return protocol->store(&tm);
+}
+
double Field_datetime::val_real(void)
{
@@ -3846,9 +3850,7 @@ void Field_datetime::sort_string(char *to,uint length __attribute__((unused)))
void Field_datetime::sql_type(String &res) const
{
- CHARSET_INFO *cs=res.charset();
- uint len=cs->snprintf(cs,(char*)res.ptr(),res.alloced_length(),"datetime");
- res.length(len);
+ res.set_latin1("datetime", 8);
}
/****************************************************************************
@@ -3903,7 +3905,7 @@ int Field_string::store(double nr)
int width=min(field_length,DBL_DIG+5);
sprintf(buff,"%-*.*g",width,max(width-5,0),nr);
end=strcend(buff,' ');
- return Field_string::store(buff,(uint) (end - buff), my_charset_latin1);
+ return Field_string::store(buff,(uint) (end - buff), my_charset_bin);
}
@@ -3926,7 +3928,6 @@ double Field_string::val_real(void)
longlong Field_string::val_int(void)
{
- longlong value;
CHARSET_INFO *cs=charset();
return my_strntoll(cs,ptr,field_length,NULL,10);
}
@@ -4016,11 +4017,6 @@ int Field_string::pack_cmp(const char *a, const char *b, uint length)
uint a_length= (uint) (uchar) *a++;
uint b_length= (uint) (uchar) *b++;
- if (binary())
- {
- int cmp= memcmp(a,b,min(a_length,b_length));
- return cmp ? cmp : (int) (a_length - b_length);
- }
return my_strnncoll(field_charset,
(const uchar*)a,a_length,
(const uchar*)b,b_length);
@@ -4035,11 +4031,6 @@ int Field_string::pack_cmp(const char *b, uint length)
end--;
uint a_length = (uint) (end - ptr);
- if (binary())
- {
- int cmp= memcmp(ptr,b,min(a_length,b_length));
- return cmp ? cmp : (int) (a_length - b_length);
- }
return my_strnncoll(field_charset,
(const uchar*)ptr,a_length,
(const uchar*)b, b_length);
@@ -4093,7 +4084,7 @@ int Field_varstring::store(double nr)
int width=min(field_length,DBL_DIG+5);
sprintf(buff,"%-*.*g",width,max(width-5,0),nr);
end=strcend(buff,' ');
- return Field_varstring::store(buff,(uint) (end - buff), my_charset_latin1);
+ return Field_varstring::store(buff,(uint) (end - buff), my_charset_bin);
}
@@ -4230,11 +4221,6 @@ int Field_varstring::pack_cmp(const char *a, const char *b, uint key_length)
a_length= (uint) (uchar) *a++;
b_length= (uint) (uchar) *b++;
}
- if (binary())
- {
- int cmp= memcmp(a,b,min(a_length,b_length));
- return cmp ? cmp : (int) (a_length - b_length);
- }
return my_strnncoll(field_charset,
(const uchar *)a,a_length,
(const uchar *)b,b_length);
@@ -4253,11 +4239,6 @@ int Field_varstring::pack_cmp(const char *b, uint key_length)
{
b_length= (uint) (uchar) *b++;
}
- if (binary())
- {
- int cmp= memcmp(a,b,min(a_length,b_length));
- return cmp ? cmp : (int) (a_length - b_length);
- }
return my_strnncoll(field_charset,
(const uchar *)a,a_length,
(const uchar *)b,b_length);
@@ -4276,7 +4257,7 @@ uint Field_varstring::max_packed_col_length(uint max_length)
return (max_length > 255 ? 2 : 1)+max_length;
}
-void Field_varstring::get_key_image(char *buff, uint length, imagetype type)
+void Field_varstring::get_key_image(char *buff, uint length, CHARSET_INFO *cs,imagetype type)
{
length-= HA_KEY_BLOB_LENGTH;
uint f_length=uint2korr(ptr);
@@ -4290,10 +4271,10 @@ void Field_varstring::get_key_image(char *buff, uint length, imagetype type)
#endif
}
-void Field_varstring::set_key_image(char *buff,uint length)
+void Field_varstring::set_key_image(char *buff,uint length, CHARSET_INFO *cs)
{
length=uint2korr(buff); // Real length is here
- (void) Field_varstring::store(buff+2, length, default_charset_info);
+ (void) Field_varstring::store(buff+2, length, cs);
}
@@ -4439,22 +4420,23 @@ int Field_blob::store(const char *from,uint len,CHARSET_INFO *cs)
int Field_blob::store(double nr)
{
- value.set(nr,2,current_thd->variables.thd_charset);
- return Field_blob::store(value.ptr(),(uint) value.length(), value.charset());
+ CHARSET_INFO *cs=charset();
+ value.set(nr, 2, cs);
+ return Field_blob::store(value.ptr(),(uint) value.length(), cs);
}
int Field_blob::store(longlong nr)
{
- value.set(nr,current_thd->variables.thd_charset);
- return Field_blob::store(value.ptr(), (uint) value.length(), value.charset());
+ CHARSET_INFO *cs=charset();
+ value.set(nr, cs);
+ return Field_blob::store(value.ptr(), (uint) value.length(), cs);
}
double Field_blob::val_real(void)
{
char *blob;
-
memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
if (!blob)
return 0.0;
@@ -4471,8 +4453,7 @@ longlong Field_blob::val_int(void)
if (!blob)
return 0;
uint32 length=get_length(ptr);
- CHARSET_INFO *cs=charset();
- return my_strntoll(cs,blob,length,NULL,10);
+ return my_strntoll(charset(),blob,length,NULL,10);
}
@@ -4482,9 +4463,9 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
char *blob;
memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
if (!blob)
- val_ptr->set("",0,field_charset); // A bit safer than ->length(0)
+ val_ptr->set("",0,charset()); // A bit safer than ->length(0)
else
- val_ptr->set((const char*) blob,get_length(ptr),field_charset);
+ val_ptr->set((const char*) blob,get_length(ptr),charset());
return val_ptr;
}
@@ -4542,7 +4523,8 @@ int Field_blob::cmp_binary(const char *a_ptr, const char *b_ptr,
/* The following is used only when comparing a key */
-void Field_blob::get_key_image(char *buff,uint length, imagetype type)
+void Field_blob::get_key_image(char *buff,uint length,
+ CHARSET_INFO *cs,imagetype type)
{
length-= HA_KEY_BLOB_LENGTH;
uint32 blob_length= get_length(ptr);
@@ -4567,9 +4549,11 @@ void Field_blob::get_key_image(char *buff,uint length, imagetype type)
if ((uint32) length > blob_length)
{
-#ifdef HAVE_purify
+ /*
+ Must clear this as we do a memcmp in opt_range.cc to detect
+ identical keys
+ */
bzero(buff+2+blob_length, (length-blob_length));
-#endif
length=(uint) blob_length;
}
int2store(buff,length);
@@ -4577,14 +4561,14 @@ void Field_blob::get_key_image(char *buff,uint length, imagetype type)
memcpy(buff+2,blob,length);
}
-void Field_blob::set_key_image(char *buff,uint length)
+void Field_blob::set_key_image(char *buff,uint length, CHARSET_INFO *cs)
{
length=uint2korr(buff);
- (void) Field_blob::store(buff+2,length, default_charset_info);
+ (void) Field_blob::store(buff+2,length,cs);
}
-void Field_geom::get_key_image(char *buff,uint length, imagetype type)
+void Field_geom::get_key_image(char *buff,uint length,CHARSET_INFO *cs, imagetype type)
{
length-=HA_KEY_BLOB_LENGTH;
ulong blob_length=get_length(ptr);
@@ -4603,7 +4587,7 @@ void Field_geom::get_key_image(char *buff,uint length, imagetype type)
return;
}
-void Field_geom::set_key_image(char *buff,uint length)
+void Field_geom::set_key_image(char *buff,uint length,CHARSET_INFO *cs)
{
Field_blob::set_key_image(buff, length);
}
@@ -4673,22 +4657,26 @@ void Field_blob::sort_string(char *to,uint length)
void Field_blob::sql_type(String &res) const
{
- CHARSET_INFO *cs=res.charset();
const char *str;
- uint len;
+ uint length;
switch (packlength) {
- default: str="tiny"; break;
- case 2: str=""; break;
- case 3: str="medium"; break;
- case 4: str="long"; break;
+ default: str="tiny"; length=4; break;
+ case 2: str=""; length=0; break;
+ case 3: str="medium"; length= 6; break;
+ case 4: str="long"; length=4; break;
+ }
+ res.set_latin1(str,length);
+ if (binary())
+ res.append("blob");
+ else
+ {
+ res.append("text");
+ if (field_charset != table->table_charset)
+ {
+ res.append(" character set ");
+ res.append(field_charset->csname);
+ }
}
-
- len=cs->snprintf(cs,(char*)res.ptr(),res.alloced_length(),"%s%s%s%s",
- str,
- binary() ? "blob" : "text",
- binary() ? "" : " character set ",
- binary() ? "" : field_charset->name);
- res.length(len);
}
@@ -4744,11 +4732,6 @@ int Field_blob::pack_cmp(const char *a, const char *b, uint key_length)
a_length= (uint) (uchar) *a++;
b_length= (uint) (uchar) *b++;
}
- if (binary())
- {
- int cmp= memcmp(a,b,min(a_length,b_length));
- return cmp ? cmp : (int) (a_length - b_length);
- }
return my_strnncoll(field_charset,
(const uchar *)a,a_length,
(const uchar *)b,b_length);
@@ -4772,11 +4755,6 @@ int Field_blob::pack_cmp(const char *b, uint key_length)
{
b_length= (uint) (uchar) *b++;
}
- if (binary())
- {
- int cmp= memcmp(a,b,min(a_length,b_length));
- return cmp ? cmp : (int) (a_length - b_length);
- }
return my_strnncoll(field_charset,
(const uchar *)a,a_length,
(const uchar *)b,b_length);
@@ -5430,8 +5408,7 @@ create_field::create_field(Field *old_field,Field *orig_field)
orig_field)
{
char buff[MAX_FIELD_WIDTH],*pos;
- CHARSET_INFO *field_charset= charset;
- String tmp(buff,sizeof(buff),field_charset);
+ String tmp(buff,sizeof(buff), charset);
/* Get the value from record[2] (the default value row) */
my_ptrdiff_t diff= (my_ptrdiff_t) (orig_field->table->rec_buff_length*2);
@@ -5443,7 +5420,7 @@ create_field::create_field(Field *old_field,Field *orig_field)
{
pos= (char*) sql_memdup(tmp.ptr(),tmp.length()+1);
pos[tmp.length()]=0;
- def=new Item_string(pos,tmp.length(),field_charset);
+ def=new Item_string(pos,tmp.length(), charset);
}
}
}
diff --git a/sql/field.h b/sql/field.h
index 3f9503764b4..6e049f45814 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -133,7 +133,9 @@ public:
tmp->unireg_check=Field::NONE;
tmp->flags&= (NOT_NULL_FLAG | BLOB_FLAG | UNSIGNED_FLAG |
ZEROFILL_FLAG | BINARY_FLAG | ENUM_FLAG | SET_FLAG);
+#ifdef PROBABLY_WRONG
tmp->table_name= new_table->table_name;
+#endif
tmp->reset_fields();
}
return tmp;
@@ -149,14 +151,14 @@ public:
if (null_ptr)
null_ptr=ADD_TO_PTR(null_ptr,ptr_diff,uchar*);
}
- inline void get_image(char *buff,uint length)
+ inline void get_image(char *buff,uint length, CHARSET_INFO *cs)
{ memcpy(buff,ptr,length); }
- inline void set_image(char *buff,uint length)
+ inline void set_image(char *buff,uint length, CHARSET_INFO *cs)
{ memcpy(ptr,buff,length); }
- virtual void get_key_image(char *buff,uint length, imagetype type)
- { get_image(buff,length); }
- virtual void set_key_image(char *buff,uint length)
- { set_image(buff,length); }
+ virtual void get_key_image(char *buff,uint length, CHARSET_INFO *cs, imagetype type)
+ { get_image(buff,length,cs); }
+ virtual void set_key_image(char *buff,uint length, CHARSET_INFO *cs)
+ { set_image(buff,length,cs); }
inline int cmp_image(char *buff,uint length)
{ return memcmp(ptr,buff,length); }
inline longlong val_int_offset(uint row_offset)
@@ -166,7 +168,7 @@ public:
ptr-=row_offset;
return tmp;
}
- bool send_binary(Protocol *protocol);
+ virtual bool send_binary(Protocol *protocol);
virtual char *pack(char* to, const char *from, uint max_length=~(uint) 0)
{
uint32 length=pack_length();
@@ -792,7 +794,6 @@ public:
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
- bool send_binary(Protocol *protocol);
int cmp(const char *,const char*);
void sort_string(char *buff,uint length);
void sql_type(String &str) const;
@@ -833,11 +834,10 @@ public:
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
- bool send_binary(Protocol *protocol);
int cmp(const char *,const char*);
void sort_string(char *buff,uint length);
- void get_key_image(char *buff,uint length, imagetype type);
- void set_key_image(char *buff,uint length);
+ void get_key_image(char *buff,uint length, CHARSET_INFO *cs, imagetype type);
+ void set_key_image(char *buff,uint length, CHARSET_INFO *cs);
void sql_type(String &str) const;
char *pack(char *to, const char *from, uint max_length=~(uint) 0);
const char *unpack(char* to, const char *from);
@@ -876,7 +876,6 @@ public:
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
- bool send_binary(Protocol *protocol);
int cmp(const char *,const char*);
int cmp(const char *a, uint32 a_length, const char *b, uint32 b_length);
int cmp_offset(uint offset);
@@ -908,8 +907,8 @@ public:
store_length(length);
memcpy_fixed(ptr+packlength,&data,sizeof(char*));
}
- void get_key_image(char *buff,uint length, imagetype type);
- void set_key_image(char *buff,uint length);
+ void get_key_image(char *buff,uint length, CHARSET_INFO *cs, imagetype type);
+ void set_key_image(char *buff,uint length, CHARSET_INFO *cs);
void sql_type(String &str) const;
inline bool copy()
{ char *tmp;
@@ -952,8 +951,8 @@ public:
enum_field_types type() const { return FIELD_TYPE_GEOMETRY;}
void sql_type(String &str) const;
- void get_key_image(char *buff,uint length, imagetype type);
- void set_key_image(char *buff,uint length);
+ void get_key_image(char *buff,uint length, CHARSET_INFO *cs,imagetype type);
+ void set_key_image(char *buff,uint length, CHARSET_INFO *cs);
};
@@ -984,7 +983,6 @@ public:
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
- bool send_binary(Protocol *protocol);
int cmp(const char *,const char*);
void sort_string(char *buff,uint length);
uint32 pack_length() const { return (uint32) packlength; }
@@ -1100,7 +1098,8 @@ bool set_field_to_null(Field *field);
bool set_field_to_null_with_conversions(Field *field, bool no_conversions);
uint find_enum(TYPELIB *typelib,const char *x, uint length);
ulonglong find_set(TYPELIB *typelib,const char *x, uint length);
-bool test_if_int(const char *str,int length,CHARSET_INFO *cs);
+bool test_if_int(const char *str, int length, const char *int_end,
+ CHARSET_INFO *cs);
/*
The following are for the interface with the .frm file
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 97e06997617..00ef12839cf 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -470,10 +470,11 @@ static void make_sortkey(register SORTPARAM *param,
switch (sort_field->result_type) {
case STRING_RESULT:
{
+ CHARSET_INFO *cs=item->charset();
if (item->maybe_null)
*to++=1;
/* All item->str() to use some extra byte for end null.. */
- String tmp((char*) to,sort_field->length+4,default_charset_info);
+ String tmp((char*) to,sort_field->length+4,cs);
String *res=item->val_str(&tmp);
if (!res)
{
@@ -488,7 +489,6 @@ static void make_sortkey(register SORTPARAM *param,
break;
}
length=res->length();
- CHARSET_INFO *cs=res->charset();
int diff=(int) (sort_field->length-length);
if (diff < 0)
{
@@ -496,7 +496,7 @@ static void make_sortkey(register SORTPARAM *param,
length=sort_field->length;
}
#ifdef USE_STRCOLL
- if(use_strnxfrm(cs))
+ if (use_strnxfrm(cs))
{
if (item->binary())
{
diff --git a/sql/gstream.cc b/sql/gstream.cc
index 5a58fef6744..a97ed9cae03 100644
--- a/sql/gstream.cc
+++ b/sql/gstream.cc
@@ -3,36 +3,38 @@
int GTextReadStream::get_next_toc_type() const
{
const char *cur = m_cur;
- while((*cur)&&(strchr(" \t\r\n",*cur)))
+ while ((*cur)&&(strchr(" \t\r\n",*cur)))
{
cur++;
}
- if(!(*cur))
+ if (!(*cur))
{
return eostream;
}
- if(((*cur>='a') && (*cur<='z')) || ((*cur>='A') && (*cur<='Z')) || (*cur=='_'))
+ if (((*cur>='a') && (*cur<='z')) || ((*cur>='A') && (*cur<='Z')) ||
+ (*cur=='_'))
{
return word;
}
- if(((*cur>='0') && (*cur<='9')) || (*cur=='-') || (*cur=='+') || (*cur=='.'))
+ if (((*cur>='0') && (*cur<='9')) || (*cur=='-') || (*cur=='+') ||
+ (*cur=='.'))
{
return numeric;
}
- if(*cur == '(')
+ if (*cur == '(')
{
return l_bra;
}
- if(*cur == ')')
+ if (*cur == ')')
{
return r_bra;
}
- if(*cur == ',')
+ if (*cur == ',')
{
return comma;
}
@@ -43,28 +45,28 @@ int GTextReadStream::get_next_toc_type() const
const char *GTextReadStream::get_next_word(int *word_len)
{
const char *cur = m_cur;
- while((*cur)&&(strchr(" \t\r\n",*cur)))
+ while ((*cur)&&(strchr(" \t\r\n",*cur)))
{
cur++;
}
m_last_text_position = cur;
- if(!(*cur))
+ if (!(*cur))
{
return 0;
}
const char *wd_start = cur;
- if(((*cur<'a') || (*cur>'z')) && ((*cur<'A') || (*cur>'Z')) && (*cur!='_'))
+ if (((*cur<'a') || (*cur>'z')) && ((*cur<'A') || (*cur>'Z')) && (*cur!='_'))
{
return NULL;
}
++cur;
- while(((*cur>='a') && (*cur<='z')) || ((*cur>='A') && (*cur<='Z')) || (*cur=='_') ||
- ((*cur>='0') && (*cur<='9')))
+ while (((*cur>='a') && (*cur<='z')) || ((*cur>='A') && (*cur<='Z')) ||
+ (*cur=='_') || ((*cur>='0') && (*cur<='9')))
{
++cur;
}
@@ -79,19 +81,19 @@ const char *GTextReadStream::get_next_word(int *word_len)
int GTextReadStream::get_next_number(double *d)
{
const char *cur = m_cur;
- while((*cur)&&(strchr(" \t\r\n",*cur)))
+ while ((*cur)&&(strchr(" \t\r\n",*cur)))
{
cur++;
}
m_last_text_position = cur;
- if(!(*cur))
+ if (!(*cur))
{
set_error_msg("Numeric constant expected");
return 1;
}
- if(((*cur<'0') || (*cur>'9')) && (*cur!='-') && (*cur!='+') && (*cur!='.'))
+ if (((*cur<'0') || (*cur>'9')) && (*cur!='-') && (*cur!='+') && (*cur!='.'))
{
set_error_msg("Numeric constant expected");
return 1;
@@ -101,7 +103,7 @@ int GTextReadStream::get_next_number(double *d)
*d = strtod(cur, &endptr);
- if(endptr)
+ if (endptr)
{
m_cur = endptr;
}
@@ -112,11 +114,11 @@ int GTextReadStream::get_next_number(double *d)
char GTextReadStream::get_next_symbol()
{
const char *cur = m_cur;
- while((*cur)&&(strchr(" \t\r\n",*cur)))
+ while ((*cur)&&(strchr(" \t\r\n",*cur)))
{
cur++;
}
- if(!(*cur))
+ if (!(*cur))
{
return 0;
}
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index c5d588d1f19..6d2538279d9 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -512,7 +512,8 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked)
file->app_private= (void*) (table->key_info+table->primary_key);
if ((error= txn_begin(db_env, 0, (DB_TXN**) &transaction, 0)) ||
(error= (file->open(file, transaction,
- fn_format(name_buff, name, "", ha_berkeley_ext, 2 | 4),
+ fn_format(name_buff, name, "", ha_berkeley_ext,
+ 2 | 4),
"main", DB_BTREE, open_mode, 0))) ||
(error= transaction->commit(transaction, 0)))
{
@@ -1940,6 +1941,27 @@ int ha_berkeley::delete_table(const char *name)
DBUG_RETURN(error);
}
+
+int ha_berkeley::rename_table(const char * from, const char * to)
+{
+ int error;
+ char from_buff[FN_REFLEN];
+ char to_buff[FN_REFLEN];
+
+ if ((error= db_create(&file, db_env, 0)))
+ my_errno= error;
+ else
+ {
+ /* On should not do a file->close() after rename returns */
+ error= file->rename(file,
+ fn_format(from_buff, from, "", ha_berkeley_ext, 2 | 4),
+ NULL, fn_format(to_buff, to, "", ha_berkeley_ext,
+ 2 | 4), 0);
+ }
+ return error;
+}
+
+
/*
How many seeks it will take to read through the table
This is to be comparable to the number returned by records_in_range so
@@ -2098,7 +2120,7 @@ int ha_berkeley::analyze(THD* thd, HA_CHECK_OPT* check_opt)
free(stat);
stat=0;
}
- if (key_file[i]->stat(key_file[i], (void*) &stat, 0))
+ if ((key_file[i]->stat)(key_file[i], (void*) &stat, 0))
goto err; /* purecov: inspected */
share->rec_per_key[i]= (stat->bt_ndata /
(stat->bt_nkeys ? stat->bt_nkeys : 1));
@@ -2111,7 +2133,7 @@ int ha_berkeley::analyze(THD* thd, HA_CHECK_OPT* check_opt)
free(stat);
stat=0;
}
- if (file->stat(file, (void*) &stat, 0))
+ if ((file->stat)(file, (void*) &stat, 0))
goto err; /* purecov: inspected */
}
pthread_mutex_lock(&share->mutex);
diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h
index dfdd12470d6..dd42e7ab9e2 100644
--- a/sql/ha_berkeley.h
+++ b/sql/ha_berkeley.h
@@ -152,6 +152,7 @@ class ha_berkeley: public handler
int create(const char *name, register TABLE *form,
HA_CREATE_INFO *create_info);
int delete_table(const char *name);
+ int rename_table(const char* from, const char* to);
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index a50ee6cf93d..68de2a529c9 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -82,7 +82,8 @@ are declared in mysqld.cc: */
long innobase_mirrored_log_groups, innobase_log_files_in_group,
innobase_log_file_size, innobase_log_buffer_size,
- innobase_buffer_pool_size, innobase_additional_mem_pool_size,
+ innobase_buffer_pool_size, innobase_buffer_pool_awe_mem_mb,
+ innobase_additional_mem_pool_size,
innobase_file_io_threads, innobase_lock_wait_timeout,
innobase_thread_concurrency, innobase_force_recovery;
@@ -225,10 +226,14 @@ convert_error_code_to_mysql(
return(HA_ERR_ROW_IS_REFERENCED);
- } else if (error == (int) DB_CANNOT_ADD_CONSTRAINT) {
+ } else if (error == (int) DB_CANNOT_ADD_CONSTRAINT) {
return(HA_ERR_CANNOT_ADD_FOREIGN);
+ } else if (error == (int) DB_COL_APPEARS_TWICE_IN_INDEX) {
+
+ return(HA_ERR_WRONG_TABLE_DEF);
+
} else if (error == (int) DB_OUT_OF_FILE_SPACE) {
return(HA_ERR_RECORD_FILE_FULL);
@@ -749,7 +754,25 @@ innobase_init(void)
srv_log_buffer_size = (ulint) innobase_log_buffer_size;
srv_flush_log_at_trx_commit = (ulint) innobase_flush_log_at_trx_commit;
- srv_pool_size = (ulint) innobase_buffer_pool_size;
+ /* We set srv_pool_size here in units of 1 kB. InnoDB internally
+ changes the value so that it becomes the number of database pages. */
+
+ if (innobase_buffer_pool_awe_mem_mb == 0) {
+ /* Careful here: we first convert the signed long int to ulint
+ and only after that divide */
+
+ srv_pool_size = ((ulint) innobase_buffer_pool_size) / 1024;
+ } else {
+ srv_use_awe = TRUE;
+ srv_pool_size = (ulint)
+ (1024 * innobase_buffer_pool_awe_mem_mb);
+ srv_awe_window_size = (ulint) innobase_buffer_pool_size;
+
+ /* Note that what the user specified as
+ innodb_buffer_pool_size is actually the AWE memory window
+ size in this case, and the real buffer pool size is
+ determined by .._awe_mem_mb. */
+ }
srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;
@@ -1235,7 +1258,14 @@ ha_innobase::open(
if (primary_key != MAX_KEY) {
fprintf(stderr,
"InnoDB: Error: table %s has no primary key in InnoDB\n"
- "InnoDB: data dictionary, but has one in MySQL!\n", name);
+ "InnoDB: data dictionary, but has one in MySQL!\n"
+ "InnoDB: If you created the table with a MySQL\n"
+ "InnoDB: version < 3.23.54 and did not define a primary\n"
+ "InnoDB: key, but defined a unique key with all non-NULL\n"
+ "InnoDB: columns, then MySQL internally treats that key\n"
+ "InnoDB: as the primary key. You can fix this error by\n"
+ "InnoDB: dump + DROP + CREATE + reimport of the table.\n",
+ name);
}
((row_prebuilt_t*)innobase_prebuilt)
@@ -1572,6 +1602,8 @@ build_template(
ibool fetch_all_in_key = FALSE;
ulint i;
+ ut_a(templ_type != ROW_MYSQL_REC_FIELDS || thd == current_thd);
+
clust_index = dict_table_get_first_index_noninline(prebuilt->table);
if (!prebuilt->hint_no_need_to_fetch_extra_cols) {
@@ -1596,6 +1628,12 @@ build_template(
}
if (prebuilt->select_lock_type == LOCK_X) {
+ /* In versions < 3.23.50 we always retrieved the clustered
+ index record if prebuilt->select_lock_type == LOCK_S,
+ but there is really not need for that, and in some cases
+ performance could be seriously degraded because the MySQL
+ optimizer did not know about our convention! */
+
/* We always retrieve the whole clustered index record if we
use exclusive row level locks, for example, if the read is
done in an UPDATE statement. */
@@ -1604,12 +1642,6 @@ build_template(
}
if (templ_type == ROW_MYSQL_REC_FIELDS) {
- /* In versions < 3.23.50 we always retrieved the clustered
- index record if prebuilt->select_lock_type == LOCK_S,
- but there is really not need for that, and in some cases
- performance could be seriously degraded because the MySQL
- optimizer did not know about our convention! */
-
index = prebuilt->index;
} else {
index = clust_index;
@@ -1900,12 +1932,9 @@ ha_innobase::write_row(
the counter here. */
skip_auto_inc_decr = FALSE;
-
- if (error == DB_DUPLICATE_KEY) {
- ut_a(user_thd->query);
- dict_accept(user_thd->query, "REPLACE",
- &skip_auto_inc_decr);
- }
+ if (error == DB_DUPLICATE_KEY &&
+ user_thd->lex.sql_command == SQLCOM_REPLACE)
+ skip_auto_inc_decr= TRUE;
if (!skip_auto_inc_decr && incremented_auto_inc_counter
&& prebuilt->trx->auto_inc_lock) {
@@ -2441,7 +2470,9 @@ ha_innobase::index_read_last(
}
/************************************************************************
-Changes the active index of a handle. */
+Changes the active index of a handle. Note that since we build also the
+template for a search, update_thd() must already have been called, in
+::external_lock, for example. */
int
ha_innobase::change_active_index(
@@ -2456,6 +2487,10 @@ ha_innobase::change_active_index(
statistic_increment(ha_read_key_count, &LOCK_status);
DBUG_ENTER("change_active_index");
+ ut_a(prebuilt->trx ==
+ (trx_t*) current_thd->transaction.all.innobase_tid);
+ ut_a(user_thd == current_thd);
+
active_index = keynr;
if (keynr != MAX_KEY && table->keys > 0) {
@@ -2481,11 +2516,13 @@ ha_innobase::change_active_index(
dict_index_copy_types(prebuilt->search_tuple, prebuilt->index,
prebuilt->index->n_fields);
- /* Maybe MySQL changes the active index for a handle also
- during some queries, we do not know: then it is safest to build
- the template such that all columns will be fetched */
+ /* MySQL changes the active index for a handle also during some
+ queries, for example SELECT MAX(a), SUM(a) first retrieves the MAX()
+ and then calculates te sum. Previously we played safe and used
+ the flag ROW_MYSQL_WHOLE_ROW below, but that caused unnecessary
+ copying. Starting from MySQL-4.1 we use a more efficient flag here. */
- build_template(prebuilt, user_thd, table, ROW_MYSQL_WHOLE_ROW);
+ build_template(prebuilt, user_thd, table, ROW_MYSQL_REC_FIELDS);
DBUG_RETURN(0);
}
@@ -3717,8 +3754,18 @@ ha_innobase::extra(
obsolete! */
switch (operation) {
+ case HA_EXTRA_FLUSH:
+ if (prebuilt->blob_heap) {
+ row_mysql_prebuilt_free_blob_heap(prebuilt);
+ }
+ break;
case HA_EXTRA_RESET:
- case HA_EXTRA_RESET_STATE:
+ if (prebuilt->blob_heap) {
+ row_mysql_prebuilt_free_blob_heap(prebuilt);
+ }
+ prebuilt->read_just_key = 0;
+ break;
+ case HA_EXTRA_RESET_STATE:
prebuilt->read_just_key = 0;
break;
case HA_EXTRA_NO_KEYREAD:
@@ -3805,8 +3852,8 @@ innobase_map_isolation_level(
enum_tx_isolation iso) /* in: MySQL isolation level code */
{
switch(iso) {
- case ISO_READ_COMMITTED: return(TRX_ISO_READ_COMMITTED);
case ISO_REPEATABLE_READ: return(TRX_ISO_REPEATABLE_READ);
+ case ISO_READ_COMMITTED: return(TRX_ISO_READ_COMMITTED);
case ISO_SERIALIZABLE: return(TRX_ISO_SERIALIZABLE);
case ISO_READ_UNCOMMITTED: return(TRX_ISO_READ_UNCOMMITTED);
default: ut_a(0); return(0);
@@ -3861,11 +3908,9 @@ ha_innobase::external_lock(
trx->n_mysql_tables_in_use++;
prebuilt->mysql_has_locked = TRUE;
- if (thd->variables.tx_isolation != ISO_REPEATABLE_READ) {
- trx->isolation_level = innobase_map_isolation_level(
+ trx->isolation_level = innobase_map_isolation_level(
(enum_tx_isolation)
thd->variables.tx_isolation);
- }
if (trx->isolation_level == TRX_ISO_SERIALIZABLE
&& prebuilt->select_lock_type == LOCK_NONE) {
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index d2639f39c5b..86fb5d1947b 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -178,7 +178,8 @@ extern char *innobase_home, *innobase_tmpdir, *innobase_logdir;
extern long innobase_lock_scan_time;
extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
extern long innobase_log_file_size, innobase_log_buffer_size;
-extern long innobase_buffer_pool_size, innobase_additional_mem_pool_size;
+extern long innobase_buffer_pool_size, innobase_buffer_pool_awe_mem_mb,
+ innobase_additional_mem_pool_size;
extern long innobase_file_io_threads, innobase_lock_wait_timeout;
extern long innobase_force_recovery, innobase_thread_concurrency;
extern char *innobase_data_home_dir, *innobase_data_file_path;
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 28c3372dde6..754d7dc8641 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -641,7 +641,7 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool optimize)
the following 'if', thought conceptually wrong,
is a useful optimization nevertheless.
*/
- if (file->state != &file->s->state.state);
+ if (file->state != &file->s->state.state)
file->s->state.state = *file->state;
if (file->s->base.auto_key)
update_auto_increment_key(&param, file, 1);
@@ -695,12 +695,22 @@ void ha_myisam::deactivate_non_unique_index(ha_rows rows)
mi_extra(file, HA_EXTRA_NO_KEYS, 0);
else
{
- /* Only disable old index if the table was empty */
- if (file->state->records == 0)
+ /*
+ Only disable old index if the table was empty and we are inserting
+ a lot of rows.
+ We should not do this for only a few rows as this is slower and
+ we don't want to update the key statistics based of only a few rows.
+ */
+ if (file->state->records == 0 &&
+ (!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT))
mi_disable_non_unique_index(file,rows);
- ha_myisam::extra_opt(HA_EXTRA_BULK_INSERT_BEGIN,
- current_thd->variables.bulk_insert_buff_size);
- table->bulk_insert= 1;
+ else
+ {
+ mi_init_bulk_insert(file,
+ current_thd->variables.bulk_insert_buff_size,
+ rows);
+ table->bulk_insert= 1;
+ }
}
}
enable_activate_all_index=1;
@@ -717,7 +727,7 @@ bool ha_myisam::activate_all_index(THD *thd)
MYISAM_SHARE* share = file->s;
DBUG_ENTER("activate_all_index");
- mi_extra(file, HA_EXTRA_BULK_INSERT_END, 0);
+ mi_end_bulk_insert(file);
table->bulk_insert= 0;
if (enable_activate_all_index &&
share->state.key_map != set_bits(ulonglong, share->base.keys))
@@ -958,13 +968,11 @@ int ha_myisam::extra(enum ha_extra_function operation)
}
-/* To be used with WRITE_CACHE, EXTRA_CACHE and BULK_INSERT_BEGIN */
+/* To be used with WRITE_CACHE and EXTRA_CACHE */
int ha_myisam::extra_opt(enum ha_extra_function operation, ulong cache_size)
{
- if ((specialflag & SPECIAL_SAFE_MODE) &
- (operation == HA_EXTRA_WRITE_CACHE ||
- operation == HA_EXTRA_BULK_INSERT_BEGIN))
+ if ((specialflag & SPECIAL_SAFE_MODE) && operation == HA_EXTRA_WRITE_CACHE)
return 0;
return mi_extra(file, operation, (void*) &cache_size);
}
@@ -1229,8 +1237,7 @@ longlong ha_myisam::get_auto_increment()
}
if (table->bulk_insert)
- mi_extra(file, HA_EXTRA_BULK_INSERT_FLUSH,
- (void*) &table->next_number_index);
+ mi_flush_bulk_insert(file, table->next_number_index);
longlong nr;
int error;
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index 4398aaecf4d..3bd812821f6 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -239,6 +239,13 @@ void ha_myisammrg::info(uint flag)
#else
ref_length=4; // Can't be > than my_off_t
#endif
+ if (flag & HA_STATUS_CONST)
+ {
+ if (table->key_parts)
+ memcpy((char*) table->key_info[0].rec_per_key,
+ (char*) info.rec_per_key,
+ sizeof(table->key_info[0].rec_per_key)*table->key_parts);
+ }
}
@@ -257,9 +264,7 @@ int ha_myisammrg::extra(enum ha_extra_function operation)
int ha_myisammrg::extra_opt(enum ha_extra_function operation, ulong cache_size)
{
- if ((specialflag & SPECIAL_SAFE_MODE) &
- (operation == HA_EXTRA_WRITE_CACHE ||
- operation == HA_EXTRA_BULK_INSERT_BEGIN))
+ if ((specialflag & SPECIAL_SAFE_MODE) && operation == HA_EXTRA_WRITE_CACHE)
return 0;
return myrg_extra(file, operation, (void*) &cache_size);
}
diff --git a/sql/item.cc b/sql/item.cc
index 12195ae359a..7363a285e32 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -47,11 +47,6 @@ Item::Item():
loop_id= 0;
}
-Item_ref_in_optimizer::Item_ref_in_optimizer(Item_in_optimizer *master,
- char *table_name_par,
- char *field_name_par):
- Item_ref(master->args, table_name_par, field_name_par), owner(master) {}
-
bool Item::check_loop(uint id)
{
@@ -121,7 +116,7 @@ bool Item_string::eq(const Item *item, bool binary_cmp) const
bool Item::get_date(TIME *ltime,bool fuzzydate)
{
char buff[40];
- String tmp(buff,sizeof(buff),default_charset_info),*res;
+ String tmp(buff,sizeof(buff), my_charset_bin),*res;
if (!(res=val_str(&tmp)) ||
str_to_TIME(res->ptr(),res->length(),ltime,fuzzydate) == TIMESTAMP_NONE)
{
@@ -139,7 +134,7 @@ bool Item::get_date(TIME *ltime,bool fuzzydate)
bool Item::get_time(TIME *ltime)
{
char buff[40];
- String tmp(buff,sizeof(buff),default_charset_info),*res;
+ String tmp(buff,sizeof(buff),my_charset_bin),*res;
if (!(res=val_str(&tmp)) ||
str_to_time(res->ptr(),res->length(),ltime))
{
@@ -178,7 +173,7 @@ const char *Item_ident::full_name() const
char *tmp;
if (!table_name)
return field_name ? field_name : name ? name : "tmp_field";
- if (db_name)
+ if (db_name && db_name[0])
{
tmp=(char*) sql_alloc((uint) strlen(db_name)+(uint) strlen(table_name)+
(uint) strlen(field_name)+3);
@@ -198,6 +193,7 @@ String *Item_field::val_str(String *str)
{
if ((null_value=field->is_null()))
return 0;
+ str->set_charset(str_value.charset());
return field->val_str(str,&str_value);
}
@@ -220,6 +216,7 @@ String *Item_field::str_result(String *str)
{
if ((null_value=result_field->is_null()))
return 0;
+ str->set_charset(str_value.charset());
return result_field->val_str(str,&str_value);
}
@@ -383,7 +380,8 @@ double Item_param::val()
{
switch (item_result_type) {
case STRING_RESULT:
- return (double)my_strntod(str_value.charset(),str_value.ptr(),str_value.length(),(char**)0);
+ return (double) my_strntod(str_value.charset(), (char*) str_value.ptr(),
+ str_value.length(), (char**) 0);
case INT_RESULT:
return (double)int_value;
default:
@@ -437,20 +435,6 @@ String *Item_copy_string::val_str(String *str)
return &str_value;
}
-double Item_ref_in_optimizer::val()
-{
- return owner->get_cache();
-}
-longlong Item_ref_in_optimizer::val_int()
-{
- return owner->get_cache_int();
-}
-String* Item_ref_in_optimizer::val_str(String* s)
-{
- return owner->get_cache_str(s);
-}
-
-
/*
Functions to convert item to field (for send_fields)
*/
@@ -464,18 +448,6 @@ bool Item::fix_fields(THD *thd,
return 0;
}
-bool Item_outer_select_context_saver::fix_fields(THD *thd,
- struct st_table_list *list,
- Item ** ref)
-{
- DBUG_ENTER("Item_outer_select_context_saver::fix_fields");
- bool res= item->fix_fields(thd,
- 0, // do not show current subselect fields
- &item);
- *ref= item;
- DBUG_RETURN(res);
-}
-
bool Item_asterisk_remover::fix_fields(THD *thd,
struct st_table_list *list,
Item ** ref)
@@ -529,6 +501,26 @@ bool Item_asterisk_remover::fix_fields(THD *thd,
DBUG_RETURN(res);
}
+bool Item_ref_on_list_position::fix_fields(THD *thd,
+ struct st_table_list *tables,
+ Item ** reference)
+{
+ List_iterator<Item> li(list);
+ Item *item;
+ for (uint i= 0; (item= li++) && i < pos; i++);
+ if (item)
+ {
+ ref= li.ref();
+ return Item_ref_null_helper::fix_fields(thd, tables, reference);
+ }
+ else
+ {
+ ref= 0;
+ my_error(ER_CARDINALITY_COL, MYF(0), pos);
+ return 1;
+ }
+}
+
double Item_ref_null_helper::val()
{
double tmp= (*ref)->val_result();
@@ -556,8 +548,11 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
if (!field) // If field is not checked
{
- Field *tmp;
- if ((tmp= find_field_in_tables(thd, this, tables, 0)) == not_found_field)
+ TABLE_LIST *where= 0;
+ Field *tmp= (Field *)not_found_field;
+ if (outer_resolving ||
+ (tmp= find_field_in_tables(thd, this, tables, &where, 0)) ==
+ not_found_field)
{
/*
We can't find table field in table list of current select,
@@ -575,20 +570,21 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
Item **refer= (Item **)not_found_item;
// Prevent using outer fields in subselects, that is not supported now
SELECT_LEX *cursel=(SELECT_LEX *) thd->lex.current_select;
- if (cursel->linkage != DERIVED_TABLE_TYPE)
- for (SELECT_LEX *sl=cursel->outer_select();
+ if (cursel->master_unit()->first_select()->linkage != DERIVED_TABLE_TYPE)
+ for (SELECT_LEX *sl=(outer_resolving?cursel:cursel->outer_select());
sl;
sl= sl->outer_select())
{
if ((tmp= find_field_in_tables(thd, this,
- (last= sl)->get_table_list(),
+ (last= sl)->get_table_list(), &where,
0)) != not_found_field)
break;
if ((refer= find_item_in_list(this, sl->item_list,
REPORT_EXCEPT_NOT_FOUND)) !=
(Item **)not_found_item)
break;
- if (sl->linkage == DERIVED_TABLE_TYPE)
+ if (sl->master_unit()->first_select()->linkage ==
+ DERIVED_TABLE_TYPE)
break; // do not look over derived table
}
if (!tmp)
@@ -598,7 +594,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
else if (tmp == not_found_field && refer == (Item **)not_found_item)
{
// call to return error code
- find_field_in_tables(thd, this, tables, 1);
+ find_field_in_tables(thd, this, tables, &where, 1);
return -1;
}
else if (refer != (Item **)not_found_item)
@@ -608,7 +604,6 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
(char *)field_name);
if (!r)
return 1;
- int res;
if (r->check_cols(1) || r->fix_fields(thd, tables, ref))
return 1;
r->depended_from= last;
@@ -624,6 +619,17 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
found table as depended (of select where was found table)
*/
thd->lex.current_select->mark_as_dependent(last);
+ if (depended_from->having_fix_field)
+ {
+ Item_ref *rf;
+ *ref= rf= new Item_ref((where->db[0]?where->db:0),
+ (char *)where->alias,
+ (char *)field_name);
+ if (!rf)
+ return 1;
+ (rf)->outer_resolving= outer_resolving;
+ return rf->check_cols(1) || rf->fix_fields(thd, tables, ref);
+ }
}
}
else if (!tmp)
@@ -639,14 +645,6 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
table->used_fields++;
table->used_keys&=field->part_of_key;
}
- if (depended_from != 0 && depended_from->having_fix_field)
- {
- *ref= new Item_ref((char *)db_name, (char *)table_name,
- (char *)field_name);
- if (!*ref)
- return 1;
- return (*ref)->check_cols(1) || (*ref)->fix_fields(thd, tables, ref);
- }
fixed= 1;
return 0;
}
@@ -1075,16 +1073,21 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
{
if (!ref)
{
- SELECT_LEX *sl= thd->lex.current_select->outer_select();
+ TABLE_LIST *where= 0;
+ SELECT_LEX *sl= (outer_resolving?
+ thd->lex.current_select->select_lex():
+ thd->lex.current_select->outer_select());
/*
Finding only in current select will be performed for selects that have
not outer one and for derived tables (which not support using outer
fields for now)
*/
- if ((ref= find_item_in_list(this,
+ if (outer_resolving ||
+ (ref= find_item_in_list(this,
*(thd->lex.current_select->get_item_list()),
((sl &&
- thd->lex.current_select->linkage !=
+ thd->lex.current_select->master_unit()->
+ first_select()->linkage !=
DERIVED_TABLE_TYPE) ?
REPORT_EXCEPT_NOT_FOUND :
REPORT_ALL_ERRORS))) ==
@@ -1108,9 +1111,10 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
(Item **)not_found_item)
break;
if ((tmp= find_field_in_tables(thd, this,
- sl->get_table_list(),
+ sl->get_table_list(), &where,
0)) != not_found_field);
- if (sl->linkage == DERIVED_TABLE_TYPE)
+ if (sl->master_unit()->first_select()->linkage ==
+ DERIVED_TABLE_TYPE)
break; // do not look over derived table
}
@@ -1206,7 +1210,7 @@ Item *resolve_const_item(Item *item,Item *comp_item)
if (res_type == STRING_RESULT)
{
char buff[MAX_FIELD_WIDTH];
- String tmp(buff,sizeof(buff),default_charset_info),*result;
+ String tmp(buff,sizeof(buff),my_charset_bin),*result;
result=item->val_str(&tmp);
if (item->null_value)
{
@@ -1220,7 +1224,7 @@ Item *resolve_const_item(Item *item,Item *comp_item)
#ifdef DELETE_ITEMS
delete item;
#endif
- return new Item_string(name,tmp_str,length,default_charset_info);
+ return new Item_string(name,tmp_str,length,result->charset());
}
if (res_type == INT_RESULT)
{
@@ -1261,8 +1265,8 @@ bool field_is_equal_to_item(Field *field,Item *item)
{
char item_buff[MAX_FIELD_WIDTH];
char field_buff[MAX_FIELD_WIDTH];
- String item_tmp(item_buff,sizeof(item_buff),default_charset_info),*item_result;
- String field_tmp(field_buff,sizeof(field_buff),default_charset_info);
+ String item_tmp(item_buff,sizeof(item_buff),my_charset_bin),*item_result;
+ String field_tmp(field_buff,sizeof(field_buff),my_charset_bin);
item_result=item->val_str(&item_tmp);
if (item->null_value)
return 1; // This must be true
@@ -1277,6 +1281,141 @@ bool field_is_equal_to_item(Field *field,Item *item)
return result == field->val_real();
}
+Item_cache* Item_cache::get_cache(Item_result type)
+{
+ switch (type)
+ {
+ case INT_RESULT:
+ return new Item_cache_int();
+ case REAL_RESULT:
+ return new Item_cache_real();
+ case STRING_RESULT:
+ return new Item_cache_str();
+ case ROW_RESULT:
+ return new Item_cache_row();
+ default:
+ // should never be in real life
+ DBUG_ASSERT(0);
+ return 0;
+ }
+}
+
+void Item_cache_str::store(Item *item)
+{
+ str_value.set(buffer, sizeof(buffer), item->charset());
+ value= item->str_result(&str_value);
+ if ((null_value= item->null_value))
+ value= 0;
+ else if (value != &str_value)
+ {
+ /*
+ We copy string value to avoid changing value if 'item' is table field
+ in queries like following (where t1.c is varchar):
+ select a,
+ (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),
+ (select c from t1 where a=t2.a)
+ from t2;
+ */
+ str_value.copy(*value);
+ value= &str_value;
+ }
+
+}
+double Item_cache_str::val()
+{
+ if (value)
+ return my_strntod(value->charset(), (char*) value->ptr(),
+ value->length(), (char**) 0);
+ else
+ return (double)0;
+}
+longlong Item_cache_str::val_int()
+{
+ if (value)
+ return my_strntoll(value->charset(), value->ptr(),
+ value->length(), (char**) 0, 10);
+ else
+ return (longlong)0;
+}
+
+bool Item_cache_row::allocate(uint num)
+{
+ item_count= num;
+ THD *thd= current_thd;
+ return (!(values=
+ (Item_cache **) thd->calloc(sizeof(Item_cache *)*item_count)));
+}
+
+bool Item_cache_row::setup(Item * item)
+{
+ if (!values && allocate(item->cols()))
+ return 1;
+ for (uint i= 0; i < item_count; i++)
+ {
+ Item *el= item->el(i);
+ Item_cache *tmp;
+ if (!(tmp= values[i]= Item_cache::get_cache(el->result_type())))
+ return 1;
+ tmp->setup(el);
+ }
+ return 0;
+}
+
+void Item_cache_row::store(Item * item)
+{
+ null_value= 0;
+ item->bring_value();
+ for (uint i= 0; i < item_count; i++)
+ {
+ values[i]->store(item->el(i));
+ null_value|= values[i]->null_value;
+ }
+}
+
+void Item_cache_row::illegal_method_call(const char *method)
+{
+ DBUG_ENTER("Item_cache_row::illegal_method_call");
+ DBUG_PRINT("error", ("!!! %s method was called for row item", method));
+ DBUG_ASSERT(0);
+ my_error(ER_CARDINALITY_COL, MYF(0), 1);
+ DBUG_VOID_RETURN;
+}
+
+bool Item_cache_row::check_cols(uint c)
+{
+ if (c != item_count)
+ {
+ my_error(ER_CARDINALITY_COL, MYF(0), c);
+ return 1;
+ }
+ return 0;
+}
+
+bool Item_cache_row::null_inside()
+{
+ for (uint i= 0; i < item_count; i++)
+ {
+ if (values[i]->cols() > 1)
+ {
+ if (values[i]->null_inside())
+ return 1;
+ }
+ else
+ {
+ values[i]->val_int();
+ if (values[i]->null_value)
+ return 1;
+ }
+ }
+ return 0;
+}
+
+void Item_cache_row::bring_value()
+{
+ for (uint i= 0; i < item_count; i++)
+ values[i]->bring_value();
+ return;
+}
/*****************************************************************************
** Instantiate templates
diff --git a/sql/item.h b/sql/item.h
index 47c7541d3e3..1d5e92f6404 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -32,12 +32,12 @@ public:
static void *operator new(size_t size) {return (void*) sql_alloc((uint) size); }
static void operator delete(void *ptr,size_t size) {} /*lint -e715 */
- enum Type {FIELD_ITEM,FUNC_ITEM,SUM_FUNC_ITEM,STRING_ITEM,
- INT_ITEM,REAL_ITEM,NULL_ITEM,VARBIN_ITEM,
- COPY_STR_ITEM,FIELD_AVG_ITEM, DEFAULT_ITEM,
- PROC_ITEM,COND_ITEM,REF_ITEM,FIELD_STD_ITEM,
- FIELD_VARIANCE_ITEM,CONST_ITEM,
- SUBSELECT_ITEM, ROW_ITEM};
+ enum Type {FIELD_ITEM, FUNC_ITEM, SUM_FUNC_ITEM, STRING_ITEM,
+ INT_ITEM, REAL_ITEM, NULL_ITEM, VARBIN_ITEM,
+ COPY_STR_ITEM, FIELD_AVG_ITEM, DEFAULT_ITEM,
+ PROC_ITEM,COND_ITEM, REF_ITEM, FIELD_STD_ITEM,
+ FIELD_VARIANCE_ITEM, CONST_ITEM,
+ SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM};
enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE };
String str_value; /* used to store value */
@@ -101,6 +101,7 @@ public:
CHARSET_INFO *thd_charset() const;
CHARSET_INFO *charset() const { return str_value.charset(); };
void set_charset(CHARSET_INFO *cs) { str_value.set_charset(cs); }
+ virtual void set_outer_resolving() {}
// Row emulation
virtual uint cols() { return 1; }
@@ -108,64 +109,12 @@ public:
virtual Item** addr(uint i) { return 0; }
virtual bool check_cols(uint c);
// It is not row => null inside is impossible
- virtual bool null_inside() { return 0; };
+ virtual bool null_inside() { return 0; }
+ // used in row subselects to get value of elements
+ virtual void bring_value() {}
};
-/*
- Wrapper base class
-*/
-
-class Item_wrapper :public Item
-{
-protected:
- Item *item;
-public:
- /*
- Following methods should not be used, because fix_fields exclude this
- item (it assign '*ref' with field 'item' in derived classes)
- */
- enum Type type() const { return item->type(); }
- enum_field_types field_type() const { return item->field_type(); }
- double val() { return item->val(); }
- longlong val_int() { return item->val_int(); }
- String* val_str(String* s) { return item->val_str(s); }
- bool check_cols(uint col) { return item->check_cols(col); }
- bool eq(const Item *item, bool binary_cmp) const
- { return item->eq(item, binary_cmp); }
- bool is_null()
- {
- item->val_int();
- return item->null_value;
- }
- bool get_date(TIME *ltime, bool fuzzydate)
- {
- return (null_value=item->get_date(ltime, fuzzydate));
- }
- bool send(Protocol *prot, String *tmp) { return item->send(prot, tmp); }
- int save_in_field(Field *field, bool no_conversions)
- {
- return item->save_in_field(field, no_conversions);
- }
- void save_org_in_field(Field *field) { item->save_org_in_field(field); }
- enum Item_result result_type () const { return item->result_type(); }
- table_map used_tables() const { return item->used_tables(); }
-};
-
-
-/*
- Save context of name resolution for Item, used in subselect transformer.
-*/
-class Item_outer_select_context_saver :public Item_wrapper
-{
-public:
- Item_outer_select_context_saver(Item *it)
- {
- item= it;
- }
- bool fix_fields(THD *, struct st_table_list *, Item ** ref);
-};
-
class st_select_lex;
class Item_ident :public Item
{
@@ -174,12 +123,14 @@ public:
const char *table_name;
const char *field_name;
st_select_lex *depended_from;
+ bool outer_resolving; /* used for items from reduced subselect */
Item_ident(const char *db_name_par,const char *table_name_par,
const char *field_name_par)
- :db_name(db_name_par),table_name(table_name_par),
- field_name(field_name_par), depended_from(0)
+ :db_name(db_name_par), table_name(table_name_par),
+ field_name(field_name_par), depended_from(0), outer_resolving(0)
{ name = (char*) field_name_par; }
const char *full_name() const;
+ void set_outer_resolving() { outer_resolving= 1; }
};
@@ -394,7 +345,8 @@ public:
name=(char*) str_value.ptr();
decimals=NOT_FIXED_DEC;
}
- Item_string(const char *name_par,const char *str,uint length,CHARSET_INFO *cs)
+ Item_string(const char *name_par, const char *str, uint length,
+ CHARSET_INFO *cs)
{
str_value.set(str,length,cs);
max_length=length;
@@ -405,11 +357,13 @@ public:
enum Type type() const { return STRING_ITEM; }
double val()
{
- return my_strntod(str_value.charset(),str_value.ptr(),str_value.length(),(char**)NULL);
+ return my_strntod(str_value.charset(), (char*) str_value.ptr(),
+ str_value.length(), (char**) 0);
}
longlong val_int()
{
- return my_strntoll(str_value.charset(),str_value.ptr(),str_value.length(),(char**) 0,10);
+ return my_strntoll(str_value.charset(), str_value.ptr(),
+ str_value.length(), (char**) 0, 10);
}
String *val_str(String*) { return (String*) &str_value; }
int save_in_field(Field *field, bool no_conversions);
@@ -568,7 +522,7 @@ protected:
Item_in_subselect* owner;
public:
Item_ref_null_helper(Item_in_subselect* master, Item **item,
- char *table_name_par,char *field_name_par):
+ char *table_name_par, char *field_name_par):
Item_ref(item, table_name_par, field_name_par), owner(master) {}
double val();
longlong val_int();
@@ -576,6 +530,28 @@ public:
bool get_date(TIME *ltime, bool fuzzydate);
};
+
+/*
+ Used to find item in list of select items after '*' items processing.
+
+ Because item '*' can be used in item list. when we create
+ Item_ref_on_list_position we do not know how item list will be changed, but
+ we know number of item position (I mean queries like "select * from t").
+*/
+class Item_ref_on_list_position: public Item_ref_null_helper
+{
+protected:
+ List<Item> &list;
+ uint pos;
+public:
+ Item_ref_on_list_position(Item_in_subselect* master,
+ List<Item> &li, uint num,
+ char *table_name, char *field_name):
+ Item_ref_null_helper(master, 0, table_name, field_name),
+ list(li), pos(num) {}
+ bool fix_fields(THD *, struct st_table_list *, Item ** ref);
+};
+
/*
To resolve '*' field moved to condition
and register NULL values
@@ -592,24 +568,6 @@ public:
bool fix_fields(THD *, struct st_table_list *, Item ** ref);
};
-class Item_in_optimizer;
-class Item_ref_in_optimizer: public Item_ref
-{
-protected:
- Item_in_optimizer* owner;
-public:
- Item_ref_in_optimizer(Item_in_optimizer* master,
- char *table_name_par,char *field_name_par);
- double val();
- longlong val_int();
- String* val_str(String* s);
- bool fix_fields(THD *, struct st_table_list *, Item ** ref)
- {
- fixed= 1;
- return 0;
- }
-};
-
/*
The following class is used to optimize comparing of date columns
We need to save the original item, to be able to set the field to the
@@ -658,7 +616,11 @@ public:
enum Item_result result_type () const { return STRING_RESULT; }
enum_field_types field_type() const { return cached_field_type; }
double val()
- { return null_value ? 0.0 : my_strntod(str_value.charset(),str_value.ptr(),str_value.length(),NULL); }
+ {
+ return (null_value ? 0.0 :
+ my_strntod(str_value.charset(), (char*) str_value.ptr(),
+ str_value.length(),NULL));
+ }
longlong val_int()
{ return null_value ? LL(0) : my_strntoll(str_value.charset(),str_value.ptr(),str_value.length(),(char**) 0,10); }
String *val_str(String*);
@@ -724,6 +686,122 @@ public:
bool cmp(void);
};
+class Item_cache: public Item
+{
+public:
+ virtual bool allocate(uint i) { return 0; };
+ virtual bool setup(Item *) { return 0; };
+ virtual void store(Item *)= 0;
+ void set_len_n_dec(uint32 max_len, uint8 dec)
+ {
+ max_length= max_len;
+ decimals= dec;
+ }
+ enum Type type() const { return CACHE_ITEM; }
+ static Item_cache* get_cache(Item_result type);
+};
+
+class Item_cache_int: public Item_cache
+{
+ longlong value;
+public:
+ Item_cache_int() { fixed= 1; null_value= 1; }
+
+ void store(Item *item)
+ {
+ value= item->val_int_result();
+ null_value= item->null_value;
+ }
+ double val() { return (double) value; }
+ longlong val_int() { return value; }
+ String* val_str(String *str) { str->set(value, thd_charset()); return str; }
+ enum Item_result result_type() const { return INT_RESULT; }
+};
+
+class Item_cache_real: public Item_cache
+{
+ double value;
+public:
+ Item_cache_real() { fixed= 1; null_value= 1; }
+
+ void store(Item *item)
+ {
+ value= item->val_result();
+ null_value= item->null_value;
+ }
+ double val() { return value; }
+ longlong val_int() { return (longlong) (value+(value > 0 ? 0.5 : -0.5)); }
+ String* val_str(String *str)
+ {
+ str->set(value, decimals, thd_charset());
+ return str;
+ }
+ enum Item_result result_type() const { return REAL_RESULT; }
+};
+
+class Item_cache_str: public Item_cache
+{
+ char buffer[80];
+ String *value;
+public:
+ Item_cache_str() { fixed= 1; null_value= 1; }
+
+ void store(Item *item);
+ double val();
+ longlong val_int();
+ String* val_str(String *) { return value; }
+ enum Item_result result_type() const { return STRING_RESULT; }
+ CHARSET_INFO *charset() const { return value->charset(); };
+};
+
+class Item_cache_row: public Item_cache
+{
+ Item_cache **values;
+ uint item_count;
+public:
+ Item_cache_row(): values(0), item_count(2) { fixed= 1; null_value= 1; }
+
+ /*
+ 'allocate' used only in row transformer, to preallocate space for row
+ cache.
+ */
+ bool allocate(uint num);
+ /*
+ 'setup' is needed only by row => it not called by simple row subselect
+ (only by IN subselect (in subselect optimizer))
+ */
+ bool setup(Item *item);
+ void store(Item *item);
+ void illegal_method_call(const char *);
+ void make_field(Send_field *)
+ {
+ illegal_method_call((const char*)"make_field");
+ };
+ double val()
+ {
+ illegal_method_call((const char*)"val");
+ return 0;
+ };
+ longlong val_int()
+ {
+ illegal_method_call((const char*)"val_int");
+ return 0;
+ };
+ String *val_str(String *)
+ {
+ illegal_method_call((const char*)"val_str");
+ return 0;
+ };
+ enum Item_result result_type() const { return ROW_RESULT; }
+
+ uint cols() { return item_count; }
+ Item* el(uint i) { return values[i]; }
+ Item** addr(uint i) { return (Item **) (values + i); }
+ bool check_cols(uint c);
+ bool null_inside();
+ void bring_value();
+};
+
extern Item_buff *new_Item_buff(Item *item);
extern Item_result item_cmp_type(Item_result a,Item_result b);
extern Item *resolve_const_item(Item *item,Item *cmp_item);
diff --git a/sql/item_buff.cc b/sql/item_buff.cc
index 7b8976bb572..573d4ab17e3 100644
--- a/sql/item_buff.cc
+++ b/sql/item_buff.cc
@@ -99,7 +99,7 @@ bool Item_field_buff::cmp(void)
{
bool tmp= field->cmp(buff) != 0; // This is not a blob!
if (tmp)
- field->get_image(buff,length);
+ field->get_image(buff,length,field->charset());
if (null_value != field->is_null())
{
null_value= !null_value;
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 851a591bae9..3d65c05b9cf 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -153,11 +153,7 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type)
comparators[i].set_cmp_func(owner, (*a)->addr(i), (*b)->addr(i));
}
else
- {
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
- current_thd->fatal_error= 1;
return 1;
- }
}
return 0;
}
@@ -247,6 +243,8 @@ int Arg_comparator::compare_e_int()
int Arg_comparator::compare_row()
{
int res= 0;
+ (*a)->bring_value();
+ (*b)->bring_value();
uint n= (*a)->cols();
for (uint i= 0; i<n; i++)
{
@@ -261,6 +259,8 @@ int Arg_comparator::compare_row()
int Arg_comparator::compare_e_row()
{
int res= 0;
+ (*a)->bring_value();
+ (*b)->bring_value();
uint n= (*a)->cols();
for (uint i= 0; i<n; i++)
{
@@ -270,60 +270,59 @@ int Arg_comparator::compare_e_row()
return 1;
}
-longlong Item_in_optimizer::val_int()
+bool Item_in_optimizer::preallocate_row()
{
- int_cache_ok= 1;
- flt_cache_ok= 0;
- str_cache_ok= 0;
- int_cache= args[0]->val_int_result();
- if (args[0]->null_value)
- {
- null_value= 1;
- return 0;
- }
- longlong tmp= args[1]->val_int_result();
- null_value= args[1]->null_value;
- return tmp;
+ return (!(cache= Item_cache::get_cache(ROW_RESULT)));
}
-longlong Item_in_optimizer::get_cache_int()
+bool Item_in_optimizer::fix_fields(THD *thd, struct st_table_list *tables,
+ Item ** ref)
{
- if (!int_cache_ok)
+ if (args[0]->fix_fields(thd, tables, args))
+ return 1;
+ if (args[0]->maybe_null)
+ maybe_null=1;
+ if (args[0]->binary())
+ set_charset(my_charset_bin);
+ with_sum_func= args[0]->with_sum_func;
+ used_tables_cache= args[0]->used_tables();
+ const_item_cache= args[0]->const_item();
+ if (!cache && !(cache= Item_cache::get_cache(args[0]->result_type())))
+ return 1;
+ cache->setup(args[0]);
+ if (args[1]->fix_fields(thd, tables, args))
+ return 1;
+ Item_in_subselect * sub= (Item_in_subselect *)args[1];
+ if (args[0]->cols() != sub->engine->cols())
{
- int_cache_ok= 1;
- flt_cache_ok= 0;
- str_cache_ok= 0;
- int_cache= args[0]->val_int_result();
- null_value= args[0]->null_value;
+ my_error(ER_CARDINALITY_COL, MYF(0), args[0]->cols());
+ return 1;
}
- return int_cache;
+ if (args[1]->maybe_null)
+ maybe_null=1;
+ with_sum_func= with_sum_func || args[1]->with_sum_func;
+ used_tables_cache|= args[1]->used_tables();
+ const_item_cache&= args[1]->const_item();
+ return 0;
}
-double Item_in_optimizer::get_cache()
+longlong Item_in_optimizer::val_int()
{
- if (!flt_cache_ok)
+ cache->store(args[0]);
+ if (cache->null_value)
{
- flt_cache_ok= 1;
- int_cache_ok= 0;
- str_cache_ok= 0;
- flt_cache= args[0]->val_result();
- null_value= args[0]->null_value;
+ null_value= 1;
+ return 0;
}
- return flt_cache;
+ longlong tmp= args[1]->val_int_result();
+ null_value= args[1]->null_value;
+ return tmp;
}
-String *Item_in_optimizer::get_cache_str(String *s)
+bool Item_in_optimizer::is_null()
{
- if (!str_cache_ok)
- {
- str_cache_ok= 1;
- int_cache_ok= 0;
- flt_cache_ok= 0;
- str_value.set(buffer, sizeof(buffer), s->charset());
- str_cache= args[0]->str_result(&str_value);
- null_value= args[0]->null_value;
- }
- return str_cache;
+ cache->store(args[0]);
+ return (null_value= (cache->null_value || args[1]->is_null()));
}
longlong Item_func_eq::val_int()
@@ -869,8 +868,9 @@ String *Item_func_case::val_str(String *str)
null_value=1;
return 0;
}
+ null_value= 0;
if (!(res=item->val_str(str)))
- null_value=1;
+ null_value= 1;
return res;
}
@@ -935,6 +935,13 @@ Item_func_case::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
return 0;
}
+void Item_func_case::set_outer_resolving()
+{
+ first_expr->set_outer_resolving();
+ else_expr->set_outer_resolving();
+ Item_func::set_outer_resolving();
+}
+
bool Item_func_case::check_loop(uint id)
{
DBUG_ENTER("Item_func_case::check_loop");
@@ -1217,8 +1224,9 @@ void cmp_item_row::store_value(Item *item)
{
THD *thd= current_thd;
n= item->cols();
- if ((comparators= (cmp_item **) thd->alloc(sizeof(cmp_item *)*n)))
+ if ((comparators= (cmp_item **) thd->calloc(sizeof(cmp_item *)*n)))
{
+ item->bring_value();
item->null_value= 0;
for (uint i=0; i < n; i++)
if ((comparators[i]= cmp_item::get_comparator(item->el(i))))
@@ -1227,18 +1235,10 @@ void cmp_item_row::store_value(Item *item)
item->null_value|= item->el(i)->null_value;
}
else
- {
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
- thd->fatal_error= 1;
return;
- }
}
else
- {
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
- thd->fatal_error= 1;
return;
- }
}
void cmp_item_row::store_value_by_template(cmp_item *t, Item *item)
@@ -1252,6 +1252,7 @@ void cmp_item_row::store_value_by_template(cmp_item *t, Item *item)
n= tmpl->n;
if ((comparators= (cmp_item **) sql_alloc(sizeof(cmp_item *)*n)))
{
+ item->bring_value();
item->null_value= 0;
for (uint i=0; i < n; i++)
if ((comparators[i]= tmpl->comparators[i]->make_same()))
@@ -1261,18 +1262,10 @@ void cmp_item_row::store_value_by_template(cmp_item *t, Item *item)
item->null_value|= item->el(i)->null_value;
}
else
- {
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
- current_thd->fatal_error= 1;
return;
- }
}
else
- {
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
- current_thd->fatal_error= 1;
return;
- }
}
int cmp_item_row::cmp(Item *arg)
@@ -1284,6 +1277,7 @@ int cmp_item_row::cmp(Item *arg)
return 1;
}
bool was_null= 0;
+ arg->bring_value();
for (uint i=0; i < n; i++)
if (comparators[i]->cmp(arg->el(i)))
{
@@ -1509,6 +1503,15 @@ bool Item_cond::check_loop(uint id)
DBUG_RETURN(0);
}
+void Item_cond::set_outer_resolving()
+{
+ Item_func::set_outer_resolving();
+ List_iterator<Item> li(list);
+ Item *item;
+ while ((item= li++))
+ item->set_outer_resolving();
+}
+
void Item_cond::split_sum_func(List<Item> &fields)
{
List_iterator<Item> li(list);
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 994e51ef89f..bd7d1bfaf7a 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -85,25 +85,28 @@ public:
void fix_length_and_dec() { decimals=0; max_length=1; }
};
+class Item_cache;
class Item_in_optimizer: public Item_bool_func
{
protected:
- char buffer[80];
- longlong int_cache;
- double flt_cache;
- String *str_cache;
- bool int_cache_ok, flt_cache_ok, str_cache_ok;
-public:
- Item_in_optimizer(Item *a,Item *b):
- Item_bool_func(a,b), int_cache_ok(0), flt_cache_ok(0), str_cache_ok(0) {}
- bool is_null() { return test(args[0]->is_null() || args[1]->is_null()); }
+ Item_cache *cache;
+public:
+ Item_in_optimizer(Item *a, Item_in_subselect *b):
+ Item_bool_func(a, (Item *)b), cache(0) {}
+ // used by row in transformer
+ bool preallocate_row();
+ bool fix_fields(THD *, struct st_table_list *, Item **);
+ bool is_null();
+ /*
+ Item_in_optimizer item is special boolean function. On value request
+ (one of val, val_int or val_str methods) it evaluate left expression
+ of IN by storing it value in cache item (one of Item_cache* items),
+ then it test cache is it NULL. If left expression (cache) is NULL then
+ Item_in_optimizer return NULL, else it evaluate Item_in_subselect.
+ */
longlong val_int();
-
- double get_cache();
- longlong get_cache_int();
- String *get_cache_str(String *s);
-
- friend class Item_ref_in_optimizer;
+
+ Item_cache **get_cache() { return &cache; }
};
class Item_bool_func2 :public Item_int_func
@@ -281,6 +284,11 @@ public:
const char *func_name() const { return "interval"; }
void update_used_tables();
bool check_loop(uint id);
+ void set_outer_resolving()
+ {
+ item->set_outer_resolving();
+ Item_func::set_outer_resolving();
+ }
};
@@ -363,6 +371,7 @@ public:
bool fix_fields(THD *thd, struct st_table_list *tlist, Item **ref);
Item *find_item(String *str);
bool check_loop(uint id);
+ void set_outer_resolving();
};
@@ -542,10 +551,14 @@ public:
cmp_item_row(): comparators(0), n(0) {}
~cmp_item_row()
{
- if(comparators)
- for(uint i= 0; i < n; i++)
+ if (comparators)
+ {
+ for (uint i= 0; i < n; i++)
+ {
if (comparators[i])
delete comparators[i];
+ }
+ }
}
void store_value(Item *item);
int cmp(Item *arg);
@@ -647,6 +660,11 @@ class Item_func_in :public Item_int_func
DBUG_RETURN(item->check_loop(id));
}
bool nulls_in_row();
+ void set_outer_resolving()
+ {
+ item->set_outer_resolving();
+ Item_int_func::set_outer_resolving();
+ }
};
/* Functions used by where clause */
@@ -788,6 +806,7 @@ public:
friend int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds);
bool check_loop(uint id);
void top_level_item() { abort_on_null=1; }
+ void set_outer_resolving();
};
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 259427af901..0dba7f6e3ae 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -303,6 +303,18 @@ Item *create_func_pow(Item* a, Item *b)
return new Item_func_pow(a,b);
}
+Item *create_func_current_user()
+{
+ THD *thd=current_thd;
+ char buff[HOSTNAME_LENGTH+USERNAME_LENGTH+2];
+ uint length;
+
+ length= (uint) (strxmov(buff, thd->priv_user, "@", thd->host_or_ip, NullS) -
+ buff);
+ return new Item_string("CURRENT_USER()", thd->memdup(buff, length), length,
+ default_charset_info);
+}
+
Item *create_func_quarter(Item* a)
{
return new Item_func_quarter(a);
@@ -406,7 +418,7 @@ Item *create_func_ucase(Item* a)
Item *create_func_version(void)
{
- return new Item_string(NullS,server_version,
+ return new Item_string("VERSION()",server_version,
(uint) strlen(server_version),
default_charset_info);
}
diff --git a/sql/item_create.h b/sql/item_create.h
index 937ea782273..97386ca9b0b 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -71,6 +71,7 @@ Item *create_func_period_add(Item* a, Item *b);
Item *create_func_period_diff(Item* a, Item *b);
Item *create_func_pi(void);
Item *create_func_pow(Item* a, Item *b);
+Item *create_func_current_user(void);
Item *create_func_quarter(Item* a);
Item *create_func_radians(Item *a);
Item *create_func_release_lock(Item* a);
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 79bb0cbb0ae..47d26169d06 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -146,6 +146,16 @@ bool Item_func::check_loop(uint id)
DBUG_RETURN(0);
}
+void Item_func::set_outer_resolving()
+{
+ if (arg_count)
+ {
+ Item **arg,**arg_end;
+ for (arg= args, arg_end= args+arg_count; arg != arg_end; arg++)
+ (*arg)->set_outer_resolving();
+ }
+}
+
void Item_func::split_sum_func(List<Item> &fields)
{
Item **arg,**arg_end;
@@ -1885,7 +1895,7 @@ longlong Item_func_set_last_insert_id::val_int()
longlong Item_func_benchmark::val_int()
{
char buff[MAX_FIELD_WIDTH];
- String tmp(buff,sizeof(buff), default_charset_info);
+ String tmp(buff,sizeof(buff), my_charset_bin);
THD *thd=current_thd;
for (ulong loop=0 ; loop < loop_count && !thd->killed; loop++)
@@ -2031,7 +2041,7 @@ Item_func_set_user_var::update()
case STRING_RESULT:
{
char buffer[MAX_FIELD_WIDTH];
- String tmp(buffer,sizeof(buffer),default_charset_info);
+ String tmp(buffer,sizeof(buffer),my_charset_bin);
(void) val_str(&tmp);
break;
}
@@ -2171,11 +2181,14 @@ void Item_func_get_user_var::fix_length_and_dec()
maybe_null=1;
decimals=NOT_FIXED_DEC;
max_length=MAX_BLOB_WIDTH;
- if ((var_entry= get_variable(&thd->user_vars, name, 0)))
- const_var_flag= thd->query_id != var_entry->update_query_id;
+ var_entry= get_variable(&thd->user_vars, name, 0);
}
+bool Item_func_get_user_var::const_item() const
+{ return var_entry && current_thd->query_id != var_entry->update_query_id; }
+
+
enum Item_result Item_func_get_user_var::result_type() const
{
user_var_entry *entry;
@@ -2223,7 +2236,7 @@ longlong Item_func_inet_aton::val_int()
char c = '.'; // we mark c to indicate invalid IP in case length is 0
char buff[36];
- String *s,tmp(buff,sizeof(buff),default_charset_info);
+ String *s,tmp(buff,sizeof(buff),my_charset_bin);
if (!(s = args[0]->val_str(&tmp))) // If null value
goto err;
null_value=0;
@@ -2358,6 +2371,15 @@ bool Item_func_match::check_loop(uint id)
DBUG_RETURN(0);
}
+void Item_func_match::set_outer_resolving()
+{
+ Item_real_func::set_outer_resolving();
+ List_iterator<Item> li(fields);
+ Item *item;
+ while ((item= li++))
+ item->set_outer_resolving();
+}
+
bool Item_func_match::fix_index()
{
List_iterator_fast<Item> li(fields);
diff --git a/sql/item_func.h b/sql/item_func.h
index 36d6dcbe002..11793b11bdb 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -133,6 +133,7 @@ public:
friend class udf_handler;
Field *tmp_table_field(TABLE *t_arg);
bool check_loop(uint id);
+ void set_outer_resolving();
};
@@ -632,6 +633,11 @@ public:
DBUG_RETURN(1);
DBUG_RETURN(item->check_loop(id));
}
+ void set_outer_resolving()
+ {
+ item->set_outer_resolving();
+ Item_int_func::set_outer_resolving();
+ }
};
@@ -807,7 +813,7 @@ public:
double val()
{
String *res; res=val_str(&str_value);
- return res ? my_strntod(res->charset(),res->ptr(),res->length(),0) : 0.0;
+ return res ? my_strntod(res->charset(),(char*) res->ptr(),res->length(),0) : 0.0;
}
longlong val_int()
{
@@ -928,11 +934,10 @@ class Item_func_get_user_var :public Item_func
{
LEX_STRING name;
user_var_entry *var_entry;
- bool const_var_flag;
public:
Item_func_get_user_var(LEX_STRING a):
- Item_func(), name(a), const_var_flag(1) {}
+ Item_func(), name(a) {}
user_var_entry *get_entry();
double val();
longlong val_int();
@@ -946,9 +951,9 @@ public:
*/
enum_field_types field_type() const { return MYSQL_TYPE_STRING; }
const char *func_name() const { return "get_user_var"; }
- bool const_item() const { return const_var_flag; }
+ bool const_item() const;
table_map used_tables() const
- { return const_var_flag ? 0 : RAND_TABLE_BIT; }
+ { return const_item() ? 0 : RAND_TABLE_BIT; }
bool eq(const Item *item, bool binary_cmp) const;
};
@@ -989,7 +994,7 @@ public:
{
ft_handler->please->close_search(ft_handler);
ft_handler=0;
- if(join_key)
+ if (join_key)
table->file->ft_handler=0;
table->fulltext_searched=0;
}
@@ -1006,6 +1011,7 @@ public:
bool fix_index();
void init_search(bool no_order);
bool check_loop(uint id);
+ void set_outer_resolving();
};
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 85a81a50256..355228e45df 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -18,7 +18,7 @@
#include "assert.h"
Item_row::Item_row(List<Item> &arg):
- Item(), array_holder(1), used_tables_cache(0), const_item_cache(1)
+ Item(), used_tables_cache(0), array_holder(1), const_item_cache(1)
{
//TODO: think placing 2-3 component items in item (as it done for function)
@@ -41,7 +41,7 @@ void Item_row::illegal_method_call(const char *method)
DBUG_ENTER("Item_row::illegal_method_call");
DBUG_PRINT("error", ("!!! %s method was called for row item", method));
DBUG_ASSERT(0);
- my_error(ER_CARDINALITY_COL, MYF(0), arg_count);
+ my_error(ER_CARDINALITY_COL, MYF(0), 1);
DBUG_VOID_RETURN;
}
@@ -54,7 +54,16 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref)
if (items[i]->fix_fields(thd, tabl, items+i))
return 1;
used_tables_cache |= items[i]->used_tables();
- const_item_cache&= items[i]->const_item();
+ if (const_item_cache&= items[i]->const_item() && !with_null)
+ {
+ if (items[i]->cols() > 1)
+ with_null|= items[i]->null_inside();
+ else
+ {
+ items[i]->val_int();
+ with_null|= items[i]->null_value;
+ }
+ }
maybe_null|= items[i]->maybe_null;
}
return 0;
@@ -82,21 +91,24 @@ bool Item_row::check_cols(uint c)
return 0;
}
-bool Item_row::null_inside()
+void Item_row::bring_value()
{
for (uint i= 0; i < arg_count; i++)
- {
- if (items[i]->cols() > 1)
- {
- if (items[i]->null_inside())
- return 1;
- }
- else
- {
- items[i]->val_int();
- if (items[i]->null_value)
- return 1;
- }
- }
+ items[i]->bring_value();
+}
+
+void Item_row::set_outer_resolving()
+{
+ for (uint i= 0; i < arg_count; i++)
+ items[i]->set_outer_resolving();
+}
+
+bool Item_row::check_loop(uint id)
+{
+ if (Item::check_loop(id))
+ return 1;
+ for (uint i= 0; i < arg_count; i++)
+ if (items[i]->check_loop(id))
+ return 1;
return 0;
}
diff --git a/sql/item_row.h b/sql/item_row.h
index 4767d19d08f..ccaf68bed64 100644
--- a/sql/item_row.h
+++ b/sql/item_row.h
@@ -16,24 +16,27 @@
class Item_row: public Item
{
- bool array_holder;
+ Item **items;
table_map used_tables_cache;
- bool const_item_cache;
uint arg_count;
- Item **items;
+ bool array_holder;
+ bool const_item_cache;
+ bool with_null;
public:
Item_row(List<Item> &);
Item_row(Item_row *item):
- Item(), array_holder(0),
+ Item(),
+ items(item->items),
used_tables_cache(item->used_tables_cache),
- const_item_cache(item->const_item_cache),
arg_count(item->arg_count),
- items(item->items)
+ array_holder(0),
+ const_item_cache(item->const_item_cache),
+ with_null(0)
{}
~Item_row()
{
- if(array_holder && items)
+ if (array_holder && items)
sql_element_free(items);
}
@@ -64,10 +67,13 @@ public:
bool const_item() const { return const_item_cache; };
enum Item_result result_type() const { return ROW_RESULT; }
void update_used_tables();
+ bool check_loop(uint id);
+ void set_outer_resolving();
uint cols() { return arg_count; }
Item* el(uint i) { return items[i]; }
Item** addr(uint i) { return items + i; }
bool check_cols(uint c);
- bool null_inside();
+ bool null_inside() { return with_null; };
+ void bring_value();
};
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 0b9658a5c2a..4358f14f08e 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -54,7 +54,8 @@ double Item_str_func::val()
{
String *res;
res=val_str(&str_value);
- return res ? my_strntod(res->charset(),res->ptr(),res->length(),NULL) : 0.0;
+ return res ? my_strntod(res->charset(), (char*) res->ptr(),res->length(),
+ NULL) : 0.0;
}
longlong Item_str_func::val_int()
@@ -1271,18 +1272,60 @@ String *Item_func_trim::val_str(String *str)
return &tmp_value;
}
+/*
+ Password() function can have 2 args now. Second argument can be used
+ to make results repeatable
+*/
String *Item_func_password::val_str(String *str)
{
- String *res =args[0]->val_str(str);
+ struct rand_struct rand_st; // local structure for 2 param version
+ ulong seed=0; // seed to initialise random generator to
+
+ String *res =args[0]->val_str(str);
if ((null_value=args[0]->null_value))
return 0;
- if (res->length() == 0)
- return &empty_string;
- make_scrambled_password(tmp_value,res->c_ptr(),opt_old_passwords,
- &current_thd->rand);
- str->set(tmp_value,get_password_length(opt_old_passwords),res->charset());
- return str;
+
+ if (arg_count == 1)
+ {
+ if (res->length() == 0)
+ return &empty_string;
+ make_scrambled_password(tmp_value,res->c_ptr(),opt_old_passwords,
+ &current_thd->rand);
+ str->set(tmp_value,get_password_length(opt_old_passwords),res->charset());
+ return str;
+ }
+ else
+ {
+ /* We'll need the buffer to get second parameter */
+ char key_buff[80];
+ String tmp_key_value(key_buff, sizeof(key_buff), system_charset_info);
+ String *key =args[1]->val_str(&tmp_key_value);
+
+ /* Check second argument for NULL value. First one is already checked */
+ if ((null_value=args[1]->null_value))
+ return 0;
+
+ /* This shall be done after checking for null for proper results */
+ if (res->length() == 0)
+ return &empty_string;
+
+ /* Generate the seed first this allows to avoid double allocation */
+ char* seed_ptr=key->c_ptr();
+ while (*seed_ptr)
+ {
+ seed=seed*211+*seed_ptr; /* Use simple hashing */
+ seed_ptr++;
+ }
+
+ /* Use constants which allow nice random values even with small seed */
+ randominit(&rand_st,seed*111111+33333333L,seed*1111+55555555L);
+
+ make_scrambled_password(tmp_value,res->c_ptr(),opt_old_passwords,
+ &rand_st);
+ str->set(tmp_value,get_password_length(opt_old_passwords),res->charset());
+ return str;
+ }
}
String *Item_func_old_password::val_str(String *str)
@@ -1438,6 +1481,8 @@ String *Item_func_soundex::val_str(String *str)
{
String *res =args[0]->val_str(str);
char last_ch,ch;
+ CHARSET_INFO *cs=my_charset_latin1;
+
if ((null_value=args[0]->null_value))
return 0; /* purecov: inspected */
@@ -1445,22 +1490,23 @@ String *Item_func_soundex::val_str(String *str)
return str; /* purecov: inspected */
char *to= (char *) tmp_value.ptr();
char *from= (char *) res->ptr(), *end=from+res->length();
-
- while (from != end && my_isspace(str->charset(),*from)) // Skip pre-space
+ tmp_value.set_charset(cs);
+
+ while (from != end && my_isspace(cs,*from)) // Skip pre-space
from++; /* purecov: inspected */
if (from == end)
return &empty_string; // No alpha characters.
- *to++ = my_toupper(str->charset(),*from);// Copy first letter
- last_ch = get_scode(str->charset(),from);// code of the first letter
+ *to++ = my_toupper(cs,*from); // Copy first letter
+ last_ch = get_scode(cs,from); // code of the first letter
// for the first 'double-letter check.
// Loop on input letters until
// end of input (null) or output
// letter code count = 3
for (from++ ; from < end ; from++)
{
- if (!my_isalpha(str->charset(),*from))
+ if (!my_isalpha(cs,*from))
continue;
- ch=get_scode(str->charset(),from);
+ ch=get_scode(cs,from);
if ((ch != '0') && (ch != last_ch)) // if not skipped or double
{
*to++ = ch; // letter, copy to output
@@ -1958,7 +2004,8 @@ String *Item_func_conv_charset::val_str(String *str)
d0=d=(unsigned char*)str->ptr();
de=d+dmaxlen;
- while( s < se && d < de){
+ while (s < se && d < de)
+ {
cnvres=from->mb_wc(from,&wc,s,se);
if (cnvres>0)
@@ -2032,7 +2079,7 @@ String *Item_func_conv_charset3::val_str(String *str)
d0=d=(unsigned char*)str->ptr();
de=d+dmaxlen;
- while( s < se && d < de){
+ while (s < se && d < de){
cnvres=from_charset->mb_wc(from_charset,&wc,s,se);
if (cnvres>0)
@@ -2394,7 +2441,7 @@ String *Item_func_quote::val_str(String *str)
*/
to= (char*) str->ptr() + new_length - 1;
*to--= '\'';
- for (start= (char*) arg->ptr() ; end-- != start; to--)
+ for (start= (char*) arg->ptr(),end= start + arg_length; end-- != start; to--)
{
/*
We can't use the bitmask here as we want to replace \O and ^Z with 0
@@ -2436,7 +2483,8 @@ General functions for spatial objects
String *Item_func_geometry_from_text::val_str(String *str)
{
Geometry geom;
- String *wkt = args[0]->val_str(str);
+ String arg_val;
+ String *wkt = args[0]->val_str(&arg_val);
GTextReadStream trs(wkt->ptr(), wkt->length());
str->length(0);
@@ -2454,7 +2502,8 @@ void Item_func_geometry_from_text::fix_length_and_dec()
String *Item_func_as_text::val_str(String *str)
{
- String *wkt = args[0]->val_str(str);
+ String arg_val;
+ String *wkt = args[0]->val_str(&arg_val);
Geometry geom;
if ((null_value=(args[0]->null_value ||
@@ -2491,7 +2540,8 @@ String *Item_func_geometry_type::val_str(String *str)
String *Item_func_envelope::val_str(String *str)
{
- String *wkb = args[0]->val_str(str);
+ String arg_val;
+ String *wkb = args[0]->val_str(&arg_val);
Geometry geom;
null_value = args[0]->null_value ||
@@ -2504,7 +2554,8 @@ String *Item_func_envelope::val_str(String *str)
String *Item_func_centroid::val_str(String *str)
{
- String *wkb = args[0]->val_str(str);
+ String arg_val;
+ String *wkb = args[0]->val_str(&arg_val);
Geometry geom;
null_value = args[0]->null_value ||
@@ -2522,7 +2573,8 @@ String *Item_func_centroid::val_str(String *str)
String *Item_func_spatial_decomp::val_str(String *str)
{
- String *wkb = args[0]->val_str(str);
+ String arg_val;
+ String *wkb = args[0]->val_str(&arg_val);
Geometry geom;
if ((null_value = (args[0]->null_value ||
@@ -2530,6 +2582,7 @@ String *Item_func_spatial_decomp::val_str(String *str)
return 0;
null_value=1;
+ str->length(0);
switch(decomp_func)
{
case SP_STARTPOINT:
@@ -2559,7 +2612,8 @@ ret:
String *Item_func_spatial_decomp_n::val_str(String *str)
{
- String *wkb = args[0]->val_str(str);
+ String arg_val;
+ String *wkb = args[0]->val_str(&arg_val);
long n = (long) args[1]->val_int();
Geometry geom;
@@ -2613,6 +2667,9 @@ Functions to concatinate various spatial objects
String *Item_func_point::val_str(String *str)
{
+ double x= args[0]->val();
+ double y= args[1]->val();
+
if ( (null_value = (args[0]->null_value ||
args[1]->null_value ||
str->realloc(1+4+8+8))))
@@ -2621,8 +2678,8 @@ String *Item_func_point::val_str(String *str)
str->length(0);
str->q_append((char)Geometry::wkbNDR);
str->q_append((uint32)Geometry::wkbPoint);
- str->q_append((double)args[0]->val());
- str->q_append((double)args[1]->val());
+ str->q_append(x);
+ str->q_append(y);
return str;
}
@@ -2639,12 +2696,13 @@ String *Item_func_point::val_str(String *str)
String *Item_func_spatial_collection::val_str(String *str)
{
+ String arg_value;
uint i;
null_value=1;
str->length(0);
- if(str->reserve(9,512))
+ if (str->reserve(9,512))
return 0;
str->q_append((char)Geometry::wkbNDR);
@@ -2653,11 +2711,10 @@ String *Item_func_spatial_collection::val_str(String *str)
for (i = 0; i < arg_count; ++i)
{
+ String *res = args[i]->val_str(&arg_value);
if (args[i]->null_value)
goto ret;
- String *res = args[i]->val_str(str);
-
if ( coll_type == Geometry::wkbGeometryCollection )
{
/*
@@ -2715,10 +2772,8 @@ String *Item_func_spatial_collection::val_str(String *str)
uint32 n_points;
double x1, y1, x2, y2;
- if (len < WKB_HEADER_SIZE + 4 + 8 + 8)
+ if (len < 4 + 2 * POINT_DATA_SIZE)
goto ret;
- data+=WKB_HEADER_SIZE;
- len-=WKB_HEADER_SIZE;
uint32 llen=len;
const char *ldata=data;
@@ -2730,10 +2785,6 @@ String *Item_func_spatial_collection::val_str(String *str)
float8get(y1,data);
data+=8;
- len-= 4 + 8 + 8;
-
- if (len < n_points * POINT_DATA_SIZE)
- goto ret;
data+=(n_points-2) * POINT_DATA_SIZE;
float8get(x2,data);
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index c8706c2c933..c90ff6e2295 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -108,14 +108,19 @@ public:
separator->fix_fields(thd, tlist, &separator) ||
Item_func::fix_fields(thd, tlist, ref));
}
- const char *func_name() const { return "concat_ws"; }
- bool check_loop(uint id)
- {
- DBUG_ENTER("Item_func_concat_ws::check_loop");
- if (Item_str_func::check_loop(id))
- DBUG_RETURN(1);
- DBUG_RETURN(separator->check_loop(id));
- }
+ const char *func_name() const { return "concat_ws"; }
+ bool check_loop(uint id)
+ {
+ DBUG_ENTER("Item_func_concat_ws::check_loop");
+ if (Item_str_func::check_loop(id))
+ DBUG_RETURN(1);
+ DBUG_RETURN(separator->check_loop(id));
+ }
+ void set_outer_resolving()
+ {
+ separator->set_outer_resolving();
+ Item_func::set_outer_resolving();
+ }
};
class Item_func_reverse :public Item_str_func
@@ -257,6 +262,7 @@ class Item_func_password :public Item_str_func
char tmp_value[64]; /* This should be enough for new password format */
public:
Item_func_password(Item *a) :Item_str_func(a) {}
+ Item_func_password(Item *a, Item *b) :Item_str_func(a,b) {}
String *val_str(String *);
void fix_length_and_dec() { max_length = get_password_length(opt_old_passwords); }
const char *func_name() const { return "password"; }
@@ -393,6 +399,11 @@ public:
DBUG_RETURN(1);
DBUG_RETURN(item->check_loop(id));
}
+ void set_outer_resolving()
+ {
+ item->set_outer_resolving();
+ Item_str_func::set_outer_resolving();
+ }
};
@@ -421,6 +432,11 @@ public:
DBUG_RETURN(1);
DBUG_RETURN(item->check_loop(id));
}
+ void set_outer_resolving()
+ {
+ item->set_outer_resolving();
+ Item_str_func::set_outer_resolving();
+ }
};
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index a8bbc433b7a..c5ecdc87d40 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -32,6 +32,11 @@ SUBSELECT TODO:
#include "mysql_priv.h"
#include "sql_select.h"
+inline Item * and_items(Item* cond, Item *item)
+{
+ return (cond? (new Item_cond_and(cond, item)) : item);
+}
+
Item_subselect::Item_subselect():
Item_result_field(), engine_owner(1), value_assigned(0), substitution(0),
have_to_be_excluded(0)
@@ -51,7 +56,7 @@ void Item_subselect::init(THD *thd, st_select_lex *select_lex,
DBUG_ENTER("Item_subselect::init");
DBUG_PRINT("subs", ("select_lex 0x%xl", (ulong) select_lex));
- select_transformer(select_lex);
+ select_transformer(thd, select_lex->master_unit());
if (select_lex->next_select())
engine= new subselect_union_engine(thd, select_lex->master_unit(), result,
this);
@@ -67,7 +72,7 @@ Item_subselect::~Item_subselect()
delete engine;
}
-void Item_subselect::select_transformer(st_select_lex *select_lex)
+void Item_subselect::select_transformer(THD *thd, st_select_lex_unit *unit)
{
DBUG_ENTER("Item_subselect::select_transformer");
DBUG_VOID_RETURN;
@@ -112,9 +117,14 @@ bool Item_subselect::check_loop(uint id)
DBUG_RETURN(engine->check_loop(id));
}
+Item::Type Item_subselect::type() const
+{
+ return SUBSELECT_ITEM;
+}
+
void Item_subselect::fix_length_and_dec()
{
- engine->fix_length_and_dec();
+ engine->fix_length_and_dec(0);
}
inline table_map Item_subselect::used_tables() const
@@ -122,56 +132,165 @@ inline table_map Item_subselect::used_tables() const
return (table_map) engine->depended() ? 1L : 0L;
}
-Item_singleval_subselect::Item_singleval_subselect(THD *thd,
+Item_singlerow_subselect::Item_singlerow_subselect(THD *thd,
st_select_lex *select_lex):
- Item_subselect()
+ Item_subselect(), value(0)
{
- DBUG_ENTER("Item_singleval_subselect::Item_singleval_subselect");
- init(thd, select_lex, new select_singleval_subselect(this));
+ DBUG_ENTER("Item_singlerow_subselect::Item_singlerow_subselect");
+ init(thd, select_lex, new select_singlerow_subselect(this));
max_columns= 1;
maybe_null= 1;
+ max_columns= UINT_MAX;
DBUG_VOID_RETURN;
}
-void Item_singleval_subselect::fix_length_and_dec()
+void Item_singlerow_subselect::reset()
{
- engine->fix_length_and_dec();
- res_type= engine->type();
+ null_value= 1;
+ if (value)
+ value->null_value= 1;
}
-Item::Type Item_subselect::type() const
+void Item_singlerow_subselect::select_transformer(THD *thd,
+ st_select_lex_unit *unit)
{
- return SUBSELECT_ITEM;
+ SELECT_LEX *select_lex= unit->first_select();
+
+ if (!select_lex->next_select() && !select_lex->table_list.elements &&
+ select_lex->item_list.elements == 1 &&
+ // TODO: mark subselect items from item list separately
+ !(select_lex->item_list.head()->type() == FIELD_ITEM ||
+ select_lex->item_list.head()->type() == REF_ITEM)
+ )
+ {
+
+ have_to_be_excluded= 1;
+ if (thd->lex.describe)
+ {
+ char warn_buff[MYSQL_ERRMSG_SIZE];
+ sprintf(warn_buff, ER(ER_SELECT_REDUCED), select_lex->select_number);
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_SELECT_REDUCED, warn_buff);
+ }
+ substitution= select_lex->item_list.head();
+ substitution->set_outer_resolving();
+
+ if (select_lex->where || select_lex->having)
+ {
+ Item *cond;
+ if (!select_lex->having)
+ cond= select_lex->where;
+ else if (!select_lex->where)
+ cond= select_lex->having;
+ else
+ if (!(cond= new Item_cond_and(select_lex->having, select_lex->where)))
+ return;
+ if (!(substitution= new Item_func_if(cond, substitution,
+ new Item_null())))
+ return;
+ }
+ }
}
-double Item_singleval_subselect::val ()
+void Item_singlerow_subselect::store(uint i, Item *item)
{
- if (engine->exec())
+ row[i]->store(item);
+}
+
+enum Item_result Item_singlerow_subselect::result_type() const
+{
+ return engine->type();
+}
+
+void Item_singlerow_subselect::fix_length_and_dec()
+{
+ if ((max_columns= engine->cols()) == 1)
+ {
+ engine->fix_length_and_dec(row= &value);
+ if (!(value= Item_cache::get_cache(engine->type())))
+ return;
+ }
+ else
+ {
+ THD *thd= current_thd;
+ if (!(row= (Item_cache**)thd->alloc(sizeof(Item_cache*)*max_columns)))
+ return;
+ engine->fix_length_and_dec(row);
+ value= *row;
+ }
+ maybe_null= engine->may_be_null();
+}
+
+uint Item_singlerow_subselect::cols()
+{
+ return engine->cols();
+}
+
+bool Item_singlerow_subselect::check_cols(uint c)
+{
+ if (c != engine->cols())
+ {
+ my_error(ER_CARDINALITY_COL, MYF(0), c);
+ return 1;
+ }
+ return 0;
+}
+
+bool Item_singlerow_subselect::null_inside()
+{
+ for (uint i= 0; i < max_columns ; i++)
+ {
+ if (row[i]->null_value)
+ return 1;
+ }
+ return 0;
+}
+
+void Item_singlerow_subselect::bring_value()
+{
+ engine->exec();
+}
+
+double Item_singlerow_subselect::val ()
+{
+ if (!engine->exec() && !value->null_value)
+ {
+ null_value= 0;
+ return value->val();
+ }
+ else
{
reset();
return 0;
}
- return real_value;
}
-longlong Item_singleval_subselect::val_int ()
+longlong Item_singlerow_subselect::val_int ()
{
- if (engine->exec())
+ if (!engine->exec() && !value->null_value)
+ {
+ null_value= 0;
+ return value->val_int();
+ }
+ else
{
reset();
return 0;
}
- return int_value;
}
-String *Item_singleval_subselect::val_str (String *str)
+String *Item_singlerow_subselect::val_str (String *str)
{
- if (engine->exec() || null_value)
+ if (!engine->exec() && !value->null_value)
+ {
+ null_value= 0;
+ return value->val_str(str);
+ }
+ else
{
reset();
return 0;
}
- return &string_value;
}
Item_exists_subselect::Item_exists_subselect(THD *thd,
@@ -213,7 +332,7 @@ Item_allany_subselect::Item_allany_subselect(THD *thd, Item * left_exp,
left_expr= left_exp;
func= f;
init(thd, select_lex, new select_exists_subselect(this));
- max_columns= UINT_MAX;
+ max_columns= 1;
reset();
// We need only 1 row to determinate existence
select_lex->master_unit()->global_parameters->select_limit= 1;
@@ -223,8 +342,9 @@ Item_allany_subselect::Item_allany_subselect(THD *thd, Item * left_exp,
void Item_exists_subselect::fix_length_and_dec()
{
- decimals=0;
+ decimals= 0;
max_length= 1;
+ max_columns= engine->cols();
}
double Item_exists_subselect::val ()
@@ -313,28 +433,44 @@ Item_allany_subselect::Item_allany_subselect(Item_allany_subselect *item):
func= item->func;
}
-void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
+void Item_in_subselect::single_value_transformer(THD *thd,
+ st_select_lex_unit *unit,
Item *left_expr,
compare_func_creator func)
{
DBUG_ENTER("Item_in_subselect::single_value_transformer");
+ if (unit->global_parameters->select_limit != HA_POS_ERROR)
+ {
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0),
+ "LIMIT & IN/ALL/ANY/SOME subquery");
+ DBUG_VOID_RETURN;
+ }
+ // no sense in ORDER BY without LIMIT
+ unit->global_parameters->order_list.empty();
+
Item_in_optimizer *optimizer;
substitution= optimizer= new Item_in_optimizer(left_expr, this);
if (!optimizer)
- {
- current_thd->fatal_error= 1;
DBUG_VOID_RETURN;
- }
+
/*
As far as Item_ref_in_optimizer do not substitude itself on fix_fields
we can use same item for all selects.
*/
- Item *expr= new Item_ref_in_optimizer(optimizer, (char *)"<no matter>",
- (char*)"<left expr>");
- select_lex->master_unit()->dependent= 1;
- for (SELECT_LEX * sl= select_lex; sl; sl= sl->next_select())
+ Item *expr= new Item_ref((Item**)optimizer->get_cache(),
+ (char *)"<no matter>",
+ (char*)"<left expr>");
+ unit->dependent= 1;
+ for (SELECT_LEX * sl= unit->first_select(); sl; sl= sl->next_select())
{
- select_lex->dependent= 1;
+ if (sl->select_limit != HA_POS_ERROR)
+ {
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0),
+ "LIMIT & IN/ALL/ANY/SOME subquery");
+ DBUG_VOID_RETURN;
+ }
+
+ sl->dependent= 1;
Item *item;
if (sl->item_list.elements > 1)
{
@@ -344,24 +480,16 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
else
item= (Item*) sl->item_list.pop();
- if (sl->having || sl->with_sum_func || sl->group_list.first ||
- sl->order_list.first)
+ sl->order_list.empty(); // no sense in ORDER BY without LIMIT
+
+ if (sl->having || sl->with_sum_func || sl->group_list.first)
{
sl->item_list.push_back(item);
item= (*func)(expr, new Item_ref_null_helper(this,
sl->item_list.head_ref(),
(char *)"<no matter>",
(char*)"<result>"));
- if (sl->having || sl->with_sum_func || sl->group_list.first)
- if (sl->having)
- sl->having= new Item_cond_and(sl->having, item);
- else
- sl->having= item;
- else
- if (sl->where)
- sl->where= new Item_cond_and(sl->having, item);
- else
- sl->where= item;
+ sl->having= and_items(sl->having, item);
}
else
{
@@ -372,10 +500,7 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
item= (*func)(expr, new Item_asterisk_remover(this, item,
(char *)"<no matter>",
(char*)"<result>"));
- if (sl->where)
- sl->where= new Item_cond_and(sl->where, item);
- else
- sl->where= item;
+ sl->where= and_items(sl->where, item);
}
else
{
@@ -385,7 +510,7 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
my_error(ER_NO_TABLES_USED, MYF(0));
DBUG_VOID_RETURN;
}
- if (select_lex->next_select())
+ if (unit->first_select()->next_select())
{
/*
It is in union => we should perform it.
@@ -402,7 +527,6 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
item= (*func)(left_expr, item);
substitution= item;
have_to_be_excluded= 1;
- THD *thd= current_thd;
if (thd->lex.describe)
{
char warn_buff[MYSQL_ERRMSG_SIZE];
@@ -417,15 +541,91 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
DBUG_VOID_RETURN;
}
-void Item_in_subselect::select_transformer(st_select_lex *select_lex)
+void Item_in_subselect::row_value_transformer(THD *thd,
+ st_select_lex_unit *unit,
+ Item *left_expr)
{
- single_value_transformer(select_lex, left_expr,
- &Item_bool_func2::eq_creator);
+ DBUG_ENTER("Item_in_subselect::row_value_transformer");
+ if (unit->global_parameters->select_limit !=
+ HA_POS_ERROR)
+ {
+ /*
+ Because we do the following (not exactly, following is just explenation)
+ transformation
+ SELECT * from t1 WHERE t1.a IN (SELECT t2.a FROM t2)
+ ->
+ SELECT * from t1 WHERE EXISTS(SELECT 1 FROM t2 t1.a = t2.a LIMIT 1)
+
+ it's impossible to support limit in the sub select.
+ */
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0),
+ "LIMIT & IN/ALL/ANY/SOME subquery");
+ DBUG_VOID_RETURN;
+ }
+ // no sense in ORDER BY without LIMIT
+ unit->global_parameters->order_list.empty();
+
+ Item_in_optimizer *optimizer;
+ substitution= optimizer= new Item_in_optimizer(left_expr, this);
+ if (!optimizer)
+ DBUG_VOID_RETURN;
+
+ unit->dependent= 1;
+ uint n= left_expr->cols();
+ if (optimizer->preallocate_row() || (*optimizer->get_cache())->allocate(n))
+ DBUG_VOID_RETURN;
+ for (SELECT_LEX * sl= unit->first_select(); sl; sl= sl->next_select())
+ {
+ if (sl->select_limit != HA_POS_ERROR)
+ {
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0),
+ "LIMIT & IN/ALL/ANY/SOME subquery");
+ DBUG_VOID_RETURN;
+ }
+ sl->order_list.empty(); // no sense in ORDER BY without LIMIT
+
+ sl->dependent= 1;
+
+ Item *item= 0;
+ List_iterator_fast<Item> li(sl->item_list);
+ for (uint i= 0; i < n; i++)
+ {
+ Item *func=
+ new Item_ref_on_list_position(this, sl->item_list, i,
+ (char *) "<no matter>",
+ (char *) "<list ref>");
+ func=
+ Item_bool_func2::eq_creator(new Item_ref((*optimizer->get_cache())->
+ addr(i),
+ (char *)"<no matter>",
+ (char *)"<left expr>"),
+ func);
+ item= and_items(item, func);
+ }
+
+ if (sl->having || sl->with_sum_func || sl->group_list.first ||
+ !sl->table_list.elements)
+ sl->having= and_items(sl->having, item);
+ else
+ sl->where= and_items(sl->where, item);
+ }
+ DBUG_VOID_RETURN;
}
-void Item_allany_subselect::select_transformer(st_select_lex *select_lex)
+
+void Item_in_subselect::select_transformer(THD *thd, st_select_lex_unit *unit)
{
- single_value_transformer(select_lex, left_expr, func);
+ if (left_expr->cols() == 1)
+ single_value_transformer(thd, unit, left_expr,
+ &Item_bool_func2::eq_creator);
+ else
+ row_value_transformer(thd, unit, left_expr);
+}
+
+void Item_allany_subselect::select_transformer(THD *thd,
+ st_select_lex_unit *unit)
+{
+ single_value_transformer(thd, unit, left_expr, func);
}
subselect_single_select_engine::subselect_single_select_engine(THD *thd,
@@ -462,7 +662,7 @@ subselect_union_engine::subselect_union_engine(THD *thd,
subselect_engine(thd, item, result)
{
unit= u;
- if( !result)
+ if (!result)
{
//out of memory
thd->fatal_error= 1;
@@ -478,13 +678,13 @@ int subselect_single_select_engine::prepare()
prepared= 1;
SELECT_LEX_NODE *save_select= thd->lex.current_select;
thd->lex.current_select= select_lex;
- if(join->prepare((TABLE_LIST*) select_lex->table_list.first,
- select_lex->where,
- (ORDER*) select_lex->order_list.first,
- (ORDER*) select_lex->group_list.first,
- select_lex->having,
- (ORDER*) 0, select_lex,
- select_lex->master_unit(), 0))
+ if (join->prepare((TABLE_LIST*) select_lex->table_list.first,
+ select_lex->where,
+ (ORDER*) select_lex->order_list.first,
+ (ORDER*) select_lex->group_list.first,
+ select_lex->having,
+ (ORDER*) 0, select_lex,
+ select_lex->master_unit(), 0))
return 1;
thd->lex.current_select= save_select;
return 0;
@@ -495,31 +695,82 @@ int subselect_union_engine::prepare()
return unit->prepare(thd, result);
}
-void subselect_single_select_engine::fix_length_and_dec()
+static Item_result set_row(SELECT_LEX *select_lex, Item * item,
+ Item_cache **row, bool *maybe_null)
{
+ Item_result res_type= STRING_RESULT;
+ Item *sel_item;
List_iterator_fast<Item> li(select_lex->item_list);
- Item *sel_item= li++;
- item->max_length= sel_item->max_length;
- res_type= sel_item->result_type();
- item->decimals= sel_item->decimals;
+ for (uint i= 0; (sel_item= li++); i++)
+ {
+ item->max_length= sel_item->max_length;
+ res_type= sel_item->result_type();
+ item->decimals= sel_item->decimals;
+ *maybe_null= sel_item->maybe_null;
+ if (row)
+ {
+ if (!(row[i]= Item_cache::get_cache(res_type)))
+ return STRING_RESULT; // we should return something
+ row[i]->set_len_n_dec(sel_item->max_length, sel_item->decimals);
+ }
+ }
+ if (select_lex->item_list.elements > 1)
+ res_type= ROW_RESULT;
+ return res_type;
}
-void subselect_union_engine::fix_length_and_dec()
+void subselect_single_select_engine::fix_length_and_dec(Item_cache **row)
{
- uint32 mlen= 0, len;
- Item *sel_item= 0;
- for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select())
+ DBUG_ASSERT(row || select_lex->item_list.elements==1);
+ res_type= set_row(select_lex, item, row, &maybe_null);
+ if (cols() != 1)
+ maybe_null= 0;
+}
+
+void subselect_union_engine::fix_length_and_dec(Item_cache **row)
+{
+ DBUG_ASSERT(row || unit->first_select()->item_list.elements==1);
+
+ if (unit->first_select()->item_list.elements == 1)
{
- List_iterator_fast<Item> li(sl->item_list);
- Item *s_item= li++;
- if ((len= s_item->max_length))
- mlen= len;
- if (!sel_item)
- sel_item= s_item;
+ uint32 mlen= 0, len;
+ Item *sel_item= 0;
+ for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select())
+ {
+ List_iterator_fast<Item> li(sl->item_list);
+ Item *s_item= li++;
+ if ((len= s_item->max_length) > mlen)
+ mlen= len;
+ if (!sel_item)
+ sel_item= s_item;
+ maybe_null= s_item->maybe_null;
+ }
+ item->max_length= mlen;
+ res_type= sel_item->result_type();
+ item->decimals= sel_item->decimals;
+ if (row)
+ {
+ if (!(row[0]= Item_cache::get_cache(res_type)))
+ return;
+ row[0]->set_len_n_dec(mlen, sel_item->decimals);
+ }
+ }
+ else
+ {
+ SELECT_LEX *sl= unit->first_select();
+ bool fake= 0;
+ res_type= set_row(sl, item, row, &fake);
+ for (sl= sl->next_select(); sl; sl->next_select())
+ {
+ List_iterator_fast<Item> li(sl->item_list);
+ Item *sel_item;
+ for (uint i= 0; (sel_item= li++); i++)
+ {
+ if (sel_item->max_length > row[i]->max_length)
+ row[i]->max_length= sel_item->max_length;
+ }
+ }
}
- item->max_length= mlen;
- res_type= sel_item->result_type();
- item->decimals= sel_item->decimals;
}
int subselect_single_select_engine::exec()
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 0e6f939803d..cf7f612224a 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -71,7 +71,7 @@ public:
{
null_value= 1;
}
- virtual void select_transformer(st_select_lex *select_lex);
+ virtual void select_transformer(THD *thd, st_select_lex_unit *unit);
bool assigned() { return value_assigned; }
void assigned(bool a) { value_assigned= a; }
enum Type type() const;
@@ -86,51 +86,43 @@ public:
bool check_loop(uint id);
friend class select_subselect;
+ friend class Item_in_optimizer;
};
/* single value subselect */
-class Item_singleval_subselect :public Item_subselect
+class Item_cache;
+class Item_singlerow_subselect :public Item_subselect
{
protected:
- longlong int_value; /* Here stored integer value of this item */
- double real_value; /* Here stored real value of this item */
- /*
- Here stored string value of this item.
- (str_value used only as temporary buffer, because it can be changed
- by Item::save_field)
- */
- String string_value;
- enum Item_result res_type; /* type of results */
-
+ Item_cache *value, **row;
public:
- Item_singleval_subselect(THD *thd, st_select_lex *select_lex);
- Item_singleval_subselect(Item_singleval_subselect *item):
+ Item_singlerow_subselect(THD *thd, st_select_lex *select_lex);
+ Item_singlerow_subselect(Item_singlerow_subselect *item):
Item_subselect(item)
{
- int_value= item->int_value;
- real_value= item->real_value;
- string_value.set(item->string_value, 0, item->string_value.length());
+ value= item->value;
max_length= item->max_length;
decimals= item->decimals;
- res_type= item->res_type;
- }
- virtual void reset()
- {
- null_value= 1;
- int_value= 0;
- real_value= 0;
- max_length= 4;
- res_type= STRING_RESULT;
}
- double val ();
+ void reset();
+ void select_transformer(THD *thd, st_select_lex_unit *unit);
+ void store(uint i, Item* item);
+ double val();
longlong val_int ();
String *val_str (String *);
- Item *new_item() { return new Item_singleval_subselect(this); }
- enum Item_result result_type() const { return res_type; }
+ Item *new_item() { return new Item_singlerow_subselect(this); }
+ enum Item_result result_type() const;
void fix_length_and_dec();
- friend class select_singleval_subselect;
+ uint cols();
+ Item* el(uint i) { return (Item*)row[i]; }
+ Item** addr(uint i) { return (Item**)row + i; }
+ bool check_cols(uint c);
+ bool null_inside();
+ void bring_value();
+
+ friend class select_singlerow_subselect;
};
/* exists subselect */
@@ -149,7 +141,7 @@ public:
}
Item_exists_subselect(): Item_subselect() {}
- virtual void reset()
+ void reset()
{
value= 0;
}
@@ -181,9 +173,11 @@ public:
null_value= 0;
was_null= 0;
}
- virtual void select_transformer(st_select_lex *select_lex);
- void single_value_transformer(st_select_lex *select_lex,
+ virtual void select_transformer(THD *thd, st_select_lex_unit *unit);
+ void single_value_transformer(THD *thd, st_select_lex_unit *unit,
Item *left_expr, compare_func_creator func);
+ void row_value_transformer(THD *thd, st_select_lex_unit *unit,
+ Item *left_expr);
longlong val_int();
double val();
String *val_str(String*);
@@ -202,22 +196,18 @@ public:
Item_allany_subselect(THD *thd, Item * left_expr, compare_func_creator f,
st_select_lex *select_lex);
Item_allany_subselect(Item_allany_subselect *item);
- virtual void select_transformer(st_select_lex *select_lex);
+ virtual void select_transformer(THD *thd, st_select_lex_unit *unit);
};
-class subselect_engine
+class subselect_engine: public Sql_alloc
{
protected:
select_subselect *result; /* results storage class */
THD *thd; /* pointer to current THD */
Item_subselect *item; /* item, that use this engine */
enum Item_result res_type; /* type of results */
+ bool maybe_null; /* may be null (first item in select) */
public:
- static void *operator new(size_t size)
- {
- return (void*) sql_alloc((uint) size);
- }
- static void operator delete(void *ptr, size_t size) {}
subselect_engine(THD *thd, Item_subselect *si, select_subselect *res)
{
@@ -225,16 +215,19 @@ public:
item= si;
this->thd= thd;
res_type= STRING_RESULT;
+ maybe_null= 0;
}
+ virtual ~subselect_engine() {}; // to satisfy compiler
virtual int prepare()= 0;
- virtual void fix_length_and_dec()= 0;
+ virtual void fix_length_and_dec(Item_cache** row)= 0;
virtual int exec()= 0;
virtual uint cols()= 0; /* return number of columnss in select */
virtual bool depended()= 0; /* depended from outer select */
enum Item_result type() { return res_type; }
virtual bool check_loop(uint id)= 0;
virtual void exclude()= 0;
+ bool may_be_null() { return maybe_null; };
};
class subselect_single_select_engine: public subselect_engine
@@ -249,7 +242,7 @@ public:
select_subselect *result,
Item_subselect *item);
int prepare();
- void fix_length_and_dec();
+ void fix_length_and_dec(Item_cache** row);
int exec();
uint cols();
bool depended();
@@ -266,7 +259,7 @@ public:
select_subselect *result,
Item_subselect *item);
int prepare();
- void fix_length_and_dec();
+ void fix_length_and_dec(Item_cache** row);
int exec();
uint cols();
bool depended();
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index f54ab87b81d..b15fceda686 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -341,7 +341,8 @@ double Item_sum_hybrid::val()
switch (hybrid_type) {
case STRING_RESULT:
String *res; res=val_str(&str_value);
- return res ? my_strntod(res->charset(),res->ptr(),res->length(),(char**)0) : 0.0;
+ return (res ? my_strntod(res->charset(), (char*) res->ptr(),res->length(),
+ (char**) 0) : 0.0);
case INT_RESULT:
if (unsigned_flag)
return ulonglong2double(sum_int);
@@ -542,7 +543,7 @@ void Item_sum_hybrid::reset_field()
if (hybrid_type == STRING_RESULT)
{
char buff[MAX_FIELD_WIDTH];
- String tmp(buff,sizeof(buff),default_charset_info),*res;
+ String tmp(buff,sizeof(buff),result_field->charset()),*res;
res=args[0]->val_str(&tmp);
if (args[0]->null_value)
@@ -897,17 +898,17 @@ String *Item_variance_field::val_str(String *str)
#include "sql_select.h"
-static int simple_raw_key_cmp(void* arg, byte* key1, byte* key2)
+int simple_raw_key_cmp(void* arg, byte* key1, byte* key2)
{
return memcmp(key1, key2, *(uint*) arg);
}
-static int simple_str_key_cmp(void* arg, byte* key1, byte* key2)
+int simple_str_key_cmp(void* arg, byte* key1, byte* key2)
{
- /* BAR TODO: remove default_charset_info */
- return my_strnncoll(default_charset_info,
- (const uchar*) key1, *(uint*) arg,
- (const uchar*) key2, *(uint*) arg);
+ Item_sum_count_distinct* item = (Item_sum_count_distinct*)arg;
+ CHARSET_INFO *cs=item->key_charset;
+ uint len=item->key_length;
+ return my_strnncoll(cs, (const uchar*) key1, len, (const uchar*) key2, len);
}
/*
@@ -1037,14 +1038,22 @@ bool Item_sum_count_distinct::setup(THD *thd)
Field* field = table->field[0];
switch(field->type())
{
- /*
- If we have a string, we must take care of charsets and case
- sensitivity
- */
case FIELD_TYPE_STRING:
case FIELD_TYPE_VAR_STRING:
- compare_key = (qsort_cmp2)(field->binary() ? simple_raw_key_cmp:
- simple_str_key_cmp);
+ if (field->binary())
+ {
+ compare_key = (qsort_cmp2)simple_raw_key_cmp;
+ cmp_arg = (void*) &key_length;
+ }
+ else
+ {
+ /*
+ If we have a string, we must take care of charsets and case
+ sensitivity
+ */
+ compare_key = (qsort_cmp2)simple_str_key_cmp;
+ cmp_arg = (void*) this;
+ }
break;
default:
/*
@@ -1052,11 +1061,12 @@ bool Item_sum_count_distinct::setup(THD *thd)
be compared with memcmp
*/
compare_key = (qsort_cmp2)simple_raw_key_cmp;
+ cmp_arg = (void*) &key_length;
break;
}
- key_length = field->pack_length();
- cmp_arg = (void*) &key_length;
- rec_offset = 1;
+ key_charset = field->charset();
+ key_length = field->pack_length();
+ rec_offset = 1;
}
else // too bad, cannot cheat - there is more than one field
{
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 50375fbf77c..ffc9558822d 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -156,7 +156,8 @@ class Item_sum_count_distinct :public Item_sum_int
TMP_TABLE_PARAM *tmp_table_param;
TREE tree;
uint key_length;
-
+ CHARSET_INFO *key_charset;
+
// calculated based on max_heap_table_size. If reached,
// walk the tree and dump it into MyISAM table
uint max_elements_in_tree;
@@ -175,6 +176,8 @@ class Item_sum_count_distinct :public Item_sum_int
int tree_to_myisam();
friend int composite_key_cmp(void* arg, byte* key1, byte* key2);
+ friend int simple_str_key_cmp(void* arg, byte* key1, byte* key2);
+ friend int simple_raw_key_cmp(void* arg, byte* key1, byte* key2);
friend int dump_leaf(byte* key, uint32 count __attribute__((unused)),
Item_sum_count_distinct* item);
@@ -481,7 +484,8 @@ public:
double val()
{
String *res; res=val_str(&str_value);
- return res ? my_strntod(res->charset(),res->ptr(),res->length(),(char**) 0) : 0.0;
+ return res ? my_strntod(res->charset(),(char*) res->ptr(),res->length(),
+ (char**) 0) : 0.0;
}
longlong val_int()
{
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 796070acb8a..744c0c1fa49 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -529,7 +529,7 @@ void Item_func_now::fix_length_and_dec()
{
struct tm tm_tmp,*start;
time_t query_start=current_thd->query_start();
- CHARSET_INFO *cs=thd_charset();
+ CHARSET_INFO *cs=my_charset_bin;
decimals=0;
max_length=19*cs->mbmaxlen;
diff --git a/sql/key.cc b/sql/key.cc
index 84669808b92..875a89a146f 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -192,8 +192,7 @@ int key_cmp(TABLE *table,const byte *key,uint idx,uint key_length)
if (!(key_part->key_type & (FIELDFLAG_NUMBER+FIELDFLAG_BINARY+
FIELDFLAG_PACK)))
{
- /* BAR TODO: I'm not sure this should be system_charset_info */
- if (my_strnncoll(system_charset_info,
+ if (my_strnncoll(key_part->field->charset(),
(const uchar*) key, length,
(const uchar*) table->record[0]+key_part->offset,length))
return 1;
diff --git a/sql/lex.h b/sql/lex.h
index 78255d477fa..a505911ccf6 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -161,6 +161,7 @@ static SYMBOL symbols[] = {
{ "FLUSH", SYM(FLUSH_SYM),0,0},
{ "FALSE", SYM(FALSE_SYM),0,0},
{ "FOREIGN", SYM(FOREIGN),0,0},
+ { "FORCE", SYM(FORCE_SYM),0,0},
{ "RAID_TYPE", SYM(RAID_TYPE),0,0},
{ "RAID_CHUNKS", SYM(RAID_CHUNKS),0,0},
{ "RAID_CHUNKSIZE", SYM(RAID_CHUNKSIZE),0,0},
@@ -426,7 +427,7 @@ static SYMBOL sql_functions[] = {
{ "CAST", SYM(CAST_SYM),0,0},
{ "CEIL", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
{ "CEILING", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
- { "CURRENT_USER", SYM(USER),0,0},
+ { "CURRENT_USER", SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_current_user)},
{ "BIT_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_length)},
{ "CENTROID", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_centroid)},
{ "CHAR_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
diff --git a/sql/log.cc b/sql/log.cc
index 9d56a16b0da..de64ad844f0 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -665,7 +665,12 @@ int MYSQL_LOG::purge_first_log(struct st_relay_log_info* rli)
rli->linfo.log_file_name);
goto err;
}
+ /*
+ Reset position to current log. This involves setting both of the
+ position variables:
+ */
rli->relay_log_pos = BIN_LOG_HEADER_SIZE;
+ rli->pending = 0;
strmake(rli->relay_log_name,rli->linfo.log_file_name,
sizeof(rli->relay_log_name)-1);
@@ -1128,8 +1133,20 @@ bool MYSQL_LOG::write(Log_event* event_info)
if (file == &log_file)
{
- error = ha_report_binlog_offset_and_commit(thd, log_file_name,
+ /*
+ LOAD DATA INFILE in AUTOCOMMIT=1 mode writes to the binlog
+ chunks also before it is successfully completed. We only report
+ the binlog write and do the commit inside the transactional table
+ handler if the log event type is appropriate.
+ */
+
+ if (event_info->get_type_code() == QUERY_EVENT
+ || event_info->get_type_code() == EXEC_LOAD_EVENT)
+ {
+ error = ha_report_binlog_offset_and_commit(thd, log_file_name,
file->pos_in_file);
+ }
+
should_rotate= (my_b_tell(file) >= (my_off_t) max_binlog_size);
}
@@ -1172,7 +1189,7 @@ uint MYSQL_LOG::next_file_id()
NOTE
- We only come here if there is something in the cache.
- - The thing in the cache is always a complete transcation
+ - The thing in the cache is always a complete transaction
- 'cache' needs to be reinitialized after this functions returns.
IMPLEMENTATION
@@ -1240,6 +1257,13 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache)
log_file.pos_in_file)))
goto err;
signal_update();
+ if (my_b_tell(&log_file) >= (my_off_t) max_binlog_size)
+ {
+ pthread_mutex_lock(&LOCK_index);
+ new_file(0); // inside mutex
+ pthread_mutex_unlock(&LOCK_index);
+ }
+
}
VOID(pthread_mutex_unlock(&LOCK_log));
DBUG_RETURN(0);
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 22416fa77a7..36fca5250ac 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -295,11 +295,27 @@ Log_event::Log_event(const char* buf, bool old_format)
****************************************************************************/
int Log_event::exec_event(struct st_relay_log_info* rli)
{
- if (rli) // QQ When is this not true ?
+ /*
+ rli is null when (as far as I (Guilhem) know)
+ the caller is
+ Load_log_event::exec_event *and* that one is called from
+ Execute_load_log_event::exec_event.
+ In this case, we don't do anything here ;
+ Execute_load_log_event::exec_event will call Log_event::exec_event
+ again later with the proper rli.
+ Strictly speaking, if we were sure that rli is null
+ only in the case discussed above, 'if (rli)' is useless here.
+ But as we are not 100% sure, keep it for now.
+ */
+ if (rli)
{
- rli->inc_pos(get_event_len(),log_pos);
- DBUG_ASSERT(rli->sql_thd != 0);
- flush_relay_log_info(rli);
+ if (rli->inside_transaction)
+ rli->inc_pending(get_event_len());
+ else
+ {
+ rli->inc_pos(get_event_len(),log_pos);
+ flush_relay_log_info(rli);
+ }
}
return 0;
}
@@ -741,7 +757,9 @@ int Query_log_event::write_data(IO_CACHE* file)
#ifndef MYSQL_CLIENT
Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
ulong query_length, bool using_trans)
- :Log_event(thd_arg, 0, using_trans), data_buf(0), query(query_arg),
+ :Log_event(thd_arg, !thd_arg->lex.tmp_table_used ?
+ 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans),
+ data_buf(0), query(query_arg),
db(thd_arg->db), q_len((uint32) query_length),
error_code(thd_arg->killed ? ER_SERVER_SHUTDOWN: thd_arg->net.last_errno),
thread_id(thd_arg->thread_id)
@@ -823,6 +841,8 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db)
*end++=';';
*end++='\n';
my_fwrite(file, (byte*) buff, (uint) (end-buff),MYF(MY_NABP | MY_WME));
+ if (flags & LOG_EVENT_THREAD_SPECIFIC_F)
+ fprintf(file,"SET @@session.pseudo_thread_id=%lu;\n",(ulong)thread_id);
my_fwrite(file, (byte*) query, q_len, MYF(MY_NABP | MY_WME));
fprintf(file, ";\n");
}
@@ -858,7 +878,7 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
thd->query_error= 0; // clear error
thd->clear_error();
- thd->slave_proxy_id = thread_id; // for temp tables
+ thd->variables.pseudo_thread_id= thread_id; // for temp tables
/*
Sanity check to make sure the master did not get a really bad
@@ -870,6 +890,19 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
mysql_log.write(thd,COM_QUERY,"%s",thd->query);
DBUG_PRINT("query",("%s",thd->query));
mysql_parse(thd, thd->query, q_len);
+
+ /*
+ Set a flag if we are inside an transaction so that we can restart
+ the transaction from the start if we are killed
+
+ This will only be done if we are supporting transactional tables
+ in the slave.
+ */
+ if (!strcmp(thd->query,"BEGIN"))
+ rli->inside_transaction= opt_using_transactions;
+ else if (!strcmp(thd->query,"COMMIT"))
+ rli->inside_transaction=0;
+
DBUG_PRINT("info",("expected_error: %d last_errno: %d",
expected_error, thd->net.last_errno));
if ((expected_error != (actual_error= thd->net.last_errno)) &&
@@ -1423,13 +1456,35 @@ void Load_log_event::set_fields(List<Item> &field_list)
}
#endif // !MYSQL_CLIENT
-/*****************************************************************************
-
- Load_log_event::exec_event()
-
- ****************************************************************************/
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli)
+/*
+ Does the data loading job when executing a LOAD DATA on the slave
+
+ SYNOPSIS
+ Load_log_event::exec_event
+ net
+ rli
+ use_rli_only_for_errors - if set to 1, rli is provided to
+ Load_log_event::exec_event only for this
+ function to have RPL_LOG_NAME and
+ rli->last_slave_error, both being used by
+ error reports. rli's position advancing
+ is skipped (done by the caller which is
+ Execute_load_log_event::exec_event).
+ - if set to 0, rli is provided for full use,
+ i.e. for error reports and position
+ advancing.
+
+ DESCRIPTION
+ Does the data loading job when executing a LOAD DATA on the slave
+
+ RETURN VALUE
+ 0 Success
+ 1 Failure
+*/
+
+int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
+ bool use_rli_only_for_errors)
{
init_sql_alloc(&thd->mem_root, 8192,0);
thd->db = rewrite_db((char*)db);
@@ -1477,7 +1532,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli)
ex.skip_lines = skip_lines;
List<Item> field_list;
set_fields(field_list);
- thd->slave_proxy_id = thd->thread_id;
+ thd->variables.pseudo_thread_id= thd->thread_id;
if (net)
{
// mysql_load will use thd->net to read the file
@@ -1491,9 +1546,15 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli)
TL_WRITE))
thd->query_error = 1;
if (thd->cuted_fields)
+ {
+ /*
+ log_pos is the position of the LOAD
+ event in the master log
+ */
sql_print_error("Slave: load data infile at position %s in log \
-'%s' produced %d warning(s)", llstr(rli->master_log_pos,llbuff), RPL_LOG_NAME,
+'%s' produced %d warning(s)", llstr(log_pos,llbuff), RPL_LOG_NAME,
thd->cuted_fields );
+ }
if (net)
net->pkt_nr= thd->net.pkt_nr;
}
@@ -1532,7 +1593,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli)
return 1;
}
- return Log_event::exec_event(rli);
+ return ( use_rli_only_for_errors ? 0 : Log_event::exec_event(rli) );
}
#endif
@@ -2670,7 +2731,11 @@ int Execute_load_log_event::exec_event(struct st_relay_log_info* rli)
save_options = thd->options;
thd->options &= ~ (ulong) (OPTION_BIN_LOG);
lev->thd = thd;
- if (lev->exec_event(0,0))
+ /*
+ lev->exec_event should use rli only for errors
+ i.e. should not advance rli's position
+ */
+ if (lev->exec_event(0,rli,1))
{
slave_print_error(rli,my_errno, "Failed executing load from '%s'", fname);
thd->options = save_options;
diff --git a/sql/log_event.h b/sql/log_event.h
index 7ba203e7f30..c5ff3ffd4da 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -212,8 +212,10 @@ struct sql_ex_info
#define BINLOG_MAGIC "\xfe\x62\x69\x6e"
-#define LOG_EVENT_TIME_F 0x1
-#define LOG_EVENT_FORCED_ROTATE_F 0x2
+#define LOG_EVENT_TIME_F 0x1
+#define LOG_EVENT_FORCED_ROTATE_F 0x2
+#define LOG_EVENT_THREAD_SPECIFIC_F 0x4 /* query depends on thread
+ (for example: TEMPORARY TABLE) */
enum Log_event_type
{
@@ -466,9 +468,10 @@ public:
void pack_info(Protocol* protocol);
int exec_event(struct st_relay_log_info* rli)
{
- return exec_event(thd->slave_net,rli);
+ return exec_event(thd->slave_net,rli,0);
}
- int exec_event(NET* net, struct st_relay_log_info* rli);
+ int exec_event(NET* net, struct st_relay_log_info* rli,
+ bool use_rli_only_for_errors);
#endif /* HAVE_REPLICATION */
#else
void print(FILE* file, bool short_form = 0, char* last_db = 0);
diff --git a/sql/mini_client.cc b/sql/mini_client.cc
index d32154685f0..2ee4b551d71 100644
--- a/sql/mini_client.cc
+++ b/sql/mini_client.cc
@@ -547,10 +547,13 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
bzero((char*) &UNIXaddr,sizeof(UNIXaddr));
UNIXaddr.sun_family = AF_UNIX;
strmov(UNIXaddr.sun_path, unix_socket);
- if (mc_sock_connect(sock,(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr),
+ if (mc_sock_connect(sock,
+ my_reinterpret_cast(struct sockaddr *) (&UNIXaddr),
+ sizeof(UNIXaddr),
mysql->options.connect_timeout) <0)
{
- DBUG_PRINT("error",("Got error %d on connect to local server",socket_errno));
+ DBUG_PRINT("error",("Got error %d on connect to local server",
+ socket_errno));
net->last_errno=CR_CONNECTION_ERROR;
sprintf(net->last_error,ER(net->last_errno),unix_socket,socket_errno);
goto error;
@@ -637,7 +640,9 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
my_gethostbyname_r_free();
}
sock_addr.sin_port = (ushort) htons((ushort) port);
- if (mc_sock_connect(sock,(struct sockaddr *) &sock_addr, sizeof(sock_addr),
+ if (mc_sock_connect(sock,
+ my_reinterpret_cast(struct sockaddr *) (&sock_addr),
+ sizeof(sock_addr),
mysql->options.connect_timeout) <0)
{
DBUG_PRINT("error",("Got error %d on connect to '%s'",
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index cf0cefd76da..cdc668d9b28 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -235,6 +235,10 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
#define SHOW_LOG_STATUS_FREE "FREE"
#define SHOW_LOG_STATUS_INUSE "IN USE"
+/* Options to add_table_to_list() */
+#define TL_OPTION_UPDATING 1
+#define TL_OPTION_FORCE_INDEX 2
+
/* Some portable defines */
#define portable_sizeof_char_ptr 8
@@ -323,11 +327,12 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create);
int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent);
void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, ushort flags);
-int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists);
+int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
+ my_bool drop_temporary);
int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
- bool log_query);
+ bool drop_temporary, bool log_query);
int mysql_rm_table_part2_with_lock(THD *thd, TABLE_LIST *tables,
- bool if_exists,
+ bool if_exists, bool drop_temporary,
bool log_query);
int quick_rm_table(enum db_type base,const char *db,
const char *table_name);
@@ -422,6 +427,9 @@ int mysql_alter_table(THD *thd, char *new_db, char *new_name,
enum enum_duplicates handle_duplicates,
enum enum_enable_or_disable keys_onoff=LEAVE_AS_IS,
bool simple_alter=0);
+int mysql_create_like_table(THD *thd, TABLE_LIST *table,
+ HA_CREATE_INFO *create_info,
+ Table_ident *src_table);
bool mysql_rename_table(enum db_type base,
const char *old_db,
const char * old_name,
@@ -463,7 +471,7 @@ bool drop_locked_tables(THD *thd,const char *db, const char *table_name);
void abort_locked_tables(THD *thd,const char *db, const char *table_name);
extern const Field *not_found_field;
Field *find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
- bool report_error);
+ TABLE_LIST **where, bool report_error);
Field *find_field_in_table(THD *thd,TABLE *table,const char *name,uint length,
bool check_grant,bool allow_rowid);
#ifdef HAVE_OPENSSL
@@ -523,7 +531,8 @@ int check_insert_fields(THD *thd,TABLE *table,List<Item> &fields,
/* sql_error.cc */
void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, uint code,
const char *msg);
-void store_warning(THD *thd, uint errcode, ...);
+void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
+ uint code, const char *format, ...);
void mysql_reset_errors(THD *thd);
my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show);
@@ -574,8 +583,7 @@ bool rm_temporary_table(enum db_type base, char *path);
void free_io_cache(TABLE *entry);
void intern_close_table(TABLE *entry);
bool close_thread_table(THD *thd, TABLE **table_ptr);
-void close_thread_tables(THD *thd,bool locked=0);
-bool close_thread_table(THD *thd, TABLE **table_ptr);
+void close_thread_tables(THD *thd, bool locked=0, bool skip_derived=0);
void close_temporary_tables(THD *thd);
TABLE_LIST * find_table_in_list(TABLE_LIST *table,
const char *db_name, const char *table_name);
@@ -705,6 +713,8 @@ extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
extern my_bool opt_safe_show_db, opt_local_infile, lower_case_table_names;
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern my_bool opt_enable_named_pipe;
+extern char *shared_memory_base_name;
+extern bool opt_enable_shared_memory;
extern char f_fyllchar;
extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log;
@@ -814,7 +824,6 @@ uint calc_week(TIME *ltime, bool with_year, bool sunday_first_day_of_week,
void find_date(char *pos,uint *vek,uint flag);
TYPELIB *convert_strings_to_array_type(my_string *typelibs, my_string *end);
TYPELIB *typelib(List<String> &strings);
-void clean_up(bool print_message=1);
ulong get_form_pos(File file, uchar *head, TYPELIB *save_names);
ulong make_new_entry(File file,uchar *fileinfo,TYPELIB *formnames,
const char *newname);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 2bacdfc14bf..e63ee43e3e3 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -34,6 +34,8 @@
#include <ft_global.h>
#include <assert.h>
+#define mysqld_charset my_charset_latin1
+
#ifndef DBUG_OFF
#define ONE_THREAD
#endif
@@ -180,7 +182,6 @@ static char szPipeName [ 257 ];
static SECURITY_ATTRIBUTES saPipeSecurity;
static SECURITY_DESCRIPTOR sdPipeDescriptor;
static HANDLE hPipe = INVALID_HANDLE_VALUE;
-static uint handler_count;
static bool opt_enable_named_pipe = 0;
#endif
#ifdef __WIN__
@@ -205,7 +206,7 @@ static char **opt_argv;
#else
#define MYSQL_SERVER_SUFFIX ""
#endif /* __NT__ */
-#endif
+#endif /* __WIN__ */
#ifdef HAVE_BERKELEY_DB
SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_YES;
@@ -246,6 +247,12 @@ SHOW_COMP_OPTION have_query_cache=SHOW_OPTION_NO;
const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
bool opt_large_files= sizeof(my_off_t) > 4;
+#if SIZEOF_OFF_T > 4 && defined(BIG_TABLES)
+#define GET_HA_ROWS GET_ULL
+#else
+#define GET_HA_ROWS GET_ULONG
+#endif
+
/*
Variables to store startup options
@@ -344,8 +351,8 @@ arg_cmp_func Arg_comparator::comparator_matrix[4][2] =
{&Arg_comparator::compare_int, &Arg_comparator::compare_e_int},
{&Arg_comparator::compare_row, &Arg_comparator::compare_e_row}};
#ifdef HAVE_SMEM
-static char *shared_memory_base_name=default_shared_memory_base_name;
-static bool opt_enable_shared_memory = 0;
+char *shared_memory_base_name=default_shared_memory_base_name;
+bool opt_enable_shared_memory = 0;
#endif
volatile ulong cached_thread_count=0;
@@ -484,7 +491,7 @@ extern "C" pthread_handler_decl(handle_slave,arg);
static uint set_maximum_open_files(uint max_file_limit);
#endif
static ulong find_bit_type(const char *x, TYPELIB *bit_lib);
-
+static void clean_up(bool print_message);
#ifndef EMBEDDED_LIBRARY
/****************************************************************************
@@ -760,13 +767,13 @@ void kill_mysql(void)
#if defined(OS2)
extern "C" void kill_server(int sig_ptr)
-#define RETURN_FROM_KILL_SERVER return
+#define RETURN_FROM_KILL_SERVER DBUG_RETURN
#elif !defined(__WIN__)
static void *kill_server(void *sig_ptr)
-#define RETURN_FROM_KILL_SERVER return 0
+#define RETURN_FROM_KILL_SERVER DBUG_RETURN(0)
#else
static void __cdecl kill_server(int sig_ptr)
-#define RETURN_FROM_KILL_SERVER return
+#define RETURN_FROM_KILL_SERVER DBUG_RETURN
#endif
{
int sig=(int) (long) sig_ptr; // This is passed a int
@@ -848,7 +855,7 @@ extern "C" sig_handler print_signal_warning(int sig)
void unireg_end(void)
{
- clean_up();
+ clean_up(1);
my_thread_end();
#ifdef SIGNALS_DONT_BREAK_READ
exit(0);
@@ -863,7 +870,7 @@ extern "C" void unireg_abort(int exit_code)
DBUG_ENTER("unireg_abort");
if (exit_code)
sql_print_error("Aborting\n");
- clean_up(); /* purecov: inspected */
+ clean_up(1); /* purecov: inspected */
DBUG_PRINT("quit",("done with cleanup in unireg_abort"));
my_thread_end();
exit(exit_code); /* purecov: inspected */
@@ -914,12 +921,12 @@ void clean_up(bool print_message)
regex_end();
#endif
+ if (print_message && errmesg)
+ sql_print_error(ER(ER_SHUTDOWN_COMPLETE),my_progname);
#if !defined(__WIN__) && !defined(EMBEDDED_LIBRARY)
if (!opt_bootstrap)
(void) my_delete(pidfile_name,MYF(0)); // This may not always exist
#endif
- if (print_message && errmesg)
- sql_print_error(ER(ER_SHUTDOWN_COMPLETE),my_progname);
x_free((gptr) my_errmsg[ERRMAPP]); /* Free messages */
DBUG_PRINT("quit", ("Error messages freed"));
/* Tell main we are ready */
@@ -929,6 +936,10 @@ void clean_up(bool print_message)
/* do the broadcast inside the lock to ensure that my_end() is not called */
(void) pthread_cond_broadcast(&COND_thread_count);
(void) pthread_mutex_unlock(&LOCK_thread_count);
+ /*
+ The following lines may never be executed as the main thread may have
+ killed us
+ */
DBUG_PRINT("quit", ("done with cleanup"));
} /* clean_up */
@@ -994,7 +1005,7 @@ static void set_user(const char *user)
{
// allow a numeric uid to be used
const char *pos;
- for (pos=user; my_isdigit(system_charset_info,*pos); pos++) ;
+ for (pos=user; my_isdigit(mysqld_charset,*pos); pos++) ;
if (*pos) // Not numeric id
{
fprintf(stderr,"Fatal error: Can't change to run as user '%s' ; Please check that the user exists!\n",user);
@@ -1509,7 +1520,7 @@ static void init_signals(void)
/* Change limits so that we will get a core file */
struct rlimit rl;
rl.rlim_cur = rl.rlim_max = RLIM_INFINITY;
- if (setrlimit(RLIMIT_CORE, &rl))
+ if (setrlimit(RLIMIT_CORE, &rl) && global_system_variables.log_warnings)
sql_print_error("Warning: setrlimit could not change the size of core files to 'infinity'; We may not be able to generate a core file on signals");
}
#endif
@@ -1578,8 +1589,11 @@ extern "C" void *signal_hand(void *arg __attribute__((unused)))
my_thread_init(); // Init new thread
DBUG_ENTER("signal_hand");
SIGNAL_THD;
- /* Setup alarm handler */
- init_thr_alarm(max_connections+max_insert_delayed_threads);
+ /*
+ Setup alarm handler
+ The two extra handlers are for slave threads
+ */
+ init_thr_alarm(max_connections+max_insert_delayed_threads+2);
#if SIGINT != THR_KILL_SIGNAL
(void) sigemptyset(&set); // Setup up SIGINT for debug
(void) sigaddset(&set,SIGINT); // For debugging
@@ -1667,12 +1681,15 @@ extern "C" void *signal_hand(void *arg __attribute__((unused)))
}
break;
case SIGHUP:
- reload_acl_and_cache((THD*) 0,
- (REFRESH_LOG | REFRESH_TABLES | REFRESH_FAST |
- REFRESH_STATUS | REFRESH_GRANT | REFRESH_THREADS |
- REFRESH_HOSTS),
- (TABLE_LIST*) 0); // Flush logs
- mysql_print_status((THD*) 0); // Send debug some info
+ if (!abort_loop)
+ {
+ reload_acl_and_cache((THD*) 0,
+ (REFRESH_LOG | REFRESH_TABLES | REFRESH_FAST |
+ REFRESH_STATUS | REFRESH_GRANT |
+ REFRESH_THREADS | REFRESH_HOSTS),
+ (TABLE_LIST*) 0); // Flush logs
+ mysql_print_status((THD*) 0); // Send debug some info
+ }
break;
#ifdef USE_ONE_SIGNAL_HAND
case THR_SERVER_ALARM:
@@ -1839,6 +1856,7 @@ bool open_log(MYSQL_LOG *log, const char *hostname,
no_auto_events);
}
+
static int init_common_variables(const char *conf_file_name, int argc, char **argv,
const char **groups)
{
@@ -2340,6 +2358,478 @@ The server will not act as a slave.");
#endif /* EMBEDDED_LIBRARY */
+#ifdef REMOTE
+
+#ifdef __WIN__
+int win_main(int argc, char **argv)
+#else
+int main(int argc, char **argv)
+#endif
+{
+ DEBUGGER_OFF;
+
+ my_umask=0660; // Default umask for new files
+ my_umask_dir=0700; // Default umask for new directories
+ MAIN_THD;
+ /*
+ Initialize signal_th and shutdown_th to main_th for default value
+ as we need to initialize them to something safe. They are used
+ when compiled with safemalloc.
+ */
+ SIGNAL_THD;
+ SHUTDOWN_THD;
+ MY_INIT(argv[0]); // init my_sys library & pthreads
+ tzset(); // Set tzname
+
+ start_time=time((time_t*) 0);
+#ifdef OS2
+ {
+ // fix timezone for daylight saving
+ struct tm *ts = localtime(&start_time);
+ if (ts->tm_isdst > 0)
+ _timezone -= 3600;
+ }
+#endif
+#ifdef HAVE_TZNAME
+#if defined(HAVE_LOCALTIME_R) && defined(_REENTRANT)
+ {
+ struct tm tm_tmp;
+ localtime_r(&start_time,&tm_tmp);
+ strmov(time_zone,tzname[tm_tmp.tm_isdst != 0 ? 1 : 0]);
+ }
+#else
+ {
+ struct tm *start_tm;
+ start_tm=localtime(&start_time);
+ strmov(time_zone,tzname[start_tm->tm_isdst != 0 ? 1 : 0]);
+ }
+#endif
+#endif
+
+ if (gethostname(glob_hostname,sizeof(glob_hostname)-4) < 0)
+ strmov(glob_hostname,"mysql");
+ strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5);
+ strmov(fn_ext(pidfile_name),".pid"); // Add proper extension
+#ifndef DBUG_OFF
+ strxmov(strend(server_version),MYSQL_SERVER_SUFFIX,"-debug",NullS);
+#else
+ strmov(strend(server_version),MYSQL_SERVER_SUFFIX);
+#endif
+#ifdef _CUSTOMSTARTUPCONFIG_
+ if (_cust_check_startup())
+ {
+ /* _cust_check_startup will report startup failure error */
+ exit( 1 );
+ }
+#endif
+ load_defaults(MYSQL_CONFIG_NAME,load_default_groups,&argc,&argv);
+ defaults_argv=argv;
+
+ set_options();
+ get_options(argc,argv);
+ max_system_variables.pseudo_thread_id= (ulong)~0;
+ if (opt_log || opt_update_log || opt_slow_log || opt_bin_log)
+ strcat(server_version,"-log");
+ DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname,
+ server_version, SYSTEM_TYPE,MACHINE_TYPE));
+
+ /* These must be set early */
+
+ (void) pthread_mutex_init(&LOCK_mysql_create_db,MY_MUTEX_INIT_SLOW);
+ (void) pthread_mutex_init(&LOCK_Acl,MY_MUTEX_INIT_SLOW);
+ (void) pthread_mutex_init(&LOCK_open,MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_mapped_file,MY_MUTEX_INIT_SLOW);
+ (void) pthread_mutex_init(&LOCK_status,MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_error_log,MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_delayed_insert,MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_delayed_status,MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_delayed_create,MY_MUTEX_INIT_SLOW);
+ (void) pthread_mutex_init(&LOCK_manager,MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_crypt,MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_bytes_sent,MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_bytes_received,MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_timezone,MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
+ (void) my_rwlock_init(&LOCK_grant, NULL);
+ (void) pthread_cond_init(&COND_thread_count,NULL);
+ (void) pthread_cond_init(&COND_refresh,NULL);
+ (void) pthread_cond_init(&COND_thread_cache,NULL);
+ (void) pthread_cond_init(&COND_flush_thread_cache,NULL);
+ (void) pthread_cond_init(&COND_manager,NULL);
+ (void) pthread_cond_init(&COND_rpl_status, NULL);
+ init_signals();
+
+ if (set_default_charset_by_name(sys_charset.value, MYF(MY_WME)))
+ exit(1);
+ charsets_list= list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG));
+
+#ifdef HAVE_OPENSSL
+ if (opt_use_ssl)
+ {
+ /* having ssl_acceptor_fd != 0 signals the use of SSL */
+ ssl_acceptor_fd= new_VioSSLAcceptorFd(opt_ssl_key, opt_ssl_cert,
+ opt_ssl_ca, opt_ssl_capath,
+ opt_ssl_cipher);
+ DBUG_PRINT("info",("ssl_acceptor_fd: %lx", (long) ssl_acceptor_fd));
+ if (!ssl_acceptor_fd)
+ opt_use_ssl = 0;
+ }
+#endif /* HAVE_OPENSSL */
+
+#ifdef HAVE_LIBWRAP
+ libwrapName= my_progname+dirname_length(my_progname);
+ openlog(libwrapName, LOG_PID, LOG_AUTH);
+#endif
+
+ if (!(opt_specialflag & SPECIAL_NO_PRIOR))
+ my_pthread_setprio(pthread_self(),CONNECT_PRIOR);
+ /* Parameter for threads created for connections */
+ (void) pthread_attr_init(&connection_attrib);
+ (void) pthread_attr_setdetachstate(&connection_attrib,
+ PTHREAD_CREATE_DETACHED);
+ pthread_attr_setstacksize(&connection_attrib,thread_stack);
+
+ if (!(opt_specialflag & SPECIAL_NO_PRIOR))
+ my_pthread_attr_setprio(&connection_attrib,WAIT_PRIOR);
+ pthread_attr_setscope(&connection_attrib, PTHREAD_SCOPE_SYSTEM);
+
+#if defined( SET_RLIMIT_NOFILE) || defined( OS2)
+ /* connections and databases needs lots of files */
+ {
+ uint wanted_files=10+(uint) max(max_connections*5,
+ max_connections+table_cache_size*2);
+ set_if_bigger(wanted_files, open_files_limit);
+ // Note that some system returns 0 if we succeed here:
+ uint files=set_maximum_open_files(wanted_files);
+ if (files && files < wanted_files && ! open_files_limit)
+ {
+ max_connections= (ulong) min((files-10),max_connections);
+ table_cache_size= (ulong) max((files-10-max_connections)/2,64);
+ DBUG_PRINT("warning",
+ ("Changed limits: max_connections: %ld table_cache: %ld",
+ max_connections,table_cache_size));
+ sql_print_error("Warning: Changed limits: max_connections: %ld table_cache: %ld",max_connections,table_cache_size);
+ }
+ }
+#endif
+ unireg_init(opt_specialflag); /* Set up extern variabels */
+ init_errmessage(); /* Read error messages from file */
+ lex_init();
+ item_init();
+ set_var_init();
+ mysys_uses_curses=0;
+#ifdef USE_REGEX
+ regex_init();
+#endif
+ select_thread=pthread_self();
+ select_thread_in_use=1;
+ if (use_temp_pool && bitmap_init(&temp_pool,1024,1))
+ unireg_abort(1);
+
+ /*
+ We have enough space for fiddling with the argv, continue
+ */
+ umask(((~my_umask) & 0666));
+ if (my_setwd(mysql_real_data_home,MYF(MY_WME)))
+ {
+ unireg_abort(1); /* purecov: inspected */
+ }
+ mysql_data_home= mysql_data_home_buff;
+ mysql_data_home[0]=FN_CURLIB; // all paths are relative from here
+ mysql_data_home[1]=0;
+ server_init();
+ table_cache_init();
+ hostname_cache_init();
+ query_cache_result_size_limit(query_cache_limit);
+ query_cache_resize(query_cache_size);
+ randominit(&sql_rand,(ulong) start_time,(ulong) start_time/2);
+ reset_floating_point_exceptions();
+ init_thr_lock();
+ init_slave_list();
+#ifdef HAVE_OPENSSL
+ if (des_key_file)
+ load_des_key_file(des_key_file);
+#endif /* HAVE_OPENSSL */
+
+ /* Setup log files */
+ if (opt_log)
+ open_log(&mysql_log, glob_hostname, opt_logname, ".log", NullS,
+ LOG_NORMAL);
+ if (opt_update_log)
+ {
+ open_log(&mysql_update_log, glob_hostname, opt_update_logname, "",
+ NullS, LOG_NEW);
+ using_update_log=1;
+ }
+
+ if (opt_slow_log)
+ open_log(&mysql_slow_log, glob_hostname, opt_slow_logname, "-slow.log",
+ NullS, LOG_NORMAL);
+#ifdef __WIN__
+#define MYSQL_ERR_FILE "mysql.err"
+ if (!opt_console)
+ {
+ freopen(MYSQL_ERR_FILE,"a+",stdout);
+ freopen(MYSQL_ERR_FILE,"a+",stderr);
+ }
+#endif
+ if (ha_init())
+ {
+ sql_print_error("Can't init databases");
+ if (unix_sock != INVALID_SOCKET)
+ unlink(mysql_unix_port);
+ exit(1);
+ }
+ ha_key_cache();
+#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
+ if (locked_in_memory && !geteuid())
+ {
+ if (mlockall(MCL_CURRENT))
+ {
+ sql_print_error("Warning: Failed to lock memory. Errno: %d\n",errno);
+ }
+ else
+ locked_in_memory=1;
+ }
+#else
+ locked_in_memory=0;
+#endif
+
+ if (opt_myisam_log)
+ (void) mi_log( 1 );
+ ft_init_stopwords(ft_precompiled_stopwords);
+
+#ifdef __WIN__
+ if (!opt_console)
+ FreeConsole(); // Remove window
+#endif
+
+ /*
+ init signals & alarm
+ After this we can't quit by a simple unireg_abort
+ */
+ error_handler_hook = my_message_sql;
+ if (pthread_key_create(&THR_THD,NULL) ||
+ pthread_key_create(&THR_MALLOC,NULL))
+ {
+ sql_print_error("Can't create thread-keys");
+ if (unix_sock != INVALID_SOCKET)
+ unlink(mysql_unix_port);
+ exit(1);
+ }
+ start_signal_handler(); // Creates pidfile
+ if (acl_init((THD*) 0, opt_noacl))
+ {
+ abort_loop=1;
+ select_thread_in_use=0;
+ (void) pthread_kill(signal_thread,MYSQL_KILL_SIGNAL);
+#ifndef __WIN__
+ if (!opt_bootstrap)
+ (void) my_delete(pidfile_name,MYF(MY_WME)); // Not needed anymore
+#endif
+ if (unix_sock != INVALID_SOCKET)
+ unlink(mysql_unix_port);
+ exit(1);
+ }
+ if (!opt_noacl)
+ (void) grant_init((THD*) 0);
+ init_max_user_conn();
+ init_update_queries();
+ DBUG_ASSERT(current_thd == 0);
+
+#ifdef HAVE_DLOPEN
+ if (!opt_noacl)
+ udf_init();
+#endif
+ /* init_slave() must be called after the thread keys are created */
+ init_slave();
+
+ DBUG_ASSERT(current_thd == 0);
+ if (opt_bin_log && !server_id)
+ {
+ server_id= !master_host ? 1 : 2;
+ switch (server_id) {
+#ifdef EXTRA_DEBUG
+ case 1:
+ sql_print_error("\
+Warning: You have enabled the binary log, but you haven't set server-id:\n\
+Updates will be logged to the binary log, but connections to slaves will\n\
+not be accepted.");
+ break;
+#endif
+ case 2:
+ sql_print_error("\
+Warning: You should set server-id to a non-0 value if master_host is set.\n\
+The server will not act as a slave.");
+ break;
+ }
+ }
+ if (opt_bin_log)
+ {
+ open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin",
+ opt_binlog_index_name,LOG_BIN);
+ using_update_log=1;
+ }
+
+
+ if (opt_bootstrap)
+ {
+ int error=bootstrap(stdin);
+ end_thr_alarm(); // Don't allow alarms
+ unireg_abort(error ? 1 : 0);
+ }
+ if (opt_init_file)
+ {
+ if (read_init_file(opt_init_file))
+ {
+ end_thr_alarm(); // Don't allow alarms
+ unireg_abort(1);
+ }
+ }
+ (void) thr_setconcurrency(concurrency); // 10 by default
+#if defined(__WIN__) && !defined(EMBEDDED_LIBRARY) //IRENA
+ {
+ hEventShutdown=CreateEvent(0, FALSE, FALSE, shutdown_event_name);
+ pthread_t hThread;
+ if (pthread_create(&hThread,&connection_attrib,handle_shutdown,0))
+ sql_print_error("Warning: Can't create thread to handle shutdown requests");
+
+ // On "Stop Service" we have to do regular shutdown
+ Service.SetShutdownEvent(hEventShutdown);
+ }
+#endif
+#ifdef OS2
+ {
+ pthread_cond_init( &eventShutdown, NULL);
+ pthread_t hThread;
+ if (pthread_create(&hThread,&connection_attrib,handle_shutdown,0))
+ sql_print_error("Warning: Can't create thread to handle shutdown requests");
+ }
+#endif
+
+ if (
+#ifdef HAVE_BERKELEY_DB
+ !berkeley_skip ||
+#endif
+ (flush_time && flush_time != ~(ulong) 0L))
+ {
+ pthread_t hThread;
+ if (pthread_create(&hThread,&connection_attrib,handle_manager,0))
+ sql_print_error("Warning: Can't create thread to manage maintenance");
+ }
+
+ printf(ER(ER_READY),my_progname,server_version,"");
+ fflush(stdout);
+#if defined(__NT__) || defined(HAVE_SMEM)
+#ifdef __NT__
+ if (hPipe == INVALID_HANDLE_VALUE &&
+ (!have_tcpip || opt_disable_networking) &&
+ !opt_enable_shared_memory)
+ {
+ sql_print_error("TCP/IP,--shared-memory or --named-pipe should be configured on NT OS");
+ unireg_abort(1);
+ }
+ else
+#endif
+ {
+ pthread_mutex_lock(&LOCK_thread_count);
+ (void) pthread_cond_init(&COND_handler_count,NULL);
+ {
+ pthread_t hThread;
+ handler_count=0;
+#ifdef __NT__
+ if (hPipe != INVALID_HANDLE_VALUE && opt_enable_named_pipe)
+ {
+ handler_count++;
+ if (pthread_create(&hThread,&connection_attrib,
+ handle_connections_namedpipes, 0))
+ {
+ sql_print_error("Warning: Can't create thread to handle named pipes");
+ handler_count--;
+ }
+ }
+#endif
+#ifdef HAVE_SMEM
+ if (opt_enable_shared_memory)
+ {
+ handler_count++;
+ if (pthread_create(&hThread,&connection_attrib,
+ handle_connections_shared_memory, 0))
+ {
+ sql_print_error("Warning: Can't create thread to handle shared memory");
+ handler_count--;
+ }
+ }
+#endif
+ if (have_tcpip && !opt_disable_networking)
+ {
+ handler_count++;
+ if (pthread_create(&hThread,&connection_attrib,
+ handle_connections_sockets, 0))
+ {
+ sql_print_error("Warning: Can't create thread to handle tcp/ip");
+ handler_count--;
+ }
+ }
+ while (handler_count > 0)
+ {
+ pthread_cond_wait(&COND_handler_count,&LOCK_thread_count);
+ }
+ }
+ pthread_mutex_unlock(&LOCK_thread_count);
+ }
+#else
+ handle_connections_sockets(0);
+#ifdef EXTRA_DEBUG2
+ sql_print_error("Exiting main thread");
+#endif
+#endif /* __NT__ */
+
+ /* (void) pthread_attr_destroy(&connection_attrib); */
+
+ DBUG_PRINT("quit",("Exiting main thread"));
+
+#ifndef __WIN__
+#ifdef EXTRA_DEBUG2
+ sql_print_error("Before Lock_thread_count");
+#endif
+ (void) pthread_mutex_lock(&LOCK_thread_count);
+ DBUG_PRINT("quit", ("Got thread_count mutex"));
+ select_thread_in_use=0; // For close_connections
+ (void) pthread_mutex_unlock(&LOCK_thread_count);
+ (void) pthread_cond_broadcast(&COND_thread_count);
+#ifdef EXTRA_DEBUG2
+ sql_print_error("After lock_thread_count");
+#endif
+#endif /* __WIN__ */
+
+ /* Wait until cleanup is done */
+ (void) pthread_mutex_lock(&LOCK_thread_count);
+ while (!ready_to_exit)
+ pthread_cond_wait(&COND_thread_count,&LOCK_thread_count);
+ (void) pthread_mutex_unlock(&LOCK_thread_count);
+
+#if defined(__WIN__) && !defined(EMBEDDED_LIBRARY)
+ if (Service.IsNT() && start_mode)
+ Service.Stop();
+ else
+ {
+ Service.SetShutdownEvent(0);
+ if (hEventShutdown)
+ CloseHandle(hEventShutdown);
+ }
+#endif
+ my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
+ exit(0);
+ return(0); /* purecov: deadcode */
+}
+#endif /* REMOTE */
+
+
/****************************************************************************
Main and thread entry function for Win32
(all this is needed only to run mysqld as a service on WinNT)
@@ -3239,6 +3729,7 @@ enum options {
OPT_INNODB_LOG_FILE_SIZE,
OPT_INNODB_LOG_BUFFER_SIZE,
OPT_INNODB_BUFFER_POOL_SIZE,
+ OPT_INNODB_BUFFER_POOL_AWE_MEM_MB,
OPT_INNODB_ADDITIONAL_MEM_POOL_SIZE,
OPT_INNODB_FILE_IO_THREADS,
OPT_INNODB_LOCK_WAIT_TIMEOUT,
@@ -3802,6 +4293,10 @@ struct my_option my_long_options[] =
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
(gptr*) &innobase_buffer_pool_size, (gptr*) &innobase_buffer_pool_size, 0,
GET_LONG, REQUIRED_ARG, 8*1024*1024L, 1024*1024L, ~0L, 0, 1024*1024L, 0},
+ {"innodb_buffer_pool_awe_mem_mb", OPT_INNODB_BUFFER_POOL_AWE_MEM_MB,
+ "If Windows AWE is used, the size of InnoDB buffer pool allocated from the AWE memory.",
+ (gptr*) &innobase_buffer_pool_awe_mem_mb, (gptr*) &innobase_buffer_pool_awe_mem_mb, 0,
+ GET_LONG, REQUIRED_ARG, 0, 0, 63000, 0, 1, 0},
{"innodb_additional_mem_pool_size", OPT_INNODB_ADDITIONAL_MEM_POOL_SIZE,
"Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.",
(gptr*) &innobase_additional_mem_pool_size,
@@ -3848,8 +4343,13 @@ struct my_option my_long_options[] =
{"lower_case_table_names", OPT_LOWER_CASE_TABLE_NAMES,
"If set to 1 table names are stored in lowercase on disk and table names will be case-insensitive.",
(gptr*) &lower_case_table_names,
- (gptr*) &lower_case_table_names, 0,
- GET_BOOL, NO_ARG, IF_WIN(1,0), 0, 1, 0, 1, 0},
+ (gptr*) &lower_case_table_names, 0, GET_BOOL, NO_ARG,
+#ifdef FN_NO_CASE_SENCE
+ 1
+#else
+ 0
+#endif
+ , 0, 1, 0, 1, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
"Max packetlength to send/receive from to server.",
(gptr*) &global_system_variables.max_allowed_packet,
@@ -3888,7 +4388,7 @@ struct my_option my_long_options[] =
{"max_join_size", OPT_MAX_JOIN_SIZE,
"Joins that are probably going to read more than max_join_size records return an error.",
(gptr*) &global_system_variables.max_join_size,
- (gptr*) &max_system_variables.max_join_size, 0, GET_ULONG, REQUIRED_ARG,
+ (gptr*) &max_system_variables.max_join_size, 0, GET_HA_ROWS, REQUIRED_ARG,
~0L, 1, ~0L, 0, 1, 0},
{"max_prepared_statements", OPT_MAX_PREP_STMT,
"Max number of prepared_statements for a thread",
@@ -4291,12 +4791,12 @@ static void set_options(void)
sizeof(mysql_real_data_home)-1);
/* Set default values for some variables */
- global_system_variables.table_type=DB_TYPE_MYISAM;
- global_system_variables.tx_isolation=ISO_REPEATABLE_READ;
+ global_system_variables.table_type= DB_TYPE_MYISAM;
+ global_system_variables.tx_isolation= ISO_REPEATABLE_READ;
global_system_variables.select_limit= (ulonglong) HA_POS_ERROR;
- max_system_variables.select_limit= (ulong) HA_POS_ERROR;
+ max_system_variables.select_limit= (ulonglong) HA_POS_ERROR;
global_system_variables.max_join_size= (ulonglong) HA_POS_ERROR;
- max_system_variables.max_join_size= (ulonglong) HA_POS_ERROR;
+ max_system_variables.max_join_size= (ulonglong) HA_POS_ERROR;
#ifdef __WIN__
/* Allow Win32 users to move MySQL anywhere */
@@ -4435,7 +4935,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
exit(1);
}
val= p--;
- while (my_isspace(system_charset_info, *p) && p > argument)
+ while (my_isspace(mysqld_charset, *p) && p > argument)
*p-- = 0;
if (p == argument)
{
@@ -4445,7 +4945,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
*val= 0;
val+= 2;
- while (*val && my_isspace(system_charset_info, *val))
+ while (*val && my_isspace(mysqld_charset, *val))
*val++;
if (!*val)
{
@@ -4588,7 +5088,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
have_symlink=SHOW_OPTION_DISABLED;
break;
case (int) OPT_BIND_ADDRESS:
- if (argument && my_isdigit(system_charset_info, argument[0]))
+ if (argument && my_isdigit(mysqld_charset, argument[0]))
{
my_bind_addr = (ulong) inet_addr(argument);
}
@@ -4699,8 +5199,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
berkeley_lock_type=berkeley_lock_types[type-1];
else
{
- if (test_if_int(argument,(uint) strlen(argument), my_charset_latin1))
- berkeley_lock_scan_time=atoi(argument);
+ char *end;
+ uint length= strlen(argument);
+ long value= my_strntol(my_charset_latin1, argument, length, &end, 10);
+ if (test_if_int(argument,(uint) length, end, my_charset_latin1))
+ berkeley_lock_scan_time= value;
else
{
fprintf(stderr,"Unknown lock type: %s\n",argument);
@@ -5003,8 +5506,8 @@ static ulong find_bit_type(const char *x, TYPELIB *bit_lib)
j=pos;
while (j != end)
{
- if (my_toupper(system_charset_info,*i++) !=
- my_toupper(system_charset_info,*j++))
+ if (my_toupper(mysqld_charset,*i++) !=
+ my_toupper(mysqld_charset,*j++))
goto skipp;
}
found_int=bit;
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index f9adee5812a..550fb772fce 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -74,7 +74,7 @@ extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received;
#include "thr_alarm.h"
#define TEST_BLOCKING 8
-#define MAX_THREE_BYTES 255L*255L*255L
+#define MAX_PACKET_LENGTH (256L*256L*256L-1)
static my_bool net_write_buff(NET *net,const char *packet,ulong len);
@@ -133,13 +133,17 @@ my_bool net_realloc(NET *net, ulong length)
{
uchar *buff;
ulong pkt_length;
+ DBUG_ENTER("net_realloc");
+ DBUG_PRINT("enter",("length: %lu", length));
+
if (length >= net->max_packet_size)
{
- DBUG_PRINT("error",("Packet too large (%lu)", length));
+ DBUG_PRINT("error",("Packet too large. Max sixe: %lu",
+ net->max_packet_size));
net->error= 1;
net->report_error= 1;
net->last_errno= ER_NET_PACKET_TOO_LARGE;
- return 1;
+ DBUG_RETURN(1);
}
pkt_length = (length+IO_SIZE-1) & ~(IO_SIZE-1);
/*
@@ -155,11 +159,11 @@ my_bool net_realloc(NET *net, ulong length)
#ifdef MYSQL_SERVER
net->last_errno= ER_OUT_OF_RESOURCES;
#endif
- return 1;
+ DBUG_RETURN(1);
}
net->buff=net->write_pos=buff;
net->buff_end=buff+(net->max_packet=pkt_length);
- return 0;
+ DBUG_RETURN(0);
}
/* Remove unwanted characters from connection */
@@ -221,13 +225,13 @@ my_net_write(NET *net,const char *packet,ulong len)
{
uchar buff[NET_HEADER_SIZE];
/*
- Big packets are handled by splitting them in packets of MAX_THREE_BYTES
- length. The last packet is always a packet that is < MAX_THREE_BYTES.
- (The last packet may even have a lengt of 0)
+ Big packets are handled by splitting them in packets of MAX_PACKET_LENGTH
+ length. The last packet is always a packet that is < MAX_PACKET_LENGTH.
+ (The last packet may even have a length of 0)
*/
- while (len >= MAX_THREE_BYTES)
+ while (len >= MAX_PACKET_LENGTH)
{
- const ulong z_size = MAX_THREE_BYTES;
+ const ulong z_size = MAX_PACKET_LENGTH;
int3store(buff, z_size);
buff[3]= (uchar) net->pkt_nr++;
if (net_write_buff(net, (char*) buff, NET_HEADER_SIZE) ||
@@ -242,7 +246,7 @@ my_net_write(NET *net,const char *packet,ulong len)
if (net_write_buff(net,(char*) buff,NET_HEADER_SIZE))
return 1;
DBUG_DUMP("packet_header",(char*) buff,NET_HEADER_SIZE);
- return net_write_buff(net,packet,len);
+ return test(net_write_buff(net,packet,len));
}
/*
@@ -281,57 +285,110 @@ net_write_command(NET *net,uchar command,
ulong length=len+1+head_len; /* 1 extra byte for command */
uchar buff[NET_HEADER_SIZE+1];
uint header_size=NET_HEADER_SIZE+1;
+ DBUG_ENTER("net_write_command");
+ DBUG_PRINT("enter",("length: %lu", len));
+
buff[4]=command; /* For first packet */
- if (length >= MAX_THREE_BYTES)
+ if (length >= MAX_PACKET_LENGTH)
{
/* Take into account that we have the command in the first header */
- len= MAX_THREE_BYTES - 1 - head_len;
+ len= MAX_PACKET_LENGTH - 1 - head_len;
do
{
- int3store(buff, MAX_THREE_BYTES);
+ int3store(buff, MAX_PACKET_LENGTH);
buff[3]= (uchar) net->pkt_nr++;
if (net_write_buff(net,(char*) buff, header_size) ||
net_write_buff(net, header, head_len) ||
net_write_buff(net, packet, len))
- return 1;
+ DBUG_RETURN(1);
packet+= len;
- length-= MAX_THREE_BYTES;
- len=MAX_THREE_BYTES;
- head_len=0;
- header_size=NET_HEADER_SIZE;
- } while (length >= MAX_THREE_BYTES);
+ length-= MAX_PACKET_LENGTH;
+ len= MAX_PACKET_LENGTH;
+ head_len= 0;
+ header_size= NET_HEADER_SIZE;
+ } while (length >= MAX_PACKET_LENGTH);
len=length; /* Data left to be written */
}
int3store(buff,length);
buff[3]= (uchar) net->pkt_nr++;
- return test(net_write_buff(net, (char*) buff, header_size) ||
+ DBUG_RETURN(test(net_write_buff(net, (char*) buff, header_size) ||
(head_len && net_write_buff(net, (char*) header, head_len)) ||
- net_write_buff(net, packet, len) || net_flush(net));
+ net_write_buff(net, packet, len) || net_flush(net)));
}
/*
Caching the data in a local buffer before sending it.
- One can force the buffer to be flushed with 'net_flush'.
+
+ SYNOPSIS
+ net_write_buff()
+ net Network handler
+ packet Packet to send
+ len Length of packet
+
+ DESCRIPTION
+ Fill up net->buffer and send it to the client when full.
+
+ If the rest of the to-be-sent-packet is bigger than buffer,
+ send it in one big block (to avoid copying to internal buffer).
+ If not, copy the rest of the data to the buffer and return without
+ sending data.
+
+ NOTES
+ The cached buffer can be sent as it is with 'net_flush()'.
+
+ In this code we have to be careful to not send a packet longer than
+ MAX_PACKET_LENGTH to net_real_write() if we are using the compressed protocol
+ as we store the length of the compressed packet in 3 bytes.
+
+ RETURN
+ 0 ok
+ 1
*/
static my_bool
net_write_buff(NET *net,const char *packet,ulong len)
{
- ulong left_length=(ulong) (net->buff_end - net->write_pos);
+ ulong left_length;
+ if (net->compress && net->max_packet > MAX_PACKET_LENGTH)
+ left_length= MAX_PACKET_LENGTH - (net->write_pos - net->buff);
+ else
+ left_length= (ulong) (net->buff_end - net->write_pos);
- while (len > left_length)
+ if (len > left_length)
{
- memcpy((char*) net->write_pos,packet,left_length);
- if (net_real_write(net,(char*) net->buff,net->max_packet))
- return 1;
- net->write_pos=net->buff;
- packet+=left_length;
- len-=left_length;
- left_length=net->max_packet;
+ if (net->write_pos != net->buff)
+ {
+ /* Fill up already used packet and write it */
+ memcpy((char*) net->write_pos,packet,left_length);
+ if (net_real_write(net,(char*) net->buff,
+ (ulong) (net->write_pos - net->buff) + left_length))
+ return 1;
+ net->write_pos= net->buff;
+ packet+= left_length;
+ len-= left_length;
+ }
+ if (net->compress)
+ {
+ /*
+ We can't have bigger packets than 16M with compression
+ Because the uncompressed length is stored in 3 bytes
+ */
+ left_length= MAX_PACKET_LENGTH;
+ while (len > left_length)
+ {
+ if (net_real_write(net, packet, left_length))
+ return 1;
+ packet+= left_length;
+ len-= left_length;
+ }
+ }
+ if (len > net->max_packet)
+ return net_real_write(net, packet, len) ? 1 : 0;
+ /* Send out rest of the blocks as full sized blocks */
}
memcpy((char*) net->write_pos,packet,len);
- net->write_pos+=len;
+ net->write_pos+= len;
return 0;
}
@@ -384,11 +441,7 @@ net_real_write(NET *net,const char *packet,ulong len)
memcpy(b+header_length,packet,len);
if (my_compress((byte*) b+header_length,&len,&complen))
- {
- DBUG_PRINT("warning",
- ("Compression error; Continuing without compression"));
complen=0;
- }
int3store(&b[NET_HEADER_SIZE],complen);
int3store(b,len);
b[3]=(uchar) (net->compress_pkt_nr++);
@@ -491,27 +544,15 @@ net_real_write(NET *net,const char *packet,ulong len)
*****************************************************************************/
#ifndef NO_ALARM
-/*
- Help function to clear the commuication buffer when we get a too
- big packet
-*/
-static void my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed)
+static my_bool net_safe_read(NET *net, char *buff, uint32 length,
+ thr_alarm_t *alarmed)
{
- ALARM alarm_buff;
uint retry_count=0;
- my_bool old_mode;
-
- if (!thr_alarm_in_use(&alarmed))
- {
- if (!thr_alarm(alarmed,net->read_timeout,&alarm_buff) ||
- vio_blocking(net->vio, TRUE, &old_mode) < 0)
- return; /* Can't setup, abort */
- }
- while (remain > 0)
+ while (length > 0)
{
- ulong length;
- if ((int) (length=vio_read(net->vio,(char*) net->buff,remain)) <= 0L)
+ int tmp;
+ if ((tmp=vio_read(net->vio,(char*) net->buff, length)) <= 0)
{
my_bool interrupted = vio_should_retry(net->vio);
if (!thr_got_alarm(&alarmed) && interrupted)
@@ -519,11 +560,60 @@ static void my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed)
if (retry_count++ < net->retry_count)
continue;
}
- return;
+ return 1;
+ }
+ length-= tmp;
+ }
+ return 0;
+}
+
+/*
+ Help function to clear the commuication buffer when we get a too big packet.
+
+ SYNOPSIS
+ my_net_skip_rest()
+ net Communication handle
+ remain Bytes to read
+ alarmed Parameter for thr_alarm()
+ alarm_buff Parameter for thr_alarm()
+
+ RETURN VALUES
+ 0 Was able to read the whole packet
+ 1 Got mailformed packet from client
+*/
+
+static my_bool my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed,
+ ALARM *alarm_buff)
+{
+ uint32 old=remain;
+ DBUG_ENTER("my_net_skip_rest");
+ DBUG_PRINT("enter",("bytes_to_skip: %u", (uint) remain));
+
+ if (!thr_alarm_in_use(&alarmed))
+ {
+ my_bool old_mode;
+ if (!thr_alarm(alarmed,net->read_timeout, alarm_buff) ||
+ vio_blocking(net->vio, TRUE, &old_mode) < 0)
+ DBUG_RETURN(1); /* Can't setup, abort */
+ }
+ for (;;)
+ {
+ while (remain > 0)
+ {
+ uint length= min(remain, net->max_packet);
+ if (net_safe_read(net, (char*) net->buff, length, alarmed))
+ DBUG_RETURN(1);
+ statistic_add(bytes_received, length, &LOCK_bytes_received);
+ remain -= (uint32) length;
}
- remain -= (uint32) length;
- statistic_add(bytes_received,length,&LOCK_bytes_received);
+ if (old != MAX_PACKET_LENGTH)
+ break;
+ if (net_safe_read(net, (char*) net->buff, NET_HEADER_SIZE, alarmed))
+ DBUG_RETURN(1);
+ old=remain= uint3korr(net->buff);
+ net->pkt_nr++;
}
+ DBUG_RETURN(0);
}
#endif /* NO_ALARM */
@@ -623,9 +713,8 @@ my_real_read(NET *net, ulong *complen)
continue;
}
#endif
- DBUG_PRINT("error",("Couldn't read packet: remain: %lu errno: %d length: %ld alarmed: %d",
- remain,vio_errno(net->vio), length,
- thr_got_alarm(&alarmed)));
+ DBUG_PRINT("error",("Couldn't read packet: remain: %u errno: %d length: %ld",
+ remain, vio_errno(net->vio), length));
len= packet_error;
net->error= 2; /* Close socket */
net->report_error= 1;
@@ -668,7 +757,10 @@ my_real_read(NET *net, ulong *complen)
#ifdef HAVE_COMPRESS
if (net->compress)
{
- /* complen is > 0 if package is really compressed */
+ /*
+ If the packet is compressed then complen > 0 and contains the
+ number of bytes in the uncompressed packet
+ */
*complen=uint3korr(&(net->buff[net->where_b + NET_HEADER_SIZE]));
}
#endif
@@ -682,11 +774,12 @@ my_real_read(NET *net, ulong *complen)
{
if (net_realloc(net,helping))
{
-#ifndef NO_ALARM
- if (i == 1)
- my_net_skip_rest(net, (uint32) len, &alarmed);
+#if defined(MYSQL_SERVER) && !defined(NO_ALARM)
+ if (!net->compress &&
+ !my_net_skip_rest(net, (uint32) len, &alarmed, &alarm_buff))
+ net->error= 3; /* Successfully skiped packet */
#endif
- len= packet_error; /* Return error */
+ len= packet_error; /* Return error and close connection */
goto end;
}
}
@@ -730,7 +823,7 @@ my_net_read(NET *net)
{
#endif
len = my_real_read(net,&complen);
- if (len == MAX_THREE_BYTES)
+ if (len == MAX_PACKET_LENGTH)
{
/* First packet of a multi-packet. Concatenate the packets */
ulong save_pos = net->where_b;
@@ -739,8 +832,8 @@ my_net_read(NET *net)
{
net->where_b += len;
total_length += len;
- len = my_real_read (net,&complen);
- } while (len == MAX_THREE_BYTES);
+ len = my_real_read(net,&complen);
+ } while (len == MAX_PACKET_LENGTH);
if (len != packet_error)
len+= total_length;
net->where_b = save_pos;
@@ -767,7 +860,7 @@ my_net_read(NET *net)
}
else
{
- /* reuse buffer, as there is noting in it that we need */
+ /* reuse buffer, as there is nothing in it that we need */
buf_length=start_of_packet=first_packet_offset=0;
}
for (;;)
@@ -798,7 +891,7 @@ my_net_read(NET *net)
else
start_of_packet+= read_length + NET_HEADER_SIZE;
- if (read_length != MAX_THREE_BYTES) /* last package */
+ if (read_length != MAX_PACKET_LENGTH) /* last package */
{
multi_byte_packet= 0; /* No last zero len packet */
break;
diff --git a/sql/nt_servc.cc b/sql/nt_servc.cc
index b917c91ce15..93bae6f444d 100644
--- a/sql/nt_servc.cc
+++ b/sql/nt_servc.cc
@@ -431,7 +431,7 @@ BOOL NTService::SeekStatus(LPCSTR szInternName, int OperationType)
if (ret_error == ERROR_ACCESS_DENIED)
{
printf("Install/Remove of the Service Denied!\n");
- if(!is_super_user())
+ if (!is_super_user())
printf("That operation should be made by an user with Administrator privileges!\n");
}
else
@@ -530,13 +530,13 @@ BOOL NTService::is_super_user()
UINT x;
BOOL ret_value=FALSE;
- if(!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE,&hAccessToken ))
+ if (!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE,&hAccessToken ))
{
- if(GetLastError() != ERROR_NO_TOKEN)
- return FALSE;
+ if (GetLastError() != ERROR_NO_TOKEN)
+ return FALSE;
- if(!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hAccessToken))
- return FALSE;
+ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hAccessToken))
+ return FALSE;
}
ret_value= GetTokenInformation(hAccessToken,TokenGroups,InfoBuffer,
@@ -544,21 +544,21 @@ BOOL NTService::is_super_user()
CloseHandle(hAccessToken);
- if(!ret_value )
- return FALSE;
+ if (!ret_value )
+ return FALSE;
- if(!AllocateAndInitializeSid(&siaNtAuthority, 2,
- SECURITY_BUILTIN_DOMAIN_RID,
- DOMAIN_ALIAS_RID_ADMINS,
- 0, 0, 0, 0, 0, 0,
- &psidAdministrators))
- return FALSE;
+ if (!AllocateAndInitializeSid(&siaNtAuthority, 2,
+ SECURITY_BUILTIN_DOMAIN_RID,
+ DOMAIN_ALIAS_RID_ADMINS,
+ 0, 0, 0, 0, 0, 0,
+ &psidAdministrators))
+ return FALSE;
ret_value = FALSE;
- for(x=0;x<ptgGroups->GroupCount;x++)
+ for (x=0;x<ptgGroups->GroupCount;x++)
{
- if( EqualSid(psidAdministrators, ptgGroups->Groups[x].Sid) )
+ if ( EqualSid(psidAdministrators, ptgGroups->Groups[x].Sid) )
{
ret_value = TRUE;
break;
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index c8b1ad380d4..43066a29624 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -603,12 +603,14 @@ int SQL_SELECT::test_quick_select(key_map keys_to_use, table_map prev_tables,
records++; /* purecov: inspected */
scan_time=(double) records / TIME_FOR_COMPARE+1;
read_time=(double) head->file->scan_time()+ scan_time + 1.0;
+ if (head->force_index)
+ scan_time= read_time= DBL_MAX;
if (limit < records)
read_time=(double) records+scan_time+1; // Force to use index
else if (read_time <= 2.0 && !force_quick_range)
DBUG_RETURN(0); /* No need for quick select */
- DBUG_PRINT("info",("Time to scan table: %ld",(long) read_time));
+ DBUG_PRINT("info",("Time to scan table: %g", read_time));
keys_to_use&=head->keys_in_use_for_query;
if (keys_to_use)
@@ -929,7 +931,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part,
{
bool like_error;
char buff1[MAX_FIELD_WIDTH],*min_str,*max_str;
- String tmp(buff1,sizeof(buff1),default_charset_info),*res;
+ String tmp(buff1,sizeof(buff1),value->charset()),*res;
uint length,offset,min_length,max_length;
if (!field->optimize_range(param->real_keynr[key_part->key]))
@@ -1043,7 +1045,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part,
if (maybe_null)
*str= (char) field->is_real_null(); // Set to 1 if null
field->get_key_image(str+maybe_null,key_part->part_length,
- key_part->image_type);
+ field->charset(),key_part->image_type);
if (!(tree=new SEL_ARG(field,str,str)))
DBUG_RETURN(0);
@@ -2162,18 +2164,29 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree,
tmp=1; // Max one record
else
{
- tmp=param->table->file->
- records_in_range((int) keynr,
- (byte*) (!min_key_length ? NullS :
- param->min_key),
- min_key_length,
- tmp_min_flag & NEAR_MIN ?
- HA_READ_AFTER_KEY : HA_READ_KEY_EXACT,
- (byte*) (!max_key_length ? NullS :
- param->max_key),
- max_key_length,
- (tmp_max_flag & NEAR_MAX ?
- HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY));
+ if (tmp_min_flag & GEOM_FLAG)
+ {
+ tmp= param->table->file->
+ records_in_range((int) keynr, (byte*)(param->min_key + 1),
+ min_key_length,
+ (ha_rkey_function)(tmp_min_flag ^ GEOM_FLAG),
+ (byte *)NullS, 0, HA_READ_KEY_EXACT);
+ }
+ else
+ {
+ tmp=param->table->file->
+ records_in_range((int) keynr,
+ (byte*) (!min_key_length ? NullS :
+ param->min_key),
+ min_key_length,
+ tmp_min_flag & NEAR_MIN ?
+ HA_READ_AFTER_KEY : HA_READ_KEY_EXACT,
+ (byte*) (!max_key_length ? NullS :
+ param->max_key),
+ max_key_length,
+ (tmp_max_flag & NEAR_MAX ?
+ HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY));
+ }
}
end:
if (tmp == HA_POS_ERROR) // Impossible range
@@ -2783,7 +2796,7 @@ static void
print_key(KEY_PART *key_part,const char *key,uint used_length)
{
char buff[1024];
- String tmp(buff,sizeof(buff),default_charset_info);
+ String tmp(buff,sizeof(buff),my_charset_bin);
for (uint length=0;
length < used_length ;
@@ -2803,7 +2816,8 @@ print_key(KEY_PART *key_part,const char *key,uint used_length)
}
field->set_key_image((char*) key,key_part->part_length -
((field->type() == FIELD_TYPE_BLOB) ?
- HA_KEY_BLOB_LENGTH : 0));
+ HA_KEY_BLOB_LENGTH : 0),
+ field->charset());
field->val_str(&tmp,&tmp);
fwrite(tmp.ptr(),sizeof(char),tmp.length(),DBUG_FILE);
}
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 1477d46e756..b1bb36353bf 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -364,7 +364,8 @@ static bool find_range_key(TABLE_REF *ref, Field* field, COND *cond)
// Save found constant
if (part->null_bit)
*key_ptr++= (byte) test(part->field->is_null());
- part->field->get_key_image((char*) key_ptr,part->length, Field::itRAW);
+ part->field->get_key_image((char*) key_ptr,part->length,
+ part->field->charset(), Field::itRAW);
key_ptr+=part->store_length - test(part->null_bit);
left_length-=part->store_length;
}
diff --git a/sql/password.c b/sql/password.c
index 9fd3757106d..da7a499ba09 100644
--- a/sql/password.c
+++ b/sql/password.c
@@ -573,7 +573,7 @@ void get_hash_and_password(ulong* salt, uint8 pversion, char* hash, unsigned cha
while (salt<salt_end) /* Iterate over these elements*/
{
val=*salt;
- for(t=3;t>=0;t--)
+ for (t=3;t>=0;t--)
{
bp[t]=val%256;
diff --git a/sql/procedure.h b/sql/procedure.h
index bc1b6062e1d..bc77803230f 100644
--- a/sql/procedure.h
+++ b/sql/procedure.h
@@ -59,7 +59,7 @@ public:
void set(double nr) { value=nr; }
void set(longlong nr) { value=(double) nr; }
void set(const char *str,uint length,CHARSET_INFO *cs)
- { value=my_strntod(cs,str,length,(char**)0); }
+ { value=my_strntod(cs,(char*) str,length,(char**)0); }
double val() { return value; }
longlong val_int() { return (longlong) value; }
String *val_str(String *s) { s->set(value,decimals,thd_charset()); return s; }
@@ -99,7 +99,8 @@ public:
double val()
{
CHARSET_INFO *cs=str_value.charset();
- return my_strntod(cs, str_value.ptr(), str_value.length(),(char**)0);
+ return my_strntod(cs, (char*) str_value.ptr(), str_value.length(),
+ (char**) 0);
}
longlong val_int()
{
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 9926d4a6432..882fd5268b1 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -209,7 +209,10 @@ net_printf(THD *thd, uint errcode, ...)
{
if (thd->bootstrap)
{
- /* In bootstrap it's ok to print on stderr */
+ /*
+ In bootstrap it's ok to print on stderr
+ This may also happen when we get an error from a slave thread
+ */
fprintf(stderr,"ERROR: %d %s\n",errcode,text_pos);
thd->fatal_error=1;
}
@@ -397,7 +400,7 @@ net_store_length(char *pkg, ulonglong length)
}
*packet++=254;
int8store(packet,length);
- return (char*) packet+9;
+ return (char*) packet+8;
}
@@ -657,7 +660,7 @@ bool Protocol_simple::store_null()
field_pos++;
#endif
char buff[1];
- buff[0]= 251;
+ buff[0]= (char)251;
return packet->append(buff, sizeof(buff), PACKET_BUFFET_EXTRA_ALLOC);
}
@@ -815,13 +818,27 @@ bool Protocol_simple::store_time(TIME *tm)
/****************************************************************************
Functions to handle the binary protocol used with prepared statements
+
+ Data format:
+
+ [ok:1] <-- reserved ok packet
+ [null_field:(field_count+7+2)/8] <-- reserved to send null data. The size is
+ calculated using:
+ bit_fields= (field_count+7+2)/8;
+ 2 bits are reserved
+ [[length]data] <-- data field (the length applies only for
+ string/binary/time/timestamp fields and
+ rest of them are not sent as they have
+ the default length that client understands
+ based on the field type
+ [..]..[[length]data] <-- data
****************************************************************************/
bool Protocol_prep::prepare_for_send(List<Item> *item_list)
{
Protocol::prepare_for_send(item_list);
- bit_fields= (field_count+3)/8;
- if (packet->alloc(bit_fields))
+ bit_fields= (field_count+9)/8;
+ if (packet->alloc(bit_fields+1))
return 1;
/* prepare_for_resend will be called after this one */
return 0;
@@ -830,9 +847,8 @@ bool Protocol_prep::prepare_for_send(List<Item> *item_list)
void Protocol_prep::prepare_for_resend()
{
- packet->length(bit_fields);
- bzero((char*) packet->ptr()+1, bit_fields-1);
- packet[0]=1; // Marker for ok packet
+ packet->length(bit_fields+1);
+ bzero((char*) packet->ptr(), 1+bit_fields);
field_pos=0;
}
@@ -851,10 +867,9 @@ bool Protocol_prep::store(const char *from,uint length)
return net_store_data(from, length);
}
-
bool Protocol_prep::store_null()
{
- uint offset=(field_pos+2)/8, bit= (1 << ((field_pos+2) & 7));
+ uint offset= (field_pos+2)/8+1, bit= (1 << ((field_pos+2) & 7));
/* Room for this as it's allocated in prepare_for_send */
char *to= (char*) packet->ptr()+offset;
*to= (char) ((uchar) *to | (uchar) bit);
@@ -880,7 +895,8 @@ bool Protocol_prep::store_short(longlong from)
{
#ifndef DEBUG_OFF
DBUG_ASSERT(field_types == 0 ||
- field_types[field_pos] == MYSQL_TYPE_SHORT);
+ field_types[field_pos] == MYSQL_TYPE_SHORT ||
+ field_types[field_pos] == MYSQL_TYPE_YEAR);
#endif
field_pos++;
char *to= packet->prep_append(2, PACKET_BUFFET_EXTRA_ALLOC);
@@ -977,11 +993,11 @@ bool Protocol_prep::store(TIME *tm)
pos= buff+1;
int2store(pos, tm->year);
- int2store(pos+2, tm->month);
- int2store(pos+3, tm->day);
- int2store(pos+4, tm->hour);
- int2store(pos+5, tm->minute);
- int2store(pos+6, tm->second);
+ pos[2]= (uchar) tm->month;
+ pos[3]= (uchar) tm->day;
+ pos[4]= (uchar) tm->hour;
+ pos[5]= (uchar) tm->minute;
+ pos[6]= (uchar) tm->second;
int4store(pos+7, tm->second_part);
if (tm->second_part)
length=11;
@@ -1014,17 +1030,24 @@ bool Protocol_prep::store_time(TIME *tm)
field_pos++;
pos= buff+1;
pos[0]= tm->neg ? 1 : 0;
- int4store(pos+1, tm->day);
- int2store(pos+5, tm->hour);
- int2store(pos+7, tm->minute);
- int2store(pos+9, tm->second);
- int4store(pos+11, tm->second_part);
+ int4store(pos+1, tm->day);
+ pos[5]= (uchar) tm->hour;
+ pos[6]= (uchar) tm->minute;
+ pos[7]= (uchar) tm->second;
+ int4store(pos+8, tm->second_part);
if (tm->second_part)
- length=14;
+ length=11;
else if (tm->hour || tm->minute || tm->second || tm->day)
- length=10;
+ length=8;
else
length=0;
buff[0]=(char) length; // Length is stored first
return packet->append(buff, length+1, PACKET_BUFFET_EXTRA_ALLOC);
}
+
+#if 0
+bool Protocol_prep::send_fields(List<Item> *list, uint flag)
+{
+ return prepare_for_send(list);
+};
+#endif
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 6ef252467c3..49b061ae6b4 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -84,7 +84,7 @@ static int init_failsafe_rpl_thread(THD* thd)
#endif
thd->mem_root.free=thd->mem_root.used=0;
- if ((ulong) thd->variables.max_join_size == (ulong) HA_POS_ERROR)
+ if (thd->variables.max_join_size == HA_POS_ERROR)
thd->options|= OPTION_BIG_SELECTS;
thd->proc_info="Thread initialized";
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 66aded8422f..0cf2b50a6ea 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -21,6 +21,8 @@
- If the variable is thread specific, add it to 'system_variables' struct.
If not, add it to mysqld.cc and an declaration in 'mysql_priv.h'
+ - Don't forget to initialize new fields in global_system_variables and
+ max_system_variables!
- Use one of the 'sys_var... classes from set_var.h or write a specific
one for the variable type.
- Define it in the 'variable definition list' in this file.
@@ -155,11 +157,13 @@ sys_var_thd_ulong sys_max_error_count("max_error_count",
&SV::max_error_count);
sys_var_thd_ulong sys_max_heap_table_size("max_heap_table_size",
&SV::max_heap_table_size);
-sys_var_thd_ulonglong sys_max_join_size("max_join_size",
+sys_var_thd_ulong sys_pseudo_thread_id("pseudo_thread_id",
+ &SV::pseudo_thread_id);
+sys_var_thd_ha_rows sys_max_join_size("max_join_size",
&SV::max_join_size,
fix_max_join_size);
#ifndef TO_BE_DELETED /* Alias for max_join_size */
-sys_var_thd_ulonglong sys_sql_max_join_size("sql_max_join_size",
+sys_var_thd_ha_rows sys_sql_max_join_size("sql_max_join_size",
&SV::max_join_size,
fix_max_join_size);
#endif
@@ -283,7 +287,7 @@ static sys_var_thd_bit sys_unique_checks("unique_checks",
/* Local state variables */
-static sys_var_thd_ulonglong sys_select_limit("sql_select_limit",
+static sys_var_thd_ha_rows sys_select_limit("sql_select_limit",
&SV::select_limit);
static sys_var_timestamp sys_timestamp("timestamp");
static sys_var_last_insert_id sys_last_insert_id("last_insert_id");
@@ -369,6 +373,7 @@ sys_var *sys_variables[]=
&sys_net_retry_count,
&sys_net_wait_timeout,
&sys_net_write_timeout,
+ &sys_pseudo_thread_id,
&sys_query_cache_size,
#ifdef HAVE_QUERY_CACHE
&sys_query_cache_limit,
@@ -451,6 +456,7 @@ struct show_var_st init_vars[]= {
#ifdef HAVE_INNOBASE_DB
{"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG },
{"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONG },
+ {"innodb_buffer_pool_awe_mem_mb", (char*) &innobase_buffer_pool_awe_mem_mb, SHOW_LONG },
{"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR},
{"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR},
{"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG },
@@ -521,6 +527,7 @@ struct show_var_st init_vars[]= {
{"pid_file", (char*) pidfile_name, SHOW_CHAR},
{"port", (char*) &mysql_port, SHOW_INT},
{"protocol_version", (char*) &protocol_version, SHOW_INT},
+ {sys_pseudo_thread_id.name, (char*) &sys_pseudo_thread_id, SHOW_SYS},
{sys_read_buff_size.name, (char*) &sys_read_buff_size, SHOW_SYS},
{sys_read_rnd_buff_size.name,(char*) &sys_read_rnd_buff_size, SHOW_SYS},
{sys_rpl_recovery_rank.name,(char*) &sys_rpl_recovery_rank, SHOW_SYS},
@@ -611,7 +618,7 @@ static void fix_max_join_size(THD *thd, enum_var_type type)
{
if (type != OPT_GLOBAL)
{
- if (thd->variables.max_join_size == (ulonglong) HA_POS_ERROR)
+ if (thd->variables.max_join_size == HA_POS_ERROR)
thd->options|= OPTION_BIG_SELECTS;
else
thd->options&= ~OPTION_BIG_SELECTS;
@@ -770,12 +777,7 @@ bool sys_var_thd_ulong::update(THD *thd, set_var *var)
if (option_limits)
tmp= (ulong) getopt_ull_limit_value(tmp, option_limits);
if (var->type == OPT_GLOBAL)
- {
- /* Lock is needed to make things safe on 32 bit systems */
- pthread_mutex_lock(&LOCK_global_system_variables);
global_system_variables.*offset= (ulong) tmp;
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
else
thd->variables.*offset= (ulong) tmp;
return 0;
@@ -802,10 +804,60 @@ byte *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type)
}
+bool sys_var_thd_ha_rows::update(THD *thd, set_var *var)
+{
+ ulonglong tmp= var->value->val_int();
+
+ /* Don't use bigger value than given with --maximum-variable-name=.. */
+ if ((ha_rows) tmp > max_system_variables.*offset)
+ tmp= max_system_variables.*offset;
+
+ if (option_limits)
+ tmp= (ha_rows) getopt_ull_limit_value(tmp, option_limits);
+ if (var->type == OPT_GLOBAL)
+ {
+ /* Lock is needed to make things safe on 32 bit systems */
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ global_system_variables.*offset= (ha_rows) tmp;
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ }
+ else
+ thd->variables.*offset= (ha_rows) tmp;
+ return 0;
+}
+
+
+void sys_var_thd_ha_rows::set_default(THD *thd, enum_var_type type)
+{
+ if (type == OPT_GLOBAL)
+ {
+ /* We will not come here if option_limits is not set */
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ global_system_variables.*offset= (ha_rows) option_limits->def_value;
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ }
+ else
+ thd->variables.*offset= global_system_variables.*offset;
+}
+
+
+byte *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type)
+{
+ if (type == OPT_GLOBAL)
+ return (byte*) &(global_system_variables.*offset);
+ return (byte*) &(thd->variables.*offset);
+}
+
+
bool sys_var_thd_ulonglong::update(THD *thd, set_var *var)
{
if (var->type == OPT_GLOBAL)
+ {
+ /* Lock is needed to make things safe on 32 bit systems */
+ pthread_mutex_lock(&LOCK_global_system_variables);
global_system_variables.*offset= var->value->val_int();
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ }
else
thd->variables.*offset= var->value->val_int();
return 0;
@@ -815,7 +867,11 @@ bool sys_var_thd_ulonglong::update(THD *thd, set_var *var)
void sys_var_thd_ulonglong::set_default(THD *thd, enum_var_type type)
{
if (type == OPT_GLOBAL)
+ {
+ pthread_mutex_lock(&LOCK_global_system_variables);
global_system_variables.*offset= (ulonglong) option_limits->def_value;
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ }
else
thd->variables.*offset= global_system_variables.*offset;
}
@@ -922,6 +978,8 @@ Item *sys_var::item(THD *thd, enum_var_type var_type)
return new Item_uint((int32) *(ulong*) value_ptr(thd, var_type));
case SHOW_LONGLONG:
return new Item_int(*(longlong*) value_ptr(thd, var_type));
+ case SHOW_HA_ROWS:
+ return new Item_int((longlong) *(ha_rows*) value_ptr(thd, var_type));
case SHOW_MY_BOOL:
return new Item_int((int32) *(my_bool*) value_ptr(thd, var_type),1);
case SHOW_CHAR:
diff --git a/sql/set_var.h b/sql/set_var.h
index 795d9f0d0ab..f9a275941ef 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -212,6 +212,24 @@ public:
};
+class sys_var_thd_ha_rows :public sys_var_thd
+{
+public:
+ ha_rows SV::*offset;
+ sys_var_thd_ha_rows(const char *name_arg, ha_rows SV::*offset_arg)
+ :sys_var_thd(name_arg), offset(offset_arg)
+ {}
+ sys_var_thd_ha_rows(const char *name_arg, ha_rows SV::*offset_arg,
+ sys_after_update_func func)
+ :sys_var_thd(name_arg,func), offset(offset_arg)
+ {}
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ SHOW_TYPE type() { return SHOW_HA_ROWS; }
+ byte *value_ptr(THD *thd, enum_var_type type);
+};
+
+
class sys_var_thd_ulonglong :public sys_var_thd
{
public:
diff --git a/sql/share/Makefile.am b/sql/share/Makefile.am
index c70ac9ccf57..35202ff4722 100644
--- a/sql/share/Makefile.am
+++ b/sql/share/Makefile.am
@@ -7,7 +7,7 @@ dist-hook:
done; \
sleep 1 ; touch $(srcdir)/*/errmsg.sys
$(INSTALL_DATA) $(srcdir)/charsets/README $(distdir)/charsets
- $(INSTALL_DATA) $(srcdir)/charsets/Index $(distdir)/charsets
+ $(INSTALL_DATA) $(srcdir)/charsets/Index.xml $(distdir)/charsets
all: @AVAILABLE_LANGUAGES_ERRORS@
@@ -25,8 +25,7 @@ install-data-local:
done
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/charsets
$(INSTALL_DATA) $(srcdir)/charsets/README $(DESTDIR)$(pkgdatadir)/charsets/README
- $(INSTALL_DATA) $(srcdir)/charsets/Index $(DESTDIR)$(pkgdatadir)/charsets/Index
- $(INSTALL_DATA) $(srcdir)/charsets/*.conf $(DESTDIR)$(pkgdatadir)/charsets
+ $(INSTALL_DATA) $(srcdir)/charsets/*.xml $(DESTDIR)$(pkgdatadir)/charsets
fix_errors:
for lang in @AVAILABLE_LANGUAGES@; \
diff --git a/sql/share/charsets/Index b/sql/share/charsets/Index
deleted file mode 100644
index b2d9fe3e2a1..00000000000
--- a/sql/share/charsets/Index
+++ /dev/null
@@ -1,70 +0,0 @@
-# sql/share/charsets/Index
-#
-# This file lists all of the available character sets. Please keep this
-# file sorted by character set number.
-
-
-big5 1
-czech 2
-dec8 3
-dos 4
-german1 5
-hp8 6
-koi8_ru 7
-latin1 8
-latin2 9
-swe7 10
-usa7 11
-ujis 12
-sjis 13
-cp1251 14
-danish 15
-hebrew 16
-tis620 18
-euc_kr 19
-estonia 20
-hungarian 21
-koi8_ukr 22
-# win1251ukr is depreciated. Use cp1251cias, cp1251csas or cp1251bin instead.
-win1251ukr 23
-gb2312 24
-greek 25
-win1250 26
-croat 27
-gbk 28
-# cp1257 is depreciated.
-# Use cp1257ltlvciai, cp1257ltlvcsas, cp1257bin, cp1257ltlvcias instead
-cp1257 29
-latin5 30
-latin1_de 31
-armscii8 32
-utf8 33
-win1250ch 34
-
-ucs2 35
-cp866 36
-keybcs2 37
-
-macce 38
-macroman 39
-
-pclatin2 40
-latvian 41
-latvian1 42
-maccebin 43
-macceciai 44
-maccecias 45
-maccecsas 46
-latin1bin 47
-latin1cias 48
-latin1csas 49
-cp1251bin 50
-cp1251cias 51
-cp1251csas 52
-macromanbin 53
-macromancias 54
-macromanciai 55
-macromancsas 56
-cp1256 57
-
-binary 63
diff --git a/sql/share/charsets/Index.xml b/sql/share/charsets/Index.xml
new file mode 100644
index 00000000000..e6cea7bc615
--- /dev/null
+++ b/sql/share/charsets/Index.xml
@@ -0,0 +1,460 @@
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets max-id=63>
+
+<description>
+This file lists all of the available character sets.
+To make maintaining easier please:
+ - keep records sorted by collation number.
+ - change charsets.max-id when adding a new collation.
+</description>
+
+<charset name="big5">
+ <family>Traditional Chinese</family>
+ <alias>big-5</alias>
+ <alias>bigfive</alias>
+ <alias>big-five</alias>
+ <alias>cn-big5</alias>
+ <alias>csbig5</alias>
+ <collation name="big5" id="1" order="Chinese" flag="primary" flag="compiled"/>
+</charset>
+
+<charset name="latin2">
+ <family>Central European</family>
+ <alias>csisolatin2</alias>
+ <alias>iso-8859-2</alias>
+ <alias>iso-ir-101</alias>
+ <alias>iso_8859-2</alias>
+ <alias>iso_8859-2:1987</alias>
+ <alias>l2</alias>
+ <collation name="czech" id="2" order="Czech" flag="compiled"/>
+ <collation name="latin2" id="9" flag="primary">
+ <order>Hungarian</order>
+ <order>Polish</order>
+ <order>Romanian</order>
+ <order>Croatian</order>
+ <order>Slovak</order>
+ <order>Slovenian</order>
+ <order>Sorbian</order>
+ </collation>
+ <collation name="hungarian" id="21" order="Hungarian"/>
+ <collation name="croat" id="27" order="Croatian"/>
+</charset>
+
+<charset name="dec8">
+ <family>Western</family>
+ <collation name="dec8" id="3" flag="primary">
+ <order>Dutch</order>
+ <order>English</order>
+ <order>French</order>
+ <order>German Duden</order>
+ <order>Italian</order>
+ <order>Latin</order>
+ <order>Pogtuguese</order>
+ <order>Spanish</order>
+ </collation>
+</charset>
+
+<charset name="pclatin1">
+ <family>Western</family>
+ <alias>850</alias>
+ <alias>cp850</alias>
+ <alias>cspc850multilingual</alias>
+ <alias>ibm850</alias>
+ <collation name="pclatin1" id="4" flag="primary">
+ <order>Dutch</order>
+ <order>English</order>
+ <order>French</order>
+ <order>German Duden</order>
+ <order>Italian</order>
+ <order>Latin</order>
+ <order>Pogtuguese</order>
+ <order>Spanish</order>
+ </collation>
+</charset>
+
+<charset name="latin1">
+ <family>Western</family>
+ <alias>csisolatin1</alias>
+ <alias>iso-8859-1</alias>
+ <alias>iso-ir-100</alias>
+ <alias>iso_8859-1</alias>
+ <alias>iso_8859-1:1987</alias>
+ <alias>l1</alias>
+ <alias>latin1</alias>
+ <collation name="german1" id="5" order="German Duden"/>
+ <collation name="latin1" id="8" order="Finnish, Swedish" flag="primary"/>
+ <collation name="danish" id="15" order="Danish"/>
+ <collation name="latin1_de" id="31" order="German DIN" flag="compiled"/>
+ <collation name="latin1_bin" id="47" order="Binary"/>
+ <collation name="latin1_ci_as" id="48">
+ <order>Dutch</order>
+ <order>English</order>
+ <order>French</order>
+ <order>German Duden</order>
+ <order>Italian</order>
+ <order>Latin</order>
+ <order>Pogtuguese</order>
+ <order>Spanish</order>
+ </collation>
+ <collation name="latin1_cs_as" id="49">
+ <order>Dutch</order>
+ <order>English</order>
+ <order>French</order>
+ <order>German Duden</order>
+ <order>Italian</order>
+ <order>Latin</order>
+ <order>Pogtuguese</order>
+ <order>Spanish</order>
+ </collation>
+</charset>
+
+<charset name="hp8">
+ <family>Western</family>
+ <alias>hproman8</alias>
+ <collation name="hp8" id="6" flag="primary">
+ <order>Dutch</order>
+ <order>English</order>
+ <order>French</order>
+ <order>German Duden</order>
+ <order>Italian</order>
+ <order>Latin</order>
+ <order>Pogtuguese</order>
+ <order>Spanish</order>
+ </collation>
+</charset>
+
+<charset name="koi8r">
+ <family>Cyrillic</family>
+ <alias>koi8-r</alias>
+ <alias>cskoi8r</alias>
+ <collation name="koi8r" id="7" order="Russian" flag="primary"/>
+</charset>
+
+<charset name="swe7">
+ <family>Western</family>
+ <alias>iso-646-se</alias>
+ <collation name="swe7" id="10" order="Swedish" flag="primary"/>
+</charset>
+
+<charset name="ascii">
+ <family>Western</family>
+ <alias>us</alias>
+ <alias>us-ascii</alias>
+ <alias>csascii</alias>
+ <alias>iso-ir-6</alias>
+ <alias>iso646-us</alias>
+ <collation name="ascii" id="11" order="English" flag="primary"/>
+</charset>
+
+<charset name="ujis">
+ <family>Japanese</family>
+ <alias>euc-jp</alias>
+ <collation name="ujis" id="12" order="Japanese" flag="primary"/>
+</charset>
+
+<charset name="sjis">
+ <family>Japanese</family>
+ <alias>s-jis</alias>
+ <alias>shift-jis</alias>
+ <alias>x-sjis</alias>
+ <collation name="sjis" id="13" order="Japanese" flag="primary"/>
+</charset>
+
+<charset name="cp1251">
+ <family>Cyrillic</family>
+ <alias>windows-1251</alias>
+ <alias>ms-cyr</alias>
+ <alias>ms-cyrillic</alias>
+ <collation name="cp1251" id="14" flag="primary">
+ <order>Belarusian</order>
+ <order>Bulgarian</order>
+ <order>Macedonian</order>
+ <order>Russian</order>
+ <order>Serbian</order>
+ <order>Mongolian</order>
+ <order>Ukrainian</order>
+ </collation>
+ <collation name="win1251ukr" id="23" order="<Depreciated>"/>
+ <collation name="cp1251_bin" id="50" order="Binary"/>
+ <collation name="cp1251_ci_as" id="51">
+ <order>Belarusian</order>
+ <order>Bulgarian</order>
+ <order>Macedonian</order>
+ <order>Russian</order>
+ <order>Serbian</order>
+ <order>Mongolian</order>
+ <order>Ukrainian</order>
+ </collation>
+ <collation name="cp1251_cs_as" id="52">
+ <order>Belarusian</order>
+ <order>Bulgarian</order>
+ <order>Macedonian</order>
+ <order>Russian</order>
+ <order>Serbian</order>
+ <order>Mongolian</order>
+ <order>Ukrainian</order>
+ </collation>
+</charset>
+
+<charset name="hebrew">
+ <family>Hebrew</family>
+ <alias>csisolatinhebrew</alias>
+ <alias>iso-8859-8</alias>
+ <alias>iso-ir-138</alias>
+ <collation name="hebrew" id="16" order="Hebrew" flag="primary"/>
+</charset>
+
+<charset name="tis620">
+ <family>Thai</family>
+ <alias>tis-620</alias>
+ <collation name="tis620" id="18" order="Thai" flag="primary" flag="compiled"/>
+</charset>
+
+<charset name="euckr">
+ <family>Korean</family>
+ <alias>euc_kr</alias>
+ <alias>euc-kr</alias>
+ <collation name="euckr" id="19" order="Korean" flag="primary" flag="compiled"/>
+</charset>
+
+<charset name="latin7">
+ <family>Baltic</family>
+ <alias>BalticRim</alias>
+ <alias>iso-8859-13</alias>
+ <alias>l7</alias>
+ <collation name="estonia" id="20" order="Estonian" flag="primary"/>
+ <collation name="latvian" id="41" order="Latvian"/>
+ <collation name="latvian1" id="42" order="Latvian"/>
+</charset>
+
+<charset name="koi8u">
+ <family>Cyrillic</family>
+ <alias>koi8-u</alias>
+ <collation name="koi8u" id="22" order="Ukranian" flag="primary"/>
+</charset>
+
+<charset name="gb2312">
+ <family>Simplified Chinese</family>
+ <alias>chinese</alias>
+ <alias>iso-ir-58</alias>
+ <collation name="gb2312" id="24" order="Chinese" flag="primary" flag="compiled"/>
+</charset>
+
+<charset name="greek">
+ <family>Greek</family>
+ <alias>csisolatingreek</alias>
+ <alias>ecma-118</alias>
+ <alias>greek8</alias>
+ <alias>iso-8859-7</alias>
+ <alias>iso-ir-126</alias>
+ <collation name="greek" id="25" order="Greek" flag="primary"/>
+</charset>
+
+<charset name="cp1250">
+ <family>Central European</family>
+ <alias>ms-ce</alias>
+ <alias>windows-1250</alias>
+ <collation name="cp1250" id="26" flag="primary">
+ <order>Hungarian</order>
+ <order>Polish</order>
+ <order>Romanian</order>
+ <order>Croatian</order>
+ <order>Slovak</order>
+ <order>Slovenian</order>
+ <order>Sorbian</order>
+ </collation>
+ <collation name="cp1250_czech" id="34" order="Czech"/>
+</charset>
+
+<charset name="gbk">
+ <family>East Asian</family>
+ <alias>cp936</alias>
+ <collation name="gbk" id="28" order="Chinese" flag="primary" flag="compiled"/>
+</charset>
+
+<charset name="cp1257">
+ <family>Baltic</family>
+ <alias>WinBaltRim</alias>
+ <alias>windows-1257</alias>
+ <collation name="cp1257" id="29" order="<Depreciated>"/>
+ <collation name="cp1257_bin" id="58" order="Binary"/>
+ <collation name="cp1257_ci_ai" id="59" flag="primary">
+ <order>Latvian</order>
+ <order>Lithuanian</order>
+ </collation>
+ <collation name="cp1257_ci_as" id="60">
+ <order>Latvian</order>
+ <order>Lithuanian</order>
+ </collation>
+ <collation name="cp1257_cs_as" id="61">
+ <order>Latvian</order>
+ <order>Lithuanian</order>
+ </collation>
+</charset>
+
+<charset name="latin5">
+ <family>South Asian</family>
+ <alias>csisolatin5</alias>
+ <alias>iso-8859-9</alias>
+ <alias>iso-ir-148</alias>
+ <alias>l5</alias>
+ <alias>latin5</alias>
+ <alias>turkish</alias>
+ <collation name="latin5" id="30" order="Turkish" flag="primary"/>
+</charset>
+
+<charset name="armscii8">
+ <family>South Asian</family>
+ <alias>armscii-8</alias>
+ <collation name="armscii8" id="32" order="Armenian" flag="primary"/>
+</charset>
+
+<charset name="utf8">
+ <family>Unicode</family>
+ <alias>utf-8</alias>
+ <collation name="utf8" id="33" flag="primary"/>
+</charset>
+
+<charset name="ucs2">
+ <family>Unicode</family>
+ <collation name="ucs2" id="35" flag="primary"/>
+</charset>
+
+<charset name="cp866">
+ <family>Cyrillic</family>
+ <alias>866</alias>
+ <alias>csibm866</alias>
+ <alias>ibm866</alias>
+ <alias>DOSCyrillicRussian</alias>
+ <collation name="cp866" id="36" order="Russian" flag="primary"/>
+</charset>
+
+<charset name="keybcs2">
+ <family>Central European</family>
+ <collation name="keybcs2" id="37" order="Czech" flag="primary"/>
+</charset>
+
+<charset name="MacCE">
+ <family>Central European</family>
+ <alias>MacCentralEurope</alias>
+ <collation name="macce" id="38" flag="primary">
+ <order>Hungarian</order>
+ <order>Polish</order>
+ <order>Romanian</order>
+ <order>Croatian</order>
+ <order>Slovak</order>
+ <order>Slovenian</order>
+ <order>Sorbian</order>
+ </collation>
+ <collation name="macce_bin" id="43" order="Binary"/>
+ <collation name="macce_ci_ai" id="44">
+ <order>Hungarian</order>
+ <order>Polish</order>
+ <order>Romanian</order>
+ <order>Croatian</order>
+ <order>Slovak</order>
+ <order>Slovenian</order>
+ <order>Sorbian</order>
+ </collation>
+ <collation name="macce_ci_as" id="45">
+ <order>Hungarian</order>
+ <order>Polish</order>
+ <order>Romanian</order>
+ <order>Croatian</order>
+ <order>Slovak</order>
+ <order>Slovenian</order>
+ <order>Sorbian</order>
+ </collation>
+ <collation name="macce_cs_as" id="46">
+ <order>Hungarian</order>
+ <order>Polish</order>
+ <order>Romanian</order>
+ <order>Croatian</order>
+ <order>Slovak</order>
+ <order>Slovenian</order>
+ <order>Sorbian</order>
+ </collation>
+</charset>
+
+<charset name="MacRoman">
+ <family>Western</family>
+ <alias>Mac</alias>
+ <alias>Macintosh</alias>
+ <alias>csmacintosh</alias>
+ <collation name="macroman" id="39" flag="primary">
+ <order>Dutch</order>
+ <order>English</order>
+ <order>French</order>
+ <order>German Duden</order>
+ <order>Italian</order>
+ <order>Latin</order>
+ <order>Pogtuguese</order>
+ <order>Spanish</order>
+ </collation>
+ <collation name="macroman_bin" id="53" order="Binary"/>
+ <collation name="macroman_ci_as" id="54">
+ <order>Dutch</order>
+ <order>English</order>
+ <order>French</order>
+ <order>German Duden</order>
+ <order>Italian</order>
+ <order>Latin</order>
+ <order>Pogtuguese</order>
+ <order>Spanish</order>
+ </collation>
+ <collation name="macroman_ci_ai" id="55">
+ <order>Dutch</order>
+ <order>English</order>
+ <order>French</order>
+ <order>German Duden</order>
+ <order>Italian</order>
+ <order>Latin</order>
+ <order>Pogtuguese</order>
+ <order>Spanish</order>
+ </collation>
+ <collation name="macroman_cs_as" id="56">
+ <order>Dutch</order>
+ <order>English</order>
+ <order>French</order>
+ <order>German Duden</order>
+ <order>Italian</order>
+ <order>Latin</order>
+ <order>Pogtuguese</order>
+ <order>Spanish</order>
+ </collation>
+</charset>
+
+<charset name="pclatin2">
+ <family>Central European</family>
+ <alias>852</alias>
+ <alias>cp852</alias>
+ <alias>ibm852</alias>
+ <collation name="pclatin2" id="40" flag="primary">
+ <order>Hungarian</order>
+ <order>Polish</order>
+ <order>Romanian</order>
+ <order>Croatian</order>
+ <order>Slovak</order>
+ <order>Slovenian</order>
+ <order>Sorbian</order>
+ </collation>
+</charset>
+
+<charset name="cp1256">
+ <family>Arabic</family>
+ <alias>ms-arab</alias>
+ <alias>windows-1256</alias>
+ <collation name="cp1256" id="57" order="Arabic" flag="primary">
+ <order>Arabic</order>
+ <order>Persian</order>
+ <order>Pakistani</order>
+ <order>Urdu</order>
+ </collation>
+</charset>
+
+<charset name="binary">
+ <collation name="binary" id="63" order="Binary" flag="primary" flag="compiled"/>
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/maccebin.conf b/sql/share/charsets/MacCE.xml
index f859e64354c..fe64fd18abc 100644
--- a/sql/share/charsets/maccebin.conf
+++ b/sql/share/charsets/MacCE.xml
@@ -1,9 +1,11 @@
-# Mac OS Central European, binary sort order
-#
-# Czech (cs), Hungarian (hu), Polish (pl), Romanian (ro), Croatian (hr),
-# Slovak (sk), Slovenian (sl), Sorbian.
-#
-# ctype array (must be 257 elements)
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="MacCE">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -21,8 +23,12 @@
00 00 00 00 00 00 00 00 02 01 02 01 00 00 02 01
02 01 00 00 02 01 02 01 01 02 01 01 02 01 01 01
02 01 01 02 01 02 01 02 01 02 02 01 01 02 01 00
+</map>
+</ctype>
-# to_lower array (must be 256 elements)
+
+<lower>
+<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
@@ -39,8 +45,12 @@
D0 D1 D2 D3 D4 D5 D6 D7 D8 DA DA DE DC DD DE E0
E0 E4 E2 E3 E4 E6 E6 87 E9 E9 92 EC EC F0 97 99
F0 F3 9C F3 F5 F5 F7 F7 F9 F9 FA FD B8 FD AE FF
+</map>
+</lower>
+
-# to_upper array (must be 256 elements)
+<upper>
+<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
@@ -57,26 +67,12 @@
D0 D1 D2 D3 D4 D5 D6 D7 CF D9 D9 DB DC DD DB DF
DF E1 E2 E3 E1 E5 E5 E7 E8 E8 EA EB EB ED EE EF
ED F1 F2 F1 F4 F4 F6 F6 F8 F8 B5 FB FC FB FE FF
+</map>
+</upper>
-# sort_order array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-# Unicode mapping (must be 256 elements)
+<unicode>
+<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
@@ -93,4 +89,121 @@
2013 2014 201C 201D 2018 2019 00F7 25CA 014D 0154 0155 0158 2039 203A 0159 0156
0157 0160 201A 201E 0161 015A 015B 00C1 0164 0165 00CD 017D 017E 016A 00D3 00D4
016B 016E 00DA 016F 0170 0171 0172 0173 00DD 00FD 0137 017B 0141 017C 0122 02C7
+</map>
+</unicode>
+
+
+<collation name="macce">
+<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 46 47 4A 4C 52 53 55 56 5A 5B 5D 62 62 67
+ 6F 70 71 75 79 81 88 89 8A 8B 8D 90 91 92 93 94
+ 95 41 46 47 4A 4C 52 53 55 56 5A 5B 5D 62 62 67
+ 6F 70 71 75 79 81 88 89 8A 8B 8D 96 97 98 99 9A
+ 41 41 41 4C 41 67 81 41 41 47 41 47 47 47 4C 8D
+ 8D 4A 56 4A 4C 4C 4C 67 4C 67 67 67 81 4C 4C 81
+ A0 A1 4C A3 A4 A5 A6 75 A8 A9 AA 4C AC AD 53 56
+ 56 56 B2 B3 56 5B B6 B7 5D 5D 5D 5D 5D 5D 5D 62
+ 62 62 C2 C3 62 62 C6 C7 C8 C9 CA 62 67 67 67 67
+ D0 D1 D2 D3 D4 D5 D6 D7 67 71 71 71 DC DD 71 71
+ 71 75 E2 E3 75 75 75 41 79 79 56 8D 8D 81 67 67
+ 81 81 81 81 81 81 81 81 8B 8B 5B 8D 5D 8D 53 FF
+</map>
+</collation>
+
+
+<collation name="macce_bin">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+</map>
+</collation>
+
+
+<collation name="macce_ci_ai">
+<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 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
+ 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D2 D3 D4 D5 D6
+ D7 41 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
+ 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D8 D9 DA DB DC
+ 41 41 41 57 41 8D B2 41 41 4D 41 4D 4D 4D 57 CA
+ CA 53 6B 53 57 57 57 8D 57 8D 8D 8D B2 57 57 B2
+ DD DE 57 DF E0 E1 E2 A7 E3 E4 E5 57 E6 E7 65 6B
+ 6B 6B E8 E9 6B 75 EA EB 79 79 79 79 79 79 79 85
+ 85 85 EC ED 85 85 EE EF F0 F1 F2 85 8D 8D 8D 8D
+ F3 F4 F5 F6 F7 F8 F9 FA 8D 9F 9F 9F FB FC 9F 9F
+ 9F A7 FD FE A7 A7 A7 41 BE BE 6B CA CA B2 8D 8D
+ B2 B2 B2 B2 B2 B2 B2 B2 C6 C6 75 CA 79 CA 65 FF
+</map>
+</collation>
+
+
+<collation name="macce_ci_as">
+<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 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
+ 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D2 D3 D4 D5 D6
+ D7 41 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
+ 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D8 D9 DA DB DC
+ 45 47 47 59 49 91 B6 43 49 4F 45 4F 51 51 59 CE
+ CE 55 71 55 5B 5B 5D 8F 5D 99 91 97 B8 5F 5F B6
+ DD DE 61 DF E0 E1 E2 AD E3 E4 E5 61 E6 E7 67 6F
+ 6F 6D E8 E9 6D 77 EA EB 7B 81 82 7F 7F 7D 7D 8B
+ 8B 87 EC ED 87 89 EE EF F0 F1 F2 89 93 97 93 95
+ F3 F4 F5 F6 F7 F8 F9 FA 95 A1 A1 A3 FB FC A3 A5
+ A5 A9 FD FE A9 AB AB 43 B0 B0 71 CC CC BC 8F 99
+ BC B4 B8 B4 BA BA BE BE C8 C8 77 D0 7B D0 67 FF
+
+</map>
+</collation>
+
+
+<collation name="macce_cs_as">
+<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 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
+ 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D2 D3 D4 D5 D6
+ D7 42 4C 4E 54 58 64 66 6A 6C 74 76 7A 84 86 8E
+ 9C 9E A0 A8 AF B3 C1 C3 C5 C7 CB D8 D9 DA DB DC
+ 45 47 48 59 49 91 B6 44 4A 4F 46 50 51 52 5A CE
+ CF 55 72 56 5B 5C 5D 90 5E 9A 92 98 B8 5F 60 B7
+ DD DE 61 DF E0 E1 E2 AD E3 E4 E5 62 E6 E7 68 6F
+ 70 6D E8 E9 6E 77 EA EB 7C 81 82 7F 80 7D 7E 8B
+ 8C 87 EC ED 88 89 EE EF F0 F1 F2 8A 93 97 94 95
+ F3 F4 F5 F6 F7 F8 F9 FA 96 A1 A2 A3 FB FC A4 A5
+ A6 A9 FD FE AA AB AC 43 B0 B1 71 CC CD BC 8F 99
+ BD B4 B9 B5 BA BB BE BF C8 C9 78 D0 7B D1 67 FF
+</map>
+</collation>
+
+
+</charset>
+</charsets>
diff --git a/sql/share/charsets/macroman.conf b/sql/share/charsets/MacRoman.xml
index 11cbee40e94..b17860f56b2 100644
--- a/sql/share/charsets/macroman.conf
+++ b/sql/share/charsets/MacRoman.xml
@@ -1,4 +1,11 @@
-# ctype array (must be 257 elements)
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="MacRoman">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -16,8 +23,11 @@
00 00 00 00 00 00 00 00 02 01 00 00 00 00 00 00
00 00 00 00 00 20 01 01 01 01 01 01 01 01 01 01
00 01 01 01 01 02 00 00 00 00 00 00 00 00 00 00
+</map>
+</ctype>
-# to_lower array (must be 256 elements)
+<lower>
+<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
@@ -34,8 +44,11 @@
D0 D1 D2 D3 D4 D5 D6 D7 D8 D8 DA DB DC DD DE DF
E0 E1 E2 E3 E4 89 90 87 91 8F 92 94 95 93 97 99
F0 98 9C 9E 9D F5 F6 F7 F8 F9 FA FB FC FD FE FF
+</map>
+</lower>
-# to_upper array (must be 256 elements)
+<upper>
+<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
@@ -52,26 +65,12 @@
D0 D1 D2 D3 D4 D5 D6 D7 D9 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
+</map>
+</upper>
-# sort_order array (must be 256 elements)
- 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 49 50 52 53 57 59 60 61 67 68 69 70 71 72
- 79 80 81 82 84 85 90 91 92 93 95 A0 A1 A2 A3 A4
- A5 41 49 50 52 53 57 59 60 61 67 68 69 70 71 72
- 79 80 81 82 84 85 90 91 92 93 95 A6 A7 A8 A9 AA
- 41 41 50 53 71 72 85 41 41 41 41 41 41 50 53 53
- 53 53 61 61 61 61 71 72 72 72 72 72 85 85 85 85
- AB AC AD AE AF B0 B1 82 B2 B3 B4 B5 B6 B7 48 72
- B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 C4 C5 48 72
- C6 C7 C8 C9 57 CA CB CC CD CE CF 41 41 72 D0 D1
- D2 D3 D4 D5 D6 D7 D8 D9 93 93 DA DB DC DD DE DF
- E0 E1 E2 E3 E4 41 53 41 53 53 61 61 61 61 72 72
- F0 72 85 85 85 61 F6 F7 F8 F9 FA FB FC FD FE FF
-# Unicode mappping (must be 256 elements)
+<unicode>
+<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
@@ -88,4 +87,115 @@
2013 2014 201C 201D 2018 2019 00F7 25CA 00FF 0178 2044 20AC 2039 203A FB01 FB02
2021 00B7 201A 201E 2030 00C2 00CA 00C1 00CB 00C8 00CD 00CE 00CF 00CC 00D3 00D4
F8FF 00D2 00DA 00DB 00D9 0131 02C6 02DC 00AF 02D8 02D9 02DA 00B8 02DD 02DB 02C7
+</map>
+</unicode>
+
+<collation name="macroman">
+<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 49 50 52 53 57 59 60 61 67 68 69 70 71 72
+ 79 80 81 82 84 85 90 91 92 93 95 A0 A1 A2 A3 A4
+ A5 41 49 50 52 53 57 59 60 61 67 68 69 70 71 72
+ 79 80 81 82 84 85 90 91 92 93 95 A6 A7 A8 A9 AA
+ 41 41 50 53 71 72 85 41 41 41 41 41 41 50 53 53
+ 53 53 61 61 61 61 71 72 72 72 72 72 85 85 85 85
+ AB AC AD AE AF B0 B1 82 B2 B3 B4 B5 B6 B7 48 72
+ B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 C4 C5 48 72
+ C6 C7 C8 C9 57 CA CB CC CD CE CF 41 41 72 D0 D1
+ D2 D3 D4 D5 D6 D7 D8 D9 93 93 DA DB DC DD DE DF
+ E0 E1 E2 E3 E4 41 53 41 53 53 61 61 61 61 72 72
+ F0 72 85 85 85 61 F6 F7 F8 F9 FA FB FC FD FE FF
+</map>
+</collation>
+
+<collation name="macroman_bin">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+</map>
+</collation>
+
+<collation name="macroman_ci_ai">
+<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 59 63 66 68 6A 75 77 79 7B 7D 81
+ 91 93 95 97 9A 9C A6 A8 AA AC B0 B2 B3 B4 B5 B6
+ B7 41 51 53 57 59 63 66 68 6A 75 77 79 7B 7D 81
+ 91 93 95 97 9A 9C A6 A8 AA AC B0 B8 B9 BA BB BC
+ 41 41 53 59 7D 81 9C 41 41 41 41 41 41 53 59 59
+ 59 59 6A 6A 6A 6A 7D 81 81 81 81 81 9C 9C 9C 9C
+ BD BE BF C0 C1 C2 C3 97 C4 C5 C6 C7 C8 C9 41 81
+ CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 41 81
+ D8 D9 DA DB 63 DC DD DE DF E0 E1 41 41 81 81 81
+ E2 E3 E4 E5 E6 E7 E8 E9 AC AC EA EB EC ED EE EF
+ F0 F1 F2 F3 F4 41 59 41 59 59 6A 6A 6A 6A 81 81
+ F0 81 9C 9C 9C 6A F6 F7 F8 F9 FA FB FC FD FE FF
+
+</map>
+</collation>
+
+<collation name="macroman_ci_as">
+<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 59 63 66 68 6A 75 77 79 7B 7D 81
+ 91 93 95 97 9A 9C A6 A8 AA AC B0 B2 B3 B4 B5 B6
+ B7 41 51 53 57 59 63 66 68 6A 75 77 79 7B 7D 81
+ 91 93 95 97 9A 9C A6 A8 AA AC B0 B8 B9 BA BB BC
+ 4B 4D 55 5D 7F 8B A4 45 43 47 4B 49 4D 55 5D 5B
+ 5F 61 6E 6C 70 72 7F 85 83 87 8B 89 A0 9E A2 A4
+ BD BE BF C0 C1 C2 C3 99 C4 C5 C6 C7 C8 C9 4F 8D
+ CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 4F 8D
+ D8 D9 DA DB 65 DC DD DE DF E0 E1 43 49 89 8F 8F
+ E2 E3 E4 E5 E6 E7 E8 E9 AE AE EA EB EC ED EE EF
+ F0 F1 F2 F3 F4 47 5F 45 61 5B 6E 70 70 6C 85 87
+ F0 83 A0 A2 9E 72 F6 F7 F8 F9 FA FB FC FD FE FF
+</map>
+</collation>
+
+<collation name="macroman_cs_as">
+<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 59 63 66 68 6A 75 77 79 7B 7D 81
+ 91 93 95 97 9A 9C A6 A8 AA AC B0 B2 B3 B4 B5 B6
+ B7 42 52 54 58 5A 64 67 69 6B 76 78 7A 7C 7E 82
+ 92 94 96 98 9B 9D A7 A9 AB AD B1 B8 B9 BA BB BC
+ 4B 4D 55 5D 7F 8B A4 46 44 48 4C 4A 4E 56 5E 5C
+ 60 62 6F 6D 71 73 80 86 84 88 8C 8A A1 9F A3 A5
+ BD BE BF C0 C1 C2 C3 99 C4 C5 C6 C7 C8 C9 4F 8D
+ CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 50 8E
+ D8 D9 DA DB 65 DC DD DE DF E0 E1 43 49 89 8F 90
+ E2 E3 E4 E5 E6 E7 E8 E9 AF AE EA EB EC ED EE EF
+ F0 F1 F2 F3 F4 47 5F 45 61 5B 6E 70 72 6C 85 87
+ F0 83 A0 A2 9E 74 F6 F7 F8 F9 FA FB FC FD FE FF
+</map>
+</collation>
+
+</charset>
+</charsets>
diff --git a/sql/share/charsets/armscii8.conf b/sql/share/charsets/armscii8.conf
deleted file mode 100644
index 54d2d0fec47..00000000000
--- a/sql/share/charsets/armscii8.conf
+++ /dev/null
@@ -1,93 +0,0 @@
-# Configuration file for the armscii8 (armenian) character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 01 02 01 02 01 02 01 02 01 02 01 02 01 02
- 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02
- 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02
- 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02
- 01 02 01 02 01 02 01 02 01 02 01 02 01 02 10 10
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 AA AB AC AD AE AF
- B0 B1 B3 B3 B5 B5 B7 B7 B9 B9 BB BB BD BD BF BF
- C1 C1 C3 C3 C5 C5 C7 C7 C9 C9 CB CB CD CD CF CF
- D1 D1 D3 D3 D5 D5 D7 D7 D9 D9 DB DB DD DD DF DF
- E1 E1 E3 E3 E5 E5 E7 E7 E9 E9 EB EB ED ED EF EF
- F1 F1 F3 F3 F5 F5 F7 F7 F9 F9 FB FB FD FD FE FF
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B2 B4 B4 B6 B6 B8 B8 BA BA BC BC BE BE
- C0 C0 C2 C2 C4 C4 C6 C6 C8 C8 CA CA CC CC CE CE
- D0 D0 D2 D2 D4 D4 D6 D6 D8 D8 DA DA DC DC DE DE
- E0 E0 E2 E2 E4 E4 E6 E6 E8 E8 EA EA EC EC EE EE
- F0 F0 F2 F2 F4 F4 F6 F6 F8 F8 FA FA FC FC FE FF
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 2741 00A7 0589 0029 0028 00BB 00AB 2014 002E 055D 002C 002D 055F 2026 055C
-055B 055E 0531 0561 0532 0562 0533 0563 0534 0564 0535 0565 0536 0566 0537 0567
-0538 0568 0539 0569 053A 056A 053B 056B 053C 056C 053D 056D 053E 056E 053F 056F
-0540 0570 0541 0571 0542 0572 0543 0573 0544 0574 0545 0575 0546 0576 0547 0577
-0548 0578 0549 0579 054A 057A 054B 057B 054C 057C 054D 057D 054E 057E 054F 057F
-0550 0580 0551 0581 0552 0582 0553 0583 0554 0584 0555 0585 0556 0586 2019 0027
diff --git a/sql/share/charsets/armscii8.xml b/sql/share/charsets/armscii8.xml
new file mode 100644
index 00000000000..99ab5eb336d
--- /dev/null
+++ b/sql/share/charsets/armscii8.xml
@@ -0,0 +1,119 @@
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="armscii8">
+
+<ctype>
+<map>
+ 00
+ 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
+ 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
+ 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 01 02 01 02 01 02 01 02 01 02 01 02 01 02
+ 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02
+ 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02
+ 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02
+ 01 02 01 02 01 02 01 02 01 02 01 02 01 02 10 10
+</map>
+</ctype>
+
+
+<lower>
+<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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 AA AB AC AD AE AF
+ B0 B1 B3 B3 B5 B5 B7 B7 B9 B9 BB BB BD BD BF BF
+ C1 C1 C3 C3 C5 C5 C7 C7 C9 C9 CB CB CD CD CF CF
+ D1 D1 D3 D3 D5 D5 D7 D7 D9 D9 DB DB DD DD DF DF
+ E1 E1 E3 E3 E5 E5 E7 E7 E9 E9 EB EB ED ED EF EF
+ F1 F1 F3 F3 F5 F5 F7 F7 F9 F9 FB FB FD FD FE FF
+</map>
+</lower>
+
+
+<upper>
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B2 B4 B4 B6 B6 B8 B8 BA BA BC BC BE BE
+ C0 C0 C2 C2 C4 C4 C6 C6 C8 C8 CA CA CC CC CE CE
+ D0 D0 D2 D2 D4 D4 D6 D6 D8 D8 DA DA DC DC DE DE
+ E0 E0 E2 E2 E4 E4 E6 E6 E8 E8 EA EA EC EC EE EE
+ F0 F0 F2 F2 F4 F4 F6 F6 F8 F8 FA FA FC FC FE FF
+</map>
+</upper>
+
+
+<unicode>
+<map>
+0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
+0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
+0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
+0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
+0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
+0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
+0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
+0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
+0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
+0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
+00A0 2741 00A7 0589 0029 0028 00BB 00AB 2014 002E 055D 002C 002D 055F 2026 055C
+055B 055E 0531 0561 0532 0562 0533 0563 0534 0564 0535 0565 0536 0566 0537 0567
+0538 0568 0539 0569 053A 056A 053B 056B 053C 056C 053D 056D 053E 056E 053F 056F
+0540 0570 0541 0571 0542 0572 0543 0573 0544 0574 0545 0575 0546 0576 0547 0577
+0548 0578 0549 0579 054A 057A 054B 057B 054C 057C 054D 057D 054E 057E 054F 057F
+0550 0580 0551 0581 0552 0582 0553 0583 0554 0584 0555 0585 0556 0586 2019 0027
+</map>
+</unicode>
+
+
+<collation name="armscii8">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+</map>
+</collation>
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/cp1257bin.conf b/sql/share/charsets/ascii.xml
index 032f8a7e05d..67ab57de88f 100644
--- a/sql/share/charsets/cp1257bin.conf
+++ b/sql/share/charsets/ascii.xml
@@ -1,9 +1,11 @@
-#
-# cp1257 character set
-#
-# Binary sorting order
-#
-# ctype array (must be 257 elements)
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="ascii">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -12,17 +14,21 @@
10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
+ 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 01
- 00 00 00 00 00 00 00 00 02 00 02 00 00 00 00 02
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 00 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 00 02 02 02 02 02 02 02 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+</map>
+</ctype>
+
-# to_lower array (must be 256 elements)
+<lower>
+<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
@@ -33,14 +39,18 @@
70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 BA AB AC AD AE BF
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF
+ 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
+</map>
+</lower>
+
-# to_upper array (must be 256 elements)
+<upper>
+<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
@@ -51,22 +61,48 @@
50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 BA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 BA BB BC BD BE AF
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
+ 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
+</map>
+</upper>
-# sort_order array (must be 256 elements)
+
+<unicode>
+<map>
+0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
+0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
+0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
+0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
+0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
+0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
+0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
+0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 0000
+0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+</map>
+</unicode>
+
+
+<collation name="ascii">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 50 51 52 53 54 55 56 57 58 59 5A 5C 5D 5B 5E 5F
+ 45 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 59 7F
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
@@ -75,22 +111,9 @@
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
+</map>
+</collation>
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 20AC 0000 201A 0000 201E 2026 2020 2021 0000 2030 0000 2039 0000 00A8 02C7 00B8
- 0000 2018 2019 201C 201D 2022 2013 2014 0000 2122 0000 203A 0000 00AF 02DB 0000
- 00A0 0000 00A2 00A3 00A4 0000 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
- 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
- 0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
- 0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
- 0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
- 0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 02D9
+</charset>
+</charsets>
diff --git a/sql/share/charsets/win1250.conf b/sql/share/charsets/cp1250.xml
index 0a5b5074bde..a863aceffc9 100644
--- a/sql/share/charsets/win1250.conf
+++ b/sql/share/charsets/cp1250.xml
@@ -1,6 +1,11 @@
-# Configuration file for the win1250 character set.
+<?xml version='1.0' encoding="utf-8"?>
-# The ctype array must have 257 elements.
+<charsets>
+
+<charset name="cp1250">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -18,8 +23,12 @@
01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 10
+</map>
+</ctype>
+
-# The to_lower array must have 256 elements.
+<lower>
+<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
@@ -36,8 +45,12 @@
F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
+</map>
+</lower>
-# The to_upper array must have 256 elements.
+
+<upper>
+<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
@@ -54,26 +67,12 @@
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE A7
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
+</map>
+</upper>
-# The sort_order array must have 256 elements.
- 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 42 43 46 49 4A 4B 4C 4D 4E 4F 50 52 53 55
- 56 57 58 59 5B 5C 5D 5E 5F 60 61 63 64 65 66 67
- 68 41 42 43 46 49 4A 4B 4C 4D 4E 4F 50 52 53 55
- 56 57 58 59 5B 5C 5D 5E 5F 60 61 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 5A 8B 5A 5B 62 62
- 90 91 92 93 94 95 96 97 98 99 5A 9B 5A 5B 62 62
- 20 A1 A2 50 A4 41 A6 59 A8 A9 59 AB AC AD AE 62
- B0 B1 B2 50 B4 B5 B6 B7 B8 41 59 BB 50 BD 50 62
- 58 41 41 41 41 50 45 43 44 49 49 49 49 4D 4D 46
- 47 53 53 55 55 55 55 D7 58 5C 5C 5C 5C 60 5B 59
- 58 41 41 41 41 50 45 43 44 49 49 49 49 4D 4D 46
- 47 53 53 55 55 55 55 F7 58 5C 5C 5C 5C 60 5B FF
-# Unicode mapping table (256 elements)
+<unicode>
+<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
@@ -90,3 +89,33 @@
0110 0143 0147 00D3 00D4 0150 00D6 00D7 0158 016E 00DA 0170 00DC 00DD 0162 00DF
0155 00E1 00E2 0103 00E4 013A 0107 00E7 010D 00E9 0119 00EB 011B 00ED 00EE 010F
0111 0144 0148 00F3 00F4 0151 00F6 00F7 0159 016F 00FA 0171 00FC 00FD 0163 02D9
+</map>
+</unicode>
+
+
+<collation name="cp1250">
+<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 42 43 46 49 4A 4B 4C 4D 4E 4F 50 52 53 55
+ 56 57 58 59 5B 5C 5D 5E 5F 60 61 63 64 65 66 67
+ 68 41 42 43 46 49 4A 4B 4C 4D 4E 4F 50 52 53 55
+ 56 57 58 59 5B 5C 5D 5E 5F 60 61 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 5A 8B 5A 5B 62 62
+ 90 91 92 93 94 95 96 97 98 99 5A 9B 5A 5B 62 62
+ 20 A1 A2 50 A4 41 A6 59 A8 A9 59 AB AC AD AE 62
+ B0 B1 B2 50 B4 B5 B6 B7 B8 41 59 BB 50 BD 50 62
+ 58 41 41 41 41 50 45 43 44 49 49 49 49 4D 4D 46
+ 47 53 53 55 55 55 55 D7 58 5C 5C 5C 5C 60 5B 59
+ 58 41 41 41 41 50 45 43 44 49 49 49 49 4D 4D 46
+ 47 53 53 55 55 55 55 F7 58 5C 5C 5C 5C 60 5B FF
+</map>
+</collation>
+
+<collation name="cp1250_czech"/>
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/cp1251.conf b/sql/share/charsets/cp1251.conf
deleted file mode 100644
index ee72c6e7b27..00000000000
--- a/sql/share/charsets/cp1251.conf
+++ /dev/null
@@ -1,93 +0,0 @@
-# Configuration file for the cp1251 character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- 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
- 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 BA BB BC BD BE 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
- 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
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7C 7D 7E 7F 80
- 81 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 82 83 84 85 FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF 61 FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF 61 FF FF FF FF FF FF FF
- 5B 5C 5D 5E 5F 60 62 63 64 65 66 67 68 69 6A 6B
- 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B
- 5B 5C 5D 5E 5F 60 62 63 64 65 66 67 68 69 6A 6B
- 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 0402 0403 201A 0453 201E 2026 2020 2021 0000 2030 0409 2039 040A 040C 040B 040F
- 0452 2018 2019 201C 201D 2022 2013 2014 0000 2122 0459 203A 045A 045C 045B 045F
- 00A0 040E 045E 0408 00A4 0490 00A6 00A7 0401 00A9 0404 00AB 00AC 00AD 00AE 0407
- 00B0 00B1 0406 0456 0491 00B5 00B6 00B7 0451 2116 0454 00BB 0458 0405 0455 0457
- 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 041A 041B 041C 041D 041E 041F
- 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F
- 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 043A 043B 043C 043D 043E 043F
- 0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F
-
diff --git a/sql/share/charsets/cp1251cias.conf b/sql/share/charsets/cp1251.xml
index 612be640b11..48c525eb797 100644
--- a/sql/share/charsets/cp1251cias.conf
+++ b/sql/share/charsets/cp1251.xml
@@ -1,12 +1,11 @@
-#
-# cp1251
-# Case insensitive, accent sensitive
-# Sort order is correct for Belarusian, Bulgarian, Macedonian,
-# Russian, Serbian, Mongolian languages. Almost good for Ukrainian,
-# except that "CYRILLIC LETTER SOFT SIGN" is not in the end of alphabet,
-# but between YERU and E.
-#
-# ctype array (must be 257 elements)
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="cp1251">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -24,8 +23,12 @@
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+</map>
+</ctype>
+
-# to_lower array (must be 256 elements)
+<lower>
+<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
@@ -42,8 +45,12 @@
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
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
+</map>
+</lower>
-# to_upper array (must be 256 elements)
+
+<upper>
+<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
@@ -60,26 +67,12 @@
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
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
+</map>
+</upper>
-# sort_order array (must be 256 elements)
- 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 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
- 5F 61 63 65 67 69 6B 6D 6F 71 73 D3 D4 D5 D6 D7
- D8 41 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
- 5F 61 63 65 67 69 6B 6D 6F 71 73 D9 DA DB DC DD
- 81 83 DE 83 DF E0 E1 E2 E3 E4 A1 E5 A7 9D B3 C1
- 81 E6 E7 E8 E9 EA EB EC ED EE A1 EF A7 9D B3 C1
- F0 B7 B7 99 F1 7D F2 F3 87 F4 89 F5 F6 F7 F8 95
- F9 FA 93 93 7D FB FC FD 87 FE 89 FF 99 8F 8F 95
- 75 77 79 7B 7F 85 8B 8D 91 97 9B 9F A3 A5 A9 AB
- AD AF B1 B5 B9 BB BD BF C3 C5 C7 C9 CB CD CF D1
- 75 77 79 7B 7F 85 8B 8D 91 97 9B 9F A3 A5 A9 AB
- AD AF B1 B5 B9 BB BD BF C3 C5 C7 C9 CB CD CF D1
-# Unicode mapping (must be 256 elements)
+<unicode>
+<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
@@ -97,3 +90,127 @@
0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 043A 043B 043C 043D 043E 043F
0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F
+</map>
+</unicode>
+
+
+<collation name="cp1251">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7C 7D 7E 7F 80
+ 81 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 82 83 84 85 FF
+ FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+ FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+ FF FF FF FF FF FF FF FF 61 FF FF FF FF FF FF FF
+ FF FF FF FF FF FF FF FF 61 FF FF FF FF FF FF FF
+ 5B 5C 5D 5E 5F 60 62 63 64 65 66 67 68 69 6A 6B
+ 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B
+ 5B 5C 5D 5E 5F 60 62 63 64 65 66 67 68 69 6A 6B
+ 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B
+</map>
+</collation>
+
+
+<collation name="cp1251_bin">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+</map>
+</collation>
+
+
+<collation name="cp1251_ci_as">
+<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 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
+ 5F 61 63 65 67 69 6B 6D 6F 71 73 D3 D4 D5 D6 D7
+ D8 41 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
+ 5F 61 63 65 67 69 6B 6D 6F 71 73 D9 DA DB DC DD
+ 81 83 DE 83 DF E0 E1 E2 E3 E4 A1 E5 A7 9D B3 C1
+ 81 E6 E7 E8 E9 EA EB EC ED EE A1 EF A7 9D B3 C1
+ F0 B7 B7 99 F1 7D F2 F3 87 F4 89 F5 F6 F7 F8 95
+ F9 FA 93 93 7D FB FC FD 87 FE 89 FF 99 8F 8F 95
+ 75 77 79 7B 7F 85 8B 8D 91 97 9B 9F A3 A5 A9 AB
+ AD AF B1 B5 B9 BB BD BF C3 C5 C7 C9 CB CD CF D1
+ 75 77 79 7B 7F 85 8B 8D 91 97 9B 9F A3 A5 A9 AB
+ AD AF B1 B5 B9 BB BD BF C3 C5 C7 C9 CB CD CF D1
+</map>
+</collation>
+
+
+<collation name="cp1251_cs_as">
+<!--
+# Case insensitive, accent sensitive
+# Sort order is correct for Belarusian, Bulgarian, Macedonian,
+# Russian, Serbian, Mongolian languages. Almost good for Ukrainian,
+# except that "CYRILLIC LETTER SOFT SIGN" is not in the end of alphabet,
+# but between YERU and E.
+-->
+<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 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
+ 5F 61 63 65 67 69 6B 6D 6F 71 73 D3 D4 D5 D6 D7
+ D8 42 44 46 48 4A 4C 4E 50 52 54 56 58 5A 5C 5E
+ 60 62 64 66 68 6A 6C 6E 70 72 74 D9 DA DB DC DD
+ 81 83 DE 84 DF E0 E1 E2 E3 E4 A1 E5 A7 9D B3 C1
+ 82 E6 E7 E8 E9 EA EB EC ED EE A2 EF A8 9E B4 C2
+ F0 B7 B8 99 F1 7D F2 F3 87 F4 89 F5 F6 F7 F8 95
+ F9 FA 93 94 7E FB FC FD 88 FE 8A FF 9A 8F 90 96
+ 75 77 79 7B 7F 85 8B 8D 91 97 9B 9F A3 A5 A9 AB
+ AD AF B1 B5 B9 BB BD BF C3 C5 C7 C9 CB CD CF D1
+ 76 78 7A 7C 80 86 8C 8E 92 98 9C A0 A4 A6 AA AC
+ AE B0 B2 B6 BA BC BE C0 C4 C6 C8 CA CC CE D0 D2
+</map>
+</collation>
+
+
+<collation name="win1251ukr">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 20 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4
+ B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 C4
+ C5 C6 C7 C8 C9 84 CA CB 88 CC 87 CD CE CF D0 8D
+ D1 D2 8C 8C 84 D3 D4 D5 88 D6 87 D7 D8 D9 DA 8D
+ 80 81 82 83 85 86 89 8A 8B 8E 8F 90 91 92 93 94
+ 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2 A3 A4
+ 80 81 82 83 85 86 89 8A 8B 8E 8F 90 91 92 93 94
+ 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2 A3 A4
+</map>
+</collation>
+
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/cp1251bin.conf b/sql/share/charsets/cp1251bin.conf
deleted file mode 100644
index 4c17fee5934..00000000000
--- a/sql/share/charsets/cp1251bin.conf
+++ /dev/null
@@ -1,95 +0,0 @@
-#
-# cp1251
-# Binary sort order
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 01 01 00 02 00 00 00 00 00 00 01 00 01 01 01 01
- 02 00 00 00 00 00 00 00 00 00 02 00 02 02 02 02
- 00 01 02 01 00 01 00 00 01 00 01 00 00 00 00 01
- 00 00 01 02 02 00 00 00 02 00 02 00 02 01 02 02
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 90 83 82 83 84 85 86 87 88 89 9A 8B 9C 9D 9E 9F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A2 A2 BC A4 B4 A6 A7 B8 A9 BA AB AC AD AE BF
- B0 B1 B3 B3 B4 B5 B6 B7 B8 B9 BA BB BC BE BE BF
- 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
- 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
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 81 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 80 91 92 93 94 95 96 97 98 99 8A 9B 8C 9D 8E 8F
- A0 A1 A1 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B2 A5 B5 B6 B7 A8 B9 AA BB A3 BD BD AF
- 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
- 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
-
-# sort_order array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 0402 0403 201A 0453 201E 2026 2020 2021 0000 2030 0409 2039 040A 040C 040B 040F
- 0452 2018 2019 201C 201D 2022 2013 2014 0000 2122 0459 203A 045A 045C 045B 045F
- 00A0 040E 045E 0408 00A4 0490 00A6 00A7 0401 00A9 0404 00AB 00AC 00AD 00AE 0407
- 00B0 00B1 0406 0456 0491 00B5 00B6 00B7 0451 2116 0454 00BB 0458 0405 0455 0457
- 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 041A 041B 041C 041D 041E 041F
- 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F
- 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 043A 043B 043C 043D 043E 043F
- 0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F
-
diff --git a/sql/share/charsets/cp1251csas.conf b/sql/share/charsets/cp1251csas.conf
deleted file mode 100644
index b6b2f853ea9..00000000000
--- a/sql/share/charsets/cp1251csas.conf
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# cp1251
-# Case sensitive, accent sensitive
-# Sort order is correct for Belarusian, Bulgarian, Macedonian,
-# Russian, Serbian, Mongolian languages. Almost good for Ukrainian,
-# except that "CYRILLIC LETTER SOFT SIGN" is not in the end of alphabet,
-# but between YERU and E.
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 01 01 00 02 00 00 00 00 00 00 01 00 01 01 01 01
- 02 00 00 00 00 00 00 00 00 00 02 00 02 02 02 02
- 00 01 02 01 00 01 00 00 01 00 01 00 00 00 00 01
- 00 00 01 02 02 00 00 00 02 00 02 00 02 01 02 02
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 90 83 82 83 84 85 86 87 88 89 9A 8B 9C 9D 9E 9F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A2 A2 BC A4 B4 A6 A7 B8 A9 BA AB AC AD AE BF
- B0 B1 B3 B3 B4 B5 B6 B7 B8 B9 BA BB BC BE BE BF
- 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
- 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
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 81 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 80 91 92 93 94 95 96 97 98 99 8A 9B 8C 9D 8E 8F
- A0 A1 A1 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B2 A5 B5 B6 B7 A8 B9 AA BB A3 BD BD AF
- 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
- 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
-
-# sort_order array (must be 256 elements)
- 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 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
- 5F 61 63 65 67 69 6B 6D 6F 71 73 D3 D4 D5 D6 D7
- D8 42 44 46 48 4A 4C 4E 50 52 54 56 58 5A 5C 5E
- 60 62 64 66 68 6A 6C 6E 70 72 74 D9 DA DB DC DD
- 81 83 DE 84 DF E0 E1 E2 E3 E4 A1 E5 A7 9D B3 C1
- 82 E6 E7 E8 E9 EA EB EC ED EE A2 EF A8 9E B4 C2
- F0 B7 B8 99 F1 7D F2 F3 87 F4 89 F5 F6 F7 F8 95
- F9 FA 93 94 7E FB FC FD 88 FE 8A FF 9A 8F 90 96
- 75 77 79 7B 7F 85 8B 8D 91 97 9B 9F A3 A5 A9 AB
- AD AF B1 B5 B9 BB BD BF C3 C5 C7 C9 CB CD CF D1
- 76 78 7A 7C 80 86 8C 8E 92 98 9C A0 A4 A6 AA AC
- AE B0 B2 B6 BA BC BE C0 C4 C6 C8 CA CC CE D0 D2
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 0402 0403 201A 0453 201E 2026 2020 2021 0000 2030 0409 2039 040A 040C 040B 040F
- 0452 2018 2019 201C 201D 2022 2013 2014 0000 2122 0459 203A 045A 045C 045B 045F
- 00A0 040E 045E 0408 00A4 0490 00A6 00A7 0401 00A9 0404 00AB 00AC 00AD 00AE 0407
- 00B0 00B1 0406 0456 0491 00B5 00B6 00B7 0451 2116 0454 00BB 0458 0405 0455 0457
- 0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 041A 041B 041C 041D 041E 041F
- 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F
- 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 043A 043B 043C 043D 043E 043F
- 0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F
-
diff --git a/sql/share/charsets/cp1256.conf b/sql/share/charsets/cp1256.xml
index 6072551813c..4947839a728 100644
--- a/sql/share/charsets/cp1256.conf
+++ b/sql/share/charsets/cp1256.xml
@@ -1,7 +1,13 @@
-#
-# Arabic, Persian, Pakistani, Urdu
-#
-# ctype array (must be 257 elements)
+<?xml version='1.0' encoding="utf-8"?>
+
+<!-- Arabic, Persian, Pakistani, Urdu -->
+
+<charsets>
+
+<charset name="">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -19,8 +25,12 @@
03 03 03 03 03 03 03 00 03 03 03 03 03 03 03 03
02 03 02 03 03 03 03 02 02 02 02 02 03 03 02 02
03 03 03 03 02 03 03 00 03 02 03 02 02 00 00 00
+</map>
+</ctype>
+
-# to_lower array (must be 256 elements)
+<lower>
+<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
@@ -37,8 +47,12 @@
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
+</map>
+</lower>
+
-# to_upper array (must be 256 elements)
+<upper>
+<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
@@ -55,26 +69,12 @@
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
+</map>
+</upper>
-# sort_order array (must be 256 elements)
- 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 45 47 4A 4C 52 55 57 59 5D 5F 61 63 65 67
- 6C 6E 70 72 74 76 7B 7D 7F 81 83 B9 BA BB BC BD
- BE 41 45 47 4A 4C 52 55 57 59 5D 5F 61 63 65 67
- 6C 6E 70 72 74 76 7B 7D 7F 81 83 BF C0 C1 C2 C3
- C4 8E C5 54 C6 C7 C8 C9 CA CB CC CD 6A 92 99 CE
- A5 CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 6A DA DB DC
- DD B6 DE DF E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB
- EC ED EE EF F0 F1 F2 F3 F4 F5 B7 F6 F7 F8 F9 B8
- FA 85 86 87 88 89 8A 8B 8C 8D 9F 90 91 93 94 95
- 96 97 98 9A 9B 9C 9D FB 9E 9F A0 A1 AD A2 A3 A4
- 43 A6 44 A7 A8 A9 AA 49 4E 4F 50 51 AB AC 5B 5C
- AE AF B0 B1 69 B2 B3 FC B4 78 B5 79 7A FD FE FF
-# Unicode mapping (must be 256 elements)
+<unicode>
+<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
@@ -91,4 +91,33 @@
0630 0631 0632 0633 0634 0635 0636 00D7 0637 0638 0639 063A 0640 0641 0642 0643
00E0 0644 00E2 0645 0646 0647 0648 00E7 00E8 00E9 00EA 00EB 0649 064A 00EE 00EF
064B 064C 064D 064E 00F4 064F 0650 00F7 0651 00F9 0652 00FB 00FC 200E 200F 0000
+</map>
+</unicode>
+
+
+<collation name="cp1256">
+<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 45 47 4A 4C 52 55 57 59 5D 5F 61 63 65 67
+ 6C 6E 70 72 74 76 7B 7D 7F 81 83 B9 BA BB BC BD
+ BE 41 45 47 4A 4C 52 55 57 59 5D 5F 61 63 65 67
+ 6C 6E 70 72 74 76 7B 7D 7F 81 83 BF C0 C1 C2 C3
+ C4 8E C5 54 C6 C7 C8 C9 CA CB CC CD 6A 92 99 CE
+ A5 CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 6A DA DB DC
+ DD B6 DE DF E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB
+ EC ED EE EF F0 F1 F2 F3 F4 F5 B7 F6 F7 F8 F9 B8
+ FA 85 86 87 88 89 8A 8B 8C 8D 9F 90 91 93 94 95
+ 96 97 98 9A 9B 9C 9D FB 9E 9F A0 A1 AD A2 A3 A4
+ 43 A6 44 A7 A8 A9 AA 49 4E 4F 50 51 AB AC 5B 5C
+ AE AF B0 B1 69 B2 B3 FC B4 78 B5 79 7A FD FE FF
+</map>
+</collation>
+
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/cp1257.conf b/sql/share/charsets/cp1257.conf
deleted file mode 100644
index 8338f99c83b..00000000000
--- a/sql/share/charsets/cp1257.conf
+++ /dev/null
@@ -1,92 +0,0 @@
-# Configuration file for the cp1257 character set.
-
-# The ctype array must have 257 elements.
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 01 01 00 00 00 00 01 00 01 00 00 01 00 00 00 00
- 01 00 00 00 00 00 00 00 01 00 00 01 00 00 01 00
- 02 02 00 00 00 00 02 00 02 00 00 02 00 00 00 00
- 02 00 00 00 00 00 00 00 02 00 00 02 00 00 02 00
-
-# The to_lower array must have 256 elements.
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 C2 C3 C4 C5 E6 C7 E8 C9 CA EB CC CD CE CF
- F0 D1 D2 D3 D4 D5 D6 D7 F8 D9 DA FB DC DD FE 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
-
-# The to_upper array must have 256 elements.
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
- C0 C1 E2 E3 E4 E5 C6 E7 C8 E9 EA CB EC ED EE EF
- D0 F1 F2 F3 F4 F5 F6 F7 D8 F9 FA DB FC FD DE FF
-
-# The sort_order array must have 256 elements.
- 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 43 44 46 47 4A 4B 4C 4D 50 51 52 53 54 55
- 56 57 58 59 5B 5C 5F 60 61 4E FF 62 63 64 65 66
- 67 41 43 44 46 47 4A 4B 4C 4D 50 51 52 53 54 55
- 56 57 58 59 5B 5C 5F 60 61 4E FF 68 69 6A 6B FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- 42 4F FF FF FF FF 48 FF 45 FF FF 49 FF FF FF FF
- 5A FF FF FF FF FF FF FF 5E FF FF 5D FF FF FF FF
- FF 4F FF FF FF FF 48 FF 45 FF FF 49 FF FF FF FF
- 5A FF FF FF FF FF FF FF 5E FF FF 5D FF FF FF FF
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-20AC 0000 201A 0000 201E 2026 2020 2021 0000 2030 0000 2039 0000 00A8 02C7 00B8
-0000 2018 2019 201C 201D 2022 2013 2014 0000 2122 0000 203A 0000 00AF 02DB 0000
-00A0 0000 00A2 00A3 00A4 0000 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
-00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
-0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
-0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
-0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
-0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 02D9
diff --git a/sql/share/charsets/cp1257.xml b/sql/share/charsets/cp1257.xml
new file mode 100644
index 00000000000..5ac2b746ff9
--- /dev/null
+++ b/sql/share/charsets/cp1257.xml
@@ -0,0 +1,229 @@
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="cp1257">
+
+<ctype>
+<map>
+ 00
+ 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
+ 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
+ 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 01
+ 00 00 00 00 00 00 00 00 02 00 02 00 00 00 00 02
+ 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 00 01 01 01 01 01 01 01 02
+ 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 00 02 02 02 02 02 02 02 00
+</map>
+</ctype>
+
+
+<lower>
+<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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 BA AB AC AD AE BF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
+ F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
+</map>
+</lower>
+
+
+<upper>
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 BA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 BA BB BC BD BE AF
+ 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
+ C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
+ D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
+</map>
+</upper>
+
+
+<unicode>
+<map>
+ 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
+ 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
+ 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
+ 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
+ 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
+ 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
+ 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
+ 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
+ 20AC 0000 201A 0000 201E 2026 2020 2021 0000 2030 0000 2039 0000 00A8 02C7 00B8
+ 0000 2018 2019 201C 201D 2022 2013 2014 0000 2122 0000 203A 0000 00AF 02DB 0000
+ 00A0 0000 00A2 00A3 00A4 0000 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
+ 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
+ 0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
+ 0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
+ 0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
+ 0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 02D9
+</map>
+</unicode>
+
+
+<collation name="cp1257">
+<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 43 44 46 47 4A 4B 4C 4D 50 51 52 53 54 55
+ 56 57 58 59 5B 5C 5F 60 61 4E FF 62 63 64 65 66
+ 67 41 43 44 46 47 4A 4B 4C 4D 50 51 52 53 54 55
+ 56 57 58 59 5B 5C 5F 60 61 4E FF 68 69 6A 6B FF
+ FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+ FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+ FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+ FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+ 42 4F FF FF FF FF 48 FF 45 FF FF 49 FF FF FF FF
+ 5A FF FF FF FF FF FF FF 5E FF FF 5D FF FF FF FF
+ FF 4F FF FF FF FF 48 FF 45 FF FF 49 FF FF FF FF
+ 5A FF FF FF FF FF FF FF 5E FF FF 5D FF FF FF FF
+</map>
+</collation>
+
+
+<collation name="cp1257_bin">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+</map>
+</collation>
+
+
+<collation name="cp1257_ci_ai">
+<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 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
+ 8F 91 93 97 9E A0 A8 AA AC AE B0 B8 B9 BA BB BC
+ BD 41 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
+ 8F 91 93 97 9E A0 A8 AA AC AE B0 BE BF C0 C1 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 83 ED 93 EE EF F0 F1 41
+ F2 F3 F4 F5 F6 F7 F8 F9 83 FA 93 FB FC FD FE 41
+ 41 69 41 4F 41 41 57 57 4F 57 B0 57 63 71 69 75
+ 97 7D 7D 83 83 83 83 C2 A0 75 97 A0 A0 B0 B0 97
+ 41 69 41 4F 41 41 57 57 4F 57 B0 57 63 71 69 75
+ 97 7D 7D 83 83 83 83 C3 A0 75 97 A0 A0 B0 B0 FF
+</map>
+</collation>
+
+
+<collation name="cp1257_ci_as">
+<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 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
+ 8F 91 93 97 9E A0 A8 AA AC AE B0 B8 B9 BA BB BC
+ BD 41 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
+ 8F 91 93 97 9E A0 A8 AA AC AE B0 BE BF C0 C1 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 85 ED 95 EE EF F0 F1 4B
+ F2 F3 F4 F5 F6 F7 F8 F9 85 FA 95 FB FC FD FE 4B
+ 43 6B 45 51 47 49 59 5B 53 5D B2 5F 65 73 6D 77
+ 99 7F 81 87 89 8B 8D C2 A2 79 9B A4 A6 B4 B6 9D
+ 43 6B 45 51 47 49 59 5B 53 5D B2 5F 65 73 6D 77
+ 99 7F 81 87 89 8B 8D C3 A2 79 9B A4 A6 B4 B6 FF
+</map>
+</collation>
+
+
+<collation name="cp1257_cs_as">
+<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 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
+ 8F 91 93 97 9E A0 A8 AA AC AE B0 B8 B9 BA BB BC
+ BD 42 4E 50 56 58 62 64 68 6A 70 72 76 7C 7E 84
+ 90 92 94 98 9F A1 A9 AB AD AF B1 BE BF C0 C1 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 85 ED 95 EE EF F0 F1 4B
+ F2 F3 F4 F5 F6 F7 F8 F9 86 FA 96 FB FC FD FE 4C
+ 43 6B 45 51 47 49 59 5B 53 5D B2 5F 65 73 6D 77
+ 99 7F 81 87 89 8B 8D C2 A2 79 9B A4 A6 B4 B6 9D
+ 44 6C 46 52 48 4A 5A 5C 54 5E B3 60 66 74 6E 78
+ 9A 80 82 88 8A 8C 8E C3 A3 7A 9C A5 A7 B5 B7 FF
+</map>
+</collation>
+
+
+<collation name="cp1257ltlv">
+<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 47 49 4D 4F 57 59 5D 5F 65 67 6B 6F 71 75
+ 79 7B 7D 81 85 87 8D 8F 91 93 95 FF FF FF FF FF
+ FF 42 48 4A 4E 50 58 5A 5E 60 66 68 6C 70 72 76
+ 7A 7C 7E 82 86 88 8E 90 92 94 96 FF FF FF FF FF
+ FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+ FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+ FF FF FF FF FF FF FF FF FF FF 7F FF FF FF FF FF
+ FF FF FF FF FF FF FF FF FF FF 80 FF FF FF FF FF
+ 45 63 43 FF FF FF 53 51 4B FF FF 55 5B 69 61 6D
+ 83 FF 73 FF 77 FF FF FF 8B FF FF 89 FF 99 97 FF
+ 46 64 44 FF FF FF 54 52 4C FF FF 56 5C 6A 62 6E
+ 84 FF 74 FF 78 FF FF FF 8C FF FF 8A FF 9A 98 FF
+</map>
+</collation>
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/cp1257ltlvciai.conf b/sql/share/charsets/cp1257ltlvciai.conf
deleted file mode 100644
index 246ae4d1fe8..00000000000
--- a/sql/share/charsets/cp1257ltlvciai.conf
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# cp1257 character set
-#
-# Case-insensitive, accent insensitive sorting order
-# For Latvian and Lithuanian languages
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 01
- 00 00 00 00 00 00 00 00 02 00 02 00 00 00 00 02
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 00 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 00 02 02 02 02 02 02 02 00
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 BA AB AC AD AE BF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 BA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 BA BB BC BD BE AF
- 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# sort_order array (must be 256 elements)
- 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 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
- 8F 91 93 97 9E A0 A8 AA AC AE B0 B8 B9 BA BB BC
- BD 41 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
- 8F 91 93 97 9E A0 A8 AA AC AE B0 BE BF C0 C1 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 83 ED 93 EE EF F0 F1 41
- F2 F3 F4 F5 F6 F7 F8 F9 83 FA 93 FB FC FD FE 41
- 41 69 41 4F 41 41 57 57 4F 57 B0 57 63 71 69 75
- 97 7D 7D 83 83 83 83 C2 A0 75 97 A0 A0 B0 B0 97
- 41 69 41 4F 41 41 57 57 4F 57 B0 57 63 71 69 75
- 97 7D 7D 83 83 83 83 C3 A0 75 97 A0 A0 B0 B0 FF
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 20AC 0000 201A 0000 201E 2026 2020 2021 0000 2030 0000 2039 0000 00A8 02C7 00B8
- 0000 2018 2019 201C 201D 2022 2013 2014 0000 2122 0000 203A 0000 00AF 02DB 0000
- 00A0 0000 00A2 00A3 00A4 0000 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
- 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
- 0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
- 0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
- 0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
- 0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 02D9
-
diff --git a/sql/share/charsets/cp1257ltlvcias.conf b/sql/share/charsets/cp1257ltlvcias.conf
deleted file mode 100644
index 6e49f5a245d..00000000000
--- a/sql/share/charsets/cp1257ltlvcias.conf
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# cp1257 character set
-#
-# Case-insensitive, accent sensitive sorting order
-# For Latvian and Lithuanian languages
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 01
- 00 00 00 00 00 00 00 00 02 00 02 00 00 00 00 02
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 00 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 00 02 02 02 02 02 02 02 00
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 BA AB AC AD AE BF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 BA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 BA BB BC BD BE AF
- 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# sort_order array (must be 256 elements)
- 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 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
- 8F 91 93 97 9E A0 A8 AA AC AE B0 B8 B9 BA BB BC
- BD 41 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
- 8F 91 93 97 9E A0 A8 AA AC AE B0 BE BF C0 C1 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 85 ED 95 EE EF F0 F1 4B
- F2 F3 F4 F5 F6 F7 F8 F9 85 FA 95 FB FC FD FE 4B
- 43 6B 45 51 47 49 59 5B 53 5D B2 5F 65 73 6D 77
- 99 7F 81 87 89 8B 8D C2 A2 79 9B A4 A6 B4 B6 9D
- 43 6B 45 51 47 49 59 5B 53 5D B2 5F 65 73 6D 77
- 99 7F 81 87 89 8B 8D C3 A2 79 9B A4 A6 B4 B6 FF
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 20AC 0000 201A 0000 201E 2026 2020 2021 0000 2030 0000 2039 0000 00A8 02C7 00B8
- 0000 2018 2019 201C 201D 2022 2013 2014 0000 2122 0000 203A 0000 00AF 02DB 0000
- 00A0 0000 00A2 00A3 00A4 0000 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
- 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
- 0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
- 0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
- 0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
- 0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 02D9
-
diff --git a/sql/share/charsets/cp1257ltlvcsas.conf b/sql/share/charsets/cp1257ltlvcsas.conf
deleted file mode 100644
index 32cd1390bd5..00000000000
--- a/sql/share/charsets/cp1257ltlvcsas.conf
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# cp1257 character set
-#
-# Case-sensitive, accent sensitive sorting order
-# For Latvian and Lithuanian languages
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 01
- 00 00 00 00 00 00 00 00 02 00 02 00 00 00 00 02
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 00 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 00 02 02 02 02 02 02 02 00
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 BA AB AC AD AE BF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 BA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 BA BB BC BD BE AF
- 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# sort_order array (must be 256 elements)
- 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 4D 4F 55 57 61 63 67 69 6F 71 75 7B 7D 83
- 8F 91 93 97 9E A0 A8 AA AC AE B0 B8 B9 BA BB BC
- BD 42 4E 50 56 58 62 64 68 6A 70 72 76 7C 7E 84
- 90 92 94 98 9F A1 A9 AB AD AF B1 BE BF C0 C1 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 85 ED 95 EE EF F0 F1 4B
- F2 F3 F4 F5 F6 F7 F8 F9 86 FA 96 FB FC FD FE 4C
- 43 6B 45 51 47 49 59 5B 53 5D B2 5F 65 73 6D 77
- 99 7F 81 87 89 8B 8D C2 A2 79 9B A4 A6 B4 B6 9D
- 44 6C 46 52 48 4A 5A 5C 54 5E B3 60 66 74 6E 78
- 9A 80 82 88 8A 8C 8E C3 A3 7A 9C A5 A7 B5 B7 FF
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 20AC 0000 201A 0000 201E 2026 2020 2021 0000 2030 0000 2039 0000 00A8 02C7 00B8
- 0000 2018 2019 201C 201D 2022 2013 2014 0000 2122 0000 203A 0000 00AF 02DB 0000
- 00A0 0000 00A2 00A3 00A4 0000 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
- 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
- 0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
- 0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
- 0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
- 0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 02D9
-
diff --git a/sql/share/charsets/cp866.conf b/sql/share/charsets/cp866.xml
index 0e4dcb3b9bc..2b050f3c993 100644
--- a/sql/share/charsets/cp866.conf
+++ b/sql/share/charsets/cp866.xml
@@ -1,9 +1,12 @@
-#
-# cp866_DOSCyrillicRussian
-# Case insensitive, accent sensitive.
-#
-#
-# ctype array (must be 257 elements)
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="cp866">
+<!-- cp866_DOSCyrillicRussian -->
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -21,8 +24,12 @@
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
01 02 01 02 01 02 01 02 00 00 00 00 00 00 00 48
+</map>
+</ctype>
-# to_lower array (must be 256 elements)
+
+<lower>
+<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
@@ -39,8 +46,12 @@
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
F1 F1 F3 F3 F5 F5 F7 F7 F8 F9 FA FB FC FD FE FF
+</map>
+</lower>
+
-# to_upper array (must be 256 elements)
+<upper>
+<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
@@ -57,26 +68,12 @@
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
F0 F0 F2 F2 F4 F4 F6 F6 F8 F9 FA FB FC FD FE FF
+</map>
+</upper>
-# sort_order array (must be 256 elements)
- 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 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
- 5F 61 63 65 67 69 6B 6D 6F 71 73 BD BE BF C0 C1
- C2 41 43 45 47 49 4B 4D 4F 51 54 55 57 59 5B 5D
- 5F 61 63 65 67 69 6B 6D 6F 71 73 C3 C4 C5 C6 C7
- 75 77 79 7B 7D 7F 85 87 89 8D 8F 91 93 95 97 99
- 9B 9D 9F A1 A5 A7 A9 AB AD AF B1 B3 B5 B7 B9 BB
- 75 77 79 7B 7D 7F 85 87 89 8D 8F 91 93 95 97 99
- C8 C9 CA 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
- 9B 9D 9F A1 A5 A7 A9 AB AD AF B1 B3 B5 B7 B9 BB
- 81 81 83 83 8B 8B A3 A3 CB CC CD CE CF D0 D1 D2
-# Unicode mapping (must be 256 elements)
+<unicode>
+<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
@@ -93,4 +90,33 @@
2568 2564 2565 2559 2558 2552 2553 256B 256A 2518 250C 2588 2584 258C 2590 2580
0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F
0401 0451 0404 0454 0407 0457 040E 045E 00B0 2219 00B7 221A 207F 00B2 25A0 00A0
+</map>
+</unicode>
+
+
+<collation name="cp866">
+<!-- Case insensitive, accent sensitive -->
+<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 43 45 47 49 4B 4D 4F 51 53 55 57 59 5B 5D
+ 5F 61 63 65 67 69 6B 6D 6F 71 73 BD BE BF C0 C1
+ C2 41 43 45 47 49 4B 4D 4F 51 54 55 57 59 5B 5D
+ 5F 61 63 65 67 69 6B 6D 6F 71 73 C3 C4 C5 C6 C7
+ 75 77 79 7B 7D 7F 85 87 89 8D 8F 91 93 95 97 99
+ 9B 9D 9F A1 A5 A7 A9 AB AD AF B1 B3 B5 B7 B9 BB
+ 75 77 79 7B 7D 7F 85 87 89 8D 8F 91 93 95 97 99
+ C8 C9 CA 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
+ 9B 9D 9F A1 A5 A7 A9 AB AD AF B1 B3 B5 B7 B9 BB
+ 81 81 83 83 8B 8B A3 A3 CB CC CD CE CF D0 D1 D2
+</map>
+</collation>
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/croat.conf b/sql/share/charsets/croat.conf
deleted file mode 100644
index bc8c1a376eb..00000000000
--- a/sql/share/charsets/croat.conf
+++ /dev/null
@@ -1,92 +0,0 @@
-# Configuration file for the croat character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00
- 00 00 00 00 00 00 00 00 00 02 00 00 00 02 00 00
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 9A 8B 8C 8D 9E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 8A 9B 9C 9D 8E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# sort_order array (must have 256 elements)
- 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 42 43 46 48 49 4A 4B 4C 4D 4E 4F 50 51 52
- 53 54 55 56 58 59 5A 5B 5C 5D 5E 5B 5C 5D 5E 5F
- 60 41 42 43 46 48 49 4A 4B 4C 4D 4E 4F 50 51 52
- 53 54 55 56 58 59 5A 5B 5C 5D 5E 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 57 8B 8C 8D 5F 8F
- 90 91 92 93 94 95 96 97 98 99 57 9B 9C 9D 5F 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- 41 41 41 41 5C 5B 45 43 44 45 45 45 49 49 49 49
- 47 4E 4F 4F 4F 4F 5D D7 D8 55 55 55 59 59 DE DF
- 41 41 41 41 5C 5B 45 43 44 45 45 45 49 49 49 49
- 47 4E 4F 4F 4F 4F 5D F7 D8 55 55 55 59 59 DE FF
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 0104 02D8 0141 00A4 013D 015A 00A7 00A8 0160 015E 0164 0179 00AD 017D 017B
-00B0 0105 02DB 0142 00B4 013E 015B 02C7 00B8 0161 015F 0165 017A 02DD 017E 017C
-0154 00C1 00C2 0102 00C4 0139 0106 00C7 010C 00C9 0118 00CB 011A 00CD 00CE 010E
-0110 0143 0147 00D3 00D4 0150 00D6 00D7 0158 016E 00DA 0170 00DC 00DD 0162 00DF
-0155 00E1 00E2 0103 00E4 013A 0107 00E7 010D 00E9 0119 00EB 011B 00ED 00EE 010F
-0111 0144 0148 00F3 00F4 0151 00F6 00F7 0159 016F 00FA 0171 00FC 00FD 0163 02D9
diff --git a/sql/share/charsets/danish.conf b/sql/share/charsets/danish.conf
deleted file mode 100644
index 1543a64d7c3..00000000000
--- a/sql/share/charsets/danish.conf
+++ /dev/null
@@ -1,92 +0,0 @@
-# Configuration file for the danish character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- 41 41 41 41 5B 5D 5B 43 45 45 45 45 49 49 49 49
- 44 4E 4F 4F 4F 4F 5C D7 5C 55 55 55 59 59 DE DF
- 41 41 41 41 5B 5D 5B 43 45 45 45 45 49 49 49 49
- 44 4E 4F 4F 4F 4F 5C F7 5C 55 55 55 59 59 DE FF
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
-00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
-00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
-00D0 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 00DD 00DE 00DF
-00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
-00F0 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 00FD 00FE 00FF
diff --git a/sql/share/charsets/dec8.conf b/sql/share/charsets/dec8.xml
index d1ffe45032d..4e76bbffd14 100644
--- a/sql/share/charsets/dec8.conf
+++ b/sql/share/charsets/dec8.xml
@@ -1,6 +1,11 @@
-# Configuration file for the dec8 character set
+<?xml version='1.0' encoding="utf-8"?>
-# ctype array (must have 257 elements)
+<charsets>
+
+<charset name="dec8">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -18,8 +23,12 @@
01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
+</map>
+</ctype>
+
-# to_lower array (must have 256 elements)
+<lower>
+<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
@@ -36,8 +45,12 @@
F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
+</map>
+</lower>
-# to_upper array (must have 256 elements)
+
+<upper>
+<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
@@ -54,26 +67,12 @@
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
+</map>
+</upper>
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
- 44 4E 4F 4F 4F 4F 5D D7 D8 55 55 55 59 59 DE DF
- 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
- 44 4E 4F 4F 4F 4F 5D F7 D8 55 55 55 59 59 DE FF
-# Unicode mapping (256 elements)
+<unicode>
+<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
@@ -90,3 +89,33 @@
0000 00D1 00D2 00D3 00D4 00D5 00D6 0152 00D8 00D9 00DA 00DB 00DC 0178 0000 00DF
00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
0000 00F1 00F2 00F3 00F4 00F5 00F6 0153 00F8 00F9 00FA 00FB 00FC 00FF 0000 0000
+</map>
+</unicode>
+
+
+<collation name="dec8">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
+ 44 4E 4F 4F 4F 4F 5D D7 D8 55 55 55 59 59 DE DF
+ 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
+ 44 4E 4F 4F 4F 4F 5D F7 D8 55 55 55 59 59 DE FF
+</map>
+</collation>
+
+
+</charset>
+
+
+</charsets>
diff --git a/sql/share/charsets/dos.conf b/sql/share/charsets/dos.conf
deleted file mode 100644
index 205202711b8..00000000000
--- a/sql/share/charsets/dos.conf
+++ /dev/null
@@ -1,93 +0,0 @@
-# Configuration file for the dos (aka cp437 DOSLatinUS) character set
-
-# ctype array (must have 257 elements)
- 00
- 20 30 30 30 30 30 30 20 20 28 28 28 28 28 30 30
- 30 30 30 30 30 30 30 30 30 30 20 30 30 30 30 30
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 30
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 01 01
- 01 02 01 02 02 02 02 02 02 01 01 10 10 10 10 10
- 02 02 02 02 02 01 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 20
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 87 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 84 86
- 82 91 91 93 94 95 96 97 98 94 81 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A4 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 9A 90 41 8E 41 8F 80 45 45 45 49 49 49 8E 8F
- 90 92 92 4F 99 4F 55 55 59 99 9A 9B 9C 9D 9E 9F
- 41 49 4F 55 A5 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 43 59 45 41 5C 41 5B 43 45 45 45 49 49 49 5C 5B
- 45 5C 5C 4F 5D 4F 55 55 59 5D 59 24 24 24 24 24
- 41 49 4F 55 4E 4E A6 A7 3F A9 AA AB AC 21 22 22
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-# Unicode mapping (256 elements)
-
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000a 000b 000c 000d 000e 000f
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001a 001b 001c 001d 001e 001f
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002a 002b 002c 002d 002e 002f
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003a 003b 003c 003d 003e 003f
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004a 004b 004c 004d 004e 004f
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005a 005b 005c 005d 005e 005f
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006a 006b 006c 006d 006e 006f
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007a 007b 007c 007d 007e 007f
-00c7 00fc 00e9 00e2 00e4 00e0 00e5 00e7 00ea 00eb 00e8 00ef 00ee 00ec 00c4 00c5
-00c9 00e6 00c6 00f4 00f6 00f2 00fb 00f9 00ff 00d6 00dc 00a2 00a3 00a5 20a7 0192
-00e1 00ed 00f3 00fa 00f1 00d1 00aa 00ba 00bf 2310 00ac 00bd 00bc 00a1 00ab 00bb
-2591 2592 2593 2502 2524 2561 2562 2556 2555 2563 2551 2557 255d 255c 255b 2510
-2514 2534 252c 251c 2500 253c 255e 255f 255a 2554 2569 2566 2560 2550 256c 2567
-2568 2564 2565 2559 2558 2552 2553 256b 256a 2518 250c 2588 2584 258c 2590 2580
-03b1 00df 0393 03c0 03a3 03c3 00b5 03c4 03a6 0398 03a9 03b4 221e 03c6 03b5 2229
-2261 00b1 2265 2264 2320 2321 00f7 2248 00b0 2219 00b7 221a 207f 00b2 25a0 00a0
diff --git a/sql/share/charsets/estonia.conf b/sql/share/charsets/estonia.conf
deleted file mode 100644
index 0226fd1fe82..00000000000
--- a/sql/share/charsets/estonia.conf
+++ /dev/null
@@ -1,92 +0,0 @@
-# Configuration file for the estonia character set.
-
-# The ctype array must have 257 elements.
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
-
-# The to_lower array must have 256 elements.
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 BA AB AC AD AE BF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# The to_upper array must have 256 elements.
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 AA BB BC BD BE AF
- 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# The sort_order array must have 256 elements.
- 00 02 03 04 05 06 07 08 09 2E 2F 30 31 32 0A 0B
- 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B
- 2C 33 34 35 36 37 38 27 39 3A 3B 5D 3C 28 3D 3E
- 76 7A 7C 7E 80 81 82 83 84 85 3F 40 5E 5F 60 41
- 42 86 90 92 98 9A A4 A6 AA AC B2 B4 B8 BE C0 C6
- CE D0 D2 D6 E5 E8 EE F0 FA FC DD 43 44 45 46 47
- 48 87 91 93 99 9B A5 A7 AB AD B3 B5 B9 BF C1 C7
- CF D1 D3 D7 E6 E9 EF F1 FB FD DE 49 4A 4B 4C 1C
- 01 1D 57 1E 5A 74 71 72 1F 75 20 5B 21 4E 52 51
- 22 55 56 58 59 73 2A 2B 23 E7 24 5C 25 4F 54 26
- 2D FE 66 67 68 FF 4D 69 CC 6A D4 62 6B 29 6C 8E
- 6D 61 7D 7F 50 6E 6F 70 CD 7B D5 63 77 78 79 8F
- 8C B0 88 94 F4 8A A2 A0 96 9C DF 9E A8 B6 AE BA
- DB C2 C4 C8 CA F2 F6 64 EC BC D8 EA F8 E1 E3 DA
- 8D B1 89 95 F5 8B A3 A1 97 9D E0 9F A9 B7 AF BB
- DC C3 C5 C9 CB F3 F7 65 ED BD D9 EB F9 E2 E4 53
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 201D 00A2 00A3 00A4 201E 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
-00B0 00B1 00B2 00B3 201C 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
-0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
-0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
-0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
-0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 2019
diff --git a/sql/share/charsets/german1.conf b/sql/share/charsets/german1.conf
deleted file mode 100644
index 64f27da3499..00000000000
--- a/sql/share/charsets/german1.conf
+++ /dev/null
@@ -1,92 +0,0 @@
-# Configuration file for the german1 character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- 41 41 41 41 41 41 41 43 45 45 45 45 49 49 49 49
- D0 4E 4F 4F 4F 4F 4F D7 4F 55 55 55 55 59 DE 53
- 41 41 41 41 41 41 41 43 45 45 45 45 49 49 49 49
- D0 4E 4F 4F 4F 4F 4F F7 4F 55 55 55 55 59 DE FF
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
-00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
-00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
-00D0 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 00DD 00DE 00DF
-00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
-00F0 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 00FD 00FE 00FF
diff --git a/sql/share/charsets/greek.conf b/sql/share/charsets/greek.conf
deleted file mode 100644
index 5eb38e2efbe..00000000000
--- a/sql/share/charsets/greek.conf
+++ /dev/null
@@ -1,93 +0,0 @@
-# Configuration file for the greek character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 48 10 10 10 00 00 10 10 10 10 00 10 10 10 00 10
- 10 10 10 10 10 10 01 10 01 01 01 10 01 10 01 01
- 02 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 00 01 01 01 01 01 01 01 01 01 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 DC B7 DD DE DF BB FC BD FD FE
- C0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 D2 F3 F4 F5 F6 F7 F8 F9 FA FB 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- DA 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 C1 C5 C7 C9
- DB C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D3 D3 D4 D5 D6 D7 D8 D9 DA DB CF D5 D9 FF
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 C1 B7 C5 C7 C9 BB CF BD D5 D9
- C9 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 C9 D5 C1 C5 C7 C9
- D5 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D3 D3 D4 D5 D6 D7 D8 D9 C9 D5 CF D5 D9 FF
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 02BD 02BC 00A3 0000 0000 00A6 00A7 00A8 00A9 0000 00AB 00AC 00AD 0000 2015
-00B0 00B1 00B2 00B3 0384 0385 0386 00B7 0388 0389 038A 00BB 038C 00BD 038E 038F
-0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 039A 039B 039C 039D 039E 039F
-03A0 03A1 0000 03A3 03A4 03A5 03A6 03A7 03A8 03A9 03AA 03AB 03AC 03AD 03AE 03AF
-03B0 03B1 03B2 03B3 03B4 03B5 03B6 03B7 03B8 03B9 03BA 03BB 03BC 03BD 03BE 03BF
-03C0 03C1 03C2 03C3 03C4 03C5 03C6 03C7 03C8 03C9 03CA 03CB 03CC 03CD 03CE 0000
- \ No newline at end of file
diff --git a/sql/share/charsets/greek.xml b/sql/share/charsets/greek.xml
new file mode 100644
index 00000000000..eeb22236675
--- /dev/null
+++ b/sql/share/charsets/greek.xml
@@ -0,0 +1,120 @@
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="greek">
+
+<ctype>
+<map>
+ 00
+ 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
+ 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
+ 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 48 10 10 10 00 00 10 10 10 10 00 10 10 10 00 10
+ 10 10 10 10 10 10 01 10 01 01 01 10 01 10 01 01
+ 02 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+ 01 01 00 01 01 01 01 01 01 01 01 01 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00
+ </map>
+</ctype>
+
+
+<lower>
+<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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 DC B7 DD DE DF BB FC BD FD FE
+ C0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
+ F0 F1 D2 F3 F4 F5 F6 F7 F8 F9 FA FB 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
+</map>
+</lower>
+
+
+<upper>
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ DA 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 C1 C5 C7 C9
+ DB C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
+ D0 D1 D3 D3 D4 D5 D6 D7 D8 D9 DA DB CF D5 D9 FF
+</map>
+</upper>
+
+
+<unicode>
+<map>
+0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
+0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
+0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
+0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
+0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
+0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
+0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
+0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
+0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
+0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
+00A0 02BD 02BC 00A3 0000 0000 00A6 00A7 00A8 00A9 0000 00AB 00AC 00AD 0000 2015
+00B0 00B1 00B2 00B3 0384 0385 0386 00B7 0388 0389 038A 00BB 038C 00BD 038E 038F
+0390 0391 0392 0393 0394 0395 0396 0397 0398 0399 039A 039B 039C 039D 039E 039F
+03A0 03A1 0000 03A3 03A4 03A5 03A6 03A7 03A8 03A9 03AA 03AB 03AC 03AD 03AE 03AF
+03B0 03B1 03B2 03B3 03B4 03B5 03B6 03B7 03B8 03B9 03BA 03BB 03BC 03BD 03BE 03BF
+03C0 03C1 03C2 03C3 03C4 03C5 03C6 03C7 03C8 03C9 03CA 03CB 03CC 03CD 03CE 0000
+</map>
+</unicode>
+
+
+<collation name="greek">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 C1 B7 C5 C7 C9 BB CF BD D5 D9
+ C9 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 C9 D5 C1 C5 C7 C9
+ D5 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
+ D0 D1 D3 D3 D4 D5 D6 D7 D8 D9 C9 D5 CF D5 D9 FF
+</map>
+</collation>
+
+</charset>
+
+</charsets>
+
diff --git a/sql/share/charsets/hebrew.conf b/sql/share/charsets/hebrew.conf
deleted file mode 100644
index 84581f6f1bb..00000000000
--- a/sql/share/charsets/hebrew.conf
+++ /dev/null
@@ -1,93 +0,0 @@
-# Configuration file for the hebrew character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 00 00 00 00 00
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
- 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
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 0000 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00D7 00AB 00AC 00AD 00AE 203E
-00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00F7 00BB 00BC 00BD 00BE 0000
-0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 2017
-05D0 05D1 05D2 05D3 05D4 05D5 05D6 05D7 05D8 05D9 05DA 05DB 05DC 05DD 05DE 05DF
-05E0 05E1 05E2 05E3 05E4 05E5 05E6 05E7 05E8 05E9 05EA 0000 0000 0000 0000 0000
- \ No newline at end of file
diff --git a/sql/share/charsets/latin1bin.conf b/sql/share/charsets/hebrew.xml
index 37e6350bcb2..3bf8bec370e 100644
--- a/sql/share/charsets/latin1bin.conf
+++ b/sql/share/charsets/hebrew.xml
@@ -1,9 +1,11 @@
-#
-# Latin1, accent sensitive, case sensitive
-#
-# Binary sorting order
-#
-# ctype array (must be 257 elements)
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="hebrew">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -13,16 +15,20 @@
01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 00 01 01 01 01 01 01 01 02
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 00 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 00 00 00 00 00
+ </map>
+</ctype>
+
-# to_lower array (must be 256 elements)
+<lower>
+<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
@@ -35,12 +41,16 @@
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF
+ 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
+</map>
+</lower>
+
-# to_upper array (must be 256 elements)
+<upper>
+<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
@@ -55,42 +65,56 @@
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
+ 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
+</map>
+</upper>
+
-# sort_order array (must be 256 elements)
+<unicode>
+<map>
+0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
+0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
+0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
+0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
+0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
+0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
+0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
+0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
+0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
+0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
+00A0 0000 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00D7 00AB 00AC 00AD 00AE 203E
+00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00F7 00BB 00BC 00BD 00BE 0000
+0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 2017
+05D0 05D1 05D2 05D3 05D4 05D5 05D6 05D7 05D8 05D9 05DA 05DB 05DC 05DD 05DE 05DF
+05E0 05E1 05E2 05E3 05E4 05E5 05E6 05E7 05E8 05E9 05EA 0000 0000 0000 0000 0000
+</map>
+</unicode>
+
+
+<collation name="hebrew">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+ D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
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
+</map>
+</collation>
+
+</charset>
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
- 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
- 00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
- 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
- 00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
- 00D0 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 00DD 00DE 00DF
- 00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
- 00F0 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 00FD 00FE 00FF
+</charsets>
diff --git a/sql/share/charsets/hp8.conf b/sql/share/charsets/hp8.conf
deleted file mode 100644
index 07036d6f186..00000000000
--- a/sql/share/charsets/hp8.conf
+++ /dev/null
@@ -1,93 +0,0 @@
-# Configuration file for the hp8 character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 20 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 20 20 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 02 10 10 10 10 10 10 02 10 02 02
- 01 10 10 01 02 10 10 02 01 10 01 01 01 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 20 20 20 20 10 10 10 10 10 10 10 10 10 20
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 C8 C0 C9 C1 CD D1 DD A8 A9 AA AB AC CB C3 AF
- B0 B2 B2 B3 B5 B5 B7 B7 B8 B9 BA BB BC BD BE BF
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D4 D1 D6 D7 D4 D5 D6 D7 CC D9 CE CF C5 DD DE C2
- C4 E2 E2 E4 E4 D5 D9 C6 CA EA EA EC EC C7 EF EF
- F1 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B1 B3 B4 B4 B6 B6 B8 B9 BA BB BC BD BE BF
- A2 A4 DF AE E0 DC E7 ED A1 A3 E8 AD D8 A5 DA DB
- D0 A6 D2 D3 D0 E5 D2 D3 D8 E6 DA DB DC A7 DE DF
- E0 E1 E1 E3 E3 E5 E6 E7 E8 E9 E9 EB EB ED EE EE
- F0 F0 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5C 5D 5B 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 00C0 00C2 00C8 00CA 00CB 00CE 00CF 00B4 02CB 02C6 00A8 02DC 00D9 00DB 20A4
-00AF 00DD 00FD 00B0 00C7 00E7 00D1 00F1 00A1 00BF 00A4 00A3 00A5 00A7 0192 00A2
-00E2 00EA 00F4 00FB 00E1 00E9 00F3 00FA 00E0 00E8 00F2 00F9 00E4 00EB 00F6 00FC
-00C5 00EE 00D8 00C6 00E5 00ED 00F8 00E6 00C4 00EC 00D6 00DC 00C9 00EF 00DF 00D4
-00C1 00C3 00E3 00D0 00F0 00CD 00CC 00D3 00D2 00D5 00F5 0160 0161 00DA 0178 00FF
-00DE 00FE 00B7 00B5 00B6 00BE 2014 00BC 00BD 00AA 00BA 00AB 25A0 00BB 00B1 0000
-
diff --git a/sql/share/charsets/hp8.xml b/sql/share/charsets/hp8.xml
new file mode 100644
index 00000000000..036f1cd067c
--- /dev/null
+++ b/sql/share/charsets/hp8.xml
@@ -0,0 +1,120 @@
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="hp8">
+
+<ctype>
+<map>
+ 00
+ 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
+ 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
+ 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 20 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 20 20 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 10 10 02 10 10 10 10 10 10 02 10 02 02
+ 01 10 10 01 02 10 10 02 01 10 01 01 01 10 10 10
+ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 20 20 20 20 10 10 10 10 10 10 10 10 10 20
+</map>
+</ctype>
+
+
+<lower>
+<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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 C8 C0 C9 C1 CD D1 DD A8 A9 AA AB AC CB C3 AF
+ B0 B2 B2 B3 B5 B5 B7 B7 B8 B9 BA BB BC BD BE BF
+ C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
+ D4 D1 D6 D7 D4 D5 D6 D7 CC D9 CE CF C5 DD DE C2
+ C4 E2 E2 E4 E4 D5 D9 C6 CA EA EA EC EC C7 EF EF
+ F1 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
+</map>
+</lower>
+
+
+<upper>
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B1 B3 B4 B4 B6 B6 B8 B9 BA BB BC BD BE BF
+ A2 A4 DF AE E0 DC E7 ED A1 A3 E8 AD D8 A5 DA DB
+ D0 A6 D2 D3 D0 E5 D2 D3 D8 E6 DA DB DC A7 DE DF
+ E0 E1 E1 E3 E3 E5 E6 E7 E8 E9 E9 EB EB ED EE EE
+ F0 F0 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
+</map>
+</upper>
+
+
+<unicode>
+<map>
+0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
+0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
+0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
+0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
+0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
+0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
+0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
+0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
+0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
+0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
+00A0 00C0 00C2 00C8 00CA 00CB 00CE 00CF 00B4 02CB 02C6 00A8 02DC 00D9 00DB 20A4
+00AF 00DD 00FD 00B0 00C7 00E7 00D1 00F1 00A1 00BF 00A4 00A3 00A5 00A7 0192 00A2
+00E2 00EA 00F4 00FB 00E1 00E9 00F3 00FA 00E0 00E8 00F2 00F9 00E4 00EB 00F6 00FC
+00C5 00EE 00D8 00C6 00E5 00ED 00F8 00E6 00C4 00EC 00D6 00DC 00C9 00EF 00DF 00D4
+00C1 00C3 00E3 00D0 00F0 00CD 00CC 00D3 00D2 00D5 00F5 0160 0161 00DA 0178 00FF
+00DE 00FE 00B7 00B5 00B6 00BE 2014 00BC 00BD 00AA 00BA 00AB 25A0 00BB 00B1 0000
+
+</map>
+</unicode>
+
+
+<collation name="hp8">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5C 5D 5B 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+</map>
+</collation>
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/hungarian.conf b/sql/share/charsets/hungarian.conf
deleted file mode 100644
index dffaff9348d..00000000000
--- a/sql/share/charsets/hungarian.conf
+++ /dev/null
@@ -1,92 +0,0 @@
-# Configuration file for the hungarian character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 48
- 01 10 01 10 01 01 10 00 00 01 01 01 01 10 01 01
- 10 02 10 02 10 02 02 10 10 02 02 02 02 10 02 02
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 10 01 01 01 01 01 01 10 01 01 01 01 01 01 01 10
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 10
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8B 8B A1 A1 8E A0
- 82 91 92 93 94 A2 96 A3 96 94 81 9B 9C 9D 9E 9F
- A0 A1 A2 A3 B5 B6 A6 93 A8 B9 BA BB BC AD BE BF
- B0 B1 B2 B3 B4 E1 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- D0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF
- A2 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA 96 EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 9A 90 83 84 85 86 87 88 89 8A 8A 8C 8D 8E 8F
- 90 91 92 A7 99 95 98 97 98 99 9A 9B 9C 9D 9E 9F
- 8F 8D 95 97 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 A0 B2 A2 B4 B5 A5 B7 B8 A9 AA AB AC BD AE AF
- 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 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA EB CC CD CE CF
- F0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# sort_order array (must have 256 elements)
- 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 47 48 4C 4E 53 54 55 56 5A 5B 5C 60 61 64
- 69 6A 6B 6E 72 75 7A 7B 7C 7D 7F 83 84 85 86 87
- 88 41 47 48 4C 4E 53 54 55 56 5A 5B 5C 60 61 64
- 69 6A 6B 6E 72 75 7A 7B 7C 7D 7F 89 8A 8B 8C 00
- 01 78 4E 04 05 06 07 08 09 0A 67 67 56 56 0F 41
- 4E 12 13 67 67 64 78 75 78 67 78 1C 1D 1E 1F FF
- 41 56 64 75 5E 6F FF 67 FF 70 71 73 80 FF 81 82
- FF 42 FF 5D FF 41 6F FF FF 70 71 73 80 FF 81 82
- 6C 41 44 45 46 5F 49 4B 4A 4E 51 52 50 56 57 4D
- FF 62 63 64 66 67 67 FF 6D 77 75 78 78 7E 74 FF
- 64 41 44 45 46 5F 49 4B 4A 4E 51 78 50 56 58 4D
- FF 62 63 64 66 67 67 FF 6D 77 75 78 78 7E 74 FF
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 0104 02D8 0141 00A4 013D 015A 00A7 00A8 0160 015E 0164 0179 00AD 017D 017B
-00B0 0105 02DB 0142 00B4 013E 015B 02C7 00B8 0161 015F 0165 017A 02DD 017E 017C
-0154 00C1 00C2 0102 00C4 0139 0106 00C7 010C 00C9 0118 00CB 011A 00CD 00CE 010E
-0110 0143 0147 00D3 00D4 0150 00D6 00D7 0158 016E 00DA 0170 00DC 00DD 0162 00DF
-0155 00E1 00E2 0103 00E4 013A 0107 00E7 010D 00E9 0119 00EB 011B 00ED 00EE 010F
-0111 0144 0148 00F3 00F4 0151 00F6 00F7 0159 016F 00FA 0171 00FC 00FD 0163 02D9
diff --git a/sql/share/charsets/keybcs2.conf b/sql/share/charsets/keybcs2.xml
index f272960b683..bdbb364822f 100644
--- a/sql/share/charsets/keybcs2.conf
+++ b/sql/share/charsets/keybcs2.xml
@@ -1,4 +1,11 @@
-# ctype array (must be 257 elements)
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="keybcs2">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -16,8 +23,12 @@
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02 02 01 02 01 02 00 02 01 01 01 02 00 02 02 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48
+</map>
+</ctype>
-# to_lower array (must be 256 elements)
+
+<lower>
+<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
@@ -34,8 +45,12 @@
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
E0 E1 E2 E3 E4 E5 E6 E7 ED E9 EA EB EC ED EE EF
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
+</map>
+</lower>
+
-# to_upper array (must be 256 elements)
+<upper>
+<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
@@ -52,26 +67,12 @@
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 E8 EE EF
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
+</map>
+</upper>
-# sort_order array (must be 256 elements)
- 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 44 45 47 49 50 51 52 53 54 55 56 57 58 5A
- 5E 5F 60 63 66 68 6C 6D 6E 6F 72 90 91 92 93 94
- 95 41 44 45 47 49 50 51 52 53 54 55 56 57 58 5A
- 5E 5F 60 63 66 68 6C 6D 6E 6F 72 96 97 98 99 9A
- 45 68 49 47 41 47 66 45 49 49 56 53 56 56 41 41
- 49 72 72 5A 5A 5A 68 68 6F 5A 68 63 56 6F 60 66
- 41 53 5A 68 58 58 68 5A 63 60 60 60 A0 A1 A2 A3
- A4 A5 A6 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC
- BD BE 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
- 80 65 83 87 88 89 DD 8A 85 8B 84 81 DE 85 82 DF
- F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
-# Unicode mappping (must be 256 elements)
+<unicode>
+<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
@@ -88,4 +89,32 @@
2568 2564 2565 2559 2558 2552 2553 256B 256A 2518 250C 2588 2584 258C 2590 2580
03B1 00DF 0393 03C0 03A3 03C3 00B5 03C4 03A6 0398 03A9 03B4 221E 03C6 03B5 2229
2261 00B1 2265 2264 2320 2321 00F7 2248 00B0 2219 00B7 221A 207F 00B2 25A0 00A0
+</map>
+</unicode>
+
+
+<collation name="keybcs2">
+<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 44 45 47 49 50 51 52 53 54 55 56 57 58 5A
+ 5E 5F 60 63 66 68 6C 6D 6E 6F 72 90 91 92 93 94
+ 95 41 44 45 47 49 50 51 52 53 54 55 56 57 58 5A
+ 5E 5F 60 63 66 68 6C 6D 6E 6F 72 96 97 98 99 9A
+ 45 68 49 47 41 47 66 45 49 49 56 53 56 56 41 41
+ 49 72 72 5A 5A 5A 68 68 6F 5A 68 63 56 6F 60 66
+ 41 53 5A 68 58 58 68 5A 63 60 60 60 A0 A1 A2 A3
+ A4 A5 A6 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC
+ BD BE 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
+ 80 65 83 87 88 89 DD 8A 85 8B 84 81 DE 85 82 DF
+ F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
+</map>
+</collation>
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/koi8_ru.conf b/sql/share/charsets/koi8_ru.conf
deleted file mode 100644
index b1d9755173f..00000000000
--- a/sql/share/charsets/koi8_ru.conf
+++ /dev/null
@@ -1,93 +0,0 @@
-# Configuration file for the koi8_ru character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 02 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 01 10 10 10 10 10 10 10 10 10 10 10 10
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 A3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
- 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 B3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- 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
- 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
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 E5 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE
- AF B0 B1 E5 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD
- FE DF E0 F6 E3 E4 F4 E2 F5 E8 E9 EA EB EC ED EE
- EF FF F0 F1 F2 F3 E6 E1 FC FB E7 F8 FD F9 F7 FA
- FE DF E0 F6 E3 E4 F4 E2 F5 E8 E9 EA EB EC ED EE
- EF FF F0 F1 F2 F3 E6 E1 FC FB E7 F8 FD F9 F7 FA
-
-# Unicode mapping table (256 elements)
-
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000a 000b 000c 000d 000e 000f
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001a 001b 001c 001d 001e 001f
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002a 002b 002c 002d 002e 002f
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003a 003b 003c 003d 003e 003f
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004a 004b 004c 004d 004e 004f
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005a 005b 005c 005d 005e 005f
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006a 006b 006c 006d 006e 006f
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007a 007b 007c 007d 007e 007f
-2500 2502 250c 2510 2514 2518 251c 2524 252c 2534 253c 2580 2584 2588 258c 2590
-2591 2592 2593 2320 25a0 2219 221a 2248 2264 2265 00a0 2321 00b0 00b2 00b7 00f7
-2550 2551 2552 0451 2553 2554 2555 2556 2557 2558 2559 255a 255b 255c 255d 255e
-255f 2560 2561 0401 2562 2563 2564 2565 2566 2567 2568 2569 256a 256b 256c 00a9
-044e 0430 0431 0446 0434 0435 0444 0433 0445 0438 0439 043a 043b 043c 043d 043e
-043f 044f 0440 0441 0442 0443 0436 0432 044c 044b 0437 0448 044d 0449 0447 044a
-042e 0410 0411 0426 0414 0415 0424 0413 0425 0418 0419 041a 041b 041c 041d 041e
-041f 042f 0420 0421 0422 0423 0416 0412 042c 042b 0417 0428 042d 0429 0427 042a
diff --git a/sql/share/charsets/koi8r.xml b/sql/share/charsets/koi8r.xml
new file mode 100644
index 00000000000..dae780f14fc
--- /dev/null
+++ b/sql/share/charsets/koi8r.xml
@@ -0,0 +1,119 @@
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="koi8r">
+
+<ctype>
+<map>
+ 00
+ 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
+ 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
+ 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
+ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 02 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 01 10 10 10 10 10 10 10 10 10 10 10 10
+ 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+ 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+</map>
+</ctype>
+
+
+<lower>
+<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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 A3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+ 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
+</map>
+</lower>
+
+
+<upper>
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 B3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ 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
+ 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
+</map>
+</upper>
+
+
+<unicode>
+<map>
+0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000a 000b 000c 000d 000e 000f
+0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001a 001b 001c 001d 001e 001f
+0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002a 002b 002c 002d 002e 002f
+0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003a 003b 003c 003d 003e 003f
+0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004a 004b 004c 004d 004e 004f
+0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005a 005b 005c 005d 005e 005f
+0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006a 006b 006c 006d 006e 006f
+0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007a 007b 007c 007d 007e 007f
+2500 2502 250c 2510 2514 2518 251c 2524 252c 2534 253c 2580 2584 2588 258c 2590
+2591 2592 2593 2320 25a0 2219 221a 2248 2264 2265 00a0 2321 00b0 00b2 00b7 00f7
+2550 2551 2552 0451 2553 2554 2555 2556 2557 2558 2559 255a 255b 255c 255d 255e
+255f 2560 2561 0401 2562 2563 2564 2565 2566 2567 2568 2569 256a 256b 256c 00a9
+044e 0430 0431 0446 0434 0435 0444 0433 0445 0438 0439 043a 043b 043c 043d 043e
+043f 044f 0440 0441 0442 0443 0436 0432 044c 044b 0437 0448 044d 0449 0447 044a
+042e 0410 0411 0426 0414 0415 0424 0413 0425 0418 0419 041a 041b 041c 041d 041e
+041f 042f 0420 0421 0422 0423 0416 0412 042c 042b 0417 0428 042d 0429 0427 042a
+</map>
+</unicode>
+
+
+<collation name="koi8r">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 E5 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE
+ AF B0 B1 E5 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD
+ FE DF E0 F6 E3 E4 F4 E2 F5 E8 E9 EA EB EC ED EE
+ EF FF F0 F1 F2 F3 E6 E1 FC FB E7 F8 FD F9 F7 FA
+ FE DF E0 F6 E3 E4 F4 E2 F5 E8 E9 EA EB EC ED EE
+ EF FF F0 F1 F2 F3 E6 E1 FC FB E7 F8 FD F9 F7 FA
+</map>
+</collation>
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/koi8_ukr.conf b/sql/share/charsets/koi8u.xml
index 5a552900544..e6cba068997 100644
--- a/sql/share/charsets/koi8_ukr.conf
+++ b/sql/share/charsets/koi8u.xml
@@ -1,6 +1,11 @@
-# Configuration file for the koi8_ukr character set
+<?xml version='1.0' encoding="utf-8"?>
-# ctype array (must have 257 elements)
+<charsets>
+
+<charset name="koi8u">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -18,8 +23,12 @@
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+</map>
+</ctype>
+
-# to_lower array (must have 256 elements)
+<lower>
+<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
@@ -36,8 +45,12 @@
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
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
+</map>
+</lower>
-# to_upper array (must have 256 elements)
+
+<upper>
+<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
@@ -54,26 +67,12 @@
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
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
+</map>
+</upper>
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 20 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4
- B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 C4
- C5 C6 C7 88 87 C8 8C 8D C9 CA CB CC CD 84 CE CF
- D0 D1 D2 88 87 D3 8C 8D D4 D5 D6 D7 D8 84 D9 DA
- A3 80 81 9B 85 86 99 83 9A 8B 8E 8F 90 91 92 93
- 94 A4 95 96 97 98 89 82 A1 A0 8A 9D A2 9E 9C 9F
- A3 80 81 9B 85 86 99 83 9A 8B 8E 8F 90 91 92 93
- 94 A4 95 96 97 98 89 82 A1 A0 8A 9D A2 9E 9C 9F
-# Unicode mapping (256 elements)
+<unicode>
+<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
@@ -90,3 +89,32 @@
043F 044F 0440 0441 0442 0443 0436 0432 044C 044B 0437 0448 044D 0449 0447 044A
042E 0410 0411 0426 0414 0415 0424 0413 0425 0418 0419 041A 041B 041C 041D 041E
041F 042F 0420 0421 0422 0423 0416 0412 042C 042B 0417 0428 042D 0429 0427 042A
+</map>
+</unicode>
+
+
+<collation name="koi8u">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 20 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4
+ B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 C4
+ C5 C6 C7 88 87 C8 8C 8D C9 CA CB CC CD 84 CE CF
+ D0 D1 D2 88 87 D3 8C 8D D4 D5 D6 D7 D8 84 D9 DA
+ A3 80 81 9B 85 86 99 83 9A 8B 8E 8F 90 91 92 93
+ 94 A4 95 96 97 98 89 82 A1 A0 8A 9D A2 9E 9C 9F
+ A3 80 81 9B 85 86 99 83 9A 8B 8E 8F 90 91 92 93
+ 94 A4 95 96 97 98 89 82 A1 A0 8A 9D A2 9E 9C 9F
+</map>
+</collation>
+
+</charset>
+
+</charsets>
+
diff --git a/sql/share/charsets/latin1.conf b/sql/share/charsets/latin1.conf
deleted file mode 100644
index 7cb5cfb3cfd..00000000000
--- a/sql/share/charsets/latin1.conf
+++ /dev/null
@@ -1,92 +0,0 @@
-# Configuration file for the latin1 character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
- 44 4E 4F 4F 4F 4F 5D D7 D8 55 55 55 59 59 DE DF
- 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
- 44 4E 4F 4F 4F 4F 5D F7 D8 55 55 55 59 59 DE FF
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
-00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
-00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
-00D0 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 00DD 00DE 00DF
-00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
-00F0 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 00FD 00FE 00FF
diff --git a/sql/share/charsets/latin1.xml b/sql/share/charsets/latin1.xml
new file mode 100644
index 00000000000..c14e369454e
--- /dev/null
+++ b/sql/share/charsets/latin1.xml
@@ -0,0 +1,233 @@
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="latin1">
+
+<ctype>
+<map>
+ 00
+ 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
+ 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
+ 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 00 01 01 01 01 01 01 01 02
+ 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 00 02 02 02 02 02 02 02 02
+</map>
+</ctype>
+
+
+<lower>
+<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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
+ F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
+</map>
+</lower>
+
+
+<upper>
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+ C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
+ D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
+</map>
+</upper>
+
+
+<unicode>
+<map>
+ 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
+ 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
+ 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
+ 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
+ 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
+ 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
+ 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
+ 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
+ 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
+ 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
+ 00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
+ 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
+ 00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
+ 00D0 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 00DD 00DE 00DF
+ 00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
+ 00F0 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 00FD 00FE 00FF
+</map>
+</unicode>
+
+
+<collation name="latin1">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
+ 44 4E 4F 4F 4F 4F 5D D7 D8 55 55 55 59 59 DE DF
+ 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
+ 44 4E 4F 4F 4F 4F 5D F7 D8 55 55 55 59 59 DE FF
+</map>
+</collation>
+
+
+<collation name="german1">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ 41 41 41 41 41 41 41 43 45 45 45 45 49 49 49 49
+ D0 4E 4F 4F 4F 4F 4F D7 4F 55 55 55 55 59 DE 53
+ 41 41 41 41 41 41 41 43 45 45 45 45 49 49 49 49
+ D0 4E 4F 4F 4F 4F 4F F7 4F 55 55 55 55 59 DE FF
+</map>
+</collation>
+
+
+<collation name="danish">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ 41 41 41 41 5B 5D 5B 43 45 45 45 45 49 49 49 49
+ 44 4E 4F 4F 4F 4F 5C D7 5C 55 55 55 59 59 DE DF
+ 41 41 41 41 5B 5D 5B 43 45 45 45 45 49 49 49 49
+ 44 4E 4F 4F 4F 4F 5C F7 5C 55 55 55 59 59 DE FF
+</map>
+</collation>
+
+
+<collation name="latin1_de"/>
+
+
+<collation name="latin1_bin">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+</map>
+</collation>
+
+
+<collation name="latin1_ci_as">
+<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
+ 43 45 47 49 4B 4D 4F 55 5D 5F 61 63 6D 6F 71 73
+ 59 7F 83 85 87 89 8B BD 8D 9C 9E A0 A2 AC B1 97
+ 43 45 47 49 4B 4D 4F 55 5D 5F 61 63 6D 6F 71 73
+ 59 7F 83 85 87 89 8B BE 8D 9C 9E A0 A2 AC B1 AE
+</map>
+</collation>
+
+
+<collation name="latin1_cs_as">
+<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 42 52 54 58 5C 66 68 6A 6C 76 78 7A 7C 7E 82
+ 90 92 94 96 99 9B A5 A7 A9 AB B0 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
+ 43 45 47 49 4B 4D 4F 55 5D 5F 61 63 6D 6F 71 73
+ 59 7F 83 85 87 89 8B BD 8D 9C 9E A0 A2 AC B1 97
+ 44 46 48 4A 4C 4E 50 56 5E 60 62 64 6E 70 72 74
+ 5A 80 84 86 88 8A 8C BE 8E 9D 9F A1 A3 AD B2 AE
+</map>
+</collation>
+
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/latin1cias.conf b/sql/share/charsets/latin1cias.conf
deleted file mode 100644
index 3b0e104aafd..00000000000
--- a/sql/share/charsets/latin1cias.conf
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Latin1, accent sensitive, case insensitive
-#
-# Sorting for Dutch, English, French, German (Duden),
-# Italian, Latin, Pogtuguese, Spanish
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 00 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 00 02 02 02 02 02 02 02 02
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# sort_order array (must be 256 elements)
- 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
- 43 45 47 49 4B 4D 4F 55 5D 5F 61 63 6D 6F 71 73
- 59 7F 83 85 87 89 8B BD 8D 9C 9E A0 A2 AC B1 97
- 43 45 47 49 4B 4D 4F 55 5D 5F 61 63 6D 6F 71 73
- 59 7F 83 85 87 89 8B BE 8D 9C 9E A0 A2 AC B1 AE
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
- 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
- 00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
- 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
- 00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
- 00D0 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 00DD 00DE 00DF
- 00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
- 00F0 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 00FD 00FE 00FF
-
diff --git a/sql/share/charsets/latin1csas.conf b/sql/share/charsets/latin1csas.conf
deleted file mode 100644
index cb3a1285de8..00000000000
--- a/sql/share/charsets/latin1csas.conf
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Latin1, accent sensitive, case sensitive
-#
-# Sorting for Dutch, English, French, German (Duden),
-# Italian, Latin, Pogtuguese, Spanish
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 00 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 00 02 02 02 02 02 02 02 02
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# sort_order array (must be 256 elements)
- 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 42 52 54 58 5C 66 68 6A 6C 76 78 7A 7C 7E 82
- 90 92 94 96 99 9B A5 A7 A9 AB B0 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
- 43 45 47 49 4B 4D 4F 55 5D 5F 61 63 6D 6F 71 73
- 59 7F 83 85 87 89 8B BD 8D 9C 9E A0 A2 AC B1 97
- 44 46 48 4A 4C 4E 50 56 5E 60 62 64 6E 70 72 74
- 5A 80 84 86 88 8A 8C BE 8E 9D 9F A1 A3 AD B2 AE
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
- 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
- 00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
- 00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
- 00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
- 00D0 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 00DD 00DE 00DF
- 00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
- 00F0 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 00FD 00FE 00FF
-
diff --git a/sql/share/charsets/latin2.conf b/sql/share/charsets/latin2.conf
deleted file mode 100644
index cc21af9faa1..00000000000
--- a/sql/share/charsets/latin2.conf
+++ /dev/null
@@ -1,92 +0,0 @@
-# Configuration file for the latin2 character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 48 01 10 01 10 01 01 10 10 01 01 01 01 10 01 01
- 10 02 10 02 10 02 02 10 10 02 02 02 02 10 02 02
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 10 01 01 01 01 01 01 10 01 01 01 01 01 01 01 10
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 10
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 B1 A2 B3 A4 B5 B6 A7 A8 B9 BA BB BC AD BE BF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- D0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 A1 B2 A3 B4 A5 A6 B7 B8 A9 AA AB AC BD AE AF
- 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- F0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# sort_order array (must have 256 elements)
- 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 44 45 48 49 4B 4C 4D 4E 4F 50 51 53 54 56
- 58 59 5A 5B 5E 5F 60 61 62 63 64 68 69 6A 6B 6C
- 6D 41 44 45 48 49 4B 4C 4D 4E 4F 50 51 53 54 56
- 58 59 5A 5B 5E 5F 60 61 62 63 64 6E 6F 70 71 FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF 42 FF 52 FF 51 5C FF FF 5D 5B 5E 65 FF 67 66
- FF 42 FF 52 FF 51 5C FF FF 5D 5B 5E 65 FF 67 66
- 5A 43 43 43 43 51 46 45 47 49 4A 49 49 4E 4E 48
- FF 55 54 57 56 56 56 FF 5A 5F 5F 5F 5F 63 5E FF
- 5A 43 43 43 43 51 46 45 47 49 4A 49 49 4E 4E 48
- FF 55 54 57 56 56 56 FF 5A 5F 5F 5F 5F 63 5E FF
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 0104 02D8 0141 00A4 013D 015A 00A7 00A8 0160 015E 0164 0179 00AD 017D 017B
-00B0 0105 02DB 0142 00B4 013E 015B 02C7 00B8 0161 015F 0165 017A 02DD 017E 017C
-0154 00C1 00C2 0102 00C4 0139 0106 00C7 010C 00C9 0118 00CB 011A 00CD 00CE 010E
-0110 0143 0147 00D3 00D4 0150 00D6 00D7 0158 016E 00DA 0170 00DC 00DD 0162 00DF
-0155 00E1 00E2 0103 00E4 013A 0107 00E7 010D 00E9 0119 00EB 011B 00ED 00EE 010F
-0111 0144 0148 00F3 00F4 0151 00F6 00F7 0159 016F 00FA 0171 00FC 00FD 0163 02D9
diff --git a/sql/share/charsets/latin2.xml b/sql/share/charsets/latin2.xml
new file mode 100644
index 00000000000..377ab19e8ad
--- /dev/null
+++ b/sql/share/charsets/latin2.xml
@@ -0,0 +1,167 @@
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="latin2">
+
+<ctype>
+<map>
+ 00
+ 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
+ 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
+ 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 48 01 10 01 10 01 01 10 10 01 01 01 01 10 01 01
+ 10 02 10 02 10 02 02 10 10 02 02 02 02 10 02 02
+ 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+ 10 01 01 01 01 01 01 10 01 01 01 01 01 01 01 10
+ 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 10
+</map>
+</ctype>
+
+
+<lower>
+<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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 B1 A2 B3 A4 B5 B6 A7 A8 B9 BA BB BC AD BE BF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
+ D0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
+</map>
+</lower>
+
+
+<upper>
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 A1 B2 A3 B4 A5 A6 B7 B8 A9 AA AB AC BD AE AF
+ 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
+ C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
+ F0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
+</map>
+</upper>
+
+
+<unicode>
+<map>
+0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
+0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
+0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
+0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
+0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
+0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
+0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
+0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
+0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
+0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
+00A0 0104 02D8 0141 00A4 013D 015A 00A7 00A8 0160 015E 0164 0179 00AD 017D 017B
+00B0 0105 02DB 0142 00B4 013E 015B 02C7 00B8 0161 015F 0165 017A 02DD 017E 017C
+0154 00C1 00C2 0102 00C4 0139 0106 00C7 010C 00C9 0118 00CB 011A 00CD 00CE 010E
+0110 0143 0147 00D3 00D4 0150 00D6 00D7 0158 016E 00DA 0170 00DC 00DD 0162 00DF
+0155 00E1 00E2 0103 00E4 013A 0107 00E7 010D 00E9 0119 00EB 011B 00ED 00EE 010F
+0111 0144 0148 00F3 00F4 0151 00F6 00F7 0159 016F 00FA 0171 00FC 00FD 0163 02D9
+</map>
+</unicode>
+
+
+<collation name="latin2">
+<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 44 45 48 49 4B 4C 4D 4E 4F 50 51 53 54 56
+ 58 59 5A 5B 5E 5F 60 61 62 63 64 68 69 6A 6B 6C
+ 6D 41 44 45 48 49 4B 4C 4D 4E 4F 50 51 53 54 56
+ 58 59 5A 5B 5E 5F 60 61 62 63 64 6E 6F 70 71 FF
+ FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+ FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+ FF 42 FF 52 FF 51 5C FF FF 5D 5B 5E 65 FF 67 66
+ FF 42 FF 52 FF 51 5C FF FF 5D 5B 5E 65 FF 67 66
+ 5A 43 43 43 43 51 46 45 47 49 4A 49 49 4E 4E 48
+ FF 55 54 57 56 56 56 FF 5A 5F 5F 5F 5F 63 5E FF
+ 5A 43 43 43 43 51 46 45 47 49 4A 49 49 4E 4E 48
+ FF 55 54 57 56 56 56 FF 5A 5F 5F 5F 5F 63 5E FF
+</map>
+</collation>
+
+
+<collation name="croat">
+<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 42 43 46 48 49 4A 4B 4C 4D 4E 4F 50 51 52
+ 53 54 55 56 58 59 5A 5B 5C 5D 5E 5B 5C 5D 5E 5F
+ 60 41 42 43 46 48 49 4A 4B 4C 4D 4E 4F 50 51 52
+ 53 54 55 56 58 59 5A 5B 5C 5D 5E 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 57 8B 8C 8D 5F 8F
+ 90 91 92 93 94 95 96 97 98 99 57 9B 9C 9D 5F 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ 41 41 41 41 5C 5B 45 43 44 45 45 45 49 49 49 49
+ 47 4E 4F 4F 4F 4F 5D D7 D8 55 55 55 59 59 DE DF
+ 41 41 41 41 5C 5B 45 43 44 45 45 45 49 49 49 49
+ 47 4E 4F 4F 4F 4F 5D F7 D8 55 55 55 59 59 DE FF
+</map>
+</collation>
+
+
+<collation name="czech"/>
+
+
+<collation name="hungarian">
+<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 47 48 4C 4E 53 54 55 56 5A 5B 5C 60 61 64
+ 69 6A 6B 6E 72 75 7A 7B 7C 7D 7F 83 84 85 86 87
+ 88 41 47 48 4C 4E 53 54 55 56 5A 5B 5C 60 61 64
+ 69 6A 6B 6E 72 75 7A 7B 7C 7D 7F 89 8A 8B 8C 00
+ 01 78 4E 04 05 06 07 08 09 0A 67 67 56 56 0F 41
+ 4E 12 13 67 67 64 78 75 78 67 78 1C 1D 1E 1F FF
+ 41 56 64 75 5E 6F FF 67 FF 70 71 73 80 FF 81 82
+ FF 42 FF 5D FF 41 6F FF FF 70 71 73 80 FF 81 82
+ 6C 41 44 45 46 5F 49 4B 4A 4E 51 52 50 56 57 4D
+ FF 62 63 64 66 67 67 FF 6D 77 75 78 78 7E 74 FF
+ 64 41 44 45 46 5F 49 4B 4A 4E 51 78 50 56 58 4D
+ FF 62 63 64 66 67 67 FF 6D 77 75 78 78 7E 74 FF
+</map>
+</collation>
+
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/latin5.conf b/sql/share/charsets/latin5.conf
deleted file mode 100644
index d603d019ce6..00000000000
--- a/sql/share/charsets/latin5.conf
+++ /dev/null
@@ -1,96 +0,0 @@
-# Configuration file for the latin5 (turkish) character set
-
-# Note: all accented characters are compared separately (this
-# is different from the default latin1 character set, where
-# e.g. a = ä = á, etc.).
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 FD 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC 69 FE 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 DD 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC 49 DE FF
-
-# sort_order array (must have 256 elements)
- 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 42 43 45 46 47 48 4A 4B 4D 4E 4F 50 51 52
- 54 55 56 57 59 5A 5C 5D 5E 5F 60 61 62 63 64 65
- 66 41 42 43 45 46 47 48 4A 4C 4D 4E 4F 50 51 52
- 54 55 56 57 59 5A 5C 5D 5E 5F 60 87 88 89 8A 8B
- 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B
- 9C 9D 9E 9F A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB
- AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB
- BC BD BE BF C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB
- CC CD CE CF D0 D1 D2 44 D3 D4 D5 D6 D7 D8 D9 DA
- 49 DB DC DD DE DF 53 E0 E1 E2 E3 E4 5B 4C 58 E5
- CC CD CE CF D0 D1 D2 44 D3 D4 D5 D6 D7 D8 D9 DA
- 49 DB DC DD DE DF 53 FA E1 E2 E3 E4 5B 4B 58 FF
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
-00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
-00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
-011E 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 0130 015E 00DF
-00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
-011F 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 0131 015F 00FF
diff --git a/sql/share/charsets/latin5.xml b/sql/share/charsets/latin5.xml
new file mode 100644
index 00000000000..a072ffc5072
--- /dev/null
+++ b/sql/share/charsets/latin5.xml
@@ -0,0 +1,125 @@
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="latin5">
+
+<ctype>
+<map>
+ 00
+ 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
+ 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
+ 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
+ 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
+</map>
+</ctype>
+
+
+<lower>
+<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 61 62 63 64 65 66 67 68 FD 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
+ F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC 69 FE 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
+</map>
+</lower>
+
+
+<upper>
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 DD 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+ C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
+ D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC 49 DE FF
+</map>
+</upper>
+
+
+<unicode>
+<map>
+0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
+0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
+0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
+0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
+0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
+0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
+0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
+0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
+0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
+0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
+00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
+00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
+00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
+011E 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 0130 015E 00DF
+00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
+011F 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 0131 015F 00FF
+</map>
+</unicode>
+
+
+<collation name="latin5">
+<!--
+# Note: all accented characters are compared separately (this
+# is different from the default latin1 character set, where
+# e.g. a = ä = á, etc.).
+-->
+<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 42 43 45 46 47 48 4A 4B 4D 4E 4F 50 51 52
+ 54 55 56 57 59 5A 5C 5D 5E 5F 60 61 62 63 64 65
+ 66 41 42 43 45 46 47 48 4A 4C 4D 4E 4F 50 51 52
+ 54 55 56 57 59 5A 5C 5D 5E 5F 60 87 88 89 8A 8B
+ 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B
+ 9C 9D 9E 9F A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB
+ AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB
+ BC BD BE BF C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB
+ CC CD CE CF D0 D1 D2 44 D3 D4 D5 D6 D7 D8 D9 DA
+ 49 DB DC DD DE DF 53 E0 E1 E2 E3 E4 5B 4C 58 E5
+ CC CD CE CF D0 D1 D2 44 D3 D4 D5 D6 D7 D8 D9 DA
+ 49 DB DC DD DE DF 53 FA E1 E2 E3 E4 5B 4B 58 FF
+</map>
+</collation>
+
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/latin7.xml b/sql/share/charsets/latin7.xml
new file mode 100644
index 00000000000..eae4d501f44
--- /dev/null
+++ b/sql/share/charsets/latin7.xml
@@ -0,0 +1,168 @@
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="latin7">
+
+<ctype>
+<map>
+ 00
+ 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
+ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
+ 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
+ 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
+ 01 20 10 20 10 10 00 00 20 10 20 10 20 10 10 10
+ 20 10 10 10 10 10 10 10 20 00 20 10 20 10 10 20
+ 48 20 10 10 10 20 10 10 10 10 01 10 10 10 10 01
+ 10 10 10 10 10 10 10 10 10 10 02 10 10 10 10 02
+ 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
+ 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 10
+</map>
+</ctype>
+
+
+<lower>
+<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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 BA AB AC AD AE BF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
+ E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
+ F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
+</map>
+</lower>
+
+
+<upper>
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 AA BB BC BD BE AF
+ 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
+ C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
+ D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
+</map>
+</upper>
+
+
+<unicode>
+<map>
+0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
+0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
+0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
+0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
+0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
+0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
+0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
+0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
+0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
+0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
+00A0 201D 00A2 00A3 00A4 201E 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
+00B0 00B1 00B2 00B3 201C 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
+0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
+0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
+0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
+0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 2019
+</map>
+</unicode>
+
+
+<collation name="estonia">
+<map>
+ 00 02 03 04 05 06 07 08 09 2E 2F 30 31 32 0A 0B
+ 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B
+ 2C 33 34 35 36 37 38 27 39 3A 3B 5D 3C 28 3D 3E
+ 76 7A 7C 7E 80 81 82 83 84 85 3F 40 5E 5F 60 41
+ 42 86 90 92 98 9A A4 A6 AA AC B2 B4 B8 BE C0 C6
+ CE D0 D2 D6 E5 E8 EE F0 FA FC DD 43 44 45 46 47
+ 48 87 91 93 99 9B A5 A7 AB AD B3 B5 B9 BF C1 C7
+ CF D1 D3 D7 E6 E9 EF F1 FB FD DE 49 4A 4B 4C 1C
+ 01 1D 57 1E 5A 74 71 72 1F 75 20 5B 21 4E 52 51
+ 22 55 56 58 59 73 2A 2B 23 E7 24 5C 25 4F 54 26
+ 2D FE 66 67 68 FF 4D 69 CC 6A D4 62 6B 29 6C 8E
+ 6D 61 7D 7F 50 6E 6F 70 CD 7B D5 63 77 78 79 8F
+ 8C B0 88 94 F4 8A A2 A0 96 9C DF 9E A8 B6 AE BA
+ DB C2 C4 C8 CA F2 F6 64 EC BC D8 EA F8 E1 E3 DA
+ 8D B1 89 95 F5 8B A3 A1 97 9D E0 9F A9 B7 AF BB
+ DC C3 C5 C9 CB F3 F7 65 ED BD D9 EB F9 E2 E4 53
+</map>
+</collation>
+
+
+<collation name="latvian">
+<!-- Created for case-sensitive record search -->
+<!-- by Andis Grasis & Rihards Grasis e-mail:andis@cata.lv -->
+<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
+ 30 32 33 34 35 36 37 2B 38 39 3A 5C 3B 2C 3C 3D
+ 76 7A 7C 7E 80 81 82 83 84 85 3E 3F 5D 5E 5F 40
+ 41 86 92 94 9A 9C A6 A8 AC AE B4 B6 BA C0 C2 C8
+ D4 D6 D8 DC E3 E6 EE F0 F2 F4 F6 42 43 44 45 46
+ 47 87 93 95 9B 9D A7 A9 AD AF B5 B7 BB C1 C3 C9
+ D5 D7 D9 DD E4 E7 EF F1 F3 F5 F7 48 49 4A 4B 20
+ 75 21 56 22 59 73 70 71 23 74 24 5A 25 4D 51 50
+ 26 54 55 57 58 72 2E 2F 27 E5 28 5B 29 4E 53 2A
+ 31 FE 65 66 67 FF 4C 68 D3 69 DA 61 6A 2D 6B 90
+ 6C 60 7D 7F 4F 6D 6E 6F D2 7B DB 62 77 78 79 91
+ 8E B2 8A 96 88 8C A4 A2 98 9E F8 A0 AA B8 B0 BE
+ E1 C4 C6 CA CE D0 CC 63 EC BC DE EA E8 FA FC E0
+ 8F B3 8B 97 89 8D A5 A3 99 9F F9 A1 AB B9 B1 BF
+ E2 C5 C7 CB CF D1 CD 64 ED BD DF EB E9 FB FD 52
+</map>
+</collation>
+
+
+<collation name="latvian1">
+<!-- Created for case-insensitive record search -->
+<!-- Created by Andis & Rihards -->
+<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
+ 30 32 33 34 35 36 37 2B 38 39 3A 5C 3B 2C 3C 3D
+ 76 7A 7C 7E 80 81 82 83 84 85 3E 3F 5D 5E 5F 40
+ 41 86 92 94 9A 9C A6 A8 AC AE B4 B6 BA C0 C2 C8
+ D4 D6 D8 DC E3 E6 EE F0 F2 F4 F6 42 43 44 45 46
+ 47 86 92 94 9A 9C A6 A8 AC AE B4 B6 BA C0 C2 C8
+ D4 D6 D8 DC E2 E6 EE F0 F2 F4 F6 48 49 4A 4B 20
+ 75 21 56 22 59 73 70 71 23 74 24 5A 25 4D 51 50
+ 26 54 55 57 58 72 2E 2F 27 E5 28 5B 29 4E 53 2A
+ 31 FE 65 66 67 FF 4C 68 2D 69 DA 61 6A 2D 6B 90
+ 6C 60 7D 7F 4F 6D 6E 6F D3 7B DB 62 77 78 79 90
+ 8E B2 8A 96 88 8C A4 A2 98 9E F8 A0 AA B8 B0 BE
+ E1 C4 C6 CA CE D0 CC 63 EC BC DE EA E8 FA FC E0
+ 8E B2 8A 96 88 8C A4 A2 98 9E F8 A0 AA B8 B0 BE
+ E1 C4 C6 CA CE D0 CC 64 EC BC DE EA E8 FA FC 52
+</map>
+</collation>
+
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/latvian.conf b/sql/share/charsets/latvian.conf
deleted file mode 100644
index c3dee95d55c..00000000000
--- a/sql/share/charsets/latvian.conf
+++ /dev/null
@@ -1,95 +0,0 @@
-# Configuration file for the latvian character set.
-# Created for case-sensitive record search
-# Created accord with windows-1257 (iso-8859-4) codepage
-# Created by Andis Grasis & Rihards Grasis e-mail:andis@cata.lv
-
-# The ctype array must have 257 elements.
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 01 20 10 20 10 10 00 00 20 10 20 10 20 10 10 10
- 20 10 10 10 10 10 10 10 20 00 20 10 20 10 10 20
- 48 20 10 10 10 20 10 10 10 10 01 10 10 10 10 01
- 10 10 10 10 10 10 10 10 10 10 02 10 10 10 10 02
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 10
-
-# The to_lower array must have 256 elements.
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 BA AB AC AD AE BF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# The to_upper array must have 256 elements.
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 AA BB BC BD BE AF
- 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# The sort_order array must have 256 elements.
- 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
- 30 32 33 34 35 36 37 2B 38 39 3A 5C 3B 2C 3C 3D
- 76 7A 7C 7E 80 81 82 83 84 85 3E 3F 5D 5E 5F 40
- 41 86 92 94 9A 9C A6 A8 AC AE B4 B6 BA C0 C2 C8
- D4 D6 D8 DC E3 E6 EE F0 F2 F4 F6 42 43 44 45 46
- 47 87 93 95 9B 9D A7 A9 AD AF B5 B7 BB C1 C3 C9
- D5 D7 D9 DD E4 E7 EF F1 F3 F5 F7 48 49 4A 4B 20
- 75 21 56 22 59 73 70 71 23 74 24 5A 25 4D 51 50
- 26 54 55 57 58 72 2E 2F 27 E5 28 5B 29 4E 53 2A
- 31 FE 65 66 67 FF 4C 68 D3 69 DA 61 6A 2D 6B 90
- 6C 60 7D 7F 4F 6D 6E 6F D2 7B DB 62 77 78 79 91
- 8E B2 8A 96 88 8C A4 A2 98 9E F8 A0 AA B8 B0 BE
- E1 C4 C6 CA CE D0 CC 63 EC BC DE EA E8 FA FC E0
- 8F B3 8B 97 89 8D A5 A3 99 9F F9 A1 AB B9 B1 BF
- E2 C5 C7 CB CF D1 CD 64 ED BD DF EB E9 FB FD 52
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 201D 00A2 00A3 00A4 201E 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
-00B0 00B1 00B2 00B3 201C 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
-0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
-0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
-0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
-0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 2019
diff --git a/sql/share/charsets/latvian1.conf b/sql/share/charsets/latvian1.conf
deleted file mode 100644
index 3094525052d..00000000000
--- a/sql/share/charsets/latvian1.conf
+++ /dev/null
@@ -1,94 +0,0 @@
-# Configuration file for the latvian character set.
-# Created for case-insensitive record search
-# Created by Andis & Rihards
-
-# The ctype array must have 257 elements.
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 00 00 10 00 10 10 00 00 00 00 00 10 00 10 10 10
- 00 10 10 10 10 10 10 10 00 00 00 10 00 10 10 00
- 48 00 10 10 10 00 10 10 10 10 01 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 10
-
-# The to_lower array must have 256 elements.
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 BA AB AC AD AE BF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE 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
-
-# The to_upper array must have 256 elements.
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 AA BB BC BD BE AF
- 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
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
-
-# The sort_order array must have 256 elements.
- 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
- 30 32 33 34 35 36 37 2B 38 39 3A 5C 3B 2C 3C 3D
- 76 7A 7C 7E 80 81 82 83 84 85 3E 3F 5D 5E 5F 40
- 41 86 92 94 9A 9C A6 A8 AC AE B4 B6 BA C0 C2 C8
- D4 D6 D8 DC E3 E6 EE F0 F2 F4 F6 42 43 44 45 46
- 47 86 92 94 9A 9C A6 A8 AC AE B4 B6 BA C0 C2 C8
- D4 D6 D8 DC E2 E6 EE F0 F2 F4 F6 48 49 4A 4B 20
- 75 21 56 22 59 73 70 71 23 74 24 5A 25 4D 51 50
- 26 54 55 57 58 72 2E 2F 27 E5 28 5B 29 4E 53 2A
- 31 FE 65 66 67 FF 4C 68 2D 69 DA 61 6A 2D 6B 90
- 6C 60 7D 7F 4F 6D 6E 6F D3 7B DB 62 77 78 79 90
- 8E B2 8A 96 88 8C A4 A2 98 9E F8 A0 AA B8 B0 BE
- E1 C4 C6 CA CE D0 CC 63 EC BC DE EA E8 FA FC E0
- 8E B2 8A 96 88 8C A4 A2 98 9E F8 A0 AA B8 B0 BE
- E1 C4 C6 CA CE D0 CC 64 EC BC DE EA E8 FA FC 52
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
-0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
-00A0 201D 00A2 00A3 00A4 201E 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6
-00B0 00B1 00B2 00B3 201C 00B5 00B6 00B7 00F8 00B9 0157 00BB 00BC 00BD 00BE 00E6
-0104 012E 0100 0106 00C4 00C5 0118 0112 010C 00C9 0179 0116 0122 0136 012A 013B
-0160 0143 0145 00D3 014C 00D5 00D6 00D7 0172 0141 015A 016A 00DC 017B 017D 00DF
-0105 012F 0101 0107 00E4 00E5 0119 0113 010D 00E9 017A 0117 0123 0137 012B 013C
-0161 0144 0146 00F3 014D 00F5 00F6 00F7 0173 0142 015B 016B 00FC 017C 017E 2019
diff --git a/sql/share/charsets/macce.conf b/sql/share/charsets/macce.conf
deleted file mode 100644
index f3ac08df087..00000000000
--- a/sql/share/charsets/macce.conf
+++ /dev/null
@@ -1,91 +0,0 @@
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 01 01 02 01 01 01 01 02 02 01 02 02 01 02 02 01
- 02 01 02 02 01 02 01 02 02 02 02 02 02 01 02 02
- 00 00 01 00 00 00 00 02 00 00 00 02 00 00 02 01
- 02 01 00 00 02 01 00 00 02 01 02 01 02 01 02 01
- 02 01 00 00 02 01 00 00 00 00 00 02 01 01 02 01
- 00 00 00 00 00 00 00 00 02 01 02 01 00 00 02 01
- 02 01 00 00 02 01 02 01 01 02 01 01 02 01 01 01
- 02 01 01 02 01 02 01 02 01 02 02 01 01 02 01 00
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 8A 82 82 8E 88 9A 9F 87 88 8B 8A 8B 8D 8D 8E 90
- 90 93 92 93 95 95 98 97 98 99 9A 9B 9C 9E 9E 9F
- A0 A1 AB A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE B0
- B0 B4 B2 B3 B4 FA B6 B7 B8 BA BA BC BC BE BE C0
- C0 C4 C2 C3 C4 CB C6 C7 C8 C9 CA CB CE 9B CE D8
- D0 D1 D2 D3 D4 D5 D6 D7 D8 DA DA DE DC DD DE E0
- E0 E4 E2 E3 E4 E6 E6 87 E9 E9 92 EC EC F0 97 99
- F0 F3 9C F3 F5 F5 F7 F7 F9 F9 FA FD B8 FD AE FF
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 81 83 84 85 86 E7 84 89 80 89 8C 8C 83 8F
- 8F 91 EA 91 94 94 96 EE 96 EF 85 CD F2 9D 9D 86
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA A2 AC AD FE AF
- AF B1 B2 B3 B1 B5 B6 B7 FC B9 B9 BB BB BD BD BF
- BF C1 C2 C3 C1 C5 C6 C7 C8 C9 CA C5 CC CD CC CF
- D0 D1 D2 D3 D4 D5 D6 D7 CF D9 D9 DB DC DD DB DF
- DF E1 E2 E3 E1 E5 E5 E7 E8 E8 EA EB EB ED EE EF
- ED F1 F2 F1 F4 F4 F6 F6 F8 F8 B5 FB FC FB FE FF
-
-# sort_order array (must be 256 elements)
- 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 46 47 4A 4C 52 53 55 56 5A 5B 5D 62 62 67
- 6F 70 71 75 79 81 88 89 8A 8B 8D 90 91 92 93 94
- 95 41 46 47 4A 4C 52 53 55 56 5A 5B 5D 62 62 67
- 6F 70 71 75 79 81 88 89 8A 8B 8D 96 97 98 99 9A
- 41 41 41 4C 41 67 81 41 41 47 41 47 47 47 4C 8D
- 8D 4A 56 4A 4C 4C 4C 67 4C 67 67 67 81 4C 4C 81
- A0 A1 4C A3 A4 A5 A6 75 A8 A9 AA 4C AC AD 53 56
- 56 56 B2 B3 56 5B B6 B7 5D 5D 5D 5D 5D 5D 5D 62
- 62 62 C2 C3 62 62 C6 C7 C8 C9 CA 62 67 67 67 67
- D0 D1 D2 D3 D4 D5 D6 D7 67 71 71 71 DC DD 71 71
- 71 75 E2 E3 75 75 75 41 79 79 56 8D 8D 81 67 67
- 81 81 81 81 81 81 81 81 8B 8B 5B 8D 5D 8D 53 FF
-
-# Unicode mappping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 00C4 0100 0101 00C9 0104 00D6 00DC 00E1 0105 010C 00E4 010D 0106 0107 00E9 0179
- 017A 010E 00ED 010F 0112 0113 0116 00F3 0117 00F4 00F6 00F5 00FA 011A 011B 00FC
- 2020 00B0 0118 00A3 00A7 2022 00B6 00DF 00AE 00A9 2122 0119 00A8 2260 0123 012E
- 012F 012A 2264 2265 012B 0136 2202 2211 0142 013B 013C 013D 013E 0139 013A 0145
- 0146 0143 00AC 221A 0144 0147 2206 00AB 00BB 2026 00A0 0148 0150 00D5 0151 014C
- 2013 2014 201C 201D 2018 2019 00F7 25CA 014D 0154 0155 0158 2039 203A 0159 0156
- 0157 0160 201A 201E 0161 015A 015B 00C1 0164 0165 00CD 017D 017E 016A 00D3 00D4
- 016B 016E 00DA 016F 0170 0171 0172 0173 00DD 00FD 0137 017B 0141 017C 0122 02C7
-
diff --git a/sql/share/charsets/macceciai.conf b/sql/share/charsets/macceciai.conf
deleted file mode 100644
index d7cdaddc425..00000000000
--- a/sql/share/charsets/macceciai.conf
+++ /dev/null
@@ -1,96 +0,0 @@
-# Mac OS Central European, case insensitive, accent sensitive
-#
-# Czech (cs), Hungarian (hu), Polish (pl), Romanian (ro), Croatian (hr),
-# Slovak (sk), Slovenian (sl), Sorbian.
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 01 01 02 01 01 01 01 02 02 01 02 02 01 02 02 01
- 02 01 02 02 01 02 01 02 02 02 02 02 02 01 02 02
- 00 00 01 00 00 00 00 02 00 00 00 02 00 00 02 01
- 02 01 00 00 02 01 00 00 02 01 02 01 02 01 02 01
- 02 01 00 00 02 01 00 00 00 00 00 02 01 01 02 01
- 00 00 00 00 00 00 00 00 02 01 02 01 00 00 02 01
- 02 01 00 00 02 01 02 01 01 02 01 01 02 01 01 01
- 02 01 01 02 01 02 01 02 01 02 02 01 01 02 01 00
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 8A 82 82 8E 88 9A 9F 87 88 8B 8A 8B 8D 8D 8E 90
- 90 93 92 93 95 95 98 97 98 99 9A 9B 9C 9E 9E 9F
- A0 A1 AB A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE B0
- B0 B4 B2 B3 B4 FA B6 B7 B8 BA BA BC BC BE BE C0
- C0 C4 C2 C3 C4 CB C6 C7 C8 C9 CA CB CE 9B CE D8
- D0 D1 D2 D3 D4 D5 D6 D7 D8 DA DA DE DC DD DE E0
- E0 E4 E2 E3 E4 E6 E6 87 E9 E9 92 EC EC F0 97 99
- F0 F3 9C F3 F5 F5 F7 F7 F9 F9 FA FD B8 FD AE FF
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 81 83 84 85 86 E7 84 89 80 89 8C 8C 83 8F
- 8F 91 EA 91 94 94 96 EE 96 EF 85 CD F2 9D 9D 86
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA A2 AC AD FE AF
- AF B1 B2 B3 B1 B5 B6 B7 FC B9 B9 BB BB BD BD BF
- BF C1 C2 C3 C1 C5 C6 C7 C8 C9 CA C5 CC CD CC CF
- D0 D1 D2 D3 D4 D5 D6 D7 CF D9 D9 DB DC DD DB DF
- DF E1 E2 E3 E1 E5 E5 E7 E8 E8 EA EB EB ED EE EF
- ED F1 F2 F1 F4 F4 F6 F6 F8 F8 B5 FB FC FB FE FF
-
-# sort_order array (must be 256 elements)
- 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 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
- 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D2 D3 D4 D5 D6
- D7 41 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
- 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D8 D9 DA DB DC
- 41 41 41 57 41 8D B2 41 41 4D 41 4D 4D 4D 57 CA
- CA 53 6B 53 57 57 57 8D 57 8D 8D 8D B2 57 57 B2
- DD DE 57 DF E0 E1 E2 A7 E3 E4 E5 57 E6 E7 65 6B
- 6B 6B E8 E9 6B 75 EA EB 79 79 79 79 79 79 79 85
- 85 85 EC ED 85 85 EE EF F0 F1 F2 85 8D 8D 8D 8D
- F3 F4 F5 F6 F7 F8 F9 FA 8D 9F 9F 9F FB FC 9F 9F
- 9F A7 FD FE A7 A7 A7 41 BE BE 6B CA CA B2 8D 8D
- B2 B2 B2 B2 B2 B2 B2 B2 C6 C6 75 CA 79 CA 65 FF
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 00C4 0100 0101 00C9 0104 00D6 00DC 00E1 0105 010C 00E4 010D 0106 0107 00E9 0179
- 017A 010E 00ED 010F 0112 0113 0116 00F3 0117 00F4 00F6 00F5 00FA 011A 011B 00FC
- 2020 00B0 0118 00A3 00A7 2022 00B6 00DF 00AE 00A9 2122 0119 00A8 2260 0123 012E
- 012F 012A 2264 2265 012B 0136 2202 2211 0142 013B 013C 013D 013E 0139 013A 0145
- 0146 0143 00AC 221A 0144 0147 2206 00AB 00BB 2026 00A0 0148 0150 00D5 0151 014C
- 2013 2014 201C 201D 2018 2019 00F7 25CA 014D 0154 0155 0158 2039 203A 0159 0156
- 0157 0160 201A 201E 0161 015A 015B 00C1 0164 0165 00CD 017D 017E 016A 00D3 00D4
- 016B 016E 00DA 016F 0170 0171 0172 0173 00DD 00FD 0137 017B 0141 017C 0122 02C7
-
diff --git a/sql/share/charsets/maccecias.conf b/sql/share/charsets/maccecias.conf
deleted file mode 100644
index 8cefd4cf9ec..00000000000
--- a/sql/share/charsets/maccecias.conf
+++ /dev/null
@@ -1,96 +0,0 @@
-# Mac OS Central European, case insensitive, accent sensitive
-#
-# Czech (cs), Hungarian (hu), Polish (pl), Romanian (ro), Croatian (hr),
-# Slovak (sk), Slovenian (sl), Sorbian.
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 01 01 02 01 01 01 01 02 02 01 02 02 01 02 02 01
- 02 01 02 02 01 02 01 02 02 02 02 02 02 01 02 02
- 00 00 01 00 00 00 00 02 00 00 00 02 00 00 02 01
- 02 01 00 00 02 01 00 00 02 01 02 01 02 01 02 01
- 02 01 00 00 02 01 00 00 00 00 00 02 01 01 02 01
- 00 00 00 00 00 00 00 00 02 01 02 01 00 00 02 01
- 02 01 00 00 02 01 02 01 01 02 01 01 02 01 01 01
- 02 01 01 02 01 02 01 02 01 02 02 01 01 02 01 00
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 8A 82 82 8E 88 9A 9F 87 88 8B 8A 8B 8D 8D 8E 90
- 90 93 92 93 95 95 98 97 98 99 9A 9B 9C 9E 9E 9F
- A0 A1 AB A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE B0
- B0 B4 B2 B3 B4 FA B6 B7 B8 BA BA BC BC BE BE C0
- C0 C4 C2 C3 C4 CB C6 C7 C8 C9 CA CB CE 9B CE D8
- D0 D1 D2 D3 D4 D5 D6 D7 D8 DA DA DE DC DD DE E0
- E0 E4 E2 E3 E4 E6 E6 87 E9 E9 92 EC EC F0 97 99
- F0 F3 9C F3 F5 F5 F7 F7 F9 F9 FA FD B8 FD AE FF
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 81 83 84 85 86 E7 84 89 80 89 8C 8C 83 8F
- 8F 91 EA 91 94 94 96 EE 96 EF 85 CD F2 9D 9D 86
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA A2 AC AD FE AF
- AF B1 B2 B3 B1 B5 B6 B7 FC B9 B9 BB BB BD BD BF
- BF C1 C2 C3 C1 C5 C6 C7 C8 C9 CA C5 CC CD CC CF
- D0 D1 D2 D3 D4 D5 D6 D7 CF D9 D9 DB DC DD DB DF
- DF E1 E2 E3 E1 E5 E5 E7 E8 E8 EA EB EB ED EE EF
- ED F1 F2 F1 F4 F4 F6 F6 F8 F8 B5 FB FC FB FE FF
-
-# sort_order array (must be 256 elements)
- 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 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
- 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D2 D3 D4 D5 D6
- D7 41 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
- 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D8 D9 DA DB DC
- 45 47 47 59 49 91 B6 43 49 4F 45 4F 51 51 59 CE
- CE 55 71 55 5B 5B 5D 8F 5D 99 91 97 B8 5F 5F B6
- DD DE 61 DF E0 E1 E2 AD E3 E4 E5 61 E6 E7 67 6F
- 6F 6D E8 E9 6D 77 EA EB 7B 81 82 7F 7F 7D 7D 8B
- 8B 87 EC ED 87 89 EE EF F0 F1 F2 89 93 97 93 95
- F3 F4 F5 F6 F7 F8 F9 FA 95 A1 A1 A3 FB FC A3 A5
- A5 A9 FD FE A9 AB AB 43 B0 B0 71 CC CC BC 8F 99
- BC B4 B8 B4 BA BA BE BE C8 C8 77 D0 7B D0 67 FF
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 00C4 0100 0101 00C9 0104 00D6 00DC 00E1 0105 010C 00E4 010D 0106 0107 00E9 0179
- 017A 010E 00ED 010F 0112 0113 0116 00F3 0117 00F4 00F6 00F5 00FA 011A 011B 00FC
- 2020 00B0 0118 00A3 00A7 2022 00B6 00DF 00AE 00A9 2122 0119 00A8 2260 0123 012E
- 012F 012A 2264 2265 012B 0136 2202 2211 0142 013B 013C 013D 013E 0139 013A 0145
- 0146 0143 00AC 221A 0144 0147 2206 00AB 00BB 2026 00A0 0148 0150 00D5 0151 014C
- 2013 2014 201C 201D 2018 2019 00F7 25CA 014D 0154 0155 0158 2039 203A 0159 0156
- 0157 0160 201A 201E 0161 015A 015B 00C1 0164 0165 00CD 017D 017E 016A 00D3 00D4
- 016B 016E 00DA 016F 0170 0171 0172 0173 00DD 00FD 0137 017B 0141 017C 0122 02C7
-
diff --git a/sql/share/charsets/maccecsas.conf b/sql/share/charsets/maccecsas.conf
deleted file mode 100644
index 8cc1de422f2..00000000000
--- a/sql/share/charsets/maccecsas.conf
+++ /dev/null
@@ -1,96 +0,0 @@
-# Mac OS Central European, case sensitive, accent sensitive
-#
-# Czech (cs), Hungarian (hu), Polish (pl), Romanian (ro), Croatian (hr),
-# Slovak (sk), Slovenian (sl), Sorbian.
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 00
- 01 01 02 01 01 01 01 02 02 01 02 02 01 02 02 01
- 02 01 02 02 01 02 01 02 02 02 02 02 02 01 02 02
- 00 00 01 00 00 00 00 02 00 00 00 02 00 00 02 01
- 02 01 00 00 02 01 00 00 02 01 02 01 02 01 02 01
- 02 01 00 00 02 01 00 00 00 00 00 02 01 01 02 01
- 00 00 00 00 00 00 00 00 02 01 02 01 00 00 02 01
- 02 01 00 00 02 01 02 01 01 02 01 01 02 01 01 01
- 02 01 01 02 01 02 01 02 01 02 02 01 01 02 01 00
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 54 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 8A 82 82 8E 88 9A 9F 87 88 8B 8A 8B 8D 8D 8E 90
- 90 93 92 93 95 95 98 97 98 99 9A 9B 9C 9E 9E 9F
- A0 A1 AB A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE B0
- B0 B4 B2 B3 B4 FA B6 B7 B8 BA BA BC BC BE BE C0
- C0 C4 C2 C3 C4 CB C6 C7 C8 C9 CA CB CE 9B CE D8
- D0 D1 D2 D3 D4 D5 D6 D7 D8 DA DA DE DC DD DE E0
- E0 E4 E2 E3 E4 E6 E6 87 E9 E9 92 EC EC F0 97 99
- F0 F3 9C F3 F5 F5 F7 F7 F9 F9 FA FD B8 FD AE FF
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 74 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 81 83 84 85 86 E7 84 89 80 89 8C 8C 83 8F
- 8F 91 EA 91 94 94 96 EE 96 EF 85 CD F2 9D 9D 86
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA A2 AC AD FE AF
- AF B1 B2 B3 B1 B5 B6 B7 FC B9 B9 BB BB BD BD BF
- BF C1 C2 C3 C1 C5 C6 C7 C8 C9 CA C5 CC CD CC CF
- D0 D1 D2 D3 D4 D5 D6 D7 CF D9 D9 DB DC DD DB DF
- DF E1 E2 E3 E1 E5 E5 E7 E8 E8 EA EB EB ED EE EF
- ED F1 F2 F1 F4 F4 F6 F6 F8 F8 B5 FB FC FB FE FF
-
-# sort_order array (must be 256 elements)
- 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 4B 4D 53 57 63 65 69 6B 73 75 79 83 85 8D
- 9B 9D 9F A7 AE B2 C0 C2 C4 C6 CA D2 D3 D4 D5 D6
- D7 42 4C 4E 54 58 64 66 6A 6C 74 76 7A 84 86 8E
- 9C 9E A0 A8 AF B3 C1 C3 C5 C7 CB D8 D9 DA DB DC
- 45 47 48 59 49 91 B6 44 4A 4F 46 50 51 52 5A CE
- CF 55 72 56 5B 5C 5D 90 5E 9A 92 98 B8 5F 60 B7
- DD DE 61 DF E0 E1 E2 AD E3 E4 E5 62 E6 E7 68 6F
- 70 6D E8 E9 6E 77 EA EB 7C 81 82 7F 80 7D 7E 8B
- 8C 87 EC ED 88 89 EE EF F0 F1 F2 8A 93 97 94 95
- F3 F4 F5 F6 F7 F8 F9 FA 96 A1 A2 A3 FB FC A4 A5
- A6 A9 FD FE AA AB AC 43 B0 B1 71 CC CD BC 8F 99
- BD B4 B9 B5 BA BB BE BF C8 C9 78 D0 7B D1 67 FF
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 00C4 0100 0101 00C9 0104 00D6 00DC 00E1 0105 010C 00E4 010D 0106 0107 00E9 0179
- 017A 010E 00ED 010F 0112 0113 0116 00F3 0117 00F4 00F6 00F5 00FA 011A 011B 00FC
- 2020 00B0 0118 00A3 00A7 2022 00B6 00DF 00AE 00A9 2122 0119 00A8 2260 0123 012E
- 012F 012A 2264 2265 012B 0136 2202 2211 0142 013B 013C 013D 013E 0139 013A 0145
- 0146 0143 00AC 221A 0144 0147 2206 00AB 00BB 2026 00A0 0148 0150 00D5 0151 014C
- 2013 2014 201C 201D 2018 2019 00F7 25CA 014D 0154 0155 0158 2039 203A 0159 0156
- 0157 0160 201A 201E 0161 015A 015B 00C1 0164 0165 00CD 017D 017E 016A 00D3 00D4
- 016B 016E 00DA 016F 0170 0171 0172 0173 00DD 00FD 0137 017B 0141 017C 0122 02C7
-
diff --git a/sql/share/charsets/macromanbin.conf b/sql/share/charsets/macromanbin.conf
deleted file mode 100644
index d0845c07f2b..00000000000
--- a/sql/share/charsets/macromanbin.conf
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# Mac OS Roman, accent insensitive, case insensitive
-#
-# Binary sort order
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 10
- 20 01 01 01 01 01 01 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 00 00 00 00 00 00 00 02 00 00 00 00 00 00 01 01
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 02
- 00 00 00 00 02 00 00 00 00 00 00 20 01 01 01 02
- 00 00 00 00 00 00 00 00 02 01 00 00 00 00 00 00
- 00 00 00 00 00 20 01 01 01 01 01 01 01 01 01 01
- 00 01 01 01 01 02 00 00 00 00 00 00 00 00 00 00
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 8A 8C 8D 8E 96 9A 9F 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD BE BF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA 88 8B 9B CE CF
- D0 D1 D2 D3 D4 D5 D6 D7 D8 D8 DA DB DC DD DE DF
- E0 E1 E2 E3 E4 89 90 87 91 8F 92 94 95 93 97 99
- F0 98 9C 9E 9D F5 F6 F7 F8 F9 FA FB FC FD FE FF
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 E7 CB E5 80 CC 81 82 83 E9
- E6 E8 EA ED EB EC 84 EE F1 EF 85 CD F2 F4 F3 86
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD AE AF
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 D7 D9 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
-
-# sort_order array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 00C4 00C5 00C7 00C9 00D1 00D6 00DC 00E1 00E0 00E2 00E4 00E3 00E5 00E7 00E9 00E8
- 00EA 00EB 00ED 00EC 00EE 00EF 00F1 00F3 00F2 00F4 00F6 00F5 00FA 00F9 00FB 00FC
- 2020 00B0 00A2 00A3 00A7 2022 00B6 00DF 00AE 00A9 2122 00B4 00A8 2260 00C6 00D8
- 221E 00B1 2264 2265 00A5 00B5 2202 2211 220F 03C0 222B 00AA 00BA 03A9 00E6 00F8
- 00BF 00A1 00AC 221A 0192 2248 2206 00AB 00BB 2026 00A0 00C0 00C3 00D5 0152 0153
- 2013 2014 201C 201D 2018 2019 00F7 25CA 00FF 0178 2044 20AC 2039 203A FB01 FB02
- 2021 00B7 201A 201E 2030 00C2 00CA 00C1 00CB 00C8 00CD 00CE 00CF 00CC 00D3 00D4
- F8FF 00D2 00DA 00DB 00D9 0131 02C6 02DC 00AF 02D8 02D9 02DA 00B8 02DD 02DB 02C7
-
diff --git a/sql/share/charsets/macromanciai.conf b/sql/share/charsets/macromanciai.conf
deleted file mode 100644
index 457e6b4f8d9..00000000000
--- a/sql/share/charsets/macromanciai.conf
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Mac OS Roman, accent insensitive, case insensitive
-#
-# Sort order: Dutch, English, French, German (Duden),
-# Italian, Latin, Pogtuguese, Spanish
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 10
- 20 01 01 01 01 01 01 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 00 00 00 00 00 00 00 02 00 00 00 00 00 00 01 01
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 02
- 00 00 00 00 02 00 00 00 00 00 00 20 01 01 01 02
- 00 00 00 00 00 00 00 00 02 01 00 00 00 00 00 00
- 00 00 00 00 00 20 01 01 01 01 01 01 01 01 01 01
- 00 01 01 01 01 02 00 00 00 00 00 00 00 00 00 00
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 8A 8C 8D 8E 96 9A 9F 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD BE BF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA 88 8B 9B CE CF
- D0 D1 D2 D3 D4 D5 D6 D7 D8 D8 DA DB DC DD DE DF
- E0 E1 E2 E3 E4 89 90 87 91 8F 92 94 95 93 97 99
- F0 98 9C 9E 9D F5 F6 F7 F8 F9 FA FB FC FD FE FF
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 E7 CB E5 80 CC 81 82 83 E9
- E6 E8 EA ED EB EC 84 EE F1 EF 85 CD F2 F4 F3 86
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD AE AF
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 D7 D9 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
-
-# sort_order array (must be 256 elements)
- 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 59 63 66 68 6A 75 77 79 7B 7D 81
- 91 93 95 97 9A 9C A6 A8 AA AC B0 B2 B3 B4 B5 B6
- B7 41 51 53 57 59 63 66 68 6A 75 77 79 7B 7D 81
- 91 93 95 97 9A 9C A6 A8 AA AC B0 B8 B9 BA BB BC
- 41 41 53 59 7D 81 9C 41 41 41 41 41 41 53 59 59
- 59 59 6A 6A 6A 6A 7D 81 81 81 81 81 9C 9C 9C 9C
- BD BE BF C0 C1 C2 C3 97 C4 C5 C6 C7 C8 C9 41 81
- CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 41 81
- D8 D9 DA DB 63 DC DD DE DF E0 E1 41 41 81 81 81
- E2 E3 E4 E5 E6 E7 E8 E9 AC AC EA EB EC ED EE EF
- F0 F1 F2 F3 F4 41 59 41 59 59 6A 6A 6A 6A 81 81
- F0 81 9C 9C 9C 6A F6 F7 F8 F9 FA FB FC FD FE FF
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 00C4 00C5 00C7 00C9 00D1 00D6 00DC 00E1 00E0 00E2 00E4 00E3 00E5 00E7 00E9 00E8
- 00EA 00EB 00ED 00EC 00EE 00EF 00F1 00F3 00F2 00F4 00F6 00F5 00FA 00F9 00FB 00FC
- 2020 00B0 00A2 00A3 00A7 2022 00B6 00DF 00AE 00A9 2122 00B4 00A8 2260 00C6 00D8
- 221E 00B1 2264 2265 00A5 00B5 2202 2211 220F 03C0 222B 00AA 00BA 03A9 00E6 00F8
- 00BF 00A1 00AC 221A 0192 2248 2206 00AB 00BB 2026 00A0 00C0 00C3 00D5 0152 0153
- 2013 2014 201C 201D 2018 2019 00F7 25CA 00FF 0178 2044 20AC 2039 203A FB01 FB02
- 2021 00B7 201A 201E 2030 00C2 00CA 00C1 00CB 00C8 00CD 00CE 00CF 00CC 00D3 00D4
- F8FF 00D2 00DA 00DB 00D9 0131 02C6 02DC 00AF 02D8 02D9 02DA 00B8 02DD 02DB 02C7
-
diff --git a/sql/share/charsets/macromancias.conf b/sql/share/charsets/macromancias.conf
deleted file mode 100644
index a00d7d412e6..00000000000
--- a/sql/share/charsets/macromancias.conf
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Mac OS Roman, accent sensitive, case insensitive
-#
-# Sort order: Dutch, English, French, German (Duden),
-# Italian, Latin, Pogtuguese, Spanish
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 10
- 20 01 01 01 01 01 01 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 00 00 00 00 00 00 00 02 00 00 00 00 00 00 01 01
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 02
- 00 00 00 00 02 00 00 00 00 00 00 20 01 01 01 02
- 00 00 00 00 00 00 00 00 02 01 00 00 00 00 00 00
- 00 00 00 00 00 20 01 01 01 01 01 01 01 01 01 01
- 00 01 01 01 01 02 00 00 00 00 00 00 00 00 00 00
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 8A 8C 8D 8E 96 9A 9F 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD BE BF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA 88 8B 9B CE CF
- D0 D1 D2 D3 D4 D5 D6 D7 D8 D8 DA DB DC DD DE DF
- E0 E1 E2 E3 E4 89 90 87 91 8F 92 94 95 93 97 99
- F0 98 9C 9E 9D F5 F6 F7 F8 F9 FA FB FC FD FE FF
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 E7 CB E5 80 CC 81 82 83 E9
- E6 E8 EA ED EB EC 84 EE F1 EF 85 CD F2 F4 F3 86
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD AE AF
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 D7 D9 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
-
-# sort_order array (must be 256 elements)
- 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 59 63 66 68 6A 75 77 79 7B 7D 81
- 91 93 95 97 9A 9C A6 A8 AA AC B0 B2 B3 B4 B5 B6
- B7 41 51 53 57 59 63 66 68 6A 75 77 79 7B 7D 81
- 91 93 95 97 9A 9C A6 A8 AA AC B0 B8 B9 BA BB BC
- 4B 4D 55 5D 7F 8B A4 45 43 47 4B 49 4D 55 5D 5B
- 5F 61 6E 6C 70 72 7F 85 83 87 8B 89 A0 9E A2 A4
- BD BE BF C0 C1 C2 C3 99 C4 C5 C6 C7 C8 C9 4F 8D
- CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 4F 8D
- D8 D9 DA DB 65 DC DD DE DF E0 E1 43 49 89 8F 8F
- E2 E3 E4 E5 E6 E7 E8 E9 AE AE EA EB EC ED EE EF
- F0 F1 F2 F3 F4 47 5F 45 61 5B 6E 70 70 6C 85 87
- F0 83 A0 A2 9E 72 F6 F7 F8 F9 FA FB FC FD FE FF
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 00C4 00C5 00C7 00C9 00D1 00D6 00DC 00E1 00E0 00E2 00E4 00E3 00E5 00E7 00E9 00E8
- 00EA 00EB 00ED 00EC 00EE 00EF 00F1 00F3 00F2 00F4 00F6 00F5 00FA 00F9 00FB 00FC
- 2020 00B0 00A2 00A3 00A7 2022 00B6 00DF 00AE 00A9 2122 00B4 00A8 2260 00C6 00D8
- 221E 00B1 2264 2265 00A5 00B5 2202 2211 220F 03C0 222B 00AA 00BA 03A9 00E6 00F8
- 00BF 00A1 00AC 221A 0192 2248 2206 00AB 00BB 2026 00A0 00C0 00C3 00D5 0152 0153
- 2013 2014 201C 201D 2018 2019 00F7 25CA 00FF 0178 2044 20AC 2039 203A FB01 FB02
- 2021 00B7 201A 201E 2030 00C2 00CA 00C1 00CB 00C8 00CD 00CE 00CF 00CC 00D3 00D4
- F8FF 00D2 00DA 00DB 00D9 0131 02C6 02DC 00AF 02D8 02D9 02DA 00B8 02DD 02DB 02C7
-
diff --git a/sql/share/charsets/macromancsas.conf b/sql/share/charsets/macromancsas.conf
deleted file mode 100644
index 1f67148680d..00000000000
--- a/sql/share/charsets/macromancsas.conf
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Mac OS Roman, accent sensitive, case sensitive
-#
-# Sort order: Dutch, English, French, German (Duden),
-# Italian, Latin, Pogtuguese, Spanish
-#
-# ctype array (must be 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 10
- 20 01 01 01 01 01 01 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 00 00 00 00 00 00 00 02 00 00 00 00 00 00 01 01
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 02
- 00 00 00 00 02 00 00 00 00 00 00 20 01 01 01 02
- 00 00 00 00 00 00 00 00 02 01 00 00 00 00 00 00
- 00 00 00 00 00 20 01 01 01 01 01 01 01 01 01 01
- 00 01 01 01 01 02 00 00 00 00 00 00 00 00 00 00
-
-# to_lower array (must be 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 8A 8C 8D 8E 96 9A 9F 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD BE BF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA 88 8B 9B CE CF
- D0 D1 D2 D3 D4 D5 D6 D7 D8 D8 DA DB DC DD DE DF
- E0 E1 E2 E3 E4 89 90 87 91 8F 92 94 95 93 97 99
- F0 98 9C 9E 9D F5 F6 F7 F8 F9 FA FB FC FD FE FF
-
-# to_upper array (must be 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 E7 CB E5 80 CC 81 82 83 E9
- E6 E8 EA ED EB EC 84 EE F1 EF 85 CD F2 F4 F3 86
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD AE AF
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 D7 D9 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
-
-# sort_order array (must be 256 elements)
- 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 59 63 66 68 6A 75 77 79 7B 7D 81
- 91 93 95 97 9A 9C A6 A8 AA AC B0 B2 B3 B4 B5 B6
- B7 42 52 54 58 5A 64 67 69 6B 76 78 7A 7C 7E 82
- 92 94 96 98 9B 9D A7 A9 AB AD B1 B8 B9 BA BB BC
- 4B 4D 55 5D 7F 8B A4 46 44 48 4C 4A 4E 56 5E 5C
- 60 62 6F 6D 71 73 80 86 84 88 8C 8A A1 9F A3 A5
- BD BE BF C0 C1 C2 C3 99 C4 C5 C6 C7 C8 C9 4F 8D
- CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 50 8E
- D8 D9 DA DB 65 DC DD DE DF E0 E1 43 49 89 8F 90
- E2 E3 E4 E5 E6 E7 E8 E9 AF AE EA EB EC ED EE EF
- F0 F1 F2 F3 F4 47 5F 45 61 5B 6E 70 72 6C 85 87
- F0 83 A0 A2 9E 74 F6 F7 F8 F9 FA FB FC FD FE FF
-
-# Unicode mapping (must be 256 elements)
- 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
- 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
- 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
- 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
- 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
- 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
- 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 00C4 00C5 00C7 00C9 00D1 00D6 00DC 00E1 00E0 00E2 00E4 00E3 00E5 00E7 00E9 00E8
- 00EA 00EB 00ED 00EC 00EE 00EF 00F1 00F3 00F2 00F4 00F6 00F5 00FA 00F9 00FB 00FC
- 2020 00B0 00A2 00A3 00A7 2022 00B6 00DF 00AE 00A9 2122 00B4 00A8 2260 00C6 00D8
- 221E 00B1 2264 2265 00A5 00B5 2202 2211 220F 03C0 222B 00AA 00BA 03A9 00E6 00F8
- 00BF 00A1 00AC 221A 0192 2248 2206 00AB 00BB 2026 00A0 00C0 00C3 00D5 0152 0153
- 2013 2014 201C 201D 2018 2019 00F7 25CA 00FF 0178 2044 20AC 2039 203A FB01 FB02
- 2021 00B7 201A 201E 2030 00C2 00CA 00C1 00CB 00C8 00CD 00CE 00CF 00CC 00D3 00D4
- F8FF 00D2 00DA 00DB 00D9 0131 02C6 02DC 00AF 02D8 02D9 02DA 00B8 02DD 02DB 02C7
-
diff --git a/sql/share/charsets/pclatin1.xml b/sql/share/charsets/pclatin1.xml
new file mode 100644
index 00000000000..742dcaec459
--- /dev/null
+++ b/sql/share/charsets/pclatin1.xml
@@ -0,0 +1,119 @@
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="pclatin1">
+
+<ctype>
+<map>
+ 00
+ 20 30 30 30 30 30 30 20 20 28 28 28 28 28 30 30
+ 30 30 30 30 30 30 30 30 30 30 20 30 30 30 30 30
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
+ 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
+ 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
+ 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 30
+ 02 02 02 02 02 02 02 02 02 02 02 02 02 02 01 01
+ 01 02 01 02 02 02 02 02 02 01 01 10 10 10 10 10
+ 02 02 02 02 02 01 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 20
+</map>
+</ctype>
+
+
+<lower>
+<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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
+ 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
+ 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
+ 87 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 84 86
+ 82 91 91 93 94 95 96 97 98 94 81 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A4 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+</map>
+</lower>
+
+
+<upper>
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 80 9A 90 41 8E 41 8F 80 45 45 45 49 49 49 8E 8F
+ 90 92 92 4F 99 4F 55 55 59 99 9A 9B 9C 9D 9E 9F
+ 41 49 4F 55 A5 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+</map>
+</upper>
+
+
+<unicode>
+<map>
+0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000a 000b 000c 000d 000e 000f
+0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001a 001b 001c 001d 001e 001f
+0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002a 002b 002c 002d 002e 002f
+0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003a 003b 003c 003d 003e 003f
+0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004a 004b 004c 004d 004e 004f
+0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005a 005b 005c 005d 005e 005f
+0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006a 006b 006c 006d 006e 006f
+0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007a 007b 007c 007d 007e 007f
+00c7 00fc 00e9 00e2 00e4 00e0 00e5 00e7 00ea 00eb 00e8 00ef 00ee 00ec 00c4 00c5
+00c9 00e6 00c6 00f4 00f6 00f2 00fb 00f9 00ff 00d6 00dc 00a2 00a3 00a5 20a7 0192
+00e1 00ed 00f3 00fa 00f1 00d1 00aa 00ba 00bf 2310 00ac 00bd 00bc 00a1 00ab 00bb
+2591 2592 2593 2502 2524 2561 2562 2556 2555 2563 2551 2557 255d 255c 255b 2510
+2514 2534 252c 251c 2500 253c 255e 255f 255a 2554 2569 2566 2560 2550 256c 2567
+2568 2564 2565 2559 2558 2552 2553 256b 256a 2518 250c 2588 2584 258c 2590 2580
+03b1 00df 0393 03c0 03a3 03c3 00b5 03c4 03a6 0398 03a9 03b4 221e 03c6 03b5 2229
+2261 00b1 2265 2264 2320 2321 00f7 2248 00b0 2219 00b7 221a 207f 00b2 25a0 00a0
+</map>
+</unicode>
+
+
+<collation name="pclatin1">
+<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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
+ 43 59 45 41 5C 41 5B 43 45 45 45 49 49 49 5C 5B
+ 45 5C 5C 4F 5D 4F 55 55 59 5D 59 24 24 24 24 24
+ 41 49 4F 55 4E 4E A6 A7 3F A9 AA AB AC 21 22 22
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+</map>
+</collation>
+
+</charset>
+
+</charsets>
diff --git a/sql/share/charsets/pclatin2.conf b/sql/share/charsets/pclatin2.xml
index dea8d085595..4402edcd847 100644
--- a/sql/share/charsets/pclatin2.conf
+++ b/sql/share/charsets/pclatin2.xml
@@ -1,4 +1,11 @@
-# ctype array (must be 257 elements)
+<?xml version='1.0' encoding="utf-8"?>
+
+<charsets>
+
+<charset name="pclatin2">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -16,8 +23,12 @@
02 01 01 01 02 01 01 01 02 00 00 00 00 01 01 00
01 02 01 01 02 02 01 02 01 01 02 01 02 01 02 00
00 00 00 00 00 00 00 00 00 00 00 02 01 02 00 48
+</map>
+</ctype>
-# to_lower array (must be 256 elements)
+
+<lower>
+<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
@@ -34,8 +45,12 @@
D0 D0 D4 89 D4 E5 A1 8C D8 D9 DA DB DC EE 85 DF
A2 E1 93 E4 E4 E5 E7 E7 EA A3 E8 FB EC EC EE EF
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
+</map>
+</lower>
+
-# to_upper array (must be 256 elements)
+<upper>
+<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
@@ -52,26 +67,12 @@
D1 D1 D2 D3 D2 D5 D6 D7 B7 D9 DA DB DC DD DE DF
E0 E1 E2 E3 E3 D5 E6 E6 E8 E9 E8 EB ED ED DD EF
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA EB FC FC FE FF
+</map>
+</upper>
-# sort_order array (must be 256 elements)
- 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 47 48 4C 4F 54 55 56 57 5A 5B 5C 5E 5F 62
- 67 68 69 6C 71 74 75 76 77 78 7B 90 91 92 93 94
- 95 41 47 48 4C 4F 54 55 56 57 5A 5B 5C 5E 5F 62
- 67 68 69 6C 71 74 75 76 77 78 7B 96 97 98 99 9A
- 48 74 4F 41 41 74 48 48 5C 4F 62 62 57 7B 41 48
- 4F 5C 5C 62 62 5C 5C 6C 6C 62 74 71 71 5C 9E 48
- 41 57 62 74 41 41 7B 7B 4F 4F AA 7B 48 6C AE AF
- B0 B1 B2 B3 B4 41 41 4F 6C B5 BA BB BC 7B 7B BF
- C0 C1 C2 C3 C4 C5 41 41 C8 C9 CA CB CC CD CE CF
- 4C 4C 4C 4F 4C 60 57 57 4F D9 DA DB DC 71 74 DF
- 62 70 62 60 60 60 6C 6C 69 74 69 74 78 78 71 EF
- F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA 74 69 69 FE FF
-# Unicode mappping (must be 256 elements)
+<unicode>
+<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
@@ -88,4 +89,31 @@
0111 0110 010E 00CB 010F 0147 00CD 00CE 011B 2518 250C 2588 2584 0162 016E 2580
00D3 00DF 00D4 0143 0144 0148 0160 0161 0154 00DA 0155 0170 00FD 00DD 0163 00B4
00AD 02DD 02DB 02C7 02D8 00A7 00F7 00B8 00B0 00A8 02D9 0171 0158 0159 25A0 00A0
+</map>
+</unicode>
+
+
+<collation name="pclatin2">
+<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 47 48 4C 4F 54 55 56 57 5A 5B 5C 5E 5F 62
+ 67 68 69 6C 71 74 75 76 77 78 7B 90 91 92 93 94
+ 95 41 47 48 4C 4F 54 55 56 57 5A 5B 5C 5E 5F 62
+ 67 68 69 6C 71 74 75 76 77 78 7B 96 97 98 99 9A
+ 48 74 4F 41 41 74 48 48 5C 4F 62 62 57 7B 41 48
+ 4F 5C 5C 62 62 5C 5C 6C 6C 62 74 71 71 5C 9E 48
+ 41 57 62 74 41 41 7B 7B 4F 4F AA 7B 48 6C AE AF
+ B0 B1 B2 B3 B4 41 41 4F 6C B5 BA BB BC 7B 7B BF
+ C0 C1 C2 C3 C4 C5 41 41 C8 C9 CA CB CC CD CE CF
+ 4C 4C 4C 4F 4C 60 57 57 4F D9 DA DB DC 71 74 DF
+ 62 70 62 60 60 60 6C 6C 69 74 69 74 78 78 71 EF
+ F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA 74 69 69 FE FF
+</map>
+</collation>
+
+</charset>
+</charsets>
diff --git a/sql/share/charsets/swe7.conf b/sql/share/charsets/swe7.xml
index 49938800f39..ffa1d90608d 100644
--- a/sql/share/charsets/swe7.conf
+++ b/sql/share/charsets/swe7.xml
@@ -1,6 +1,11 @@
-# Configuration file for the swe7 character set
+<?xml version='1.0' encoding="utf-8"?>
-# ctype array (must have 257 elements)
+<charsets>
+
+<charset name="swe7">
+
+<ctype>
+<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
@@ -18,8 +23,12 @@
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+</map>
+</ctype>
+
-# to_lower array (must have 256 elements)
+<lower>
+<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
@@ -36,8 +45,12 @@
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
+</map>
+</lower>
-# to_upper array (must have 256 elements)
+
+<upper>
+<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
@@ -54,26 +67,12 @@
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
+</map>
+</upper>
-# sort_order array (must have 256 elements)
- 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
- 45 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5C 5D 5B 59 5F
- 45 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5C 5D 5B 59 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-# Unicode mapping (256 elements)
+<unicode>
+<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
@@ -90,3 +89,33 @@
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+</map>
+</unicode>
+
+
+<collation name="swe7">
+<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
+ 45 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5C 5D 5B 59 5F
+ 45 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 5C 5D 5B 59 7F
+ 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
+ 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
+ A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
+ B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
+</map>
+</collation>
+
+</charset>
+
+</charsets>
+
+
diff --git a/sql/share/charsets/usa7.conf b/sql/share/charsets/usa7.conf
deleted file mode 100644
index 380fc9b5d8b..00000000000
--- a/sql/share/charsets/usa7.conf
+++ /dev/null
@@ -1,92 +0,0 @@
-# Configuration file for the usa7 character set
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5C 5D 5B 5E 5F
- 45 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 59 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE 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
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 0000
-0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
diff --git a/sql/share/charsets/win1251.conf b/sql/share/charsets/win1251.conf
deleted file mode 100644
index 2164cb36b9e..00000000000
--- a/sql/share/charsets/win1251.conf
+++ /dev/null
@@ -1,100 +0,0 @@
-# Configuration file for the win1251 character set
-
-# NOTE: this character set is deprecated. Please don't use it
-# unless you must because of old tables.
-#
-# If you want to convert your files to charset cp1251, you can do:
-#
-# myisamchk -rq --set-character-set-name=cp1251 *.MYI
-
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 01 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 02 10 10 10 10 10 10 10
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 B8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
- E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
- F0 F1 F2 F3 F4 F5 F5 F7 F8 F9 FA FB FC FD FE FF
- 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 A8 B9 BA BB BC BD BE BF
- C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D5 D7 D8 D9 DA DB DC DD DE DF
- 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
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
- 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 A3 A4 A5 A6 A7 C6 A9 AA AB AC AD AE AF
- B0 B1 B2 B3 B4 B5 B6 B7 C6 B9 BA BB BC BD BE BF
- C0 C1 C2 C3 C4 C5 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
- C0 C1 C2 C3 C4 C5 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
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0402 0403 201A 0453 201E 2026 2020 2021 0000 2030 0409 2039 040A 040C 040B 040F
-0452 2018 2019 201C 201D 2022 2013 2014 0000 2122 0459 203A 045A 045C 045B 045F
-00A0 040E 045E 0408 00A4 0490 00A6 00A7 0401 00A9 0404 00AB 00AC 00AD 00AE 0407
-00B0 00B1 0406 0456 0491 00B5 00B6 00B7 0451 2116 0454 00BB 0458 0405 0455 0457
-0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 041A 041B 041C 041D 041E 041F
-0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F
-0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 043A 043B 043C 043D 043E 043F
-0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F
diff --git a/sql/share/charsets/win1251ukr.conf b/sql/share/charsets/win1251ukr.conf
deleted file mode 100644
index da08e4c7d6f..00000000000
--- a/sql/share/charsets/win1251ukr.conf
+++ /dev/null
@@ -1,95 +0,0 @@
-# Configuration file for the win1251ukr character set
-
-# it's really, just a cp1251 charset with Ukranian letter
-# marked as "letters"
-
-# ctype array (must have 257 elements)
- 00
- 20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
- 10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
- 10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
- 10 10 10 10 10 10 10 10 01 10 01 10 10 10 10 01
- 10 10 01 02 10 10 10 10 02 10 02 10 10 10 10 02
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
-
-# to_lower array (must have 256 elements)
- 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 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
- 20 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 20 20 20 20 20 A5 20 20 A8 20 AA 20 20 20 20 AF
- 20 20 B2 B2 A5 20 20 20 A8 20 AA 20 20 20 20 AF
- 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
- 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
-
-# to_upper array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 20 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 20 20 20 20 20 B4 20 20 B8 20 BA 20 20 20 20 BF
- 20 20 B3 B3 B4 20 20 20 B8 20 BA 20 20 20 20 BF
- 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
- 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
-
-# sort_order array (must have 256 elements)
- 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 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
- 20 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
- A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4
- B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 C4
- C5 C6 C7 C8 C9 84 CA CB 88 CC 87 CD CE CF D0 8D
- D1 D2 8C 8C 84 D3 D4 D5 88 D6 87 D7 D8 D9 DA 8D
- 80 81 82 83 85 86 89 8A 8B 8E 8F 90 91 92 93 94
- 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2 A3 A4
- 80 81 82 83 85 86 89 8A 8B 8E 8F 90 91 92 93 94
- 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2 A3 A4
-
-# Unicode mapping (256 elements)
-0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
-0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
-0402 0403 201A 0453 201E 2026 2020 2021 0000 2030 0409 2039 040A 040C 040B 040F
-0452 2018 2019 201C 201D 2022 2013 2014 0000 2122 0459 203A 045A 045C 045B 045F
-00A0 040E 045E 0408 00A4 0490 00A6 00A7 0401 00A9 0404 00AB 00AC 00AD 00AE 0407
-00B0 00B1 0406 0456 0491 00B5 00B6 00B7 0451 2116 0454 00BB 0458 0405 0455 0457
-0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 041A 041B 041C 041D 041E 041F
-0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F
-0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 043A 043B 043C 043D 043E 043F
-0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F
diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt
index 6c1a6db674b..6c3196bfeba 100644
--- a/sql/share/czech/errmsg.txt
+++ b/sql/share/czech/errmsg.txt
@@ -208,8 +208,8 @@ v/*
"Tabulka '%-.64s' je ozna-Bèena jako poru¹ená a poslední (automatická?) oprava se nezdaøila",
"Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -259,3 +259,4 @@ v/*
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt
index 2067f13d593..dcc016511dd 100644
--- a/sql/share/danish/errmsg.txt
+++ b/sql/share/danish/errmsg.txt
@@ -202,8 +202,8 @@
"Tabellen '%-.64s' er markeret med fejl og sidste (automatiske?) REPAIR fejlede",
"Advarsel: Visse data i tabeller der ikke understøtter transaktioner kunne ikke tilbagestilles",
"Fler-udtryks transaktion krævede mere plads en 'max_binlog_cache_size' bytes. Forhøj værdien af denne variabel og prøv igen',
-"Denne handling kunne ikke udføres med kørende slave, brug først kommandoen SLAVE STOP",
-"Denne handling kræver en kørende slave. Konfigurer en slave og brug kommandoen SLAVE START",
+"Denne handling kunne ikke udføres med kørende slave, brug først kommandoen STOP SLAVE",
+"Denne handling kræver en kørende slave. Konfigurer en slave og brug kommandoen START SLAVE",
"Denne server er ikke konfigureret som slave. Ret in config-filen eller brug kommandoen CHANGE MASTER TO",
"Kunne ikke initialisere master info-struktur. Check om rettigheder i master.info",
"Kunne ikke danne en slave-tråd. Check systemressourcerne",
@@ -253,3 +253,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt
index 0c8d652653f..6091616fc4a 100644
--- a/sql/share/dutch/errmsg.txt
+++ b/sql/share/dutch/errmsg.txt
@@ -210,8 +210,8 @@
"Tabel '%-.64s' staat als gecrashed gemarkeerd en de laatste (automatische?) reparatie poging mislukte",
"Waarschuwing: Roll back mislukt voor sommige buiten transacties gewijzigde tabellen",
"Multi-statement transactie vereist meer dan 'max_binlog_cache_size' bytes opslag. Verhoog deze mysqld variabele en probeer opnieuw',
-"Deze operatie kan niet worden uitgevoerd met een actieve slave, doe eerst SLAVE STOP",
-"Deze operatie vereist een actieve slave, configureer slave en doe dan SLAVE START",
+"Deze operatie kan niet worden uitgevoerd met een actieve slave, doe eerst STOP SLAVE",
+"Deze operatie vereist een actieve slave, configureer slave en doe dan START SLAVE",
"De server is niet geconfigureerd als slave, fix in configuratie bestand of met CHANGE MASTER TO",
"Kon master info structuur niet initialiseren, controleer permissies in master.info",
"Kon slave thread niet aanmaken, controleer systeem resources",
@@ -261,3 +261,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt
index 68e4f07f246..465992e63b2 100644
--- a/sql/share/english/errmsg.txt
+++ b/sql/share/english/errmsg.txt
@@ -199,8 +199,8 @@
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -217,8 +217,8 @@
"Deadlock found when trying to get lock; Try restarting transaction",
"The used table type doesn't support FULLTEXT indexes",
"Cannot add foreign key constraint",
-"Cannot add a child row: a foreign key constraint fails",
-"Cannot delete a parent row: a foreign key constraint fails",
+"Cannot add or update a child row: a foreign key constraint fails",
+"Cannot delete or update a parent row: a foreign key constraint fails",
"Error connecting to master: %-.128s",
"Error running query on master: %-.128s",
"Error when executing command %s: %-.128s",
@@ -250,3 +250,4 @@
"Every derived table must have it's own alias",
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt
index 13663cca8e2..43eb5de89a5 100644
--- a/sql/share/estonian/errmsg.txt
+++ b/sql/share/estonian/errmsg.txt
@@ -204,8 +204,8 @@
"Tabel '%-.64s' on märgitud vigaseks ja viimane (automaatne?) parandus ebaõnnestus",
"Hoiatus: mõnesid transaktsioone mittetoetavaid tabeleid ei suudetud tagasi kerida",
"Mitme lausendiga transaktsioon nõudis rohkem ruumi kui lubatud 'max_binlog_cache_size' muutujaga. Suurenda muutuja väärtust ja proovi uuesti",
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -255,3 +255,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt
index ac1764aa7eb..d7bb19c2876 100644
--- a/sql/share/french/errmsg.txt
+++ b/sql/share/french/errmsg.txt
@@ -199,8 +199,8 @@
"La table '%-.64s' est marquée 'crashed' et le dernier 'repair' a échoué",
"Attention: certaines tables ne supportant pas les transactions ont été changées et elles ne pourront pas être restituées",
"Cette transaction à commandes multiples nécessite plus de 'max_binlog_cache_size' octets de stockage, augmentez cette variable de mysqld et réessayez',
-"Cette opération ne peut être réalisée avec un esclave actif, faites SLAVE STOP d'abord",
-"Cette opération nécessite un esclave actif, configurez les esclaves et faites SLAVE START",
+"Cette opération ne peut être réalisée avec un esclave actif, faites STOP SLAVE d'abord",
+"Cette opération nécessite un esclave actif, configurez les esclaves et faites START SLAVE",
"Le server n'est pas configuré comme un esclave, changez le fichier de configuration ou utilisez CHANGE MASTER TO",
"Impossible d'initialiser les structures d'information de maître, vérifiez les permissions sur master.info",
"Impossible de créer une tâche esclave, vérifiez les ressources système",
@@ -250,3 +250,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt
index c996066d0eb..765fbd875e2 100644
--- a/sql/share/german/errmsg.txt
+++ b/sql/share/german/errmsg.txt
@@ -208,8 +208,8 @@
"Tabelle '%-.64s' ist als defekt makiert und der letzte (automatische) Reparaturversuch schlug fehl.",
"Warnung: Das Rollback konnte bei einigen Tabellen, die nicht mittels Transaktionen geändert wurden, nicht ausgeführt werden.",
"Multi-Statement Transaktionen benötigen mehr als 'max_binlog_cache_size' Bytes An Speicher. Diese mysqld-Variable vergrössern und erneut versuchen.',
-"Diese Operation kann nicht bei einem aktiven Slave durchgeführt werden. Das Kommand SLAVE STOP muss zuerst ausgeführt werden.",
-"Diese Operation benötigt einen aktiven Slave. Slave konfigurieren und mittels SLAVE START aktivieren.",
+"Diese Operation kann nicht bei einem aktiven Slave durchgeführt werden. Das Kommand STOP SLAVE muss zuerst ausgeführt werden.",
+"Diese Operation benötigt einen aktiven Slave. Slave konfigurieren und mittels START SLAVE aktivieren.",
"Der Server ist nicht als Slave konfigiriert. Im Konfigurations-File oder mittel CHANGE MASTER TO beheben.",
"Konnte Master-Info-Struktur nicht initialisieren; Berechtigungen von master.info prüfen.",
"Konnte keinen Slave-Thread starten. System-Resourcen überprüfen.",
@@ -260,3 +260,4 @@
"Für jede abgeleitete Tabelle muss ein eigener Alias angegeben werden.",
"Select %u wurde während der Optimierung reduziert.",
"Tabelle '%-.64s', die in einem der SELECT-Befehle verwendet wurde kann nicht in %-.32s verwendet werden."
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt
index 7e680216b3e..8831d4e47b9 100644
--- a/sql/share/greek/errmsg.txt
+++ b/sql/share/greek/errmsg.txt
@@ -199,8 +199,8 @@
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -250,3 +250,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt
index 747d2be5a3b..8d6c321d316 100644
--- a/sql/share/hungarian/errmsg.txt
+++ b/sql/share/hungarian/errmsg.txt
@@ -201,8 +201,8 @@
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -252,3 +252,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt
index ef7efa925af..451ad3e058b 100644
--- a/sql/share/italian/errmsg.txt
+++ b/sql/share/italian/errmsg.txt
@@ -199,8 +199,8 @@
"La tabella '%-.64s' e` segnalata come corrotta e l'ultima ricostruzione (automatica?) e` fallita",
"Attenzione: Alcune delle modifiche alle tabelle non transazionali non possono essere ripristinate (roll back impossibile)",
"La transazione a comandi multipli (multi-statement) ha richiesto piu` di 'max_binlog_cache_size' bytes di disco: aumentare questa variabile di mysqld e riprovare',
-"Questa operazione non puo' essere eseguita con un database 'slave' che gira, lanciare prima SLAVE STOP",
-"Questa operaione richiede un database 'slave', configurarlo ed eseguire SLAVE START",
+"Questa operazione non puo' essere eseguita con un database 'slave' che gira, lanciare prima STOP SLAVE",
+"Questa operaione richiede un database 'slave', configurarlo ed eseguire START SLAVE",
"Il server non e' configurato come 'slave', correggere il file di configurazione cambiando CHANGE MASTER TO",
"Impossibile inizializzare la struttura 'master info', controllare i permessi sul file master.info",
"Impossibile creare il thread 'slave', controllare le risorse di sistema",
@@ -219,25 +219,25 @@
"Impossibile aggiungere il vincolo di integrita' referenziale (foreign key constraint)",
"Impossibile aggiungere la riga: un vincolo d'integrita' referenziale non e' soddisfatto",
"Impossibile cancellare la riga: un vincolo d'integrita' referenziale non e' soddisfatto",
-"Error connecting to master: %-.128s",
-"Error running query on master: %-.128s",
-"Error when executing command %s: %-.128s",
-"Wrong usage of %s and %s",
-"The used SELECT statements have a different number of columns",
-"Can't execute the query because you have a conflicting read lock",
-"Mixing of transactional and non-transactional tables is disabled",
-"Option '%s' used twice in statement",
-"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
-"Access denied. You need the %-.128s privilege for this operation",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
-"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
-"Variable '%-.64s' doesn't have a default value",
-"Variable '%-.64s' can't be set to the value of '%-.64s'",
-"Wrong argument type to variable '%-.64s'",
-"Variable '%-.64s' can only be set, not read",
-"Wrong usage/placement of '%s'",
-"This version of MySQL doesn't yet support '%s'",
-"Got fatal error %d: '%-.128s' from master when reading data from binary log",
+"Errore durante la connessione al master: %-.128s",
+"Errore eseguendo una query sul master: %-.128s",
+"Errore durante l'esecuzione del comando %s: %-.128s",
+"Uso errato di %s e %s",
+"La SELECT utilizzata ha un numero di colonne differente",
+"Impossibile eseguire la query perche' c'e' un conflitto con in lock di lettura",
+"E' disabilitata la possibilita' di mischiare tabelle transazionali e non-transazionali",
+"L'opzione '%s' e' stata usata due volte nel comando",
+"L'utente '%-.64s' ha ecceduto la risorsa '%s' (valore corrente: %ld)",
+"Accesso non consentito. Serve il privilegio %-.128s per questa operazione",
+"La variabile '%-.64s' e' una variabile locale ( LOCAL ) e non puo' essere cambiata usando SET GLOBAL",
+"La variabile '%-.64s' e' una variabile globale ( GLOBAL ) e deve essere cambiata usando SET GLOBAL",
+"La variabile '%-.64s' non ha un valore di default",
+"Alla variabile '%-.64s' non puo' essere assegato il valore '%-.64s'",
+"Tipo di valore errato per la variabile '%-.64s'",
+"Alla variabile '%-.64s' e' di sola scrittura quindi puo' essere solo assegnato un valore, non letto",
+"Uso/posizione di '%s' sbagliato",
+"Questa versione di MySQL non supporta ancora '%s'",
+"Errore fatale %d: '%-.128s' dal master leggendo i dati dal log binario",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Cardinality error (more/less than %d columns)",
@@ -250,3 +250,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt
index 61b69000473..70ab2d6d42d 100644
--- a/sql/share/japanese/errmsg.txt
+++ b/sql/share/japanese/errmsg.txt
@@ -201,8 +201,8 @@
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -252,3 +252,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt
index 9c367c43551..c18c3ed3873 100644
--- a/sql/share/korean/errmsg.txt
+++ b/sql/share/korean/errmsg.txt
@@ -199,8 +199,8 @@
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -250,3 +250,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt
index a3fed98e81a..9cd99613f52 100644
--- a/sql/share/norwegian-ny/errmsg.txt
+++ b/sql/share/norwegian-ny/errmsg.txt
@@ -201,8 +201,8 @@
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -252,3 +252,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt
index 26eabe3b91f..32fe6c30b34 100644
--- a/sql/share/norwegian/errmsg.txt
+++ b/sql/share/norwegian/errmsg.txt
@@ -201,8 +201,8 @@
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -252,3 +252,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt
index 616a5d4919b..4b59a62f991 100644
--- a/sql/share/polish/errmsg.txt
+++ b/sql/share/polish/errmsg.txt
@@ -203,8 +203,8 @@
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -254,3 +254,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt
index 04a9afaa808..7236bd86652 100644
--- a/sql/share/portuguese/errmsg.txt
+++ b/sql/share/portuguese/errmsg.txt
@@ -199,8 +199,8 @@
"Tabela '%-.64s' está marcada como danificada e a última reparação (automática?) falhou",
"Aviso: Algumas tabelas não-transacionais alteradas não puderam ser reconstituídas (rolled back)",
"Transações multi-declaradas (multi-statement transactions) requeriram mais do que o valor limite (max_binlog_cache_size) de bytes para armazenagem. Aumente o valor desta variável do mysqld e tente novamente",
-"Esta operação não pode ser realizada com um 'slave' em execução. Execute SLAVE STOP primeiro",
-"Esta operação requer um 'slave' em execução. Configure o 'slave' e execute SLAVE START",
+"Esta operação não pode ser realizada com um 'slave' em execução. Execute STOP SLAVE primeiro",
+"Esta operação requer um 'slave' em execução. Configure o 'slave' e execute START SLAVE",
"O servidor não está configurado como 'slave'. Acerte o arquivo de configuração ou use CHANGE MASTER TO",
"Não pode inicializar a estrutura de informação do 'master'. Verifique as permissões em 'master.info'",
"Não conseguiu criar 'thread' de 'slave'. Verifique os recursos do sistema",
@@ -250,3 +250,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt
index 0ae6fc8e51a..0b8bbe1c219 100644
--- a/sql/share/romanian/errmsg.txt
+++ b/sql/share/romanian/errmsg.txt
@@ -203,8 +203,8 @@
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -254,3 +254,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt
index 343178b3118..2f1eedd207c 100644
--- a/sql/share/russian/errmsg.txt
+++ b/sql/share/russian/errmsg.txt
@@ -202,8 +202,8 @@
"ôÁÂÌÉÃÁ '%-.64s' ÐÏÍÅÞÅÎÁ ËÁË ÉÓÐÏÒÞÅÎÎÁÑ É ÐÏÓÌÅÄÎÑÑ ÐÏÐÙÔËÁ ÉÓÐÒÁ×ÌÅÎÉÑ (Á×ÔÏÍÁÔÉÞÅÓËÁÑ?) ÎÅ ÕÄÁÌÁÓØ",
"ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÎÅËÏÔÏÒÙÅ ÎÅÔÒÁÎÚÁËÃÉÏÎÎÙÅ ÔÁÂÌÉÃÙ ÎÅ ÐÏÄÞÉÎÑÀÔÓÑ ROLLBACK",
"íÎÏÇÏÚÁÐÒÏÓÎÁÑ ÔÒÁÎÚÁËÃÉÑ ÔÒÅÂÕÅÔ Õ×ÅÌÉÞÅÎÉÑ 'max_binlog_cache_size' - Õ×ÅÌÉÞÔÅ ÜÔÕ ÐÅÒÅÍÅÎÎÕÀ É ÐÏÐÒÏÂÕÊÔÅ ÅÝÅ ÒÁÚ",
-"üÔÁ ÏÐÅÒÁÃÉÑ ÎÅ×ÏÚÍÏÖÎÁ Ó ÁËÔÉ×ÎÙÍ slave, ÎÁÄÏ SLAVE STOP",
-"üÔÁ ÏÐÅÒÁÃÉÑ ÎÅ×ÏÚÍÏÖÎÁ Ó ÐÁÓÓÉ×ÎÙÍ slave, ÎÁÄÏ SLAVE START",
+"üÔÁ ÏÐÅÒÁÃÉÑ ÎÅ×ÏÚÍÏÖÎÁ Ó ÁËÔÉ×ÎÙÍ slave, ÎÁÄÏ STOP SLAVE",
+"üÔÁ ÏÐÅÒÁÃÉÑ ÎÅ×ÏÚÍÏÖÎÁ Ó ÐÁÓÓÉ×ÎÙÍ slave, ÎÁÄÏ START SLAVE",
"üÔÏÔ ÓÅÒ×ÅÒ ÎÅ slave, ÉÓÐÒÁ×ØÔÅ × ËÏÎÆÉÇÕÒÁÃÉÏÎÎÏÍ ÆÁÊÌÅ ÉÌÉ ËÏÍÍÁÎÄÏÊ CHANGE MASTER TO",
"îÅ ÐÏÌÕÞÉÌÏÓØ ÉÎÉÃÉÁÌÉÚÉÒÏ×ÁÔØ ÓÔÒÕËÔÕÒÕ master info, ÐÒÏ×ÅÒÔÅ persmissions ÎÁ ÆÁÊÌÅ master.info",
"îÅ ÍÏÇÕ ÓÏÚÄÁÔØ ÐÒÏÃÅÓÓ SLAVE, ÐÒÏ×ÅÒØÔÅ ÓÉÓÔÅÍÎÙÅ ÒÅÓÕÒÓÙ",
@@ -253,3 +253,4 @@
"Every derived table must have it's own alias"
"Select %u ÂÙÌ ÕÐÒÁÚÄÎÅÎ × ÐÒÏÃÅÓÓÅ ÏÐÔÉÍÉÚÁÃÉÉ",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt
index b04b94b82e8..75cfd73f3f0 100644
--- a/sql/share/serbian/errmsg.txt
+++ b/sql/share/serbian/errmsg.txt
@@ -205,8 +205,8 @@
"Tabela '%-.64s' je markirana kao ošteæena, a zadnja (automatska?) popravka je bila neuspela",
"Upozorenje: Neke izmenjene tabele ne podržavaju komandu 'ROLLBACK'",
"Transakcija sa više stavki zahtevala je više od 'max_binlog_cache_size' bajtova skladišnog prostora. Uveæajte ovu promenljivu servera i pokušajte ponovo',
-"Ova operacija ne može biti izvršena dok je aktivan podreðeni server. Zadajte prvo komandu 'SLAVE STOP' da zaustavite podreðeni server.",
-"Ova operacija zahteva da je aktivan podreðeni server. Konfigurišite prvo podreðeni server i onda izvršite komandu 'SLAVE START'",
+"Ova operacija ne može biti izvršena dok je aktivan podreðeni server. Zadajte prvo komandu 'STOP SLAVE' da zaustavite podreðeni server.",
+"Ova operacija zahteva da je aktivan podreðeni server. Konfigurišite prvo podreðeni server i onda izvršite komandu 'START SLAVE'",
"Server nije konfigurisan kao podreðeni server, ispravite konfiguracioni file ili na njemu izvršite komandu 'CHANGE MASTER TO'",
"Nisam mogao da inicijalizujem informacionu strukturu glavnog servera, proverite da li imam privilegije potrebne za pristup file-u 'master.info'",
"Nisam mogao da startujem thread za podreðeni server, proverite sistemske resurse",
@@ -246,3 +246,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt
index f8f52f86b6a..de354f234c7 100644
--- a/sql/share/slovak/errmsg.txt
+++ b/sql/share/slovak/errmsg.txt
@@ -207,8 +207,8 @@
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-"This operation cannot be performed with a running slave, run SLAVE STOP first",
-"This operation requires a running slave, configure slave and do SLAVE START",
+"This operation cannot be performed with a running slave, run STOP SLAVE first",
+"This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
"Could not initialize master info structure, check permisions on master.info",
"Could not create slave thread, check system resources",
@@ -258,3 +258,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt
index 674d36e9d8c..a528c3e6b36 100644
--- a/sql/share/spanish/errmsg.txt
+++ b/sql/share/spanish/errmsg.txt
@@ -200,8 +200,8 @@
"Tabla '%-.64s' está marcada como crashed y la última reparación (automactica?) falló",
"Aviso: Algunas tablas no transancionales no pueden tener rolled back",
"Multipla transición necesita mas que 'max_binlog_cache_size' bytes de almacenamiento. Aumente esta variable mysqld y tente de nuevo',
-"Esta operación no puede ser hecha con el esclavo funcionando, primero use SLAVE STOP",
-"Esta operación necesita el esclavo funcionando, configure esclavo y haga el SLAVE START",
+"Esta operación no puede ser hecha con el esclavo funcionando, primero use STOP SLAVE",
+"Esta operación necesita el esclavo funcionando, configure esclavo y haga el START SLAVE",
"El servidor no está configurado como esclavo, edite el archivo config file o con CHANGE MASTER TO",
"No puedo inicializar la estructura info del master, verifique permisiones en el master.info",
"No puedo crear el thread esclavo, verifique recursos del sistema",
@@ -251,3 +251,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt
index 052568ac30d..5473f4e8e42 100644
--- a/sql/share/swedish/errmsg.txt
+++ b/sql/share/swedish/errmsg.txt
@@ -199,8 +199,8 @@
"Tabell '%-.64s' är crashad och senast (automatiska?) reparation misslyckades",
"Några icke transaktionella tabeller kunde inte återställas vid ROLLBACK",
"Transaktionen krävde mera än 'max_binlog_cache_size' minne. Utöka denna mysqld variabel och försök på nytt",
-"Denna operation kan inte göras under replikering; Gör SLAVE STOP först",
-"Denna operation kan endast göras under replikering; Konfigurera slaven och gör SLAVE START",
+"Denna operation kan inte göras under replikering; Gör STOP SLAVE först",
+"Denna operation kan endast göras under replikering; Konfigurera slaven och gör START SLAVE",
"Servern är inte konfigurerade som en replikations slav. Ändra konfigurationsfilen eller gör CHANGE MASTER TO",
"Kunde inte initializera replications-strukturerna. Kontrollera privilegerna för 'master.info'",
"Kunde inte starta en tråd för replikering",
@@ -250,3 +250,4 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt
index 122506f17cf..0b91786d1f3 100644
--- a/sql/share/ukrainian/errmsg.txt
+++ b/sql/share/ukrainian/errmsg.txt
@@ -204,8 +204,8 @@
"ôÁÂÌÉÃÀ '%-.64s' ÍÁÒËÏ×ÁÎÏ ÑË Ú¦ÐÓÏ×ÁÎÕ ÔÁ ÏÓÔÁÎΤ (Á×ÔÏÍÁÔÉÞÎÅ?) צÄÎÏ×ÌÅÎÎÑ ÎÅ ×ÄÁÌÏÓÑ",
"úÁÓÔÅÒÅÖÅÎÎÑ: äÅÑ˦ ÎÅÔÒÁÎÚÁËæÊΦ ÚͦÎÉ ÔÁÂÌÉÃØ ÎÅ ÍÏÖÎÁ ÂÕÄÅ ÐÏ×ÅÒÎÕÔÉ",
"ôÒÁÎÚÁËÃ¦Ñ Ú ÂÁÇÁÔØÍÁ ×ÉÒÁÚÁÍÉ ×ÉÍÁÇÁ¤ ¦ÌØÛÅ Î¦Ö 'max_binlog_cache_size' ÂÁÊÔ¦× ÄÌÑ ÚÂÅÒ¦ÇÁÎÎÑ. ú¦ÌØÛÔÅ ÃÀ ÚͦÎÎÕ mysqld ÔÁ ÓÐÒÏÂÕÊÔÅ ÚÎÏ×Õ',
-"ïÐÅÒÁÃ¦Ñ ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÎÁÎÁ Ú ÚÁÐÕÝÅÎÉÍ Ð¦ÄÌÅÇÌÉÍ, ÓÐÏÞÁÔËÕ ×ÉËÏÎÁÊÔÅ SLAVE STOP",
-"ïÐÅÒÁÃ¦Ñ ×ÉÍÁÇÁ¤ ÚÁÐÕÝÅÎÏÇÏ Ð¦ÄÌÅÇÌÏÇÏ, ÚËÏÎƦÇÕÒÕÊÔŠЦÄÌÅÇÌÏÇÏ ÔÁ ×ÉËÏÎÁÊÔÅ SLAVE START",
+"ïÐÅÒÁÃ¦Ñ ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÎÁÎÁ Ú ÚÁÐÕÝÅÎÉÍ Ð¦ÄÌÅÇÌÉÍ, ÓÐÏÞÁÔËÕ ×ÉËÏÎÁÊÔÅ STOP SLAVE",
+"ïÐÅÒÁÃ¦Ñ ×ÉÍÁÇÁ¤ ÚÁÐÕÝÅÎÏÇÏ Ð¦ÄÌÅÇÌÏÇÏ, ÚËÏÎƦÇÕÒÕÊÔŠЦÄÌÅÇÌÏÇÏ ÔÁ ×ÉËÏÎÁÊÔÅ START SLAVE",
"óÅÒ×ÅÒ ÎÅ ÚËÏÎƦÇÕÒÏ×ÁÎÏ ÑË Ð¦ÄÌÅÇÌÉÊ, ×ÉÐÒÁ×ÔÅ ÃÅ Õ ÆÁÊ̦ ËÏÎƦÇÕÒÁæ§ ÁÂÏ Ú CHANGE MASTER TO",
"îÅ ÍÏÖÕ ¦Î¦Ã¦Á̦ÚÕ×ÁÔÉ ÓÔÒÕËÔÕÒÕ ÉÎÆÏÒÍÁæ§ ÇÏÌÏ×ÎÏÇÏ, ÐÅÒÅצÒÔÅ ÐÒÁ×Á ÄÏÓÔÕÐÕ ÎÁ master.info",
"îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ Ð¦ÄÌÅÇÌÕ Ç¦ÌËÕ, ÐÅÒÅצÒÔÅ ÓÉÓÔÅÍΦ ÒÅÓÕÒÓÉ",
@@ -255,3 +255,4 @@
"Every derived table must have it's own alias"
"Select %u was ÓËÁÓÏ×ÁÎÏ ÐÒÉ ÏÐÔÉÍiÚÁÃii",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
+"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" \ No newline at end of file
diff --git a/sql/slave.cc b/sql/slave.cc
index 0fbf4f67846..3e28c21c9cc 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -416,6 +416,7 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
}
if ((thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL)) && mi->slave_running)
{
+ DBUG_PRINT("info",("Terminating IO thread"));
mi->abort_slave=1;
if ((error=terminate_slave_thread(mi->io_thd,io_lock,
io_cond_lock,
@@ -426,6 +427,7 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
}
if ((thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL)) && mi->rli.slave_running)
{
+ DBUG_PRINT("info",("Terminating SQL thread"));
DBUG_ASSERT(mi->rli.sql_thd != 0) ;
mi->rli.abort_slave=1;
if ((error=terminate_slave_thread(mi->rli.sql_thd,sql_lock,
@@ -1750,7 +1752,7 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
#endif
- if ((ulong) thd->variables.max_join_size == (ulong) HA_POS_ERROR)
+ if (thd->variables.max_join_size == HA_POS_ERROR)
thd->options |= OPTION_BIG_SELECTS;
if (thd_type == SLAVE_THD_SQL)
@@ -2575,12 +2577,6 @@ static int process_io_rotate(MASTER_INFO *mi, Rotate_log_event *rev)
memcpy(mi->master_log_name, rev->new_log_ident, rev->ident_len+1);
mi->master_log_pos= rev->pos;
-
- pthread_mutex_lock(&mi->rli.data_lock);
- memcpy(mi->rli.master_log_name, rev->new_log_ident, rev->ident_len+1);
- mi->rli.master_log_pos= rev->pos;
- pthread_mutex_unlock(&mi->rli.data_lock);
-
DBUG_PRINT("info", ("master_log_pos: '%s' %d",
mi->master_log_name, (ulong) mi->master_log_pos));
#ifndef DBUG_OFF
@@ -2968,7 +2964,12 @@ static IO_CACHE *reopen_relay_log(RELAY_LOG_INFO *rli, const char **errmsg)
if ((rli->cur_log_fd=open_binlog(cur_log,rli->relay_log_name,
errmsg)) <0)
DBUG_RETURN(0);
- my_b_seek(cur_log,rli->relay_log_pos);
+ /*
+ We want to start exactly where we was before:
+ relay_log_pos Current log pos
+ pending Number of bytes already processed from the event
+ */
+ my_b_seek(cur_log,rli->relay_log_pos + rli->pending);
DBUG_RETURN(cur_log);
}
diff --git a/sql/slave.h b/sql/slave.h
index 358762306e2..8122975a809 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -188,11 +188,13 @@ typedef struct st_relay_log_info
volatile bool abort_slave, slave_running;
bool log_pos_current;
bool skip_log_purge;
-
+ bool inside_transaction;
+
st_relay_log_info()
- :info_fd(-1),cur_log_fd(-1), cur_log_old_open_count(0), abort_pos_wait(0),
- slave_run_id(0), inited(0), abort_slave(0), slave_running(0),
- log_pos_current(0), skip_log_purge(0)
+ :info_fd(-1),cur_log_fd(-1), cur_log_old_open_count(0), abort_pos_wait(0),
+ slave_run_id(0), inited(0), abort_slave(0), slave_running(0),
+ log_pos_current(0), skip_log_purge(0),
+ inside_transaction(0) /* the default is autocommit=1 */
{
relay_log_name[0] = master_log_name[0] = 0;
bzero(&info_file,sizeof(info_file));
diff --git a/sql/spatial.cc b/sql/spatial.cc
index b21d30e4b53..5c6be3c221c 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -44,7 +44,7 @@ static Geometry::GClassInfo ci_collection[] =
IMPLEMENT_GEOM(GGeometryCollection, wkbGeometryCollection, "GEOMETRYCOLLECTION")
};
-static Geometry::GClassInfo *ci_collection_end = ci_collection + sizeof(ci_collection);
+static Geometry::GClassInfo *ci_collection_end = ci_collection + sizeof(ci_collection)/sizeof(ci_collection[0]);
/***************************** Geometry *******************************/
@@ -66,7 +66,7 @@ Geometry::GClassInfo *Geometry::find_class(const char *name, size_t len)
cur_rt < ci_collection_end; ++cur_rt)
{
if ((cur_rt->m_name[len] == 0) &&
- (strncmp(cur_rt->m_name, name, len) == 0))
+ (strncasecmp(cur_rt->m_name, name, len) == 0))
{
return cur_rt;
}
@@ -506,7 +506,7 @@ int GPolygon::get_data_as_text(String *txt) const
for (; n_linear_rings>0; --n_linear_rings)
{
- if(no_data(data, 4))
+ if (no_data(data, 4))
return 1;
uint32 n_points = uint4korr(data);
data += 4;
@@ -593,7 +593,7 @@ int GPolygon::area(double *ar) const
data += (8+8);
}
lr_area=fabs(lr_area)/2;
- if(result==-1) result=lr_area;
+ if (result==-1) result=lr_area;
else result-=lr_area;
}
*ar=fabs(result);
@@ -1344,7 +1344,7 @@ int GGeometryCollection::get_mbr(MBR *mbr) const
data += 4;
for (; n_objects>0; --n_objects)
{
- if(no_data(data, WKB_HEADER_SIZE))
+ if (no_data(data, WKB_HEADER_SIZE))
return 1;
uint32 wkb_type = uint4korr(data + sizeof(char));
data += WKB_HEADER_SIZE;
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index e2ddd2cba81..b87f620901d 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1936,7 +1936,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
ulong rights, ulong col_rights,
bool revoke_grant)
{
- char grantor[HOSTNAME_LENGTH+1+USERNAME_LENGTH];
+ char grantor[HOSTNAME_LENGTH+USERNAME_LENGTH+2];
int old_row_exists = 1;
int error=0;
ulong store_table_rights, store_col_rights;
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index c1d49fdab51..a424d877919 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -403,7 +403,6 @@ void field_real::add()
length= my_sprintf(buff, (buff, "%-.*f", (int) decs, num));
#endif
-
// We never need to check further than this
end = buff + length - 1 - decs + max_notzero_dec_len;
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index f7a0c6960d4..47cbaf088a3 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -19,6 +19,7 @@
#include "mysql_priv.h"
#include "sql_acl.h"
+#include "sql_select.h"
#include <m_ctype.h>
#include <my_dir.h>
#include <hash.h>
@@ -306,7 +307,8 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
close_old_data_files(thd,thd->open_tables,1,1);
bool found=1;
/* Wait until all threads has closed all the tables we had locked */
- DBUG_PRINT("info", ("Waiting for others threads to close their open tables"));
+ DBUG_PRINT("info",
+ ("Waiting for others threads to close their open tables"));
while (found && ! thd->killed)
{
found=0;
@@ -347,12 +349,40 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
}
-/* Put all tables used by thread in free list */
+/*
+ Close all tables used by thread
+
+ SYNOPSIS
+ close_thread_tables()
+ thd Thread handler
+ lock_in_use Set to 1 (0 = default) if caller has a lock on
+ LOCK_open
+ skip_derived Set to 1 (0 = default) if we should not free derived
+ tables.
+
+ IMPLEMENTATION
+ Unlocks tables and frees derived tables.
+ Put all normal tables used by thread in free list.
+*/
-void close_thread_tables(THD *thd, bool locked)
+void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
{
DBUG_ENTER("close_thread_tables");
+ if (thd->derived_tables && !skip_derived)
+ {
+ TABLE *table, *next;
+ /*
+ Close all derived tables generated from questions like
+ SELECT * from (select * from t1))
+ */
+ for (table= thd->derived_tables ; table ; table= next)
+ {
+ next= table->next;
+ free_tmp_table(thd, table);
+ }
+ thd->derived_tables= 0;
+ }
if (thd->locked_tables)
{
ha_commit_stmt(thd); // If select statement
@@ -363,10 +393,11 @@ void close_thread_tables(THD *thd, bool locked)
if (thd->lock)
{
- mysql_unlock_tables(thd, thd->lock); thd->lock=0;
+ mysql_unlock_tables(thd, thd->lock);
+ thd->lock=0;
}
/* VOID(pthread_sigmask(SIG_SETMASK,&thd->block_signals,NULL)); */
- if (!locked)
+ if (!lock_in_use)
VOID(pthread_mutex_lock(&LOCK_open));
safe_mutex_assert_owner(&LOCK_open);
@@ -385,7 +416,7 @@ void close_thread_tables(THD *thd, bool locked)
/* Tell threads waiting for refresh that something has happened */
VOID(pthread_cond_broadcast(&COND_refresh));
}
- if (!locked)
+ if (!lock_in_use)
VOID(pthread_mutex_unlock(&LOCK_open));
/* VOID(pthread_sigmask(SIG_SETMASK,&thd->signals,NULL)); */
DBUG_VOID_RETURN;
@@ -553,7 +584,7 @@ TABLE **find_temporary_table(THD *thd, const char *db, const char *table_name)
uint key_length= (uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
TABLE *table,**prev;
- int4store(key+key_length,thd->slave_proxy_id);
+ int4store(key+key_length,thd->variables.pseudo_thread_id);
key_length += 4;
prev= &thd->temporary_tables;
@@ -593,7 +624,7 @@ bool rename_temporary_table(THD* thd, TABLE *table, const char *db,
(strmov((table->real_name=strmov(table->table_cache_key=key,
db)+1),
table_name) - table->table_cache_key)+1;
- int4store(key+table->key_length,thd->slave_proxy_id);
+ int4store(key+table->key_length,thd->variables.pseudo_thread_id);
table->key_length += 4;
return 0;
}
@@ -715,7 +746,7 @@ TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
table->tablenr=thd->current_tablenr++;
table->used_fields=0;
table->const_table=0;
- table->outer_join=table->null_row=table->maybe_null=0;
+ table->outer_join= table->null_row= table->maybe_null= table->force_index= 0;
table->status=STATUS_NO_RECORD;
table->keys_in_use_for_query= table->keys_in_use;
table->used_keys= table->keys_for_keyread;
@@ -747,7 +778,7 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
if (thd->killed)
DBUG_RETURN(0);
key_length= (uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
- int4store(key + key_length, thd->slave_proxy_id);
+ int4store(key + key_length, thd->variables.pseudo_thread_id);
for (table=thd->temporary_tables; table ; table=table->next)
{
@@ -761,6 +792,7 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
DBUG_RETURN(0);
}
table->query_id=thd->query_id;
+ thd->lex.tmp_table_used= 1;
goto reset;
}
}
@@ -873,7 +905,7 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
table->tablenr=thd->current_tablenr++;
table->used_fields=0;
table->const_table=0;
- table->outer_join=table->null_row=table->maybe_null=0;
+ table->outer_join= table->null_row= table->maybe_null= table->force_index= 0;
table->status=STATUS_NO_RECORD;
table->keys_in_use_for_query= table->keys_in_use;
table->used_keys= table->keys_for_keyread;
@@ -944,6 +976,7 @@ bool reopen_table(TABLE *table,bool locked)
tmp.status= table->status;
tmp.keys_in_use_for_query= tmp.keys_in_use;
tmp.used_keys= tmp.keys_for_keyread;
+ tmp.force_index= tmp.force_index;
/* Get state */
tmp.key_length= table->key_length;
@@ -1561,7 +1594,7 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
+1), table_name)
- tmp_table->table_cache_key)+1;
int4store(tmp_table->table_cache_key + tmp_table->key_length,
- thd->slave_proxy_id);
+ thd->variables.pseudo_thread_id);
tmp_table->key_length += 4;
if (link_in_list)
@@ -1653,6 +1686,7 @@ const Field *not_found_field= (Field*) 0x1;
thd - pointer to current thread structure
item - field item that should be found
tables - tables for scaning
+ where - table where field found will be returned via this parameter
report_error - if FALSE then do not report error if item not found and
return not_found_field;
@@ -1666,7 +1700,7 @@ const Field *not_found_field= (Field*) 0x1;
Field *
find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
- bool report_error)
+ TABLE_LIST **where, bool report_error)
{
Field *found=0;
const char *db=item->db_name;
@@ -1687,6 +1721,7 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
grant_option && !thd->master_access,1);
if (find)
{
+ (*where)= tables;
if (find == WRONG_GRANT)
return (Field*) 0;
if (db || !thd->where)
@@ -1706,19 +1741,15 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
if (!found_table && report_error)
{
char buff[NAME_LEN*2+1];
- if (db)
+ if (db && db[0])
{
strxnmov(buff,sizeof(buff)-1,db,".",table_name,NullS);
table_name=buff;
}
if (report_error)
{
- if (thd->lex.current_select->get_master()->order_list.elements)
- my_printf_error(ER_TABLENAME_NOT_ALLOWED_HERE, ER(ER_TABLENAME_NOT_ALLOWED_HERE),
- MYF(0), table_name, thd->where);
- else
- my_printf_error(ER_UNKNOWN_TABLE, ER(ER_UNKNOWN_TABLE), MYF(0),
- table_name, thd->where);
+ my_printf_error(ER_UNKNOWN_TABLE, ER(ER_UNKNOWN_TABLE), MYF(0),
+ table_name, thd->where);
}
else
return (Field*) not_found_field;
@@ -1734,6 +1765,14 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
bool allow_rowid= tables && !tables->next; // Only one table
for (; tables ; tables=tables->next)
{
+ if (!tables->table)
+ {
+ if (report_error)
+ my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MYF(0),
+ item->full_name(),thd->where);
+ return (Field*) not_found_field;
+ }
+
Field *field=find_field_in_table(thd,tables->table,name,length,
grant_option &&
!thd->master_access, allow_rowid);
@@ -1741,6 +1780,7 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
{
if (field == WRONG_GRANT)
return (Field*) 0;
+ (*where)= tables;
if (found)
{
if (!thd->where) // Returns first found
@@ -1925,6 +1965,7 @@ bool setup_tables(TABLE_LIST *tables)
table->maybe_null=test(table->outer_join=table_list->outer_join);
table->tablenr=tablenr;
table->map= (table_map) 1 << tablenr;
+ table->force_index= table_list->force_index;
if (table_list->use_index)
{
key_map map= get_key_map_from_key_list(table,
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index f0c16369ef9..dc112343844 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1064,6 +1064,8 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used,
for (; tables_used; tables_used=tables_used->next)
{
DBUG_ASSERT(!using_transactions || tables_used->table!=0);
+ if (tables_used->derived)
+ continue;
if (using_transactions &&
tables_used->table->file->has_transactions())
/*
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index e43fb0d3a0b..d2dc8ce5a42 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -90,7 +90,7 @@ THD::THD():user_time(0), fatal_error(0),
db_length=query_length=col_access=0;
query_error=0;
next_insert_id=last_insert_id=0;
- open_tables=temporary_tables=handler_tables=0;
+ open_tables= temporary_tables= handler_tables= derived_tables= 0;
current_tablenr=0;
handler_items=0;
tmp_table=0;
@@ -100,7 +100,7 @@ THD::THD():user_time(0), fatal_error(0),
start_time=(time_t) 0;
current_linfo = 0;
slave_thread = 0;
- slave_proxy_id = 0;
+ variables.pseudo_thread_id= 0;
file_id = 0;
cond_count=0;
warn_id= 0;
@@ -532,7 +532,7 @@ bool select_send::send_data(List<Item> &items)
List_iterator_fast<Item> li(items);
Protocol *protocol= thd->protocol;
char buff[MAX_FIELD_WIDTH];
- String buffer(buff, sizeof(buff), system_charset_info);
+ String buffer(buff, sizeof(buff), my_charset_bin);
DBUG_ENTER("send_data");
protocol->prepare_for_resend();
@@ -656,7 +656,7 @@ bool select_export::send_data(List<Item> &items)
DBUG_ENTER("send_data");
char buff[MAX_FIELD_WIDTH],null_buff[2],space[MAX_FIELD_WIDTH];
bool space_inited=0;
- String tmp(buff,sizeof(buff),default_charset_info),*res;
+ String tmp(buff,sizeof(buff),my_charset_bin),*res;
tmp.length(0);
if (unit->offset_limit_cnt)
@@ -717,10 +717,11 @@ bool select_export::send_data(List<Item> &items)
pos++)
{
#ifdef USE_MB
- if (use_mb(default_charset_info))
+ CHARSET_INFO *res_charset=res->charset();
+ if (use_mb(res_charset))
{
int l;
- if ((l=my_ismbchar(default_charset_info, pos, end)))
+ if ((l=my_ismbchar(res_charset, pos, end)))
{
pos += l-1;
continue;
@@ -863,7 +864,7 @@ bool select_dump::send_data(List<Item> &items)
{
List_iterator_fast<Item> li(items);
char buff[MAX_FIELD_WIDTH];
- String tmp(buff,sizeof(buff),default_charset_info),*res;
+ String tmp(buff,sizeof(buff),my_charset_bin),*res;
tmp.length(0);
Item *item;
DBUG_ENTER("send_data");
@@ -923,10 +924,10 @@ select_subselect::select_subselect(Item_subselect *item)
this->item=item;
}
-bool select_singleval_subselect::send_data(List<Item> &items)
+bool select_singlerow_subselect::send_data(List<Item> &items)
{
- DBUG_ENTER("select_singleval_subselect::send_data");
- Item_singleval_subselect *it= (Item_singleval_subselect *)item;
+ DBUG_ENTER("select_singlerow_subselect::send_data");
+ Item_singlerow_subselect *it= (Item_singlerow_subselect *)item;
if (it->assigned())
{
my_message(ER_SUBSELECT_NO_1_ROW, ER(ER_SUBSELECT_NO_1_ROW), MYF(0));
@@ -938,32 +939,9 @@ bool select_singleval_subselect::send_data(List<Item> &items)
DBUG_RETURN(0);
}
List_iterator_fast<Item> li(items);
- Item *val_item= li++; // Only one (single value subselect)
- /*
- Following val() call have to be first, because function AVG() & STD()
- calculate value on it & determinate "is it NULL?".
- */
- it->real_value= val_item->val_result();
- if ((it->null_value= val_item->null_value))
- {
- it->reset();
- }
- else
- {
- it->max_length= val_item->max_length;
- it->decimals= val_item->decimals;
- it->set_charset(val_item->charset());
- it->int_value= val_item->val_int_result();
- String *s= val_item->str_result(&it->string_value);
- if (s != &it->string_value)
- {
- it->string_value.set(*s, 0, s->length());
- }
- // TODO: remove when correct charset handling appeared for Item
- it->str_value.set(*s, 0, s->length()); // store charset
-
- it->res_type= val_item->result_type();
- }
+ Item *val_item;
+ for (uint i= 0; (val_item= li++); i++)
+ it->store(i, val_item);
it->assigned(1);
DBUG_RETURN(0);
}
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 346b6e7851f..5acbb622a14 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -351,8 +351,8 @@ struct system_variables
{
ulonglong myisam_max_extra_sort_file_size;
ulonglong myisam_max_sort_file_size;
- ulonglong select_limit;
- ulonglong max_join_size;
+ ha_rows select_limit;
+ ha_rows max_join_size;
ulong bulk_insert_buff_size;
ulong join_buff_size;
ulong long_query_time;
@@ -377,6 +377,12 @@ struct system_variables
ulong tmp_table_size;
ulong tx_isolation;
+ /*
+ In slave thread we need to know in behalf of which
+ thread the query is being run to replicate temp tables properly
+ */
+ ulong pseudo_thread_id;
+
my_bool log_warnings;
my_bool low_priority_updates;
@@ -435,7 +441,7 @@ public:
uint client_capabilities; /* What the client supports */
/* Determines if which non-standard SQL behaviour should be enabled */
uint sql_mode;
- uint max_client_packet_length;
+ ulong max_client_packet_length;
ulong master_access; /* Global privileges from mysql.user */
ulong db_access; /* Privileges for current db */
@@ -445,7 +451,7 @@ public:
handler_tables - list of tables that were opened with HANDLER OPEN
and are still in use by this thread
*/
- TABLE *open_tables,*temporary_tables, *handler_tables;
+ TABLE *open_tables,*temporary_tables, *handler_tables, *derived_tables;
// TODO: document the variables below
MYSQL_LOCK *lock; /* Current locks */
MYSQL_LOCK *locked_tables; /* Tables locked with LOCK */
@@ -534,11 +540,6 @@ public:
each thread that is using LOG_INFO needs to adjust the pointer to it
*/
LOG_INFO* current_linfo;
- /*
- In slave thread we need to know in behalf of which
- thread the query is being run to replicate temp tables properly
- */
- ulong slave_proxy_id;
NET* slave_net; // network connection from slave -> m.
my_off_t log_pos;
/* Used by the sys_var class to store temporary values */
@@ -839,10 +840,10 @@ public:
};
/* Single value subselect interface class */
-class select_singleval_subselect :public select_subselect
+class select_singlerow_subselect :public select_subselect
{
public:
- select_singleval_subselect(Item_subselect *item):select_subselect(item){}
+ select_singlerow_subselect(Item_subselect *item):select_subselect(item){}
bool send_data(List<Item> &items);
};
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 311bf29aee7..1c441ea7a26 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -114,10 +114,12 @@ static bool load_db_opt(const char *path, HA_CREATE_INFO *create)
{
if (!strncmp(buf,"default-character-set", (pos-buf)))
{
- if (!(create->table_charset=get_charset_by_name(pos+1, MYF(0))))
+ if (strcmp(pos+1,"DEFAULT"))
{
- sql_print_error(ER(ER_UNKNOWN_CHARACTER_SET),
- pos+1);
+ if (!(create->table_charset=get_charset_by_name(pos+1, MYF(0))))
+ {
+ sql_print_error(ER(ER_UNKNOWN_CHARACTER_SET),pos+1);
+ }
}
}
}
@@ -333,7 +335,8 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
}
else
{
- store_warning(thd,ER_DB_DROP_EXISTS,db);
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_DB_DROP_EXISTS, ER(ER_DB_DROP_EXISTS), db);
if (!silent)
send_ok(thd,0);
}
@@ -468,7 +471,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
my_dirend(dirp);
if (thd->killed ||
- (tot_list && mysql_rm_table_part2_with_lock(thd, tot_list, 1, 1)))
+ (tot_list && mysql_rm_table_part2_with_lock(thd, tot_list, 1, 0, 1)))
DBUG_RETURN(-1);
/*
@@ -675,9 +678,13 @@ int mysqld_show_create_db(THD *thd, const char *dbname,
to=strxmov(to,"`",dbname,"`", NullS);
if (create.table_charset)
- to= strxmov(to," /*!40100 DEFAULT CHARACTER SET ",
- create.table_charset->name,"*/",NullS);
-
+ {
+ int cl= (create.table_charset->state & MY_CS_PRIMARY) ? 0 : 1;
+ to= strxmov(to," /*!40100"
+ " DEFAULT CHARACTER SET ",create.table_charset->csname,
+ cl ? " COLLATE " : "", cl ? create.table_charset->name : "",
+ " */",NullS);
+ }
protocol->store(path, (uint) (to-path));
if (protocol->write())
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 88da3e2505c..cfa7170fd0a 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -536,7 +536,7 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK);
bzero((char*) &create_info,sizeof(create_info));
create_info.auto_increment_value= table->file->auto_increment_value;
- create_info.table_charset=default_charset_info;
+ create_info.table_charset=table->table_charset;
db_type table_type=table->db_type;
strmov(path,table->path);
@@ -580,7 +580,7 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
}
bzero((char*) &create_info,sizeof(create_info));
- create_info.table_charset=default_charset_info;
+ create_info.table_charset=table_list->table->table_charset;
*fn_ext(path)=0; // Remove the .frm extension
error= ha_create_table(path,&create_info,1) ? -1 : 0;
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index f7d845e9e36..0a2e2947add 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2002-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
/*
Derived tables
- These were introduced by Monty and Sinisa <sinisa@mysql.com>
+ These were introduced by Sinisa <sinisa@mysql.com>
*/
@@ -38,17 +38,26 @@ static const char *any_db="*any*"; // Special symbol for check_access
t TABLE_LIST for the upper SELECT
IMPLEMENTATION
-
- Derived table is resolved with temporary table. It is created based on the
- queries defined. After temporary table is created, if this is not EXPLAIN,
- then the entire unit / node is deleted. unit is deleted if UNION is used
- for derived table and node is deleted is it is a simple SELECT.
+ Derived table is resolved with temporary table. It is created based on the
+ queries defined. After temporary table is created, if this is not EXPLAIN,
+ then the entire unit / node is deleted. unit is deleted if UNION is used
+ for derived table and node is deleted is it is a simple SELECT.
+
+ After table creation, the above TABLE_LIST is updated with a new table.
- After table creation, the above TABLE_LIST is updated with a new table.
+ This function is called before any command containing derived table
+ is executed.
- This function is called before any command containing derived table is executed.
+ Derived tables is stored in thd->derived_tables and freed in
+ close_thread_tables()
- TODO: To move creation of derived tables IN open_and_lock_tables()
+ TODO
+ Move creation of derived tables in open_and_lock_tables()
+
+ RETURN
+ 0 ok
+ 1 Error
+ -1 Error and error message given
*/
@@ -57,20 +66,21 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
SELECT_LEX *sl= unit->first_select();
List<Item> item_list;
TABLE *table;
- int res= 0;
+ int res;
select_union *derived_result;
TABLE_LIST *tables= (TABLE_LIST *)sl->table_list.first;
TMP_TABLE_PARAM tmp_table_param;
bool is_union=sl->next_select() && sl->next_select()->linkage == UNION_TYPE;
+ SELECT_LEX_NODE *save_current_select= lex->current_select;
DBUG_ENTER("mysql_derived");
-
-/*
- In create_total_list, derived tables have to be treated in case of EXPLAIN,
- This is because unit/node is not deleted in that case. Current code in this
- function has to be improved to recognize better when this function is called
- from derived tables and when from other functions.
-*/
+ /*
+ In create_total_list, derived tables have to be treated in case of
+ EXPLAIN, This is because unit/node is not deleted in that
+ case. Current code in this function has to be improved to
+ recognize better when this function is called from derived tables
+ and when from other functions.
+ */
if (is_union && unit->create_total_list(thd, lex, &tables))
DBUG_RETURN(-1);
@@ -91,40 +101,33 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
{
if (is_union)
{
-/*
- The following code is a re-do of fix_tables_pointers() found in sql_select.cc
- for UNION's within derived tables. The only difference is in navigation, as in
- derived tables we care for this level only.
-
- fix_tables_pointers makes sure that in UNION's we do not open single table twice
- if found in different SELECT's.
-
-*/
- for (SELECT_LEX *sel= sl;
- sel;
- sel= sel->next_select())
- {
- for (TABLE_LIST *cursor= (TABLE_LIST *)sel->table_list.first;
- cursor;
- cursor=cursor->next)
- cursor->table= cursor->table_list->table;
- }
+ /*
+ The following code is a re-do of fix_tables_pointers() found
+ in sql_select.cc for UNION's within derived tables. The only
+ difference is in navigation, as in derived tables we care for
+ this level only.
+
+ */
+ for (SELECT_LEX *sel= sl; sel; sel= sel->next_select())
+ relink_tables(sel);
}
+ lex->current_select= sl;
if (setup_fields(thd,tables,item_list,0,0,1))
{
- res=-1;
+ res= -1;
goto exit;
}
bzero((char*) &tmp_table_param,sizeof(tmp_table_param));
tmp_table_param.field_count=item_list.elements;
if (!(table=create_tmp_table(thd, &tmp_table_param, item_list,
- (ORDER*) 0, is_union && !unit->union_option, 1,
+ (ORDER*) 0,
+ is_union && !unit->union_option, 1,
(sl->options | thd->options |
TMP_TABLE_ALL_COLUMNS),
HA_POS_ERROR)))
{
- res=-1;
+ res= -1;
goto exit;
}
@@ -138,10 +141,8 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
if (unit->select_limit_cnt == HA_POS_ERROR)
sl->options&= ~OPTION_FOUND_ROWS;
- SELECT_LEX_NODE *save_current_select= lex->current_select;
- lex->current_select= sl;
if (is_union)
- res=mysql_union(thd,lex,derived_result,unit);
+ res= mysql_union(thd,lex,derived_result,unit);
else
res= mysql_select(thd, tables, sl->item_list,
sl->where, (ORDER *) sl->order_list.first,
@@ -149,13 +150,15 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
sl->having, (ORDER*) NULL,
sl->options | thd->options | SELECT_NO_UNLOCK,
derived_result, unit, sl, 0);
- lex->current_select= save_current_select;
if (!res)
{
-// Here we entirely fix both TABLE_LIST and list of SELECT's as there were no derived tables
+ /*
+ Here we entirely fix both TABLE_LIST and list of SELECT's as
+ there were no derived tables
+ */
if (derived_result->flush())
- res=1;
+ res= 1;
else
{
t->real_name=table->real_name;
@@ -164,27 +167,29 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
table->tmp_table=TMP_TABLE;
if (lex->describe)
{
+ // to fix a problem in EXPLAIN
if (tables)
- tables->table_list->table=tables->table; // to fix a problem in EXPLAIN
+ tables->table_list->table=tables->table;
}
else
- {
- if (is_union)
- unit->exclude();
- else
- sl->exclude();
- }
- t->db=(char *)"";
- t->derived=(SELECT_LEX *)0; // just in case ...
+ unit->exclude();
+ t->db= (char *)"";
+ t->derived=(SELECT_LEX *) 1; // just in case ...
table->file->info(HA_STATUS_VARIABLE);
}
}
delete derived_result;
}
if (res)
- free_tmp_table(thd,table);
+ free_tmp_table(thd, table);
+ else
+ {
+ table->next= thd->derived_tables;
+ thd->derived_tables= table;
+ }
exit:
- close_thread_tables(thd);
+ lex->current_select= save_current_select;
+ close_thread_tables(thd, 0, 1);
}
DBUG_RETURN(res);
}
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index c9684855b86..5508be5167a 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -105,31 +105,29 @@ void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, uint code,
}
/*
- Store warning to the list
+ Push the warning/error to error list if there is still room in the list
+
+ SYNOPSIS
+ push_warning_printf()
+ thd Thread handle
+ level Severity of warning (note, warning, error ...)
+ code Error number
+ msg Clear error message
*/
-void store_warning(THD *thd, uint errcode, ...)
+void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
+ uint code, const char *format, ...)
{
-#if TESTS_TO_BE_FIXED
va_list args;
- const char *format;
char warning[ERRMSGSIZE+20];
- DBUG_ENTER("store_warning");
- DBUG_PRINT("enter",("warning: %u",errcode));
+ DBUG_ENTER("push_warning_printf");
+ DBUG_PRINT("enter",("warning: %u", code));
- va_start(args,errcode);
- if (errcode)
- format= ER(errcode);
- else
- {
- format=va_arg(args,char*);
- errcode= ER_UNKNOWN_ERROR;
- }
- (void) vsprintf (warning,format,args);
+ va_start(args,format);
+ my_vsnprintf(warning, sizeof(warning), format, args);
va_end(args);
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, errcode, warning);
+ push_warning(thd, level, code, warning);
DBUG_VOID_RETURN;
-#endif
}
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 97703cd6b20..0d8af46dbf6 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -109,6 +109,10 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
if (cond && (cond->check_cols(1) || cond->fix_fields(thd, tables, &cond)))
return -1;
+ /* InnoDB needs to know that this table handle is used in the HANDLER */
+
+ table->file->init_table_handle_for_HANDLER();
+
if (keyname)
{
if ((keyno=find_type(keyname, &table->keynames, 1+2)-1)<0)
@@ -131,8 +135,6 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
insert_fields(thd,tables,tables->db,tables->alias,&it);
- table->file->init_table_handle_for_HANDLER(); // Only InnoDB requires it
-
select_limit+=offset_limit;
protocol->send_fields(&list,1);
@@ -142,6 +144,12 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
if (!lock)
goto err0; // mysql_lock_tables() printed error message already
+ /* In ::external_lock InnoDB resets the fields which tell it that
+ the handle is used in the HANDLER interface. Tell it again that
+ we are using it for HANDLER. */
+
+ table->file->init_table_handle_for_HANDLER();
+
for (num_rows=0; num_rows < select_limit; )
{
switch (mode) {
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index db28823a43d..013101a0ecc 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -22,6 +22,8 @@
** Get help on string
***************************************************************************/
+#define help_charset my_charset_latin1
+
MI_INFO *open_help_file(THD *thd, const char *name)
{
char path[FN_REFLEN];
@@ -94,7 +96,7 @@ int search_functions(MI_INFO *file_leafs, const char *mask,
DBUG_ENTER("search_functions");
int count= 0;
- if(mi_scan_init(file_leafs))
+ if (mi_scan_init(file_leafs))
DBUG_RETURN(-1);
help_leaf leaf;
@@ -104,21 +106,21 @@ int search_functions(MI_INFO *file_leafs, const char *mask,
leaf.prepare_fields();
const char *lname= leaf.get_name();
- if (wild_case_compare(system_charset_info,lname,mask))
+ if (wild_case_compare(help_charset,lname,mask))
continue;
count++;
if (count>2)
{
- String *s= new String(lname,system_charset_info);
+ String *s= new String(lname,help_charset);
if (!s->copy())
names->push_back(s);
}
else if (count==1)
{
- *description= new String(leaf.get_description(),system_charset_info);
- *example= new String(leaf.get_example(),system_charset_info);
- *name= new String(lname,system_charset_info);
+ *description= new String(leaf.get_description(),help_charset);
+ *example= new String(leaf.get_example(),help_charset);
+ *name= new String(lname,help_charset);
(*description)->copy();
(*example)->copy();
(*name)->copy();
@@ -132,7 +134,7 @@ int search_functions(MI_INFO *file_leafs, const char *mask,
*description= 0;
*example= 0;
- String *s= new String(lname,system_charset_info);
+ String *s= new String(lname,help_charset);
if (!s->copy())
names->push_back(s);
}
@@ -189,7 +191,7 @@ int search_categories(THD *thd,
if (!(file_categories= open_help_file(thd,"function_category_name")))
DBUG_RETURN(-1);
- if(mi_scan_init(file_categories))
+ if (mi_scan_init(file_categories))
{
mi_close(file_categories);
DBUG_RETURN(-1);
@@ -203,14 +205,14 @@ int search_categories(THD *thd,
category.prepare_fields();
const char *lname= category.get_name();
- if (mask && wild_case_compare(system_charset_info,lname,mask))
+ if (mask && wild_case_compare(help_charset,lname,mask))
continue;
count++;
if (count==1 && res_id)
*res_id= category.get_cat_id();
- String *s= new String(lname,system_charset_info);
+ String *s= new String(lname,help_charset);
if (!s->copy())
names->push_back(s);
}
@@ -282,7 +284,7 @@ int get_all_names_for_category(THD *thd,MI_INFO *file_leafs,
(const byte*)&leaf_id,4,HA_READ_KEY_EXACT))
{
leaf.prepare_fields();
- String *s= new String(leaf.get_name(),system_charset_info);
+ String *s= new String(leaf.get_name(),help_charset);
if (!s->copy())
res->push_back(s);
}
@@ -391,11 +393,11 @@ int mysqld_help(THD *thd, const char *mask)
description->ptr(), example->ptr())))
goto end;
}
- else if((res= send_header_2(protocol)) ||
- (res= send_variant_2_list(protocol,&function_list,false)) ||
- (search_categories(thd, mask, &categories_list, 0)<0 &&
- (res=1)) ||
- (res= send_variant_2_list(protocol,&categories_list,true)))
+ else if ((res= send_header_2(protocol)) ||
+ (res= send_variant_2_list(protocol,&function_list,false)) ||
+ (search_categories(thd, mask, &categories_list, 0)<0 &&
+ (res=1)) ||
+ (res= send_variant_2_list(protocol,&categories_list,true)))
{
goto end;
}
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index f45e09cf0bf..e76e982adea 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -109,7 +109,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
int error;
bool log_on= ((thd->options & OPTION_UPDATE_LOG) ||
!(thd->master_access & SUPER_ACL));
- bool transactional_table, log_delayed, bulk_insert=0;
+ bool transactional_table, log_delayed, bulk_insert;
uint value_count;
ulong counter = 1;
ulonglong id;
@@ -217,21 +217,17 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
thd->proc_info="update";
if (duplic != DUP_ERROR)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
- if ((bulk_insert= (values_list.elements >= MIN_ROWS_TO_USE_BULK_INSERT &&
- lock_type != TL_WRITE_DELAYED &&
- !(specialflag & SPECIAL_SAFE_MODE))))
+ if ((lock_type != TL_WRITE_DELAYED && !(specialflag & SPECIAL_SAFE_MODE)) &&
+ values_list.elements >= MIN_ROWS_TO_USE_BULK_INSERT)
{
table->file->extra_opt(HA_EXTRA_WRITE_CACHE,
min(thd->variables.read_buff_size,
table->avg_row_length*values_list.elements));
- if (thd->variables.bulk_insert_buff_size)
- table->file->extra_opt(HA_EXTRA_BULK_INSERT_BEGIN,
- min(thd->variables.bulk_insert_buff_size,
- (table->total_key_length +
- table->keys * TREE_ELEMENT_EXTRA_SIZE)*
- values_list.elements));
- table->bulk_insert= 1;
+ table->file->deactivate_non_unique_index(values_list.elements);
+ bulk_insert=1;
}
+ else
+ bulk_insert=0;
while ((values= its++))
{
@@ -309,7 +305,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
error=1;
}
}
- if (table->file->extra(HA_EXTRA_BULK_INSERT_END))
+ if (table->file->activate_all_index(thd))
{
if (!error)
{
@@ -317,7 +313,6 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
error=1;
}
}
- table->bulk_insert= 0;
}
if (id && values_list.elements != 1)
thd->insert_id(id); // For update log
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 99e465f79c0..b656f698e89 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -165,11 +165,13 @@ LEX *lex_start(THD *thd, uchar *buf,uint length)
lex->select_lex.ftfunc_list= &lex->select_lex.ftfunc_list_alloc;
lex->current_select= &lex->select_lex;
lex->convert_set= (lex->thd= thd)->variables.convert_set;
+ lex->thd_charset= lex->thd->variables.thd_charset;
lex->yacc_yyss=lex->yacc_yyvs=0;
lex->ignore_space=test(thd->sql_mode & MODE_IGNORE_SPACE);
lex->slave_thd_opt=0;
lex->sql_command=SQLCOM_END;
lex->safe_to_cache_query= 1;
+ lex->tmp_table_used= 0;
bzero(&lex->mi,sizeof(lex->mi));
return lex;
}
@@ -556,7 +558,7 @@ int yylex(void *arg, void *yythd)
*/
if ((yylval->lex_str.str[0]=='_') &&
- (lex->charset=get_charset_by_name(yylval->lex_str.str+1,MYF(0))))
+ (lex->charset=get_charset_by_csname(yylval->lex_str.str+1,MYF(0))))
return(UNDERSCORE_CHARSET);
else
return(IDENT);
@@ -941,7 +943,7 @@ int yylex(void *arg, void *yythd)
void st_select_lex_node::init_query()
{
- dependent= 0;
+ no_table_names_allowed= dependent= 0;
}
void st_select_lex_node::init_select()
@@ -1035,7 +1037,7 @@ void st_select_lex_node::include_global(st_select_lex_node **plink)
//excluding from global list (internal function)
void st_select_lex_node::fast_exclude()
{
- if(link_prev)
+ if (link_prev)
{
if ((*link_prev= link_next))
link_next->link_prev= link_prev;
@@ -1067,7 +1069,7 @@ void st_select_lex_node::exclude()
void st_select_lex_unit::exclude_level()
{
SELECT_LEX_UNIT *units= 0, **units_last= &units;
- for(SELECT_LEX *sl= first_select(); sl; sl= sl->next_select())
+ for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select())
{
if (sl->link_prev && (*sl->link_prev= sl->link_next))
sl->link_next->link_prev= sl->link_prev;
@@ -1141,7 +1143,7 @@ void st_select_lex_node::mark_as_dependent(SELECT_LEX *last)
for (SELECT_LEX_NODE *s= this;
s &&s != last;
s= s->outer_select())
- if( !s->dependent )
+ if ( !s->dependent )
{
// Select is dependent of outer select
s->dependent= 1;
@@ -1169,13 +1171,14 @@ List<String>* st_select_lex_node::get_use_index() { return 0; }
List<String>* st_select_lex_node::get_ignore_index() { return 0; }
TABLE_LIST *st_select_lex_node::add_table_to_list(THD *thd, Table_ident *table,
LEX_STRING *alias,
- bool updating,
+ ulong table_join_options,
thr_lock_type flags,
List<String> *use_index,
List<String> *ignore_index)
{
return 0;
}
+ulong st_select_lex_node::get_table_join_options() { return 0; }
/*
This is used for UNION & subselect to create a new table list of all used
@@ -1332,6 +1335,11 @@ List<String>* st_select_lex::get_ignore_index()
return ignore_index_ptr;
}
+ulong st_select_lex::get_table_join_options()
+{
+ return table_join_options;
+}
+
/*
There are st_select_lex::add_table_to_list &
st_select_lex::set_lock_for_tables in sql_parse.cc
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 927b806a082..e4a17838cd2 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -212,6 +212,7 @@ public:
bool with_sum_func;
bool create_refs;
bool dependent; /* dependent from outer select subselect */
+ bool no_table_names_allowed; /* used for global order by */
static void *operator new(size_t size)
{
@@ -243,9 +244,10 @@ public:
virtual List<Item>* get_item_list();
virtual List<String>* get_use_index();
virtual List<String>* get_ignore_index();
+ virtual ulong get_table_join_options();
virtual TABLE_LIST *add_table_to_list(THD *thd, Table_ident *table,
LEX_STRING *alias,
- bool updating,
+ ulong table_options,
thr_lock_type flags= TL_UNLOCK,
List<String> *use_index= 0,
List<String> *ignore_index= 0);
@@ -336,6 +338,7 @@ public:
List<Item_func_match> ftfunc_list_alloc;
JOIN *join; /* after JOIN::prepare it is pointer to corresponding JOIN */
const char *type; /* type of select for EXPLAIN */
+ ulong table_join_options;
uint in_sum_expr;
uint select_number; /* number of select (used for EXPLAIN) */
bool braces; /* SELECT ... UNION (SELECT ... ) <- this braces */
@@ -373,9 +376,10 @@ public:
List<Item>* get_item_list();
List<String>* get_use_index();
List<String>* get_ignore_index();
+ ulong get_table_join_options();
TABLE_LIST* add_table_to_list(THD *thd, Table_ident *table,
LEX_STRING *alias,
- bool updating,
+ ulong table_options,
thr_lock_type flags= TL_UNLOCK,
List<String> *use_index= 0,
List<String> *ignore_index= 0);
@@ -432,7 +436,7 @@ typedef struct st_lex
create_field *last_field;
Item *default_value, *comment;
CONVERT *convert_set;
- CONVERT *thd_convert_set; // Set with SET CHAR SET
+ CHARSET_INFO *thd_charset;
LEX_USER *grant_user;
gptr yacc_yyss,yacc_yyvs;
THD *thd;
@@ -461,6 +465,7 @@ typedef struct st_lex
uint slave_thd_opt;
CHARSET_INFO *charset;
char *help_arg;
+ bool tmp_table_used;
} LEX;
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 3e281e6e916..0a4c6330154 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -273,11 +273,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->time_stamp=save_time_stamp;
table->next_number_field=0;
- if (thd->lock)
- {
- mysql_unlock_tables(thd, thd->lock);
- thd->lock=0;
- }
}
if (file >= 0) my_close(file,MYF(0));
free_blobs(table); /* if pack_blob was used */
@@ -296,7 +291,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
mysql_bin_log.write(&d);
}
}
- DBUG_RETURN(-1); // Error on read
+ error= -1; // Error on read
+ goto err;
}
sprintf(name,ER(ER_LOAD_INFO),info.records,info.deleted,
info.records-info.copied,thd->cuted_fields);
@@ -330,6 +326,13 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
}
if (transactional_table)
error=ha_autocommit_or_rollback(thd,error);
+
+err:
+ if (thd->lock)
+ {
+ mysql_unlock_tables(thd, thd->lock);
+ thd->lock=0;
+ }
DBUG_RETURN(error);
}
diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc
index 6eb4fbcaaf6..1f22073f556 100644
--- a/sql/sql_olap.cc
+++ b/sql/sql_olap.cc
@@ -62,7 +62,7 @@ static int make_new_olap_select(LEX *lex, SELECT_LEX *select_lex, List<Item> new
List_iterator<Item> list_it(select_lex->item_list);
List_iterator<Item> new_it(new_fields);
- while((item=list_it++))
+ while ((item=list_it++))
{
bool not_found=true;
if (item->type()==Item::FIELD_ITEM)
@@ -109,15 +109,15 @@ static int olap_combos(List<Item> old_fields, List<Item> new_fields, Item *item
int num_new_fields)
{
int sl_return = 0;
- if(position == num_new_fields)
+ if (position == num_new_fields)
{
- if(item)
+ if (item)
new_fields.push_front(item);
sl_return = make_new_olap_select(lex, select_lex, new_fields);
}
else
{
- if(item)
+ if (item)
new_fields.push_front(item);
while ((num_fields - num_new_fields >= selection - position) && !sl_return)
{
@@ -170,12 +170,12 @@ int handle_olaps(LEX *lex, SELECT_LEX *select_lex)
if (select_lex->olap == CUBE_TYPE)
{
- for( int i=count-1; i>=0 && !sl_return; i--)
+ for ( int i=count-1; i>=0 && !sl_return; i--)
sl_return=olap_combos(item_list_copy, new_item_list, (Item *)0, lex, select_lex, 0, 0, count, i);
}
else if (select_lex->olap == ROLLUP_TYPE)
{
- for( int i=count-1; i>=0 && !sl_return; i--)
+ for ( int i=count-1; i>=0 && !sl_return; i--)
{
Item *item;
item_list_copy.pop();
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 7d9dc05b4cf..d71db58ed32 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -74,7 +74,8 @@ const char *command_name[]={
"Drop DB", "Refresh", "Shutdown", "Statistics", "Processlist",
"Connect","Kill","Debug","Ping","Time","Delayed_insert","Change user",
"Binlog Dump","Table Dump", "Connect Out", "Register Slave",
- "Prepare", "Prepare Execute", "Long Data", "Close stmt"
+ "Prepare", "Prepare Execute", "Long Data", "Close stmt",
+ "Error" // Last command number
};
static char empty_c_string[1]= {0}; // Used for not defined 'db'
@@ -189,9 +190,9 @@ end:
static int check_user(THD *thd,enum_server_command command, const char *user,
const char *passwd, const char *db, bool check_count,
- bool do_send_error, char* crypted_scramble,
- bool had_password,uint *cur_priv_version,
- ACL_USER** hint_user)
+ bool simple_connect, bool do_send_error,
+ char* crypted_scramble, bool had_password,
+ uint *cur_priv_version, ACL_USER** hint_user)
{
thd->db=0;
thd->db_length=0;
@@ -211,7 +212,7 @@ static int check_user(THD *thd,enum_server_command command, const char *user,
cur_priv_version,hint_user);
DBUG_PRINT("info",
- ("Capabilities: %d packet_length: %d Host: '%s' User: '%s' Using password: %s Access: %u db: '%s'",
+ ("Capabilities: %d packet_length: %ld Host: '%s' User: '%s' Using password: %s Access: %u db: '%s'",
thd->client_capabilities, thd->max_client_packet_length,
thd->host_or_ip, thd->priv_user,
had_password ? "yes": "no",
@@ -222,14 +223,23 @@ static int check_user(THD *thd,enum_server_command command, const char *user,
{
if (do_send_error)
{
- net_printf(thd, ER_ACCESS_DENIED_ERROR,
- thd->user,
- thd->host_or_ip,
- had_password ? ER(ER_YES) : ER(ER_NO));
- mysql_log.write(thd,COM_CONNECT,ER(ER_ACCESS_DENIED_ERROR),
- thd->user,
- thd->host_or_ip,
- had_password ? ER(ER_YES) : ER(ER_NO));
+ /* Old client should get nicer error message if password version is not supported*/
+ if (simple_connect && *hint_user && (*hint_user)->pversion)
+ {
+ net_printf(thd, ER_NOT_SUPPORTED_AUTH_MODE);
+ mysql_log.write(thd,COM_CONNECT,ER(ER_NOT_SUPPORTED_AUTH_MODE));
+ }
+ else
+ {
+ net_printf(thd, ER_ACCESS_DENIED_ERROR,
+ thd->user,
+ thd->host_or_ip,
+ had_password ? ER(ER_YES) : ER(ER_NO));
+ mysql_log.write(thd,COM_CONNECT,ER(ER_ACCESS_DENIED_ERROR),
+ thd->user,
+ thd->host_or_ip,
+ had_password ? ER(ER_YES) : ER(ER_NO));
+ }
return(1); // Error already given
}
else
@@ -508,6 +518,9 @@ check_connections(THD *thd)
{
vio_in_addr(net->vio,&thd->remote.sin_addr);
thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors);
+ /* Cut very long hostnames to avoid possible overflows */
+ if (thd->host)
+ thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0;
if (connect_errors > max_connect_errors)
return(ER_HOST_IS_BLOCKED);
}
@@ -524,6 +537,7 @@ check_connections(THD *thd)
thd->ip=0;
bzero((char*) &thd->remote,sizeof(struct sockaddr));
}
+ /* Ensure that wrong hostnames doesn't cause buffer overflows */
vio_keepalive(net->vio, TRUE);
ulong pkt_len=0;
@@ -639,8 +653,9 @@ check_connections(THD *thd)
/* Store information if we used password. passwd will be dammaged */
bool using_password=test(passwd[0]);
/* Check user permissions. If password failure we'll get scramble back */
- if (check_user(thd,COM_CONNECT, user, passwd, db, 1, simple_connect,
- prepared_scramble,using_password,&cur_priv_version,&cached_user)<0)
+ if (check_user(thd, COM_CONNECT, user, passwd, db, 1, simple_connect,
+ simple_connect, prepared_scramble, using_password, &cur_priv_version,
+ &cached_user)<0)
{
/* If The client is old we just have to return error */
if (simple_connect)
@@ -680,7 +695,7 @@ check_connections(THD *thd)
}
/* Final attempt to check the user based on reply */
if (check_user(thd,COM_CONNECT, tmp_user, (char*)net->read_pos,
- tmp_db, 1, 1,prepared_scramble,using_password,&cur_priv_version,
+ tmp_db, 1, 0, 1, prepared_scramble, using_password, &cur_priv_version,
&cached_user))
return -1;
}
@@ -753,7 +768,7 @@ pthread_handler_decl(handle_one_connection,arg)
goto end_thread;
}
- if ((ulong) thd->variables.max_join_size == (ulonglong) HA_POS_ERROR)
+ if (thd->variables.max_join_size == HA_POS_ERROR)
thd->options |= OPTION_BIG_SELECTS;
if (thd->client_capabilities & CLIENT_COMPRESS)
net->compress=1; // Use compression
@@ -829,7 +844,7 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg)
#endif
- if ((ulong) thd->variables.max_join_size == (ulonglong) HA_POS_ERROR)
+ if (thd->variables.max_join_size == HA_POS_ERROR)
thd->options |= OPTION_BIG_SELECTS;
thd->proc_info=0;
@@ -961,14 +976,22 @@ bool do_command(THD *thd)
net_new_transaction(net);
if ((packet_length=my_net_read(net)) == packet_error)
{
- DBUG_PRINT("info",("Got error reading command from socket %s",
- vio_description(net->vio) ));
- return TRUE;
+ DBUG_PRINT("info",("Got error %d reading command from socket %s",
+ net->error,
+ vio_description(net->vio)));
+ /* Check if we can continue without closing the connection */
+ if (net->error != 3)
+ DBUG_RETURN(TRUE); // We have to close it.
+ send_error(thd,net->last_errno,NullS);
+ net->error= 0;
+ DBUG_RETURN(FALSE);
}
else
{
packet=(char*) net->read_pos;
command = (enum enum_server_command) (uchar) packet[0];
+ if (command >= COM_END)
+ command= COM_END; // Wrong command
DBUG_PRINT("info",("Command on %s = %d (%s)",
vio_description(net->vio), command,
command_name[command]));
@@ -1087,7 +1110,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
Do not retry if we already have sent error (result>0)
*/
if (check_user(thd,COM_CHANGE_USER, user, passwd, db, 0, simple_connect,
- prepared_scramble,using_password,&cur_priv_version,&cached_user)<0)
+ simple_connect, prepared_scramble, using_password, &cur_priv_version,
+ &cached_user)<0)
{
/* If The client is old we just have to have auth failure */
if (simple_connect)
@@ -1122,7 +1146,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
/* Final attempt to check the user based on reply */
if (check_user(thd,COM_CHANGE_USER, tmp_user, (char*)net->read_pos,
- tmp_db, 0, 1,prepared_scramble,using_password,&cur_priv_version,
+ tmp_db, 0, 0, 1, prepared_scramble, using_password, &cur_priv_version,
&cached_user))
goto restore_user;
}
@@ -1175,7 +1199,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if (alloc_query(thd, packet, packet_length))
break; // fatal error is set
mysql_log.write(thd,command,"%s",thd->query);
- DBUG_PRINT("query",("%s",thd->query));
+ DBUG_PRINT("query",("%-.4096s",thd->query));
mysql_parse(thd,thd->query, thd->query_length);
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),WAIT_PRIOR);
@@ -1253,6 +1277,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
if (lower_case_table_names)
my_casedn_str(files_charset_info, db);
+ if (check_access(thd,DROP_ACL,db,0,1))
+ break;
if (thd->locked_tables || thd->active_transaction())
{
send_error(thd,ER_LOCK_OR_ACTIVE_TRANSACTION);
@@ -1295,10 +1321,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if (check_global_access(thd,RELOAD_ACL))
break;
mysql_log.write(thd,command,NullS);
- if (reload_acl_and_cache(thd, options, (TABLE_LIST*) 0))
- send_error(thd,0);
- else
- send_eof(thd);
+ /* error sending is deferred to reload_acl_and_cache */
+ reload_acl_and_cache(thd, options, (TABLE_LIST*) 0) ;
break;
}
#ifndef EMBEDDED_LIBRARY
@@ -1377,11 +1401,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
case COM_CONNECT: // Impossible here
case COM_TIME: // Impossible from client
case COM_DELAYED_INSERT:
+ case COM_END:
default:
send_error(thd, ER_UNKNOWN_COM_ERROR);
break;
}
- if (thd->lock || thd->open_tables)
+ if (thd->lock || thd->open_tables || thd->derived_tables)
{
thd->proc_info="closing tables";
close_thread_tables(thd); /* Free tables */
@@ -1476,7 +1501,6 @@ mysql_execute_command(THD *thd)
int res= 0;
LEX *lex= &thd->lex;
TABLE_LIST *tables= (TABLE_LIST*) lex->select_lex.table_list.first;
- TABLE_LIST *cursor;
SELECT_LEX *select_lex= &lex->select_lex;
SELECT_LEX_UNIT *unit= &lex->unit;
DBUG_ENTER("mysql_execute_command");
@@ -1527,9 +1551,11 @@ mysql_execute_command(THD *thd)
for (SELECT_LEX *sl= lex->all_selects_list;
sl;
sl= sl->next_select_in_list())
+ {
for (TABLE_LIST *cursor= sl->get_table_list();
cursor;
cursor= cursor->next)
+ {
if (cursor->derived && (res=mysql_derived(thd, lex,
(SELECT_LEX_UNIT *)
cursor->derived,
@@ -1539,6 +1565,8 @@ mysql_execute_command(THD *thd)
send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN : 0);
DBUG_VOID_RETURN;
}
+ }
+ }
}
if ((&lex->select_lex != lex->all_selects_list &&
lex->unit.create_total_list(thd, lex, &tables))
@@ -1619,7 +1647,14 @@ mysql_execute_command(THD *thd)
break;
}
case SQLCOM_DO:
- res=mysql_do(thd, *lex->insert_list);
+ if (tables && ((res= check_table_access(thd, SELECT_ACL, tables)) ||
+ (res= open_and_lock_tables(thd,tables))))
+ break;
+
+ fix_tables_pointers(lex->all_selects_list);
+ res= mysql_do(thd, *lex->insert_list);
+ if (thd->net.report_error)
+ res= -1;
break;
case SQLCOM_EMPTY_QUERY:
@@ -1644,7 +1679,9 @@ mysql_execute_command(THD *thd)
{
res= mysqld_show_warnings(thd, (ulong)
((1L << (uint) MYSQL_ERROR::WARN_LEVEL_NOTE) |
- (1L << (uint) MYSQL_ERROR::WARN_LEVEL_WARN)));
+ (1L << (uint) MYSQL_ERROR::WARN_LEVEL_WARN) |
+ (1L << (uint) MYSQL_ERROR::WARN_LEVEL_ERROR)
+ ));
break;
}
case SQLCOM_SHOW_ERRORS:
@@ -1836,7 +1873,6 @@ mysql_execute_command(THD *thd)
}
if (tables->next)
{
- TABLE_LIST *table;
if (check_table_access(thd, SELECT_ACL, tables->next))
goto error; // Error message is given
}
@@ -1863,10 +1899,14 @@ mysql_execute_command(THD *thd)
}
else // regular create
{
- res = mysql_create_table(thd,tables->db ? tables->db : thd->db,
- tables->real_name, &lex->create_info,
- lex->create_list,
- lex->key_list,0,0,0); // do logging
+ if (lex->name)
+ res= mysql_create_like_table(thd, tables, &lex->create_info,
+ (Table_ident *)lex->name);
+ else
+ res= mysql_create_table(thd,tables->db ? tables->db : thd->db,
+ tables->real_name, &lex->create_info,
+ lex->create_list,
+ lex->key_list,0,0,0); // do logging
if (!res)
send_ok(thd);
}
@@ -1894,6 +1934,24 @@ mysql_execute_command(THD *thd)
break;
}
case SQLCOM_SLAVE_STOP:
+ /*
+ If the client thread has locked tables, a deadlock is possible.
+ Assume that
+ - the client thread does LOCK TABLE t READ.
+ - then the master updates t.
+ - then the SQL slave thread wants to update t,
+ so it waits for the client thread because t is locked by it.
+ - then the client thread does SLAVE STOP.
+ SLAVE STOP waits for the SQL slave thread to terminate its
+ update t, which waits for the client thread because t is locked by it.
+ To prevent that, refuse SLAVE STOP if the
+ client thread has locked tables
+ */
+ if (thd->locked_tables || thd->active_transaction())
+ {
+ send_error(thd,ER_LOCK_OR_ACTIVE_TRANSACTION);
+ break;
+ }
{
LOCK_ACTIVE_MI;
stop_slave(thd,active_mi,1/* net report*/);
@@ -2272,6 +2330,7 @@ mysql_execute_command(THD *thd)
for (auxi=(TABLE_LIST*) aux_tables ; auxi ; auxi=auxi->next)
auxi->table= auxi->table_list->table;
if (&lex->select_lex != lex->all_selects_list)
+ {
for (TABLE_LIST *t= select_lex->get_table_list();
t; t= t->next)
{
@@ -2282,6 +2341,7 @@ mysql_execute_command(THD *thd)
break;
}
}
+ }
fix_tables_pointers(lex->all_selects_list);
if (!thd->fatal_error && (result= new multi_delete(thd,aux_tables,
table_count)))
@@ -2305,12 +2365,17 @@ mysql_execute_command(THD *thd)
}
case SQLCOM_DROP_TABLE:
{
- if (check_table_access(thd,DROP_ACL,tables))
- goto error; /* purecov: inspected */
- if (end_active_trans(thd))
- res= -1;
- else
- res = mysql_rm_table(thd,tables,lex->drop_if_exists);
+ if (!lex->drop_temporary)
+ {
+ if (check_table_access(thd,DROP_ACL,tables))
+ goto error; /* purecov: inspected */
+ if (end_active_trans(thd))
+ {
+ res= -1;
+ break;
+ }
+ }
+ res= mysql_rm_table(thd,tables,lex->drop_if_exists, lex->drop_temporary);
}
break;
case SQLCOM_DROP_INDEX:
@@ -2490,9 +2555,16 @@ mysql_execute_command(THD *thd)
}
#endif /* EMBEDDED_LIBRARY */
case SQLCOM_SET_OPTION:
- if (!(res=sql_set_variables(thd, &lex->var_list)))
+ if (tables && ((res= check_table_access(thd, SELECT_ACL, tables)) ||
+ (res= open_and_lock_tables(thd,tables))))
+ break;
+ fix_tables_pointers(lex->all_selects_list);
+ if (!(res= sql_set_variables(thd, &lex->var_list)))
send_ok(thd);
+ if (thd->net.report_error)
+ res= -1;
break;
+
case SQLCOM_UNLOCK_TABLES:
unlock_locked_tables(thd);
if (thd->options & OPTION_TABLE_LOCK)
@@ -2693,10 +2765,8 @@ mysql_execute_command(THD *thd)
case SQLCOM_RESET:
if (check_global_access(thd,RELOAD_ACL) || check_db_used(thd, tables))
goto error;
- if (reload_acl_and_cache(thd, lex->type, tables))
- send_error(thd,0);
- else
- send_ok(thd);
+ /* error sending is deferred to reload_acl_and_cache */
+ reload_acl_and_cache(thd, lex->type, tables) ;
break;
case SQLCOM_KILL:
kill_one_thread(thd,lex->thread_id);
@@ -3043,6 +3113,7 @@ mysql_init_query(THD *thd)
lex->select_lex.link_prev= (st_select_lex_node**)&(lex->all_selects_list);
lex->olap=lex->describe=0;
lex->derived_tables= false;
+ lex->lock_option=TL_READ;
thd->check_loops_counter= thd->select_number=
lex->select_lex.select_number= 1;
thd->free_list= 0;
@@ -3572,11 +3643,30 @@ bool add_to_list(THD *thd, SQL_LIST &list,Item *item,bool asc)
}
+/*
+ Add a table to list of used tables
+
+ SYNOPSIS
+ add_table_to_list()
+ table Table to add
+ alias alias for table (or null if no alias)
+ table_options A set of the following bits:
+ TL_OPTION_UPDATING Table will be updated
+ TL_OPTION_FORCE_INDEX Force usage of index
+ lock_type How table should be locked
+ use_index List of indexed used in USE INDEX
+ ignore_index List of indexed used in IGNORE INDEX
+
+ RETURN
+ 0 Error
+ # Pointer to TABLE_LIST element added to the total table list
+*/
+
TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
Table_ident *table,
LEX_STRING *alias,
- bool updating,
- thr_lock_type flags,
+ ulong table_options,
+ thr_lock_type lock_type,
List<String> *use_index,
List<String> *ignore_index)
{
@@ -3633,8 +3723,9 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
}
ptr->real_name=table->table.str;
ptr->real_name_length=table->table.length;
- ptr->lock_type=flags;
- ptr->updating=updating;
+ ptr->lock_type= lock_type;
+ ptr->updating= test(table_options & TL_OPTION_UPDATING);
+ ptr->force_index= test(table_options & TL_OPTION_FORCE_INDEX);
ptr->derived= (SELECT_LEX_UNIT *) table->sel;
if (use_index)
ptr->use_index=(List<String> *) thd->memdup((gptr) use_index,
@@ -3644,7 +3735,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
sizeof(*ignore_index));
/* check that used name is unique */
- if (flags != TL_IGNORE)
+ if (lock_type != TL_IGNORE)
{
for (TABLE_LIST *tables=(TABLE_LIST*) table_list.first ;
tables ;
@@ -3714,10 +3805,15 @@ void add_join_natural(TABLE_LIST *a,TABLE_LIST *b)
b->natural_join=a;
}
+
+/*
+ Reload/resets privileges and the different caches
+*/
+
bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables)
{
bool result=0;
-
+ bool error_already_sent=0;
select_errors=0; /* Write if more errors */
if (options & REFRESH_GRANT)
{
@@ -3778,12 +3874,30 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables)
{
LOCK_ACTIVE_MI;
if (reset_slave(thd, active_mi))
+ {
result=1;
+ /*
+ reset_slave() sends error itself.
+ If it didn't, one would either change reset_slave()'s prototype, to
+ pass *errorcode and *errmsg to it when it's called or
+ change reset_slave to use my_error() to register the error.
+ */
+ error_already_sent=1;
+ }
UNLOCK_ACTIVE_MI;
}
#endif
if (options & REFRESH_USER_RESOURCES)
reset_mqh(thd,(LEX_USER *) NULL);
+
+ if (thd && !error_already_sent)
+ {
+ if (result)
+ send_error(thd,0);
+ else
+ send_ok(thd);
+ }
+
return result;
}
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index fde81ad9044..3a5bf8ebaad 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -331,9 +331,12 @@ static bool setup_params_data(PREP_STMT *stmt)
if (!param->long_data_supplied)
{
if (IS_PARAM_NULL(pos,param_no))
- param->maybe_null=param->null_value=1;
+ param->maybe_null= param->null_value= 1;
else
+ {
+ param->maybe_null= param->null_value= 0;
param->setup_param_func(param,&read_pos);
+ }
}
param_no++;
}
@@ -450,10 +453,9 @@ static bool mysql_test_upd_fields(PREP_STMT *stmt, TABLE_LIST *table_list,
COND *conds)
{
THD *thd= stmt->thd;
- TABLE *table;
DBUG_ENTER("mysql_test_upd_fields");
- if (!(table = open_ltable(thd,table_list,table_list->lock_type)))
+ if (open_and_lock_tables(thd, table_list))
DBUG_RETURN(1);
if (setup_tables(table_list) || setup_fields(thd,table_list,fields,1,0,0) ||
@@ -487,13 +489,12 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
COND *conds, ORDER *order, ORDER *group,
Item *having)
{
- TABLE *table;
bool hidden_group_fields;
THD *thd= stmt->thd;
List<Item> all_fields(fields);
DBUG_ENTER("mysql_test_select_fields");
- if (!(table = open_ltable(thd,tables,TL_READ)))
+ if (open_and_lock_tables(thd, tables))
DBUG_RETURN(1);
thd->used_tables=0; // Updated by setup_fields
@@ -522,7 +523,7 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
sending any info on where clause.
*/
if (send_prep_stmt(stmt, fields.elements) ||
- thd->protocol_prep.send_fields(&fields,0) ||
+ thd->protocol_simple.send_fields(&fields,0) ||
send_item_params(stmt))
DBUG_RETURN(1);
DBUG_RETURN(0);
@@ -636,19 +637,40 @@ static bool parse_prepare_query(PREP_STMT *stmt,
/*
Initialize parameter items in statement
*/
-static bool init_param_items(THD *thd, PREP_STMT *stmt)
+
+static bool init_param_items(PREP_STMT *stmt)
{
+ List<Item> &params= stmt->thd->lex.param_list;
Item_param **to;
+
if (!(stmt->param= to= (Item_param **)
my_malloc(sizeof(Item_param *)*(stmt->param_count+1),
MYF(MY_WME))))
return 1;
- List_iterator<Item> param_iterator(thd->lex.param_list);
+ List_iterator<Item> param_iterator(params);
while ((*(to++) = (Item_param *)param_iterator++));
return 0;
}
/*
+ Initialize stmt execution
+*/
+
+static void init_stmt_execute(PREP_STMT *stmt)
+{
+ THD *thd= stmt->thd;
+ TABLE_LIST *tables=(TABLE_LIST*) thd->lex.select_lex.table_list.first;
+
+ /*
+ TODO: When the new table structure is ready, then have a status bit
+ to indicate the table is altered, and re-do the setup_*
+ and open the tables back.
+ */
+ if (tables)
+ tables->table=0; //safety - nasty init
+}
+
+/*
Parse the query and send the total number of parameters
and resultset metadata information back to client (if any),
without executing the query i.e. with out any log/disk
@@ -669,29 +691,32 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
DBUG_ENTER("mysql_stmt_prepare");
bzero((char*) &stmt, sizeof(stmt));
- stmt.thd= thd;
+
stmt.stmt_id= ++thd->current_stmt_id;
init_sql_alloc(&stmt.mem_root, 8192, 8192);
+
+ stmt.thd= thd;
+ stmt.thd->mem_root= stmt.mem_root;
- thd->mem_root= stmt.mem_root;
- if (alloc_query(thd, packet, packet_length))
+ if (alloc_query(stmt.thd, packet, packet_length))
goto err;
+
if (parse_prepare_query(&stmt, thd->query, thd->query_length))
goto err;
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),WAIT_PRIOR);
- if (init_param_items(thd, &stmt))
+ if (init_param_items(&stmt))
goto err;
- stmt.mem_root= thd->mem_root;
+ stmt.mem_root= stmt.thd->mem_root;
tree_insert(&thd->prepared_statements, (void *)&stmt, 0, (void *)0);
thd->mem_root= thd_root; // restore main mem_root
DBUG_RETURN(0);
err:
- stmt.mem_root= thd->mem_root;
+ stmt.mem_root= stmt.thd->mem_root;
free_prep_stmt(&stmt, free_free, (void*) 0);
thd->mem_root = thd_root; // restore main mem_root
DBUG_RETURN(1);
@@ -725,6 +750,8 @@ void mysql_stmt_execute(THD *thd, char *packet)
DBUG_VOID_RETURN;
}
+ init_stmt_execute(stmt);
+
if (stmt->param_count && setup_params_data(stmt))
DBUG_VOID_RETURN;
@@ -737,9 +764,9 @@ void mysql_stmt_execute(THD *thd, char *packet)
mysql_delete(), mysql_update() and mysql_select() to not to
have re-check on setup_* and other things ..
*/
- thd->protocol= &thd->protocol_prep; // Switch to binary protocol
+ stmt->thd->protocol= &thd->protocol_prep; // Switch to binary protocol
mysql_execute_command(stmt->thd);
- thd->protocol= &thd->protocol_simple; // Use normal protocol
+ stmt->thd->protocol= &thd->protocol_simple; // Use normal protocol
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(), WAIT_PRIOR);
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 7c247302e02..a4a1cbd4ad6 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -698,20 +698,48 @@ int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
return 0;
}
+
+/*
+ Remove all relay logs and start replication from the start
+
+ SYNOPSIS
+ reset_slave()
+ thd Thread handler
+ mi Master info for the slave
+
+
+ NOTES
+ We don't send ok in this functions as this is called from
+ reload_acl_and_cache() which may have done other tasks, which may
+ have failed for which we want to send and error.
+
+ RETURN
+ 0 ok
+ 1 error
+ In this case error is sent to the client with send_error()
+*/
+
+
int reset_slave(THD *thd, MASTER_INFO* mi)
{
MY_STAT stat_area;
char fname[FN_REFLEN];
- int restart_thread_mask = 0,error=0;
+ int thread_mask= 0, error= 0;
+ uint sql_errno=0;
const char* errmsg=0;
DBUG_ENTER("reset_slave");
lock_slave_threads(mi);
- init_thread_mask(&restart_thread_mask,mi,0 /* not inverse */);
- if ((error=terminate_slave_threads(mi,restart_thread_mask,1 /*skip lock*/))
- || (error=purge_relay_logs(&mi->rli, thd,
- 1 /* just reset */,
- &errmsg)))
+ init_thread_mask(&thread_mask,mi,0 /* not inverse */);
+ if (thread_mask) // We refuse if any slave thread is running
+ {
+ sql_errno= ER_SLAVE_MUST_STOP;
+ error=1;
+ goto err;
+ }
+ if ((error= purge_relay_logs(&mi->rli, thd,
+ 1 /* just reset */,
+ &errmsg)))
goto err;
end_master_info(mi);
@@ -727,17 +755,15 @@ int reset_slave(THD *thd, MASTER_INFO* mi)
error=1;
goto err;
}
- if (restart_thread_mask)
- error=start_slave_threads(0 /* mutex not needed */,
- 1 /* wait for start*/,
- mi,master_info_file,relay_log_info_file,
- restart_thread_mask);
- // TODO: fix error messages so they get to the client
+
err:
unlock_slave_threads(mi);
+ if (thd && error)
+ send_error(thd, sql_errno, errmsg);
DBUG_RETURN(error);
}
+
void kill_zombie_dump_threads(uint32 slave_server_id)
{
pthread_mutex_lock(&LOCK_thread_count);
@@ -769,23 +795,20 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
int change_master(THD* thd, MASTER_INFO* mi)
{
- int error=0,restart_thread_mask;
+ int thread_mask;
const char* errmsg=0;
bool need_relay_log_purge=1;
DBUG_ENTER("change_master");
- // kill slave thread
lock_slave_threads(mi);
- init_thread_mask(&restart_thread_mask,mi,0 /*not inverse*/);
- if (restart_thread_mask &&
- (error=terminate_slave_threads(mi,
- restart_thread_mask,
- 1 /*skip lock*/)))
+ init_thread_mask(&thread_mask,mi,0 /*not inverse*/);
+ if (thread_mask) // We refuse if any slave thread is running
{
- send_error(thd,error);
+ net_printf(thd,ER_SLAVE_MUST_STOP);
unlock_slave_threads(mi);
DBUG_RETURN(1);
}
+
thd->proc_info = "changing master";
LEX_MASTER_INFO* lex_mi = &thd->lex.mi;
// TODO: see if needs re-write
@@ -854,6 +877,7 @@ int change_master(THD* thd, MASTER_INFO* mi)
&errmsg))
{
net_printf(thd, 0, "Failed purging old relay logs: %s",errmsg);
+ unlock_slave_threads(mi);
DBUG_RETURN(1);
}
}
@@ -884,18 +908,9 @@ int change_master(THD* thd, MASTER_INFO* mi)
pthread_cond_broadcast(&mi->data_cond);
pthread_mutex_unlock(&mi->rli.data_lock);
- thd->proc_info = "starting slave";
- if (restart_thread_mask)
- error=start_slave_threads(0 /* mutex not needed*/,
- 1 /* wait for start*/,
- mi,master_info_file,relay_log_info_file,
- restart_thread_mask);
unlock_slave_threads(mi);
thd->proc_info = 0;
- if (error)
- send_error(thd,error);
- else
- send_ok(thd);
+ send_ok(thd);
DBUG_RETURN(0);
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index c7ab438ba97..f6f7c473b07 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -184,6 +184,16 @@ int handle_select(THD *thd, LEX *lex, select_result *result)
return res;
}
+
+void relink_tables(SELECT_LEX *select_lex)
+{
+ for (TABLE_LIST *cursor= (TABLE_LIST *) select_lex->table_list.first;
+ cursor;
+ cursor=cursor->next)
+ cursor->table= cursor->table_list->table;
+}
+
+
void fix_tables_pointers(SELECT_LEX *select_lex)
{
if (select_lex->next_select_in_list())
@@ -192,18 +202,15 @@ void fix_tables_pointers(SELECT_LEX *select_lex)
for (SELECT_LEX *sl= select_lex;
sl;
sl= sl->next_select_in_list())
- {
- for (TABLE_LIST *cursor= (TABLE_LIST *)sl->table_list.first;
- cursor;
- cursor=cursor->next)
- cursor->table= cursor->table_list->table;
- }
+ relink_tables(sl);
}
}
+
/*
- Inline function to setup clauses without sum functions
+ Function to setup clauses without sum functions
*/
+
inline int setup_without_group(THD *thd, TABLE_LIST *tables,
List<Item> &fields,
List<Item> &all_fields,
@@ -1160,7 +1167,7 @@ mysql_select(THD *thd, TABLE_LIST *tables, List<Item> &fields, COND *conds,
if (thd->possible_loops)
{
Item *item;
- while(thd->possible_loops->elements)
+ while (thd->possible_loops->elements)
{
item= thd->possible_loops->pop();
if (item->check_loop(thd->check_loops_counter++))
@@ -1507,7 +1514,7 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds,
select->quick=0;
if (records != HA_POS_ERROR)
{
- s->records=s->found_records=records;
+ s->found_records=records;
s->read_time= (ha_rows) (s->quick ? s->quick->read_time : 0.0);
}
}
@@ -2298,7 +2305,8 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
!(s->quick && best_key && s->quick->index == best_key->key &&
best_max_key_part >= s->table->quick_key_parts[best_key->key]) &&
!((s->table->file->table_flags() & HA_TABLE_SCAN_ON_INDEX) &&
- s->table->used_keys && best_key))
+ s->table->used_keys && best_key) &&
+ !(s->table->force_index && best_key))
{ // Check full join
if (s->on_expr)
{
@@ -4980,7 +4988,10 @@ join_read_const(JOIN_TAB *tab)
empty_record(table);
if (error != HA_ERR_KEY_NOT_FOUND)
{
- sql_print_error("read_const: Got error %d when reading table %s",
+ /* Locking reads can legally return also these errors, do not
+ print them to the .err log */
+ if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
+ sql_print_error("read_const: Got error %d when reading table %s",
error, table->path);
table->file->print_error(error,MYF(0));
return 1;
@@ -5043,7 +5054,8 @@ join_read_always_key(JOIN_TAB *tab)
{
if (error != HA_ERR_KEY_NOT_FOUND)
{
- sql_print_error("read_const: Got error %d when reading table %s",error,
+ if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
+ sql_print_error("read_const: Got error %d when reading table %s",error,
table->path);
table->file->print_error(error,MYF(0));
return 1;
@@ -5072,7 +5084,8 @@ join_read_last_key(JOIN_TAB *tab)
{
if (error != HA_ERR_KEY_NOT_FOUND)
{
- sql_print_error("read_const: Got error %d when reading table %s",error,
+ if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
+ sql_print_error("read_const: Got error %d when reading table %s",error,
table->path);
table->file->print_error(error,MYF(0));
return 1;
@@ -5104,7 +5117,8 @@ join_read_next_same(READ_RECORD *info)
{
if (error != HA_ERR_END_OF_FILE)
{
- sql_print_error("read_next: Got error %d when reading table %s",error,
+ if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
+ sql_print_error("read_next: Got error %d when reading table %s",error,
table->path);
table->file->print_error(error,MYF(0));
return 1;
@@ -5126,7 +5140,8 @@ join_read_prev_same(READ_RECORD *info)
{
if (error != HA_ERR_END_OF_FILE)
{
- sql_print_error("read_next: Got error %d when reading table %s",error,
+ if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
+ sql_print_error("read_next: Got error %d when reading table %s",error,
table->path);
table->file->print_error(error,MYF(0));
error= 1;
@@ -5197,7 +5212,8 @@ join_read_first(JOIN_TAB *tab)
{
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
{
- sql_print_error("read_first_with_key: Got error %d when reading table",
+ if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
+ sql_print_error("read_first_with_key: Got error %d when reading table",
error);
table->file->print_error(error,MYF(0));
return 1;
@@ -5216,7 +5232,9 @@ join_read_next(READ_RECORD *info)
{
if (error != HA_ERR_END_OF_FILE)
{
- sql_print_error("read_next_with_key: Got error %d when reading table %s",
+ if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
+ sql_print_error(
+ "read_next_with_key: Got error %d when reading table %s",
error, info->table->path);
info->file->print_error(error,MYF(0));
return 1;
@@ -5248,7 +5266,8 @@ join_read_last(JOIN_TAB *tab)
{
if (error != HA_ERR_END_OF_FILE)
{
- sql_print_error("read_last_with_key: Got error %d when reading table",
+ if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
+ sql_print_error("read_last_with_key: Got error %d when reading table",
error, table->path);
table->file->print_error(error,MYF(0));
return 1;
@@ -5267,7 +5286,9 @@ join_read_prev(READ_RECORD *info)
{
if (error != HA_ERR_END_OF_FILE)
{
- sql_print_error("read_prev_with_key: Got error %d when reading table: %s",
+ if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
+ sql_print_error(
+ "read_prev_with_key: Got error %d when reading table: %s",
error,info->table->path);
info->file->print_error(error,MYF(0));
return 1;
@@ -5295,7 +5316,8 @@ join_ft_read_first(JOIN_TAB *tab)
{
if (error != HA_ERR_END_OF_FILE)
{
- sql_print_error("ft_read_first: Got error %d when reading table %s",
+ if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
+ sql_print_error("ft_read_first: Got error %d when reading table %s",
error, table->path);
table->file->print_error(error,MYF(0));
return 1;
@@ -5313,7 +5335,8 @@ join_ft_read_next(READ_RECORD *info)
{
if (error != HA_ERR_END_OF_FILE)
{
- sql_print_error("ft_read_next: Got error %d when reading table %s",
+ if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
+ sql_print_error("ft_read_next: Got error %d when reading table %s",
error, info->table->path);
info->file->print_error(error,MYF(0));
return 1;
@@ -5938,6 +5961,69 @@ static uint find_shortest_key(TABLE *table, key_map usable_keys)
return best;
}
+/*
+ SYNOPSIS
+ is_subkey()
+ key_part - first key parts
+ ref_key_part - second key parts
+ ref_key_part_end - last+1 part of the second key
+ DESCRIPTION
+ Test if a second key is the subkey of the first one.
+ NOTE
+ Second key MUST be shorter than the first one.
+ RETURN
+ 1 - is the subkey
+ 0 - otherwise
+*/
+
+inline bool
+is_subkey(KEY_PART_INFO *key_part, KEY_PART_INFO *ref_key_part,
+ KEY_PART_INFO *ref_key_part_end)
+{
+ for (; ref_key_part < ref_key_part_end; key_part++, ref_key_part++)
+ if (!key_part->field->eq(ref_key_part->field))
+ return 0;
+ return 1;
+}
+
+/*
+ SYNOPSIS
+ test_if_subkey()
+ ref - number of key, used for WHERE clause
+ usable_keys - keys for testing
+ DESCRIPTION
+ Test if we can use one of the 'usable_keys' instead of 'ref' key.
+ RETURN
+ MAX_KEY - if we can't use other key
+ the number of found key - otherwise
+*/
+
+static uint
+test_if_subkey(ORDER *order, TABLE *table, uint ref, key_map usable_keys)
+{
+ uint nr;
+ uint min_length= (uint) ~0;
+ uint best= MAX_KEY;
+ uint not_used;
+ KEY_PART_INFO *ref_key_part= table->key_info[ref].key_part;
+ uint ref_key_parts= table->key_info[ref].key_parts;
+ KEY_PART_INFO *ref_key_part_end= ref_key_part + ref_key_parts;
+
+ for (nr= 0; usable_keys; usable_keys>>= 1, nr++)
+ {
+ if ((usable_keys & 1) &&
+ table->key_info[nr].key_length < min_length &&
+ table->key_info[nr].key_parts >= ref_key_parts &&
+ is_subkey(table->key_info[nr].key_part, ref_key_part,
+ ref_key_part_end) &&
+ test_if_order_by_key(order, table, nr, &not_used))
+ {
+ min_length= table->key_info[nr].key_length;
+ best= nr;
+ }
+ }
+ return best;
+}
/*
Test if we can skip the ORDER BY by using an index.
@@ -5985,6 +6071,27 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
*/
int order_direction;
uint used_key_parts;
+ if (!(usable_keys & ((key_map) 1 << ref_key)))
+ {
+ /*
+ We come here when ref_key is not among usable_keys
+ */
+ uint a;
+ if ((a= test_if_subkey(order, table, ref_key, usable_keys)) < MAX_KEY)
+ {
+ if (tab->ref.key >= 0)
+ {
+ tab->ref.key= a;
+ table->file->index_init(a);
+ }
+ else
+ {
+ select->quick->index= a;
+ select->quick->init();
+ }
+ ref_key= a;
+ }
+ }
/* Check if we get the rows in requested sorted order by using the key */
if ((usable_keys & ((key_map) 1 << ref_key)) &&
(order_direction = test_if_order_by_key(order,table,ref_key,
@@ -6650,12 +6757,14 @@ store_record_in_cache(JOIN_CACHE *cache)
{
if (last_record)
{
- copy->blob_field->get_image((char*) pos,copy->length+sizeof(char*));
+ copy->blob_field->get_image((char*) pos,copy->length+sizeof(char*),
+ copy->blob_field->charset());
pos+=copy->length+sizeof(char*);
}
else
{
- copy->blob_field->get_image((char*) pos,copy->length); // blob length
+ copy->blob_field->get_image((char*) pos,copy->length, // blob length
+ copy->blob_field->charset());
memcpy(pos+copy->length,copy->str,copy->blob_length); // Blob data
pos+=copy->length+copy->blob_length;
}
@@ -6712,7 +6821,8 @@ read_cached_record(JOIN_TAB *tab)
{
if (last_record)
{
- copy->blob_field->set_image((char*) pos,copy->length+sizeof(char*));
+ copy->blob_field->set_image((char*) pos,copy->length+sizeof(char*),
+ copy->blob_field->charset());
pos+=copy->length+sizeof(char*);
}
else
@@ -7517,7 +7627,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
item_list.push_back(new Item_string(message,strlen(message),
default_charset_info));
if (result->send_data(item_list))
- result->send_error(0,NullS);
+ join->error= 1;
}
else
{
@@ -7527,7 +7637,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
JOIN_TAB *tab=join->join_tab+i;
TABLE *table=tab->table;
char buff[512],*buff_ptr=buff;
- char buff1[512], buff2[512], buff3[512];
+ char buff1[512], buff2[512];
String tmp1(buff1,sizeof(buff1),default_charset_info);
String tmp2(buff2,sizeof(buff2),default_charset_info);
tmp1.length(0);
@@ -7658,7 +7768,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
// For next iteration
used_tables|=table->map;
if (result->send_data(item_list))
- result->send_error(0,NullS);
+ join->error= 1;
}
}
for (SELECT_LEX_UNIT *unit= join->select_lex->first_inner_unit();
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 1fbe2052831..e30bba830eb 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -374,3 +374,4 @@ public:
bool cp_buffer_from_ref(TABLE_REF *ref);
bool error_if_full_join(JOIN *join);
+void relink_tables(SELECT_LEX *select_lex);
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 78bae8d29dc..168dbe4cfa3 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -675,6 +675,7 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
List<Item> field_list;
field_list.push_back(new Item_empty_string("Field",NAME_LEN));
field_list.push_back(new Item_empty_string("Type",40));
+ field_list.push_back(new Item_empty_string("Collation",40));
field_list.push_back(new Item_empty_string("Null",1));
field_list.push_back(new Item_empty_string("Key",3));
field_list.push_back(item=new Item_empty_string("Default",NAME_LEN));
@@ -721,6 +722,7 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
protocol->store(field->field_name);
field->sql_type(type);
protocol->store(type.ptr(), type.length());
+ protocol->store(field->charset()->name);
pos=(byte*) ((flags & NOT_NULL_FLAG) &&
field->type() != FIELD_TYPE_TIMESTAMP ?
@@ -841,7 +843,6 @@ int
mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
{
TABLE *table;
- char buff[256];
Protocol *protocol= thd->protocol;
DBUG_ENTER("mysqld_show_keys");
DBUG_PRINT("enter",("db: %s table: %s",table_list->db,
@@ -1055,6 +1056,16 @@ store_create_info(THD *thd, TABLE *table, String *packet)
bool has_default = (field->type() != FIELD_TYPE_BLOB &&
field->type() != FIELD_TYPE_TIMESTAMP &&
field->unireg_check != Field::NEXT_NUMBER);
+
+ /*
+ For string types dump collation name only if
+ collation is not primary for the given charset
+ */
+ if (!field->binary() && !(field->charset()->state & MY_CS_PRIMARY))
+ {
+ packet->append(" collate ",9);
+ packet->append(field->charset()->name);
+ }
if (flags & NOT_NULL_FLAG)
packet->append(" NOT NULL", 9);
@@ -1117,8 +1128,8 @@ store_create_info(THD *thd, TABLE *table, String *packet)
packet->append(" USING BTREE", 12);
// +BAR: send USING only in non-default case: non-spatial rtree
- if((key_info->algorithm == HA_KEY_ALG_RTREE) &&
- !(key_info->flags & HA_SPATIAL))
+ if ((key_info->algorithm == HA_KEY_ALG_RTREE) &&
+ !(key_info->flags & HA_SPATIAL))
packet->append(" USING RTREE",12);
packet->append(" (", 2);
@@ -1167,7 +1178,12 @@ store_create_info(THD *thd, TABLE *table, String *packet)
if (table->table_charset)
{
packet->append(" CHARSET=");
- packet->append(table->table_charset->name);
+ packet->append(table->table_charset->csname);
+ if (!(table->table_charset->state & MY_CS_PRIMARY))
+ {
+ packet->append(" COLLATE=");
+ packet->append(table->table_charset->name);
+ }
}
if (table->min_rows)
@@ -1273,6 +1289,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
THD *tmp;
while ((tmp=it++))
{
+ struct st_my_thread_var *mysys_var;
#ifndef EMBEDDED_LIBRARY
if ((tmp->net.vio || tmp->system_thread) &&
(!user || (tmp->user && !strcmp(tmp->user,user))))
@@ -1294,8 +1311,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
if ((thd_info->db=tmp->db)) // Safe test
thd_info->db=thd->strdup(thd_info->db);
thd_info->command=(int) tmp->command;
- if (tmp->mysys_var)
- pthread_mutex_lock(&tmp->mysys_var->mutex);
+ if ((mysys_var= tmp->mysys_var))
+ pthread_mutex_lock(&mysys_var->mutex);
thd_info->proc_info= (char*) (tmp->killed ? "Killed" : 0);
#ifndef EMBEDDED_LIBRARY
thd_info->state_info= (char*) (tmp->locked ? "Locked" :
@@ -1311,8 +1328,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
#else
thd_info->state_info= (char*)"Writing to net";
#endif
- if (tmp->mysys_var)
- pthread_mutex_unlock(&tmp->mysys_var->mutex);
+ if (mysys_var)
+ pthread_mutex_unlock(&mysys_var->mutex);
#if !defined(DONT_USE_THR_ALARM) && ! defined(SCO)
if (pthread_kill(tmp->real_id,0))
@@ -1341,7 +1358,6 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
time_t now= time(0);
while ((thd_info=thread_infos.get()))
{
- char buff[20],*end;
protocol->prepare_for_resend();
protocol->store((ulonglong) thd_info->thread_id);
protocol->store(thd_info->user);
@@ -1375,10 +1391,14 @@ int mysqld_show_charsets(THD *thd, const char *wild)
List<Item> field_list;
CHARSET_INFO **cs;
Protocol *protocol= thd->protocol;
+ char flags[64];
+
DBUG_ENTER("mysqld_show_charsets");
- field_list.push_back(new Item_empty_string("Name",30));
+ field_list.push_back(new Item_empty_string("CS_Name",30));
+ field_list.push_back(new Item_empty_string("COL_Name",30));
field_list.push_back(new Item_return_int("Id",11, FIELD_TYPE_SHORT));
+ field_list.push_back(new Item_empty_string("Flags",30));
field_list.push_back(new Item_return_int("strx_maxlen",3, FIELD_TYPE_TINY));
field_list.push_back(new Item_return_int("mb_maxlen",3, FIELD_TYPE_TINY));
@@ -1387,14 +1407,17 @@ int mysqld_show_charsets(THD *thd, const char *wild)
for (cs=all_charsets ; cs < all_charsets+255 ; cs++ )
{
- if (!cs[0])
- continue;
- if (!(wild && wild[0] &&
+ if (cs[0] && !(wild && wild[0] &&
wild_case_compare(system_charset_info,cs[0]->name,wild)))
{
protocol->prepare_for_resend();
+ protocol->store(cs[0]->csname);
protocol->store(cs[0]->name);
protocol->store_short((longlong) cs[0]->number);
+ flags[0]='\0';
+ if (cs[0]->state & MY_CS_PRIMARY)
+ strcat(flags,"pri");
+ protocol->store(flags);
protocol->store_tiny((longlong) cs[0]->strxfrm_multiply);
protocol->store_tiny((longlong) cs[0]->mbmaxlen);
if (protocol->write())
@@ -1450,6 +1473,9 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables,
break;
case SHOW_LONGLONG:
end= longlong10_to_str(*(longlong*) value, buff, 10);
+ break;
+ case SHOW_HA_ROWS:
+ end= longlong10_to_str((longlong) *(ha_rows*) value, buff, 10);
break;
case SHOW_BOOL:
end= strmov(buff, *(bool*) value ? "ON" : "OFF");
@@ -1481,7 +1507,7 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables,
break;
#ifndef EMBEDDED_LIBRARY
case SHOW_RPL_STATUS:
- end= int10_to_str((long) rpl_status_type[(int)rpl_status], buff, 10);
+ end= strmov(buff, rpl_status_type[(int)rpl_status]);
break;
case SHOW_SLAVE_RUNNING:
{
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 51b2386ae62..4c499af8f9e 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -30,6 +30,9 @@
extern gptr sql_alloc(unsigned size);
extern void sql_element_free(void *ptr);
+static uint32
+copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
+ const char *from, uint32 from_length, CHARSET_INFO *from_cs);
#include "sql_string.h"
@@ -223,55 +226,51 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
return FALSE;
}
-/* Copy with charset convertion */
-bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *from, CHARSET_INFO *to)
-{
- uint32 new_length=to->mbmaxlen*arg_length;
- int cnvres;
- my_wc_t wc;
- const uchar *s=(const uchar *)str;
- const uchar *se=s+arg_length;
- uchar *d, *de;
+ /* Copy with charset convertion */
+bool String::copy(const char *str, uint32 arg_length,
+ CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
+{
+ uint32 new_length= to_cs->mbmaxlen*arg_length;
if (alloc(new_length))
return TRUE;
+ str_length=copy_and_convert((char*) Ptr, new_length, to_cs,
+ str, arg_length, from_cs);
+ str_charset=to_cs;
+ return FALSE;
+}
- d=(uchar *)Ptr;
- de=d+new_length;
+
+/*
+ Set a string to the value of a latin1-string, keeping the original charset
- for (str_length=new_length ; s < se && d < de ; )
- {
- if ((cnvres=from->mb_wc(from,&wc,s,se)) > 0 )
- {
- s+=cnvres;
- }
- else if (cnvres==MY_CS_ILSEQ)
- {
- s++;
- wc='?';
- }
- else
- break;
+ SYNOPSIS
+ copy_or_set()
+ str String of a simple charset (latin1)
+ arg_length Length of string
-outp:
- if((cnvres=to->wc_mb(to,wc,d,de)) >0 )
- {
- d+=cnvres;
- }
- else if (cnvres==MY_CS_ILUNI && wc!='?')
- {
- wc='?';
- goto outp;
- }
- else
- break;
+ IMPLEMENTATION
+ If string object is of a simple character set, set it to point to the
+ given string.
+ If not, make a copy and convert it to the new character set.
+
+ RETURN
+ 0 ok
+ 1 Could not allocate result buffer
+
+*/
+
+bool String::set_latin1(const char *str, uint32 arg_length)
+{
+ if (str_charset->mbmaxlen == 1)
+ {
+ set(str, arg_length, str_charset);
+ return 0;
}
- Ptr[new_length]=0;
- length((uint32) (d-(uchar *)Ptr));
- str_charset=to;
- return FALSE;
+ return copy(str, arg_length, my_charset_latin1, str_charset);
}
+
/* This is used by mysql.cc */
bool String::fill(uint32 max_length,char fill_char)
@@ -306,11 +305,26 @@ bool String::append(const String &s)
return FALSE;
}
+
+/*
+ Append a latin1 string to the a string of the current character set
+*/
+
+
bool String::append(const char *s,uint32 arg_length)
{
if (!arg_length) // Default argument
if (!(arg_length= (uint32) strlen(s)))
return FALSE;
+ if (str_charset->mbmaxlen > 1)
+ {
+ uint32 add_length=arg_length * str_charset->mbmaxlen;
+ if (realloc(str_length+ add_length))
+ return TRUE;
+ str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset,
+ s, arg_length, my_charset_latin1);
+ return FALSE;
+ }
if (realloc(str_length+arg_length))
return TRUE;
memcpy(Ptr+str_length,s,arg_length);
@@ -318,6 +332,7 @@ bool String::append(const char *s,uint32 arg_length)
return FALSE;
}
+
#ifdef TO_BE_REMOVED
bool String::append(FILE* file, uint32 arg_length, myf my_flags)
{
@@ -658,4 +673,61 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length)
}
+/****************************************************************************
+ Help functions
+****************************************************************************/
+
+/*
+ copy a string from one character set to another
+
+ SYNOPSIS
+ copy_and_convert()
+ to Store result here
+ to_cs Character set of result string
+ from Copy from here
+ from_length Length of from string
+ from_cs From character set
+
+ NOTES
+ 'to' must be big enough as form_length * to_cs->mbmaxlen
+
+ RETURN
+ length of bytes copied to 'to'
+*/
+
+static uint32
+copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
+ const char *from, uint32 from_length, CHARSET_INFO *from_cs)
+{
+ int cnvres;
+ my_wc_t wc;
+ const uchar *from_end= (const uchar*) from+from_length;
+ char *to_start= to;
+ uchar *to_end= (uchar*) to+to_length;
+
+ while ((uchar*) from < from_end)
+ {
+ if ((cnvres=from_cs->mb_wc(from_cs, &wc, (uchar*) from, from_end)) > 0)
+ from+= cnvres;
+ else if (cnvres == MY_CS_ILSEQ)
+ {
+ from++;
+ wc= '?';
+ }
+ else
+ break; // Impossible char.
+
+outp:
+ if ((cnvres= to_cs->wc_mb(to_cs, wc, (uchar*) to, to_end)) > 0)
+ to+= cnvres;
+ else if (cnvres == MY_CS_ILUNI && wc != '?')
+ {
+ wc= '?';
+ goto outp;
+ }
+ else
+ break;
+ }
+ return (uint32) (to - to_start);
+}
diff --git a/sql/sql_string.h b/sql/sql_string.h
index d7447dd6ed6..ad91b20f18c 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -115,6 +115,7 @@ public:
Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0;
str_charset=cs;
}
+ bool String::set_latin1(const char *str, uint32 arg_length);
inline void set_quick(char *str,uint32 arg_length, CHARSET_INFO *cs)
{
if (!alloced)
@@ -225,7 +226,7 @@ public:
{
Ptr[str_length++] = c;
}
- void q_append(const uint32 &n)
+ void q_append(const uint32 n)
{
int4store(Ptr + str_length, n);
str_length += 4;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 49e84db62c9..291976fe154 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -46,7 +46,8 @@ static int copy_data_between_tables(TABLE *from,TABLE *to,
** This will wait for all users to free the table before dropping it
*****************************************************************************/
-int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
+int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
+ my_bool drop_temporary)
{
int error;
DBUG_ENTER("mysql_rm_table");
@@ -57,7 +58,7 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
thd->mysys_var->current_cond= &COND_refresh;
VOID(pthread_mutex_lock(&LOCK_open));
- if (global_read_lock)
+ if (!drop_temporary && global_read_lock)
{
if (thd->global_read_lock)
{
@@ -72,7 +73,7 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
}
}
- error=mysql_rm_table_part2(thd,tables,if_exists,0);
+ error=mysql_rm_table_part2(thd,tables, if_exists, drop_temporary, 0);
err:
pthread_mutex_unlock(&LOCK_open);
@@ -91,14 +92,15 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
int mysql_rm_table_part2_with_lock(THD *thd,
TABLE_LIST *tables, bool if_exists,
- bool dont_log_query)
+ bool drop_temporary, bool dont_log_query)
{
int error;
thd->mysys_var->current_mutex= &LOCK_open;
thd->mysys_var->current_cond= &COND_refresh;
VOID(pthread_mutex_lock(&LOCK_open));
- error=mysql_rm_table_part2(thd,tables, if_exists, dont_log_query);
+ error=mysql_rm_table_part2(thd,tables, if_exists, drop_temporary,
+ dont_log_query);
pthread_mutex_unlock(&LOCK_open);
VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
@@ -111,6 +113,17 @@ int mysql_rm_table_part2_with_lock(THD *thd,
}
/*
+ Execute the drop of a normal or temporary table
+
+ SYNOPSIS
+ mysql_rm_table_part2()
+ thd Thread handler
+ tables Tables to drop
+ if_exists If set, don't give an error if table doesn't exists.
+ In this case we give an warning of level 'NOTE'
+ drop_temporary Only drop temporary tables
+ dont_log_query Don't log the query
+
TODO:
When logging to the binary log, we should log
tmp_tables and transactional tables as separate statements if we
@@ -120,10 +133,15 @@ int mysql_rm_table_part2_with_lock(THD *thd,
The current code only writes DROP statements that only uses temporary
tables to the cache binary log. This should be ok on most cases, but
not all.
+
+ RETURN
+ 0 ok
+ 1 Error
+ -1 Thread was killed
*/
int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
- bool dont_log_query)
+ bool drop_temporary, bool dont_log_query)
{
TABLE_LIST *table;
char path[FN_REFLEN];
@@ -142,29 +160,33 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
continue; // removed temporary table
}
- abort_locked_tables(thd,db,table->real_name);
- while (remove_table_from_cache(thd,db,table->real_name) && !thd->killed)
- {
- dropping_tables++;
- (void) pthread_cond_wait(&COND_refresh,&LOCK_open);
- dropping_tables--;
- }
- drop_locked_tables(thd,db,table->real_name);
- if (thd->killed)
- DBUG_RETURN(-1);
-
- /* remove form file and isam files */
- strxmov(path, mysql_data_home, "/", db, "/", table->real_name, reg_ext,
- NullS);
- (void) unpack_filename(path,path);
error=0;
+ if (!drop_temporary)
+ {
+ abort_locked_tables(thd,db,table->real_name);
+ while (remove_table_from_cache(thd,db,table->real_name) && !thd->killed)
+ {
+ dropping_tables++;
+ (void) pthread_cond_wait(&COND_refresh,&LOCK_open);
+ dropping_tables--;
+ }
+ drop_locked_tables(thd,db,table->real_name);
+ if (thd->killed)
+ DBUG_RETURN(-1);
- table_type=get_table_type(path);
+ /* remove form file and isam files */
+ strxmov(path, mysql_data_home, "/", db, "/", table->real_name, reg_ext,
+ NullS);
+ (void) unpack_filename(path,path);
- if (access(path,F_OK))
+ table_type=get_table_type(path);
+ }
+ if (drop_temporary || access(path,F_OK))
{
if (if_exists)
- store_warning(thd, ER_BAD_TABLE_ERROR, table->real_name);
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR),
+ table->real_name);
else
error= 1;
}
@@ -190,6 +212,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
wrong_tables.append(String(table->real_name,default_charset_info));
}
}
+ thd->lex.tmp_table_used= tmp_table_deleted;
if (some_tables_deleted || tmp_table_deleted)
{
query_cache_invalidate3(thd, tables, 0);
@@ -398,7 +421,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
it.rewind();
while ((sql_field=it++))
{
- if(!sql_field->charset)
+ if (!sql_field->charset)
sql_field->charset = create_info->table_charset ?
create_info->table_charset :
thd->db_charset? thd->db_charset :
@@ -824,6 +847,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
(void) rm_temporary_table(create_info->db_type, path);
goto end;
}
+ thd->lex.tmp_table_used= 1;
}
if (!tmp_table && !no_log)
{
@@ -1392,6 +1416,127 @@ int mysql_optimize_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt)
}
+/*
+ Create a table identical to the specified table
+
+ SYNOPSIS
+ mysql_create_like_table()
+ thd Thread object
+ table Table list (one table only)
+ create_info Create info
+ table_ident Src table_ident
+
+ RETURN VALUES
+ 0 ok
+ -1 error
+*/
+
+int mysql_create_like_table(THD* thd, TABLE_LIST* table,
+ HA_CREATE_INFO *create_info,
+ Table_ident *table_ident)
+{
+ TABLE **tmp_table;
+ char src_path[FN_REFLEN], dst_path[FN_REFLEN];
+ char *db= table->db;
+ char *table_name= table->real_name;
+ char *src_db= thd->db;
+ char *src_table= table_ident->table.str;
+ int err;
+
+ DBUG_ENTER("mysql_create_like_table");
+
+ /*
+ Validate the source table
+ */
+ if (table_ident->table.length > NAME_LEN ||
+ (table_ident->table.length &&
+ check_table_name(src_table,table_ident->table.length)) ||
+ table_ident->db.str && check_db_name((src_db= table_ident->db.str)))
+ {
+ my_error(ER_WRONG_TABLE_NAME, MYF(0), src_table);
+ DBUG_RETURN(-1);
+ }
+
+ if ((tmp_table= find_temporary_table(thd, src_db, src_table)))
+ strxmov(src_path, (*tmp_table)->path, reg_ext, NullS);
+ else
+ {
+ strxmov(src_path, mysql_data_home, "/", src_db, "/", src_table,
+ reg_ext, NullS);
+ if (access(src_path, F_OK))
+ {
+ my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table);
+ DBUG_RETURN(-1);
+ }
+ }
+
+ /*
+ Validate the destination table
+
+ skip the destination table name checking as this is already
+ validated.
+ */
+ if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
+ {
+ if (find_temporary_table(thd, db, table_name))
+ goto table_exists;
+ sprintf(dst_path,"%s%s%lx_%lx_%x%s",mysql_tmpdir,tmp_file_prefix,
+ current_pid, thd->thread_id, thd->tmp_table++,reg_ext);
+ create_info->table_options|= HA_CREATE_DELAY_KEY_WRITE;
+ }
+ else
+ {
+ strxmov(dst_path, mysql_data_home, "/", db, "/", table_name,
+ reg_ext, NullS);
+ if (!access(dst_path, F_OK))
+ goto table_exists;
+ }
+
+ /*
+ Create a new table by copying from source table
+ */
+ if (my_copy(src_path, dst_path, MYF(MY_WME)))
+ DBUG_RETURN(-1);
+
+ /*
+ As mysql_truncate don't work on a new table at this stage of
+ creation, instead create the table directly (for both normal
+ and temporary tables).
+ */
+ *fn_ext(dst_path)= 0;
+ err= ha_create_table(dst_path, create_info, 1);
+
+ if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
+ {
+ if (err || !open_temporary_table(thd, dst_path, db, table_name, 1))
+ {
+ (void) rm_temporary_table(create_info->db_type,
+ dst_path); /* purecov: inspected */
+ DBUG_RETURN(-1); /* purecov: inspected */
+ }
+ }
+ else if (err)
+ {
+ (void) quick_rm_table(create_info->db_type, db,
+ table_name); /* purecov: inspected */
+ DBUG_RETURN(-1); /* purecov: inspected */
+ }
+ DBUG_RETURN(0);
+
+table_exists:
+ if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
+ {
+ char warn_buff[MYSQL_ERRMSG_SIZE];
+ sprintf(warn_buff,ER(ER_TABLE_EXISTS_ERROR),table_name);
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TABLE_EXISTS_ERROR,warn_buff);
+ DBUG_RETURN(0);
+ }
+ my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
+ DBUG_RETURN(-1);
+}
+
+
int mysql_analyze_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt)
{
#ifdef OS2
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 3fbeaa753db..758778ecfa8 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -276,6 +276,7 @@ static void display_table_locks (void)
VOID(pthread_mutex_unlock(&lock->mutex));
}
VOID(pthread_mutex_unlock(&THR_LOCK_lock));
+ uint i;
if (!saved_table_locks.elements) goto end;
qsort((gptr) dynamic_element(&saved_table_locks,0,TABLE_LOCK_INFO *),saved_table_locks.elements,sizeof(TABLE_LOCK_INFO),(qsort_cmp) dl_compare);
@@ -283,7 +284,7 @@ static void display_table_locks (void)
puts("\nThread database.table_name Locked/Waiting Lock_type\n");
- for (uint i=0 ; i < saved_table_locks.elements ; i++)
+ for (i=0 ; i < saved_table_locks.elements ; i++)
{
TABLE_LOCK_INFO *dl_ptr=dynamic_element(&saved_table_locks,i,TABLE_LOCK_INFO*);
printf("%-8ld%-28.28s%-22s%s\n",
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 51d43b41833..324befcb59e 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -33,6 +33,7 @@
#endif
#include "mysql_priv.h"
+#include <my_pthread.h>
#ifdef HAVE_DLOPEN
extern "C"
@@ -70,7 +71,7 @@ extern "C"
static bool initialized = 0;
static MEM_ROOT mem;
static HASH udf_hash;
-static pthread_mutex_t THR_LOCK_udf;
+static rw_lock_t THR_LOCK_udf;
static udf_func *add_udf(char *name, Item_result ret, char *dl,
@@ -122,8 +123,8 @@ void udf_init()
if (initialized)
DBUG_VOID_RETURN;
- pthread_mutex_init(&THR_LOCK_udf,MY_MUTEX_INIT_SLOW);
-
+ my_rwlock_init(&THR_LOCK_udf,NULL);
+
init_sql_alloc(&mem, 1024,0);
THD *new_thd = new THD;
if (!new_thd ||
@@ -262,7 +263,7 @@ static void del_udf(udf_func *udf)
void free_udf(udf_func *udf)
{
DBUG_ENTER("free_udf");
- pthread_mutex_lock(&THR_LOCK_udf);
+ rw_wrlock(&THR_LOCK_udf);
if (!--udf->usage_count)
{
/*
@@ -274,7 +275,7 @@ void free_udf(udf_func *udf)
if (!find_udf_dl(udf->dl))
dlclose(udf->dlhandle);
}
- pthread_mutex_unlock(&THR_LOCK_udf);
+ rw_unlock(&THR_LOCK_udf);
DBUG_VOID_RETURN;
}
@@ -287,7 +288,7 @@ udf_func *find_udf(const char *name,uint length,bool mark_used)
DBUG_ENTER("find_udf");
/* TODO: This should be changed to reader locks someday! */
- pthread_mutex_lock(&THR_LOCK_udf);
+ rw_rdlock(&THR_LOCK_udf);
if ((udf=(udf_func*) hash_search(&udf_hash,(byte*) name,
length ? length : (uint) strlen(name))))
{
@@ -296,7 +297,7 @@ udf_func *find_udf(const char *name,uint length,bool mark_used)
else if (mark_used)
udf->usage_count++;
}
- pthread_mutex_unlock(&THR_LOCK_udf);
+ rw_unlock(&THR_LOCK_udf);
DBUG_RETURN(udf);
}
@@ -375,7 +376,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
DBUG_RETURN(1);
}
- pthread_mutex_lock(&THR_LOCK_udf);
+ rw_wrlock(&THR_LOCK_udf);
if ((hash_search(&udf_hash,(byte*) udf->name, udf->name_length)))
{
net_printf(thd, ER_UDF_EXISTS, udf->name);
@@ -438,13 +439,13 @@ int mysql_create_function(THD *thd,udf_func *udf)
del_udf(u_d);
goto err;
}
- pthread_mutex_unlock(&THR_LOCK_udf);
+ rw_unlock(&THR_LOCK_udf);
DBUG_RETURN(0);
err:
if (new_dl)
dlclose(dl);
- pthread_mutex_unlock(&THR_LOCK_udf);
+ rw_unlock(&THR_LOCK_udf);
DBUG_RETURN(1);
}
@@ -460,7 +461,7 @@ int mysql_drop_function(THD *thd,const char *udf_name)
send_error(thd, ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES));
DBUG_RETURN(1);
}
- pthread_mutex_lock(&THR_LOCK_udf);
+ rw_wrlock(&THR_LOCK_udf);
if (!(udf=(udf_func*) hash_search(&udf_hash,(byte*) udf_name,
(uint) strlen(udf_name))))
{
@@ -490,10 +491,10 @@ int mysql_drop_function(THD *thd,const char *udf_name)
}
close_thread_tables(thd);
- pthread_mutex_unlock(&THR_LOCK_udf);
+ rw_unlock(&THR_LOCK_udf);
DBUG_RETURN(0);
err:
- pthread_mutex_unlock(&THR_LOCK_udf);
+ rw_unlock(&THR_LOCK_udf);
DBUG_RETURN(1);
}
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 10175bfe345..cdd34977e5a 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -279,9 +279,10 @@ int st_select_lex_unit::exec()
}
if (!thd->fatal_error) // Check if EOM
{
- offset_limit_cnt= global_parameters->offset_limit;
- select_limit_cnt= global_parameters->select_limit+
- global_parameters->offset_limit;
+ SELECT_LEX *sl=thd->lex.current_select->master_unit()->first_select();
+ offset_limit_cnt= (sl->braces) ? global_parameters->offset_limit : 0;
+ select_limit_cnt= (sl->braces) ? global_parameters->select_limit+
+ global_parameters->offset_limit : HA_POS_ERROR;
if (select_limit_cnt < global_parameters->select_limit)
select_limit_cnt= HA_POS_ERROR; // no limit
if (select_limit_cnt == HA_POS_ERROR)
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index de5cb9ef45b..3aae6f6f411 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -233,6 +233,7 @@ int mysql_update(THD *thd,
}
}
end_read_record(&info);
+
if (table->key_read)
{
table->key_read=0;
@@ -416,8 +417,6 @@ int mysql_multi_update(THD *thd,
(ORDER *)NULL,
options | SELECT_NO_JOIN_CACHE,
result, unit, select_lex, 0);
-
-end:
delete result;
DBUG_RETURN(res);
}
@@ -631,7 +630,6 @@ bool multi_update::send_data(List<Item> &not_used_values)
TABLE_LIST *cur_table;
DBUG_ENTER("multi_update::send_data");
- found++;
for (cur_table= update_tables; cur_table ; cur_table= cur_table->next)
{
TABLE *table= cur_table->table;
@@ -647,6 +645,7 @@ bool multi_update::send_data(List<Item> &not_used_values)
store_record(table,1);
if (fill_record(*fields_for_table[offset], *values_for_table[offset]))
DBUG_RETURN(1);
+ found++;
if (compare_record(table, thd->query_id))
{
int error;
@@ -673,7 +672,7 @@ bool multi_update::send_data(List<Item> &not_used_values)
int error;
TABLE *tmp_table= tmp_tables[offset];
fill_record(tmp_table->field+1, *values_for_table[offset]);
-
+ found++;
/* Store pointer to row */
memcpy((char*) tmp_table->field[0]->ptr,
(char*) table->file->ref, table->file->ref_length);
@@ -772,7 +771,6 @@ int multi_update::do_updates(bool from_send_error)
continue; // May happen on dup key
goto err;
}
- found++;
if ((local_error= table->file->rnd_pos(table->record[0], ref_pos)))
goto err;
table->status|= STATUS_UPDATED;
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 55f165c0739..318d563b88a 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001 MySQL AB
+/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -222,6 +222,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token FIRST_SYM
%token FIXED_SYM
%token FLOAT_NUM
+%token FORCE_SYM
%token FOREIGN
%token FROM
%token FULL
@@ -587,7 +588,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
simple_ident select_item2 expr opt_expr opt_else sum_expr in_sum_expr
table_wild opt_pad no_in_expr expr_expr simple_expr no_and_expr
using_list expr_or_default set_expr_or_default
- param_marker singleval_subselect singleval_subselect_init
+ param_marker singlerow_subselect singlerow_subselect_init
exists_subselect exists_subselect_init
%type <item_list>
@@ -633,7 +634,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%type <charset>
charset_name
charset_name_or_default
- opt_db_default_character_set
+ collation_name
+ collation_name_or_default
%type <variable> internal_variable_name
@@ -822,7 +824,8 @@ create:
($2 &
HA_LEX_CREATE_TMP_TABLE ?
&tmp_table_alias :
- (LEX_STRING*) 0),1,
+ (LEX_STRING*) 0),
+ TL_OPTION_UPDATING,
((using_update_log)?
TL_READ_NO_INSERT:
TL_READ)))
@@ -835,6 +838,7 @@ create:
lex->create_info.options=$2 | $4;
lex->create_info.db_type= (enum db_type) lex->thd->variables.table_type;
lex->create_info.table_charset=thd->db_charset?thd->db_charset:default_charset_info;
+ lex->name=0;
}
create2
{}
@@ -842,7 +846,8 @@ create:
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_CREATE_INDEX;
- if (!lex->current_select->add_table_to_list(lex->thd, $7,NULL,1))
+ if (!lex->current_select->add_table_to_list(lex->thd, $7, NULL,
+ TL_OPTION_UPDATING))
YYABORT;
lex->create_list.empty();
lex->key_list.empty();
@@ -856,13 +861,14 @@ create:
lex->key_list.push_back(new Key($2,$4.str, $5, lex->col_list));
lex->col_list.empty();
}
- | CREATE DATABASE opt_if_not_exists ident opt_db_default_character_set
+ | CREATE DATABASE opt_if_not_exists ident
+ { Lex->create_info.table_charset=NULL; }
+ opt_create_database_options
{
LEX *lex=Lex;
lex->sql_command=SQLCOM_CREATE_DB;
lex->name=$4.str;
lex->create_info.options=$3;
- lex->create_info.table_charset=$5;
}
| CREATE udf_func_type UDF_SYM ident
{
@@ -883,7 +889,13 @@ create:
create2:
'(' field_list ')' opt_create_table_options create3 {}
| opt_create_table_options create3 {}
- ;
+ | LIKE table_ident
+ {
+ LEX *lex=Lex;
+ if (!(lex->name= (char *)$2))
+ YYABORT;
+ }
+ ;
create3:
/* empty */ {}
@@ -900,6 +912,22 @@ opt_as:
/* empty */ {}
| AS {};
+opt_create_database_options:
+ /* empty */ {}
+ | create_database_options {};
+
+create_database_options:
+ create_database_option {}
+ | create_database_options create_database_option {};
+
+create_database_option:
+ COLLATE_SYM collation_name_or_default
+ { Lex->create_info.table_charset=$2; }
+ | opt_default CHAR_SYM SET charset_name_or_default
+ { Lex->create_info.table_charset=$4; }
+ | opt_default CHARSET charset_name_or_default
+ { Lex->create_info.table_charset=$3; };
+
opt_table_options:
/* empty */ { $$= 0; }
| table_options { $$= $1;};
@@ -967,6 +995,11 @@ create_table_option:
Lex->create_info.table_charset= $5;
Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET;
}
+ | COLLATE_SYM opt_equal collation_name_or_default
+ {
+ Lex->create_info.table_charset= $3;
+ Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET;
+ }
| INSERT_METHOD opt_equal merge_insert_types { Lex->create_info.merge_insert_method= $3; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;}
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING { Lex->create_info.data_file_name= $4.str; }
| INDEX DIRECTORY_SYM opt_equal TEXT_STRING { Lex->create_info.index_file_name= $4.str; };
@@ -997,6 +1030,7 @@ merge_insert_types:
opt_select_from:
opt_limit_clause {}
+ | FROM DUAL_SYM {}
| select_from select_lock_type;
udf_func_type:
@@ -1223,19 +1257,26 @@ attribute:
| opt_primary KEY_SYM { Lex->type|= PRI_KEY_FLAG | NOT_NULL_FLAG; }
| UNIQUE_SYM { Lex->type|= UNIQUE_FLAG; }
| UNIQUE_SYM KEY_SYM { Lex->type|= UNIQUE_KEY_FLAG; }
- | COMMENT_SYM text_literal { Lex->comment= $2; };
+ | COMMENT_SYM text_literal { Lex->comment= $2; }
+ | COLLATE_SYM collation_name { Lex->charset=$2; };
charset_name:
- BINARY
+ ident
{
- if (!($$=get_charset_by_name("binary",MYF(0))))
+ if (!($$=get_charset_by_csname($1.str,MYF(0))))
{
- net_printf(YYTHD,ER_UNKNOWN_CHARACTER_SET,"binary");
+ net_printf(YYTHD,ER_UNKNOWN_CHARACTER_SET,$1.str);
YYABORT;
}
- }
- | ident
+ };
+
+charset_name_or_default:
+ charset_name { $$=$1; }
+ | DEFAULT { $$=NULL; } ;
+
+collation_name:
+ ident
{
if (!($$=get_charset_by_name($1.str,MYF(0))))
{
@@ -1244,19 +1285,14 @@ charset_name:
}
};
-charset_name_or_default:
- charset_name { $$=$1; }
+collation_name_or_default:
+ collation_name { $$=$1; }
| DEFAULT { $$=NULL; } ;
opt_default:
/* empty */ {}
| DEFAULT {};
-opt_db_default_character_set:
- /* empty */ { $$=default_charset_info; }
- | opt_default CHAR_SYM SET charset_name_or_default { $$=$4; }
- | opt_default CHARSET charset_name_or_default { $$=$3; };
-
opt_binary:
/* empty */ { Lex->charset=NULL; }
| ASCII_SYM { Lex->charset=my_charset_latin1; }
@@ -1270,7 +1306,6 @@ opt_binary:
YYABORT;
}
}
- | COLLATE_SYM charset_name { Lex->charset=$2; }
| CHAR_SYM SET charset_name { Lex->charset=$3; } ;
opt_primary:
@@ -1347,7 +1382,8 @@ opt_unique_or_fulltext:
key_alg:
/* empty */ { $$= HA_KEY_ALG_UNDEF; }
- | USING opt_btree_or_rtree { $$= $2; };
+ | USING opt_btree_or_rtree { $$= $2; }
+ | TYPE_SYM opt_btree_or_rtree { $$= $2; };
opt_btree_or_rtree:
BTREE_SYM { $$= HA_KEY_ALG_BTREE; }
@@ -1381,7 +1417,8 @@ alter:
LEX *lex=&thd->lex;
lex->sql_command = SQLCOM_ALTER_TABLE;
lex->name=0;
- if (!lex->select_lex.add_table_to_list(thd, $4, NULL,1))
+ if (!lex->select_lex.add_table_to_list(thd, $4, NULL,
+ TL_OPTION_UPDATING))
YYABORT;
lex->drop_primary=0;
lex->create_list.empty();
@@ -1400,12 +1437,11 @@ alter:
}
alter_list
{}
- | ALTER DATABASE ident opt_db_default_character_set
+ | ALTER DATABASE ident opt_create_database_options
{
LEX *lex=Lex;
lex->sql_command=SQLCOM_ALTER_DB;
lex->name=$3.str;
- lex->create_info.table_charset=$4;
};
@@ -1648,8 +1684,10 @@ table_to_table:
{
LEX *lex=Lex;
SELECT_LEX_NODE *sl= lex->current_select;
- if (!sl->add_table_to_list(lex->thd, $1,NULL,1,TL_IGNORE) ||
- !sl->add_table_to_list(lex->thd, $3,NULL,1,TL_IGNORE))
+ if (!sl->add_table_to_list(lex->thd, $1,NULL,TL_OPTION_UPDATING,
+ TL_IGNORE) ||
+ !sl->add_table_to_list(lex->thd, $3,NULL,TL_OPTION_UPDATING,
+ TL_IGNORE))
YYABORT;
};
@@ -1668,12 +1706,17 @@ select_init:
'(' SELECT_SYM select_part2 ')'
{
LEX *lex= Lex;
- SELECT_LEX_NODE * sel= lex->current_select;
+ SELECT_LEX * sel= lex->current_select->select_lex();
if (sel->set_braces(1))
{
send_error(lex->thd, ER_SYNTAX_ERROR);
YYABORT;
}
+ if (sel->linkage == UNION_TYPE && !sel->master_unit()->first_select()->braces)
+ {
+ send_error(lex->thd, ER_SYNTAX_ERROR);
+ YYABORT;
+ }
/* select in braces, can't contain global parameters */
sel->master_unit()->global_parameters=
sel->master_unit();
@@ -1683,11 +1726,17 @@ select_init2:
select_part2
{
LEX *lex= Lex;
+ SELECT_LEX * sel= lex->current_select->select_lex();
if (lex->current_select->set_braces(0))
{
send_error(lex->thd, ER_SYNTAX_ERROR);
YYABORT;
}
+ if (sel->linkage == UNION_TYPE && sel->master_unit()->first_select()->braces)
+ {
+ send_error(lex->thd, ER_SYNTAX_ERROR);
+ YYABORT;
+ }
}
union_clause
;
@@ -1695,6 +1744,7 @@ select_init2:
select_part2:
{
LEX *lex=Lex;
+ SELECT_LEX * sel= lex->current_select->select_lex();
if (lex->current_select == &lex->select_lex)
lex->lock_option= TL_READ; /* Only for global SELECT */
mysql_init_select(lex);
@@ -1880,7 +1930,7 @@ expr_expr:
{ $$= new Item_date_add_interval($1,$4,$5,0); }
| expr '-' INTERVAL_SYM expr interval
{ $$= new Item_date_add_interval($1,$4,$5,1); }
- | expr COLLATE_SYM charset_name
+ | expr COLLATE_SYM collation_name
{ $$= new Item_func_set_collation($1,$3); };
/* expressions that begin with 'expr' that do NOT follow IN_SYM */
@@ -2017,7 +2067,7 @@ simple_expr:
$$= new Item_row(*$5);
}
| EXISTS exists_subselect { $$= $2; }
- | singleval_subselect { $$= $1; }
+ | singlerow_subselect { $$= $1; }
| '{' ident expr '}' { $$= $3; }
| MATCH ident_list_arg AGAINST '(' expr ')'
{ Select->add_ftfunc_to_list((Item_func_match *)
@@ -2201,9 +2251,9 @@ simple_expr:
| NOW_SYM '(' expr ')'
{ $$= new Item_func_now($3); Lex->safe_to_cache_query=0;}
| PASSWORD '(' expr ')'
- {
- $$= new Item_func_password($3);
- }
+ { $$= new Item_func_password($3); }
+ | PASSWORD '(' expr ',' expr ')'
+ { $$= new Item_func_password($3,$5); }
| POINTFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| POINTFROMTEXT '(' expr ',' expr ')'
@@ -2489,12 +2539,14 @@ join_table:
{
SELECT_LEX *sel= Select->select_lex();
sel->use_index_ptr=sel->ignore_index_ptr=0;
+ sel->table_join_options= 0;
}
table_ident opt_table_alias opt_key_definition
{
LEX *lex= Lex;
SELECT_LEX_NODE *sel= lex->current_select;
- if (!($$= sel->add_table_to_list(lex->thd, $2, $3, 0,
+ if (!($$= sel->add_table_to_list(lex->thd, $2, $3,
+ sel->get_table_join_options(),
lex->lock_option,
sel->get_use_index(),
sel->get_ignore_index())))
@@ -2509,7 +2561,9 @@ join_table:
lex->current_select= unit->outer_select();
if (!($$= lex->current_select->
add_table_to_list(lex->thd, new Table_ident(unit), $5, 0,
- lex->lock_option)))
+ TL_READ,(List<String> *)0,
+ (List<String> *)0)))
+
YYABORT;
};
@@ -2538,6 +2592,13 @@ opt_key_definition:
sel->use_index= *$2;
sel->use_index_ptr= &sel->use_index;
}
+ | FORCE_SYM key_usage_list
+ {
+ SELECT_LEX *sel= Select->select_lex();
+ sel->use_index= *$2;
+ sel->use_index_ptr= &sel->use_index;
+ sel->table_join_options|= TL_OPTION_FORCE_INDEX;
+ }
| IGNORE_SYM key_usage_list
{
SELECT_LEX *sel= Select->select_lex();
@@ -2547,8 +2608,14 @@ opt_key_definition:
key_usage_list:
key_or_index { Select->select_lex()->interval_list.empty(); }
- '(' key_usage_list2 ')'
- { $$= &Select->select_lex()->interval_list; };
+ '(' key_list_or_empty ')'
+ { $$= &Select->select_lex()->interval_list; }
+ ;
+
+key_list_or_empty:
+ /* empty */ {}
+ | key_usage_list2 {}
+ ;
key_usage_list2:
key_usage_list2 ',' ident
@@ -2909,7 +2976,8 @@ drop:
lex->drop_list.empty();
lex->drop_list.push_back(new Alter_drop(Alter_drop::KEY,
$3.str));
- if (!lex->current_select->add_table_to_list(lex->thd, $5,NULL, 1))
+ if (!lex->current_select->add_table_to_list(lex->thd, $5, NULL,
+ TL_OPTION_UPDATING))
YYABORT;
}
| DROP DATABASE if_exists ident
@@ -2933,7 +3001,11 @@ table_list:
table_name:
table_ident
- { if (!Select->add_table_to_list(YYTHD, $1, NULL, 1)) YYABORT; };
+ {
+ if (!Select->add_table_to_list(YYTHD, $1, NULL, TL_OPTION_UPDATING))
+ YYABORT;
+ }
+ ;
if_exists:
/* empty */ { $$= 0; }
@@ -3168,7 +3240,8 @@ delete:
single_multi:
FROM table_ident
{
- if (!Select->add_table_to_list(YYTHD, $2, NULL, 1, Lex->lock_option))
+ if (!Select->add_table_to_list(YYTHD, $2, NULL, TL_OPTION_UPDATING,
+ Lex->lock_option))
YYABORT;
}
where_clause opt_order_clause
@@ -3187,16 +3260,17 @@ table_wild_list:
| table_wild_list ',' table_wild_one {};
table_wild_one:
- ident opt_wild
+ ident opt_wild opt_table_alias
{
- if (!Select->add_table_to_list(YYTHD, new Table_ident($1), NULL, 1,
- Lex->lock_option))
+ if (!Select->add_table_to_list(YYTHD, new Table_ident($1), $3,
+ TL_OPTION_UPDATING, Lex->lock_option))
YYABORT;
}
- | ident '.' ident opt_wild
+ | ident '.' ident opt_wild opt_table_alias
{
if (!Select->add_table_to_list(YYTHD, new Table_ident($1, $3, 0),
- NULL, 1, Lex->lock_option))
+ $5, TL_OPTION_UPDATING,
+ Lex->lock_option))
YYABORT;
}
;
@@ -3360,7 +3434,7 @@ show_param:
| CREATE TABLE_SYM table_ident
{
Lex->sql_command = SQLCOM_SHOW_CREATE;
- if(!Select->add_table_to_list(YYTHD, $3, NULL,0))
+ if (!Select->add_table_to_list(YYTHD, $3, NULL,0))
YYABORT;
}
| MASTER_SYM STATUS_SYM
@@ -3529,14 +3603,14 @@ load: LOAD DATA_SYM load_data_lock opt_local INFILE TEXT_STRING
opt_duplicate INTO TABLE_SYM table_ident opt_field_term opt_line_term
opt_ignore_lines opt_field_spec
{
- if (!Select->add_table_to_list(YYTHD, $11, NULL, 1))
+ if (!Select->add_table_to_list(YYTHD, $11, NULL, TL_OPTION_UPDATING))
YYABORT;
}
|
LOAD TABLE_SYM table_ident FROM MASTER_SYM
{
Lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
- if (!Select->add_table_to_list(YYTHD, $3, NULL, 1))
+ if (!Select->add_table_to_list(YYTHD, $3, NULL, TL_OPTION_UPDATING))
YYABORT;
}
@@ -3666,17 +3740,41 @@ simple_ident:
}
| ident '.' ident
{
- SELECT_LEX_NODE *sel=Select;
+ THD *thd= YYTHD;
+ LEX *lex= &thd->lex;
+ SELECT_LEX_NODE *sel= lex->current_select;
+ if (sel->no_table_names_allowed)
+ {
+ my_printf_error(ER_TABLENAME_NOT_ALLOWED_HERE,
+ ER(ER_TABLENAME_NOT_ALLOWED_HERE),
+ MYF(0), $1.str, thd->where);
+ }
$$ = !sel->create_refs || sel->get_in_sum_expr() > 0 ? (Item*) new Item_field(NullS,$1.str,$3.str) : (Item*) new Item_ref(NullS,$1.str,$3.str);
}
| '.' ident '.' ident
{
- SELECT_LEX_NODE *sel=Select;
+ THD *thd= YYTHD;
+ LEX *lex= &thd->lex;
+ SELECT_LEX_NODE *sel= lex->current_select;
+ if (sel->no_table_names_allowed)
+ {
+ my_printf_error(ER_TABLENAME_NOT_ALLOWED_HERE,
+ ER(ER_TABLENAME_NOT_ALLOWED_HERE),
+ MYF(0), $2.str, thd->where);
+ }
$$ = !sel->create_refs || sel->get_in_sum_expr() > 0 ? (Item*) new Item_field(NullS,$2.str,$4.str) : (Item*) new Item_ref(NullS,$2.str,$4.str);
}
| ident '.' ident '.' ident
{
- SELECT_LEX_NODE *sel=Select;
+ THD *thd= YYTHD;
+ LEX *lex= &thd->lex;
+ SELECT_LEX_NODE *sel= lex->current_select;
+ if (sel->no_table_names_allowed)
+ {
+ my_printf_error(ER_TABLENAME_NOT_ALLOWED_HERE,
+ ER(ER_TABLENAME_NOT_ALLOWED_HERE),
+ MYF(0), $3.str, thd->where);
+ }
$$ = !sel->create_refs || sel->get_in_sum_expr() > 0 ? (Item*) new Item_field((YYTHD->client_capabilities & CLIENT_NO_SCHEMA ? NullS :$1.str),$3.str,$5.str) : (Item*) new Item_ref((YYTHD->client_capabilities & CLIENT_NO_SCHEMA ? NullS :$1.str),$3.str,$5.str);
};
@@ -4461,7 +4559,8 @@ optional_order_or_limit:
/* Empty */ {}
|
{
- LEX *lex=Lex;
+ THD *thd= YYTHD;
+ LEX *lex= &thd->lex;
if (!lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
{
send_error(lex->thd, ER_SYNTAX_ERROR);
@@ -4473,8 +4572,15 @@ optional_order_or_limit:
lex->current_select= sel->master_unit();
lex->current_select->select_limit=
lex->thd->variables.select_limit;
+ lex->current_select->no_table_names_allowed= 1;
+ thd->where= "global ORDER clause";
}
order_or_limit
+ {
+ THD *thd= YYTHD;
+ thd->lex.current_select->no_table_names_allowed= 0;
+ thd->where= "";
+ }
;
order_or_limit:
@@ -4487,17 +4593,17 @@ union_option:
/* empty */ {}
| ALL {Select->master_unit()->union_option= 1;};
-singleval_subselect:
- subselect_start singleval_subselect_init
+singlerow_subselect:
+ subselect_start singlerow_subselect_init
subselect_end
{
$$= $2;
};
-singleval_subselect_init:
+singlerow_subselect_init:
select_init2
{
- $$= new Item_singleval_subselect(YYTHD,
+ $$= new Item_singlerow_subselect(YYTHD,
Lex->current_select->master_unit()->
first_select());
};
diff --git a/sql/stacktrace.c b/sql/stacktrace.c
index f5c0a59b572..762c45e7184 100644
--- a/sql/stacktrace.c
+++ b/sql/stacktrace.c
@@ -38,7 +38,7 @@ void safe_print_str(const char* name, const char* val, int max_len)
}
fprintf(stderr, "= ");
- for(; max_len && PTR_SANE(val) && *val; --max_len)
+ for (; max_len && PTR_SANE(val) && *val; --max_len)
fputc(*val++, stderr);
fputc('\n', stderr);
}
@@ -59,7 +59,7 @@ void safe_print_str(const char* name, const char* val, int max_len)
inline uchar** find_prev_fp(uint32* pc, uchar** fp)
{
int i;
- for(i = 0; i < MAX_INSTR_IN_FUNC; ++i,--pc)
+ for (i = 0; i < MAX_INSTR_IN_FUNC; ++i,--pc)
{
uchar* p = (uchar*)pc;
if (p[2] == 222 && p[3] == 35)
@@ -73,7 +73,7 @@ inline uchar** find_prev_fp(uint32* pc, uchar** fp)
inline uint32* find_prev_pc(uint32* pc, uchar** fp)
{
int i;
- for(i = 0; i < MAX_INSTR_IN_FUNC; ++i,--pc)
+ for (i = 0; i < MAX_INSTR_IN_FUNC; ++i,--pc)
{
char* p = (char*)pc;
if (p[1] == 0 && p[2] == 94 && p[3] == -73)
diff --git a/sql/structs.h b/sql/structs.h
index 604be6fcc6e..59b9335a5c4 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -130,7 +130,7 @@ enum SHOW_TYPE
SHOW_UNDEF,
SHOW_LONG, SHOW_LONGLONG, SHOW_INT, SHOW_CHAR, SHOW_CHAR_PTR, SHOW_BOOL,
SHOW_MY_BOOL, SHOW_OPENTABLES, SHOW_STARTTIME, SHOW_QUESTION,
- SHOW_LONG_CONST, SHOW_INT_CONST, SHOW_HAVE, SHOW_SYS,
+ SHOW_LONG_CONST, SHOW_INT_CONST, SHOW_HAVE, SHOW_SYS, SHOW_HA_ROWS,
#ifdef HAVE_OPENSSL
SHOW_SSL_CTX_SESS_ACCEPT, SHOW_SSL_CTX_SESS_ACCEPT_GOOD,
SHOW_SSL_GET_VERSION, SHOW_SSL_CTX_GET_SESSION_CACHE_MODE,
diff --git a/sql/table.cc b/sql/table.cc
index 84a072c886d..72f0143115f 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -146,7 +146,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
bzero((char*) keyinfo,n_length);
outparam->key_info=keyinfo;
outparam->max_key_length= outparam->total_key_length= 0;
- key_part= (KEY_PART_INFO*) (keyinfo+keys);
+ key_part= my_reinterpret_cast(KEY_PART_INFO*) (keyinfo+keys);
strpos=disk_buff+6;
ulong *rec_per_key;
diff --git a/sql/table.h b/sql/table.h
index d24e4e1e422..6291b250787 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -91,6 +91,7 @@ struct st_table {
my_bool copy_blobs; /* copy_blobs when storing */
my_bool null_row; /* All columns are null */
my_bool maybe_null,outer_join; /* Used with OUTER JOIN */
+ my_bool force_index;
my_bool distinct,const_table,no_rows;
my_bool key_read, bulk_insert;
my_bool crypted;
@@ -168,6 +169,7 @@ typedef struct st_table_list
bool straight; /* optimize with prev table */
bool updating; /* for replicate-do/ignore table */
bool do_redirect; /* To get the struct in UNION's */
+ bool force_index; /* Prefer index over table scan */
} TABLE_LIST;
typedef struct st_changed_table_list