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

into mc05.(none):/space2/tomas/mysql-4.1-ndb-test
This commit is contained in:
unknown 2004-06-15 06:33:03 +02:00
commit 61540a24d7
40 changed files with 3125 additions and 190 deletions

View file

@ -14,6 +14,6 @@ extra_configs="$pentium_configs"
# fail
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
--with-embedded-server --enable-thread-safe-client \
--with-openssl --with-vio --with-raid --without-ndbcluster"
--with-openssl --with-vio --with-raid --with-ndbcluster"
. "$path/FINISH.sh"

View file

@ -12,15 +12,17 @@ use Getopt::Long;
$opt_help = 0;
$opt_version = 0;
$opt_verbose = 0;
$opt_target = "mysql-copyright-target-";
$opt_target .= `date +%d%m%y-%H%M%S`;
chop $opt_target;
GetOptions("help","version","target=s") || error();
GetOptions("help","version","target=s", "verbose") || error();
# fix the directory prefix for target dir
$WD= cwd();
my $win_flag = 0;
$opt_target= $WD . '/' . $opt_target;
&main();
@ -50,6 +52,7 @@ sub main
for ($i=0; $ARGV[$i]; $i++)
{
my $distfile= $ARGV[$i];
$win_flag = ($distfile =~ /win-src/) ? 1 : 0;
my $dir;
$dir= "mysql-copyright-";
@ -66,20 +69,19 @@ sub main
}
# if the distfile is mysql-3.22.22-alpha.tar.gz, then
# distname is 'mysql-3.22.22-alpha' and suffix '.tar.gz'
if ($distfile =~ m/^($REG_BASENAME)([\-\_])
($REG_VERSION){1}([\.\-\+])
(.*)?$/xo)
if ($distfile =~
m/^($REG_BASENAME)([\-\_])($REG_VERSION){1}([\.\-\+]\w+\-\w+)?[\.\-\+](.*)?$/xo)
{
$distname= $1.$2.$3;
$suffix= $5.$6;
$suffix= $5;
$fileext = $6;
$newdistname= $1."com".$2.$3;
$newdistname .= $suffix if $win_flag;
}
# find out the extract path (should be same as distname!)
chomp($destdir= `tar ztf ../$distfile | head -1`);
# remove slash from the end
$destdir= substr($destdir, 0, -1);
print "destdir: $destdir\n";
print "distname: $distname\n";
if ("$destdir" ne "$distname")
{
@ -103,26 +105,49 @@ sub main
# remove readline subdir and update configure accordingly
system("rm -rf $destdir/cmd-line-utils/readline");
unlink ("$destdir/configure") or die "Can't delete $destdir/configure: $!\n";
`(cd $destdir ; sed -e 's!\ cmd-line-utils\/readline\/Makefile\ dnl!!g' < configure.in > configure.in.new)`;
rename ("$destdir/configure.in.new","$destdir/configure.in") or die "Can't rename $destdir/configure.in.new: $!\n";;
`(cd $destdir ; autoconf)`;
if ($win_flag) {
chdir("$destdir") or (print "$! Unable to change directory to $desdir!\n" && exit(0));
} else {
chdir("$destdir");
unlink ("configure") or die "Can't delete $destdir/configure: $!\n";
open(CONFIGURE,"<configure.in") or die "$! Unable to open configure.in to read from!\n";
undef $/;
my $configure = <CONFIGURE>;
close(CONFIGURE);
$configure =~ s|cmd\-line\-utils/readline/Makefile dnl\n?||g;
open(CONFIGURE,">configure.in") or die "$! Unable to open configure.in to write to!\n";
print CONFIGURE $configure;
close(CONFIGURE);
`autoconf`;
if (! -f "configure") {
print "\"./configure\" was not produced, exiting!\n";
exit(0);
}
}
# fix file copyrights
&fix_usage_copyright();
&add_copyright();
# rename the directory with new distribution name
chdir("$WD/$dir");
print "renaming $destdir $newdistname\n" if $opt_verbose;
rename($destdir, $newdistname);
# tar the new distribution
`tar cz -f $opt_target/$newdistname.tar.gz *`;
`tar cz -f $WD/$newdistname.tar.gz $newdistname`;
$pec= $? >> 8;
abort($dir, "Making new tar archive failed!\n") if ($pec);
# remove temporary directory
chdir "..";
`rm -rf $dir/`;
chdir($WD) or print "$! Unable to move up one dir\n";
my $cwd = getcwd();
print "current dir is $cwd\n" if $opt_verbose ;
print "deleting temp dir $dir\n" if $opt_verbose;
if (-d $dir) {
system("rm -rf $dir") or print "$! Unable to delete $dir!\n";
}
}
exit(0);
}
@ -138,7 +163,7 @@ sub fix_usage_copyright
foreach my $Cfile (@Cfiles)
{
chop $Cfile;
`replace "This is free software," "This is commercial software," "and you are welcome to modify and redistribute it under the GPL license" "please see the file MySQLEULA.txt for details" -- $Cfile`;
`replace "This is free software," "This is commercial software," "and you are welcome to modify and redistribute it under the GPL license" "please see the file MySQLEULA.txt for details" -- "$Cfile"` if -f $Cfile;
}
}
@ -152,7 +177,9 @@ sub add_copyright
foreach my $file (@files)
{
chop $file;
`$WD/Build-tools/mysql-copyright-2 $file`;
next if ! -f $file;
next if -B $file;
`$WD/Build-tools/mysql-copyright-2 "$file"`;
}
}

View file

@ -1452,6 +1452,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
;;
esac
AM_CONDITIONAL(HAVE_NDBCLUSTER_DB, test "have_ndbcluster" = "yes")
AC_SUBST(ndbcluster_includes)
AC_SUBST(ndbcluster_libs)
AC_SUBST(ndbcluster_system_libs)

View file

