mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge work.mysql.com:/home/bk/mysql-4.1
into myvenu.com:/home/venu/work/sql/dev-4.1
This commit is contained in:
@@ -211,7 +211,8 @@ extern const char *get_charset_name(uint cs_number);
|
||||
extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
|
||||
extern my_bool set_default_charset(uint cs, myf flags);
|
||||
extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
|
||||
extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, myf flags);
|
||||
extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
|
||||
uint cs_flags, myf my_flags);
|
||||
extern my_bool set_default_charset_by_name(const char *cs_name, myf flags);
|
||||
extern void free_charsets(void);
|
||||
extern char *list_charsets(myf want_flags); /* my_free() this string... */
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#undef HAVE_OPENSSL
|
||||
#undef HAVE_VIO
|
||||
#undef HAVE_ISAM
|
||||
#undef HAVE_SMEM /* No shared memory */
|
||||
|
||||
#define DONT_USE_RAID
|
||||
|
||||
|
@@ -268,4 +268,6 @@
|
||||
#define ER_NOT_SUPPORTED_AUTH_MODE 1249
|
||||
#define ER_SPATIAL_CANT_HAVE_NULL 1250
|
||||
#define ER_COLLATION_CHARSET_MISMATCH 1251
|
||||
#define ER_ERROR_MESSAGES 252
|
||||
#define ER_SLAVE_WAS_RUNNING 1252
|
||||
#define ER_SLAVE_WAS_NOT_RUNNING 1253
|
||||
#define ER_ERROR_MESSAGES 254
|
||||
|
@@ -200,12 +200,6 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
|
||||
if (!opt_mysql_tmpdir || !opt_mysql_tmpdir[0])
|
||||
opt_mysql_tmpdir=(char*) P_tmpdir; /* purecov: inspected */
|
||||
|
||||
if (init_thread_environment())
|
||||
{
|
||||
mysql_server_end();
|
||||
return 1;
|
||||
}
|
||||
|
||||
umask(((~my_umask) & 0666));
|
||||
if (init_server_components())
|
||||
{
|
||||
|
@@ -31,6 +31,7 @@ dist-hook:
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) \
|
||||
@@ -47,6 +48,7 @@ install-data-local:
|
||||
$(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data
|
||||
|
||||
SUFFIXES = .sh
|
||||
|
||||
|
@@ -3,8 +3,11 @@ connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
connection slave;
|
||||
--error 0,1199
|
||||
!stop slave;
|
||||
#we expect STOP SLAVE to produce a warning as the slave is stopped
|
||||
#(the server was started with skip-slave-start)
|
||||
--disable_warnings
|
||||
stop slave;
|
||||
--enable_warnings
|
||||
@r/slave-stopped.result show status like 'Slave_running';
|
||||
connection master;
|
||||
--disable_warnings
|
||||
|
@@ -483,4 +483,31 @@ Z
|
||||
z
|
||||
SELECT DISTINCT latin1_f COLLATE koi8r FROM t1;
|
||||
COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1'
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`latin1_f` char(32) NOT NULL default ''
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
SHOW FIELDS FROM t1;
|
||||
Field Type Collation Null Key Default Extra
|
||||
latin1_f char(32) latin1
|
||||
ALTER TABLE t1 CHANGE latin1_f
|
||||
latin1_f CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`latin1_f` char(32) character set latin1 collate latin1_bin default NULL
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
SHOW FIELDS FROM t1;
|
||||
Field Type Collation Null Key Default Extra
|
||||
latin1_f char(32) character set latin1 latin1_bin YES NULL
|
||||
ALTER TABLE t1 CHARACTER SET latin1 COLLATE latin1_bin;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`latin1_f` char(32) collate latin1_bin default NULL
|
||||
) TYPE=MyISAM CHARSET=latin1 COLLATE=latin1_bin
|
||||
SHOW FIELDS FROM t1;
|
||||
Field Type Collation Null Key Default Extra
|
||||
latin1_f char(32) latin1_bin YES NULL
|
||||
DROP TABLE t1;
|
||||
|
@@ -233,7 +233,7 @@ auto bigint(17) unsigned binary PRI 0 select,insert,update,references
|
||||
t1 bigint(1) binary 0 select,insert,update,references
|
||||
t2 char(1) latin1 select,insert,update,references
|
||||
t3 mediumtext latin1 select,insert,update,references
|
||||
t4 mediumblob binary select,insert,update,references
|
||||
t4 mediumtext character set latin1 latin1_bin select,insert,update,references
|
||||
select * from t2;
|
||||
auto t1 t2 t3 t4
|
||||
11 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||||
|
@@ -112,4 +112,19 @@ SELECT DISTINCT latin1_f COLLATE koi8r FROM t1;
|
||||
--FROM t1
|
||||
--HAVING (_latin1'Mu"ller' COLLATE latin1_de) = k
|
||||
|
||||
|
||||
#
|
||||
# Check that SHOW displays COLLATE clause
|
||||
#
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
SHOW FIELDS FROM t1;
|
||||
ALTER TABLE t1 CHANGE latin1_f
|
||||
latin1_f CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin;
|
||||
SHOW CREATE TABLE t1;
|
||||
SHOW FIELDS FROM t1;
|
||||
ALTER TABLE t1 CHARACTER SET latin1 COLLATE latin1_bin;
|
||||
SHOW CREATE TABLE t1;
|
||||
SHOW FIELDS FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
@@ -57,22 +57,40 @@ static void set_max_sort_char(CHARSET_INFO *cs)
|
||||
static void simple_cs_init_functions(CHARSET_INFO *cs)
|
||||
{
|
||||
|
||||
cs->strnxfrm = my_strnxfrm_simple;
|
||||
cs->strnncoll = my_strnncoll_simple;
|
||||
cs->strnncollsp = my_strnncollsp_simple;
|
||||
cs->like_range = my_like_range_simple;
|
||||
cs->wildcmp = my_wildcmp_8bit;
|
||||
cs->mb_wc = my_mb_wc_8bit;
|
||||
cs->wc_mb = my_wc_mb_8bit;
|
||||
if (cs->state & MY_CS_BINSORT)
|
||||
{
|
||||
CHARSET_INFO *b= &my_charset_bin;
|
||||
cs->strnxfrm = b->strnxfrm;
|
||||
cs->like_range = b->like_range;
|
||||
cs->wildcmp = b->wildcmp;
|
||||
cs->strnncoll = b->strnncoll;
|
||||
cs->strnncollsp = b->strnncollsp;
|
||||
cs->tosort = b->tosort;
|
||||
cs->strcasecmp = b->strcasecmp;
|
||||
cs->strncasecmp = b->strncasecmp;
|
||||
cs->hash_caseup = b->hash_caseup;
|
||||
cs->hash_sort = b->hash_sort;
|
||||
}
|
||||
else
|
||||
{
|
||||
cs->strnxfrm = my_strnxfrm_simple;
|
||||
cs->like_range = my_like_range_simple;
|
||||
cs->wildcmp = my_wildcmp_8bit;
|
||||
cs->strnncoll = my_strnncoll_simple;
|
||||
cs->strnncollsp = my_strnncollsp_simple;
|
||||
cs->tosort = my_tosort_8bit;
|
||||
cs->strcasecmp = my_strcasecmp_8bit;
|
||||
cs->strncasecmp = my_strncasecmp_8bit;
|
||||
cs->hash_caseup = my_hash_caseup_simple;
|
||||
cs->hash_sort = my_hash_sort_simple;
|
||||
}
|
||||
|
||||
cs->caseup_str = my_caseup_str_8bit;
|
||||
cs->casedn_str = my_casedn_str_8bit;
|
||||
cs->caseup = my_caseup_8bit;
|
||||
cs->casedn = my_casedn_8bit;
|
||||
cs->tosort = my_tosort_8bit;
|
||||
cs->strcasecmp = my_strcasecmp_8bit;
|
||||
cs->strncasecmp = my_strncasecmp_8bit;
|
||||
cs->hash_caseup = my_hash_caseup_simple;
|
||||
cs->hash_sort = my_hash_sort_simple;
|
||||
cs->mb_wc = my_mb_wc_8bit;
|
||||
cs->wc_mb = my_wc_mb_8bit;
|
||||
cs->snprintf = my_snprintf_8bit;
|
||||
cs->long10_to_str= my_long10_to_str_8bit;
|
||||
cs->longlong10_to_str= my_longlong10_to_str_8bit;
|
||||
@@ -223,7 +241,8 @@ static my_bool simple_cs_is_full(CHARSET_INFO *cs)
|
||||
{
|
||||
return ((cs->csname && cs->tab_to_uni && cs->ctype && cs->to_upper &&
|
||||
cs->to_lower) &&
|
||||
(cs->number && cs->name && cs->sort_order));
|
||||
(cs->number && cs->name &&
|
||||
(cs->sort_order || (cs->state & MY_CS_BINSORT) )));
|
||||
}
|
||||
|
||||
|
||||
@@ -553,7 +572,9 @@ CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags)
|
||||
}
|
||||
|
||||
|
||||
CHARSET_INFO *get_charset_by_csname(const char *cs_name, myf flags)
|
||||
CHARSET_INFO *get_charset_by_csname(const char *cs_name,
|
||||
uint cs_flags,
|
||||
myf flags)
|
||||
{
|
||||
CHARSET_INFO *cs=NULL;
|
||||
CHARSET_INFO **css;
|
||||
@@ -561,7 +582,7 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name, myf flags)
|
||||
|
||||
for (css= all_charsets; css < all_charsets+255; ++css)
|
||||
{
|
||||
if ( css[0] && (css[0]->state & MY_CS_PRIMARY) &&
|
||||
if ( css[0] && (css[0]->state & cs_flags) &&
|
||||
css[0]->csname && !strcmp(css[0]->csname, cs_name))
|
||||
{
|
||||
cs= css[0]->number ? get_internal_charset(css[0]->number,flags) : NULL;
|
||||
|
16
netware/BUILD/compile-AUTOTOOLS
Executable file
16
netware/BUILD/compile-AUTOTOOLS
Executable file
@@ -0,0 +1,16 @@
|
||||
#! /bin/sh
|
||||
|
||||
for package in . ./innobase
|
||||
do
|
||||
(cd $package
|
||||
rm -rf config.cache autom4te.cache
|
||||
aclocal
|
||||
autoheader
|
||||
libtoolize --force
|
||||
aclocal
|
||||
automake --add-missing --force-missing
|
||||
autoconf)
|
||||
done
|
||||
|
||||
#rm -rf ./bdb/build_unix/config.cache ./bdb/dist/autom4te.cache
|
||||
#(cd ./bdb/dist && sh s_all)
|
52
netware/BUILD/compile-linux-tools
Executable file
52
netware/BUILD/compile-linux-tools
Executable file
@@ -0,0 +1,52 @@
|
||||
#! /bin/sh
|
||||
|
||||
#debug
|
||||
#set -x
|
||||
|
||||
if test ! -r ./sql/mysqld.cc
|
||||
then
|
||||
echo "you must start from the top source directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
path=`dirname $0`
|
||||
|
||||
# clean
|
||||
if test -e "Makefile"; then make -k clean; fi
|
||||
|
||||
# remove files
|
||||
rm -f NEW-RPMS/*
|
||||
rm -f */.deps/*.P
|
||||
rm -f */*.linux
|
||||
|
||||
# run autotools
|
||||
. $path/compile-AUTOTOOLS
|
||||
|
||||
# configure
|
||||
./configure --without-innodb --without-docs
|
||||
|
||||
# build tools only
|
||||
make clean config.h
|
||||
(cd dbug; make libdbug.a)
|
||||
(cd strings; make libmystrings.a)
|
||||
(cd mysys; make libmysys.a)
|
||||
(cd heap; make libheap.a)
|
||||
(cd vio; make libvio.a)
|
||||
(cd regex; make libregex.a)
|
||||
(cd isam; make libnisam.a)
|
||||
(cd merge; make libmerge.a)
|
||||
(cd myisam; make libmyisam.a)
|
||||
(cd myisammrg; make libmyisammrg.a)
|
||||
(cd extra; make comp_err)
|
||||
(cd libmysql; make conf_to_src)
|
||||
(cd libmysql_r; make conf_to_src)
|
||||
(cd sql; make gen_lex_hash)
|
||||
(cd strings; make conf_to_src)
|
||||
|
||||
# copying required linux tools
|
||||
cp extra/comp_err extra/comp_err.linux
|
||||
cp libmysql/conf_to_src libmysql/conf_to_src.linux
|
||||
cp libmysql_r/conf_to_src libmysql_r/conf_to_src.linux
|
||||
cp sql/gen_lex_hash sql/gen_lex_hash.linux
|
||||
cp strings/conf_to_src strings/conf_to_src.linux
|
||||
|
35
netware/BUILD/compile-netware-END
Executable file
35
netware/BUILD/compile-netware-END
Executable file
@@ -0,0 +1,35 @@
|
||||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
|
||||
# clean
|
||||
if test -e "Makefile"; then make -k clean; fi
|
||||
|
||||
# remove files
|
||||
rm -f NEW-RPMS/*
|
||||
rm -f */.deps/*.P
|
||||
rm -rf Makefile.in.bk
|
||||
|
||||
# Metrowerks enviornment
|
||||
. $path/mwenv
|
||||
|
||||
# run auto tools
|
||||
. $path/compile-AUTOTOOLS
|
||||
|
||||
# configure
|
||||
./configure $base_configs $extra_configs
|
||||
|
||||
# make
|
||||
make clean bin-dist
|
||||
|
||||
# mark the build
|
||||
for file in *.tar.gz
|
||||
do
|
||||
if (expr "$file" : "mysql-[1-9].*" > /dev/null)
|
||||
then
|
||||
new_file=`echo $file | sed -e "s/mysql-/mysql-$suffix-/"`
|
||||
if test -e "$new_file"; then mv -f $new_file $new_file.old; fi
|
||||
mv $file $new_file
|
||||
fi
|
||||
done
|
||||
|
23
netware/BUILD/compile-netware-START
Executable file
23
netware/BUILD/compile-netware-START
Executable file
@@ -0,0 +1,23 @@
|
||||
#! /bin/sh
|
||||
|
||||
#debug
|
||||
#set -x
|
||||
|
||||
if test ! -r ./sql/mysqld.cc
|
||||
then
|
||||
echo "you must start from the top source directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
path=`dirname $0`
|
||||
|
||||
# stop on errors
|
||||
set -e
|
||||
|
||||
base_configs=" \
|
||||
--host=i686-pc-netware \
|
||||
--enable-local-infile \
|
||||
--with-extra-charsets=latin1_de \
|
||||
--prefix=N:/mysql \
|
||||
"
|
||||
|
8
netware/BUILD/compile-netware-all
Executable file
8
netware/BUILD/compile-netware-all
Executable file
@@ -0,0 +1,8 @@
|
||||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
|
||||
$path/compile-netware-standard
|
||||
$path/compile-netware-debug
|
||||
#$path/compile-netware-max
|
||||
#$path/compile-netware-max-debug
|
15
netware/BUILD/compile-netware-debug
Executable file
15
netware/BUILD/compile-netware-debug
Executable file
@@ -0,0 +1,15 @@
|
||||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. $path/compile-netware-START
|
||||
|
||||
suffix="debug"
|
||||
|
||||
extra_configs=" \
|
||||
--with-innodb \
|
||||
--with-debug=full \
|
||||
"
|
||||
|
||||
. $path/compile-netware-END
|
||||
|
||||
|
14
netware/BUILD/compile-netware-standard
Executable file
14
netware/BUILD/compile-netware-standard
Executable file
@@ -0,0 +1,14 @@
|
||||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. $path/compile-netware-START
|
||||
|
||||
suffix="standard"
|
||||
|
||||
extra_configs=" \
|
||||
--with-innodb
|
||||
"
|
||||
|
||||
. $path/compile-netware-END
|
||||
|
||||
|
0
netware/mw/mwasmnlm → netware/BUILD/mwasmnlm
Normal file → Executable file
0
netware/mw/mwasmnlm → netware/BUILD/mwasmnlm
Normal file → Executable file
0
netware/mw/mwccnlm → netware/BUILD/mwccnlm
Normal file → Executable file
0
netware/mw/mwccnlm → netware/BUILD/mwccnlm
Normal file → Executable file
29
netware/BUILD/mwenv
Executable file
29
netware/BUILD/mwenv
Executable file
@@ -0,0 +1,29 @@
|
||||
#! /bin/sh
|
||||
|
||||
# WINE_BUILD_DIR, BUILD_DIR, and VERSION must be changed before compiling
|
||||
# This values are normally changed by the nwbootstrap script
|
||||
|
||||
# the default for WINE_BUILD_DIR is "F:/mydev"
|
||||
export MYDEV="WINE_BUILD_DIR"
|
||||
|
||||
export MWCNWx86Includes="$MYDEV/libc/include"
|
||||
export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib"
|
||||
export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib"
|
||||
|
||||
export WINEPATH="$MYDEV/mw/bin"
|
||||
|
||||
# the default for BUILD_DIR is "$HOME/mydev"
|
||||
export PATH="$PATH:BUILD_DIR/mysql-VERSION/netware/BUILD"
|
||||
|
||||
export AR='mwldnlm'
|
||||
export AR_FLAGS='-type library -o'
|
||||
export AS='mwasmnlm'
|
||||
export CC='mwccnlm -gccincludes'
|
||||
export CFLAGS='-dialect c -proc 686 -bool on -relax_pointers -DUSE_OLD_FUNCTIONS'
|
||||
export CXX='mwccnlm -gccincludes'
|
||||
export CXXFLAGS='-dialect c++ -proc 686 -bool on -relax_pointers'
|
||||
export LD='mwldnlm'
|
||||
export LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -flags pseudopreemption'
|
||||
export RANLIB=:
|
||||
export STRIP=:
|
||||
|
0
netware/mw/mwldnlm → netware/BUILD/mwldnlm
Normal file → Executable file
0
netware/mw/mwldnlm → netware/BUILD/mwldnlm
Normal file → Executable file
166
netware/BUILD/nwbootstrap
Executable file
166
netware/BUILD/nwbootstrap
Executable file
@@ -0,0 +1,166 @@
|
||||
#! /bin/sh
|
||||
|
||||
# debug
|
||||
#set -x
|
||||
|
||||
path=`dirname $0`
|
||||
|
||||
# stop on errors
|
||||
set -e
|
||||
|
||||
# repository direcotry
|
||||
repo_dir=`pwd`
|
||||
|
||||
# build direcotry
|
||||
build_dir="$HOME/mydev"
|
||||
wine_build_dir="F:/mydev"
|
||||
|
||||
# doc directory
|
||||
doc_dir="$repo_dir/../mysqldoc"
|
||||
|
||||
# init
|
||||
target_dir=""
|
||||
temp_dir=""
|
||||
revision=""
|
||||
rev=""
|
||||
build=""
|
||||
mwenv=""
|
||||
|
||||
# show usage
|
||||
show_usage()
|
||||
{
|
||||
cat << EOF
|
||||
|
||||
usage: nwbootstrap [options]
|
||||
|
||||
Exports a revision of the BitKeeper tree (nwbootstrap must be run inside a
|
||||
directory of the BitKeeper tree to be used). Creates the ChangeLog file.
|
||||
Adds the latest manual.texi from the mysqldoc BitKeeper tree. Builds the
|
||||
Linux tools required for cross-platform builds. Optionally, builds the
|
||||
binary distributions for NetWare.
|
||||
|
||||
options:
|
||||
|
||||
--build=<opt> Build the binary distributions for NetWare,
|
||||
where <opt> is "standard", "debug", or "all"
|
||||
(default is to not build a binary distribution)
|
||||
|
||||
--build-dir=<dir> Export the BitKeeper tree to the <dir> directroy
|
||||
(default is "$build_dir")
|
||||
|
||||
--doc-dir=<dir> Use the mysqldoc BitKeeper tree located in the
|
||||
<dir> directory
|
||||
(default is parallel to current BitKeeper tree)
|
||||
|
||||
--help Show this help information
|
||||
|
||||
--revision=<rev> Export the BitKeeper tree as of revision <rev>
|
||||
(default is the latest revision)
|
||||
|
||||
--wine-build-dir=<dir> Use the WINE directory <dir>, which should
|
||||
correspond to the --build-dir directory
|
||||
(default is "$wine_build_dir")
|
||||
|
||||
examples:
|
||||
|
||||
nwbootstrap
|
||||
|
||||
nwbootstrap --revision=1.1594 --build=all
|
||||
|
||||
nwbootstrap --build-dir=/home/jdoe/dev --wine-build-dir=F:/dev
|
||||
|
||||
|
||||
EOF
|
||||
exit 0;
|
||||
}
|
||||
|
||||
# parse arguments
|
||||
for arg do
|
||||
case "$arg" in
|
||||
--build-dir=*) build_dir=`echo "$arg" | sed -e "s;--build-dir=;;"` ;;
|
||||
--wine-build-dir=*) wine_build_dir=`echo "$arg" | sed -e "s;--wine-build-dir=;;"` ;;
|
||||
--revision=*) revision=`echo "$arg" | sed -e "s;--revision=;;"` ;;
|
||||
--build=*) build=`echo "$arg" | sed -e "s;--build=;;"` ;;
|
||||
--doc-dir=*) doc_dir=`echo "$arg" | sed -e "s;--doc-dir=;;"` ;;
|
||||
*) show_usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "starting build..."
|
||||
|
||||
# check for bk and repo_dir
|
||||
bk help > /dev/null
|
||||
repo_dir=`bk root $repo_dir`
|
||||
cd $repo_dir
|
||||
doc_dir="$repo_dir/../mysqldoc"
|
||||
|
||||
# build temporary directory
|
||||
temp_dir="$build_dir/mysql-$$.tmp"
|
||||
|
||||
# export the bk tree
|
||||
command="bk export";
|
||||
if test $revision; then command="$command -r$revision"; fi
|
||||
command="$command $temp_dir"
|
||||
echo "exporting $repo_dir..."
|
||||
$command
|
||||
|
||||
# determine version
|
||||
version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < $temp_dir/configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"`
|
||||
echo "version: $version"
|
||||
|
||||
# build target directory
|
||||
target_dir="$build_dir/mysql-$version"
|
||||
|
||||
# delete any old target
|
||||
if test -d $target_dir.old; then rm -rf $target_dir.old; fi
|
||||
|
||||
# rename old target
|
||||
if test -d $target_dir; then mv -f $target_dir $target_dir.old; fi
|
||||
|
||||
# rename directory to use version
|
||||
mv $temp_dir $target_dir
|
||||
|
||||
# create ChangeLog
|
||||
if test $revision
|
||||
then
|
||||
rev=`bk changes -r..$revision -t -d':REV:' -n | head -2 | tail -1`
|
||||
else
|
||||
rev=`bk changes -t -d':REV:' -n | head -1`
|
||||
fi
|
||||
|
||||
echo "creating ChangeLog..."
|
||||
bk changes -v -r$rev > $target_dir/ChangeLog
|
||||
|
||||
# add the latest manual
|
||||
if test -d $doc_dir
|
||||
then
|
||||
echo "adding the latest manual..."
|
||||
install -m 644 $doc_dir/Docs/{manual,reservedwords}.texi $target_dir/Docs/
|
||||
fi
|
||||
|
||||
# make files writeable
|
||||
cd $target_dir
|
||||
chmod -R u+rw,g+rw .
|
||||
|
||||
# edit the mvenv file
|
||||
mwenv="./netware/BUILD/mwenv"
|
||||
mv -f $mwenv $mwenv.org
|
||||
sed -e "s;WINE_BUILD_DIR;$wine_build_dir;g" \
|
||||
-e "s;BUILD_DIR;$build_dir;g" \
|
||||
-e "s;VERSION;$version;g" $mwenv.org > $mwenv
|
||||
chmod +rwx $mwenv
|
||||
|
||||
# build linux tools
|
||||
echo "compiling linux tools..."
|
||||
./netware/BUILD/compile-linux-tools
|
||||
|
||||
# compile
|
||||
if test $build
|
||||
then
|
||||
echo "compiling $build..."
|
||||
./netware/BUILD/compile-netware-$build
|
||||
fi
|
||||
|
||||
echo "done"
|
||||
|
||||
|
@@ -1,65 +0,0 @@
|
||||
LIBRARY LIBMYSQLD
|
||||
DESCRIPTION 'MySQL 4.0 Embedded Server Library'
|
||||
VERSION 4.0
|
||||
EXPORTS
|
||||
mysql_server_end
|
||||
mysql_server_init
|
||||
mysql_use_result
|
||||
mysql_thread_safe
|
||||
mysql_thread_id
|
||||
mysql_store_result
|
||||
mysql_stat
|
||||
mysql_shutdown
|
||||
mysql_select_db
|
||||
mysql_row_tell
|
||||
mysql_row_seek
|
||||
mysql_real_query
|
||||
mysql_real_connect
|
||||
mysql_query
|
||||
mysql_ping
|
||||
mysql_options
|
||||
mysql_num_rows
|
||||
mysql_num_fields
|
||||
mysql_list_tables
|
||||
mysql_list_processes
|
||||
mysql_list_fields
|
||||
mysql_list_dbs
|
||||
mysql_kill
|
||||
mysql_insert_id
|
||||
mysql_init
|
||||
mysql_info
|
||||
mysql_get_server_info
|
||||
mysql_get_proto_info
|
||||
mysql_get_host_info
|
||||
mysql_get_client_info
|
||||
mysql_free_result
|
||||
mysql_field_tell
|
||||
mysql_field_count
|
||||
mysql_field_seek
|
||||
mysql_fetch_row
|
||||
mysql_fetch_lengths
|
||||
mysql_fetch_fields
|
||||
mysql_fetch_field_direct
|
||||
mysql_fetch_field
|
||||
mysql_escape_string
|
||||
mysql_real_escape_string
|
||||
mysql_error
|
||||
mysql_errno
|
||||
mysql_eof
|
||||
mysql_dump_debug_info
|
||||
mysql_drop_db
|
||||
mysql_debug
|
||||
mysql_data_seek
|
||||
mysql_create_db
|
||||
mysql_character_set_name
|
||||
mysql_change_user
|
||||
mysql_connect
|
||||
mysql_close
|
||||
mysql_affected_rows
|
||||
mysql_thread_init
|
||||
mysql_thread_end
|
||||
mysql_send_query
|
||||
mysql_read_query_result
|
||||
mysql_refresh
|
||||
mysql_odbc_escape_string
|
||||
myodbc_remove_escape
|
@@ -1,11 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
export MYDEV="F:/mydev"
|
||||
|
||||
export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/zlib-1.1.4"
|
||||
export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/zlib-1.1.4"
|
||||
export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a"
|
||||
|
||||
export WINEPATH="$MYDEV/mw/bin"
|
||||
|
||||
export PATH="$PATH:$HOME/mydev/mysql-4.1/netware/mw"
|
@@ -1,145 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# show executed commands
|
||||
# set -x
|
||||
|
||||
# stop on errors
|
||||
set -e
|
||||
|
||||
BD=`pwd`
|
||||
|
||||
build=0
|
||||
build_debug=0
|
||||
skip_linux=0
|
||||
|
||||
# parse arguments
|
||||
for arg do
|
||||
case "$arg" in
|
||||
--build) build=1 ;;
|
||||
--build-debug) build_debug=1 ;;
|
||||
--skip-linux) skip_linux=1 ;;
|
||||
*) echo "$0: unrecognized option: $arg" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# run the auto tools
|
||||
autotools()
|
||||
{
|
||||
for package in $BD $BD/innobase
|
||||
do
|
||||
echo "cd $package"
|
||||
cd $package
|
||||
rm -f config.cache
|
||||
echo "aclocal"
|
||||
aclocal
|
||||
echo "autoheader"
|
||||
autoheader
|
||||
echo "libtoolize --force"
|
||||
libtoolize --force
|
||||
echo "aclocal"
|
||||
aclocal
|
||||
echo "automake --add-missing --force-missing"
|
||||
automake --add-missing --force-missing
|
||||
echo "autoconf"
|
||||
autoconf
|
||||
done
|
||||
|
||||
cd $BD
|
||||
}
|
||||
|
||||
# check the source direcotry
|
||||
echo "looking for \"$BD/sql/mysqld.cc\"..."
|
||||
if test ! -r ./sql/mysqld.cc
|
||||
then
|
||||
echo "./netware/nwbootstrap must be started from the top source directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# clean
|
||||
# make -j 2 -k distclean
|
||||
rm -f NEW-RPMS/*
|
||||
rm -f */.deps/*.P
|
||||
|
||||
# make files writeable
|
||||
chmod -R u+rw,g+rw .
|
||||
|
||||
# skip linux?
|
||||
if test $skip_linux -ne 1
|
||||
then
|
||||
echo "starting linux build..."
|
||||
|
||||
echo "autotools..."
|
||||
autotools
|
||||
|
||||
echo "configuring for linux..."
|
||||
./configure --without-docs --without-innodb
|
||||
|
||||
echo "building for linux..."
|
||||
make clean all
|
||||
|
||||
echo "copying required linux binaries..."
|
||||
rm -f */*.linux
|
||||
cp extra/comp_err extra/comp_err.linux
|
||||
cp libmysql/conf_to_src libmysql/conf_to_src.linux
|
||||
cp libmysql/conf_to_src libmysql_r/conf_to_src.linux
|
||||
cp sql/gen_lex_hash sql/gen_lex_hash.linux
|
||||
cp strings/conf_to_src strings/conf_to_src.linux
|
||||
|
||||
echo "cleaning linux build..."
|
||||
make clean distclean
|
||||
fi
|
||||
|
||||
echo "starting netware build..."
|
||||
|
||||
# remove stale Makefile.in.bk files
|
||||
rm -rf Makefile.in.bk
|
||||
|
||||
# start mw enviornment
|
||||
chmod +x ./netware/nwconfigure
|
||||
chmod +x ./netware/mw/mwenv
|
||||
chmod +x ./netware/mw/mwasmnlm
|
||||
chmod +x ./netware/mw/mwccnlm
|
||||
chmod +x ./netware/mw/mwldnlm
|
||||
|
||||
. ./netware/mw/mwenv
|
||||
|
||||
# link nwconfigure
|
||||
rm -f ./nwconfigure
|
||||
ln ./netware/nwconfigure ./nwconfigure
|
||||
|
||||
# save old builds from previous run
|
||||
if test -e *.tar.gz
|
||||
then
|
||||
rm -f *.tar.gz.old
|
||||
rename .tar.gz .tar.gz.old *.tar.gz
|
||||
fi
|
||||
|
||||
echo "autotools..."
|
||||
autotools
|
||||
|
||||
# debug build
|
||||
if test $build_debug -eq 1
|
||||
then
|
||||
echo "configuring for netware (debug)..."
|
||||
./nwconfigure --with-debug=full
|
||||
|
||||
echo "building for netware (debug)..."
|
||||
make clean bin-dist
|
||||
|
||||
# mark the debug build
|
||||
rename .tar.gz -debug.tar.gz *.tar.gz
|
||||
fi
|
||||
|
||||
# release build
|
||||
if test $build -eq 1
|
||||
then
|
||||
echo "configuring for netware..."
|
||||
./nwconfigure
|
||||
|
||||
echo "building for netware..."
|
||||
make clean bin-dist
|
||||
fi
|
||||
|
||||
echo "done"
|
||||
|
||||
|
@@ -1,23 +0,0 @@
|
||||
#! /bin/sh
|
||||
CMD="\
|
||||
AR='mwldnlm' \
|
||||
AR_FLAGS='-type library -o' \
|
||||
AS='mwasmnlm' \
|
||||
CC='mwccnlm -gccincludes' \
|
||||
CFLAGS='-dialect c -proc 686 -bool on -relax_pointers -DUSE_OLD_FUNCTIONS' \
|
||||
CXX='mwccnlm -gccincludes' \
|
||||
CXXFLAGS='-dialect c++ -proc 686 -bool on -relax_pointers' \
|
||||
LD='mwldnlm' \
|
||||
LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -flags pseudopreemption' \
|
||||
RANLIB=: \
|
||||
STRIP=: \
|
||||
./configure --host=i686-pc-netware $* \
|
||||
--without-docs \
|
||||
--enable-local-infile \
|
||||
--with-extra-charsets=latin1_de \
|
||||
--prefix=N:/mysql \
|
||||
"
|
||||
#rm -f config.cache config.log config.status
|
||||
echo $CMD
|
||||
eval $CMD
|
||||
|
@@ -64,16 +64,17 @@ case $system in
|
||||
esac
|
||||
|
||||
|
||||
mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \
|
||||
mkdir $BASE $BASE/bin \
|
||||
$BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \
|
||||
$BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \
|
||||
$BASE/mysql-test/include $BASE/mysql-test/std_data
|
||||
|
||||
if [ $BASE_SYSTEM != "netware" ] ; then
|
||||
mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man $BASE/man/man1
|
||||
fi
|
||||
mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \
|
||||
$BASE/man/man1 $BASE/data $BASE/data/mysql $BASE/data/test
|
||||
|
||||
chmod o-rwx $BASE/data $BASE/data/*
|
||||
chmod o-rwx $BASE/data $BASE/data/*
|
||||
fi
|
||||
|
||||
for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \
|
||||
MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html \
|
||||
@@ -183,6 +184,7 @@ done
|
||||
|
||||
$CP mysql-test/include/*.inc $BASE/mysql-test/include
|
||||
$CP mysql-test/std_data/*.dat mysql-test/std_data/*.001 $BASE/mysql-test/std_data
|
||||
$CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data
|
||||
$CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t
|
||||
$CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r
|
||||
|
||||
|
19
sql/field.cc
19
sql/field.cc
@@ -248,7 +248,7 @@ void Field_str::make_field(Send_field *field)
|
||||
|
||||
void Field_str::add_binary_or_charset(String &res) const
|
||||
{
|
||||
if (binary())
|
||||
if (charset() == &my_charset_bin)
|
||||
res.append(" binary");
|
||||
else if (field_charset != table->table_charset &&
|
||||
!(current_thd->variables.sql_mode & MODE_NO_FIELD_OPTIONS) &&
|
||||
@@ -3875,13 +3875,18 @@ void Field_datetime::sql_type(String &res) const
|
||||
|
||||
/* Copy a string and fill with space */
|
||||
|
||||
static bool use_conversion(CHARSET_INFO *cs1, CHARSET_INFO *cs2)
|
||||
{
|
||||
return (cs1 != &my_charset_bin) && (cs2 != &my_charset_bin) && (cs1!=cs2);
|
||||
}
|
||||
|
||||
int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||
{
|
||||
int error= 0;
|
||||
char buff[80];
|
||||
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
||||
/* Convert character set if nesessary */
|
||||
if ((cs != field_charset) && (cs!=&my_charset_bin) && (!binary()))
|
||||
if (use_conversion(cs, field_charset))
|
||||
{
|
||||
tmpstr.copy(from, length, cs, field_charset);
|
||||
from= tmpstr.ptr();
|
||||
@@ -4063,7 +4068,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||
char buff[80];
|
||||
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
||||
/* Convert character set if nesessary */
|
||||
if ((cs != field_charset) && (cs!=&my_charset_bin) && (!binary()))
|
||||
if (use_conversion(cs, field_charset))
|
||||
{
|
||||
tmpstr.copy(from, length, cs, field_charset);
|
||||
from= tmpstr.ptr();
|
||||
@@ -4380,7 +4385,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||
char buff[80];
|
||||
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
||||
/* Convert character set if nesessary */
|
||||
if ((cs != field_charset) && (cs!=&my_charset_bin) && (!binary()))
|
||||
if (use_conversion(cs, field_charset))
|
||||
{
|
||||
tmpstr.copy(from, length, cs, field_charset);
|
||||
from= tmpstr.ptr();
|
||||
@@ -4627,7 +4632,7 @@ void Field_blob::sql_type(String &res) const
|
||||
case 4: str="long"; length=4; break;
|
||||
}
|
||||
res.set_latin1(str,length);
|
||||
if (binary())
|
||||
if (charset() == &my_charset_bin)
|
||||
res.append("blob");
|
||||
else
|
||||
{
|
||||
@@ -4857,7 +4862,7 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||
char buff[80];
|
||||
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
||||
/* Convert character set if nesessary */
|
||||
if ((cs != field_charset) && (cs!=&my_charset_bin) && (!binary()))
|
||||
if (use_conversion(cs, field_charset))
|
||||
{
|
||||
tmpstr.copy(from, length, cs, field_charset);
|
||||
from= tmpstr.ptr();
|
||||
@@ -5072,7 +5077,7 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||
char buff[80];
|
||||
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
||||
/* Convert character set if nesessary */
|
||||
if ((cs != field_charset) && (cs!=&my_charset_bin) && (!binary()))
|
||||
if (use_conversion(cs, field_charset))
|
||||
{
|
||||
tmpstr.copy(from, length, cs, field_charset);
|
||||
from= tmpstr.ptr();
|
||||
|
11
sql/field.h
11
sql/field.h
@@ -160,8 +160,6 @@ public:
|
||||
{ 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)
|
||||
{
|
||||
ptr+=row_offset;
|
||||
@@ -265,7 +263,7 @@ public:
|
||||
unireg_check_arg, field_name_arg, table_arg)
|
||||
{
|
||||
field_charset=charset;
|
||||
if (binary())
|
||||
if (charset->state & MY_CS_BINSORT)
|
||||
flags|=BINARY_FLAG;
|
||||
}
|
||||
Item_result result_type () const { return STRING_RESULT; }
|
||||
@@ -277,13 +275,6 @@ public:
|
||||
|
||||
void set_charset(CHARSET_INFO *charset) { field_charset=charset; }
|
||||
bool binary() const { return field_charset->state & MY_CS_BINSORT ? 1 : 0; }
|
||||
inline int cmp_image(char *buff,uint length)
|
||||
{
|
||||
if (binary())
|
||||
return memcmp(ptr,buff,length);
|
||||
else
|
||||
return my_strncasecmp(field_charset,ptr,buff,length);
|
||||
}
|
||||
friend class create_field;
|
||||
};
|
||||
|
||||
|
@@ -120,8 +120,8 @@ bool Item_string::eq(const Item *item, bool binary_cmp) const
|
||||
if (type() == item->type())
|
||||
{
|
||||
if (binary_cmp)
|
||||
return !stringcmp(&str_value, &item->str_value);
|
||||
return !sortcmp(&str_value, &item->str_value);
|
||||
return !sortcmp(&str_value, &item->str_value, &my_charset_bin);
|
||||
return !sortcmp(&str_value, &item->str_value, charset());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1355,7 +1355,7 @@ bool field_is_equal_to_item(Field *field,Item *item)
|
||||
if (item->null_value)
|
||||
return 1; // This must be true
|
||||
field->val_str(&field_tmp,&field_tmp);
|
||||
return !stringcmp(&field_tmp,item_result);
|
||||
return !sortcmp(&field_tmp,item_result,&my_charset_bin);
|
||||
}
|
||||
if (res_type == INT_RESULT)
|
||||
return 1; // Both where of type int
|
||||
|
@@ -56,10 +56,8 @@ bool Item_str_buff::cmp(void)
|
||||
}
|
||||
else if (null_value)
|
||||
return 0; // new and old value was null
|
||||
else if (!item->binary())
|
||||
tmp= sortcmp(&value,res) != 0;
|
||||
else
|
||||
tmp= stringcmp(&value,res) != 0;
|
||||
tmp= sortcmp(&value,res,item->charset()) != 0;
|
||||
if (tmp)
|
||||
value.copy(*res); // Remember for next cmp
|
||||
return tmp;
|
||||
|
@@ -125,7 +125,9 @@ void Item_bool_func2::fix_length_and_dec()
|
||||
}
|
||||
}
|
||||
set_cmp_func();
|
||||
binary_cmp= args[0]->binary() || args[1]->binary();
|
||||
/* QQ: COERCIBILITY */
|
||||
cmp_charset= (args[0]->binary() || args[1]->binary()) ?
|
||||
&my_charset_bin : args[0]->charset();
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +169,7 @@ int Arg_comparator::compare_string()
|
||||
if ((res2= (*b)->val_str(&owner->tmp_value2)))
|
||||
{
|
||||
owner->null_value= 0;
|
||||
return owner->binary_cmp ? stringcmp(res1,res2) : sortcmp(res1,res2);
|
||||
return sortcmp(res1,res2,owner->cmp_charset);
|
||||
}
|
||||
}
|
||||
owner->null_value= 1;
|
||||
@@ -181,8 +183,7 @@ int Arg_comparator::compare_e_string()
|
||||
res2= (*b)->val_str(&owner->tmp_value2);
|
||||
if (!res1 || !res2)
|
||||
return test(res1 == res2);
|
||||
return (owner->binary_cmp ? test(stringcmp(res1, res2) == 0) :
|
||||
test(sortcmp(res1, res2) == 0));
|
||||
return test(sortcmp(res1, res2, owner->cmp_charset) == 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -402,7 +403,7 @@ longlong Item_func_strcmp::val_int()
|
||||
null_value=1;
|
||||
return 0;
|
||||
}
|
||||
int value= binary_cmp ? stringcmp(a,b) : sortcmp(a,b);
|
||||
int value= sortcmp(a,b,cmp_charset);
|
||||
null_value=0;
|
||||
return !value ? 0 : (value < 0 ? (longlong) -1 : (longlong) 1);
|
||||
}
|
||||
@@ -482,10 +483,11 @@ void Item_func_between::fix_length_and_dec()
|
||||
cmp_type=item_cmp_type(args[0]->result_type(),
|
||||
item_cmp_type(args[1]->result_type(),
|
||||
args[2]->result_type()));
|
||||
/* QQ: COERCIBILITY */
|
||||
if (args[0]->binary() | args[1]->binary() | args[2]->binary())
|
||||
string_compare=stringcmp;
|
||||
cmp_charset= &my_charset_bin;
|
||||
else
|
||||
string_compare=sortcmp;
|
||||
cmp_charset= args[0]->charset();
|
||||
|
||||
/*
|
||||
Make a special case of compare with date/time and longlong fields.
|
||||
@@ -517,17 +519,17 @@ longlong Item_func_between::val_int()
|
||||
a=args[1]->val_str(&value1);
|
||||
b=args[2]->val_str(&value2);
|
||||
if (!args[1]->null_value && !args[2]->null_value)
|
||||
return (string_compare(value,a) >= 0 && string_compare(value,b) <= 0) ?
|
||||
1 : 0;
|
||||
return (sortcmp(value,a,cmp_charset) >= 0 &&
|
||||
sortcmp(value,b,cmp_charset) <= 0) ? 1 : 0;
|
||||
if (args[1]->null_value && args[2]->null_value)
|
||||
null_value=1;
|
||||
else if (args[1]->null_value)
|
||||
{
|
||||
null_value= string_compare(value,b) <= 0; // not null if false range.
|
||||
null_value= sortcmp(value,b,cmp_charset) <= 0; // not null if false range.
|
||||
}
|
||||
else
|
||||
{
|
||||
null_value= string_compare(value,a) >= 0; // not null if false range.
|
||||
null_value= sortcmp(value,a,cmp_charset) >= 0; // not null if false range.
|
||||
}
|
||||
}
|
||||
else if (cmp_type == INT_RESULT)
|
||||
@@ -809,12 +811,13 @@ Item *Item_func_case::find_item(String *str)
|
||||
}
|
||||
if ((tmp=args[i]->val_str(str))) // If not null
|
||||
{
|
||||
/* QQ: COERCIBILITY */
|
||||
if (first_expr_is_binary || args[i]->binary())
|
||||
{
|
||||
if (stringcmp(tmp,first_expr_str)==0)
|
||||
if (sortcmp(tmp,first_expr_str,&my_charset_bin)==0)
|
||||
return args[i+1];
|
||||
}
|
||||
else if (sortcmp(tmp,first_expr_str)==0)
|
||||
else if (sortcmp(tmp,first_expr_str,tmp->charset())==0)
|
||||
return args[i+1];
|
||||
}
|
||||
break;
|
||||
@@ -1211,10 +1214,7 @@ cmp_item* cmp_item::get_comparator(Item *item)
|
||||
{
|
||||
switch (item->result_type()) {
|
||||
case STRING_RESULT:
|
||||
if (item->binary())
|
||||
return new cmp_item_binary_string;
|
||||
else
|
||||
return new cmp_item_sort_string;
|
||||
return new cmp_item_sort_string(item->charset());
|
||||
break;
|
||||
case INT_RESULT:
|
||||
return new cmp_item_int;
|
||||
@@ -1234,12 +1234,7 @@ cmp_item* cmp_item::get_comparator(Item *item)
|
||||
|
||||
cmp_item* cmp_item_sort_string::make_same()
|
||||
{
|
||||
return new cmp_item_sort_string_in_static();
|
||||
}
|
||||
|
||||
cmp_item* cmp_item_binary_string::make_same()
|
||||
{
|
||||
return new cmp_item_binary_string_in_static();
|
||||
return new cmp_item_sort_string_in_static(cmp_charset);
|
||||
}
|
||||
|
||||
cmp_item* cmp_item_int::make_same()
|
||||
@@ -1346,6 +1341,22 @@ bool Item_func_in::nulls_in_row()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int srtcmp_in(const String *x,const String *y)
|
||||
{
|
||||
CHARSET_INFO *cs= x->charset();
|
||||
return cs->strnncollsp(cs,
|
||||
(unsigned char *) x->ptr(),x->length(),
|
||||
(unsigned char *) y->ptr(),y->length());
|
||||
}
|
||||
|
||||
static int bincmp_in(const String *x,const String *y)
|
||||
{
|
||||
CHARSET_INFO *cs= &my_charset_bin;
|
||||
return cs->strnncollsp(cs,
|
||||
(unsigned char *) x->ptr(),x->length(),
|
||||
(unsigned char *) y->ptr(),y->length());
|
||||
}
|
||||
|
||||
void Item_func_in::fix_length_and_dec()
|
||||
{
|
||||
/*
|
||||
@@ -1357,9 +1368,9 @@ void Item_func_in::fix_length_and_dec()
|
||||
switch (item->result_type()) {
|
||||
case STRING_RESULT:
|
||||
if (item->binary())
|
||||
array=new in_string(arg_count,(qsort_cmp) stringcmp);
|
||||
array=new in_string(arg_count,(qsort_cmp) srtcmp_in);
|
||||
else
|
||||
array=new in_string(arg_count,(qsort_cmp) sortcmp);
|
||||
array=new in_string(arg_count,(qsort_cmp) bincmp_in);
|
||||
break;
|
||||
case INT_RESULT:
|
||||
array= new in_longlong(arg_count);
|
||||
@@ -1759,8 +1770,9 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref)
|
||||
|
||||
/*
|
||||
Comparision is by default done according to character set of LIKE
|
||||
QQ: COERCIBILITY
|
||||
*/
|
||||
if (binary_cmp)
|
||||
if (cmp_charset == &my_charset_bin)
|
||||
set_charset(&my_charset_bin);
|
||||
else
|
||||
set_charset(args[1]->charset());
|
||||
@@ -1877,7 +1889,7 @@ longlong Item_func_regex::val_int()
|
||||
null_value=1;
|
||||
return 0;
|
||||
}
|
||||
if (!regex_compiled || stringcmp(res2,&prev_regexp))
|
||||
if (!regex_compiled || sortcmp(res2,&prev_regexp,&my_charset_bin))
|
||||
{
|
||||
prev_regexp.copy(*res2);
|
||||
if (regex_compiled)
|
||||
@@ -1936,7 +1948,7 @@ void Item_func_like::turboBM_compute_suffixes(int *suff)
|
||||
|
||||
*splm1 = pattern_len;
|
||||
|
||||
if (binary_cmp)
|
||||
if (cmp_charset == &my_charset_bin)
|
||||
{
|
||||
int i;
|
||||
for (i = pattern_len - 2; i >= 0; i--)
|
||||
@@ -2039,7 +2051,7 @@ void Item_func_like::turboBM_compute_bad_character_shifts()
|
||||
for (i = bmBc; i < end; i++)
|
||||
*i = pattern_len;
|
||||
|
||||
if (binary_cmp)
|
||||
if (cmp_charset == &my_charset_bin)
|
||||
{
|
||||
for (j = 0; j < plm1; j++)
|
||||
bmBc[(uint) (uchar) pattern[j]] = plm1 - j;
|
||||
@@ -2070,7 +2082,7 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const
|
||||
const int tlmpl= text_len - pattern_len;
|
||||
|
||||
/* Searching */
|
||||
if (binary_cmp)
|
||||
if (cmp_charset == &my_charset_bin)
|
||||
{
|
||||
while (j <= tlmpl)
|
||||
{
|
||||
|
@@ -112,7 +112,7 @@ class Item_bool_func2 :public Item_int_func
|
||||
protected:
|
||||
Arg_comparator cmp;
|
||||
String tmp_value1,tmp_value2;
|
||||
bool binary_cmp;
|
||||
CHARSET_INFO *cmp_charset;
|
||||
|
||||
public:
|
||||
Item_bool_func2(Item *a,Item *b):
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
bool have_rev_func() const { return rev_functype() != UNKNOWN_FUNC; }
|
||||
void print(String *str) { Item_func::print_op(str); }
|
||||
bool is_null() { return test(args[0]->is_null() || args[1]->is_null()); }
|
||||
virtual bool binary() const { return binary_cmp; }
|
||||
virtual bool binary() const { return test(cmp_charset->state & MY_CS_BINSORT); }
|
||||
|
||||
static Item_bool_func2* eq_creator(Item *a, Item *b);
|
||||
static Item_bool_func2* ne_creator(Item *a, Item *b);
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
|
||||
class Item_func_between :public Item_int_func
|
||||
{
|
||||
int (*string_compare)(const String *x,const String *y);
|
||||
CHARSET_INFO *cmp_charset;
|
||||
public:
|
||||
Item_result cmp_type;
|
||||
String value0,value1,value2;
|
||||
@@ -263,7 +263,9 @@ public:
|
||||
void fix_length_and_dec()
|
||||
{
|
||||
max_length=2;
|
||||
binary_cmp= args[0]->binary() || args[1]->binary();
|
||||
/* QQ: COERCIBILITY */
|
||||
cmp_charset= args[0]->binary() || args[1]->binary() ?
|
||||
&my_charset_bin : args[0]->charset();
|
||||
}
|
||||
optimize_type select_optimize() const { return OPTIMIZE_NONE; }
|
||||
const char *func_name() const { return "strcmp"; }
|
||||
@@ -439,7 +441,8 @@ public:
|
||||
class cmp_item :public Sql_alloc
|
||||
{
|
||||
public:
|
||||
cmp_item() {}
|
||||
CHARSET_INFO *cmp_charset;
|
||||
cmp_item() { cmp_charset= &my_charset_bin; }
|
||||
virtual ~cmp_item() {}
|
||||
virtual void store_value(Item *item)= 0;
|
||||
virtual int cmp(Item *item)= 0;
|
||||
@@ -453,18 +456,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
typedef int (*str_cmp_func_pointer)(const String *, const String *);
|
||||
class cmp_item_string :public cmp_item
|
||||
{
|
||||
protected:
|
||||
str_cmp_func_pointer str_cmp_func;
|
||||
String *value_res;
|
||||
public:
|
||||
cmp_item_string (str_cmp_func_pointer cmp): str_cmp_func(cmp) {}
|
||||
cmp_item_string (CHARSET_INFO *cs) { cmp_charset= cs; }
|
||||
friend class cmp_item_sort_string;
|
||||
friend class cmp_item_binary_string;
|
||||
friend class cmp_item_sort_string_in_static;
|
||||
friend class cmp_item_binary_string_in_static;
|
||||
};
|
||||
|
||||
class cmp_item_sort_string :public cmp_item_string
|
||||
@@ -473,12 +472,9 @@ protected:
|
||||
char value_buff[80];
|
||||
String value;
|
||||
public:
|
||||
cmp_item_sort_string(str_cmp_func_pointer cmp):
|
||||
cmp_item_string(cmp),
|
||||
value(value_buff, sizeof(value_buff), default_charset_info) {}
|
||||
cmp_item_sort_string():
|
||||
cmp_item_string(&sortcmp),
|
||||
value(value_buff, sizeof(value_buff), default_charset_info) {}
|
||||
cmp_item_sort_string(CHARSET_INFO *cs):
|
||||
cmp_item_string(cs),
|
||||
value(value_buff, sizeof(value_buff), cs) {}
|
||||
void store_value(Item *item)
|
||||
{
|
||||
value_res= item->val_str(&value);
|
||||
@@ -489,22 +485,16 @@ public:
|
||||
String tmp(buff, sizeof(buff), default_charset_info), *res;
|
||||
if (!(res= arg->val_str(&tmp)))
|
||||
return 1; /* Can't be right */
|
||||
return (*str_cmp_func)(value_res, res);
|
||||
return sortcmp(value_res, res, cmp_charset);
|
||||
}
|
||||
int compare(cmp_item *c)
|
||||
{
|
||||
cmp_item_string *cmp= (cmp_item_string *)c;
|
||||
return (*str_cmp_func)(value_res, cmp->value_res);
|
||||
return sortcmp(value_res, cmp->value_res, cmp_charset);
|
||||
}
|
||||
cmp_item *make_same();
|
||||
};
|
||||
|
||||
class cmp_item_binary_string :public cmp_item_sort_string {
|
||||
public:
|
||||
cmp_item_binary_string(): cmp_item_sort_string(&stringcmp) {}
|
||||
cmp_item *make_same();
|
||||
};
|
||||
|
||||
class cmp_item_int :public cmp_item
|
||||
{
|
||||
longlong value;
|
||||
@@ -590,9 +580,8 @@ class cmp_item_sort_string_in_static :public cmp_item_string
|
||||
protected:
|
||||
String value;
|
||||
public:
|
||||
cmp_item_sort_string_in_static(str_cmp_func_pointer cmp):
|
||||
cmp_item_string(cmp) {}
|
||||
cmp_item_sort_string_in_static(): cmp_item_string(&sortcmp) {}
|
||||
cmp_item_sort_string_in_static(CHARSET_INFO *cs):
|
||||
cmp_item_string(cs) {}
|
||||
void store_value(Item *item)
|
||||
{
|
||||
value_res= item->val_str(&value);
|
||||
@@ -606,21 +595,11 @@ public:
|
||||
int compare(cmp_item *c)
|
||||
{
|
||||
cmp_item_string *cmp= (cmp_item_string *)c;
|
||||
return (*str_cmp_func)(value_res, cmp->value_res);
|
||||
return sortcmp(value_res, cmp->value_res, cmp_charset);
|
||||
}
|
||||
cmp_item * make_same()
|
||||
{
|
||||
return new cmp_item_sort_string_in_static();
|
||||
}
|
||||
};
|
||||
|
||||
class cmp_item_binary_string_in_static :public cmp_item_sort_string_in_static {
|
||||
public:
|
||||
cmp_item_binary_string_in_static():
|
||||
cmp_item_sort_string_in_static(&stringcmp) {}
|
||||
cmp_item * make_same()
|
||||
{
|
||||
return new cmp_item_binary_string_in_static();
|
||||
return new cmp_item_sort_string_in_static(cmp_charset);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -107,7 +107,7 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
|
||||
return 0; // Fatal error if flag is set!
|
||||
if (arg_count)
|
||||
{ // Print purify happy
|
||||
coercibility= COER_NOCOLL;
|
||||
bool first_coll= 1;
|
||||
for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++)
|
||||
{
|
||||
if ((*arg)->fix_fields(thd, tables, arg) ||
|
||||
@@ -122,16 +122,18 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
|
||||
Set return character set to first argument if we are returning a
|
||||
string.
|
||||
*/
|
||||
if ((*arg)->binary())
|
||||
if (first_coll)
|
||||
{
|
||||
set_charset((*arg)->charset());
|
||||
coercibility= (*args)->coercibility;
|
||||
first_coll= 0;
|
||||
}
|
||||
else if ((*arg)->charset() == &my_charset_bin ||
|
||||
charset() == &my_charset_bin)
|
||||
{
|
||||
set_charset(&my_charset_bin);
|
||||
coercibility= COER_NOCOLL;
|
||||
}
|
||||
else if (coercibility== COER_NOCOLL)
|
||||
{
|
||||
coercibility= (*arg)->coercibility;
|
||||
set_charset((*arg)->charset());
|
||||
}
|
||||
else if ((*arg)->coercibility < coercibility)
|
||||
{
|
||||
if (strcmp(charset()->csname,(*arg)->charset()->csname))
|
||||
@@ -864,6 +866,7 @@ void Item_func_min_max::fix_length_and_dec()
|
||||
max_length=0;
|
||||
maybe_null=1;
|
||||
cmp_type=args[0]->result_type();
|
||||
|
||||
for (uint i=0 ; i < arg_count ; i++)
|
||||
{
|
||||
if (max_length < args[i]->max_length)
|
||||
@@ -873,11 +876,11 @@ void Item_func_min_max::fix_length_and_dec()
|
||||
if (!args[i]->maybe_null)
|
||||
maybe_null=0;
|
||||
cmp_type=item_cmp_type(cmp_type,args[i]->result_type());
|
||||
if (args[i]->binary())
|
||||
if (i==0)
|
||||
set_charset(args[i]->charset());
|
||||
else if (args[i]->charset() == &my_charset_bin)
|
||||
set_charset(&my_charset_bin);
|
||||
}
|
||||
if (cmp_type == STRING_RESULT)
|
||||
str_cmp_function= binary() ? stringcmp : sortcmp;
|
||||
}
|
||||
|
||||
|
||||
@@ -922,7 +925,7 @@ String *Item_func_min_max::val_str(String *str)
|
||||
res2= args[i]->val_str(res == str ? &tmp_value : str);
|
||||
if (res2)
|
||||
{
|
||||
int cmp= (*str_cmp_function)(res,res2);
|
||||
int cmp= sortcmp(res,res2,charset());
|
||||
if ((cmp_sign < 0 ? cmp : -cmp) < 0)
|
||||
res=res2;
|
||||
}
|
||||
|
@@ -524,7 +524,6 @@ class Item_func_min_max :public Item_func
|
||||
Item_result cmp_type;
|
||||
String tmp_value;
|
||||
int cmp_sign;
|
||||
int (*str_cmp_function)(const String *x,const String *y);
|
||||
public:
|
||||
Item_func_min_max(List<Item> &list,int cmp_sign_arg) :Item_func(list),
|
||||
cmp_type(INT_RESULT), cmp_sign(cmp_sign_arg) {}
|
||||
|
@@ -2181,12 +2181,15 @@ String *Item_func_set_collation::val_str(String *str)
|
||||
str=args[0]->val_str(str);
|
||||
if ((null_value=args[0]->null_value))
|
||||
return 0;
|
||||
str->set_charset(set_collation);
|
||||
str->set_charset(charset());
|
||||
return str;
|
||||
}
|
||||
|
||||
bool Item_func_set_collation::fix_fields(THD *thd,struct st_table_list *tables, Item **ref)
|
||||
{
|
||||
CHARSET_INFO *set_collation;
|
||||
String tmp, *str;
|
||||
const char *colname;
|
||||
char buff[STACK_BUFF_ALLOC]; // Max argument in function
|
||||
used_tables_cache=0;
|
||||
const_item_cache=1;
|
||||
@@ -2195,17 +2198,32 @@ bool Item_func_set_collation::fix_fields(THD *thd,struct st_table_list *tables,
|
||||
return 0; // Fatal error if flag is set!
|
||||
if (args[0]->fix_fields(thd, tables, args) || args[0]->check_cols(1))
|
||||
return 1;
|
||||
maybe_null=args[0]->maybe_null;
|
||||
if (args[0]->fix_fields(thd, tables, args) || args[0]->check_cols(1))
|
||||
return 2;
|
||||
maybe_null=args[0]->maybe_null || args[1]->maybe_null;
|
||||
|
||||
str= args[1]->val_str(&tmp);
|
||||
colname= str->c_ptr();
|
||||
if (!strncmp(colname,"BINARY",6))
|
||||
set_collation= get_charset_by_csname(args[0]->charset()->csname,
|
||||
MY_CS_BINSORT,MYF(0));
|
||||
else
|
||||
set_collation= get_charset_by_name(colname,MYF(0));
|
||||
|
||||
if (!set_collation)
|
||||
{
|
||||
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), str->c_ptr());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strcmp(args[0]->charset()->csname,set_collation->csname))
|
||||
{
|
||||
if (strcmp(set_collation->name,"binary"))
|
||||
{
|
||||
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
|
||||
set_collation->name,args[0]->charset()->csname);
|
||||
return 1;
|
||||
}
|
||||
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
|
||||
set_collation->name,args[0]->charset()->csname);
|
||||
return 1;
|
||||
}
|
||||
set_charset(set_collation);
|
||||
|
||||
coercibility= COER_EXPLICIT;
|
||||
with_sum_func= with_sum_func || args[0]->with_sum_func;
|
||||
used_tables_cache=args[0]->used_tables();
|
||||
@@ -2227,7 +2245,7 @@ bool Item_func_set_collation::eq(const Item *item, bool binary_cmp) const
|
||||
func_name() != item_func->func_name())
|
||||
return 0;
|
||||
Item_func_set_collation *item_func_sc=(Item_func_set_collation*) item;
|
||||
if (set_collation != item_func_sc->set_collation)
|
||||
if (charset() != item_func_sc->charset())
|
||||
return 0;
|
||||
for (uint i=0; i < arg_count ; i++)
|
||||
if (!args[i]->eq(item_func_sc->args[i], binary_cmp))
|
||||
|
@@ -581,12 +581,10 @@ public:
|
||||
|
||||
class Item_func_set_collation :public Item_str_func
|
||||
{
|
||||
CHARSET_INFO *set_collation;
|
||||
public:
|
||||
Item_func_set_collation(Item *a, CHARSET_INFO *cs) :Item_str_func(a)
|
||||
{ set_collation=cs; }
|
||||
bool fix_fields(THD *thd,struct st_table_list *tables, Item **ref);
|
||||
Item_func_set_collation(Item *a, Item *b) :Item_str_func(a,b) {};
|
||||
String *val_str(String *);
|
||||
bool fix_fields(THD *thd,struct st_table_list *tables, Item **ref);
|
||||
void fix_length_and_dec()
|
||||
{ max_length = args[0]->max_length; }
|
||||
bool eq(const Item *item, bool binary_cmp) const;
|
||||
|
@@ -183,12 +183,17 @@ Item_sum_hybrid::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
|
||||
return 1;
|
||||
hybrid_type=item->result_type();
|
||||
if (hybrid_type == INT_RESULT)
|
||||
max_length=20;
|
||||
else if (hybrid_type == REAL_RESULT)
|
||||
max_length=float_length(decimals);
|
||||
else
|
||||
{
|
||||
str_cmp_function= item->binary() ? stringcmp : sortcmp;
|
||||
cmp_charset= &my_charset_bin;
|
||||
max_length=20;
|
||||
}
|
||||
else if (hybrid_type == REAL_RESULT)
|
||||
{
|
||||
cmp_charset= &my_charset_bin;
|
||||
max_length=float_length(decimals);
|
||||
}else
|
||||
{
|
||||
cmp_charset= item->charset();
|
||||
max_length=item->max_length;
|
||||
}
|
||||
decimals=item->decimals;
|
||||
@@ -440,7 +445,7 @@ bool Item_sum_min::add()
|
||||
{
|
||||
String *result=args[0]->val_str(&tmp_value);
|
||||
if (!args[0]->null_value &&
|
||||
(null_value || (*str_cmp_function)(&value,result) > 0))
|
||||
(null_value || sortcmp(&value,result,cmp_charset) > 0))
|
||||
{
|
||||
value.copy(*result);
|
||||
null_value=0;
|
||||
@@ -487,7 +492,7 @@ bool Item_sum_max::add()
|
||||
{
|
||||
String *result=args[0]->val_str(&tmp_value);
|
||||
if (!args[0]->null_value &&
|
||||
(null_value || (*str_cmp_function)(&value,result) < 0))
|
||||
(null_value || sortcmp(&value,result,cmp_charset) < 0))
|
||||
{
|
||||
value.copy(*result);
|
||||
null_value=0;
|
||||
@@ -762,7 +767,7 @@ Item_sum_hybrid::min_max_update_str_field(int offset)
|
||||
result_field->ptr-=offset;
|
||||
|
||||
if (result_field->is_null() ||
|
||||
(cmp_sign * (*str_cmp_function)(res_str,&tmp_value)) < 0)
|
||||
(cmp_sign * sortcmp(res_str,&tmp_value,cmp_charset)) < 0)
|
||||
result_field->store(res_str->ptr(),res_str->length(),res_str->charset());
|
||||
else
|
||||
{ // Use old value
|
||||
|
@@ -369,17 +369,19 @@ class Item_sum_hybrid :public Item_sum
|
||||
enum_field_types hybrid_field_type;
|
||||
int cmp_sign;
|
||||
table_map used_table_cache;
|
||||
int (*str_cmp_function)(const String *x,const String *y);
|
||||
CHARSET_INFO *cmp_charset;
|
||||
|
||||
public:
|
||||
Item_sum_hybrid(Item *item_par,int sign)
|
||||
:Item_sum(item_par), hybrid_type(INT_RESULT), cmp_sign(sign),
|
||||
used_table_cache(~(table_map) 0)
|
||||
used_table_cache(~(table_map) 0),
|
||||
cmp_charset(&my_charset_bin)
|
||||
{}
|
||||
Item_sum_hybrid(THD *thd, Item_sum_hybrid &item):
|
||||
Item_sum(thd, item), value(item.value), tmp_value(item.tmp_value),
|
||||
sum(item.sum), sum_int(item.sum_int), hybrid_type(item.hybrid_type),
|
||||
cmp_sign(item.cmp_sign), used_table_cache(used_table_cache) {}
|
||||
cmp_sign(item.cmp_sign), used_table_cache(used_table_cache),
|
||||
cmp_charset(item.cmp_charset) {}
|
||||
bool fix_fields(THD *, TABLE_LIST *, Item **);
|
||||
table_map used_tables() const { return used_table_cache; }
|
||||
bool const_item() const { return !used_table_cache; }
|
||||
|
@@ -2142,10 +2142,12 @@ void User_var_log_event::print(FILE* file, bool short_form, char* last_db)
|
||||
int User_var_log_event::exec_event(struct st_relay_log_info* rli)
|
||||
{
|
||||
Item *it= 0;
|
||||
CHARSET_INFO *charset= log_cs;
|
||||
CHARSET_INFO *charset= 0;
|
||||
LEX_STRING user_var_name;
|
||||
user_var_name.str= name;
|
||||
user_var_name.length= name_len;
|
||||
double real_val;
|
||||
longlong int_val;
|
||||
|
||||
if (type != ROW_RESULT)
|
||||
init_sql_alloc(&thd->mem_root, 8192,0);
|
||||
@@ -2158,12 +2160,16 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli)
|
||||
{
|
||||
switch (type) {
|
||||
case REAL_RESULT:
|
||||
double real_val;
|
||||
float8get(real_val, val);
|
||||
it= new Item_real(real_val);
|
||||
val= (char*) &real_val; // Pointer to value in native format
|
||||
val_len= sizeof(real_val);
|
||||
break;
|
||||
case INT_RESULT:
|
||||
it= new Item_int((longlong) uint8korr(val));
|
||||
int_val= (longlong) uint8korr(val);
|
||||
it= new Item_int(int_val);
|
||||
val= (char*) &int_val; // Pointer to value in native format
|
||||
val_len= sizeof(int_val);
|
||||
break;
|
||||
case STRING_RESULT:
|
||||
it= new Item_string(val, val_len, charset);
|
||||
|
@@ -583,7 +583,7 @@ public:
|
||||
~Intvar_log_event() {}
|
||||
Log_event_type get_type_code() { return INTVAR_EVENT;}
|
||||
const char* get_var_type_name();
|
||||
int get_data_size() { return sizeof(type) + sizeof(val);}
|
||||
int get_data_size() { return 9; /* sizeof(type) + sizeof(val) */;}
|
||||
int write_data(IO_CACHE* file);
|
||||
bool is_valid() { return 1; }
|
||||
};
|
||||
@@ -616,7 +616,7 @@ class Rand_log_event: public Log_event
|
||||
Rand_log_event(const char* buf, bool old_format);
|
||||
~Rand_log_event() {}
|
||||
Log_event_type get_type_code() { return RAND_EVENT;}
|
||||
int get_data_size() { return sizeof(ulonglong) * 2; }
|
||||
int get_data_size() { return 16; /* sizeof(ulonglong) * 2*/ }
|
||||
int write_data(IO_CACHE* file);
|
||||
bool is_valid() { return 1; }
|
||||
};
|
||||
|
@@ -494,6 +494,7 @@ static void start_signal_handler(void);
|
||||
extern "C" pthread_handler_decl(signal_hand, arg);
|
||||
static void set_options(void);
|
||||
static void get_options(int argc,char **argv);
|
||||
static int init_thread_environment();
|
||||
static char *get_relative_path(const char *path);
|
||||
static void fix_paths(void);
|
||||
extern "C" pthread_handler_decl(handle_connections_sockets,arg);
|
||||
@@ -504,11 +505,9 @@ static bool read_init_file(char *file_name);
|
||||
#ifdef __NT__
|
||||
extern "C" pthread_handler_decl(handle_connections_namedpipes,arg);
|
||||
#endif
|
||||
#if !defined(EMBEDDED_LIBRARY)
|
||||
#ifdef HAVE_SMEM
|
||||
static pthread_handler_decl(handle_connections_shared_memory,arg);
|
||||
#endif
|
||||
#endif /* EMBEDDED_LIBRARY */
|
||||
extern "C" pthread_handler_decl(handle_slave,arg);
|
||||
#ifdef SET_RLIMIT_NOFILE
|
||||
static uint set_maximum_open_files(uint max_file_limit);
|
||||
@@ -2033,6 +2032,8 @@ static int init_common_variables(const char *conf_file_name, int argc,
|
||||
defaults_argv=argv;
|
||||
set_options();
|
||||
get_options(argc,argv);
|
||||
if (init_thread_environment())
|
||||
return 1;
|
||||
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,
|
||||
@@ -2300,7 +2301,6 @@ static void handle_connections_methods()
|
||||
handler_count--;
|
||||
}
|
||||
}
|
||||
#if !defined(EMBEDDED_LIBRARY)
|
||||
#ifdef HAVE_SMEM
|
||||
if (opt_enable_shared_memory)
|
||||
{
|
||||
@@ -2313,7 +2313,6 @@ static void handle_connections_methods()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // EMBEDDED_LIBRARY
|
||||
|
||||
while (handler_count > 0)
|
||||
pthread_cond_wait(&COND_handler_count,&LOCK_thread_count);
|
||||
@@ -2349,8 +2348,6 @@ int main(int argc, char **argv)
|
||||
init_signals();
|
||||
if (!(opt_specialflag & SPECIAL_NO_PRIOR))
|
||||
my_pthread_setprio(pthread_self(),CONNECT_PRIOR);
|
||||
if (init_thread_environment())
|
||||
unireg_abort(1);
|
||||
pthread_attr_setstacksize(&connection_attrib,thread_stack);
|
||||
#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
|
||||
{
|
||||
@@ -2683,6 +2680,7 @@ static int bootstrap(FILE *file)
|
||||
int error= 0;
|
||||
DBUG_ENTER("bootstrap");
|
||||
#ifndef EMBEDDED_LIBRARY // TODO: Enable this
|
||||
|
||||
THD *thd= new THD;
|
||||
thd->bootstrap=1;
|
||||
thd->client_capabilities=0;
|
||||
|
@@ -1194,7 +1194,7 @@ bool sys_var_thd_client_charset::check(THD *thd, set_var *var)
|
||||
if (!(res=var->value->val_str(&str)))
|
||||
res= &empty_string;
|
||||
|
||||
if (!(tmp=get_charset_by_csname(res->c_ptr(),MYF(0))))
|
||||
if (!(tmp=get_charset_by_csname(res->c_ptr(),MY_CS_PRIMARY,MYF(0))))
|
||||
{
|
||||
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), res->c_ptr());
|
||||
return 1;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version='1.0' encoding="utf-8"?>
|
||||
|
||||
<charsets max-id=63>
|
||||
<charsets max-id="82">
|
||||
|
||||
<description>
|
||||
This file lists all of the available character sets.
|
||||
@@ -16,7 +16,10 @@ To make maintaining easier please:
|
||||
<alias>big-five</alias>
|
||||
<alias>cn-big5</alias>
|
||||
<alias>csbig5</alias>
|
||||
<collation name="big5" id="1" order="Chinese" flag="primary" flag="compiled"/>
|
||||
<collation name="big5" id="1" order="Chinese">
|
||||
<flag>primary</flag>
|
||||
<flag>compiled"</flag>
|
||||
</collation>
|
||||
</charset>
|
||||
|
||||
<charset name="latin2">
|
||||
@@ -39,10 +42,12 @@ To make maintaining easier please:
|
||||
</collation>
|
||||
<collation name="hungarian" id="21" order="Hungarian"/>
|
||||
<collation name="croat" id="27" order="Croatian"/>
|
||||
<collation name="latin2_bin" id="77" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="dec8">
|
||||
<family>Western</family>
|
||||
<collation name="dec_bin" id="69" order="Binary" flag="binary"/>
|
||||
<collation name="dec8" id="3" flag="primary">
|
||||
<order>Dutch</order>
|
||||
<order>English</order>
|
||||
@@ -71,6 +76,7 @@ To make maintaining easier please:
|
||||
<order>Pogtuguese</order>
|
||||
<order>Spanish</order>
|
||||
</collation>
|
||||
<collation name="pclatin1_bin" id="80" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="latin1">
|
||||
@@ -86,7 +92,7 @@ To make maintaining easier please:
|
||||
<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_bin" id="47" order="Binary" flag="binary"/>
|
||||
<collation name="latin1_ci_as" id="48">
|
||||
<order>Dutch</order>
|
||||
<order>English</order>
|
||||
@@ -112,6 +118,7 @@ To make maintaining easier please:
|
||||
<charset name="hp8">
|
||||
<family>Western</family>
|
||||
<alias>hproman8</alias>
|
||||
<collation name="hp8_bin" id="72" order="Binary" flag="binary"/>
|
||||
<collation name="hp8" id="6" flag="primary">
|
||||
<order>Dutch</order>
|
||||
<order>English</order>
|
||||
@@ -129,12 +136,14 @@ To make maintaining easier please:
|
||||
<alias>koi8-r</alias>
|
||||
<alias>cskoi8r</alias>
|
||||
<collation name="koi8r" id="7" order="Russian" flag="primary"/>
|
||||
<collation name="koi8r_bin" id="74" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="swe7">
|
||||
<family>Western</family>
|
||||
<alias>iso-646-se</alias>
|
||||
<collation name="swe7" id="10" order="Swedish" flag="primary"/>
|
||||
<collation name="swe7_bin" id="82" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="ascii">
|
||||
@@ -145,6 +154,7 @@ To make maintaining easier please:
|
||||
<alias>iso-ir-6</alias>
|
||||
<alias>iso646-us</alias>
|
||||
<collation name="ascii" id="11" order="English" flag="primary"/>
|
||||
<collation name="ascii_bin" id="65" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="ujis">
|
||||
@@ -175,8 +185,8 @@ To make maintaining easier please:
|
||||
<order>Mongolian</order>
|
||||
<order>Ukrainian</order>
|
||||
</collation>
|
||||
<collation name="win1251ukr" id="23" order="<Depreciated>"/>
|
||||
<collation name="cp1251_bin" id="50" order="Binary"/>
|
||||
<collation name="win1251ukr" id="23" order="Depreciated"/>
|
||||
<collation name="cp1251_bin" id="50" order="Binary" flag="binary"/>
|
||||
<collation name="cp1251_ci_as" id="51">
|
||||
<order>Belarusian</order>
|
||||
<order>Bulgarian</order>
|
||||
@@ -203,19 +213,26 @@ To make maintaining easier please:
|
||||
<alias>iso-8859-8</alias>
|
||||
<alias>iso-ir-138</alias>
|
||||
<collation name="hebrew" id="16" order="Hebrew" flag="primary"/>
|
||||
<collation name="hebrew_bin" id="71" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="tis620">
|
||||
<family>Thai</family>
|
||||
<alias>tis-620</alias>
|
||||
<collation name="tis620" id="18" order="Thai" flag="primary" flag="compiled"/>
|
||||
<collation name="tis620" id="18" order="Thai">
|
||||
<flag>primary</flag>
|
||||
<flag>compiled</flag>
|
||||
</collation>
|
||||
</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"/>
|
||||
<collation name="euckr" id="19" order="Korean">
|
||||
<flag>primary</flag>
|
||||
<flag>compiled"</flag>
|
||||
</collation>
|
||||
</charset>
|
||||
|
||||
<charset name="latin7">
|
||||
@@ -226,19 +243,24 @@ To make maintaining easier please:
|
||||
<collation name="estonia" id="20" order="Estonian" flag="primary"/>
|
||||
<collation name="latvian" id="41" order="Latvian"/>
|
||||
<collation name="latvian1" id="42" order="Latvian"/>
|
||||
<collation name="latin7_bin" id="79" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="koi8u">
|
||||
<family>Cyrillic</family>
|
||||
<alias>koi8-u</alias>
|
||||
<collation name="koi8u" id="22" order="Ukranian" flag="primary"/>
|
||||
<collation name="koi8u_bin" id="75" order="Binary" flag="binary"/>
|
||||
</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"/>
|
||||
<collation name="gb2312" id="24" order="Chinese">
|
||||
<flag>primary</flag>
|
||||
<flag>compiled"</flag>
|
||||
</collation>
|
||||
</charset>
|
||||
|
||||
<charset name="greek">
|
||||
@@ -249,6 +271,7 @@ To make maintaining easier please:
|
||||
<alias>iso-8859-7</alias>
|
||||
<alias>iso-ir-126</alias>
|
||||
<collation name="greek" id="25" order="Greek" flag="primary"/>
|
||||
<collation name="greek_bin" id="70" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="cp1250">
|
||||
@@ -265,20 +288,24 @@ To make maintaining easier please:
|
||||
<order>Sorbian</order>
|
||||
</collation>
|
||||
<collation name="cp1250_czech" id="34" order="Czech"/>
|
||||
<collation name="cp1250_bin" id="66" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="gbk">
|
||||
<family>East Asian</family>
|
||||
<alias>cp936</alias>
|
||||
<collation name="gbk" id="28" order="Chinese" flag="primary" flag="compiled"/>
|
||||
<collation name="gbk" id="28" order="Chinese">
|
||||
<flag>primary</flag>
|
||||
<flag>compiled</flag>
|
||||
</collation>
|
||||
</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" id="29" order="Depreciated"/>
|
||||
<collation name="cp1257_bin" id="58" order="Binary" flag="binary"/>
|
||||
<collation name="cp1257_ci_ai" id="59" flag="primary">
|
||||
<order>Latvian</order>
|
||||
<order>Lithuanian</order>
|
||||
@@ -302,12 +329,14 @@ To make maintaining easier please:
|
||||
<alias>latin5</alias>
|
||||
<alias>turkish</alias>
|
||||
<collation name="latin5" id="30" order="Turkish" flag="primary"/>
|
||||
<collation name="latin5_bin" id="78" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="armscii8">
|
||||
<family>South Asian</family>
|
||||
<alias>armscii-8</alias>
|
||||
<collation name="armscii8" id="32" order="Armenian" flag="primary"/>
|
||||
<collation name="armscii_bin" id="64" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="utf8">
|
||||
@@ -328,11 +357,13 @@ To make maintaining easier please:
|
||||
<alias>ibm866</alias>
|
||||
<alias>DOSCyrillicRussian</alias>
|
||||
<collation name="cp866" id="36" order="Russian" flag="primary"/>
|
||||
<collation name="cp866_bin" id="68" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="keybcs2">
|
||||
<family>Central European</family>
|
||||
<collation name="keybcs2" id="37" order="Czech" flag="primary"/>
|
||||
<collation name="keybcs2_bin" id="73" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="MacCE">
|
||||
@@ -347,7 +378,7 @@ To make maintaining easier please:
|
||||
<order>Slovenian</order>
|
||||
<order>Sorbian</order>
|
||||
</collation>
|
||||
<collation name="macce_bin" id="43" order="Binary"/>
|
||||
<collation name="macce_bin" id="43" order="Binary" flag="binary"/>
|
||||
<collation name="macce_ci_ai" id="44">
|
||||
<order>Hungarian</order>
|
||||
<order>Polish</order>
|
||||
@@ -392,7 +423,7 @@ To make maintaining easier please:
|
||||
<order>Pogtuguese</order>
|
||||
<order>Spanish</order>
|
||||
</collation>
|
||||
<collation name="macroman_bin" id="53" order="Binary"/>
|
||||
<collation name="macroman_bin" id="53" order="Binary" flag="binary"/>
|
||||
<collation name="macroman_ci_as" id="54">
|
||||
<order>Dutch</order>
|
||||
<order>English</order>
|
||||
@@ -439,12 +470,14 @@ To make maintaining easier please:
|
||||
<order>Slovenian</order>
|
||||
<order>Sorbian</order>
|
||||
</collation>
|
||||
<collation name="pclatin2_bin" id="81" order="Binary" flag="binary"/>
|
||||
</charset>
|
||||
|
||||
<charset name="cp1256">
|
||||
<family>Arabic</family>
|
||||
<alias>ms-arab</alias>
|
||||
<alias>windows-1256</alias>
|
||||
<collation name="cp1256_bin" id="67" order="Binary" flag="binary"/>
|
||||
<collation name="cp1256" id="57" order="Arabic" flag="primary">
|
||||
<order>Arabic</order>
|
||||
<order>Persian</order>
|
||||
@@ -454,7 +487,11 @@ To make maintaining easier please:
|
||||
</charset>
|
||||
|
||||
<charset name="binary">
|
||||
<collation name="binary" id="63" order="Binary" flag="primary" flag="compiled"/>
|
||||
<collation name="binary" id="63" order="Binary">
|
||||
<flag>primary</flag>
|
||||
<flag>compiled</flag>
|
||||
</collation>
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
||||
|
@@ -115,27 +115,7 @@
|
||||
</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_bin" flag="binary"/>
|
||||
|
||||
<collation name="macce_ci_ai">
|
||||
<map>
|
||||
|
@@ -111,26 +111,7 @@
|
||||
</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_bin" flag="binary"/>
|
||||
|
||||
<collation name="macroman_ci_ai">
|
||||
<map>
|
||||
|
@@ -114,6 +114,8 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="armscii_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -114,6 +114,8 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="ascii_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -116,6 +116,8 @@
|
||||
|
||||
<collation name="cp1250_czech"/>
|
||||
|
||||
<collation name="cp1250_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -116,26 +116,7 @@
|
||||
</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_bin" flag="binary"/>
|
||||
|
||||
|
||||
<collation name="cp1251_ci_as">
|
||||
|
@@ -116,6 +116,7 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="cp1256_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
|
@@ -115,26 +115,7 @@
|
||||
</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_bin" flag="binary"/>
|
||||
|
||||
|
||||
<collation name="cp1257_ci_ai">
|
||||
|
@@ -116,6 +116,8 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="cp866_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -114,6 +114,7 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="dec_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
|
@@ -114,6 +114,8 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="greek_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -114,6 +114,8 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="hebrew_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -115,6 +115,8 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="hp8_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -114,6 +114,8 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="keybcs2_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -114,6 +114,8 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="koi8r_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -114,6 +114,8 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="koi8u_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -162,26 +162,7 @@
|
||||
<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_bin" flag="binary"/>
|
||||
|
||||
|
||||
<collation name="latin1_ci_as">
|
||||
|
@@ -161,6 +161,7 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="latin2_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
|
@@ -119,6 +119,7 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="latin5_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
|
@@ -162,6 +162,7 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="latin7_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
|
@@ -114,6 +114,8 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="pclatin1_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -114,6 +114,8 @@
|
||||
</map>
|
||||
</collation>
|
||||
|
||||
<collation name="swe7_bin" flag="binary"/>
|
||||
|
||||
</charset>
|
||||
|
||||
</charsets>
|
||||
|
@@ -262,3 +262,5 @@ v/*
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -256,3 +256,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -264,3 +264,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -253,3 +253,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -258,3 +258,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -253,3 +253,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -263,3 +263,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client",
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -253,3 +253,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -255,3 +255,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -253,3 +253,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -255,3 +255,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -253,3 +253,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -255,3 +255,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -255,3 +255,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -257,3 +257,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -253,3 +253,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -257,3 +257,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -256,3 +256,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -249,3 +249,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -261,3 +261,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -254,3 +254,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -253,3 +253,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -258,3 +258,5 @@
|
||||
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
|
||||
"All parts of a SPATIAL KEY must be NOT NULL"
|
||||
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
|
||||
"The slave was already running"
|
||||
"The slave was already stopped"
|
||||
|
@@ -41,13 +41,13 @@
|
||||
int sortcmp2(void* cmp_arg __attribute__((unused)),
|
||||
const String *a,const String *b)
|
||||
{
|
||||
return sortcmp(a,b);
|
||||
return sortcmp(a,b,a->charset());
|
||||
}
|
||||
|
||||
int stringcmp2(void* cmp_arg __attribute__((unused)),
|
||||
const String *a,const String *b)
|
||||
{
|
||||
return stringcmp(a,b);
|
||||
return sortcmp(a,b,&my_charset_bin);
|
||||
}
|
||||
|
||||
int compare_double2(void* cmp_arg __attribute__((unused)),
|
||||
@@ -329,20 +329,10 @@ void field_str::add()
|
||||
if (length > max_length)
|
||||
max_length = length;
|
||||
|
||||
if (item->binary())
|
||||
{
|
||||
if (stringcmp(res, &min_arg) < 0)
|
||||
min_arg.copy(*res);
|
||||
if (stringcmp(res, &max_arg) > 0)
|
||||
max_arg.copy(*res);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sortcmp(res, &min_arg) < 0)
|
||||
min_arg.copy(*res);
|
||||
if (sortcmp(res, &max_arg) > 0)
|
||||
max_arg.copy(*res);
|
||||
}
|
||||
if (sortcmp(res, &min_arg,item->charset()) < 0)
|
||||
min_arg.copy(*res);
|
||||
if (sortcmp(res, &max_arg,item->charset()) > 0)
|
||||
max_arg.copy(*res);
|
||||
}
|
||||
|
||||
if (room_in_tree)
|
||||
|
@@ -578,7 +578,8 @@ int yylex(void *arg, void *yythd)
|
||||
*/
|
||||
|
||||
if ((yylval->lex_str.str[0]=='_') &&
|
||||
(lex->charset=get_charset_by_csname(yylval->lex_str.str+1,MYF(0))))
|
||||
(lex->charset=get_charset_by_csname(yylval->lex_str.str+1,
|
||||
MY_CS_PRIMARY,MYF(0))))
|
||||
return(UNDERSCORE_CHARSET);
|
||||
else
|
||||
return(IDENT);
|
||||
|
@@ -1059,9 +1059,6 @@ bool do_command(THD *thd)
|
||||
bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
char* packet, uint packet_length)
|
||||
{
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
int res;
|
||||
#endif
|
||||
NET *net= &thd->net;
|
||||
bool error= 0;
|
||||
/*
|
||||
@@ -1138,7 +1135,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
char tmp_db[NAME_LEN+1];
|
||||
ACL_USER* cached_user ; /* Cached user */
|
||||
uint cur_priv_version; /* Cached grant version */
|
||||
ulong pkt_len=0; /* Length of reply packet */
|
||||
int res;
|
||||
ulong pkt_len= 0; /* Length of reply packet */
|
||||
|
||||
bzero((char*) prepared_scramble, sizeof(prepared_scramble));
|
||||
/* Small check for incomming packet */
|
||||
|
@@ -622,7 +622,7 @@ Increase max_allowed_packet on master";
|
||||
|
||||
int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
|
||||
{
|
||||
int slave_errno = 0;
|
||||
int slave_errno;
|
||||
if (!thd)
|
||||
thd = current_thd;
|
||||
int thread_mask;
|
||||
@@ -631,10 +631,17 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
|
||||
if (check_access(thd, SUPER_ACL, any_db))
|
||||
DBUG_RETURN(1);
|
||||
lock_slave_threads(mi); // this allows us to cleanly read slave_running
|
||||
// Get a mask of _stopped_ threads
|
||||
init_thread_mask(&thread_mask,mi,1 /* inverse */);
|
||||
/*
|
||||
Below we will start all stopped threads.
|
||||
But if the user wants to start only one thread, do as if the other thread
|
||||
was running (as we don't wan't to touch the other thread), so set the
|
||||
bit to 0 for the other thread
|
||||
*/
|
||||
if (thd->lex.slave_thd_opt)
|
||||
thread_mask &= thd->lex.slave_thd_opt;
|
||||
if (thread_mask)
|
||||
if (thread_mask) //some threads are stopped, start them
|
||||
{
|
||||
if (init_master_info(mi,master_info_file,relay_log_info_file, 0))
|
||||
slave_errno=ER_MASTER_INFO;
|
||||
@@ -648,7 +655,12 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
|
||||
slave_errno = ER_BAD_SLAVE;
|
||||
}
|
||||
else
|
||||
slave_errno = ER_SLAVE_MUST_STOP;
|
||||
{
|
||||
//no error if all threads are already started, only a warning
|
||||
slave_errno= 0;
|
||||
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_SLAVE_WAS_RUNNING,
|
||||
ER(ER_SLAVE_WAS_RUNNING));
|
||||
}
|
||||
|
||||
unlock_slave_threads(mi);
|
||||
|
||||
@@ -667,7 +679,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
|
||||
|
||||
int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
|
||||
{
|
||||
int slave_errno = 0;
|
||||
int slave_errno;
|
||||
if (!thd)
|
||||
thd = current_thd;
|
||||
|
||||
@@ -676,12 +688,29 @@ int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
|
||||
thd->proc_info = "Killing slave";
|
||||
int thread_mask;
|
||||
lock_slave_threads(mi);
|
||||
// Get a mask of _running_ threads
|
||||
init_thread_mask(&thread_mask,mi,0 /* not inverse*/);
|
||||
/*
|
||||
Below we will stop all running threads.
|
||||
But if the user wants to stop only one thread, do as if the other thread
|
||||
was stopped (as we don't wan't to touch the other thread), so set the
|
||||
bit to 0 for the other thread
|
||||
*/
|
||||
if (thd->lex.slave_thd_opt)
|
||||
thread_mask &= thd->lex.slave_thd_opt;
|
||||
slave_errno = (thread_mask) ?
|
||||
terminate_slave_threads(mi,thread_mask,
|
||||
1 /*skip lock */) : ER_SLAVE_NOT_RUNNING;
|
||||
|
||||
if (thread_mask)
|
||||
{
|
||||
slave_errno= terminate_slave_threads(mi,thread_mask,
|
||||
1 /*skip lock */);
|
||||
}
|
||||
else
|
||||
{
|
||||
//no error if both threads are already stopped, only a warning
|
||||
slave_errno= 0;
|
||||
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_SLAVE_WAS_NOT_RUNNING,
|
||||
ER(ER_SLAVE_WAS_NOT_RUNNING));
|
||||
}
|
||||
unlock_slave_threads(mi);
|
||||
thd->proc_info = 0;
|
||||
|
||||
|
@@ -1074,7 +1074,7 @@ store_create_info(THD *thd, TABLE *table, String *packet)
|
||||
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) &&
|
||||
if (!(field->charset()->state & MY_CS_PRIMARY) &&
|
||||
!limited_mysql_mode && !foreign_db_mode)
|
||||
{
|
||||
packet->append(" collate ", 9);
|
||||
|
@@ -538,30 +538,14 @@ void String::qs_append(const char &c)
|
||||
}
|
||||
|
||||
|
||||
int sortcmp(const String *x,const String *y)
|
||||
int sortcmp(const String *x,const String *y, CHARSET_INFO *cs)
|
||||
{
|
||||
CHARSET_INFO *cs= x->str_charset;
|
||||
return cs->strnncollsp(cs,
|
||||
(unsigned char *) x->ptr(),x->length(),
|
||||
(unsigned char *) y->ptr(),y->length());
|
||||
}
|
||||
|
||||
|
||||
int stringcmp(const String *x,const String *y)
|
||||
{
|
||||
const char *s= x->ptr();
|
||||
const char *t= y->ptr();
|
||||
uint32 x_len=x->length(),y_len=y->length(),len=min(x_len,y_len);
|
||||
|
||||
while (len--)
|
||||
{
|
||||
if (*s++ != *t++)
|
||||
return ((int) (uchar) s[-1] - (int) (uchar) t[-1]);
|
||||
}
|
||||
return (int) (x_len-y_len);
|
||||
}
|
||||
|
||||
|
||||
String *copy_if_not_alloced(String *to,String *from,uint32 from_length)
|
||||
{
|
||||
if (from->Alloced_length >= from_length)
|
||||
|
@@ -25,8 +25,7 @@
|
||||
#endif
|
||||
|
||||
class String;
|
||||
int sortcmp(const String *a,const String *b);
|
||||
int stringcmp(const String *a,const String *b);
|
||||
int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
|
||||
String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
|
||||
|
||||
class String
|
||||
@@ -205,8 +204,7 @@ public:
|
||||
void strip_sp();
|
||||
inline void caseup() { my_caseup(str_charset,Ptr,str_length); }
|
||||
inline void casedn() { my_casedn(str_charset,Ptr,str_length); }
|
||||
friend int sortcmp(const String *a,const String *b);
|
||||
friend int stringcmp(const String *a,const String *b);
|
||||
friend int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
|
||||
friend String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
|
||||
uint32 numchars();
|
||||
int charpos(int i,uint32 offset=0);
|
||||
|
@@ -1304,7 +1304,7 @@ attribute:
|
||||
charset_name:
|
||||
ident
|
||||
{
|
||||
if (!($$=get_charset_by_csname($1.str,MYF(0))))
|
||||
if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))))
|
||||
{
|
||||
net_printf(YYTHD,ER_UNKNOWN_CHARACTER_SET,$1.str);
|
||||
YYABORT;
|
||||
@@ -1989,8 +1989,12 @@ expr_expr:
|
||||
{ $$= new Item_date_add_interval($1,$3,$4,0); }
|
||||
| expr '-' interval_expr interval
|
||||
{ $$= new Item_date_add_interval($1,$3,$4,1); }
|
||||
| expr COLLATE_SYM collation_name
|
||||
{ $$= new Item_func_set_collation($1,$3); };
|
||||
| expr COLLATE_SYM ident
|
||||
{
|
||||
$$= new Item_func_set_collation($1,new Item_string($3.str,$3.length,
|
||||
YYTHD->variables.thd_charset));
|
||||
}
|
||||
;
|
||||
|
||||
/* expressions that begin with 'expr' that do NOT follow IN_SYM */
|
||||
no_in_expr:
|
||||
@@ -2142,7 +2146,11 @@ simple_expr:
|
||||
{ Select->add_ftfunc_to_list((Item_func_match *)
|
||||
($$=new Item_func_match_bool(*$2,$5))); }
|
||||
| ASCII_SYM '(' expr ')' { $$= new Item_func_ascii($3); }
|
||||
| BINARY expr %prec NEG { $$= new Item_func_set_collation($2,&my_charset_bin); }
|
||||
| BINARY expr %prec NEG
|
||||
{
|
||||
$$= new Item_func_set_collation($2,new Item_string("BINARY",6,
|
||||
&my_charset_latin1));
|
||||
}
|
||||
| CAST_SYM '(' expr AS cast_type ')' { $$= create_func_cast($3, $5); }
|
||||
| CASE_SYM opt_expr WHEN_SYM when_list opt_else END
|
||||
{ $$= new Item_func_case(* $4, $2, $5 ); }
|
||||
|
@@ -201,6 +201,8 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, uint len)
|
||||
case _CS_FLAG:
|
||||
if (!strncmp("primary",attr,len))
|
||||
i->cs.state|= MY_CS_PRIMARY;
|
||||
else if (!strncmp("binary",attr,len))
|
||||
i->cs.state|= MY_CS_BINSORT;
|
||||
break;
|
||||
case _CS_UPPERMAP:
|
||||
fill_uchar(i->to_upper,MY_CS_TO_UPPER_TABLE_SIZE,attr,len);
|
||||
|
Reference in New Issue
Block a user