merge
BitKeeper/etc/logging_ok: auto-union BUILD/compile-alpha-cxx: Auto merged BUILD/compile-alpha-debug: Auto merged configure.in: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged
This commit is contained in:
commit
024e1d1bce
@ -1110,3 +1110,8 @@ VC++Files/client/mysql_amd64.dsp
|
||||
client/mysqltestmanager-pwgen
|
||||
client/mysqltestmanagerc
|
||||
tools/mysqltestmanager
|
||||
config.guess
|
||||
config.sub
|
||||
install-sh
|
||||
ltmain.sh
|
||||
missing
|
||||
|
@ -7,17 +7,8 @@ commands="\
|
||||
$make -k distclean || true
|
||||
/bin/rm -rf */.deps/*.P config.cache storage/innobase/config.cache storage/bdb/build_unix/config.cache bdb/dist/autom4te.cache autom4te.cache innobase/autom4te.cache;
|
||||
|
||||
aclocal || (echo \"Can't execute aclocal\" && exit 1)
|
||||
autoheader || (echo \"Can't execute autoheader\" && exit 1)
|
||||
aclocal || (echo \"Can't execute aclocal\" && exit 1)
|
||||
automake || (echo \"Can't execute automake\" && exit 1)
|
||||
autoconf || (echo \"Can't execute autoconf\" && exit 1)
|
||||
(cd storage/bdb/dist && sh s_all)
|
||||
(cd storage/innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
if [ -d gemini ]
|
||||
then
|
||||
(cd gemini && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
fi"
|
||||
path=`dirname $0`
|
||||
. \"$path/autorun.sh\""
|
||||
|
||||
if [ -z "$just_clean" ]
|
||||
then
|
||||
|
15
BUILD/autorun.sh
Executable file
15
BUILD/autorun.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# Create MySQL autotools infrastructure
|
||||
|
||||
aclocal || (echo "Can't execute aclocal" && exit 1)
|
||||
autoheader || (echo "Can't execute autoheader" && exit 1)
|
||||
# --force means overwrite ltmain.sh script if it already exists
|
||||
libtoolize --automake --force \
|
||||
|| (echo "Can't execute libtoolize" && exit 1)
|
||||
# --add-missing instructs automake to install missing auxiliary files
|
||||
# and --force to overwrite them if they already exist
|
||||
automake --add-missing --force \
|
||||
|| (echo "Can't execute automake" && exit 1)
|
||||
autoconf || (echo "Can't execute autoconf" && exit 1)
|
||||
(cd bdb/dist && sh s_all)
|
||||
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
@ -2,7 +2,9 @@
|
||||
make -k clean
|
||||
/bin/rm -f */.deps/*.P */*.o
|
||||
/bin/rm -f config.cache mysql-*.tar.gz
|
||||
aclocal; autoheader; aclocal; automake; autoconf
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CC=ccc CFLAGS="-fast -O3 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mcpu=ev6 -Wa,-mev6" CXXLDFLAGS='/usr/lib/compaq/libots-2.2.7/libots.so /usr/lib/compaq/cpml-5.0.0/libcpml_ev6.a' ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-thread-safe-client
|
||||
make
|
||||
|
@ -2,7 +2,9 @@
|
||||
make -k clean
|
||||
/bin/rm -f */.deps/*.P */*.o
|
||||
/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache storage/bdb/build_unix/config.cache mysql-*.tar.gz
|
||||
aclocal; autoheader; aclocal; automake; autoconf
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CC=ccc CFLAGS="-fast" CXX=cxx CXXFLAGS="-fast -noexceptions -nortti" ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-non_shared --with-client-ldflags=-non_shared --without-extra-tools --disable-dependency-tracking
|
||||
|
||||
|
@ -2,7 +2,9 @@
|
||||
make -k clean
|
||||
/bin/rm -f */.deps/*.P */*.o
|
||||
/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache storage/bdb/build_unix/config.cache mysql-*.tar.gz
|
||||
aclocal; autoheader; aclocal; automake; autoconf
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CFLAGS=-O1 CC=gcc CXX=gcc CXXFLAGS="-O1 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-debug --with-extra-charsets=complex --without-extra-tools
|
||||
make
|
||||
|
@ -62,14 +62,9 @@ done
|
||||
|
||||
set -x
|
||||
make distclean
|
||||
aclocal
|
||||
autoheader
|
||||
libtoolize --automake --force
|
||||
automake --force --add-missing
|
||||
autoconf
|
||||
|
||||
(cd storage/bdb/dist && sh s_all)
|
||||
(cd storage/innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CC=cc CXX=aCC CFLAGS="$cflags" CXXFLAGS="$cxxflags" \
|
||||
./configure --prefix=/usr/local/mysql --disable-shared \
|
||||
|
@ -1,13 +1,8 @@
|
||||
gmake -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache storage/bdb/build_unix/config.cache
|
||||
|
||||
aclocal && autoheader && aclocal && automake && autoconf
|
||||
(cd storage/bdb/dist && sh s_all)
|
||||
(cd storage/innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
if [ -d gemini ]
|
||||
then
|
||||
(cd gemini && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
fi
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CC=ecc CFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" CXX=ecc CXXFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-debug --with-innodb --with-embedded-server --with-archive-storage-engine
|
||||
gmake
|
||||
|
@ -34,14 +34,9 @@ fi
|
||||
|
||||
set -x
|
||||
make distclean
|
||||
aclocal
|
||||
autoheader
|
||||
libtoolize --automake --force
|
||||
automake --force --add-missing
|
||||
autoconf
|
||||
|
||||
(cd storage/bdb/dist && sh s_all)
|
||||
(cd storage/innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
# C options:
|
||||
# -apo - auto-parallize for multiprocessors (implies -mp)
|
||||
|
37
BUILD/compile-pentium-icc
Executable file
37
BUILD/compile-pentium-icc
Executable file
@ -0,0 +1,37 @@
|
||||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
# Note that we can't use ccache with icc as the generated .deps file will
|
||||
# then contain wrong information
|
||||
CC=icc
|
||||
CXX=icpc
|
||||
CXXLD="$CXX -static-libcxa"
|
||||
export CC CXX
|
||||
|
||||
|
||||
extra_flags="$pentium_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
|
||||
|
||||
# Disable following warnings as these are generated by header files:
|
||||
# 161 unrecognized pragma
|
||||
# 444 destructor for base class xxx is not virtual
|
||||
# 279 controlling expression is constant
|
||||
# 810 conversion from ulonglong to ulong with cast
|
||||
# 981 operands are evaluated in unspecified order
|
||||
# 1292 warning for unknown 'attribute' options
|
||||
# 1469 "xxx" clobber ignored
|
||||
# 1572 floating-point equality and inequality comparisons are unreliable
|
||||
|
||||
# In C++
|
||||
# 869 parameter "xxx" was never referenced
|
||||
# (Problem with virtual functions)
|
||||
# 874 support for placement delete is disabled
|
||||
|
||||
c_warnings=""
|
||||
cxx_warnings=""
|
||||
extra_flags="-O3 -unroll2 -ip -mp -no-gcc -restrict"
|
||||
base_cxxflags="-fno-exceptions -fno-rtti"
|
||||
extra_configs="$pentium_configs $static_link"
|
||||
|
||||
. "$path/FINISH.sh"
|
34
BUILD/compile-pentium-icc-valgrind-max
Executable file
34
BUILD/compile-pentium-icc-valgrind-max
Executable file
@ -0,0 +1,34 @@
|
||||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
# Note that we can't use ccache with icc as the generated .deps file will
|
||||
# then contain wrong information
|
||||
CC=icc
|
||||
CXX=icpc
|
||||
export CC CXX
|
||||
|
||||
extra_flags="$pentium_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
|
||||
|
||||
# Disable following warnings as these are generated by header files:
|
||||
# 161 unrecognized pragma
|
||||
# 444 destructor for base class xxx is not virtual
|
||||
# 279 controlling expression is constant
|
||||
# 810 conversion from ulonglong to ulong with cast
|
||||
# 981 operands are evaluated in unspecified order
|
||||
# 1292 warning for unknown 'attribute' options
|
||||
# 1469 "xxx" clobber ignored
|
||||
# 1572 floating-point equality and inequality comparisons are unreliable
|
||||
|
||||
# In C++
|
||||
# 869 parameter "xxx" was never referenced
|
||||
# (Problem with virtual functions)
|
||||
# 874 support for placement delete is disabled
|
||||
|
||||
c_warnings="-Wall -Wcheck -wd161,444,279,810,981,1292,1469,1572"
|
||||
cxx_warnings="$c_warnings -wd869,874"
|
||||
base_cxxflags="-fno-exceptions -fno-rtti"
|
||||
extra_configs="$pentium_configs $debug_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
@ -2,13 +2,8 @@ AM_MAKEFLAGS="-j 2"
|
||||
gmake -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
||||
aclocal && autoheader && aclocal && automake && autoconf
|
||||
(cd storage/bdb/dist && sh s_all)
|
||||
(cd storage/innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
if [ -d gemini ]
|
||||
then
|
||||
(cd gemini && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
fi
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
export PATH=/usr/local/pgcc/bin:$PATH
|
||||
CFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O6 -mpentiumpro -fomit-frame-pointer -mstack-align-double" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O6 -fomit-frame-pointer -mpentiumpro -mstack-align-double" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
|
||||
|
9
BUILD/compile-sap
Executable file
9
BUILD/compile-sap
Executable file
@ -0,0 +1,9 @@
|
||||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium_cflags"
|
||||
extra_configs="$pentium_configs --without-berkeley-db"
|
||||
|
||||
. "$path/FINISH.sh"
|
9
BUILD/compile-sap-debug
Executable file
9
BUILD/compile-sap-debug
Executable file
@ -0,0 +1,9 @@
|
||||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium_cflags $debug_cflags"
|
||||
extra_configs="$pentium_configs $debug_configs --without-berkeley-db $static_link"
|
||||
|
||||
. "$path/FINISH.sh"
|
@ -3,14 +3,9 @@
|
||||
gmake -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
||||
aclocal && autoheader && aclocal && automake && autoconf
|
||||
(cd storage/bdb/dist && sh s_all)
|
||||
(cd storage/innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
if [ -d gemini ]
|
||||
then
|
||||
(cd gemini && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
fi
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
|
||||
|
||||
gmake -j 4
|
||||
|
@ -3,13 +3,8 @@
|
||||
gmake -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
||||
aclocal && autoheader && aclocal && automake && autoconf
|
||||
(cd storage/bdb/dist && sh s_all)
|
||||
(cd storage/innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
if [ -d gemini ]
|
||||
then
|
||||
(cd gemini && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
fi
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug
|
||||
|
||||
|
@ -3,13 +3,8 @@
|
||||
gmake -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
||||
aclocal && autoheader && aclocal && automake && autoconf
|
||||
(cd storage/bdb/dist && sh s_all)
|
||||
(cd storage/innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
if [ -d gemini ]
|
||||
then
|
||||
(cd gemini && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
fi
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
|
||||
# Assume Forte is installed in /opt/SUNWSpro
|
||||
|
@ -33,9 +33,9 @@ done
|
||||
|
||||
gmake -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
aclocal && autoheader && aclocal && automake && autoconf
|
||||
(cd storage/bdb/dist && sh s_all)
|
||||
(cd storage/innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-berkeley-db --with-embedded-server --with-innodb $EXTRA_CONFIG_FLAGS
|
||||
|
||||
|
@ -246,6 +246,8 @@ salle@geopard.online.bg
|
||||
salle@vafla.home
|
||||
salle@vafla.online.bg
|
||||
sasha@mysql.sashanet.com
|
||||
schwenke@lmy003.wdf.sap.corp
|
||||
schwenke@lmy003.xl.local
|
||||
serg@build.mysql.com
|
||||
serg@build.mysql2.com
|
||||
serg@mysql.com
|
||||
|
@ -203,7 +203,9 @@ static struct my_option my_long_options[] =
|
||||
{"default-character-set", OPT_DEFAULT_CHARSET,
|
||||
"Set the default character set.", (gptr*) &default_charset,
|
||||
(gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED.",
|
||||
{"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED; "
|
||||
"currently ignored because of http://bugs.mysql.com/bug.php?id=7815 "
|
||||
"but will be re-enabled later",
|
||||
(gptr*) &opt_delayed, (gptr*) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"delete-master-logs", OPT_DELETE_MASTER_LOGS,
|
||||
@ -708,6 +710,25 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifndef REMOVE_THIS_CODE_WHEN_FIX_BUG_7815
|
||||
case (int) OPT_DELAYED:
|
||||
/*
|
||||
Because of http://bugs.mysql.com/bug.php?id=7815, we disable
|
||||
--delayed-insert; when the bug gets fixed by checking the storage engine
|
||||
(using the table definition cache) before printing INSERT DELAYED, we
|
||||
can correct the option's description and re-enable it again (scheduled
|
||||
for later 5.0 or 5.1 versions).
|
||||
It's ok to do the if() below as get_one_option is called after
|
||||
opt_delayed is set.
|
||||
*/
|
||||
if (opt_delayed)
|
||||
{
|
||||
fprintf(stderr, "Warning: ignoring --delayed-insert (as explained "
|
||||
"in the output of 'mysqldump --help').\n");
|
||||
opt_delayed= 0;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -2024,11 +2024,11 @@ my_bool end_of_query(int c)
|
||||
int read_line(char* buf, int size)
|
||||
{
|
||||
int c;
|
||||
char quote;
|
||||
char* p= buf, *buf_end= buf + size - 1;
|
||||
int no_save= 0;
|
||||
enum {R_NORMAL, R_Q1, R_ESC_Q_Q1, R_ESC_Q_Q2,
|
||||
R_ESC_SLASH_Q1, R_ESC_SLASH_Q2,
|
||||
R_Q2, R_COMMENT, R_LINE_START} state= R_LINE_START;
|
||||
enum {R_NORMAL, R_Q, R_Q_IN_Q, R_SLASH_IN_Q,
|
||||
R_COMMENT, R_LINE_START} state= R_LINE_START;
|
||||
DBUG_ENTER("read_line");
|
||||
|
||||
start_lineno= *lineno;
|
||||
@ -2063,10 +2063,11 @@ int read_line(char* buf, int size)
|
||||
*p= 0;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
else if (c == '\'')
|
||||
state = R_Q1;
|
||||
else if (c == '"')
|
||||
state = R_Q2;
|
||||
else if (c == '\'' || c == '"' || c == '`')
|
||||
{
|
||||
quote= c;
|
||||
state= R_Q;
|
||||
}
|
||||
else if (c == '\n')
|
||||
{
|
||||
state = R_LINE_START;
|
||||
@ -2101,55 +2102,36 @@ int read_line(char* buf, int size)
|
||||
*p= 0;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
else if (c == '\'')
|
||||
state= R_Q1;
|
||||
else if (c == '"')
|
||||
state= R_Q2;
|
||||
else if (c == '\'' || c == '"' || c == '`')
|
||||
{
|
||||
quote= c;
|
||||
state= R_Q;
|
||||
}
|
||||
else
|
||||
state= R_NORMAL;
|
||||
break;
|
||||
|
||||
case R_Q1:
|
||||
if (c == '\'')
|
||||
state= R_ESC_Q_Q1;
|
||||
case R_Q:
|
||||
if (c == quote)
|
||||
state= R_Q_IN_Q;
|
||||
else if (c == '\\')
|
||||
state= R_ESC_SLASH_Q1;
|
||||
state= R_SLASH_IN_Q;
|
||||
break;
|
||||
case R_ESC_Q_Q1:
|
||||
case R_Q_IN_Q:
|
||||
if (end_of_query(c))
|
||||
{
|
||||
*p= 0;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
if (c != '\'')
|
||||
if (c != quote)
|
||||
state= R_NORMAL;
|
||||
else
|
||||
state= R_Q1;
|
||||
state= R_Q;
|
||||
break;
|
||||
case R_ESC_SLASH_Q1:
|
||||
state= R_Q1;
|
||||
case R_SLASH_IN_Q:
|
||||
state= R_Q;
|
||||
break;
|
||||
|
||||
case R_Q2:
|
||||
if (c == '"')
|
||||
state= R_ESC_Q_Q2;
|
||||
else if (c == '\\')
|
||||
state= R_ESC_SLASH_Q2;
|
||||
break;
|
||||
case R_ESC_Q_Q2:
|
||||
if (end_of_query(c))
|
||||
{
|
||||
*p= 0;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
if (c != '"')
|
||||
state= R_NORMAL;
|
||||
else
|
||||
state= R_Q2;
|
||||
break;
|
||||
case R_ESC_SLASH_Q2:
|
||||
state= R_Q2;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!no_save)
|
||||
|
1416
config.guess
vendored
1416
config.guess
vendored
File diff suppressed because it is too large
Load Diff
1501
config.sub
vendored
1501
config.sub
vendored
File diff suppressed because it is too large
Load Diff
@ -38,7 +38,7 @@ AC_LANG_PUSH(C++)
|
||||
if test "$ac_cv_prog_gxx" = "yes"
|
||||
then
|
||||
# Add -Werror, remove -fbranch-probabilities (Bug #268)
|
||||
CXXFLAGS=`echo $CXXFLAGS -Werror | sed 's/-fbranch-probabilities//'`
|
||||
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
|
||||
fi
|
||||
mysql_cv_btype_last_arg_accept=none
|
||||
[AC_TRY_COMPILE([#if defined(inline)
|
||||
@ -98,7 +98,7 @@ AC_LANG_PUSH(C++)
|
||||
if test "$ac_cv_prog_gxx" = "yes"
|
||||
then
|
||||
# Add -Werror, remove -fbranch-probabilities (Bug #268)
|
||||
CXXFLAGS=`echo $CXXFLAGS -Werror | sed 's/-fbranch-probabilities//'`
|
||||
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
|
||||
fi
|
||||
mysql_cv_btype_struct_rlimit=none
|
||||
[AC_TRY_COMPILE([#if defined(inline)
|
||||
|
@ -1965,9 +1965,12 @@ AC_LANG_CPLUSPLUS
|
||||
# with respect to ANSI C++
|
||||
# We also remove the -fbranch-probabilities option as this will give warnings
|
||||
# about not profiled code, which confuses configure
|
||||
# We also must remove -W and -Wcheck which on icc produces warnings that
|
||||
# we don't want to catch with -Werror
|
||||
|
||||
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
|
||||
then
|
||||
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
|
||||
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
|
||||
fi
|
||||
|
||||
AC_TRY_COMPILE(
|
||||
@ -2002,7 +2005,7 @@ AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
|
||||
then
|
||||
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
|
||||
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
|
||||
fi
|
||||
AC_TRY_COMPILE(
|
||||
[#undef inline
|
||||
@ -2035,7 +2038,7 @@ AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
|
||||
then
|
||||
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
|
||||
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
|
||||
fi
|
||||
AC_TRY_COMPILE(
|
||||
[#undef inline
|
||||
|
411
depcomp
411
depcomp
@ -1,411 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
# Copyright 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
# `libtool' can also be set to `yes' or `no'.
|
||||
|
||||
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. This file always lives in the current directory.
|
||||
# Also, the AIX compiler puts `$object:' at the start of each line;
|
||||
# $object doesn't have directory information.
|
||||
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
outname="$stripped.o"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 AIX compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
|
||||
tmpdepfile1="$object.d"
|
||||
tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile1"; then
|
||||
tmpdepfile="$tmpdepfile1"
|
||||
else
|
||||
tmpdepfile="$tmpdepfile2"
|
||||
fi
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a space and a tab in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*) # this is libtool, let us make it quiet
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
case "$arg" in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
;;
|
||||
esac
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
# X makedepend
|
||||
(
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in no)
|
||||
set ""; shift
|
||||
cleared=yes
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift;;
|
||||
-*)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tail +3 "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*)
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
case $arg in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
;;
|
||||
esac
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
"$@" -E |
|
||||
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*)
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
case $arg in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
;;
|
||||
esac
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -63,7 +63,7 @@ typedef struct st_pointer_array { /* when using array-strings */
|
||||
#define LAST_CHAR_CODE 259
|
||||
|
||||
typedef struct st_replace {
|
||||
bool found;
|
||||
my_bool found;
|
||||
struct st_replace *next[256];
|
||||
} REPLACE;
|
||||
|
||||
@ -80,19 +80,18 @@ typedef struct st_replace_found {
|
||||
|
||||
/* functions defined in this file */
|
||||
|
||||
extern int main(int argc,char * *argv);
|
||||
static int static_get_options(int *argc,char * * *argv);
|
||||
static int get_replace_strings(int *argc,char * * *argv,
|
||||
POINTER_ARRAY *from_array,
|
||||
POINTER_ARRAY *to_array);
|
||||
int insert_pointer_name(POINTER_ARRAY *pa, my_string name);
|
||||
void free_pointer_array(POINTER_ARRAY *pa);
|
||||
static int insert_pointer_name(POINTER_ARRAY *pa, my_string name);
|
||||
static void free_pointer_array(POINTER_ARRAY *pa);
|
||||
static int convert_pipe(REPLACE *,FILE *,FILE *);
|
||||
static int convert_file(REPLACE *, my_string);
|
||||
REPLACE *init_replace(my_string *from, my_string *to,uint count, my_string
|
||||
word_end_chars);
|
||||
uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
|
||||
my_string from);
|
||||
static REPLACE *init_replace(my_string *from, my_string *to,uint count,
|
||||
my_string word_end_chars);
|
||||
static uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
|
||||
my_string from);
|
||||
static int initialize_buffer(void);
|
||||
static void reset_buffer(void);
|
||||
static void free_buffer(void);
|
||||
@ -101,9 +100,7 @@ static int silent=0,verbose=0,updated=0;
|
||||
|
||||
/* The main program */
|
||||
|
||||
int main(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int i,error;
|
||||
char word_end_chars[256],*pos;
|
||||
@ -118,7 +115,7 @@ char *argv[];
|
||||
|
||||
for (i=1,pos=word_end_chars ; i < 256 ; i++)
|
||||
if (my_isspace(&my_charset_latin1,i))
|
||||
*pos++=i;
|
||||
*pos++= (char) i;
|
||||
*pos=0;
|
||||
if (!(replace=init_replace((char**) from.typelib.type_names,
|
||||
(char**) to.typelib.type_names,
|
||||
@ -153,7 +150,7 @@ static int static_get_options(argc,argv)
|
||||
register int *argc;
|
||||
register char **argv[];
|
||||
{
|
||||
int help,version,opt;
|
||||
int help,version;
|
||||
char *pos;
|
||||
|
||||
silent=verbose=help=0;
|
||||
@ -162,7 +159,7 @@ register char **argv[];
|
||||
while (*++pos)
|
||||
{
|
||||
version=0;
|
||||
switch((opt= *pos)) {
|
||||
switch((*pos)) {
|
||||
case 's':
|
||||
silent=1;
|
||||
break;
|
||||
@ -249,7 +246,7 @@ POINTER_ARRAY *from_array,*to_array;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
|
||||
static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
|
||||
{
|
||||
uint i,length,old_count;
|
||||
byte *new_pos;
|
||||
@ -323,8 +320,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
|
||||
|
||||
/* free pointer array */
|
||||
|
||||
void free_pointer_array(pa)
|
||||
reg1 POINTER_ARRAY *pa;
|
||||
static void free_pointer_array(reg1 POINTER_ARRAY *pa)
|
||||
{
|
||||
if (pa->typelib.count)
|
||||
{
|
||||
@ -382,9 +378,9 @@ static void or_bits(REP_SET *to,REP_SET *from);
|
||||
static void copy_bits(REP_SET *to,REP_SET *from);
|
||||
static int cmp_bits(REP_SET *set1,REP_SET *set2);
|
||||
static int get_next_bit(REP_SET *set,uint lastpos);
|
||||
static int find_set(REP_SETS *sets,REP_SET *find);
|
||||
static int find_found(FOUND_SET *found_set,uint table_offset,
|
||||
int found_offset);
|
||||
static short find_set(REP_SETS *sets,REP_SET *find);
|
||||
static short find_found(FOUND_SET *found_set,uint table_offset,
|
||||
int found_offset);
|
||||
static uint start_at_word(my_string pos);
|
||||
static uint end_of_word(my_string pos);
|
||||
static uint replace_len(my_string pos);
|
||||
@ -394,11 +390,12 @@ static uint found_sets=0;
|
||||
|
||||
/* Init a replace structure for further calls */
|
||||
|
||||
REPLACE *init_replace(my_string *from, my_string *to,uint count,
|
||||
my_string word_end_chars)
|
||||
static REPLACE *init_replace(my_string *from, my_string *to,uint count,
|
||||
my_string word_end_chars)
|
||||
{
|
||||
uint i,j,states,set_nr,len,result_len,max_length,found_end,bits_set,bit_nr;
|
||||
int used_sets,chr,default_state;
|
||||
int used_sets,chr;
|
||||
short default_state;
|
||||
char used_chars[LAST_CHAR_CODE],is_word_end[256];
|
||||
my_string pos,to_pos,*to_array;
|
||||
REP_SETS sets;
|
||||
@ -561,7 +558,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
|
||||
for (chr= 0 ; chr < 256 ; chr++)
|
||||
{
|
||||
if (! used_chars[chr])
|
||||
set->next[chr]= chr ? default_state : -1;
|
||||
set->next[chr]= (short) (chr ? default_state : -1);
|
||||
else
|
||||
{
|
||||
new_set=make_new_set(&sets);
|
||||
@ -652,7 +649,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
|
||||
for (i=1 ; i <= found_sets ; i++)
|
||||
{
|
||||
pos=from[found_set[i-1].table_offset];
|
||||
rep_str[i].found= !bcmp(pos,"\\^",3) ? 2 : 1;
|
||||
rep_str[i].found= (my_bool) (!bcmp(pos,"\\^",3) ? 2 : 1);
|
||||
rep_str[i].replace_string=to_array[found_set[i-1].table_offset];
|
||||
rep_str[i].to_offset=found_set[i-1].found_offset-start_at_word(pos);
|
||||
rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
|
||||
@ -812,7 +809,7 @@ static int get_next_bit(REP_SET *set,uint lastpos)
|
||||
free given set, else put in given set in sets and return it's
|
||||
position */
|
||||
|
||||
static int find_set(REP_SETS *sets,REP_SET *find)
|
||||
static short find_set(REP_SETS *sets,REP_SET *find)
|
||||
{
|
||||
uint i;
|
||||
for (i=0 ; i < sets->count-1 ; i++)
|
||||
@ -820,30 +817,33 @@ static int find_set(REP_SETS *sets,REP_SET *find)
|
||||
if (!cmp_bits(sets->set+i,find))
|
||||
{
|
||||
free_last_set(sets);
|
||||
return i;
|
||||
return (short) i;
|
||||
}
|
||||
}
|
||||
return i; /* return new postion */
|
||||
return (short) i; /* return new postion */
|
||||
}
|
||||
|
||||
/* find if there is a found_set with same table_offset & found_offset
|
||||
If there is return offset to it, else add new offset and return pos.
|
||||
Pos returned is -offset-2 in found_set_structure because it's is
|
||||
saved in set->next and set->next[] >= 0 points to next set and
|
||||
set->next[] == -1 is reserved for end without replaces.
|
||||
*/
|
||||
|
||||
static int find_found(FOUND_SET *found_set,uint table_offset, int found_offset)
|
||||
/*
|
||||
find if there is a found_set with same table_offset & found_offset
|
||||
If there is return offset to it, else add new offset and return pos.
|
||||
Pos returned is -offset-2 in found_set_structure because it's is
|
||||
saved in set->next and set->next[] >= 0 points to next set and
|
||||
set->next[] == -1 is reserved for end without replaces.
|
||||
*/
|
||||
|
||||
static short find_found(FOUND_SET *found_set,uint table_offset,
|
||||
int found_offset)
|
||||
{
|
||||
int i;
|
||||
for (i=0 ; (uint) i < found_sets ; i++)
|
||||
if (found_set[i].table_offset == table_offset &&
|
||||
found_set[i].found_offset == found_offset)
|
||||
return -i-2;
|
||||
return (short) (-i-2);
|
||||
found_set[i].table_offset=table_offset;
|
||||
found_set[i].found_offset=found_offset;
|
||||
found_sets++;
|
||||
return -i-2; /* return new postion */
|
||||
return (short) (-i-2); /* return new postion */
|
||||
}
|
||||
|
||||
/* Return 1 if regexp starts with \b or ends with \b*/
|
||||
@ -878,7 +878,8 @@ static uint replace_len(my_string str)
|
||||
|
||||
/* The actual loop */
|
||||
|
||||
uint replace_strings(REPLACE *rep, my_string *start,uint *max_length, my_string from)
|
||||
static uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
|
||||
my_string from)
|
||||
{
|
||||
reg1 REPLACE *rep_pos;
|
||||
reg2 REPLACE_STRING *rep_str;
|
||||
|
@ -39,9 +39,9 @@ extern void _db_pargs_(uint _line_,const char *keyword);
|
||||
extern void _db_doprnt_ _VARARGS((const char *format,...));
|
||||
extern void _db_dump_(uint _line_,const char *keyword,const char *memory,
|
||||
uint length);
|
||||
extern void _db_output_();
|
||||
extern void _db_lock_file();
|
||||
extern void _db_unlock_file();
|
||||
extern void _db_output_(uint);
|
||||
extern void _db_lock_file(void);
|
||||
extern void _db_unlock_file(void);
|
||||
|
||||
#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
|
||||
char **_db_framep_; \
|
||||
|
@ -778,15 +778,13 @@ extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
|
||||
extern char *strdup_root(MEM_ROOT *root,const char *str);
|
||||
extern char *strmake_root(MEM_ROOT *root,const char *str,uint len);
|
||||
extern char *memdup_root(MEM_ROOT *root,const char *str,uint len);
|
||||
extern int my_correct_defaults_file(const char *file_location,
|
||||
const char *option,
|
||||
const char *option_value,
|
||||
const char *section_name,
|
||||
int remove_option);
|
||||
extern void get_defaults_files(int argc, char **argv,
|
||||
char **defaults, char **extra_defaults);
|
||||
extern int load_defaults(const char *conf_file, const char **groups,
|
||||
int *argc, char ***argv);
|
||||
extern uint modify_defaults_file(const char *file_location, const char *option,
|
||||
const char *option_value,
|
||||
const char *section_name, int remove_option);
|
||||
extern int my_search_option_files(const char *conf_file, int *argc,
|
||||
char ***argv, uint *args_used,
|
||||
Process_option_func func, void *func_ctx);
|
||||
|
@ -417,6 +417,9 @@ const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
|
||||
/* Some other useful functions */
|
||||
|
||||
my_bool my_init(void);
|
||||
extern uint modify_defaults_file(const char *file_location, const char *option,
|
||||
const char *option_value,
|
||||
const char *section_name, int remove_option);
|
||||
int load_defaults(const char *conf_file, const char **groups,
|
||||
int *argc, char ***argv);
|
||||
my_bool my_thread_init(void);
|
||||
|
251
install-sh
251
install-sh
@ -1,251 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$cpprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
@ -61,7 +61,8 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
|
||||
mf_format.lo mf_path.lo mf_unixpath.lo my_fopen.lo \
|
||||
my_symlink.lo my_fstream.lo \
|
||||
mf_loadpath.lo my_pthread.lo my_thr_init.lo \
|
||||
thr_mutex.lo mulalloc.lo string.lo default.lo \
|
||||
thr_mutex.lo mulalloc.lo string.lo \
|
||||
default.lo default_modify.lo \
|
||||
my_compress.lo array.lo my_once.lo list.lo my_net.lo \
|
||||
charset.lo charset-def.lo hash.lo mf_iocache.lo \
|
||||
mf_iocache2.lo my_seek.lo my_sleep.lo \
|
||||
|
@ -1,5 +1,5 @@
|
||||
LIBRARY LIBMYSQL
|
||||
DESCRIPTION 'MySQL 4.1 Client Library'
|
||||
DESCRIPTION 'MySQL 5.0 Client Library'
|
||||
VERSION 6.0
|
||||
EXPORTS
|
||||
_dig_vec_lower
|
||||
@ -150,6 +150,4 @@ EXPORTS
|
||||
mysql_server_end
|
||||
mysql_set_character_set
|
||||
get_defaults_files
|
||||
get_charset_by_csname
|
||||
get_charsets_dir
|
||||
charsets_dir
|
||||
modify_defaults_file
|
||||
|
@ -160,3 +160,4 @@ EXPORTS
|
||||
get_defaults_files
|
||||
my_charset_bin
|
||||
my_charset_same
|
||||
modify_defaults_file
|
||||
|
283
missing
283
missing
@ -1,283 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case "$1" in
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing 0.3 - GNU automake"
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aclocal)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
|
||||
# We have makeinfo, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||
fi
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar ${1+"$@"} && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar ${1+"$@"} && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case "$firstarg" in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" ${1+"$@"} && exit 0
|
||||
;;
|
||||
esac
|
||||
case "$firstarg" in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" ${1+"$@"} && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequirements for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -1,38 +0,0 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file
|
||||
do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d
|
||||
do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp" 1>&2
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
@ -679,7 +679,9 @@ CREATE TABLE `t1` (
|
||||
|
||||
|
||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||
INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
|
||||
LOCK TABLES `t1` WRITE;
|
||||
INSERT IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
|
||||
UNLOCK TABLES;
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
|
@ -142,3 +142,9 @@ after_--enable_abort_on_error
|
||||
1064
|
||||
select 3 from t1 ;
|
||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||
select 1 as `a'b`, 2 as `a"b`;
|
||||
a'b a"b
|
||||
1 2
|
||||
select 'aaa\\','aa''a',"aa""a";
|
||||
aaa\ aa'a aa"a
|
||||
aaa\ aa'a aa"a
|
||||
|
@ -11,7 +11,7 @@ Variable_name Value
|
||||
slave_compressed_protocol OFF
|
||||
show variables like 'slave_load_tmpdir';
|
||||
Variable_name Value
|
||||
slave_load_tmpdir MYSQL_TEST_DIR/var/tmp/
|
||||
slave_load_tmpdir SLAVE_LOAD_TMPDIR
|
||||
show variables like 'slave_skip_errors';
|
||||
Variable_name Value
|
||||
slave_skip_errors 3,100,137,643,1752
|
||||
|
@ -116,7 +116,7 @@ func CREATE TABLE `func` (
|
||||
`name` char(64) collate utf8_bin NOT NULL default '',
|
||||
`ret` tinyint(1) NOT NULL default '0',
|
||||
`dl` char(128) collate utf8_bin NOT NULL default '',
|
||||
`type` enum('function','aggregate') character set utf8 NOT NULL default 'function',
|
||||
`type` enum('function','aggregate') character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'
|
||||
show create table tables_priv;
|
||||
@ -152,7 +152,7 @@ procs_priv CREATE TABLE `procs_priv` (
|
||||
`Db` char(64) collate utf8_bin NOT NULL default '',
|
||||
`User` char(16) collate utf8_bin NOT NULL default '',
|
||||
`Routine_name` char(64) collate utf8_bin NOT NULL default '',
|
||||
`Routine_type` enum('FUNCTION','PROCEDURE') collate utf8_bin NOT NULL default 'FUNCTION',
|
||||
`Routine_type` enum('FUNCTION','PROCEDURE') collate utf8_bin NOT NULL,
|
||||
`Grantor` char(77) collate utf8_bin NOT NULL default '',
|
||||
`Proc_priv` set('Execute','Alter Routine','Grant') character set utf8 NOT NULL default '',
|
||||
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
@ -164,7 +164,7 @@ Table Create Table
|
||||
proc CREATE TABLE `proc` (
|
||||
`db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`name` char(64) NOT NULL default '',
|
||||
`type` enum('FUNCTION','PROCEDURE') NOT NULL default 'FUNCTION',
|
||||
`type` enum('FUNCTION','PROCEDURE') NOT NULL,
|
||||
`specific_name` char(64) NOT NULL default '',
|
||||
`language` enum('SQL') NOT NULL default 'SQL',
|
||||
`sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL default 'CONTAINS_SQL',
|
||||
|
@ -1626,7 +1626,7 @@ create table t1 (a enum (' ','a','b') not null);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` enum('','a','b') NOT NULL default ''
|
||||
`a` enum('','a','b') NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (a enum (' ','a','b ') not null default 'b ');
|
||||
@ -1670,12 +1670,12 @@ show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) default '1',
|
||||
`b` enum('value','öäü_value','ÊÃÕ') NOT NULL default 'value'
|
||||
`b` enum('value','öäü_value','ÊÃÕ') NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
show columns from t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) YES 1
|
||||
b enum('value','öäü_value','ÊÃÕ') NO value
|
||||
b enum('value','öäü_value','ÊÃÕ') NO
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (c enum('a', 'A') BINARY);
|
||||
INSERT INTO t1 VALUES ('a'),('A');
|
||||
|
@ -62,7 +62,7 @@ blob_col blob NULL YES NULL #
|
||||
tinyblob_col tinyblob NULL YES NULL #
|
||||
mediumblob_col mediumblob NULL NO #
|
||||
longblob_col longblob NULL NO #
|
||||
options enum('one','two','tree') latin1_swedish_ci NO MUL one #
|
||||
options enum('one','two','tree') latin1_swedish_ci NO MUL #
|
||||
flags set('one','two','tree') latin1_swedish_ci NO #
|
||||
show keys from t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
@ -231,7 +231,7 @@ date_time datetime NULL YES NULL #
|
||||
new_blob_col varchar(20) latin1_swedish_ci YES NULL #
|
||||
tinyblob_col tinyblob NULL YES NULL #
|
||||
mediumblob_col mediumblob NULL NO #
|
||||
options enum('one','two','tree') latin1_swedish_ci NO MUL one #
|
||||
options enum('one','two','tree') latin1_swedish_ci NO MUL #
|
||||
flags set('one','two','tree') latin1_swedish_ci NO #
|
||||
new_field char(10) latin1_swedish_ci NO new #
|
||||
show full columns from t2;
|
||||
|
@ -180,6 +180,7 @@ select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
|
||||
coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4)
|
||||
2 2 2 2
|
||||
set session @honk=99;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@honk=99' at line 1
|
||||
set one_shot @honk=99;
|
||||
ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
|
||||
set @first_var= NULL;
|
||||
|
@ -515,3 +515,7 @@ show warnings;
|
||||
Level Code Message
|
||||
Warning 1329 No data to FETCH
|
||||
drop table t1;
|
||||
set @@warning_count=1;
|
||||
ERROR HY000: Variable 'warning_count' is a read only variable
|
||||
set @@global.error_count=1;
|
||||
ERROR HY000: Variable 'error_count' is a read only variable
|
||||
|
@ -286,3 +286,12 @@ select 3 from t1 ;
|
||||
#select 3 from t1 ;
|
||||
#
|
||||
#select 3 from t1 ;
|
||||
|
||||
|
||||
#
|
||||
# Bug #10251: Identifiers containing quotes not handled correctly
|
||||
#
|
||||
select 1 as `a'b`, 2 as `a"b`;
|
||||
|
||||
# Test escaping of quotes
|
||||
select 'aaa\\','aa''a',"aa""a";
|
||||
|
@ -5,7 +5,7 @@ set global sql_slave_skip_counter=100;
|
||||
|
||||
# BUG #7800: Add various-slave related variables to SHOW VARIABLES
|
||||
show variables like 'slave_compressed_protocol';
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--replace_column 2 SLAVE_LOAD_TMPDIR
|
||||
show variables like 'slave_load_tmpdir';
|
||||
# We just set some arbitrary values in variables-master.opt so we can test
|
||||
# that a list of values works correctly
|
||||
|
@ -116,6 +116,7 @@ select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
|
||||
#
|
||||
# Bug #9286 SESSION/GLOBAL should be disallowed for user variables
|
||||
#
|
||||
--error 1064
|
||||
set session @honk=99;
|
||||
--error 1382
|
||||
set one_shot @honk=99;
|
||||
|
@ -387,3 +387,11 @@ select a into @x from t1;
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #10339: read only variables.
|
||||
#
|
||||
|
||||
--error 1238
|
||||
set @@warning_count=1;
|
||||
--error 1238
|
||||
set @@global.error_count=1;
|
||||
|
@ -48,7 +48,8 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
|
||||
my_chsize.c my_lread.c my_lwrite.c my_clock.c \
|
||||
my_quick.c my_lockmem.c my_static.c \
|
||||
my_sync.c my_getopt.c my_mkdir.c \
|
||||
default.c my_compress.c checksum.c raid.cc \
|
||||
default_modify.c default.c \
|
||||
my_compress.c checksum.c raid.cc \
|
||||
my_net.c my_semaphore.c my_port.c my_sleep.c \
|
||||
charset.c charset-def.c my_bitmap.c my_bit.c md5.c \
|
||||
my_gethostbyname.c rijndael.c my_aes.c sha1.c \
|
||||
|
135
mysys/default.c
135
mysys/default.c
@ -81,141 +81,6 @@ static void init_default_directories();
|
||||
|
||||
static char *remove_end_comment(char *ptr);
|
||||
|
||||
/*
|
||||
Add/remove option to the option file section.
|
||||
|
||||
SYNOPSYS
|
||||
my_correct_file()
|
||||
file_location The location of configuration file to edit
|
||||
option option to look for
|
||||
option value The value of the option we would like to set
|
||||
section_name the name of the section
|
||||
remove_option This is true if we want to remove the option.
|
||||
False otherwise.
|
||||
IMPLEMENTATION
|
||||
We open the option file first, then read the file line-by-line,
|
||||
looking for the section we need. At the same time we put these lines
|
||||
into a buffer. Then we look for the option within this section and
|
||||
change/remove it. In the end we get a buffer with modified version of the
|
||||
file. Then we write it to the file, truncate it if needed and close it.
|
||||
|
||||
RETURN
|
||||
0 - ok
|
||||
1 - some error has occured. Probably due to the lack of resourses
|
||||
-1 - cannot open the file
|
||||
*/
|
||||
|
||||
int my_correct_defaults_file(const char *file_location, const char *option,
|
||||
const char *option_value,
|
||||
const char *section_name, int remove_option)
|
||||
{
|
||||
FILE *cnf_file;
|
||||
struct stat file_stat;
|
||||
char linebuff[512], *ptr;
|
||||
uint optlen;
|
||||
uint len;
|
||||
char *file_buffer;
|
||||
uint position= 0;
|
||||
int is_found= FALSE;
|
||||
DBUG_ENTER("my_correct_defaults_file");
|
||||
|
||||
optlen= strlen(option);
|
||||
|
||||
if (!(cnf_file= my_fopen(file_location, O_RDWR, MYF(0))))
|
||||
goto err_fopen;
|
||||
|
||||
/* my_fstat doesn't use the flag parameter */
|
||||
if (my_fstat(fileno(cnf_file), &file_stat, MYF(0)))
|
||||
goto err;
|
||||
|
||||
/*
|
||||
Reserve space to read the contents of the file and some more
|
||||
for the option we want ot add.
|
||||
*/
|
||||
file_buffer= (char*) my_malloc(sizeof(char)*
|
||||
(file_stat.st_size + /* current file size */
|
||||
optlen + /* option name len */
|
||||
2 + /* reserve space for newline */
|
||||
1 + /* reserve for '=' char */
|
||||
strlen(option_value)), /* option value len */
|
||||
MYF(MY_WME));
|
||||
|
||||
if (!file_buffer)
|
||||
goto malloc_err;
|
||||
while (fgets(linebuff, sizeof(linebuff), cnf_file))
|
||||
{
|
||||
len= strlen(linebuff);
|
||||
|
||||
/* if the section is found traverse it */
|
||||
if (is_found)
|
||||
{
|
||||
/* skip the old value of the option we are changing */
|
||||
if (strncmp(linebuff, option, optlen))
|
||||
{
|
||||
/* copy all other lines */
|
||||
strmake(file_buffer + position, linebuff, len);
|
||||
position+= len;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strmake(file_buffer + position, linebuff, len);
|
||||
position+= len;
|
||||
}
|
||||
|
||||
|
||||
/* looking for appropriate section */
|
||||
for (ptr= linebuff ; my_isspace(&my_charset_latin1,*ptr) ; ptr++)
|
||||
{}
|
||||
|
||||
if (*ptr == '[')
|
||||
{
|
||||
/* copy the line to the buffer */
|
||||
if (!strncmp(++ptr, section_name, strlen(section_name)))
|
||||
{
|
||||
is_found= TRUE;
|
||||
/* add option */
|
||||
if (!remove_option)
|
||||
{
|
||||
strmake(file_buffer + position, option, optlen);
|
||||
position+= optlen;
|
||||
if (*option_value)
|
||||
{
|
||||
*(file_buffer + position++)= '=';
|
||||
strmake(file_buffer + position, option_value,
|
||||
strlen(option_value));
|
||||
position+= strlen(option_value);
|
||||
}
|
||||
/* add a newline */
|
||||
strcat(file_buffer + position, NEWLINE);
|
||||
position+= strlen(NEWLINE);
|
||||
}
|
||||
}
|
||||
else
|
||||
is_found= FALSE; /* mark that this section is of no interest to us */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (my_chsize(fileno(cnf_file), position, 0, MYF(MY_WME)) ||
|
||||
my_fseek(cnf_file, 0, MY_SEEK_SET, MYF(0)) ||
|
||||
my_fwrite(cnf_file, file_buffer, position, MYF(MY_NABP)) ||
|
||||
my_fclose(cnf_file, MYF(MY_WME)))
|
||||
goto err;
|
||||
|
||||
my_free(file_buffer, MYF(0));
|
||||
|
||||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
my_free(file_buffer, MYF(0));
|
||||
malloc_err:
|
||||
my_fclose(cnf_file, MYF(0));
|
||||
DBUG_RETURN(1); /* out of resources */
|
||||
err_fopen:
|
||||
DBUG_RETURN(-1); /* cannot access the option file */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Process config files in default directories.
|
||||
|
164
mysys/default_modify.c
Normal file
164
mysys/default_modify.c
Normal file
@ -0,0 +1,164 @@
|
||||
/*
|
||||
Add/remove option to the option file section.
|
||||
|
||||
SYNOPSYS
|
||||
modify_defaults_file()
|
||||
file_location The location of configuration file to edit
|
||||
option option to look for
|
||||
option value The value of the option we would like to set
|
||||
section_name the name of the section
|
||||
remove_option This is true if we want to remove the option.
|
||||
False otherwise.
|
||||
IMPLEMENTATION
|
||||
We open the option file first, then read the file line-by-line,
|
||||
looking for the section we need. At the same time we put these lines
|
||||
into a buffer. Then we look for the option within this section and
|
||||
change/remove it. In the end we get a buffer with modified version of the
|
||||
file. Then we write it to the file, truncate it if needed and close it.
|
||||
|
||||
RETURN
|
||||
0 - ok
|
||||
1 - some error has occured. Probably due to the lack of resourses
|
||||
2 - cannot open the file
|
||||
*/
|
||||
|
||||
#include "my_global.h"
|
||||
#include "mysys_priv.h"
|
||||
#include "m_string.h"
|
||||
#include <my_dir.h>
|
||||
|
||||
#define BUFF_SIZE 1024
|
||||
|
||||
#ifdef __WIN__
|
||||
#define NEWLINE "\r\n"
|
||||
#define NEWLINE_LEN 2
|
||||
#else
|
||||
#define NEWLINE "\n"
|
||||
#define NEWLINE_LEN 1
|
||||
#endif
|
||||
|
||||
uint modify_defaults_file(const char *file_location, const char *option,
|
||||
const char *option_value,
|
||||
const char *section_name, int remove_option)
|
||||
{
|
||||
FILE *cnf_file;
|
||||
struct stat file_stat;
|
||||
char linebuff[BUFF_SIZE], tmp[BUFF_SIZE], *tmp_ptr, *src_ptr, *dst_ptr,
|
||||
*file_buffer;
|
||||
uint optlen, optval_len, sect_len;
|
||||
my_bool in_section= FALSE;
|
||||
DBUG_ENTER("modify_defaults_file");
|
||||
|
||||
optlen= strlen(option);
|
||||
optval_len= strlen(option_value);
|
||||
sect_len= strlen(section_name);
|
||||
|
||||
if (!(cnf_file= my_fopen(file_location, O_RDWR | O_BINARY, MYF(0))))
|
||||
DBUG_RETURN(2);
|
||||
|
||||
/* my_fstat doesn't use the flag parameter */
|
||||
if (my_fstat(fileno(cnf_file), &file_stat, MYF(0)))
|
||||
goto err;
|
||||
|
||||
/*
|
||||
Reserve space to read the contents of the file and some more
|
||||
for the option we want to add.
|
||||
*/
|
||||
if (!(file_buffer= (char*) my_malloc(sizeof(char)*
|
||||
(file_stat.st_size +
|
||||
/* option name len */
|
||||
optlen +
|
||||
/* reserve space for newline */
|
||||
NEWLINE_LEN +
|
||||
/* reserve for '=' char */
|
||||
1 +
|
||||
/* option value len */
|
||||
optval_len), MYF(MY_WME))))
|
||||
goto malloc_err;
|
||||
|
||||
for (dst_ptr= file_buffer, tmp_ptr= 0;
|
||||
fgets(linebuff, BUFF_SIZE, cnf_file); )
|
||||
{
|
||||
/* Skip over whitespaces */
|
||||
for (src_ptr= linebuff; my_isspace(&my_charset_latin1, *src_ptr);
|
||||
src_ptr++)
|
||||
{}
|
||||
|
||||
if (in_section && !strncmp(src_ptr, option, optlen) &&
|
||||
(*(src_ptr + optlen) == '=' ||
|
||||
my_isspace(&my_charset_latin1, *(src_ptr + optlen)) ||
|
||||
*(src_ptr + optlen) == '\0'))
|
||||
{
|
||||
/* The option under modifying was found in this section. Apply new. */
|
||||
if (!remove_option)
|
||||
dst_ptr= strmov(dst_ptr, tmp);
|
||||
tmp_ptr= 0; /* To mark that we have already applied this */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If going to new group and we have option to apply, do it now */
|
||||
if (tmp_ptr && *src_ptr == '[')
|
||||
{
|
||||
dst_ptr= strmov(dst_ptr, tmp);
|
||||
tmp_ptr= 0;
|
||||
}
|
||||
dst_ptr= strmov(dst_ptr, linebuff);
|
||||
}
|
||||
/* Look for a section */
|
||||
if (*src_ptr == '[')
|
||||
{
|
||||
/* Copy the line to the buffer */
|
||||
if (!strncmp(++src_ptr, section_name, sect_len))
|
||||
{
|
||||
src_ptr+= sect_len;
|
||||
/* Skip over whitespaces. They are allowed after section name */
|
||||
for (; my_isspace(&my_charset_latin1, *src_ptr); src_ptr++)
|
||||
{}
|
||||
|
||||
if (*src_ptr != ']')
|
||||
continue; /* Missing closing parenthesis. Assume this was no group */
|
||||
|
||||
in_section= TRUE;
|
||||
/* add option */
|
||||
if (!remove_option)
|
||||
{
|
||||
tmp_ptr= strmov(tmp, option);
|
||||
if (*option_value)
|
||||
{
|
||||
*tmp_ptr++= '=';
|
||||
tmp_ptr= strmov(tmp_ptr, option_value);
|
||||
}
|
||||
/* add a newline */
|
||||
strmov(tmp_ptr, NEWLINE);
|
||||
}
|
||||
}
|
||||
else
|
||||
in_section= FALSE; /* mark that this section is of no interest to us */
|
||||
}
|
||||
}
|
||||
/* File ended. New option still remains to apply at the end */
|
||||
if (tmp_ptr)
|
||||
{
|
||||
if (*(dst_ptr - 1) != '\n')
|
||||
*dst_ptr++= '\n';
|
||||
dst_ptr= strmov(dst_ptr, tmp);
|
||||
}
|
||||
|
||||
if (my_chsize(fileno(cnf_file), (my_off_t) (dst_ptr - file_buffer), 0,
|
||||
MYF(MY_WME)) ||
|
||||
my_fseek(cnf_file, 0, MY_SEEK_SET, MYF(0)) ||
|
||||
my_fwrite(cnf_file, file_buffer, (uint) (dst_ptr - file_buffer),
|
||||
MYF(MY_NABP)) ||
|
||||
my_fclose(cnf_file, MYF(MY_WME)))
|
||||
goto err;
|
||||
|
||||
my_free(file_buffer, MYF(0));
|
||||
|
||||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
my_free(file_buffer, MYF(0));
|
||||
malloc_err:
|
||||
my_fclose(cnf_file, MYF(0));
|
||||
DBUG_RETURN(1); /* out of resources */
|
||||
}
|
@ -85,7 +85,7 @@ void init_thr_alarm(uint max_alarms)
|
||||
#else
|
||||
{
|
||||
struct sigaction sact;
|
||||
sact.sa_flags = 0;
|
||||
bzero((char*) &sact, sizeof(sact));
|
||||
sact.sa_handler = thread_alarm;
|
||||
sigaction(THR_CLIENT_ALARM, &sact, (struct sigaction*) 0);
|
||||
}
|
||||
|
@ -315,8 +315,8 @@ system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'`
|
||||
system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'`
|
||||
|
||||
# Use the override --machine if present
|
||||
if [ $MACHINE != "" ] ; then
|
||||
machine= $MACHINE
|
||||
if [ -n $MACHINE ] ; then
|
||||
machine=$MACHINE
|
||||
fi
|
||||
|
||||
# Change the distribution to a long descriptive name
|
||||
|
@ -14,7 +14,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
INCLUDES= -I$(top_srcdir)/include -I$(top_builddir)/include
|
||||
INCLUDES= @ZLIB_INCLUDES@ -I$(top_srcdir)/include \
|
||||
$(openssl_includes) -I$(top_builddir)/include
|
||||
|
||||
DEFS= -DMYSQL_INSTANCE_MANAGER -DMYSQL_SERVER
|
||||
|
||||
|
@ -548,7 +548,7 @@ int Show_instance_log_files::execute(struct st_net *net, ulong connection_id)
|
||||
path_field.name= (char*) "Path";
|
||||
path_field.length= DEFAULT_FIELD_LENGTH;
|
||||
path.data= &path_field;
|
||||
size_field.name= (char*) "Filesize";
|
||||
size_field.name= (char*) "File size";
|
||||
size_field.length= DEFAULT_FIELD_LENGTH;
|
||||
size.data= &size_field;
|
||||
field_list= list_add(NULL, &size);
|
||||
@ -689,8 +689,8 @@ int Set_option::correct_file(int skip)
|
||||
{
|
||||
int error;
|
||||
|
||||
error= my_correct_defaults_file("/etc/my.cnf", option,
|
||||
option_value, instance_name, skip);
|
||||
error= modify_defaults_file("/etc/my.cnf", option,
|
||||
option_value, instance_name, skip);
|
||||
if (error > 0)
|
||||
return ER_OUT_OF_RESOURCES;
|
||||
else if (error < 0)
|
||||
|
@ -300,7 +300,7 @@ void print_hash_map(const char *name)
|
||||
char *cur;
|
||||
int i;
|
||||
|
||||
printf("uchar %s[%d]= {\n",name,size_hash_map);
|
||||
printf("static uchar %s[%d]= {\n",name,size_hash_map);
|
||||
for (i=0, cur= hash_map; i<size_hash_map; i++, cur++)
|
||||
{
|
||||
switch(i%4){
|
||||
@ -459,11 +459,11 @@ int main(int argc,char **argv)
|
||||
generate_find_structs();
|
||||
print_find_structs();
|
||||
|
||||
printf("\nunsigned int sql_functions_max_len=%d;\n",max_len);
|
||||
printf("\nunsigned int symbols_max_len=%d;\n\n",max_len2);
|
||||
printf("\static unsigned int sql_functions_max_len=%d;\n",max_len);
|
||||
printf("\static unsigned int symbols_max_len=%d;\n\n",max_len2);
|
||||
|
||||
printf("\
|
||||
inline SYMBOL *get_hash_symbol(const char *s,\n \
|
||||
static inline SYMBOL *get_hash_symbol(const char *s,\n\
|
||||
unsigned int len,bool function)\n\
|
||||
{\n\
|
||||
register uchar *hash_map;\n\
|
||||
|
@ -1478,7 +1478,19 @@ next_insert_id(ulonglong nr,struct system_variables *variables)
|
||||
|
||||
|
||||
/*
|
||||
Updates columns with type NEXT_NUMBER if:
|
||||
Update the auto_increment field if necessary
|
||||
|
||||
SYNOPSIS
|
||||
update_auto_increment()
|
||||
|
||||
RETURN
|
||||
0 ok
|
||||
1 get_auto_increment() was called and returned ~(ulonglong) 0
|
||||
|
||||
|
||||
IMPLEMENTATION
|
||||
|
||||
Updates columns with type NEXT_NUMBER if:
|
||||
|
||||
- If column value is set to NULL (in which case
|
||||
auto_increment_field_not_null is 0)
|
||||
@ -1517,12 +1529,13 @@ next_insert_id(ulonglong nr,struct system_variables *variables)
|
||||
thd->next_insert_id is cleared after it's been used for a statement.
|
||||
*/
|
||||
|
||||
void handler::update_auto_increment()
|
||||
bool handler::update_auto_increment()
|
||||
{
|
||||
ulonglong nr;
|
||||
THD *thd= table->in_use;
|
||||
struct system_variables *variables= &thd->variables;
|
||||
bool auto_increment_field_not_null;
|
||||
bool result= 0;
|
||||
DBUG_ENTER("handler::update_auto_increment");
|
||||
|
||||
/*
|
||||
@ -1551,11 +1564,13 @@ void handler::update_auto_increment()
|
||||
thd->next_insert_id= nr;
|
||||
DBUG_PRINT("info",("next_insert_id: %lu", (ulong) nr));
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
if (!(nr= thd->next_insert_id))
|
||||
{
|
||||
nr= get_auto_increment();
|
||||
if ((nr= get_auto_increment()) == ~(ulonglong) 0)
|
||||
result= 1; // Mark failure
|
||||
|
||||
if (variables->auto_increment_increment != 1)
|
||||
nr= next_insert_id(nr-1, variables);
|
||||
/*
|
||||
@ -1595,7 +1610,7 @@ void handler::update_auto_increment()
|
||||
|
||||
/* Mark that we generated a new value */
|
||||
auto_increment_column_changed=1;
|
||||
DBUG_VOID_RETURN;
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -506,7 +506,7 @@ public:
|
||||
}
|
||||
virtual int ha_initialise();
|
||||
int ha_open(const char *name, int mode, int test_if_locked);
|
||||
void update_auto_increment();
|
||||
bool update_auto_increment();
|
||||
virtual void print_error(int error, myf errflag);
|
||||
virtual bool get_error_message(int error, String *buf);
|
||||
uint get_dup_key(int error);
|
||||
|
19
sql/item.cc
19
sql/item.cc
@ -307,8 +307,14 @@ Item::Item():
|
||||
|
||||
/* Put item in free list so that we can free all items at end */
|
||||
THD *thd= current_thd;
|
||||
next= thd->free_list;
|
||||
thd->free_list= this;
|
||||
|
||||
if (reused)
|
||||
next= reuse_next;
|
||||
else
|
||||
{
|
||||
next= thd->free_list;
|
||||
thd->free_list= this;
|
||||
}
|
||||
/*
|
||||
Item constructor can be called during execution other then SQL_COM
|
||||
command => we should check thd->lex->current_select on zero (thd->lex
|
||||
@ -343,8 +349,13 @@ Item::Item(THD *thd, Item *item):
|
||||
fixed(item->fixed),
|
||||
collation(item->collation)
|
||||
{
|
||||
next= thd->free_list; // Put in free list
|
||||
thd->free_list= this;
|
||||
if (reused)
|
||||
next= reuse_next;
|
||||
else
|
||||
{
|
||||
next= thd->free_list; // Put in free list
|
||||
thd->free_list= this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
54
sql/item.h
54
sql/item.h
@ -229,9 +229,59 @@ class Item {
|
||||
Item(const Item &); /* Prevent use of these */
|
||||
void operator=(Item &);
|
||||
public:
|
||||
static void *operator new(size_t size) {return (void*) sql_alloc((uint) size); }
|
||||
/* For SP reuse mechanism */
|
||||
bool reused;
|
||||
size_t reuse_slot_size;
|
||||
Item *reuse_next;
|
||||
|
||||
static void *operator new(size_t size)
|
||||
{
|
||||
Item *me= (Item *)sql_alloc((uint) size);
|
||||
|
||||
if (me)
|
||||
{
|
||||
me->reuse_slot_size= size;
|
||||
me->reused= FALSE;
|
||||
}
|
||||
return (void*)me;
|
||||
}
|
||||
static void *operator new(size_t size, MEM_ROOT *mem_root)
|
||||
{ return (void*) alloc_root(mem_root, (uint) size); }
|
||||
{
|
||||
Item *me= (Item *)alloc_root(mem_root, (uint) size);
|
||||
|
||||
if (me)
|
||||
{
|
||||
me->reuse_slot_size= size;
|
||||
me->reused= FALSE;
|
||||
}
|
||||
return (void*)me;
|
||||
}
|
||||
static void *operator new(size_t size, MEM_ROOT *mem_root, Item *reuse)
|
||||
{
|
||||
Item *me;
|
||||
|
||||
if (!reuse || size > reuse->reuse_slot_size)
|
||||
{
|
||||
me= (Item *)alloc_root(mem_root, (uint) size);
|
||||
if (me)
|
||||
{
|
||||
me->reuse_slot_size= size;
|
||||
me->reused= FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /* Reuse old item */
|
||||
size_t slot_size= reuse->reuse_slot_size;
|
||||
|
||||
reuse->delete_self();
|
||||
me= reuse;
|
||||
me->reuse_slot_size= slot_size;
|
||||
/* For the constructor */
|
||||
me->reuse_next= reuse->next;
|
||||
me->reused= TRUE;
|
||||
}
|
||||
return (void *)me;
|
||||
}
|
||||
static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); }
|
||||
static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
|
||||
|
||||
|
@ -1827,7 +1827,7 @@ void Item_func_round::fix_length_and_dec()
|
||||
return;
|
||||
}
|
||||
|
||||
int decimals_to_set= max(args[1]->val_int(), 0);
|
||||
int decimals_to_set= max((int)args[1]->val_int(), 0);
|
||||
if (args[0]->decimals == NOT_FIXED_DEC)
|
||||
{
|
||||
max_length= args[0]->max_length;
|
||||
|
@ -2906,9 +2906,9 @@ String *Item_func_uuid::val_str(String *str)
|
||||
ulonglong tv=my_getsystime() + UUID_TIME_OFFSET + nanoseq;
|
||||
if (unlikely(tv < uuid_time))
|
||||
set_clock_seq_str();
|
||||
else
|
||||
if (unlikely(tv == uuid_time))
|
||||
{ /* special protection from low-res system clocks */
|
||||
else if (unlikely(tv == uuid_time))
|
||||
{
|
||||
/* special protection from low-res system clocks */
|
||||
nanoseq++;
|
||||
tv++;
|
||||
}
|
||||
|
@ -1117,7 +1117,8 @@ extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open,
|
||||
LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator,
|
||||
LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
|
||||
LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock,
|
||||
LOCK_global_system_variables, LOCK_user_conn;
|
||||
LOCK_global_system_variables, LOCK_user_conn,
|
||||
LOCK_bytes_sent, LOCK_bytes_received;
|
||||
extern rw_lock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
|
||||
extern pthread_cond_t COND_refresh, COND_thread_count, COND_manager;
|
||||
extern pthread_attr_t connection_attrib;
|
||||
|
132
sql/mysqld.cc
132
sql/mysqld.cc
@ -224,7 +224,7 @@ extern "C" int gethostname(char *name, int namelen);
|
||||
/* Constants */
|
||||
|
||||
const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
|
||||
const char *sql_mode_names[] =
|
||||
static const char *sql_mode_names[] =
|
||||
{
|
||||
"REAL_AS_FLOAT", "PIPES_AS_CONCAT", "ANSI_QUOTES", "IGNORE_SPACE",
|
||||
"?", "ONLY_FULL_GROUP_BY", "NO_UNSIGNED_SUBTRACTION",
|
||||
@ -238,10 +238,15 @@ const char *sql_mode_names[] =
|
||||
};
|
||||
TYPELIB sql_mode_typelib= { array_elements(sql_mode_names)-1,"",
|
||||
sql_mode_names, NULL };
|
||||
const char *tc_heuristic_recover_names[]= { "COMMIT", "ROLLBACK", NullS };
|
||||
TYPELIB tc_heuristic_recover_typelib=
|
||||
{ array_elements(tc_heuristic_recover_names)-1,"",
|
||||
tc_heuristic_recover_names, NULL };
|
||||
static const char *tc_heuristic_recover_names[]=
|
||||
{
|
||||
"COMMIT", "ROLLBACK", NullS
|
||||
};
|
||||
static TYPELIB tc_heuristic_recover_typelib=
|
||||
{
|
||||
array_elements(tc_heuristic_recover_names)-1,"",
|
||||
tc_heuristic_recover_names, NULL
|
||||
};
|
||||
const char *first_keyword= "first", *binary_keyword= "BINARY";
|
||||
const char *my_localhost= "localhost", *delayed_user= "DELAYED";
|
||||
#if SIZEOF_OFF_T > 4 && defined(BIG_TABLES)
|
||||
@ -255,8 +260,7 @@ bool opt_large_files= sizeof(my_off_t) > 4;
|
||||
/*
|
||||
Used with --help for detailed option
|
||||
*/
|
||||
bool opt_help= 0;
|
||||
bool opt_verbose= 0;
|
||||
static bool opt_help= 0, opt_verbose= 0;
|
||||
|
||||
arg_cmp_func Arg_comparator::comparator_matrix[5][2] =
|
||||
{{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string},
|
||||
@ -265,27 +269,55 @@ arg_cmp_func Arg_comparator::comparator_matrix[5][2] =
|
||||
{&Arg_comparator::compare_row, &Arg_comparator::compare_e_row},
|
||||
{&Arg_comparator::compare_decimal, &Arg_comparator::compare_e_decimal}};
|
||||
|
||||
/* static variables */
|
||||
|
||||
static bool lower_case_table_names_used= 0;
|
||||
static bool volatile select_thread_in_use, signal_thread_in_use;
|
||||
static bool volatile ready_to_exit;
|
||||
static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0;
|
||||
static my_bool opt_bdb, opt_isam, opt_ndbcluster;
|
||||
static my_bool opt_short_log_format= 0;
|
||||
static my_bool opt_log_queries_not_using_indexes= 0;
|
||||
static uint kill_cached_threads, wake_thread;
|
||||
static ulong killed_threads, thread_created;
|
||||
static ulong max_used_connections;
|
||||
static ulong my_bind_addr; /* the address we bind to */
|
||||
static volatile ulong cached_thread_count= 0;
|
||||
static const char *sql_mode_str= "OFF";
|
||||
static char *mysqld_user, *mysqld_chroot, *log_error_file_ptr;
|
||||
static char *opt_init_slave, *language_ptr, *opt_init_connect;
|
||||
static char *default_character_set_name;
|
||||
static char *my_bind_addr_str;
|
||||
static char *default_collation_name;
|
||||
static char mysql_data_home_buff[2];
|
||||
static struct passwd *user_info;
|
||||
static I_List<THD> thread_cache;
|
||||
|
||||
static pthread_cond_t COND_thread_cache, COND_flush_thread_cache;
|
||||
|
||||
#ifdef HAVE_BERKELEY_DB
|
||||
static my_bool opt_sync_bdb_logs;
|
||||
#endif
|
||||
|
||||
/* Global variables */
|
||||
|
||||
bool opt_log, opt_update_log, opt_bin_log, opt_slow_log;
|
||||
bool opt_error_log= IF_WIN(1,0);
|
||||
bool opt_disable_networking=0, opt_skip_show_db=0;
|
||||
bool lower_case_table_names_used= 0;
|
||||
bool server_id_supplied = 0;
|
||||
bool opt_endinfo,using_udf_functions, locked_in_memory;
|
||||
bool opt_using_transactions, using_update_log;
|
||||
bool volatile abort_loop, select_thread_in_use, signal_thread_in_use;
|
||||
bool volatile ready_to_exit, shutdown_in_progress, grant_option;
|
||||
bool volatile abort_loop;
|
||||
bool volatile shutdown_in_progress, grant_option;
|
||||
|
||||
my_bool opt_skip_slave_start = 0; // If set, slave is not autostarted
|
||||
my_bool opt_reckless_slave = 0;
|
||||
my_bool opt_enable_named_pipe= 0, opt_debugging= 0;
|
||||
my_bool opt_local_infile, opt_external_locking, opt_slave_compressed_protocol;
|
||||
my_bool opt_enable_named_pipe= 0;
|
||||
my_bool opt_local_infile, opt_slave_compressed_protocol;
|
||||
my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
|
||||
my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
|
||||
my_bool opt_log_slave_updates= 0;
|
||||
my_bool opt_console= 0, opt_bdb, opt_innodb, opt_isam, opt_ndbcluster;
|
||||
my_bool opt_innodb;
|
||||
#ifdef HAVE_NDBCLUSTER_DB
|
||||
const char *opt_ndbcluster_connectstring= 0;
|
||||
const char *opt_ndb_connectstring= 0;
|
||||
@ -297,10 +329,8 @@ const char *opt_ndb_mgmd;
|
||||
ulong opt_ndb_nodeid;
|
||||
#endif
|
||||
my_bool opt_readonly, use_temp_pool, relay_log_purge;
|
||||
my_bool opt_sync_bdb_logs, opt_sync_frm, opt_allow_suspicious_udfs;
|
||||
my_bool opt_sync_frm, opt_allow_suspicious_udfs;
|
||||
my_bool opt_secure_auth= 0;
|
||||
my_bool opt_short_log_format= 0;
|
||||
my_bool opt_log_queries_not_using_indexes= 0;
|
||||
my_bool lower_case_file_system= 0;
|
||||
my_bool opt_large_pages= 0;
|
||||
uint opt_large_page_size= 0;
|
||||
@ -320,7 +350,7 @@ uint mysqld_port, test_flags, select_errors, dropping_tables, ha_open_options;
|
||||
uint delay_key_write_options, protocol_version;
|
||||
uint lower_case_table_names;
|
||||
uint tc_heuristic_recover= 0;
|
||||
uint volatile thread_count, thread_running, kill_cached_threads, wake_thread;
|
||||
uint volatile thread_count, thread_running;
|
||||
ulong back_log, connect_timeout, concurrency;
|
||||
ulong server_id, thd_startup_options;
|
||||
ulong table_cache_size, thread_stack, thread_stack_min, what_to_log;
|
||||
@ -331,21 +361,18 @@ ulong thread_cache_size=0, binlog_cache_size=0, max_binlog_cache_size=0;
|
||||
ulong query_cache_size=0;
|
||||
ulong refresh_version, flush_version; /* Increments on each reload */
|
||||
query_id_t query_id;
|
||||
ulong aborted_threads, killed_threads, aborted_connects;
|
||||
ulong aborted_threads, aborted_connects;
|
||||
ulong delayed_insert_timeout, delayed_insert_limit, delayed_queue_size;
|
||||
ulong delayed_insert_threads, delayed_insert_writes, delayed_rows_in_use;
|
||||
ulong delayed_insert_errors,flush_time, thread_created;
|
||||
ulong delayed_insert_errors,flush_time;
|
||||
ulong specialflag=0;
|
||||
ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
|
||||
ulong max_connections,max_used_connections,
|
||||
max_connect_errors;
|
||||
ulong max_connections, max_connect_errors;
|
||||
uint max_user_connections= 0;
|
||||
ulong thread_id=1L,current_pid;
|
||||
ulong slow_launch_threads = 0, sync_binlog_period;
|
||||
ulong expire_logs_days = 0;
|
||||
ulong rpl_recovery_rank=0;
|
||||
ulong my_bind_addr; /* the address we bind to */
|
||||
volatile ulong cached_thread_count= 0;
|
||||
double last_query_cost= -1; /* -1 denotes that no query was compiled yet */
|
||||
|
||||
double log_10[32]; /* 10 potences */
|
||||
@ -354,24 +381,18 @@ time_t start_time;
|
||||
char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
|
||||
char *default_tz_name;
|
||||
char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN];
|
||||
char* log_error_file_ptr= log_error_file;
|
||||
char mysql_real_data_home[FN_REFLEN],
|
||||
language[FN_REFLEN], reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN],
|
||||
*mysqld_user,*mysqld_chroot, *opt_init_file,
|
||||
*opt_init_connect, *opt_init_slave, *opt_tc_log_file,
|
||||
*opt_init_file, *opt_tc_log_file,
|
||||
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
|
||||
|
||||
const char *opt_date_time_formats[3];
|
||||
|
||||
char *language_ptr, *default_collation_name, *default_character_set_name;
|
||||
char mysql_data_home_buff[2], *mysql_data_home=mysql_real_data_home;
|
||||
struct passwd *user_info;
|
||||
char *mysql_data_home= mysql_real_data_home;
|
||||
char server_version[SERVER_VERSION_LENGTH];
|
||||
char *mysqld_unix_port, *opt_mysql_tmpdir;
|
||||
char *my_bind_addr_str;
|
||||
const char **errmesg; /* Error messages */
|
||||
const char *myisam_recover_options_str="OFF";
|
||||
const char *sql_mode_str="OFF";
|
||||
/* name of reference on left espression in rewritten IN subquery */
|
||||
const char *in_left_expr_name= "<left expr>";
|
||||
/* name of additional condition */
|
||||
@ -389,7 +410,7 @@ Le_creator le_creator;
|
||||
FILE *bootstrap_file;
|
||||
int bootstrap_error;
|
||||
|
||||
I_List<THD> threads,thread_cache;
|
||||
I_List<THD> threads;
|
||||
I_List<NAMED_LIST> key_caches;
|
||||
Rpl_filter* rpl_filter;
|
||||
Rpl_filter* binlog_filter;
|
||||
@ -424,9 +445,7 @@ pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count,
|
||||
LOCK_global_system_variables,
|
||||
LOCK_user_conn, LOCK_slave_list, LOCK_active_mi;
|
||||
rw_lock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
|
||||
pthread_cond_t COND_refresh,COND_thread_count, COND_slave_stopped,
|
||||
COND_slave_start;
|
||||
pthread_cond_t COND_thread_cache,COND_flush_thread_cache;
|
||||
pthread_cond_t COND_refresh,COND_thread_count;
|
||||
pthread_t signal_thread;
|
||||
pthread_attr_t connection_attrib;
|
||||
|
||||
@ -501,7 +520,7 @@ static const char* default_dbug_option;
|
||||
char *libwrapName= NULL;
|
||||
#endif
|
||||
#ifdef HAVE_QUERY_CACHE
|
||||
ulong query_cache_limit= 0;
|
||||
static ulong query_cache_limit= 0;
|
||||
ulong query_cache_min_res_unit= QUERY_CACHE_MIN_RESULT_DATA_SIZE;
|
||||
Query_cache query_cache;
|
||||
#endif
|
||||
@ -521,7 +540,7 @@ struct st_VioSSLAcceptorFd *ssl_acceptor_fd;
|
||||
/* Function declarations */
|
||||
|
||||
static void start_signal_handler(void);
|
||||
extern "C" pthread_handler_decl(signal_hand, arg);
|
||||
static pthread_handler_decl(signal_hand, arg);
|
||||
static void mysql_init_variables(void);
|
||||
static void get_options(int argc,char **argv);
|
||||
static void set_server_version(void);
|
||||
@ -557,8 +576,6 @@ static void close_connections(void)
|
||||
#ifdef EXTRA_DEBUG
|
||||
int count=0;
|
||||
#endif
|
||||
THD *thd= current_thd;
|
||||
|
||||
DBUG_ENTER("close_connections");
|
||||
|
||||
/* Clear thread cache */
|
||||
@ -1912,12 +1929,12 @@ the problem, but since we have already crashed, something is definitely wrong\n\
|
||||
and this may fail.\n\n");
|
||||
fprintf(stderr, "key_buffer_size=%lu\n",
|
||||
(ulong) dflt_key_cache->key_cache_mem_size);
|
||||
fprintf(stderr, "read_buffer_size=%ld\n", global_system_variables.read_buff_size);
|
||||
fprintf(stderr, "max_used_connections=%ld\n", max_used_connections);
|
||||
fprintf(stderr, "max_connections=%ld\n", max_connections);
|
||||
fprintf(stderr, "threads_connected=%d\n", thread_count);
|
||||
fprintf(stderr, "read_buffer_size=%ld\n", (long) global_system_variables.read_buff_size);
|
||||
fprintf(stderr, "max_used_connections=%lu\n", max_used_connections);
|
||||
fprintf(stderr, "max_connections=%lu\n", max_connections);
|
||||
fprintf(stderr, "threads_connected=%u\n", thread_count);
|
||||
fprintf(stderr, "It is possible that mysqld could use up to \n\
|
||||
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = %ld K\n\
|
||||
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = %lu K\n\
|
||||
bytes of memory\n", ((ulong) dflt_key_cache->key_cache_mem_size +
|
||||
(global_system_variables.read_buff_size +
|
||||
global_system_variables.sortbuff_size) *
|
||||
@ -1948,7 +1965,7 @@ the thread stack. Please read http://www.mysql.com/doc/en/Linux.html\n\n",
|
||||
fprintf(stderr, "Trying to get some variables.\n\
|
||||
Some pointers may be invalid and cause the dump to abort...\n");
|
||||
safe_print_str("thd->query", thd->query, 1024);
|
||||
fprintf(stderr, "thd->thread_id=%ld\n", thd->thread_id);
|
||||
fprintf(stderr, "thd->thread_id=%lu\n", (ulong) thd->thread_id);
|
||||
}
|
||||
fprintf(stderr, "\
|
||||
The manual page at http://www.mysql.com/doc/en/Crashing.html contains\n\
|
||||
@ -2094,7 +2111,7 @@ static void start_signal_handler(void)
|
||||
/* This threads handles all signals and alarms */
|
||||
|
||||
/* ARGSUSED */
|
||||
extern "C" void *signal_hand(void *arg __attribute__((unused)))
|
||||
static void *signal_hand(void *arg __attribute__((unused)))
|
||||
{
|
||||
sigset_t set;
|
||||
int sig;
|
||||
@ -2234,7 +2251,7 @@ static void check_data_home(const char *path)
|
||||
|
||||
|
||||
/* ARGSUSED */
|
||||
extern "C" int my_message_sql(uint error, const char *str, myf MyFlags)
|
||||
static int my_message_sql(uint error, const char *str, myf MyFlags)
|
||||
{
|
||||
THD *thd;
|
||||
DBUG_ENTER("my_message_sql");
|
||||
@ -2355,7 +2372,7 @@ extern "C" pthread_handler_decl(handle_shutdown,arg)
|
||||
#endif
|
||||
|
||||
|
||||
const char *load_default_groups[]= {
|
||||
static const char *load_default_groups[]= {
|
||||
#ifdef HAVE_NDBCLUSTER_DB
|
||||
"mysql_cluster",
|
||||
#endif
|
||||
@ -2366,6 +2383,7 @@ static const int load_default_groups_sz=
|
||||
sizeof(load_default_groups)/sizeof(load_default_groups[0]);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
Initialize one of the global date/time format variables
|
||||
|
||||
@ -2383,8 +2401,8 @@ sizeof(load_default_groups)/sizeof(load_default_groups[0]);
|
||||
1 error
|
||||
*/
|
||||
|
||||
bool init_global_datetime_format(timestamp_type format_type,
|
||||
DATE_TIME_FORMAT **var_ptr)
|
||||
static bool init_global_datetime_format(timestamp_type format_type,
|
||||
DATE_TIME_FORMAT **var_ptr)
|
||||
{
|
||||
/* Get command line option */
|
||||
const char *str= opt_date_time_formats[format_type];
|
||||
@ -4351,7 +4369,6 @@ Disable with --skip-bdb (will save memory).",
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"bdb-no-sync", OPT_BDB_NOSYNC,
|
||||
"This option is deprecated, use --skip-sync-bdb-logs instead",
|
||||
// (gptr*) &opt_sync_bdb_logs, (gptr*) &opt_sync_bdb_logs, 0, GET_BOOL,
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"bdb-shared-data", OPT_BDB_SHARED,
|
||||
"Start Berkeley DB in multi-process mode.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
|
||||
@ -4573,7 +4590,7 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
|
||||
{"isam", OPT_ISAM, "Obsolete. ISAM storage engine is no longer supported.",
|
||||
(gptr*) &opt_isam, (gptr*) &opt_isam, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"language", 'L',
|
||||
{"language", 'L',
|
||||
"Client error messages in given language. May be given as a full path.",
|
||||
(gptr*) &language_ptr, (gptr*) &language_ptr, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
@ -5797,11 +5814,6 @@ static void print_version(void)
|
||||
server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT);
|
||||
}
|
||||
|
||||
static void use_help(void)
|
||||
{
|
||||
print_version();
|
||||
printf("Use '--help' or '--no-defaults --help' for a list of available options\n");
|
||||
}
|
||||
|
||||
static void usage(void)
|
||||
{
|
||||
@ -6091,7 +6103,7 @@ static void mysql_init_variables(void)
|
||||
}
|
||||
|
||||
|
||||
extern "C" my_bool
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
@ -6599,7 +6611,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
}
|
||||
/* Initiates DEBUG - but no debugging here ! */
|
||||
|
||||
extern "C" gptr *
|
||||
static gptr *
|
||||
mysql_getopt_value(const char *keyname, uint key_length,
|
||||
const struct my_option *option)
|
||||
{
|
||||
@ -6628,7 +6640,7 @@ mysql_getopt_value(const char *keyname, uint key_length,
|
||||
}
|
||||
|
||||
|
||||
void option_error_reporter(enum loglevel level, const char *format, ...)
|
||||
static void option_error_reporter(enum loglevel level, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
@ -2954,6 +2954,11 @@ bool not_all_support_one_shot(List<set_var_base> *var_list)
|
||||
|
||||
int set_var::check(THD *thd)
|
||||
{
|
||||
if (var->is_readonly())
|
||||
{
|
||||
my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0), var->name, "read only");
|
||||
return -1;
|
||||
}
|
||||
if (var->check_type(type))
|
||||
{
|
||||
int err= type == OPT_GLOBAL ? ER_LOCAL_VARIABLE : ER_GLOBAL_VARIABLE;
|
||||
|
@ -32,7 +32,7 @@ extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib;
|
||||
|
||||
enum enum_var_type
|
||||
{
|
||||
OPT_DEFAULT, OPT_SESSION, OPT_GLOBAL
|
||||
OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL
|
||||
};
|
||||
|
||||
typedef int (*sys_check_func)(THD *, set_var *);
|
||||
@ -75,6 +75,7 @@ public:
|
||||
{ return option_limits == 0; }
|
||||
Item *item(THD *thd, enum_var_type type, LEX_STRING *base);
|
||||
virtual bool is_struct() { return 0; }
|
||||
virtual bool is_readonly() const { return 0; }
|
||||
};
|
||||
|
||||
|
||||
@ -699,6 +700,7 @@ public:
|
||||
return (*value_ptr_func)(thd);
|
||||
}
|
||||
SHOW_TYPE type() { return show_type; }
|
||||
bool is_readonly() const { return 1; }
|
||||
};
|
||||
|
||||
class sys_var_thd_time_zone :public sys_var_thd
|
||||
|
@ -131,7 +131,9 @@ sp_prepare_func_item(THD* thd, Item **it_addr)
|
||||
** if nothing else.
|
||||
*/
|
||||
Item *
|
||||
sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type)
|
||||
sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type,
|
||||
MEM_ROOT *mem_root,
|
||||
Item *reuse)
|
||||
{
|
||||
DBUG_ENTER("sp_eval_func_item");
|
||||
Item *it= sp_prepare_func_item(thd, it_addr);
|
||||
@ -144,7 +146,7 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type)
|
||||
|
||||
/* QQ How do we do this? Is there some better way? */
|
||||
if (type == MYSQL_TYPE_NULL)
|
||||
it= new Item_null();
|
||||
it= new(mem_root, reuse) Item_null();
|
||||
else
|
||||
{
|
||||
switch (sp_map_result_type(type)) {
|
||||
@ -155,12 +157,12 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type)
|
||||
if (it->null_value)
|
||||
{
|
||||
DBUG_PRINT("info", ("INT_RESULT: null"));
|
||||
it= new Item_null();
|
||||
it= new(mem_root, reuse) Item_null();
|
||||
}
|
||||
else
|
||||
{
|
||||
DBUG_PRINT("info", ("INT_RESULT: %d", i));
|
||||
it= new Item_int(i);
|
||||
it= new(mem_root, reuse) Item_int(i);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -171,7 +173,7 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type)
|
||||
if (it->null_value)
|
||||
{
|
||||
DBUG_PRINT("info", ("REAL_RESULT: null"));
|
||||
it= new Item_null();
|
||||
it= new(mem_root, reuse) Item_null();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -180,7 +182,7 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type)
|
||||
uint8 decimals= it->decimals;
|
||||
uint32 max_length= it->max_length;
|
||||
DBUG_PRINT("info", ("REAL_RESULT: %g", d));
|
||||
it= new Item_float(d);
|
||||
it= new(mem_root, reuse) Item_float(d);
|
||||
it->decimals= decimals;
|
||||
it->max_length= max_length;
|
||||
}
|
||||
@ -190,9 +192,9 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type)
|
||||
{
|
||||
my_decimal value, *val= it->val_decimal(&value);
|
||||
if (it->null_value)
|
||||
it= new Item_null();
|
||||
it= new(mem_root, reuse) Item_null();
|
||||
else
|
||||
it= new Item_decimal(val);
|
||||
it= new(mem_root, reuse) Item_decimal(val);
|
||||
#ifndef DBUG_OFF
|
||||
char dbug_buff[DECIMAL_MAX_STR_LENGTH+1];
|
||||
DBUG_PRINT("info", ("DECIMAL_RESULT: %s", dbug_decimal_as_string(dbug_buff, val)));
|
||||
@ -208,14 +210,16 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type)
|
||||
if (it->null_value)
|
||||
{
|
||||
DBUG_PRINT("info", ("default result: null"));
|
||||
it= new Item_null();
|
||||
it= new(mem_root, reuse) Item_null();
|
||||
}
|
||||
else
|
||||
{
|
||||
DBUG_PRINT("info",("default result: %*s",
|
||||
s->length(), s->c_ptr_quick()));
|
||||
it= new Item_string(thd->strmake(s->ptr(), s->length()),
|
||||
s->length(), it->collation.collation);
|
||||
it= new(mem_root, reuse) Item_string(thd->strmake(s->ptr(),
|
||||
s->length()),
|
||||
s->length(),
|
||||
it->collation.collation);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -708,7 +712,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, Item **resp)
|
||||
for (i= 0 ; i < params && i < argcount ; i++)
|
||||
{
|
||||
sp_pvar_t *pvar = m_pcont->find_pvar(i);
|
||||
Item *it= sp_eval_func_item(thd, argp++, pvar->type);
|
||||
Item *it= sp_eval_func_item(thd, argp++, pvar->type, thd->mem_root, NULL);
|
||||
|
||||
if (it)
|
||||
nctx->push_item(it);
|
||||
@ -823,7 +827,8 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
|
||||
}
|
||||
else
|
||||
{
|
||||
Item *it2= sp_eval_func_item(thd, li.ref(), pvar->type);
|
||||
Item *it2= sp_eval_func_item(thd, li.ref(), pvar->type,
|
||||
thd->mem_root, NULL);
|
||||
|
||||
if (it2)
|
||||
nctx->push_item(it2); // IN or INOUT
|
||||
@ -1469,7 +1474,9 @@ sp_instr_set::exec_core(THD *thd, uint *nextp)
|
||||
Item *it;
|
||||
int res;
|
||||
|
||||
it= sp_eval_func_item(thd, &m_value, m_type);
|
||||
it= sp_eval_func_item(thd, &m_value, m_type,
|
||||
thd->mem_root,
|
||||
thd->spcont->get_item(m_offset));
|
||||
if (! it)
|
||||
res= -1;
|
||||
else
|
||||
@ -1715,7 +1722,7 @@ sp_instr_freturn::exec_core(THD *thd, uint *nextp)
|
||||
Item *it;
|
||||
int res;
|
||||
|
||||
it= sp_eval_func_item(thd, &m_value, m_type);
|
||||
it= sp_eval_func_item(thd, &m_value, m_type, thd->mem_root, NULL);
|
||||
if (! it)
|
||||
res= -1;
|
||||
else
|
||||
|
@ -43,8 +43,11 @@ sp_rcontext::sp_rcontext(uint fsize, uint hmax, uint cmax)
|
||||
int
|
||||
sp_rcontext::set_item_eval(uint idx, Item **item_addr, enum_field_types type)
|
||||
{
|
||||
extern Item *sp_eval_func_item(THD *thd, Item **it, enum_field_types type);
|
||||
Item *it= sp_eval_func_item(current_thd, item_addr, type);
|
||||
extern Item *sp_eval_func_item(THD *thd, Item **it, enum_field_types type,
|
||||
MEM_ROOT *mem_root,
|
||||
Item *reuse);
|
||||
THD *thd= current_thd;
|
||||
Item *it= sp_eval_func_item(thd, item_addr, type, thd->mem_root, NULL);
|
||||
|
||||
if (! it)
|
||||
return -1;
|
||||
@ -111,7 +114,12 @@ void
|
||||
sp_rcontext::save_variables(uint fp)
|
||||
{
|
||||
while (fp < m_count)
|
||||
m_saved.push_front(m_frame[fp++]);
|
||||
{
|
||||
Item *it= m_frame[fp];
|
||||
|
||||
m_frame[fp++]= NULL; // Prevent reuse
|
||||
m_saved.push_front(it);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -173,6 +173,9 @@ public:
|
||||
static void operator delete(void *ptr, void *buffer)
|
||||
{}
|
||||
|
||||
static void operator delete(void *buffer)
|
||||
{}
|
||||
|
||||
static String bad_geometry_data;
|
||||
|
||||
enum wkbType
|
||||
|
@ -3115,6 +3115,7 @@ void grant_free(void)
|
||||
grant_option = FALSE;
|
||||
hash_free(&column_priv_hash);
|
||||
hash_free(&proc_priv_hash);
|
||||
hash_free(&func_priv_hash);
|
||||
free_root(&memex,MYF(0));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@ -3650,7 +3651,8 @@ err:
|
||||
1 error
|
||||
*/
|
||||
|
||||
bool check_routine_level_acl(THD *thd, const char *db, const char *name, bool is_proc)
|
||||
bool check_routine_level_acl(THD *thd, const char *db, const char *name,
|
||||
bool is_proc)
|
||||
{
|
||||
bool no_routine_acl= 1;
|
||||
if (grant_option)
|
||||
@ -5662,7 +5664,8 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
|
||||
Dummy wrappers when we don't have any access checks
|
||||
****************************************************************************/
|
||||
|
||||
bool check_routine_level_acl(THD *thd, const char *db, const char *name)
|
||||
bool check_routine_level_acl(THD *thd, const char *db, const char *name,
|
||||
bool is_proc)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -978,7 +978,8 @@ int check_that_all_fields_are_given_values(THD *thd, TABLE *entry)
|
||||
for (Field **field=entry->field ; *field ; field++)
|
||||
{
|
||||
if ((*field)->query_id != thd->query_id &&
|
||||
((*field)->flags & NO_DEFAULT_VALUE_FLAG))
|
||||
((*field)->flags & NO_DEFAULT_VALUE_FLAG) &&
|
||||
((*field)->real_type() != FIELD_TYPE_ENUM))
|
||||
{
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_NO_DEFAULT_FOR_FIELD,
|
||||
|
@ -50,7 +50,8 @@ pthread_key(LEX*,THR_LEX);
|
||||
used when comparing keywords
|
||||
*/
|
||||
|
||||
uchar to_upper_lex[] = {
|
||||
static uchar to_upper_lex[]=
|
||||
{
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -1533,8 +1534,8 @@ void st_select_lex::print_order(String *str, ORDER *order)
|
||||
if (order->counter_used)
|
||||
{
|
||||
char buffer[20];
|
||||
my_snprintf(buffer, 20, "%u", order->counter);
|
||||
str->append(buffer);
|
||||
uint length= my_snprintf(buffer, 20, "%d", order->counter);
|
||||
str->append(buffer, length);
|
||||
}
|
||||
else
|
||||
(*order->item)->print(str);
|
||||
|
@ -899,10 +899,11 @@ struct st_lex_local: public st_lex
|
||||
{ /* Never called */ }
|
||||
};
|
||||
|
||||
void lex_init(void);
|
||||
void lex_free(void);
|
||||
void lex_start(THD *thd, uchar *buf,uint length);
|
||||
void lex_end(LEX *lex);
|
||||
extern void lex_init(void);
|
||||
extern void lex_free(void);
|
||||
extern void lex_start(THD *thd, uchar *buf,uint length);
|
||||
extern void lex_end(LEX *lex);
|
||||
extern int yylex(void *arg, void *yythd);
|
||||
|
||||
extern pthread_key(LEX*,THR_LEX);
|
||||
|
||||
|
@ -5436,12 +5436,9 @@ new_create_field(THD *thd, char *field_name, enum_field_types type,
|
||||
new_field->comment=*comment;
|
||||
/*
|
||||
Set flag if this field doesn't have a default value
|
||||
Enum values has always the first value as a default (set in
|
||||
make_empty_rec().
|
||||
*/
|
||||
if (!default_value && !(type_modifier & AUTO_INCREMENT_FLAG) &&
|
||||
(type_modifier & NOT_NULL_FLAG) && type != FIELD_TYPE_TIMESTAMP &&
|
||||
type != FIELD_TYPE_ENUM)
|
||||
(type_modifier & NOT_NULL_FLAG) && type != FIELD_TYPE_TIMESTAMP)
|
||||
new_field->flags|= NO_DEFAULT_VALUE_FLAG;
|
||||
|
||||
if (length && !(new_field->length= (uint) atoi(length)))
|
||||
|
@ -1928,6 +1928,50 @@ Cursor::~Cursor()
|
||||
|
||||
/*********************************************************************/
|
||||
|
||||
/*
|
||||
An entry point to single-unit select (a select without UNION).
|
||||
|
||||
SYNOPSIS
|
||||
mysql_select()
|
||||
|
||||
thd thread handler
|
||||
rref_pointer_array a reference to ref_pointer_array of
|
||||
the top-level select_lex for this query
|
||||
tables list of all tables used in this query.
|
||||
The tables have been pre-opened.
|
||||
wild_num number of wildcards used in the top level
|
||||
select of this query.
|
||||
For example statement
|
||||
SELECT *, t1.*, catalog.t2.* FROM t0, t1, t2;
|
||||
has 3 wildcards.
|
||||
fields list of items in SELECT list of the top-level
|
||||
select
|
||||
e.g. SELECT a, b, c FROM t1 will have Item_field
|
||||
for a, b and c in this list.
|
||||
conds top level item of an expression representing
|
||||
WHERE clause of the top level select
|
||||
og_num total number of ORDER BY and GROUP BY clauses
|
||||
arguments
|
||||
order linked list of ORDER BY agruments
|
||||
group linked list of GROUP BY arguments
|
||||
having top level item of HAVING expression
|
||||
proc_param list of PROCEDUREs
|
||||
select_options select options (BIG_RESULT, etc)
|
||||
result an instance of result set handling class.
|
||||
This object is responsible for send result
|
||||
set rows to the client or inserting them
|
||||
into a table.
|
||||
select_lex the only SELECT_LEX of this query
|
||||
unit top-level UNIT of this query
|
||||
UNIT is an artificial object created by the parser
|
||||
for every SELECT clause.
|
||||
e.g. SELECT * FROM t1 WHERE a1 IN (SELECT * FROM t2)
|
||||
has 2 unions.
|
||||
|
||||
RETURN VALUE
|
||||
FALSE success
|
||||
TRUE an error
|
||||
*/
|
||||
|
||||
bool
|
||||
mysql_select(THD *thd, Item ***rref_pointer_array,
|
||||
|
@ -1200,6 +1200,7 @@ static bool safe_update_on_fly(JOIN_TAB *join_tab, List<Item> *fields)
|
||||
case JT_EQ_REF:
|
||||
return TRUE; // At most one matching row
|
||||
case JT_REF:
|
||||
case JT_REF_OR_NULL:
|
||||
return !check_if_key_used(table, join_tab->ref.key, *fields);
|
||||
case JT_ALL:
|
||||
/* If range search on index */
|
||||
|
183
sql/sql_yacc.yy
183
sql/sql_yacc.yy
@ -698,7 +698,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
|
||||
opt_var_ident_type delete_option opt_temporary all_or_any opt_distinct
|
||||
opt_ignore_leaves fulltext_options spatial_type union_option
|
||||
start_transaction_opts opt_chain opt_release
|
||||
union_opt select_derived_init
|
||||
union_opt select_derived_init option_type option_type2
|
||||
|
||||
%type <ulong_num>
|
||||
ulong_num raid_types merge_insert_types
|
||||
@ -3994,7 +3994,7 @@ select_options:
|
||||
YYABORT;
|
||||
}
|
||||
}
|
||||
;
|
||||
;
|
||||
|
||||
select_option_list:
|
||||
select_option_list select_option
|
||||
@ -7475,7 +7475,7 @@ option_type_value:
|
||||
lex->sphead->m_tmp_query= lex->tok_start;
|
||||
}
|
||||
}
|
||||
option_type option_value
|
||||
ext_option_value
|
||||
{
|
||||
LEX *lex= Lex;
|
||||
|
||||
@ -7516,11 +7516,15 @@ option_type_value:
|
||||
};
|
||||
|
||||
option_type:
|
||||
/* empty */ {}
|
||||
| GLOBAL_SYM { Lex->option_type= OPT_GLOBAL; }
|
||||
| LOCAL_SYM { Lex->option_type= OPT_SESSION; }
|
||||
| SESSION_SYM { Lex->option_type= OPT_SESSION; }
|
||||
| ONE_SHOT_SYM { Lex->option_type= OPT_SESSION; Lex->one_shot_set= 1; }
|
||||
option_type2 {}
|
||||
| GLOBAL_SYM { $$=OPT_GLOBAL; }
|
||||
| LOCAL_SYM { $$=OPT_SESSION; }
|
||||
| SESSION_SYM { $$=OPT_SESSION; }
|
||||
;
|
||||
|
||||
option_type2:
|
||||
/* empty */ { $$= OPT_DEFAULT; }
|
||||
| ONE_SHOT_SYM { Lex->one_shot_set= 1; $$= OPT_SESSION; }
|
||||
;
|
||||
|
||||
opt_var_type:
|
||||
@ -7537,89 +7541,110 @@ opt_var_ident_type:
|
||||
| SESSION_SYM '.' { $$=OPT_SESSION; }
|
||||
;
|
||||
|
||||
option_value:
|
||||
'@' ident_or_text equal expr
|
||||
{
|
||||
Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var($2,$4)));
|
||||
}
|
||||
| internal_variable_name equal set_expr_or_default
|
||||
{
|
||||
LEX *lex=Lex;
|
||||
ext_option_value:
|
||||
sys_option_value
|
||||
| option_type2 option_value;
|
||||
|
||||
if ($1.var == &trg_new_row_fake_var)
|
||||
sys_option_value:
|
||||
option_type internal_variable_name equal set_expr_or_default
|
||||
{
|
||||
LEX *lex=Lex;
|
||||
|
||||
if ($2.var == &trg_new_row_fake_var)
|
||||
{
|
||||
/* We are in trigger and assigning value to field of new row */
|
||||
Item *it;
|
||||
sp_instr_set_trigger_field *i;
|
||||
if ($1)
|
||||
{
|
||||
/* We are in trigger and assigning value to field of new row */
|
||||
Item *it;
|
||||
sp_instr_set_trigger_field *i;
|
||||
if (lex->query_tables)
|
||||
{
|
||||
my_message(ER_SP_SUBSELECT_NYI, ER(ER_SP_SUBSELECT_NYI),
|
||||
MYF(0));
|
||||
YYABORT;
|
||||
}
|
||||
if ($3)
|
||||
it= $3;
|
||||
else
|
||||
{
|
||||
/* QQ: Shouldn't this be field's default value ? */
|
||||
it= new Item_null();
|
||||
}
|
||||
|
||||
if (!(i= new sp_instr_set_trigger_field(
|
||||
lex->sphead->instructions(), lex->spcont,
|
||||
$1.base_name, it)))
|
||||
YYABORT;
|
||||
|
||||
/*
|
||||
Let us add this item to list of all Item_trigger_field
|
||||
objects in trigger.
|
||||
*/
|
||||
lex->trg_table_fields.link_in_list((byte *)&i->trigger_field,
|
||||
(byte **)&i->trigger_field.next_trg_field);
|
||||
|
||||
lex->sphead->add_instr(i);
|
||||
yyerror(ER(ER_SYNTAX_ERROR));
|
||||
YYABORT;
|
||||
}
|
||||
else if ($1.var)
|
||||
{ /* System variable */
|
||||
lex->var_list.push_back(new set_var(lex->option_type, $1.var,
|
||||
&$1.base_name, $3));
|
||||
}
|
||||
if (lex->query_tables)
|
||||
{
|
||||
my_message(ER_SP_SUBSELECT_NYI, ER(ER_SP_SUBSELECT_NYI),
|
||||
MYF(0));
|
||||
YYABORT;
|
||||
}
|
||||
if ($4)
|
||||
it= $4;
|
||||
else
|
||||
{
|
||||
/* An SP local variable */
|
||||
sp_pcontext *ctx= lex->spcont;
|
||||
sp_pvar_t *spv;
|
||||
sp_instr_set *i;
|
||||
Item *it;
|
||||
{
|
||||
/* QQ: Shouldn't this be field's default value ? */
|
||||
it= new Item_null();
|
||||
}
|
||||
|
||||
spv= ctx->find_pvar(&$1.base_name);
|
||||
if (!(i= new sp_instr_set_trigger_field(
|
||||
lex->sphead->instructions(), lex->spcont,
|
||||
$2.base_name, it)))
|
||||
YYABORT;
|
||||
|
||||
if ($3)
|
||||
it= $3;
|
||||
else if (spv->dflt)
|
||||
it= spv->dflt;
|
||||
else
|
||||
it= new Item_null();
|
||||
i= new sp_instr_set(lex->sphead->instructions(), ctx,
|
||||
spv->offset, it, spv->type, lex, TRUE);
|
||||
lex->sphead->add_instr(i);
|
||||
spv->isset= TRUE;
|
||||
}
|
||||
}
|
||||
/*
|
||||
Let us add this item to list of all Item_trigger_field
|
||||
objects in trigger.
|
||||
*/
|
||||
lex->trg_table_fields.link_in_list((byte *)&i->trigger_field,
|
||||
(byte **)&i->trigger_field.next_trg_field);
|
||||
|
||||
lex->sphead->add_instr(i);
|
||||
}
|
||||
else if ($2.var)
|
||||
{ /* System variable */
|
||||
if ($1)
|
||||
lex->option_type= (enum_var_type)$1;
|
||||
lex->var_list.push_back(new set_var(lex->option_type, $2.var,
|
||||
&$2.base_name, $4));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* An SP local variable */
|
||||
sp_pcontext *ctx= lex->spcont;
|
||||
sp_pvar_t *spv;
|
||||
sp_instr_set *i;
|
||||
Item *it;
|
||||
if ($1)
|
||||
{
|
||||
yyerror(ER(ER_SYNTAX_ERROR));
|
||||
YYABORT;
|
||||
}
|
||||
|
||||
spv= ctx->find_pvar(&$2.base_name);
|
||||
|
||||
if ($4)
|
||||
it= $4;
|
||||
else if (spv->dflt)
|
||||
it= spv->dflt;
|
||||
else
|
||||
it= new Item_null();
|
||||
i= new sp_instr_set(lex->sphead->instructions(), ctx,
|
||||
spv->offset, it, spv->type, lex, TRUE);
|
||||
lex->sphead->add_instr(i);
|
||||
spv->isset= TRUE;
|
||||
}
|
||||
}
|
||||
| option_type TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types
|
||||
{
|
||||
LEX *lex=Lex;
|
||||
if (!$1)
|
||||
lex->option_type= (enum_var_type)$1;
|
||||
lex->var_list.push_back(new set_var(lex->option_type,
|
||||
find_sys_var("tx_isolation"),
|
||||
&null_lex_str,
|
||||
new Item_int((int32) $5)));
|
||||
}
|
||||
;
|
||||
|
||||
option_value:
|
||||
'@' ident_or_text equal expr
|
||||
{
|
||||
Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var($2,$4)));
|
||||
}
|
||||
| '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default
|
||||
{
|
||||
LEX *lex=Lex;
|
||||
lex->var_list.push_back(new set_var((enum_var_type) $3, $4.var,
|
||||
&$4.base_name, $6));
|
||||
}
|
||||
| TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types
|
||||
{
|
||||
LEX *lex=Lex;
|
||||
lex->var_list.push_back(new set_var(lex->option_type,
|
||||
find_sys_var("tx_isolation"),
|
||||
&null_lex_str,
|
||||
new Item_int((int32) $4)));
|
||||
}
|
||||
| charset old_or_new_charset_name_or_default
|
||||
{
|
||||
THD *thd= YYTHD;
|
||||
|
@ -787,6 +787,7 @@ static void verify_field_count(MYSQL_RES *result, uint exp_count)
|
||||
|
||||
/* Utility function to execute a query using prepare-execute */
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
static void execute_prepare_query(const char *query, ulonglong exp_count)
|
||||
{
|
||||
MYSQL_STMT *stmt;
|
||||
@ -807,7 +808,7 @@ static void execute_prepare_query(const char *query, ulonglong exp_count)
|
||||
DIE_UNLESS(affected_rows == exp_count);
|
||||
mysql_stmt_close(stmt);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Store result processing */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user