@ -318,6 +318,7 @@ TYPELIB command_typelib= {array_elements(command_names),"",
DYNAMIC_STRING ds_res;
static void die(const char *fmt, ...);
static void init_var_hash();
static VAR* var_from_env(const char *, const char *);
static byte* get_var_key(const byte* rec, uint* len,
my_bool __attribute__((unused)) t);
static VAR* var_init(VAR* v, const char *name, int name_len, const char *val,
@ -654,11 +655,10 @@ VAR* var_get(const char* var_name, const char** var_name_end, my_bool raw,
if (!(v = (VAR*) hash_search(&var_hash, save_var_name,
var_name - save_var_name)))
{
if (ignore_not_existing)
DBUG_RETURN(0);
if (end)
*(char*) end = 0;
die("Variable '%s' used uninitialized", save_var_name);
char c=*var_name, *s=(char*)var_name;;
*s=0;
v=var_from_env(save_var_name, "");
*s=c;
}
--var_name; /* Point at last character */
}
@ -2580,7 +2580,7 @@ static void var_free(void *v)
}
static void var_from_env(const char *name, const char *def_val)
static VAR* var_from_env(const char *name, const char *def_val)
{
const char *tmp;
VAR *v;
@ -2589,6 +2589,7 @@ static void var_from_env(const char *name, const char *def_val)
v = var_init(0, name, 0, tmp, 0);
my_hash_insert(&var_hash, (byte*)v);
return v;
}
@ -2599,10 +2600,8 @@ static void init_var_hash(MYSQL *mysql)
if (hash_init(&var_hash, charset_info,
1024, 0, 0, get_var_key, var_free, MYF(0)))
die("Variable hash initialization failed");
var_from_env("MASTER_MYPORT", "9306");
var_from_env("SLAVE_MYPORT", "9307");
var_from_env("MYSQL_TEST_DIR", "/tmp");
var_from_env("BIG_TEST", opt_big_test ? "1" : "0");
if (opt_big_test)
my_hash_insert(&var_hash, (byte*) var_init(0,"BIG_TEST", 0, "1",0));
v= var_init(0,"MAX_TABLES", 0, (sizeof(ulong) == 4) ? "31" : "62",0);
my_hash_insert(&var_hash, (byte*) v);
v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0);

View file

@ -2905,7 +2905,6 @@ then
NDB_DEFS="-DNDEBUG"
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS) \$(NDB_CXXFLAGS_LOC) \$(NDB_CXXFLAGS_RELEASE_LOC)"
fi
fi
AC_SUBST([NDB_DEFS])
@ -2928,13 +2927,7 @@ then
fi
AC_SUBST([ndb_bin_am_ldflags])
AC_SUBST([ndb_opt_test_subdirs])
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
# Output results
AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
ndb/docs/Makefile dnl
ndb/Makefile ndb/include/Makefile dnl
AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl
ndb/src/Makefile ndb/src/common/Makefile dnl
ndb/tools/Makefile dnl
ndb/src/common/debugger/Makefile ndb/src/common/debugger/signaldata/Makefile dnl
@ -2976,7 +2969,14 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
ndb/test/ndbapi/Makefile dnl
ndb/test/ndbapi/bank/Makefile dnl
ndb/test/tools/Makefile dnl
ndb/test/run-test/Makefile dnl
ndb/test/run-test/Makefile mysql-test/ndb/Makefile dnl
)
fi
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
# Output results
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
strings/Makefile regex/Makefile heap/Makefile dnl
bdb/Makefile dnl
myisam/Makefile myisammrg/Makefile dnl
@ -2989,15 +2989,14 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
merge/Makefile dbug/Makefile scripts/Makefile dnl
include/Makefile sql-bench/Makefile tools/Makefile dnl
tests/Makefile Docs/Makefile support-files/Makefile dnl
support-files/MacOSX/Makefile mysql-test/Makefile mysql-test/ndb/Makefile dnl
support-files/MacOSX/Makefile mysql-test/Makefile dnl
netware/Makefile dnl
include/mysql_version.h dnl
cmd-line-utils/Makefile dnl
cmd-line-utils/libedit/Makefile dnl
cmd-line-utils/readline/Makefile dnl
, , [
test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
])
cmd-line-utils/readline/Makefile)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
AC_OUTPUT
rm -f $AVAILABLE_LANGUAGES_ERRORS_RULES
echo

View file

@ -104,7 +104,7 @@ typedef struct my_collation_handler_st
my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
/* Collation routines */
int (*strnncoll)(struct charset_info_st *,
const uchar *, uint, const uchar *, uint);
const uchar *, uint, const uchar *, uint, my_bool);
int (*strnncollsp)(struct charset_info_st *,
const uchar *, uint, const uchar *, uint);
int (*strnxfrm)(struct charset_info_st *,
@ -206,6 +206,7 @@ typedef struct charset_info_st
uchar *to_lower;
uchar *to_upper;
uchar *sort_order;
uint16 *contractions;
uint16 **sort_order_big;
uint16 *tab_to_uni;
MY_UNI_IDX *tab_from_uni;
@ -253,7 +254,7 @@ extern CHARSET_INFO my_charset_cp1250_czech_ci;
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
uint);
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
const uchar *, uint);
const uchar *, uint, my_bool);
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint,
const uchar *, uint);
@ -387,7 +388,7 @@ extern my_bool my_parse_charset_xml(const char *bug, uint len,
#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d)))
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d)))
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))

View file

@ -23,10 +23,10 @@
the second column is the ODBC state (which the 4.1 server sends out by
default) and the last is the state used by the JDBC driver.
If the last column is "" then it means that the JDBC driver is using the
ODBC state
ODBC state.
The errors in this file is sorted in the same order as in mysqld_error.h
to allow on to do binary searches for the sqlstate.
The errors in this file are sorted in the same order as in mysqld_error.h
to allow one to do binary searches for the sqlstate.
*/
ER_DUP_KEY, "23000", "",

View file

@ -511,6 +511,7 @@ int check_embedded_connection(MYSQL *mysql)
thd->host= (char*)my_localhost;
thd->host_or_ip= thd->host;
thd->user= my_strdup(mysql->user, MYF(0));
thd->priv_user= thd->user;
return check_user(thd, COM_CONNECT, NULL, 0, thd->db, true);
}

View file

@ -53,10 +53,10 @@ static double _nwghts[11]=
-3.796875000000000};
static double *nwghts=_nwghts+5; /* nwghts[i] = -0.5*1.5**i */
#define FTB_FLAG_TRUNC 1 /* MUST be 1 */
#define FTB_FLAG_TRUNC 1 /* */
#define FTB_FLAG_YES 2 /* no two from these three */
#define FTB_FLAG_NO 4 /* YES, NO, WONLY */
#define FTB_FLAG_WONLY 8 /* should be ever set both */
#define FTB_FLAG_WONLY 8 /* should be _ever_ set both */
typedef struct st_ftb_expr FTB_EXPR;
struct st_ftb_expr
@ -157,6 +157,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
w.len+extra));
ftbw->len=w.len+1;
ftbw->flags=0;
ftbw->off=0;
if (param.yesno>0) ftbw->flags|=FTB_FLAG_YES;
if (param.yesno<0) ftbw->flags|=FTB_FLAG_NO;
if (param.trunc) ftbw->flags|=FTB_FLAG_TRUNC;
@ -203,23 +204,26 @@ static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)),
static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
{
int r;
uint off;
int subkeys=1;
my_bool can_go_down;
MI_INFO *info=ftb->info;
uint off, extra=HA_FT_WLEN+info->s->base.rec_reflength;
byte *lastkey_buf=ftbw->word+ftbw->off;
if (ftbw->flags & FTB_FLAG_TRUNC)
lastkey_buf+=ftbw->len;
if (init_search)
{
ftbw->key_root=info->s->state.key_root[ftb->keynr];
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
ftbw->off=0;
r=_mi_search(info, ftbw->keyinfo, (uchar*) ftbw->word, ftbw->len,
SEARCH_FIND | SEARCH_BIGGER, ftbw->key_root);
}
else
{
r=_mi_search(info, ftbw->keyinfo, (uchar*) ftbw->word+ftbw->off,
r=_mi_search(info, ftbw->keyinfo, (uchar*) lastkey_buf,
USE_WHOLE_KEY, SEARCH_BIGGER, ftbw->key_root);
}
@ -230,7 +234,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
if (can_go_down)
{
/* going down ? */
off=info->lastkey_length-HA_FT_WLEN-info->s->base.rec_reflength;
off=info->lastkey_length-extra;
subkeys=ft_sintXkorr(info->lastkey+off);
}
if (subkeys<0 || info->lastpos < info->state->data_file_length)
@ -243,11 +247,11 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
if (!r && !ftbw->off)
{
r= mi_compare_text(ftb->charset,
info->lastkey + (ftbw->flags & FTB_FLAG_TRUNC),
ftbw->len - (ftbw->flags & FTB_FLAG_TRUNC),
(uchar*) ftbw->word + (ftbw->flags & FTB_FLAG_TRUNC),
ftbw->len - (ftbw->flags & FTB_FLAG_TRUNC),
0,0);
info->lastkey+1,
info->lastkey_length-extra-1,
(uchar*) ftbw->word+1,
ftbw->len-1,
(my_bool) (ftbw->flags & FTB_FLAG_TRUNC),0);
}
if (r) /* not found */
@ -269,8 +273,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
}
/* going up to the first-level tree to continue search there */
_mi_dpointer(info, (uchar*) (ftbw->word+ftbw->off+HA_FT_WLEN),
ftbw->key_root);
_mi_dpointer(info, (uchar*) (lastkey_buf+HA_FT_WLEN), ftbw->key_root);
ftbw->key_root=info->s->state.key_root[ftb->keynr];
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
ftbw->off=0;
@ -278,7 +281,10 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
}
/* matching key found */
memcpy(ftbw->word+ftbw->off, info->lastkey, info->lastkey_length);
memcpy(lastkey_buf, info->lastkey, info->lastkey_length);
if (lastkey_buf == ftbw->word)
ftbw->len=info->lastkey_length-extra;
/* going down ? */
if (subkeys<0)
{
@ -291,7 +297,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
ftbw->keyinfo=& info->s->ft2_keyinfo;
r=_mi_search_first(info, ftbw->keyinfo, ftbw->key_root);
DBUG_ASSERT(r==0); /* found something */
memcpy(ftbw->word+off, info->lastkey, info->lastkey_length);
memcpy(lastkey_buf+off, info->lastkey, info->lastkey_length);
}
ftbw->docid[0]=info->lastpos;
return 0;
@ -356,7 +362,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
else
reset_tree(& ftb->no_dupes);
}
if (_ft2_search(ftb, ftbw, 1))
return;
}

View file

@ -142,6 +142,8 @@ int chk_del(MI_CHECK *param, register MI_INFO *info, uint test_flag)
empty=0;
for (i= info->state->del ; i > 0L && next_link != HA_OFFSET_ERROR ; i--)
{
if (*killed_ptr(param))
DBUG_RETURN(1);
if (test_flag & T_VERBOSE)
printf(" %9s",llstr(next_link,buff));
if (next_link >= info->state->data_file_length)
@ -233,6 +235,8 @@ static int check_k_link(MI_CHECK *param, register MI_INFO *info, uint nr)
records= (ha_rows) (info->state->key_file_length / block_size);
while (next_link != HA_OFFSET_ERROR && records > 0)
{
if (*killed_ptr(param))
DBUG_RETURN(1);
if (param->testflag & T_VERBOSE)
printf("%16s",llstr(next_link,llbuff));
if (next_link > info->state->key_file_length ||
@ -372,6 +376,8 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ;
rec_per_key_part+=keyinfo->keysegs, key++, keyinfo++)
{
if (*killed_ptr(param))
DBUG_RETURN(-1);
param->key_crc[key]=0;
if (!(((ulonglong) 1 << key) & share->state.key_map))
{
@ -592,6 +598,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
}
for ( ;; )
{
if (*killed_ptr(param))
goto err;
memcpy((char*) info->lastkey,(char*) key,key_length);
info->lastkey_length=key_length;
if (nod_flag)
@ -782,6 +790,8 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
bzero((char*) key_checksum, info->s->base.keys * sizeof(key_checksum[0]));
while (pos < info->state->data_file_length)
{
if (*killed_ptr(param))
goto err2;
switch (info->s->data_file_type) {
case STATIC_RECORD:
if (my_b_read(&param->read_cache,(byte*) record,

View file

@ -69,9 +69,9 @@ my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, byte *record,
ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
{
const byte *pos, *end;
ha_checksum crc=0;
HA_KEYSEG *keyseg;
ulong crc= 0;
ulong seed= 4;
HA_KEYSEG *keyseg;
for (keyseg=def->seg ; keyseg < def->end ; keyseg++)
{
@ -118,7 +118,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
(((uchar) *(uchar*) pos++))) +
(crc >> (8*sizeof(ha_checksum)-8));
}
return crc;
return (ha_checksum)crc;
}
/*

View file

@ -17,7 +17,9 @@
## Process this file with automake to create Makefile.in
if HAVE_NDBCLUSTER_DB
SUBDIRS = ndb
endif
benchdir_root= $(prefix)
testdir = $(benchdir_root)/mysql-test
@ -74,6 +76,7 @@ SUFFIXES = .sh
-e 's!@''libexecdir''@!$(libexecdir)!g' \
-e 's!@''PERL''@!@PERL@!' \
-e 's!@''VERSION''@!@VERSION@!' \
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
-e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
-e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
-e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \

View file

@ -16,6 +16,7 @@ USE_MANAGER=0
MY_TZ=GMT-3
TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work
LOCAL_SOCKET=@MYSQL_UNIX_ADDR@
MYSQL_TCP_PORT=@MYSQL_TCP_PORT@; export MYSQL_TCP_PORT
# For query_cache test
case `uname` in

File diff suppressed because it is too large Load diff

View file

@ -363,3 +363,14 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
t collation(t)
aus Osnabrück latin1_german2_ci
DROP TABLE t1;
CREATE TABLE t1 (s varchar(255), FULLTEXT (s)) DEFAULT CHARSET=utf8;
insert into t1 (s) values ('pära para para'),('para para para');
select * from t1 where match(s) against('para' in boolean mode);
s
pära para para
para para para
select * from t1 where match(s) against('par*' in boolean mode);
s
pära para para
para para para
DROP TABLE t1;

181
mysql-test/t/ctype_uca.test Normal file
View file

@ -0,0 +1,181 @@
-- source include/have_ucs2.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
# Test Unicode collations.
#
set names utf8;
create table t1 (c1 char(10) character set utf8 collate utf8_bin);
#
# Basic Latin
#
insert into t1 values ('A'),('a');
insert into t1 values ('B'),('b');
insert into t1 values ('C'),('c');
insert into t1 values ('D'),('d');
insert into t1 values ('E'),('e');
insert into t1 values ('F'),('f');
insert into t1 values ('G'),('g');
insert into t1 values ('H'),('h');
insert into t1 values ('I'),('i');
insert into t1 values ('J'),('j');
insert into t1 values ('K'),('k');
insert into t1 values ('L'),('l');
insert into t1 values ('M'),('m');
insert into t1 values ('N'),('n');
insert into t1 values ('O'),('o');
insert into t1 values ('P'),('p');
insert into t1 values ('Q'),('q');
insert into t1 values ('R'),('r');
insert into t1 values ('S'),('s');
insert into t1 values ('T'),('t');
insert into t1 values ('U'),('u');
insert into t1 values ('V'),('v');
insert into t1 values ('W'),('w');
insert into t1 values ('X'),('x');
insert into t1 values ('Y'),('y');
insert into t1 values ('Z'),('z');
#
# Latin1 suppliment
#
insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0);
insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1);
insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2);
insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3);
insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4);
insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5);
insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6);
insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7);
insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8);
insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9);
insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca);
insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb);
insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc);
insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd);
insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce);
insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf);
insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0);
insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1);
insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2);
insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3);
insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4);
insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5);
insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6);
insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7);
insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8);
insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9);
insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da);
insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db);
insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc);
insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd);
insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de);
insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df);
#
# Latin extended-A, 0100-017F
#
insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103);
insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107);
insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b);
insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f);
insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113);
insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117);
insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b);
insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f);
insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123);
insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127);
insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b);
insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f);
insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133);
insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137);
insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b);
insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f);
insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143);
insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147);
insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b);
insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f);
insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153);
insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157);
insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b);
insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f);
insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163);
insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167);
insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b);
insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f);
insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173);
insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177);
insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b);
insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f);
#
# Latin extended-B, 0180-024F
#
insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183);
insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187);
insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b);
insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f);
insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193);
insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197);
insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b);
insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f);
insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3);
insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7);
insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab);
insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af);
insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3);
insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7);
insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb);
insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf);
insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3);
insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7);
insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb);
insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf);
insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3);
insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7);
insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db);
insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df);
insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3);
insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7);
insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb);
insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef);
insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3);
insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7);
insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb);
insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff);
insert into t1 values ('AA'),('Aa'),('aa'),('aA');
insert into t1 values ('CH'),('Ch'),('ch'),('cH');
insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
insert into t1 values ('LL'),('Ll'),('ll'),('lL');
insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
insert into t1 values ('OE'),('Oe'),('oe'),('oE');
insert into t1 values ('SS'),('Ss'),('ss'),('sS');
insert into t1 values ('RR'),('Rr'),('rr'),('rR');
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci;
--select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;

View file

@ -279,3 +279,12 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
DROP TABLE t1;
#
# bug#3964
#
CREATE TABLE t1 (s varchar(255), FULLTEXT (s)) DEFAULT CHARSET=utf8;
insert into t1 (s) values ('pära para para'),('para para para');
select * from t1 where match(s) against('para' in boolean mode);
select * from t1 where match(s) against('par*' in boolean mode);
DROP TABLE t1;

View file

@ -12,7 +12,7 @@ show slave status;
change master to master_host='127.0.0.1';
# The following needs to be cleaned up when change master is fixed
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT $MYSQL_TCP_PORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
--replace_result $MASTER_MYPORT MASTER_PORT

View file

@ -33,6 +33,29 @@ extern CHARSET_INFO my_charset_ucs2_estonian_uca_ci;
extern CHARSET_INFO my_charset_ucs2_spanish_uca_ci;
extern CHARSET_INFO my_charset_ucs2_swedish_uca_ci;
extern CHARSET_INFO my_charset_ucs2_turkish_uca_ci;
extern CHARSET_INFO my_charset_ucs2_czech_uca_ci;
extern CHARSET_INFO my_charset_ucs2_danish_uca_ci;
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;
#endif
#ifdef HAVE_CHARSET_utf8
extern CHARSET_INFO my_charset_utf8_general_uca_ci;
extern CHARSET_INFO my_charset_utf8_icelandic_uca_ci;
extern CHARSET_INFO my_charset_utf8_latvian_uca_ci;
extern CHARSET_INFO my_charset_utf8_romanian_uca_ci;
extern CHARSET_INFO my_charset_utf8_slovenian_uca_ci;
extern CHARSET_INFO my_charset_utf8_polish_uca_ci;
extern CHARSET_INFO my_charset_utf8_estonian_uca_ci;
extern CHARSET_INFO my_charset_utf8_spanish_uca_ci;
extern CHARSET_INFO my_charset_utf8_swedish_uca_ci;
extern CHARSET_INFO my_charset_utf8_turkish_uca_ci;
extern CHARSET_INFO my_charset_utf8_czech_uca_ci;
extern CHARSET_INFO my_charset_utf8_danish_uca_ci;
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;
#endif
my_bool init_compiled_charsets(myf flags __attribute__((unused)))
@ -87,7 +110,6 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_ucs2_general_ci);
add_compiled_collation(&my_charset_ucs2_bin);
add_compiled_collation(&my_charset_ucs2_general_uca);
add_compiled_collation(&my_charset_ucs2_general_uca);
add_compiled_collation(&my_charset_ucs2_icelandic_uca_ci);
add_compiled_collation(&my_charset_ucs2_latvian_uca_ci);
add_compiled_collation(&my_charset_ucs2_romanian_uca_ci);
@ -97,6 +119,11 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_ucs2_spanish_uca_ci);
add_compiled_collation(&my_charset_ucs2_swedish_uca_ci);
add_compiled_collation(&my_charset_ucs2_turkish_uca_ci);
add_compiled_collation(&my_charset_ucs2_czech_uca_ci);
add_compiled_collation(&my_charset_ucs2_danish_uca_ci);
add_compiled_collation(&my_charset_ucs2_lithuanian_uca_ci);
add_compiled_collation(&my_charset_ucs2_slovak_uca_ci);
add_compiled_collation(&my_charset_ucs2_spanish2_uca_ci);
#endif
#ifdef HAVE_CHARSET_ujis
@ -107,6 +134,21 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
#ifdef HAVE_CHARSET_utf8
add_compiled_collation(&my_charset_utf8_general_ci);
add_compiled_collation(&my_charset_utf8_bin);
add_compiled_collation(&my_charset_utf8_general_uca_ci);
add_compiled_collation(&my_charset_utf8_icelandic_uca_ci);
add_compiled_collation(&my_charset_utf8_latvian_uca_ci);
add_compiled_collation(&my_charset_utf8_romanian_uca_ci);
add_compiled_collation(&my_charset_utf8_slovenian_uca_ci);
add_compiled_collation(&my_charset_utf8_polish_uca_ci);
add_compiled_collation(&my_charset_utf8_estonian_uca_ci);
add_compiled_collation(&my_charset_utf8_spanish_uca_ci);
add_compiled_collation(&my_charset_utf8_swedish_uca_ci);
add_compiled_collation(&my_charset_utf8_turkish_uca_ci);
add_compiled_collation(&my_charset_utf8_czech_uca_ci);
add_compiled_collation(&my_charset_utf8_danish_uca_ci);
add_compiled_collation(&my_charset_utf8_lithuanian_uca_ci);
add_compiled_collation(&my_charset_utf8_slovak_uca_ci);
add_compiled_collation(&my_charset_utf8_spanish2_uca_ci);
#endif
/* Copy compiled charsets */

View file

@ -21,13 +21,11 @@ int mi_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length,
uchar *b, uint b_length, my_bool part_key,
my_bool skip_end_space)
{
if (part_key && b_length < a_length)
a_length=b_length;
if (skip_end_space)
return charset_info->coll->strnncollsp(charset_info, a, a_length,
b, b_length);
return charset_info->coll->strnncoll(charset_info, a, a_length,
b, b_length);
b, b_length, part_key);
}

View file

@ -4242,9 +4242,8 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr)
(const uchar*) b_ptr,
field_length);
}
return field_charset->coll->strnncoll(field_charset,
(const uchar*) a_ptr, field_length,
(const uchar*) b_ptr, field_length);
return my_strnncoll(field_charset,(const uchar*) a_ptr, field_length,
(const uchar*) b_ptr, field_length);
}
void Field_string::sort_string(char *to,uint length)

View file

@ -35,8 +35,10 @@ protected:
enum enum_field_types *field_types;
#endif
uint field_count;
#ifndef EMBEDDED_LIBRARY
bool net_store_data(const char *from, uint length);
#ifdef EMBEDDED_LIBRARY
#else
virtual bool net_store_data(const char *from, uint length);
char **next_field;
MYSQL_FIELD *next_mysql_field;
MEM_ROOT *alloc;

View file

@ -1191,7 +1191,7 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
}
net_flush(&thd->net);
if ((error= table->file->dump(thd,fd)))
my_error(ER_GET_ERRNO, MYF(0));
my_error(ER_GET_ERRNO, MYF(0), error);
err:
close_thread_tables(thd);

View file

@ -251,11 +251,12 @@ static int my_strnncoll_big5_internal(const uchar **a_res,
static int my_strnncoll_big5(CHARSET_INFO *cs __attribute__((unused)),
const uchar *a, uint a_length,
const uchar *b, uint b_length)
const uchar *b, uint b_length,
my_bool b_is_prefix)
{
uint length= min(a_length, b_length);
int res= my_strnncoll_big5_internal(&a, &b, length);
return res ? res : (int) (a_length - b_length);
return res ? res : (int)((b_is_prefix ? length : a_length) - b_length);
}
@ -6299,7 +6300,6 @@ static MY_CHARSET_HANDLER my_charset_big5_handler=
my_long10_to_str_8bit,
my_longlong10_to_str_8bit,
my_fill_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -6320,6 +6320,7 @@ CHARSET_INFO my_charset_big5_chinese_ci=
to_lower_big5,
to_upper_big5,
sort_order_big5,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
@ -6347,6 +6348,7 @@ CHARSET_INFO my_charset_big5_bin=
to_lower_big5,
to_upper_big5,
sort_order_big5,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */

View file

@ -91,10 +91,20 @@ static uchar bin_char_array[] =
static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)),
const uchar *s, uint slen,
const uchar *t, uint tlen)
const uchar *t, uint tlen,
my_bool t_is_prefix)
{
int cmp= memcmp(s,t,min(slen,tlen));
return cmp ? cmp : (int) (slen - tlen);
uint len=min(slen,tlen);
int cmp= memcmp(s,t,len);
return cmp ? cmp : (int)((t_is_prefix ? len : slen) - tlen);
}
static int my_strnncollsp_binary(CHARSET_INFO * cs __attribute__((unused)),
const uchar *s, uint slen,
const uchar *t, uint tlen)
{
return my_strnncoll_binary(cs,s,slen,t,tlen,0);
}
@ -335,7 +345,7 @@ MY_COLLATION_HANDLER my_collation_8bit_bin_handler =
{
NULL, /* init */
my_strnncoll_binary,
my_strnncoll_binary,
my_strnncollsp_binary,
my_strnxfrm_bin,
my_like_range_simple,
my_wildcmp_bin,
@ -385,9 +395,10 @@ CHARSET_INFO my_charset_bin =
bin_char_array, /* to_lower */
bin_char_array, /* to_upper */
bin_char_array, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */

View file

@ -242,12 +242,16 @@ while (1) \
static int my_strnncoll_czech(CHARSET_INFO *cs __attribute__((unused)),
const uchar * s1, uint len1,
const uchar * s2, uint len2)
const uchar * s2, uint len2,
my_bool s2_is_prefix)
{
int v1, v2;
const uchar * p1, * p2, * store1, * store2;
int pass1 = 0, pass2 = 0;
if (s2_is_prefix && len1 > len2)
len1=len2;
p1 = s1; p2 = s2;
store1 = s1; store2 = s2;
@ -276,7 +280,7 @@ int my_strnncollsp_czech(CHARSET_INFO * cs,
{
for ( ; slen && s[slen-1] == ' ' ; slen--);
for ( ; tlen && t[tlen-1] == ' ' ; tlen--);
return my_strnncoll_czech(cs,s,slen,t,tlen);
return my_strnncoll_czech(cs,s,slen,t,tlen,0);
}
@ -595,6 +599,7 @@ CHARSET_INFO my_charset_latin2_czech_ci =
to_lower_czech,
to_upper_czech,
sort_order_czech,
NULL, /* contractions */
NULL, /* sort_order_big*/
tab_8859_2_uni, /* tab_to_uni */
idx_uni_8859_2, /* tab_from_uni */

View file

@ -8688,6 +8688,7 @@ CHARSET_INFO my_charset_euckr_korean_ci=
to_lower_euc_kr,
to_upper_euc_kr,
sort_order_euc_kr,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
@ -8715,6 +8716,7 @@ CHARSET_INFO my_charset_euckr_bin=
to_lower_euc_kr,
to_upper_euc_kr,
sort_order_euc_kr,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */

View file

@ -29,6 +29,7 @@ CHARSET_INFO compiled_charsets[] = {
NULL, /* to_lower */
NULL, /* to_upper */
NULL, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */

View file

@ -5739,9 +5739,10 @@ CHARSET_INFO my_charset_gb2312_chinese_ci=
to_lower_gb2312,
to_upper_gb2312,
sort_order_gb2312,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@ -5765,9 +5766,10 @@ CHARSET_INFO my_charset_gb2312_bin=
to_lower_gb2312,
to_upper_gb2312,
sort_order_gb2312,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */

View file

@ -2614,11 +2614,12 @@ int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res,
int my_strnncoll_gbk(CHARSET_INFO *cs __attribute__((unused)),
const uchar *a, uint a_length,
const uchar *b, uint b_length)
const uchar *b, uint b_length,
my_bool b_is_prefix)
{
uint length= min(a_length, b_length);
int res= my_strnncoll_gbk_internal(&a, &b, length);
return res ? res : (int) (a_length - b_length);
return res ? res : (int) ((b_is_prefix ? length : a_length) - b_length);
}
@ -9969,9 +9970,10 @@ CHARSET_INFO my_charset_gbk_chinese_ci=
to_lower_gbk,
to_upper_gbk,
sort_order_gbk,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@ -9995,9 +9997,10 @@ CHARSET_INFO my_charset_gbk_bin=
to_lower_gbk,
to_upper_gbk,
sort_order_gbk,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */

View file

@ -418,6 +418,7 @@ CHARSET_INFO my_charset_latin1=
to_lower_latin1,
to_upper_latin1,
sort_order_latin1,
NULL, /* contractions */
NULL, /* sort_order_big*/
cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
@ -528,7 +529,8 @@ uchar combo2map[]={
static int my_strnncoll_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
const uchar *a, uint a_length,
const uchar *b, uint b_length)
const uchar *b, uint b_length,
my_bool b_is_prefix)
{
const uchar *a_end= a + a_length;
const uchar *b_end= b + b_length;
@ -561,7 +563,7 @@ static int my_strnncoll_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
A simple test of string lengths won't work -- we test to see
which string ran out first
*/
return ((a < a_end || a_extend) ? 1 :
return ((a < a_end || a_extend) ? (b_is_prefix ? 0 : 1) :
(b < b_end || b_extend) ? -1 : 0);
}
@ -699,6 +701,7 @@ CHARSET_INFO my_charset_latin1_german2_ci=
to_lower_latin1,
to_upper_latin1,
sort_order_latin1_de,
NULL, /* contractions */
NULL, /* sort_order_big*/
cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
@ -726,6 +729,7 @@ CHARSET_INFO my_charset_latin1_bin=
to_lower_latin1,
to_upper_latin1,
sort_order_latin1_de,
NULL, /* contractions */
NULL, /* sort_order_big*/
cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */

View file

@ -322,7 +322,7 @@ uint my_instr_mb(CHARSET_INFO *cs,
int mblen;
if (!cs->coll->strnncoll(cs, (unsigned char*) b, s_length,
(unsigned char*) s, s_length))
(unsigned char*) s, s_length, 0))
{
if (nmatch)
{
@ -352,10 +352,19 @@ uint my_instr_mb(CHARSET_INFO *cs,
static int my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
const uchar *s, uint slen,
const uchar *t, uint tlen)
const uchar *t, uint tlen,
my_bool t_is_prefix)
{
int cmp= memcmp(s,t,min(slen,tlen));
return cmp ? cmp : (int) (slen - tlen);
uint len=min(slen,tlen);
int cmp= memcmp(s,t,len);
return cmp ? cmp : (int) ((t_is_prefix ? len : slen) - tlen);
}
static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
const uchar *s, uint slen,
const uchar *t, uint tlen)
{
return my_strnncoll_mb_bin(cs,s,slen,t,tlen,0);
}
@ -514,7 +523,7 @@ MY_COLLATION_HANDLER my_collation_mb_bin_handler =
{
NULL, /* init */
my_strnncoll_mb_bin,
my_strnncoll_mb_bin,
my_strnncollsp_mb_bin,
my_strnxfrm_mb_bin,
my_like_range_simple,
my_wildcmp_mb_bin,

View file

@ -46,16 +46,19 @@ int my_strnxfrm_simple(CHARSET_INFO * cs,
}
int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, uint slen,
const uchar *t, uint tlen)
const uchar *t, uint tlen,
my_bool t_is_prefix)
{
int len = ( slen > tlen ) ? tlen : slen;
uchar *map= cs->sort_order;
if (t_is_prefix && slen > tlen)
slen=tlen;
while (len--)
{
if (map[*s++] != map[*t++])
return ((int) map[s[-1]] - (int) map[t[-1]]);
}
return (int) (slen-tlen);
return (int) (slen - tlen);
}

View file

@ -232,9 +232,12 @@ static int my_strnncoll_sjis_internal(CHARSET_INFO *cs,
static int my_strnncoll_sjis(CHARSET_INFO *cs __attribute__((unused)),
const uchar *a, uint a_length,
const uchar *b, uint b_length)
const uchar *b, uint b_length,
my_bool b_is_prefix)
{
int res= my_strnncoll_sjis_internal(cs, &a, a_length, &b, b_length);
if (b_is_prefix && a_length > b_length)
a_length= b_length;
return res ? res : (int) (a_length - b_length);
}
@ -4586,9 +4589,10 @@ CHARSET_INFO my_charset_sjis_japanese_ci=
to_lower_sjis,
to_upper_sjis,
sort_order_sjis,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@ -4612,9 +4616,10 @@ CHARSET_INFO my_charset_sjis_bin=
to_lower_sjis,
to_upper_sjis,
sort_order_sjis,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */

View file

@ -529,12 +529,16 @@ static uint thai2sortable(uchar *tstr, uint len)
static
int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)),
const uchar * s1, uint len1,
const uchar * s2, uint len2)
const uchar * s2, uint len2,
my_bool s2_is_prefix)
{
uchar buf[80] ;
uchar *tc1, *tc2;
int i;
if (s2_is_prefix && len1 > len2)
len1= len2;
tc1= buf;
if ((len1 + len2 +2) > (int) sizeof(buf))
tc1= (uchar*) malloc(len1+len2);
@ -958,9 +962,10 @@ CHARSET_INFO my_charset_tis620_thai_ci=
to_lower_tis620,
to_upper_tis620,
sort_order_tis620,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
@ -984,9 +989,10 @@ CHARSET_INFO my_charset_tis620_bin=
to_lower_tis620,
to_upper_tis620,
sort_order_tis620,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */

File diff suppressed because it is too large Load diff

View file

@ -182,7 +182,8 @@ static void my_casedn_str_ucs2(CHARSET_INFO *cs __attribute__((unused)),
static int my_strnncoll_ucs2(CHARSET_INFO *cs,
const uchar *s, uint slen,
const uchar *t, uint tlen)
const uchar *t, uint tlen,
my_bool t_is_prefix)
{
int s_res,t_res;
my_wc_t s_wc,t_wc;
@ -213,7 +214,14 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs,
s+=s_res;
t+=t_res;
}
return ( (se-s) - (te-t) );
return t_is_prefix ? t-te : ((se-s) - (te-t));
}
static int my_strnncollsp_ucs2(CHARSET_INFO *cs,
const uchar *s, uint slen,
const uchar *t, uint tlen)
{
return my_strnncoll_ucs2(cs,s,slen,t,tlen,0);
}
@ -1223,8 +1231,9 @@ int my_wildcmp_ucs2_bin(CHARSET_INFO *cs,
static
int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
const uchar *s, uint slen,
const uchar *t, uint tlen)
const uchar *s, uint slen,
const uchar *t, uint tlen,
my_bool t_is_prefix)
{
int s_res,t_res;
my_wc_t s_wc,t_wc;
@ -1249,7 +1258,14 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
s+=s_res;
t+=t_res;
}
return ( (se-s) - (te-t) );
return t_is_prefix ? t-te : ((se-s) - (te-t));
}
static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs,
const uchar *s, uint slen,
const uchar *t, uint tlen)
{
return my_strnncoll_ucs2_bin(cs,s,slen,t,tlen,0);
}
@ -1374,7 +1390,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler =
{
NULL, /* init */
my_strnncoll_ucs2,
my_strnncoll_ucs2,
my_strnncollsp_ucs2,
my_strnxfrm_ucs2,
my_like_range_ucs2,
my_wildcmp_ucs2_ci,
@ -1388,7 +1404,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler =
{
NULL, /* init */
my_strnncoll_ucs2_bin,
my_strnncoll_ucs2_bin,
my_strnncollsp_ucs2_bin,
my_strnxfrm_ucs2_bin,
my_like_range_simple,
my_wildcmp_ucs2_bin,
@ -1438,9 +1454,10 @@ CHARSET_INFO my_charset_ucs2_general_ci=
to_lower_ucs2, /* to_lower */
to_upper_ucs2, /* to_upper */
to_upper_ucs2, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@ -1464,6 +1481,7 @@ CHARSET_INFO my_charset_ucs2_bin=
to_lower_ucs2, /* to_lower */
to_upper_ucs2, /* to_upper */
to_upper_ucs2, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */

View file

@ -8475,9 +8475,10 @@ CHARSET_INFO my_charset_ujis_japanese_ci=
to_lower_ujis,
to_upper_ujis,
sort_order_ujis,
NULL, /* sort_order_big*/
NULL, /* contractions */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@ -8502,9 +8503,10 @@ CHARSET_INFO my_charset_ujis_bin=
to_lower_ujis,
to_upper_ujis,
sort_order_ujis,
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */

View file

@ -1808,7 +1808,8 @@ static void my_casedn_str_utf8(CHARSET_INFO *cs, char * s)
static int my_strnncoll_utf8(CHARSET_INFO *cs,
const uchar *s, uint slen,
const uchar *t, uint tlen)
const uchar *t, uint tlen,
my_bool t_is_prefix)
{
int s_res,t_res;
my_wc_t s_wc,t_wc;
@ -1839,7 +1840,7 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs,
s+=s_res;
t+=t_res;
}
return ( (se-s) - (te-t) );
return t_is_prefix ? t-te : ((se-s) - (te-t));
}
@ -2056,7 +2057,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler =
my_hash_sort_utf8
};
static MY_CHARSET_HANDLER my_charset_handler=
MY_CHARSET_HANDLER my_charset_utf8_handler=
{
NULL, /* init */
my_ismbchar_utf8,
@ -2097,9 +2098,10 @@ CHARSET_INFO my_charset_utf8_general_ci=
to_lower_utf8, /* to_lower */
to_upper_utf8, /* to_upper */
to_upper_utf8, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@ -2107,7 +2109,7 @@ CHARSET_INFO my_charset_utf8_general_ci=
3, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
&my_charset_handler,
&my_charset_utf8_handler,
&my_collation_ci_handler
};
@ -2124,9 +2126,10 @@ CHARSET_INFO my_charset_utf8_bin=
to_lower_utf8, /* to_lower */
to_upper_utf8, /* to_upper */
to_upper_utf8, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@ -2134,13 +2137,12 @@ CHARSET_INFO my_charset_utf8_bin=
3, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
&my_charset_handler,
&my_charset_utf8_handler,
&my_collation_mb_bin_handler
};
#ifdef MY_TEST_UTF8
#include <stdio.h>
static void test_mb(CHARSET_INFO *cs, uchar *s)
@ -2172,7 +2174,7 @@ int main()
test_mb(cs,(uchar*)str);
pr1;2cintf("orig :'%s'\n",str);
printf("orig :'%s'\n",str);
my_caseup_utf8(cs,str,15);
printf("caseup :'%s'\n",str);

View file

@ -448,20 +448,25 @@ static struct wordvalue doubles[] = {
static int my_strnncoll_win1250ch(CHARSET_INFO *cs __attribute__((unused)),
const uchar * s1, uint len1,
const uchar * s2, uint len2)
const uchar * s2, uint len2,
my_bool s2_is_prefix)
{
int v1, v2;
const uchar * p1, * p2;
int pass1 = 0, pass2 = 0;
int diff;
if (s2_is_prefix && len1 > len2)
len1=len2;
p1 = s1; p2 = s2;
do {
do
{
NEXT_CMP_VALUE(s1, p1, pass1, v1, (int)len1);
NEXT_CMP_VALUE(s2, p2, pass2, v2, (int)len2);
diff = v1 - v2;
if (diff != 0) return diff;
if ((diff = v1 - v2))
return diff;
} while (v1);
return 0;
}
@ -478,7 +483,7 @@ int my_strnncollsp_win1250ch(CHARSET_INFO * cs,
{
for ( ; slen && s[slen-1] == ' ' ; slen--);
for ( ; tlen && t[tlen-1] == ' ' ; tlen--);
return my_strnncoll_win1250ch(cs,s,slen,t,tlen);
return my_strnncoll_win1250ch(cs,s,slen,t,tlen,0);
}
@ -629,6 +634,7 @@ CHARSET_INFO my_charset_cp1250_czech_ci =
to_lower_win1250ch,
to_upper_win1250ch,
sort_order_win1250ch,
NULL, /* contractions */
NULL, /* sort_order_big*/
tab_cp1250_uni, /* tab_to_uni */
idx_uni_cp1250, /* tab_from_uni */