Commit 19345396 authored by unknown's avatar unknown

Merge mskold@build.mysql.com:/home/bk/mysql-4.1

into mysql.com:/usr/local/home/marty/MySQL/test/mysql-4.1

parents c6d8121c 786f841f
......@@ -2834,25 +2834,13 @@ com_status(String *buffer __attribute__((unused)),
const char *status;
char buff[22];
ulonglong id;
MYSQL_RES *result;
LINT_INIT(result);
tee_puts("--------------", stdout);
usage(1); /* Print version */
if (connected)
{
MYSQL_RES *result;
LINT_INIT(result);
tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",mysql_thread_id(&mysql));
if (!mysql_query(&mysql,"select DATABASE(), USER() limit 1") &&
(result=mysql_use_result(&mysql)))
{
MYSQL_ROW cur=mysql_fetch_row(result);
if (cur)
{
tee_fprintf(stdout, "Current database:\t%s\n", cur[0] ? cur[0] : "");
tee_fprintf(stdout, "Current user:\t\t%s\n", cur[1]);
}
mysql_free_result(result);
}
#ifdef HAVE_OPENSSL
if (mysql.net.vio && mysql.net.vio->ssl_arg &&
SSL_get_cipher((SSL*) mysql.net.vio->ssl_arg))
......@@ -2886,9 +2874,20 @@ com_status(String *buffer __attribute__((unused)),
if ((id= mysql_insert_id(&mysql)))
tee_fprintf(stdout, "Insert id:\t\t%s\n", llstr(id, buff));
tee_fprintf(stdout, "Client characterset:\t%s\n",
charset_info->name);
tee_fprintf(stdout, "Server characterset:\t%s\n", mysql.charset->name);
if (!mysql_query(&mysql,"select @@character_set_client, @@character_set_connection, @@character_set_server, @@character_set_database") &&
(result=mysql_use_result(&mysql)))
{
MYSQL_ROW cur=mysql_fetch_row(result);
if (cur)
{
tee_fprintf(stdout, "Server characterset:\t%s\n", cur[0] ? cur[0] : "");
tee_fprintf(stdout, "Db characterset:\t%s\n", cur[3] ? cur[3] : "");
tee_fprintf(stdout, "Client characterset:\t%s\n", cur[2] ? cur[2] : "");
tee_fprintf(stdout, "Conn. characterset:\t%s\n", cur[1] ? cur[1] : "");
}
mysql_free_result(result);
}
#ifndef EMBEDDED_LIBRARY
if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || ! mysql.unix_socket)
tee_fprintf(stdout, "TCP port:\t\t%d\n", mysql.port);
......
......@@ -2715,7 +2715,7 @@ case $default_charset in
define(UCSC2, ucs2_czech_ci ucs2_danish_ci)
define(UCSC3, ucs2_estonian_ci ucs2_icelandic_ci)
define(UCSC4, ucs2_latvian_ci ucs2_lithuanian_ci)
define(UCSC5, ucs2_polish_ci ucs2_romanian_ci)
define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci)
define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci)
define(UCSC7, ucs2_spanish2_ci ucs2_spanish_ci)
define(UCSC8, ucs2_swedish_ci ucs2_turkish_ci)
......@@ -2733,7 +2733,7 @@ case $default_charset in
define(UTFC2, utf8_czech_ci utf8_danish_ci)
define(UTFC3, utf8_estonian_ci utf8_icelandic_ci)
define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci)
define(UTFC5, utf8_polish_ci utf8_romanian_ci)
define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
define(UTFC6, utf8_slovak_ci utf8_slovenian_ci)
define(UTFC7, utf8_spanish2_ci utf8_spanish_ci)
define(UTFC8, utf8_swedish_ci utf8_turkish_ci)
......
This diff is collapsed.
......@@ -723,3 +723,16 @@ col2 col col
2 2 2
1 3 3
drop table t1, t2;
create table t1 (a char(25));
insert into t1 set a = repeat('x', 20);
insert into t1 set a = concat(repeat('x', 19), 'z');
insert into t1 set a = concat(repeat('x', 19), 'ab');
insert into t1 set a = concat(repeat('x', 19), 'aa');
set max_sort_length=20;
select a from t1 order by a;
a
xxxxxxxxxxxxxxxxxxxab
xxxxxxxxxxxxxxxxxxxaa
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxz
drop table t1;
This diff is collapsed.
......@@ -486,3 +486,16 @@ select t2.col2 as col, t2.col from t2 order by t2.col;
select t2.col2, t2.col, t2.col from t2 order by t2.col;
drop table t1, t2;
#
# Bug #5428: a problem with small max_sort_length value
#
create table t1 (a char(25));
insert into t1 set a = repeat('x', 20);
insert into t1 set a = concat(repeat('x', 19), 'z');
insert into t1 set a = concat(repeat('x', 19), 'ab');
insert into t1 set a = concat(repeat('x', 19), 'aa');
set max_sort_length=20;
select a from t1 order by a;
drop table t1;
......@@ -39,6 +39,7 @@ extern CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci;
extern CHARSET_INFO my_charset_ucs2_slovak_uca_ci;
extern CHARSET_INFO my_charset_ucs2_spanish2_uca_ci;
extern CHARSET_INFO my_charset_ucs2_roman_uca_ci;
extern CHARSET_INFO my_charset_ucs2_persian_uca_ci;
#endif
#ifdef HAVE_CHARSET_utf8
......@@ -58,6 +59,7 @@ extern CHARSET_INFO my_charset_utf8_lithuanian_uca_ci;
extern CHARSET_INFO my_charset_utf8_slovak_uca_ci;
extern CHARSET_INFO my_charset_utf8_spanish2_uca_ci;
extern CHARSET_INFO my_charset_utf8_roman_uca_ci;
extern CHARSET_INFO my_charset_utf8_persian_uca_ci;
#endif
my_bool init_compiled_charsets(myf flags __attribute__((unused)))
......@@ -127,6 +129,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_ucs2_slovak_uca_ci);
add_compiled_collation(&my_charset_ucs2_spanish2_uca_ci);
add_compiled_collation(&my_charset_ucs2_roman_uca_ci);
add_compiled_collation(&my_charset_ucs2_persian_uca_ci);
#endif
#ifdef HAVE_CHARSET_ujis
......@@ -153,6 +156,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8_slovak_uca_ci);
add_compiled_collation(&my_charset_utf8_spanish2_uca_ci);
add_compiled_collation(&my_charset_utf8_roman_uca_ci);
add_compiled_collation(&my_charset_utf8_persian_uca_ci);
#endif
/* Copy compiled charsets */
......
......@@ -6657,6 +6657,42 @@ static const char roman[]= /* i.e. Classical Latin */
"& I << j <<< J "
"& V << u <<< U ";
/*
Persian collation support was provided by
Jody McIntyre <mysql@modernduck.com>
To: internals@lists.mysql.com
Subject: Persian UTF8 collation support
Date: 17.08.2004
Contraction is not implemented. Some implementations do perform
contraction but others do not, and it is able to sort all my test
strings correctly.
Jody.
*/
static const char persian[]=
"& \\u066D < \\u064E < \\uFE76 < \\uFE77 < \\u0650 < \\uFE7A < \\uFE7B"
" < \\u064F < \\uFE78 < \\uFE79 < \\u064B < \\uFE70 < \\uFE71"
" < \\u064D < \\uFE74 < \\u064C < \\uFE72"
"& \\uFE7F < \\u0653 < \\u0654 < \\u0655 < \\u0670"
"& \\u0669 < \\u0622 < \\u0627 < \\u0671 < \\u0621 < \\u0623 < \\u0625"
" < \\u0624 < \\u0626"
"& \\u0642 < \\u06A9 < \\u0643"
"& \\u0648 < \\u0647 < \\u0629 < \\u06C0 < \\u06CC < \\u0649 < \\u064A"
"& \\uFE80 < \\uFE81 < \\uFE82 < \\uFE8D < \\uFE8E < \\uFB50 < \\uFB51"
" < \\uFE80 < \\uFE83 < \\uFE84 < \\uFE87 < \\uFE88 < \\uFE85"
" < \\uFE86 < \\u0689 < \\u068A"
"& \\uFEAE < \\uFDFC"
"& \\uFED8 < \\uFB8E < \\uFB8F < \\uFB90 < \\uFB91 < \\uFED9 < \\uFEDA"
" < \\uFEDB < \\uFEDC"
"& \\uFEEE < \\uFEE9 < \\uFEEA < \\uFEEB < \\uFEEC < \\uFE93 < \\uFE94"
" < \\uFBA4 < \\uFBA5 < \\uFBFC < \\uFBFD < \\uFBFE < \\uFBFF"
" < \\uFEEF < \\uFEF0 < \\uFEF1 < \\uFEF2 < \\uFEF3 < \\uFEF4"
" < \\uFEF5 < \\uFEF6 < \\uFEF7 < \\uFEF8 < \\uFEF9 < \\uFEFA"
" < \\uFEFB < \\uFEFC";
/*
Unicode Collation Algorithm:
Collation element (weight) scanner,
......@@ -7671,7 +7707,7 @@ static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems,
return (size_t) nitems;
}
#define MY_MAX_COLL_RULE 64
#define MY_MAX_COLL_RULE 128
/*
This function copies an UCS2 collation from
......@@ -8360,6 +8396,35 @@ CHARSET_INFO my_charset_ucs2_roman_uca_ci=
&my_collation_ucs2_uca_handler
};
CHARSET_INFO my_charset_ucs2_persian_uca_ci=
{
144,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
"ucs2", /* cs name */
"ucs2_persian_ci", /* name */
"", /* comment */
persian, /* tailoring */
NULL, /* ctype */
NULL, /* to_lower */
NULL, /* to_upper */
NULL, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
2, /* mbminlen */
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
};
#endif
......@@ -8838,4 +8903,32 @@ CHARSET_INFO my_charset_utf8_roman_uca_ci=
&my_charset_utf8_handler,
&my_collation_any_uca_handler
};
CHARSET_INFO my_charset_utf8_persian_uca_ci=
{
208,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
"utf8", /* cs name */
"utf8_persian_ci", /* name */
"", /* comment */
persian, /* tailoring */
ctype_utf8, /* ctype */
NULL, /* to_lower */
NULL, /* to_upper */
NULL, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
1, /* mbminlen */
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment