Merge mysql.com:/home/my/mysql-5.1

into  mysql.com:/home/my/mysql-new


BitKeeper/etc/ignore:
  auto-union
BUILD/SETUP.sh:
  Auto merged
CMakeLists.txt:
  Auto merged
client/get_password.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
cmd-line-utils/readline/bind.c:
  Auto merged
cmd-line-utils/readline/display.c:
  Auto merged
cmd-line-utils/readline/histexpand.c:
  Auto merged
cmd-line-utils/readline/history.c:
  Auto merged
cmd-line-utils/readline/readline.c:
  Auto merged
cmd-line-utils/readline/text.c:
  Auto merged
dbug/user.r:
  Auto merged
extra/yassl/src/handshake.cpp:
  Auto merged
include/config-win.h:
  Auto merged
include/m_string.h:
  Auto merged
include/my_global.h:
  Auto merged
include/my_pthread.h:
  Auto merged
include/mysql/plugin.h:
  Auto merged
include/mysql_com.h:
  Auto merged
include/thr_alarm.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
libmysql/dll.c:
  Auto merged
libmysql/get_password.c:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/alter_table.result:
  Auto merged
mysql-test/r/change_user.result:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/merge.result:
  Auto merged
mysql-test/r/mix2_myisam.result:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/valgrind.supp:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_events.result:
  Auto merged
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
mysys/mf_iocache.c:
  Auto merged
mysys/mf_tempfile.c:
  Auto merged
mysys/my_atomic.c:
  Auto merged
mysys/my_bit.c:
  Auto merged
mysys/my_bitmap.c:
  Auto merged
mysys/my_compress.c:
  Auto merged
mysys/my_create.c:
  Auto merged
mysys/my_delete.c:
  Auto merged
mysys/my_error.c:
  Auto merged
mysys/my_init.c:
  Auto merged
mysys/my_open.c:
  Auto merged
mysys/my_realloc.c:
  Auto merged
mysys/my_rename.c:
  Auto merged
mysys/my_symlink.c:
  Auto merged
mysys/my_sync.c:
  Auto merged
mysys/my_thr_init.c:
  Auto merged
mysys/thr_alarm.c:
  Auto merged
mysys/thr_lock.c:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
server-tools/instance-manager/mysql_connection.cc:
  Auto merged
sql/CMakeLists.txt:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/events.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/gen_lex_hash.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_partition.h:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/partition_info.cc:
  Auto merged
sql/rpl_injector.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_test.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/unireg.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
storage/csv/ha_tina.cc:
  Auto merged
storage/csv/ha_tina.h:
  Auto merged
storage/myisam/CMakeLists.txt:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_eval.c:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/ft_parser.c:
  Auto merged
storage/myisam/ft_static.c:
  Auto merged
storage/myisam/ft_stopwords.c:
  Auto merged
storage/myisam/ft_test1.c:
  Auto merged
storage/myisam/ft_update.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_create.c:
  Auto merged
storage/myisam/mi_delete.c:
  Auto merged
storage/myisam/mi_delete_all.c:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
storage/myisam/mi_key.c:
  Auto merged
storage/myisam/mi_packrec.c:
  Auto merged
storage/myisam/mi_range.c:
  Auto merged
storage/myisam/mi_search.c:
  Auto merged
storage/myisam/mi_test1.c:
  Auto merged
storage/myisam/mi_test2.c:
  Auto merged
storage/myisam/mi_test3.c:
  Auto merged
storage/myisam/mi_unique.c:
  Auto merged
storage/myisam/mi_write.c:
  Auto merged
storage/myisam/myisamchk.c:
  Auto merged
storage/myisam/myisamdef.h:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
storage/myisam/sort.c:
  Auto merged
storage/myisam/sp_test.c:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
configure.in:
  Manual merge
dbug/dbug.c:
  Restore to original state in Maria tree
  The big diff comes from a wrong pull from 5.0 -> 5.1 after backporting dbug to 5.0 from 5.1
include/Makefile.am:
  Manual merge
include/my_atomic.h:
  Ignore changes
include/my_base.h:
  Manual merge
include/my_dbug.h:
  Use orginal my_dbug.h from maria tree
include/my_handler.h:
  Manual merge
include/my_sys.h:
  Manual merge
include/myisam.h:
  Manual merge
mysql-test/lib/mtr_report.pl:
  Manual merge
mysql-test/r/myisam.result:
  Manual merge
mysql-test/suite/binlog/r/binlog_unsafe.result:
  Manual merge
mysql-test/suite/binlog/t/binlog_unsafe.test:
  Manual merge
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
  Manual merge
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
  No changes
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
  Manual merge
mysql-test/t/change_user.test:
  Manual merge
mysql-test/t/disabled.def:
  Manual merge
mysql-test/t/merge.test:
  No changes
mysql-test/t/myisam.test:
  Manual merge
mysys/Makefile.am:
  Manual merge
mysys/array.c:
  Manual merge
mysys/mf_keycache.c:
  Manual merge
mysys/my_getsystime.c:
  Manual merge
mysys/my_handler.c:
  Manual merge
mysys/my_pread.c:
  Manual merge
mysys/safemalloc.c:
  Manual merge
sql/ha_partition.cc:
  Manual merge
sql/handler.cc:
  Manual merge
sql/lex.h:
  Manual merge
sql/mysql_priv.h:
  Manual merge
sql/mysqld.cc:
  Manual merge
sql/set_var.h:
  Manual merge
sql/sql_class.cc:
  Manual merge
sql/sql_insert.cc:
  Manual merge
sql/sql_parse.cc:
  Manual merge
sql/sql_select.cc:
  Manual merge
sql/sql_show.cc:
  Manual merge
sql/sql_table.cc:
  Manual merge
storage/myisam/mi_checksum.c:
  No changes
storage/myisam/mi_extra.c:
  Manual merge
storage/myisam/mi_open.c:
  Manual merge
storage/myisammrg/ha_myisammrg.cc:
  Manual merge
strings/strmake.c:
  No changes
This commit is contained in:
unknown 2008-04-28 19:24:05 +03:00
commit 50ceea65cf
1189 changed files with 158244 additions and 124472 deletions

View File

@ -10,11 +10,14 @@
*.core
*.d
*.da
*.dll
*.exe
*.exp
*.gcda
*.gcno
*.gcov
*.idb
*.ilk
*.la
*.lai
*.lib
@ -59,6 +62,7 @@
./mysql.sln
./mysql.suo
./prepare
.DS_Store
.defs.mk
.depend
.depend.mk
@ -459,6 +463,7 @@ cmd-line-utils/readline/.deps/undo.Po
cmd-line-utils/readline/.deps/util.Po
cmd-line-utils/readline/.deps/vi_mode.Po
cmd-line-utils/readline/.deps/xmalloc.Po
comments
comon.h
comp_err/*.ds?
comp_err/*.vcproj
@ -494,6 +499,7 @@ dbug/factorial
dbug/factorial.r
dbug/main.r
dbug/output*.r
dbug/tests
dbug/user.ps
dbug/user.t
debian/control
@ -1180,6 +1186,7 @@ libmysqld/sql_parse.cc
libmysqld/sql_partition.cc
libmysqld/sql_plugin.cc
libmysqld/sql_prepare.cc
libmysqld/sql_profile.cc
libmysqld/sql_rename.cc
libmysqld/sql_repl.cc
libmysqld/sql_select.cc
@ -1221,7 +1228,10 @@ linked_server_sources
linked_tools_sources
locked
ltmain.sh
ma_test_recovery.output
man/*.1
maria-win.patch
maria_log.00000*
maria_log_control
merge/*.ds?
merge/*.vcproj
@ -1282,6 +1292,9 @@ mysql-5.0.2-alpha.tar.gz
mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
mysql-test/*.ds?
mysql-test/*.vcproj
mysql-test/.DS_Store
mysql-test/funcs_1.log
mysql-test/funcs_1.tar
mysql-test/gmon.out
mysql-test/install_test_db
mysql-test/lib/init_db.sql
@ -1370,9 +1383,12 @@ mysql-test/r/symlink.log
mysql-test/r/system_mysql_db.log
mysql-test/r/tmp.result
mysql-test/r/udf.log
mysql-test/reg.log
mysql-test/rpl.log
mysql-test/share/mysql
mysql-test/std_data/*.pem
mysql-test/suite/funcs_1.tar.gz
mysql-test/suite/funcs_1.tar.zip
mysql-test/suite/funcs_1/r/innodb_trig_03e.warnings
mysql-test/suite/funcs_1/r/innodb_views.warnings
mysql-test/suite/funcs_1/r/memory_trig_03e.warnings
@ -2443,6 +2459,7 @@ storage/maria/ma_test_all
storage/maria/maria.log
storage/maria/maria_chk
storage/maria/maria_control
storage/maria/maria_dump_log
storage/maria/maria_ftdump
storage/maria/maria_log
storage/maria/maria_log.*
@ -2471,6 +2488,7 @@ storage/maria/unittest/mf_pagecache_consist_64kWR-t-big
storage/maria/unittest/mf_pagecache_single_64k-t-big
storage/maria/unittest/page_cache_test_file_1
storage/maria/unittest/pagecache_debug.log
storage/maria/unittest/tmp/*
storage/myisam/.deps/ft_boolean_search.Po
storage/myisam/.deps/ft_nlq_search.Po
storage/myisam/.deps/ft_parser.Po
@ -2992,6 +3010,7 @@ test/tools/ndb_cpcc
test/tools/restart
test/tools/verify_index
test1/*
test?.MA?
test_xml
tests/*.ds?
tests/*.vcproj
@ -3042,6 +3061,7 @@ unittest/mytap/t/*.t
unittest/mytap/t/.deps/basic-t.Po
unittest/page_cache_test_file_1
unittest/pagecache_debug.log
unittest/tmp/*
unittest/unit
vi.h
vio/*.ds?
@ -3066,16 +3086,3 @@ win/vs8cache.txt
ylwrap
zlib/*.ds?
zlib/*.vcproj
libmysqld/sql_profile.cc
*.dll
*.ilk
*.exp
comments
maria-win.patch
storage/maria/maria_dump_log
maria_log.00000*
ma_test_recovery.output
test?.MA?
dbug/tests
storage/maria/unittest/tmp/*
unittest/tmp/*

View File

@ -100,8 +100,10 @@ if [ "x$warning_mode" != "xpedantic" ]; then
# C warnings
c_warnings="$warnings -Wunused-parameter"
# C++ warnings
cxx_warnings="$warnings -Woverloaded-virtual -Wsign-promo -Wreorder"
cxx_warnings="$warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
cxx_warnings="$warnings"
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
cxx_warnings="$cxx_warnings -Wreorder"
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
# Added unless --with-debug=full
debug_extra_cflags="-O1 -Wuninitialized"
else

1516
BUILD/build_mccge.sh Executable file

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,9 @@
#
# Check cpu of current machine and find the
# best compiler optimization flags for gcc
# Will return result in:
# cpu_arg : Type of CPU
# check_cpu_args : Arguments for GCC compiler settings
#
check_cpu () {
@ -33,7 +36,7 @@ check_cpu () {
# parse CPU flags
for flag in `$cpuinfo | grep '^flags' | sed -e 's/^flags.*: //' -e 's/[^a-zA-Z0-9_ ]/_/g'`; do
eval cpu_flag_$flag=yes
eval cpu_flag_$flag=yes
done
else
# Fallback when there is no /proc/cpuinfo
@ -62,92 +65,95 @@ check_cpu () {
Alpha*EV6*)
cpu_arg="ev6";
;;
# Intel ia32
*Intel*Core*|*X[eE][oO][nN]*)
# a Xeon is just another pentium4 ...
# ... unless it has the "lm" (long-mode) flag set,
# in that case it's a Xeon with EM64T support
# If SSE3 support exists it is a Core2 Duo or newer
# So is Intel Core.
if [ -z "$cpu_flag_lm" ]; then
cpu_arg="pentium4";
else
cpu_arg="nocona";
if [ -z "$cpu_flag_lm" ]; then
cpu_arg="pentium4"
else
cpu_arg="nocona"
fi
if test -z "$cpu_flag_ssse3" ; then
core2="no"
else
core2="yes"
fi
;;
*Pentium*4*Mobile*)
cpu_arg="pentium4m";
;;
cpu_arg="pentium4m"
;;
*Pentium*4*)
cpu_arg="pentium4";
cpu_arg="pentium4"
;;
*Pentium*III*Mobile*)
cpu_arg="pentium3m";
;;
cpu_arg="pentium3m"
;;
*Pentium*III*)
cpu_arg="pentium3";
;;
cpu_arg="pentium3"
;;
*Pentium*M*pro*)
cpu_arg="pentium-m";
cpu_arg="pentium-m"
;;
*Celeron\(R\)*\ M*)
cpu_arg="pentium-m";
;;
cpu_arg="pentium-m"
;;
*Celeron*Coppermine*)
cpu_arg="pentium3"
;;
;;
*Celeron\(R\)*)
cpu_arg="pentium4"
;;
;;
*Celeron*)
cpu_arg="pentium2";
;;
*Athlon*64*)
cpu_arg="athlon64";
cpu_arg="pentium2"
;;
*Turion*)
cpu_arg="athlon64";
cpu_arg="athlon64"
;;
*Opteron*)
cpu_arg="athlon64";
*Athlon*64*)
cpu_arg="athlon64"
;;
*Athlon*)
cpu_arg="athlon";
cpu_arg="athlon"
;;
*Opteron*)
cpu_arg="opteron";
cpu_arg="opteron"
;;
# MacOSX / Intel
*i386*i486*)
cpu_arg="pentium-m";
cpu_arg="pentium-m"
;;
*i386*)
cpu_arg="i386"
;;
#Core 2 Duo
*Intel*Core\(TM\)2*)
cpu_arg="nocona";
cpu_arg="nocona"
;;
# Intel ia64
*Itanium*)
# Don't need to set any flags for itanium(at the moment)
cpu_arg="";
cpu_arg="itanium"
;;
#
# Solaris Sparc
*sparc*sun4u*)
cpu_arg="sparc"
;;
# Power PC
*ppc*)
cpu_arg='powerpc'
cpu_arg="powerpc"
;;
*powerpc*)
cpu_arg='powerpc'
cpu_arg="powerpc"
;;
# unknown
*)
cpu_arg="";
cpu_arg=""
;;
esac
if test -z "$cpu_arg" ; then
if test "$CPUINFO" != " " ; then
# fallback to uname if necessary
@ -176,29 +182,22 @@ check_cpu () {
cc_minor=$2
cc_patch=$3
cc_comp=`expr $cc_major '*' 100 '+' $cc_minor`
case "$cc_ver--$cc_verno" in
*GCC*)
# different gcc backends (and versions) have different CPU flags
case `gcc -dumpmachine` in
i?86-*)
if test "$cc_comp" -lt 304
then
check_cpu_args='-mcpu=$cpu_arg'
i?86-* | x86_64-*)
if test "$cc_comp" -lt 304 ; then
check_cpu_cflags="-mcpu=${cpu_arg}"
elif test "$cc_comp" -ge 402 ; then
check_cpu_cflags="-mtune=native"
else
check_cpu_args='-mtune=$cpu_arg'
check_cpu_cflags="-mtune=${cpu_arg}"
fi
;;
ppc-*)
check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg'
;;
x86_64-*)
if test "$cc_comp" -lt 304
then
check_cpu_args='-mcpu=$cpu_arg'
else
check_cpu_args='-mtune=$cpu_arg'
fi
check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}"
;;
*)
check_cpu_cflags=""
@ -208,7 +207,7 @@ check_cpu () {
;;
2.95.*)
# GCC 2.95 doesn't expose its name in --version output
check_cpu_args='-m$cpu_arg'
check_cpu_cflags="-m${cpu_arg}"
;;
*)
check_cpu_cflags=""
@ -219,41 +218,23 @@ check_cpu () {
# now we check whether the compiler really understands the cpu type
touch __test.c
if test "x$core2" = "xyes" ; then
cpu_arg="core2"
fi
while [ "$cpu_arg" ] ; do
printf "testing $cpu_arg ... " >&2
# compile check
check_cpu_cflags=`eval echo $check_cpu_args`
if $cc -c $check_cpu_cflags __test.c 2>/dev/null; then
echo ok >&2
break;
eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null
if test "x$?" = "x0" ; then
echo ok >&2
break;
fi
echo failed >&2
check_cpu_cflags=""
# if compile failed: check whether it supports a predecessor of this CPU
# this list is not complete, feel free to add further entries
case "$cpu_arg" in
# Intel ia32
nocona) cpu_arg=pentium4 ;;
prescott) cpu_arg=pentium4 ;;
pentium4m) cpu_arg=pentium4 ;;
pentium4) cpu_arg=pentium3 ;;
pentium3m) cpu_arg=pentium3 ;;
pentium3) cpu_arg=pentium2 ;;
pentium2) cpu_arg=pentiumpro ;;
pentiumpro) cpu_arg=pentium ;;
pentium) cpu_arg=i486 ;;
i486) cpu_arg=i386 ;;
# power / powerPC
7450) cpu_arg=7400 ;;
*) cpu_arg="" ;;
esac
break;
done
rm __test.*
}

View File

@ -0,0 +1,22 @@
#! /usr/bin/perl
use strict;
use warnings;
use FindBin;
require "$FindBin::Bin/triggers-lib.pl";
# Don't run unless commit was successful
check_status() || exit 0;
my $cset = latest_cset();
# Read most recent ChangeSet's changed files. Send merge changes along, since
# they'll need to be incorporated in InnoDB's source tree eventually.
my $changes = innodb_get_changes('cset', $cset, 'yes')
or exit 0;
innodb_send_changes_email($cset, $changes)
or exit 1;
exit 0;

View File

@ -0,0 +1,30 @@
#! /usr/bin/perl
use strict;
use warnings;
use FindBin;
require "$FindBin::Bin/triggers-lib.pl";
# Don't run unless push/pull was successful
check_status() or exit 0;
# Don't run if push/pull is in local clones
exit 0 if repository_type() eq 'local';
# For each pushed ChangeSet, check it for InnoDB files and send
# diff of entire ChangeSet to InnoDB developers if such changes
# exist.
my $error = 0;
foreach my $cset (read_bk_csetlist())
{
my $changes = innodb_get_changes('cset', $cset, 'yes')
or next;
innodb_send_changes_email($cset, $changes)
or $error = 1;
}
exit ($error == 0 ? 0 : 1);

View File

@ -0,0 +1,21 @@
#! /usr/bin/perl
use strict;
use warnings;
use FindBin;
require "$FindBin::Bin/triggers-lib.pl";
die "$0: Script error: \$BK_PENDING is not set in pre-commit trigger\n"
unless defined $ENV{BK_PENDING};
# Read changed files from $BK_PENDING directly. Do not bother user about
# merge changes; they don't have any choice, the merge must be done.
my $changes = innodb_get_changes('file', $ENV{BK_PENDING}, undef)
or exit 0;
innodb_inform_and_query_user($changes)
or exit 1; # Abort commit
# OK, continue with commit
exit 0;

View File

@ -0,0 +1,356 @@
# To use this convenience library in a trigger, simply require it at
# at the top of the script. For example:
#
# #! /usr/bin/perl
#
# use FindBin;
# require "$FindBin::Bin/triggers-lib.pl";
#
# FindBin is needed, because sometimes a trigger is called from the
# RESYNC directory, and the trigger dir is ../BitKeeper/triggers
use strict;
use warnings;
use Carp;
use FindBin;
my $mysql_version = "5.1";
# These addresses must be kept current in all MySQL versions.
# See the wiki page InnoDBandOracle.
#my @innodb_to_email = ('dev_innodb_ww@oracle.com');
#my @innodb_cc_email = ('dev-innodb@mysql.com');
# FIXME: Keep this for testing; remove it once it's been used for a
# week or two.
my @innodb_to_email = ('tim@mysql.com');
my @innodb_cc_email = ();
# This is for MySQL >= 5.1. Regex which defines the InnoDB files
# which should generally not be touched by MySQL developers.
my $innodb_files_description = <<EOF;
storage/innobase/*
mysql-test/t/innodb* (except mysql-test/t/innodb_mysql*)
mysql-test/r/innodb* (except mysql-test/r/innodb_mysql*)
EOF
my $innodb_files_regex = qr{
^
(
# Case 1: innobase/*
storage/innobase/
|
# Case 2: mysql-test/[tr]/innodb* (except innodb_mysql*)
mysql-test/(t|r)/SCCS/s.innodb
# The mysql-test/[tr]/innodb_mysql* are OK to edit
(?!_mysql)
)
}x;
# See 'bk help log', and the format of, e.g., $BK_PENDING.
# Important: this already contains the terminating newline!
my $file_rev_dspec = ':SFILE:|:REV:\n';
my $bktmp = "$FindBin::Bin/../tmp";
my $sendmail;
foreach ('/usr/sbin/sendmail', 'sendmail') {
$sendmail = $_;
last if -x $sendmail;
}
my $from = $ENV{REAL_EMAIL} || $ENV{USER} . '@mysql.com';
# close_or_warn
# $fh file handle to be closed
# $description description of the file handle
# RETURN Return value of close($fh)
#
# Print a nice warning message if close() isn't successful. See
# perldoc perlvar and perldoc -f close for details.
sub close_or_warn (*$)
{
my ($fh, $description) = @_;
my $status = close $fh;
if (not $status) {
warn "$0: error on close of '$description': ",
($! ? "$!" : "exit status " . ($? >> 8)), "\n";
}
return $status;
}
# check_status
# $warn If true, warn about bad status
# RETURN TRUE, if $BK_STATUS is "OK"; FALSE otherwise
#
# Also checks the undocumented $BK_COMMIT env variable
sub check_status
{
my ($warn) = @_;
my $status = (grep { defined $_ }
$ENV{BK_STATUS}, $ENV{BK_COMMIT}, '<undef>')[0];
unless ($status eq 'OK')
{
warn "Bad BK_STATUS '$status'\n" if $warn;
return undef;
}
return 1;
}
# repository_location
#
# RETURN ('HOST', 'ROOT') for the repository being modified
sub repository_location
{
if ($ENV{BK_SIDE} eq 'client') {
return ($ENV{BK_HOST}, $ENV{BK_ROOT});
} else {
return ($ENV{BKD_HOST}, $ENV{BKD_ROOT});
}
}
# repository_type
# RETURN:
# 'main' for repo on bk-internal with post-incoming.bugdb trigger
# 'team' for repo on bk-internal with post-incoming.queuepush.pl trigger
# 'local' otherwise
#
# This definition may need to be modified if the host name or triggers change.
sub repository_type
{
my ($host, $root) = repository_location();
return 'local'
unless uc($host) eq 'BK-INTERNAL.MYSQL.COM'
and -e "$root/BitKeeper/triggers/post-incoming.queuepush.pl";
return 'main' if -e "$root/BitKeeper/triggers/post-incoming.bugdb";
return 'team';
}
# latest_cset
# RETURN Key for most recent ChangeSet
sub latest_cset {
chomp(my $retval = `bk changes -r+ -k`);
return $retval;
}
# read_bk_csetlist
# RETURN list of cset keys from $BK_CSETLIST file
sub read_bk_csetlist
{
die "$0: script error: \$BK_CSETLIST not set\n"
unless defined $ENV{BK_CSETLIST};
open CSETS, '<', $ENV{BK_CSETLIST}
or die "$0: can't read \$BK_CSETLIST='$ENV{BK_CSETLIST}': $!\n";
chomp(my @csets = <CSETS>);
close_or_warn(CSETS, "\$BK_CSETLIST='$ENV{BK_CSETLIST}'");
return @csets;
}
# innodb_get_changes
# $type 'file' or 'cset'
# $value file name (e.g., $BK_PENDING) or ChangeSet key
# $want_merge_changes flag; if false, merge changes will be ignored
# RETURN A string describing the InnoDB changes, or undef if no changes
#
# The return value does *not* include ChangeSet comments, only per-file
# comments.
sub innodb_get_changes
{
my ($type, $value, $want_merge_changes) = @_;
if ($type eq 'file')
{
open CHANGES, '<', $value
or die "$0: can't read '$value': $!\n";
}
elsif ($type eq 'cset')
{
open CHANGES, '-|', "bk changes -r'$value' -v -d'$file_rev_dspec'"
or die "$0: can't exec 'bk changes': $!\n";
}
else
{
croak "$0: script error: invalid type '$type'";
}
my @changes = grep { /$innodb_files_regex/ } <CHANGES>;
close_or_warn(CHANGES, "($type, '$value')");
return undef unless @changes;
# Set up a pipeline of 'bk log' commands to weed out unwanted deltas. We
# never want deltas which contain no actual changes. We may not want deltas
# which are merges.
my @filters;
# This tests if :LI: (lines inserted) or :LD: (lines deleted) is
# non-zero. That is, did this delta change the file contents?
push @filters,
"bk log -d'"
. "\$if(:LI: -gt 0){$file_rev_dspec}"
. "\$if(:LI: -eq 0){\$if(:LD: -gt 0){$file_rev_dspec}}"
. "' -";
push @filters, "bk log -d'\$unless(:MERGE:){$file_rev_dspec}' -"
unless $want_merge_changes;
my $tmpname = "$bktmp/ibchanges.txt";
my $pipeline = join(' | ', @filters) . " > $tmpname";
open TMP, '|-', $pipeline
or die "$0: can't exec [[$pipeline]]: $!\n";
print TMP @changes;
close_or_warn(TMP, "| $pipeline");
# Use bk log to describe the changes
open LOG, "bk log - < $tmpname |"
or die "$0: can't exec 'bk log - < $tmpname': $!\n";
my @log = <LOG>;
close_or_warn(LOG, "bk log - < $tmpname |");
unlink $tmpname;
return undef unless @log;
return join('', @log);
}
# Ask user if they really want to commit.
# RETURN TRUE = YES, commit; FALSE = NO, do not commit
sub innodb_inform_and_query_user
{
my ($description) = @_;
my $tmpname = "$bktmp/ibquery.txt";
open MESSAGE, "> $tmpname"
or die "$0: can't write message to '$tmpname': $!";
print MESSAGE <<EOF;
This ChangeSet modifies some files which should normally be changed by
InnoDB developers only. In general, MySQL developers should not change:
$innodb_files_description
The following InnoDB files were modified:
=========================================================
$description
=========================================================
If you understand this, you may Commit these changes. The changes
will be sent to the InnoDB developers at @{[join ', ', @innodb_to_email]},
CC @{[join ', ', @innodb_cc_email]}.
EOF
close_or_warn(MESSAGE, "$tmpname");
my $status = system('bk', 'prompt', '-w',
'-yCommit these changes', '-nDo not Commit', "-f$tmpname");
unlink $tmpname;
return ($status == 0 ? 1 : undef);
}
# innodb_send_changes_email
# $cset The ChangeSet key
# $description A (maybe brief) description of the changes
# RETURN TRUE = Success, e-mail sent; FALSE = Failure
#
# Sends a complete diff of changes in $cset by e-mail.
sub innodb_send_changes_email
{
my ($cset, $description) = @_;
# FIXME: Much of this is duplicated in the 'post-commit' Bourne shell
# trigger
my $cset_short = `bk changes -r'$cset' -d':P:::I:'`;
my $cset_key = `bk changes -r'$cset' -d':KEY:'`;
my ($host, $bk_root) = repository_location();
my $type = repository_type();
(my $treename = $bk_root) =~ s,^.*/,,;
print "Nofifying InnoDB developers at ",
(join ', ', @innodb_to_email, @innodb_cc_email), "\n";
open SENDMAIL, '|-', "$sendmail -t"
or die "Can't exec '$sendmail -t': $!\n";
my @headers;
push @headers, "List-ID: <bk.innodb-$mysql_version>";
push @headers, "From: $from";
push @headers, "To: " . (join ', ', @innodb_to_email);
push @headers, "Cc: " . (join ', ', @innodb_cc_email) if @innodb_cc_email;
push @headers,
"Subject: InnoDB changes in $type $mysql_version tree ($cset_short)";
push @headers, "X-CSetKey: <$cset_key>";
print SENDMAIL map { "$_\n" } @headers, '';
if ($type eq 'main')
{
print SENDMAIL <<EOF;
Changes pushed to $treename by $ENV{USER} affect the following
files. These changes are in a $mysql_version main tree. They
will be available publicly within 24 hours.
EOF
}
elsif ($type eq 'team')
{
print SENDMAIL <<EOF;
Changes added to $treename by $ENV{USER} affect the
following files. These changes are in a $mysql_version team tree.
EOF
}
else
{
print SENDMAIL <<EOF;
A local commit by $ENV{USER} affects the following files. These
changes are in a clone of a $mysql_version tree.
EOF
}
print SENDMAIL "\n";
print SENDMAIL qx(bk changes -r'$cset');
print SENDMAIL "$description";
print SENDMAIL "The complete ChangeSet diffs follow.\n\n";
print SENDMAIL qx(bk rset -r'$cset' -ah | bk gnupatch -h -dup -T);
close_or_warn(SENDMAIL, "$sendmail -t")
or return undef;
return 1;
}
1;

View File

@ -111,6 +111,10 @@ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDBUG_OFF")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
#TODO: update the code and remove the disabled warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805")
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996")
@ -160,6 +164,14 @@ IF(WIN32)
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
ENDIF(WIN32)
# This definition is necessary to work around a bug with Intellisense described
# here: http://tinyurl.com/2cb428. Syntax highlighting is important for proper
# debugger functionality.
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
MESSAGE(STATUS "Detected 64-bit platform.")
ADD_DEFINITIONS("-D_WIN64")
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 8)
IF(EMBED_MANIFESTS)
# Search for the tools (mt, makecat, signtool) necessary for embedding
# manifests and signing executables with the MySQL AB authenticode cert.

View File

@ -32,7 +32,8 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c)
TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32)
ADD_EXECUTABLE(mysqltest mysqltest.c ../mysys/my_getsystime.c ../mysys/my_copy.c)
ADD_EXECUTABLE(mysqltest mysqltest.c ../mysys/my_getsystime.c
../mysys/my_copy.c ../mysys/my_mkdir.c)
TARGET_LINK_LIBRARIES(mysqltest mysqlclient_notls regex wsock32)
ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)

View File

@ -88,7 +88,8 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
mysqltest_SOURCES= mysqltest.c \
$(top_srcdir)/mysys/my_getsystime.c \
$(top_srcdir)/mysys/my_copy.c
$(top_srcdir)/mysys/my_copy.c \
$(top_srcdir)/mysys/my_mkdir.c
mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD)
mysql_upgrade_SOURCES= mysql_upgrade.c \

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000-2003 MySQL AB
/* Copyright (C) 2000-2008 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -290,13 +290,6 @@ static COMMANDS commands[] = {
/* Get bash-like expansion for some commands */
{ "create table", 0, 0, 0, ""},
{ "create database", 0, 0, 0, ""},
{ "drop", 0, 0, 0, ""},
{ "select", 0, 0, 0, ""},
{ "insert", 0, 0, 0, ""},
{ "replace", 0, 0, 0, ""},
{ "update", 0, 0, 0, ""},
{ "delete", 0, 0, 0, ""},
{ "explain", 0, 0, 0, ""},
{ "show databases", 0, 0, 0, ""},
{ "show fields from", 0, 0, 0, ""},
{ "show keys from", 0, 0, 0, ""},
@ -306,6 +299,718 @@ static COMMANDS commands[] = {
{ "set option", 0, 0, 0, ""},
{ "lock tables", 0, 0, 0, ""},
{ "unlock tables", 0, 0, 0, ""},
/* generated 2006-12-28. Refresh occasionally from lexer. */
{ "ACTION", 0, 0, 0, ""},
{ "ADD", 0, 0, 0, ""},
{ "AFTER", 0, 0, 0, ""},
{ "AGAINST", 0, 0, 0, ""},
{ "AGGREGATE", 0, 0, 0, ""},
{ "ALL", 0, 0, 0, ""},
{ "ALGORITHM", 0, 0, 0, ""},
{ "ALTER", 0, 0, 0, ""},
{ "ANALYZE", 0, 0, 0, ""},
{ "AND", 0, 0, 0, ""},
{ "ANY", 0, 0, 0, ""},
{ "AS", 0, 0, 0, ""},
{ "ASC", 0, 0, 0, ""},
{ "ASCII", 0, 0, 0, ""},
{ "ASENSITIVE", 0, 0, 0, ""},
{ "AUTO_INCREMENT", 0, 0, 0, ""},
{ "AVG", 0, 0, 0, ""},
{ "AVG_ROW_LENGTH", 0, 0, 0, ""},
{ "BACKUP", 0, 0, 0, ""},
{ "BDB", 0, 0, 0, ""},
{ "BEFORE", 0, 0, 0, ""},
{ "BEGIN", 0, 0, 0, ""},
{ "BERKELEYDB", 0, 0, 0, ""},
{ "BETWEEN", 0, 0, 0, ""},
{ "BIGINT", 0, 0, 0, ""},
{ "BINARY", 0, 0, 0, ""},
{ "BINLOG", 0, 0, 0, ""},
{ "BIT", 0, 0, 0, ""},
{ "BLOB", 0, 0, 0, ""},
{ "BOOL", 0, 0, 0, ""},
{ "BOOLEAN", 0, 0, 0, ""},
{ "BOTH", 0, 0, 0, ""},
{ "BTREE", 0, 0, 0, ""},
{ "BY", 0, 0, 0, ""},
{ "BYTE", 0, 0, 0, ""},
{ "CACHE", 0, 0, 0, ""},
{ "CALL", 0, 0, 0, ""},
{ "CASCADE", 0, 0, 0, ""},
{ "CASCADED", 0, 0, 0, ""},
{ "CASE", 0, 0, 0, ""},
{ "CHAIN", 0, 0, 0, ""},
{ "CHANGE", 0, 0, 0, ""},
{ "CHANGED", 0, 0, 0, ""},
{ "CHAR", 0, 0, 0, ""},
{ "CHARACTER", 0, 0, 0, ""},
{ "CHARSET", 0, 0, 0, ""},
{ "CHECK", 0, 0, 0, ""},
{ "CHECKSUM", 0, 0, 0, ""},
{ "CIPHER", 0, 0, 0, ""},
{ "CLIENT", 0, 0, 0, ""},
{ "CLOSE", 0, 0, 0, ""},
{ "CODE", 0, 0, 0, ""},
{ "COLLATE", 0, 0, 0, ""},
{ "COLLATION", 0, 0, 0, ""},
{ "COLUMN", 0, 0, 0, ""},
{ "COLUMNS", 0, 0, 0, ""},
{ "COMMENT", 0, 0, 0, ""},
{ "COMMIT", 0, 0, 0, ""},
{ "COMMITTED", 0, 0, 0, ""},
{ "COMPACT", 0, 0, 0, ""},
{ "COMPRESSED", 0, 0, 0, ""},
{ "CONCURRENT", 0, 0, 0, ""},
{ "CONDITION", 0, 0, 0, ""},
{ "CONNECTION", 0, 0, 0, ""},
{ "CONSISTENT", 0, 0, 0, ""},
{ "CONSTRAINT", 0, 0, 0, ""},
{ "CONTAINS", 0, 0, 0, ""},
{ "CONTINUE", 0, 0, 0, ""},
{ "CONVERT", 0, 0, 0, ""},
{ "CREATE", 0, 0, 0, ""},
{ "CROSS", 0, 0, 0, ""},
{ "CUBE", 0, 0, 0, ""},
{ "CURRENT_DATE", 0, 0, 0, ""},
{ "CURRENT_TIME", 0, 0, 0, ""},
{ "CURRENT_TIMESTAMP", 0, 0, 0, ""},
{ "CURRENT_USER", 0, 0, 0, ""},
{ "CURSOR", 0, 0, 0, ""},
{ "DATA", 0, 0, 0, ""},
{ "DATABASE", 0, 0, 0, ""},
{ "DATABASES", 0, 0, 0, ""},
{ "DATE", 0, 0, 0, ""},
{ "DATETIME", 0, 0, 0, ""},
{ "DAY", 0, 0, 0, ""},
{ "DAY_HOUR", 0, 0, 0, ""},
{ "DAY_MICROSECOND", 0, 0, 0, ""},
{ "DAY_MINUTE", 0, 0, 0, ""},
{ "DAY_SECOND", 0, 0, 0, ""},
{ "DEALLOCATE", 0, 0, 0, ""},
{ "DEC", 0, 0, 0, ""},
{ "DECIMAL", 0, 0, 0, ""},
{ "DECLARE", 0, 0, 0, ""},
{ "DEFAULT", 0, 0, 0, ""},
{ "DEFINER", 0, 0, 0, ""},
{ "DELAYED", 0, 0, 0, ""},
{ "DELAY_KEY_WRITE", 0, 0, 0, ""},
{ "DELETE", 0, 0, 0, ""},
{ "DESC", 0, 0, 0, ""},
{ "DESCRIBE", 0, 0, 0, ""},
{ "DES_KEY_FILE", 0, 0, 0, ""},
{ "DETERMINISTIC", 0, 0, 0, ""},
{ "DIRECTORY", 0, 0, 0, ""},
{ "DISABLE", 0, 0, 0, ""},
{ "DISCARD", 0, 0, 0, ""},
{ "DISTINCT", 0, 0, 0, ""},
{ "DISTINCTROW", 0, 0, 0, ""},
{ "DIV", 0, 0, 0, ""},
{ "DO", 0, 0, 0, ""},
{ "DOUBLE", 0, 0, 0, ""},
{ "DROP", 0, 0, 0, ""},
{ "DUAL", 0, 0, 0, ""},
{ "DUMPFILE", 0, 0, 0, ""},
{ "DUPLICATE", 0, 0, 0, ""},
{ "DYNAMIC", 0, 0, 0, ""},
{ "EACH", 0, 0, 0, ""},
{ "ELSE", 0, 0, 0, ""},
{ "ELSEIF", 0, 0, 0, ""},
{ "ENABLE", 0, 0, 0, ""},
{ "ENCLOSED", 0, 0, 0, ""},
{ "END", 0, 0, 0, ""},
{ "ENGINE", 0, 0, 0, ""},
{ "ENGINES", 0, 0, 0, ""},
{ "ENUM", 0, 0, 0, ""},
{ "ERRORS", 0, 0, 0, ""},
{ "ESCAPE", 0, 0, 0, ""},
{ "ESCAPED", 0, 0, 0, ""},
{ "EVENTS", 0, 0, 0, ""},
{ "EXECUTE", 0, 0, 0, ""},
{ "EXISTS", 0, 0, 0, ""},
{ "EXIT", 0, 0, 0, ""},
{ "EXPANSION", 0, 0, 0, ""},
{ "EXPLAIN", 0, 0, 0, ""},
{ "EXTENDED", 0, 0, 0, ""},
{ "FALSE", 0, 0, 0, ""},
{ "FAST", 0, 0, 0, ""},
{ "FETCH", 0, 0, 0, ""},
{ "FIELDS", 0, 0, 0, ""},
{ "FILE", 0, 0, 0, ""},
{ "FIRST", 0, 0, 0, ""},
{ "FIXED", 0, 0, 0, ""},
{ "FLOAT", 0, 0, 0, ""},
{ "FLOAT4", 0, 0, 0, ""},
{ "FLOAT8", 0, 0, 0, ""},
{ "FLUSH", 0, 0, 0, ""},
{ "FOR", 0, 0, 0, ""},
{ "FORCE", 0, 0, 0, ""},
{ "FOREIGN", 0, 0, 0, ""},
{ "FOUND", 0, 0, 0, ""},
{ "FRAC_SECOND", 0, 0, 0, ""},
{ "FROM", 0, 0, 0, ""},
{ "FULL", 0, 0, 0, ""},
{ "FULLTEXT", 0, 0, 0, ""},
{ "FUNCTION", 0, 0, 0, ""},
{ "GEOMETRY", 0, 0, 0, ""},
{ "GEOMETRYCOLLECTION", 0, 0, 0, ""},
{ "GET_FORMAT", 0, 0, 0, ""},
{ "GLOBAL", 0, 0, 0, ""},
{ "GRANT", 0, 0, 0, ""},
{ "GRANTS", 0, 0, 0, ""},
{ "GROUP", 0, 0, 0, ""},
{ "HANDLER", 0, 0, 0, ""},
{ "HASH", 0, 0, 0, ""},
{ "HAVING", 0, 0, 0, ""},
{ "HELP", 0, 0, 0, ""},
{ "HIGH_PRIORITY", 0, 0, 0, ""},
{ "HOSTS", 0, 0, 0, ""},
{ "HOUR", 0, 0, 0, ""},
{ "HOUR_MICROSECOND", 0, 0, 0, ""},
{ "HOUR_MINUTE", 0, 0, 0, ""},
{ "HOUR_SECOND", 0, 0, 0, ""},
{ "IDENTIFIED", 0, 0, 0, ""},
{ "IF", 0, 0, 0, ""},
{ "IGNORE", 0, 0, 0, ""},
{ "IMPORT", 0, 0, 0, ""},
{ "IN", 0, 0, 0, ""},
{ "INDEX", 0, 0, 0, ""},
{ "INDEXES", 0, 0, 0, ""},
{ "INFILE", 0, 0, 0, ""},
{ "INNER", 0, 0, 0, ""},
{ "INNOBASE", 0, 0, 0, ""},
{ "INNODB", 0, 0, 0, ""},
{ "INOUT", 0, 0, 0, ""},
{ "INSENSITIVE", 0, 0, 0, ""},
{ "INSERT", 0, 0, 0, ""},
{ "INSERT_METHOD", 0, 0, 0, ""},
{ "INT", 0, 0, 0, ""},
{ "INT1", 0, 0, 0, ""},
{ "INT2", 0, 0, 0, ""},
{ "INT3", 0, 0, 0, ""},
{ "INT4", 0, 0, 0, ""},
{ "INT8", 0, 0, 0, ""},
{ "INTEGER", 0, 0, 0, ""},
{ "INTERVAL", 0, 0, 0, ""},
{ "INTO", 0, 0, 0, ""},
{ "IO_THREAD", 0, 0, 0, ""},
{ "IS", 0, 0, 0, ""},
{ "ISOLATION", 0, 0, 0, ""},
{ "ISSUER", 0, 0, 0, ""},
{ "ITERATE", 0, 0, 0, ""},
{ "INVOKER", 0, 0, 0, ""},
{ "JOIN", 0, 0, 0, ""},
{ "KEY", 0, 0, 0, ""},
{ "KEYS", 0, 0, 0, ""},
{ "KILL", 0, 0, 0, ""},
{ "LANGUAGE", 0, 0, 0, ""},
{ "LAST", 0, 0, 0, ""},
{ "LEADING", 0, 0, 0, ""},
{ "LEAVE", 0, 0, 0, ""},
{ "LEAVES", 0, 0, 0, ""},
{ "LEFT", 0, 0, 0, ""},
{ "LEVEL", 0, 0, 0, ""},
{ "LIKE", 0, 0, 0, ""},
{ "LIMIT", 0, 0, 0, ""},
{ "LINES", 0, 0, 0, ""},
{ "LINESTRING", 0, 0, 0, ""},
{ "LOAD", 0, 0, 0, ""},
{ "LOCAL", 0, 0, 0, ""},
{ "LOCALTIME", 0, 0, 0, ""},
{ "LOCALTIMESTAMP", 0, 0, 0, ""},
{ "LOCK", 0, 0, 0, ""},
{ "LOCKS", 0, 0, 0, ""},
{ "LOGS", 0, 0, 0, ""},
{ "LONG", 0, 0, 0, ""},
{ "LONGBLOB", 0, 0, 0, ""},
{ "LONGTEXT", 0, 0, 0, ""},
{ "LOOP", 0, 0, 0, ""},
{ "LOW_PRIORITY", 0, 0, 0, ""},
{ "MASTER", 0, 0, 0, ""},
{ "MASTER_CONNECT_RETRY", 0, 0, 0, ""},
{ "MASTER_HOST", 0, 0, 0, ""},
{ "MASTER_LOG_FILE", 0, 0, 0, ""},
{ "MASTER_LOG_POS", 0, 0, 0, ""},
{ "MASTER_PASSWORD", 0, 0, 0, ""},
{ "MASTER_PORT", 0, 0, 0, ""},
{ "MASTER_SERVER_ID", 0, 0, 0, ""},
{ "MASTER_SSL", 0, 0, 0, ""},
{ "MASTER_SSL_CA", 0, 0, 0, ""},
{ "MASTER_SSL_CAPATH", 0, 0, 0, ""},
{ "MASTER_SSL_CERT", 0, 0, 0, ""},
{ "MASTER_SSL_CIPHER", 0, 0, 0, ""},
{ "MASTER_SSL_KEY", 0, 0, 0, ""},
{ "MASTER_USER", 0, 0, 0, ""},
{ "MATCH", 0, 0, 0, ""},
{ "MAX_CONNECTIONS_PER_HOUR", 0, 0, 0, ""},
{ "MAX_QUERIES_PER_HOUR", 0, 0, 0, ""},
{ "MAX_ROWS", 0, 0, 0, ""},
{ "MAX_UPDATES_PER_HOUR", 0, 0, 0, ""},
{ "MAX_USER_CONNECTIONS", 0, 0, 0, ""},
{ "MEDIUM", 0, 0, 0, ""},
{ "MEDIUMBLOB", 0, 0, 0, ""},
{ "MEDIUMINT", 0, 0, 0, ""},
{ "MEDIUMTEXT", 0, 0, 0, ""},
{ "MERGE", 0, 0, 0, ""},
{ "MICROSECOND", 0, 0, 0, ""},
{ "MIDDLEINT", 0, 0, 0, ""},
{ "MIGRATE", 0, 0, 0, ""},
{ "MINUTE", 0, 0, 0, ""},
{ "MINUTE_MICROSECOND", 0, 0, 0, ""},
{ "MINUTE_SECOND", 0, 0, 0, ""},
{ "MIN_ROWS", 0, 0, 0, ""},
{ "MOD", 0, 0, 0, ""},
{ "MODE", 0, 0, 0, ""},
{ "MODIFIES", 0, 0, 0, ""},
{ "MODIFY", 0, 0, 0, ""},
{ "MONTH", 0, 0, 0, ""},
{ "MULTILINESTRING", 0, 0, 0, ""},
{ "MULTIPOINT", 0, 0, 0, ""},
{ "MULTIPOLYGON", 0, 0, 0, ""},
{ "MUTEX", 0, 0, 0, ""},
{ "NAME", 0, 0, 0, ""},
{ "NAMES", 0, 0, 0, ""},
{ "NATIONAL", 0, 0, 0, ""},
{ "NATURAL", 0, 0, 0, ""},
{ "NDB", 0, 0, 0, ""},
{ "NDBCLUSTER", 0, 0, 0, ""},
{ "NCHAR", 0, 0, 0, ""},
{ "NEW", 0, 0, 0, ""},
{ "NEXT", 0, 0, 0, ""},
{ "NO", 0, 0, 0, ""},
{ "NONE", 0, 0, 0, ""},
{ "NOT", 0, 0, 0, ""},
{ "NO_WRITE_TO_BINLOG", 0, 0, 0, ""},
{ "NULL", 0, 0, 0, ""},
{ "NUMERIC", 0, 0, 0, ""},
{ "NVARCHAR", 0, 0, 0, ""},
{ "OFFSET", 0, 0, 0, ""},
{ "OLD_PASSWORD", 0, 0, 0, ""},
{ "ON", 0, 0, 0, ""},
{ "ONE", 0, 0, 0, ""},
{ "ONE_SHOT", 0, 0, 0, ""},
{ "OPEN", 0, 0, 0, ""},
{ "OPTIMIZE", 0, 0, 0, ""},
{ "OPTION", 0, 0, 0, ""},
{ "OPTIONALLY", 0, 0, 0, ""},
{ "OR", 0, 0, 0, ""},
{ "ORDER", 0, 0, 0, ""},
{ "OUT", 0, 0, 0, ""},
{ "OUTER", 0, 0, 0, ""},
{ "OUTFILE", 0, 0, 0, ""},
{ "PACK_KEYS", 0, 0, 0, ""},
{ "PARTIAL", 0, 0, 0, ""},
{ "PASSWORD", 0, 0, 0, ""},
{ "PHASE", 0, 0, 0, ""},
{ "POINT", 0, 0, 0, ""},
{ "POLYGON", 0, 0, 0, ""},
{ "PRECISION", 0, 0, 0, ""},
{ "PREPARE", 0, 0, 0, ""},
{ "PREV", 0, 0, 0, ""},
{ "PRIMARY", 0, 0, 0, ""},
{ "PRIVILEGES", 0, 0, 0, ""},
{ "PROCEDURE", 0, 0, 0, ""},
{ "PROCESS", 0, 0, 0, ""},
{ "PROCESSLIST", 0, 0, 0, ""},
{ "PURGE", 0, 0, 0, ""},
{ "QUARTER", 0, 0, 0, ""},
{ "QUERY", 0, 0, 0, ""},
{ "QUICK", 0, 0, 0, ""},
{ "RAID0", 0, 0, 0, ""},
{ "RAID_CHUNKS", 0, 0, 0, ""},
{ "RAID_CHUNKSIZE", 0, 0, 0, ""},
{ "RAID_TYPE", 0, 0, 0, ""},
{ "READ", 0, 0, 0, ""},
{ "READS", 0, 0, 0, ""},
{ "REAL", 0, 0, 0, ""},
{ "RECOVER", 0, 0, 0, ""},
{ "REDUNDANT", 0, 0, 0, ""},
{ "REFERENCES", 0, 0, 0, ""},
{ "REGEXP", 0, 0, 0, ""},
{ "RELAY_LOG_FILE", 0, 0, 0, ""},
{ "RELAY_LOG_POS", 0, 0, 0, ""},
{ "RELAY_THREAD", 0, 0, 0, ""},
{ "RELEASE", 0, 0, 0, ""},
{ "RELOAD", 0, 0, 0, ""},
{ "RENAME", 0, 0, 0, ""},
{ "REPAIR", 0, 0, 0, ""},
{ "REPEATABLE", 0, 0, 0, ""},
{ "REPLACE", 0, 0, 0, ""},
{ "REPLICATION", 0, 0, 0, ""},
{ "REPEAT", 0, 0, 0, ""},
{ "REQUIRE", 0, 0, 0, ""},
{ "RESET", 0, 0, 0, ""},
{ "RESTORE", 0, 0, 0, ""},
{ "RESTRICT", 0, 0, 0, ""},
{ "RESUME", 0, 0, 0, ""},
{ "RETURN", 0, 0, 0, ""},
{ "RETURNS", 0, 0, 0, ""},
{ "REVOKE", 0, 0, 0, ""},
{ "RIGHT", 0, 0, 0, ""},
{ "RLIKE", 0, 0, 0, ""},
{ "ROLLBACK", 0, 0, 0, ""},
{ "ROLLUP", 0, 0, 0, ""},
{ "ROUTINE", 0, 0, 0, ""},
{ "ROW", 0, 0, 0, ""},
{ "ROWS", 0, 0, 0, ""},
{ "ROW_FORMAT", 0, 0, 0, ""},
{ "RTREE", 0, 0, 0, ""},
{ "SAVEPOINT", 0, 0, 0, ""},
{ "SCHEMA", 0, 0, 0, ""},
{ "SCHEMAS", 0, 0, 0, ""},
{ "SECOND", 0, 0, 0, ""},
{ "SECOND_MICROSECOND", 0, 0, 0, ""},
{ "SECURITY", 0, 0, 0, ""},
{ "SELECT", 0, 0, 0, ""},
{ "SENSITIVE", 0, 0, 0, ""},
{ "SEPARATOR", 0, 0, 0, ""},
{ "SERIAL", 0, 0, 0, ""},
{ "SERIALIZABLE", 0, 0, 0, ""},
{ "SESSION", 0, 0, 0, ""},
{ "SET", 0, 0, 0, ""},
{ "SHARE", 0, 0, 0, ""},
{ "SHOW", 0, 0, 0, ""},
{ "SHUTDOWN", 0, 0, 0, ""},
{ "SIGNED", 0, 0, 0, ""},
{ "SIMPLE", 0, 0, 0, ""},
{ "SLAVE", 0, 0, 0, ""},
{ "SNAPSHOT", 0, 0, 0, ""},
{ "SMALLINT", 0, 0, 0, ""},
{ "SOME", 0, 0, 0, ""},
{ "SONAME", 0, 0, 0, ""},
{ "SOUNDS", 0, 0, 0, ""},
{ "SPATIAL", 0, 0, 0, ""},
{ "SPECIFIC", 0, 0, 0, ""},
{ "SQL", 0, 0, 0, ""},
{ "SQLEXCEPTION", 0, 0, 0, ""},
{ "SQLSTATE", 0, 0, 0, ""},
{ "SQLWARNING", 0, 0, 0, ""},
{ "SQL_BIG_RESULT", 0, 0, 0, ""},
{ "SQL_BUFFER_RESULT", 0, 0, 0, ""},
{ "SQL_CACHE", 0, 0, 0, ""},
{ "SQL_CALC_FOUND_ROWS", 0, 0, 0, ""},
{ "SQL_NO_CACHE", 0, 0, 0, ""},
{ "SQL_SMALL_RESULT", 0, 0, 0, ""},
{ "SQL_THREAD", 0, 0, 0, ""},
{ "SQL_TSI_FRAC_SECOND", 0, 0, 0, ""},
{ "SQL_TSI_SECOND", 0, 0, 0, ""},
{ "SQL_TSI_MINUTE", 0, 0, 0, ""},
{ "SQL_TSI_HOUR", 0, 0, 0, ""},
{ "SQL_TSI_DAY", 0, 0, 0, ""},
{ "SQL_TSI_WEEK", 0, 0, 0, ""},
{ "SQL_TSI_MONTH", 0, 0, 0, ""},
{ "SQL_TSI_QUARTER", 0, 0, 0, ""},
{ "SQL_TSI_YEAR", 0, 0, 0, ""},
{ "SSL", 0, 0, 0, ""},
{ "START", 0, 0, 0, ""},
{ "STARTING", 0, 0, 0, ""},
{ "STATUS", 0, 0, 0, ""},
{ "STOP", 0, 0, 0, ""},
{ "STORAGE", 0, 0, 0, ""},
{ "STRAIGHT_JOIN", 0, 0, 0, ""},
{ "STRING", 0, 0, 0, ""},
{ "STRIPED", 0, 0, 0, ""},
{ "SUBJECT", 0, 0, 0, ""},
{ "SUPER", 0, 0, 0, ""},
{ "SUSPEND", 0, 0, 0, ""},
{ "TABLE", 0, 0, 0, ""},
{ "TABLES", 0, 0, 0, ""},
{ "TABLESPACE", 0, 0, 0, ""},
{ "TEMPORARY", 0, 0, 0, ""},
{ "TEMPTABLE", 0, 0, 0, ""},
{ "TERMINATED", 0, 0, 0, ""},
{ "TEXT", 0, 0, 0, ""},
{ "THEN", 0, 0, 0, ""},
{ "TIME", 0, 0, 0, ""},
{ "TIMESTAMP", 0, 0, 0, ""},
{ "TIMESTAMPADD", 0, 0, 0, ""},
{ "TIMESTAMPDIFF", 0, 0, 0, ""},
{ "TINYBLOB", 0, 0, 0, ""},
{ "TINYINT", 0, 0, 0, ""},
{ "TINYTEXT", 0, 0, 0, ""},
{ "TO", 0, 0, 0, ""},
{ "TRAILING", 0, 0, 0, ""},
{ "TRANSACTION", 0, 0, 0, ""},
{ "TRIGGER", 0, 0, 0, ""},
{ "TRIGGERS", 0, 0, 0, ""},
{ "TRUE", 0, 0, 0, ""},
{ "TRUNCATE", 0, 0, 0, ""},
{ "TYPE", 0, 0, 0, ""},
{ "TYPES", 0, 0, 0, ""},
{ "UNCOMMITTED", 0, 0, 0, ""},
{ "UNDEFINED", 0, 0, 0, ""},
{ "UNDO", 0, 0, 0, ""},
{ "UNICODE", 0, 0, 0, ""},
{ "UNION", 0, 0, 0, ""},
{ "UNIQUE", 0, 0, 0, ""},
{ "UNKNOWN", 0, 0, 0, ""},
{ "UNLOCK", 0, 0, 0, ""},
{ "UNSIGNED", 0, 0, 0, ""},
{ "UNTIL", 0, 0, 0, ""},
{ "UPDATE", 0, 0, 0, ""},
{ "UPGRADE", 0, 0, 0, ""},
{ "USAGE", 0, 0, 0, ""},
{ "USE", 0, 0, 0, ""},
{ "USER", 0, 0, 0, ""},
{ "USER_RESOURCES", 0, 0, 0, ""},
{ "USE_FRM", 0, 0, 0, ""},
{ "USING", 0, 0, 0, ""},
{ "UTC_DATE", 0, 0, 0, ""},
{ "UTC_TIME", 0, 0, 0, ""},
{ "UTC_TIMESTAMP", 0, 0, 0, ""},
{ "VALUE", 0, 0, 0, ""},
{ "VALUES", 0, 0, 0, ""},
{ "VARBINARY", 0, 0, 0, ""},
{ "VARCHAR", 0, 0, 0, ""},
{ "VARCHARACTER", 0, 0, 0, ""},
{ "VARIABLES", 0, 0, 0, ""},
{ "VARYING", 0, 0, 0, ""},
{ "WARNINGS", 0, 0, 0, ""},
{ "WEEK", 0, 0, 0, ""},
{ "WHEN", 0, 0, 0, ""},
{ "WHERE", 0, 0, 0, ""},
{ "WHILE", 0, 0, 0, ""},
{ "VIEW", 0, 0, 0, ""},
{ "WITH", 0, 0, 0, ""},
{ "WORK", 0, 0, 0, ""},
{ "WRITE", 0, 0, 0, ""},
{ "X509", 0, 0, 0, ""},
{ "XOR", 0, 0, 0, ""},
{ "XA", 0, 0, 0, ""},
{ "YEAR", 0, 0, 0, ""},
{ "YEAR_MONTH", 0, 0, 0, ""},
{ "ZEROFILL", 0, 0, 0, ""},
{ "ABS", 0, 0, 0, ""},
{ "ACOS", 0, 0, 0, ""},
{ "ADDDATE", 0, 0, 0, ""},
{ "ADDTIME", 0, 0, 0, ""},
{ "AES_ENCRYPT", 0, 0, 0, ""},
{ "AES_DECRYPT", 0, 0, 0, ""},
{ "AREA", 0, 0, 0, ""},
{ "ASIN", 0, 0, 0, ""},
{ "ASBINARY", 0, 0, 0, ""},
{ "ASTEXT", 0, 0, 0, ""},
{ "ASWKB", 0, 0, 0, ""},
{ "ASWKT", 0, 0, 0, ""},
{ "ATAN", 0, 0, 0, ""},
{ "ATAN2", 0, 0, 0, ""},
{ "BENCHMARK", 0, 0, 0, ""},
{ "BIN", 0, 0, 0, ""},
{ "BIT_COUNT", 0, 0, 0, ""},
{ "BIT_OR", 0, 0, 0, ""},
{ "BIT_AND", 0, 0, 0, ""},
{ "BIT_XOR", 0, 0, 0, ""},
{ "CAST", 0, 0, 0, ""},
{ "CEIL", 0, 0, 0, ""},
{ "CEILING", 0, 0, 0, ""},
{ "BIT_LENGTH", 0, 0, 0, ""},
{ "CENTROID", 0, 0, 0, ""},
{ "CHAR_LENGTH", 0, 0, 0, ""},
{ "CHARACTER_LENGTH", 0, 0, 0, ""},
{ "COALESCE", 0, 0, 0, ""},
{ "COERCIBILITY", 0, 0, 0, ""},
{ "COMPRESS", 0, 0, 0, ""},
{ "CONCAT", 0, 0, 0, ""},
{ "CONCAT_WS", 0, 0, 0, ""},
{ "CONNECTION_ID", 0, 0, 0, ""},
{ "CONV", 0, 0, 0, ""},
{ "CONVERT_TZ", 0, 0, 0, ""},
{ "COUNT", 0, 0, 0, ""},
{ "COS", 0, 0, 0, ""},
{ "COT", 0, 0, 0, ""},
{ "CRC32", 0, 0, 0, ""},
{ "CROSSES", 0, 0, 0, ""},
{ "CURDATE", 0, 0, 0, ""},
{ "CURTIME", 0, 0, 0, ""},
{ "DATE_ADD", 0, 0, 0, ""},
{ "DATEDIFF", 0, 0, 0, ""},
{ "DATE_FORMAT", 0, 0, 0, ""},
{ "DATE_SUB", 0, 0, 0, ""},
{ "DAYNAME", 0, 0, 0, ""},
{ "DAYOFMONTH", 0, 0, 0, ""},
{ "DAYOFWEEK", 0, 0, 0, ""},
{ "DAYOFYEAR", 0, 0, 0, ""},
{ "DECODE", 0, 0, 0, ""},
{ "DEGREES", 0, 0, 0, ""},
{ "DES_ENCRYPT", 0, 0, 0, ""},
{ "DES_DECRYPT", 0, 0, 0, ""},
{ "DIMENSION", 0, 0, 0, ""},
{ "DISJOINT", 0, 0, 0, ""},
{ "ELT", 0, 0, 0, ""},
{ "ENCODE", 0, 0, 0, ""},
{ "ENCRYPT", 0, 0, 0, ""},
{ "ENDPOINT", 0, 0, 0, ""},
{ "ENVELOPE", 0, 0, 0, ""},
{ "EQUALS", 0, 0, 0, ""},
{ "EXTERIORRING", 0, 0, 0, ""},
{ "EXTRACT", 0, 0, 0, ""},
{ "EXP", 0, 0, 0, ""},
{ "EXPORT_SET", 0, 0, 0, ""},
{ "FIELD", 0, 0, 0, ""},
{ "FIND_IN_SET", 0, 0, 0, ""},
{ "FLOOR", 0, 0, 0, ""},
{ "FORMAT", 0, 0, 0, ""},
{ "FOUND_ROWS", 0, 0, 0, ""},
{ "FROM_DAYS", 0, 0, 0, ""},
{ "FROM_UNIXTIME", 0, 0, 0, ""},
{ "GET_LOCK", 0, 0, 0, ""},
{ "GEOMETRYN", 0, 0, 0, ""},
{ "GEOMETRYTYPE", 0, 0, 0, ""},
{ "GEOMCOLLFROMTEXT", 0, 0, 0, ""},
{ "GEOMCOLLFROMWKB", 0, 0, 0, ""},
{ "GEOMETRYCOLLECTIONFROMTEXT", 0, 0, 0, ""},
{ "GEOMETRYCOLLECTIONFROMWKB", 0, 0, 0, ""},
{ "GEOMETRYFROMTEXT", 0, 0, 0, ""},
{ "GEOMETRYFROMWKB", 0, 0, 0, ""},
{ "GEOMFROMTEXT", 0, 0, 0, ""},
{ "GEOMFROMWKB", 0, 0, 0, ""},
{ "GLENGTH", 0, 0, 0, ""},
{ "GREATEST", 0, 0, 0, ""},
{ "GROUP_CONCAT", 0, 0, 0, ""},
{ "GROUP_UNIQUE_USERS", 0, 0, 0, ""},
{ "HEX", 0, 0, 0, ""},
{ "IFNULL", 0, 0, 0, ""},
{ "INET_ATON", 0, 0, 0, ""},
{ "INET_NTOA", 0, 0, 0, ""},
{ "INSTR", 0, 0, 0, ""},
{ "INTERIORRINGN", 0, 0, 0, ""},
{ "INTERSECTS", 0, 0, 0, ""},
{ "ISCLOSED", 0, 0, 0, ""},
{ "ISEMPTY", 0, 0, 0, ""},
{ "ISNULL", 0, 0, 0, ""},
{ "IS_FREE_LOCK", 0, 0, 0, ""},
{ "IS_USED_LOCK", 0, 0, 0, ""},
{ "LAST_INSERT_ID", 0, 0, 0, ""},
{ "ISSIMPLE", 0, 0, 0, ""},
{ "LAST_DAY", 0, 0, 0, ""},
{ "LCASE", 0, 0, 0, ""},
{ "LEAST", 0, 0, 0, ""},
{ "LENGTH", 0, 0, 0, ""},
{ "LN", 0, 0, 0, ""},
{ "LINEFROMTEXT", 0, 0, 0, ""},
{ "LINEFROMWKB", 0, 0, 0, ""},
{ "LINESTRINGFROMTEXT", 0, 0, 0, ""},
{ "LINESTRINGFROMWKB", 0, 0, 0, ""},
{ "LOAD_FILE", 0, 0, 0, ""},
{ "LOCATE", 0, 0, 0, ""},
{ "LOG", 0, 0, 0, ""},
{ "LOG2", 0, 0, 0, ""},
{ "LOG10", 0, 0, 0, ""},
{ "LOWER", 0, 0, 0, ""},
{ "LPAD", 0, 0, 0, ""},
{ "LTRIM", 0, 0, 0, ""},
{ "MAKE_SET", 0, 0, 0, ""},
{ "MAKEDATE", 0, 0, 0, ""},
{ "MAKETIME", 0, 0, 0, ""},
{ "MASTER_POS_WAIT", 0, 0, 0, ""},
{ "MAX", 0, 0, 0, ""},
{ "MBRCONTAINS", 0, 0, 0, ""},
{ "MBRDISJOINT", 0, 0, 0, ""},
{ "MBREQUAL", 0, 0, 0, ""},
{ "MBRINTERSECTS", 0, 0, 0, ""},
{ "MBROVERLAPS", 0, 0, 0, ""},
{ "MBRTOUCHES", 0, 0, 0, ""},
{ "MBRWITHIN", 0, 0, 0, ""},
{ "MD5", 0, 0, 0, ""},
{ "MID", 0, 0, 0, ""},
{ "MIN", 0, 0, 0, ""},
{ "MLINEFROMTEXT", 0, 0, 0, ""},
{ "MLINEFROMWKB", 0, 0, 0, ""},
{ "MPOINTFROMTEXT", 0, 0, 0, ""},
{ "MPOINTFROMWKB", 0, 0, 0, ""},
{ "MPOLYFROMTEXT", 0, 0, 0, ""},
{ "MPOLYFROMWKB", 0, 0, 0, ""},
{ "MONTHNAME", 0, 0, 0, ""},
{ "MULTILINESTRINGFROMTEXT", 0, 0, 0, ""},
{ "MULTILINESTRINGFROMWKB", 0, 0, 0, ""},
{ "MULTIPOINTFROMTEXT", 0, 0, 0, ""},
{ "MULTIPOINTFROMWKB", 0, 0, 0, ""},
{ "MULTIPOLYGONFROMTEXT", 0, 0, 0, ""},
{ "MULTIPOLYGONFROMWKB", 0, 0, 0, ""},
{ "NAME_CONST", 0, 0, 0, ""},
{ "NOW", 0, 0, 0, ""},
{ "NULLIF", 0, 0, 0, ""},
{ "NUMGEOMETRIES", 0, 0, 0, ""},
{ "NUMINTERIORRINGS", 0, 0, 0, ""},
{ "NUMPOINTS", 0, 0, 0, ""},
{ "OCTET_LENGTH", 0, 0, 0, ""},
{ "OCT", 0, 0, 0, ""},
{ "ORD", 0, 0, 0, ""},
{ "OVERLAPS", 0, 0, 0, ""},
{ "PERIOD_ADD", 0, 0, 0, ""},
{ "PERIOD_DIFF", 0, 0, 0, ""},
{ "PI", 0, 0, 0, ""},
{ "POINTFROMTEXT", 0, 0, 0, ""},
{ "POINTFROMWKB", 0, 0, 0, ""},
{ "POINTN", 0, 0, 0, ""},
{ "POLYFROMTEXT", 0, 0, 0, ""},
{ "POLYFROMWKB", 0, 0, 0, ""},
{ "POLYGONFROMTEXT", 0, 0, 0, ""},
{ "POLYGONFROMWKB", 0, 0, 0, ""},
{ "POSITION", 0, 0, 0, ""},
{ "POW", 0, 0, 0, ""},
{ "POWER", 0, 0, 0, ""},
{ "QUOTE", 0, 0, 0, ""},
{ "RADIANS", 0, 0, 0, ""},
{ "RAND", 0, 0, 0, ""},
{ "RELEASE_LOCK", 0, 0, 0, ""},
{ "REVERSE", 0, 0, 0, ""},
{ "ROUND", 0, 0, 0, ""},
{ "ROW_COUNT", 0, 0, 0, ""},
{ "RPAD", 0, 0, 0, ""},
{ "RTRIM", 0, 0, 0, ""},
{ "SEC_TO_TIME", 0, 0, 0, ""},
{ "SESSION_USER", 0, 0, 0, ""},
{ "SUBDATE", 0, 0, 0, ""},
{ "SIGN", 0, 0, 0, ""},
{ "SIN", 0, 0, 0, ""},
{ "SHA", 0, 0, 0, ""},
{ "SHA1", 0, 0, 0, ""},
{ "SLEEP", 0, 0, 0, ""},
{ "SOUNDEX", 0, 0, 0, ""},
{ "SPACE", 0, 0, 0, ""},
{ "SQRT", 0, 0, 0, ""},
{ "SRID", 0, 0, 0, ""},
{ "STARTPOINT", 0, 0, 0, ""},
{ "STD", 0, 0, 0, ""},
{ "STDDEV", 0, 0, 0, ""},
{ "STDDEV_POP", 0, 0, 0, ""},
{ "STDDEV_SAMP", 0, 0, 0, ""},
{ "STR_TO_DATE", 0, 0, 0, ""},
{ "STRCMP", 0, 0, 0, ""},
{ "SUBSTR", 0, 0, 0, ""},
{ "SUBSTRING", 0, 0, 0, ""},
{ "SUBSTRING_INDEX", 0, 0, 0, ""},
{ "SUBTIME", 0, 0, 0, ""},
{ "SUM", 0, 0, 0, ""},
{ "SYSDATE", 0, 0, 0, ""},
{ "SYSTEM_USER", 0, 0, 0, ""},
{ "TAN", 0, 0, 0, ""},
{ "TIME_FORMAT", 0, 0, 0, ""},
{ "TIME_TO_SEC", 0, 0, 0, ""},
{ "TIMEDIFF", 0, 0, 0, ""},
{ "TO_DAYS", 0, 0, 0, ""},
{ "TOUCHES", 0, 0, 0, ""},
{ "TRIM", 0, 0, 0, ""},
{ "UCASE", 0, 0, 0, ""},
{ "UNCOMPRESS", 0, 0, 0, ""},
{ "UNCOMPRESSED_LENGTH", 0, 0, 0, ""},
{ "UNHEX", 0, 0, 0, ""},
{ "UNIQUE_USERS", 0, 0, 0, ""},
{ "UNIX_TIMESTAMP", 0, 0, 0, ""},
{ "UPPER", 0, 0, 0, ""},
{ "UUID", 0, 0, 0, ""},
{ "VARIANCE", 0, 0, 0, ""},
{ "VAR_POP", 0, 0, 0, ""},
{ "VAR_SAMP", 0, 0, 0, ""},
{ "VERSION", 0, 0, 0, ""},
{ "WEEKDAY", 0, 0, 0, ""},
{ "WEEKOFYEAR", 0, 0, 0, ""},
{ "WITHIN", 0, 0, 0, ""},
{ "X", 0, 0, 0, ""},
{ "Y", 0, 0, 0, ""},
{ "YEARWEEK", 0, 0, 0, ""},
/* end sentinel */
{ (char *)NULL, 0, 0, 0, ""}
};
@ -421,6 +1126,7 @@ int main(int argc,char *argv[])
if (mysql_server_init(embedded_server_arg_count, embedded_server_args,
(char**) embedded_server_groups))
{
put_error(NULL);
free_defaults(defaults_argv);
my_end(0);
exit(1);
@ -563,12 +1269,12 @@ sig_handler handle_sigint(int sig)
/* terminate if no query being executed, or we already tried interrupting */
if (!executing_query || interrupted_query)
mysql_end(sig);
goto err;
kill_mysql= mysql_init(kill_mysql);
if (!mysql_real_connect(kill_mysql,current_host, current_user, opt_password,
"", opt_mysql_port, opt_mysql_unix_port,0))
mysql_end(sig);
goto err;
/* kill_buffer is always big enough because max length of %lu is 15 */
sprintf(kill_buffer, "KILL /*!50000 QUERY */ %lu", mysql_thread_id(&mysql));
@ -577,6 +1283,22 @@ sig_handler handle_sigint(int sig)
tee_fprintf(stdout, "Query aborted by Ctrl+C\n");
interrupted_query= 1;
return;
err:
#ifdef _WIN32
/*
When SIGINT is raised on Windows, the OS creates a new thread to handle the
interrupt. Once that thread completes, the main thread continues running
only to find that it's resources have already been free'd when the sigint
handler called mysql_end().
*/
mysql_thread_end();
return;
#else
mysql_end(sig);
#endif
}
@ -813,7 +1535,7 @@ static void usage(int version)
if (version)
return;
printf("\
Copyright (C) 2002 MySQL AB\n\
Copyright (C) 2000-2008 MySQL AB\n\
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
and you are welcome to modify and redistribute it under the GPL license\n");
printf("Usage: %s [OPTIONS] [database]\n", my_progname);
@ -1767,12 +2489,6 @@ static void build_completion_hash(bool rehash, bool write_info)
if (status.batch || quick || !current_db)
DBUG_VOID_RETURN; // We don't need completion in batches
/* hash SQL commands */
while (cmd->name) {
add_word(&ht,(char*) cmd->name);
cmd++;
}
if (!rehash)
DBUG_VOID_RETURN;
@ -1782,6 +2498,12 @@ static void build_completion_hash(bool rehash, bool write_info)
completion_hash_clean(&ht);
free_root(&hash_mem_root,MYF(0));
/* hash this file's known subset of SQL commands */
while (cmd->name) {
add_word(&ht,(char*) cmd->name);
cmd++;
}
/* hash MySQL functions (to be implemented) */
/* hash all database names */
@ -2163,7 +2885,8 @@ com_charset(String *buffer __attribute__((unused)), char *line)
static int
com_go(String *buffer,char *line __attribute__((unused)))
{
char buff[200], time_buff[32], *pos;
char buff[200]; /* about 110 chars used so far */
char time_buff[52+3+1]; /* time max + space&parens + NUL */
MYSQL_RES *result;
ulong timer, warnings= 0;
uint error= 0;
@ -2224,6 +2947,8 @@ com_go(String *buffer,char *line __attribute__((unused)))
do
{
char *pos;
if (quick)
{
if (!(result=mysql_use_result(&mysql)) && mysql_field_count(&mysql))
@ -2242,7 +2967,9 @@ com_go(String *buffer,char *line __attribute__((unused)))
if (verbose >= 3 || !opt_silent)
mysql_end_timer(timer,time_buff);
else
time_buff[0]=0;
time_buff[0]= '\0';
/* Every branch must truncate buff . */
if (result)
{
if (!mysql_num_rows(result) && ! quick && !column_types_flag)
@ -3809,6 +4536,11 @@ static ulong start_timer(void)
}
/**
Write as many as 52+1 bytes to buff, in the form of a legible duration of time.
len("4294967296 days, 23 hours, 59 minutes, 60.00 seconds") -> 52
*/
static void nice_time(double sec,char *buff,bool part_second)
{
ulong tmp;

View File

@ -74,7 +74,7 @@ static struct my_option my_long_options[]=
{"debug", '#', "Output debug log", (uchar* *) & default_dbug_option,
(uchar* *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,

View File

@ -97,7 +97,7 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",

View File

@ -113,6 +113,8 @@ static char *opt_password=0,*current_user=0,
*log_error_file= NULL;
static char **defaults_argv= 0;
static char compatible_mode_normal_str[255];
/* Server supports character_set_results session variable? */
static my_bool server_supports_switching_charsets= TRUE;
static ulong opt_compatible_mode= 0;
#define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1
#define MYSQL_OPT_MASTER_DATA_COMMENTED_SQL 2
@ -243,7 +245,7 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
@ -1239,11 +1241,27 @@ static void restore_time_zone(FILE *sql_file,
}
/**
Switch charset for results to some specified charset. If the server does not
support character_set_results variable, nothing can be done here. As for
whether something should be done here, future new callers of this function
should be aware that the server lacking the facility of switching charsets is
treated as success.
@note If the server lacks support, then nothing is changed and no error
condition is returned.
@returns whether there was an error or not
*/
static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
{
char query_buffer[QUERY_LENGTH];
size_t query_length;
/* Server lacks facility. This is not an error, by arbitrary decision . */
if (!server_supports_switching_charsets)
return FALSE;
query_length= my_snprintf(query_buffer,
sizeof (query_buffer),
"SET SESSION character_set_results = '%s'",
@ -1457,11 +1475,14 @@ static int connect_to_db(char *host, char *user,char *passwd)
DB_error(&mysql_connection, "when trying to connect");
DBUG_RETURN(1);
}
/*
Don't dump SET NAMES with a pre-4.1 server (bug#7997).
*/
if (mysql_get_server_version(&mysql_connection) < 40100)
{
/* Don't dump SET NAMES with a pre-4.1 server (bug#7997). */
opt_set_charset= 0;
/* Don't switch charsets for 4.1 and earlier. (bug#34192). */
server_supports_switching_charsets= FALSE;
}
/*
As we're going to set SQL_MODE, it would be lost on reconnect, so we
cannot reconnect.
@ -4306,6 +4327,7 @@ static int do_show_master_status(MYSQL *mysql_con)
my_printf_error(0, "Error: Binlogging on server not active",
MYF(0));
mysql_free_result(master);
maybe_exit(EX_MYSQLERR);
return 1;
}
mysql_free_result(master);

View File

@ -87,7 +87,7 @@ static struct my_option my_long_options[] =
0, 0, 0},
{"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",

View File

@ -178,7 +178,7 @@ static struct my_option my_long_options[] =
0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",

View File

@ -569,13 +569,13 @@ static struct my_option my_long_options[] =
OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit.",
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
(uchar**) &default_dbug_option, (uchar**) &default_dbug_option, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,

View File

@ -45,6 +45,10 @@
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef __WIN__
#include <direct.h>
#endif
/* Use cygwin for --exec and --system before 5.0 */
#if MYSQL_VERSION_ID < 50000
@ -271,7 +275,7 @@ enum enum_commands {
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
Q_SEND_QUIT, Q_CHANGE_USER,
Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
@ -361,6 +365,9 @@ const char *command_names[]=
"diff_files",
"send_quit",
"change_user",
"mkdir",
"rmdir",
0
};
@ -537,6 +544,17 @@ static int do_send_query(struct st_connection *cn, const char *q, int q_len,
return 0;
}
static void wait_query_thread_end(struct st_connection *con)
{
if (!con->query_done)
{
pthread_mutex_lock(&con->mutex);
while (!con->query_done)
pthread_cond_wait(&con->cond, &con->mutex);
pthread_mutex_unlock(&con->mutex);
}
}
#else /*EMBEDDED_LIBRARY*/
#define do_send_query(cn,q,q_len,flags) mysql_send_query(&cn->mysql, q, q_len)
@ -1914,6 +1932,18 @@ void var_set_errno(int sql_errno)
var_set_int("$mysql_errno", sql_errno);
}
/*
Update $mysql_get_server_version variable with version
of the currently connected server
*/
void var_set_mysql_get_server_version(MYSQL* mysql)
{
var_set_int("$mysql_get_server_version", mysql_get_server_version(mysql));
}
/*
Set variable from the result of a query
@ -2223,7 +2253,7 @@ int open_file(const char *name)
if (!(cur_file->file = my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
{
cur_file--;
die("Could not open file '%s'", buff);
die("Could not open '%s' for reading", buff);
}
cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
cur_file->lineno=1;
@ -2770,6 +2800,67 @@ void do_file_exist(struct st_command *command)
}
/*
SYNOPSIS
do_mkdir
command called command
DESCRIPTION
mkdir <dir_name>
Create the directory <dir_name>
*/
void do_mkdir(struct st_command *command)
{
int error;
static DYNAMIC_STRING ds_dirname;
const struct command_arg mkdir_args[] = {
"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to create"
};
DBUG_ENTER("do_mkdir");
check_command_args(command, command->first_argument,
mkdir_args, sizeof(mkdir_args)/sizeof(struct command_arg),
' ');
DBUG_PRINT("info", ("creating directory: %s", ds_dirname.str));
error= my_mkdir(ds_dirname.str, 0777, MYF(0)) != 0;
handle_command_error(command, error);
dynstr_free(&ds_dirname);
DBUG_VOID_RETURN;
}
/*
SYNOPSIS
do_rmdir
command called command
DESCRIPTION
rmdir <dir_name>
Remove the empty directory <dir_name>
*/
void do_rmdir(struct st_command *command)
{
int error;
static DYNAMIC_STRING ds_dirname;
const struct command_arg rmdir_args[] = {
"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to remove"
};
DBUG_ENTER("do_rmdir");
check_command_args(command, command->first_argument,
rmdir_args, sizeof(rmdir_args)/sizeof(struct command_arg),
' ');
DBUG_PRINT("info", ("removing directory: %s", ds_dirname.str));
error= rmdir(ds_dirname.str) != 0;
handle_command_error(command, error);
dynstr_free(&ds_dirname);
DBUG_VOID_RETURN;
}
/*
Read characters from line buffer or file. This is needed to allow
my_ungetc() to buffer MAX_DELIMITER_LENGTH characters for a file
@ -3982,6 +4073,10 @@ int select_connection_name(const char *name)
if (!(cur_con= find_connection_by_name(name)))
die("connection '%s' not found in connection pool", name);
/* Update $mysql_get_server_version to that of current connection */
var_set_mysql_get_server_version(&cur_con->mysql);
DBUG_RETURN(0);
}
@ -4035,7 +4130,14 @@ void do_close_connection(struct st_command *command)
con->mysql.net.vio = 0;
}
}
#endif
#else
/*
As query could be still executed in a separate theread
we need to check if the query's thread was finished and probably wait
(embedded-server specific)
*/
wait_query_thread_end(con);
#endif /*EMBEDDED_LIBRARY*/
if (con->stmt)
mysql_stmt_close(con->stmt);
con->stmt= 0;
@ -4187,11 +4289,13 @@ int connect_n_handle_errors(struct st_command *command,
if (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0,
CLIENT_MULTI_STATEMENTS))
{
var_set_errno(mysql_errno(con));
handle_error(command, mysql_errno(con), mysql_error(con),
mysql_sqlstate(con), ds);
return 0; /* Not connected */
}
var_set_errno(0);
handle_no_error(command);
return 1; /* Connected */
}
@ -4321,6 +4425,9 @@ void do_connect(struct st_command *command)
(int) (sizeof(connections)/sizeof(struct st_connection)));
}
#ifdef EMBEDDED_LIBRARY
con_slot->query_done= 1;
#endif
if (!mysql_init(&con_slot->mysql))
die("Failed on mysql_init()");
if (opt_compress || con_compress)
@ -4369,6 +4476,9 @@ void do_connect(struct st_command *command)
next_con++; /* if we used the next_con slot, advance the pointer */
}
/* Update $mysql_get_server_version to that of current connection */
var_set_mysql_get_server_version(&cur_con->mysql);
dynstr_free(&ds_connection_name);
dynstr_free(&ds_host);
dynstr_free(&ds_user);
@ -5034,7 +5144,7 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
@ -5216,7 +5326,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0);
if (!(cur_file->file=
my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
die("Could not open %s: errno = %d", buff, errno);
die("Could not open '%s' for reading: errno = %d", buff, errno);
cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
cur_file->lineno= 1;
break;
@ -5343,9 +5453,9 @@ void str_to_file2(const char *fname, char *str, int size, my_bool append)
flags|= O_TRUNC;
if ((fd= my_open(buff, flags,
MYF(MY_WME | MY_FFNF))) < 0)
die("Could not open %s: errno = %d", buff, errno);
die("Could not open '%s' for writing: errno = %d", buff, errno);
if (append && my_seek(fd, 0, SEEK_END, MYF(0)) == MY_FILEPOS_ERROR)
die("Could not find end of file %s: errno = %d", buff, errno);
die("Could not find end of file '%s': errno = %d", buff, errno);
if (my_write(fd, (uchar*)str, size, MYF(MY_WME|MY_FNABP)))
die("write failed");
my_close(fd, MYF(0));
@ -5834,16 +5944,11 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
}
#ifdef EMBEDDED_LIBRARY
/*
Here we handle 'reap' command, so we need to check if the
query's thread was finished and probably wait
Here we handle 'reap' command, so we need to check if the
query's thread was finished and probably wait
*/
else if (flags & QUERY_REAP_FLAG)
{
pthread_mutex_lock(&cn->mutex);
while (!cn->query_done)
pthread_cond_wait(&cn->cond, &cn->mutex);
pthread_mutex_unlock(&cn->mutex);
}
wait_query_thread_end(cn);
#endif /*EMBEDDED_LIBRARY*/
if (!(flags & QUERY_REAP_FLAG))
DBUG_VOID_RETURN;
@ -6314,6 +6419,8 @@ int util_query(MYSQL* org_mysql, const char* query){
if (!(mysql= mysql_init(mysql)))
die("Failed in mysql_init()");
/* enable local infile, in non-binary builds often disabled by default */
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
org_mysql->passwd, org_mysql->db, org_mysql->port,
org_mysql->unix_socket);
@ -6907,6 +7014,9 @@ int main(int argc, char **argv)
*/
var_set_errno(-1);
/* Update $mysql_get_server_version to that of current connection */
var_set_mysql_get_server_version(&cur_con->mysql);
if (opt_include)
{
open_file(opt_include);
@ -6962,6 +7072,8 @@ int main(int argc, char **argv)
case Q_ECHO: do_echo(command); command_executed++; break;
case Q_SYSTEM: do_system(command); break;
case Q_REMOVE_FILE: do_remove_file(command); break;
case Q_MKDIR: do_mkdir(command); break;
case Q_RMDIR: do_rmdir(command); break;
case Q_FILE_EXIST: do_file_exist(command); break;
case Q_WRITE_FILE: do_write_file(command); break;
case Q_APPEND_FILE: do_append_file(command); break;
@ -7309,7 +7421,7 @@ void timer_output(void)
ulonglong timer_now(void)
{
return my_getsystime() / 10000;
return my_micro_time() / 1000;
}

View File

@ -136,6 +136,8 @@ struct editline {
protected int el_editmode(EditLine *, int, const char **);
#define el_isprint(x) ((unsigned char) (x) < 0x80 ? isprint(x) : 1)
#ifdef DEBUG
#define EL_ABORT(a) do { \
fprintf(el->el_errfile, "%s, %d: ", \

View File

@ -618,7 +618,7 @@ key__decode_char(char *buf, int cnt, int ch)
} else if (ch == '\\') {
buf[cnt++] = '\\';
buf[cnt] = '\\';
} else if (ch == ' ' || (isprint(ch) && !isspace(ch))) {
} else if (ch == ' ' || (el_isprint(ch) && !isspace(ch))) {
buf[cnt] = ch;
} else {
buf[cnt++] = '\\';
@ -660,7 +660,7 @@ key__decode_str(const char *str, char *buf, const char *sep)
} else if (*p == '^' || *p == '\\') {
*b++ = '\\';
*b++ = *p;
} else if (*p == ' ' || (isprint((unsigned char) *p) &&
} else if (*p == ' ' || (el_isprint((unsigned char) *p) &&
!isspace((unsigned char) *p))) {
*b++ = *p;
} else {

View File

@ -961,7 +961,7 @@ map_init_nls(EditLine *el)
el_action_t *map = el->el_map.key;
for (i = 0200; i <= 0377; i++)
if (isprint(i))
if (el_isprint(i))
map[i] = ED_INSERT;
}

View File

@ -508,7 +508,7 @@ el_gets(EditLine *el, int *nread)
el->el_chared.c_redo.pos < el->el_chared.c_redo.lim) {
if (cmdnum == VI_DELETE_PREV_CHAR &&
el->el_chared.c_redo.pos != el->el_chared.c_redo.buf
&& isprint((unsigned char)el->el_chared.c_redo.pos[-1]))
&& el_isprint((unsigned char)el->el_chared.c_redo.pos[-1]))
el->el_chared.c_redo.pos--;
else
*el->el_chared.c_redo.pos++ = ch;

View File

@ -88,7 +88,7 @@ private void
re_addc(EditLine *el, int c)
{
if (isprint(c)) {
if (el_isprint(c)) {
re_putc(el, c, 1);
return;
}
@ -964,7 +964,7 @@ re_refresh_cursor(EditLine *el)
h = 1;
v++;
}
} else if (!isprint((unsigned char) c)) {
} else if (!el_isprint((unsigned char) c)) {
h += 3;
if (h > th) { /* if overflow, compensate */
h = h - th;
@ -1057,7 +1057,7 @@ re_fastaddc(EditLine *el)
char mc = (c == '\177') ? '?' : (c | 0100);
re_fastputc(el, '^');
re_fastputc(el, mc);
} else if (isprint((unsigned char) c)) { /* normal char */
} else if (el_isprint((unsigned char) c)) { /* normal char */
re_fastputc(el, c);
} else {
re_fastputc(el, '\\');

View File

@ -27,7 +27,7 @@
#endif
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <stdio.h>

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include "rlconf.h"

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <stdio.h>

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#if !defined (BUFSIZ)

View File

@ -23,7 +23,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <stdio.h>

View File

@ -31,7 +31,7 @@
#endif
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <stdio.h>

View File

@ -26,7 +26,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <stdio.h>

View File

@ -23,7 +23,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <stdio.h>

View File

@ -26,7 +26,7 @@
#endif
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -27,7 +27,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -21,7 +21,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#if defined (HAVE_STDLIB_H)

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#if defined (HAVE_UNISTD_H)

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -28,7 +28,7 @@
#include "rlconf.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <stdio.h>

View File

@ -23,7 +23,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -27,7 +27,7 @@
#define _RLDEFS_H_
#if defined (HAVE_CONFIG_H)
# include "config.h"
# include "config_readline.h"
#endif
#include "rlstdc.h"

View File

@ -23,7 +23,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -26,7 +26,7 @@
#define _RLWINSIZE_H_
#if defined (HAVE_CONFIG_H)
# include "config.h"
# include "config_readline.h"
#endif
/* Try to find the definitions of `struct winsize' and TIOGCWINSZ */

View File

@ -21,7 +21,7 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#include <config.h>
#include "config_readline.h"
#ifdef HAVE_STRING_H
# include <string.h>
#endif

View File

@ -23,7 +23,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -23,7 +23,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <stdio.h> /* Just for NULL. Yuck. */

View File

@ -25,7 +25,7 @@
#define _RLTCAP_H_
#if defined (HAVE_CONFIG_H)
# include "config.h"
# include "config_readline.h"
#endif
#if defined (HAVE_TERMCAP_H)

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#if defined (HAVE_UNISTD_H)

View File

@ -20,7 +20,7 @@
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#if defined (HAVE_UNISTD_H)

View File

@ -23,7 +23,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -22,7 +22,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -32,7 +32,7 @@
#if defined (VI_MODE)
#if defined (HAVE_CONFIG_H)
# include <config.h>
# include "config_readline.h"
#endif
#include <sys/types.h>

View File

@ -21,7 +21,7 @@
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
#include <config.h>
#include "config_readline.h"
#endif
#include <stdio.h>

View File

@ -199,7 +199,7 @@ do
;;
*)
AC_MSG_ERROR([Charset '$cs' not available. (Available are: $CHARSETS_AVAILABLE).
See the Installation chapter in the Reference Manual.]);
See the Installation chapter in the Reference Manual.])
esac
done
@ -380,7 +380,7 @@ case $default_charset in
;;
*)
AC_MSG_ERROR([Charset $cs not available. (Available are: $CHARSETS_AVAILABLE).
See the Installation chapter in the Reference Manual.]);
See the Installation chapter in the Reference Manual.])
esac
if test "$default_collation" = default; then
@ -405,7 +405,7 @@ else
Collation $default_collation is not valid for character set $default_charset.
Valid collations are: $default_charset_collations.
See the Installation chapter in the Reference Manual.
]);
])
fi
AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_CHARSET_NAME], ["$default_charset"],

View File

@ -2,9 +2,9 @@ dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_NDBCLUSTER
dnl ---------------------------------------------------------------------------
NDB_VERSION_MAJOR=`echo $MYSQL_NO_DASH_VERSION | cut -d. -f1`
NDB_VERSION_MINOR=`echo $MYSQL_NO_DASH_VERSION | cut -d. -f2`
NDB_VERSION_BUILD=`echo $MYSQL_NO_DASH_VERSION | cut -d. -f3`
NDB_VERSION_MAJOR=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f1`
NDB_VERSION_MINOR=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f2`
NDB_VERSION_BUILD=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f3`
NDB_VERSION_STATUS=`echo $VERSION | sed 's/^[[-.0-9]]*//'`
TEST_NDBCLUSTER=""

View File

@ -631,7 +631,7 @@ case $SYSTEM_TYPE in
esac
if test "$CXX_VERSION"
then
AC_MSG_CHECKING("C++ compiler version");
AC_MSG_CHECKING("C++ compiler version")
AC_MSG_RESULT("$CXX $CXX_VERSION")
fi
AC_SUBST(CXX_VERSION)

View File

@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
#
# When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version().
AM_INIT_AUTOMAKE(mysql, 5.1.24-maria-alpha)
AM_INIT_AUTOMAKE(mysql, 5.1.25-maria-alpha)
AM_CONFIG_HEADER([include/config.h:config.h.in])
PROTOCOL_VERSION=10
@ -23,9 +23,19 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
# Set all version vars based on $VERSION. How do we do this more elegant ?
# Remember that regexps needs to quote [ and ] since this is run through m4
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"`
MYSQL_BASE_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|\.[[^.]]*$||"`
MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION | sed -e 's|[[^0-9.]].*$||;s|$|.|' | sed -e 's/[[^0-9.]]//g; s/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'`
# We take some made up examples
#
# VERSION 5.1.40sp1-alpha 5.0.34a
# MYSQL_NO_DASH_VERSION 5.1.40sp1 5.0.34a
# MYSQL_NUMERIC_VERSION 5.1.40 5.0.34
# MYSQL_BASE_VERSION 5.1 5.0
# MYSQL_VERSION_ID 50140 50034
#
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \
awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
# Add previous major version for debian package upgrade path
MYSQL_PREVIOUS_BASE_VERSION=5.0
@ -188,7 +198,7 @@ CC_VERSION=`$CC --version | sed 1q`
esac
if test $? -eq "0"
then
AC_MSG_CHECKING("C Compiler version");
AC_MSG_CHECKING("C Compiler version")
AC_MSG_RESULT("$CC $CC_VERSION")
else
CC_VERSION=""
@ -813,8 +823,8 @@ AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \
sys/prctl.h \
sys/resource.h sys/param.h port.h ieeefp.h)
sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h \
execinfo.h)
AC_CHECK_HEADERS([xfs/xfs.h])
@ -1031,8 +1041,8 @@ case $SYSTEM_TYPE in
;;
*hpux11.*)
AC_MSG_WARN([Enabling workarounds for hpux 11])
CFLAGS="$CFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CXXFLAGS="$CXXFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CFLAGS="$CFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CXXFLAGS="$CXXFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
if test "$with_named_thread" = "no"
then
AC_MSG_WARN([Using --with-named-thread=-lpthread])
@ -1296,7 +1306,7 @@ See the Installation chapter in the Reference Manual for more information.])
AC_MSG_RESULT("no need to check headers")
fi
AC_MSG_CHECKING("for pthread_create in -lpthread");
AC_MSG_CHECKING("for pthread_create in -lpthread")
ac_save_LIBS="$LIBS"
LIBS="$LIBS -lpthread"
AC_TRY_LINK( [#include <pthread.h>],
@ -1356,7 +1366,7 @@ then
then
AC_MSG_RESULT("yes")
else
AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.]);
AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.])
fi
AC_MSG_RESULT("yes")
elif test -f /usr/local/lib/libpthread.a -o -f /usr/local/lib/libpthread.so
@ -1372,7 +1382,7 @@ then
then
AC_MSG_RESULT("yes")
else
AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.]);
AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.])
fi
AC_MSG_RESULT("yes")
# Hack for SCO UnixWare 7.1.x
@ -1517,7 +1527,7 @@ else
AC_MSG_RESULT("$with_posix_threads")
if test "$with_posix_threads" = "no"
then
AC_MSG_CHECKING("for pthread_create in -lpthread");
AC_MSG_CHECKING("for pthread_create in -lpthread")
ac_save_LIBS="$LIBS"
LIBS="$LIBS -lpthread"
CLIENT_THREAD_LIBS="-lpthread"
@ -1530,7 +1540,7 @@ else
then
LIBS=" $ac_save_LIBS -lpthreads"
CLIENT_THREAD_LIBS="-lpthreads"
AC_MSG_CHECKING("for pthread_create in -lpthreads");
AC_MSG_CHECKING("for pthread_create in -lpthreads")
AC_TRY_LINK(
[#include <pthread.h>],
[ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
@ -1541,7 +1551,7 @@ else
# This is for FreeBSD
LIBS="$ac_save_LIBS -pthread"
CLIENT_THREAD_LIBS="-pthread"
AC_MSG_CHECKING("for pthread_create in -pthread");
AC_MSG_CHECKING("for pthread_create in -pthread")
AC_TRY_LINK(
[#include <pthread.h>],
[ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
@ -1915,7 +1925,7 @@ if test "$ac_cv_conv_longlong_to_float" != "yes"
then
AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
again]);
again])
fi
fi
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
@ -2041,7 +2051,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
sighold sigset sigthreadmask port_create sleep thr_yield \
snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \
posix_fallocate)
posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
#
#
@ -2079,7 +2089,7 @@ CFLAGS="$ORG_CFLAGS"
AC_CHECK_FUNC(fseeko,
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
then
AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!");
AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
fi]
)
@ -2331,6 +2341,21 @@ then
fi
AC_MSG_RESULT("$netinet_inc")
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS(cxxabi.h)
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
[AC_TRY_LINK([#include <cxxabi.h>], [
char *foo= 0; int bar= 0;
foo= abi::__cxa_demangle(foo, foo, 0, &bar);
], [mysql_cv_cxa_demangle=yes], [mysql_cv_cxa_demangle=no])])
AC_LANG_RESTORE
if test "x$mysql_cv_cxa_demangle" = xyes; then
AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
[Define to 1 if you have the `abi::__cxa_demangle' function.])
fi
#--------------------------------------------------------------------
# Check for requested features
#--------------------------------------------------------------------

View File

@ -454,7 +454,7 @@ void _db_process_(const char *name)
/*
* FUNCTION
*
* ParseDbug parse control string and set current debugger settings
* DbugParse parse control string and set current debugger settings
*
* DESCRIPTION
*
@ -481,7 +481,7 @@ void _db_process_(const char *name)
* 0 - a list of functions was not changed
*/
int ParseDbug(CODE_STATE *cs, const char *control)
int DbugParse(CODE_STATE *cs, const char *control)
{
const char *end;
int rel, f_used=0;
@ -834,7 +834,7 @@ void _db_set_(const char *control)
uint old_fflags;
get_code_state_or_return;
old_fflags=fflags(cs);
if (ParseDbug(cs, control))
if (DbugParse(cs, control))
FixTraceFlags(old_fflags, cs);
}
@ -863,7 +863,7 @@ void _db_push_(const char *control)
get_code_state_or_return;
old_fflags=fflags(cs);
PushState(cs);
if (ParseDbug(cs, control))
if (DbugParse(cs, control))
FixTraceFlags(old_fflags, cs);
}
@ -887,7 +887,7 @@ void _db_set_init_(const char *control)
CODE_STATE tmp_cs;
bzero((uchar*) &tmp_cs, sizeof(tmp_cs));
tmp_cs.stack= &init_settings;
ParseDbug(&tmp_cs, control);
DbugParse(&tmp_cs, control);
}
/*

View File

@ -730,8 +730,9 @@ warning will be given. The DBUG_POP macro has no arguments.
EX:\ \fCDBUG_POP\ ();\fR
.SP 1
.LI DBUG_SET\
Modifies the current debugger state on top of the stack using the
debug control string passed as the macro argument. Unless
Modifies the current debugger state on top of the stack or pushes
a new state if the current is set to the initial settings, using
the debug control string passed as the macro argument. Unless
.I incremental
control string is used (see below), it's equivalent to a combination of
DBUG_POP and DBUG_PUSH.

View File

@ -44,6 +44,9 @@ TARGET_LINK_LIBRARIES(my_print_defaults strings mysys debug dbug taocrypt wsock3
ADD_EXECUTABLE(perror perror.c)
TARGET_LINK_LIBRARIES(perror strings mysys debug dbug wsock32)
ADD_EXECUTABLE(resolveip resolveip.c)
TARGET_LINK_LIBRARIES(resolveip strings mysys debug dbug wsock32)
ADD_EXECUTABLE(replace replace.c)
TARGET_LINK_LIBRARIES(replace strings mysys debug dbug wsock32)

View File

@ -13,9 +13,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Return error-text for system error messages and nisam messages */
/* Return error-text for system error messages and handler messages */
#define PERROR_VERSION "2.10"
#define PERROR_VERSION "2.11"
#include <my_global.h>
#include <my_sys.h>
@ -30,6 +30,10 @@
static my_bool verbose, print_all_codes;
#include "../include/my_base.h"
#include "../mysys/my_handler_errors.h"
#include "../include/my_handler.h"
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
static my_bool ndb_code;
static char ndb_string[1024];
@ -82,36 +86,6 @@ typedef struct ha_errors {
static HA_ERRORS ha_errlist[]=
{
{ 120,"Didn't find key on read or update" },
{ 121,"Duplicate key on write or update" },
{ 123,"Someone has changed the row since it was read (while the table was locked to prevent it)" },
{ 124,"Wrong index given to function" },
{ 126,"Index file is crashed" },
{ 127,"Record-file is crashed" },
{ 128,"Out of memory" },
{ 130,"Incorrect file format" },
{ 131,"Command not supported by database" },
{ 132,"Old database file" },
{ 133,"No record read before update" },
{ 134,"Record was already deleted (or record file crashed)" },
{ 135,"No more room in record file" },
{ 136,"No more room in index file" },
{ 137,"No more records (read after end of file)" },
{ 138,"Unsupported extension used for table" },
{ 139,"Too big row"},
{ 140,"Wrong create options"},
{ 141,"Duplicate unique key or constraint on write or update"},
{ 142,"Unknown character set used"},
{ 143,"Conflicting table definitions in sub-tables of MERGE table"},
{ 144,"Table is crashed and last repair failed"},
{ 145,"Table was marked as crashed and should be repaired"},
{ 146,"Lock timed out; Retry transaction"},
{ 147,"Lock table is full; Restart program with a larger locktable"},
{ 148,"Updates are not allowed under a read only transactions"},
{ 149,"Lock deadlock; Retry transaction"},
{ 150,"Foreign key constraint is incorrectly formed"},
{ 151,"Cannot add a child row"},
{ 152,"Cannot delete a parent row"},
{ -30999, "DB_INCOMPLETE: Sync didn't finish"},
{ -30998, "DB_KEYEMPTY: Key/data deleted or never created"},
{ -30997, "DB_KEYEXIST: The key/data pair already exists"},
@ -193,6 +167,17 @@ static const char *get_ha_error_msg(int code)
{
HA_ERRORS *ha_err_ptr;
/*
If you got compilation error here about compile_time_assert array, check
that every HA_ERR_xxx constant has a corresponding error message in
handler_error_messages[] list (check mysys/ma_handler_errors.h and
include/my_base.h).
*/
compile_time_assert(HA_ERR_FIRST + array_elements(handler_error_messages) ==
HA_ERR_LAST + 1);
if (code >= HA_ERR_FIRST && code <= HA_ERR_LAST)
return handler_error_messages[code - HA_ERR_FIRST];
for (ha_err_ptr=ha_errlist ; ha_err_ptr->errcode ;ha_err_ptr++)
if (ha_err_ptr->errcode == code)
return ha_err_ptr->msg;
@ -210,6 +195,8 @@ int main(int argc,char *argv[])
if (get_options(&argc,&argv))
exit(1);
my_handler_error_register();
error=0;
#ifdef HAVE_SYS_ERRLIST
if (print_all_codes)
@ -290,29 +277,24 @@ int main(int argc,char *argv[])
(const uchar*) "Unknown Error", 13) &&
(!unknown_error || strcmp(msg, unknown_error)))
{
found=1;
found= 1;
if (verbose)
printf("OS error code %3d: %s\n",code,msg);
printf("OS error code %3d: %s\n", code, msg);
else
puts(msg);
}
if ((msg= get_ha_error_msg(code)))
{
found= 1;
if (verbose)
printf("MySQL error code %3d: %s\n", code, msg);
else
puts(msg);
}
if (!found)
{
/* Error message still not found, look in handler error codes */
if (!(msg=get_ha_error_msg(code)))
{
fprintf(stderr,"Illegal error code: %d\n",code);
error=1;
}
else
{
found= 1;
if (verbose)
printf("MySQL error code %3d: %s\n",code,msg);
else
puts(msg);
}
fprintf(stderr,"Illegal error code: %d\n", code);
error= 1;
}
}
}

View File

@ -21,13 +21,15 @@
#include <m_ctype.h>
#include <my_sys.h>
#include <m_string.h>
#include <sys/types.h>
#include <sys/socket.h>
#ifndef HAVE_BROKEN_NETINET_INCLUDES
#include <netinet/in.h>
#ifndef WIN32
# include <sys/types.h>
# include <sys/socket.h>
# ifndef HAVE_BROKEN_NETINET_INCLUDES
# include <netinet/in.h>
# endif
# include <arpa/inet.h>
# include <netdb.h>
#endif
#include <arpa/inet.h>
#include <netdb.h>
#include <my_net.h>
#include <my_getopt.h>
@ -116,13 +118,21 @@ int main(int argc, char **argv)
while (argc--)
{
#ifndef WIN32
struct in_addr addr;
#endif
ip = *argv++;
/* Not compatible with IPv6! Probably should use getnameinfo(). */
#ifdef WIN32
taddr = inet_addr(ip);
if(taddr != INADDR_NONE)
{
#else
if (inet_aton(ip, &addr) != 0)
{
taddr= addr.s_addr;
#endif
if (taddr == htonl(INADDR_BROADCAST))
{
puts("Broadcast");

View File

@ -24,4 +24,5 @@ SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp sr
src/yassl_imp.cpp src/yassl_int.cpp)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(yassl ${YASSL_SOURCES})
ADD_DEPENDENCIES(yassl GenError)
ENDIF(NOT SOURCE_SUBLIBS)

View File

@ -168,14 +168,12 @@ typedef uint rf_SetTimer;
#define Socket_defined
#define my_socket SOCKET
#define bool BOOL
#define SIGPIPE SIGINT
#define RETQSORTTYPE void
#define QSORT_TYPE_IS_VOID
#define RETSIGTYPE void
#define SOCKET_SIZE_TYPE int
#define my_socket_defined
#define bool_defined
#define byte_defined
#define HUGE_PTR
#define STDCALL __stdcall /* Used by libmysql.dll */
@ -267,73 +265,10 @@ inline double ulonglong2double(ulonglong value)
#define tell(A) _telli64(A)
#endif
#define STACK_DIRECTION -1
/* Optimized store functions for Intel x86 */
#ifndef _WIN64
#define sint2korr(A) (*((int16 *) (A)))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
(((uint32) 255L << 24) | \
(((uint32) (uchar) (A)[2]) << 16) |\
(((uint32) (uchar) (A)[1]) << 8) | \
((uint32) (uchar) (A)[0])) : \
(((uint32) (uchar) (A)[2]) << 16) |\
(((uint32) (uchar) (A)[1]) << 8) | \
((uint32) (uchar) (A)[0])))
#define sint4korr(A) (*((long *) (A)))
#define uint2korr(A) (*((uint16 *) (A)))
/*
ATTENTION !
Please, note, uint3korr reads 4 bytes (not 3) !
It means, that you have to provide enough allocated space !
*/
#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF)
#define uint4korr(A) (*((unsigned long *) (A)))
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16) +\
(((uint32) ((uchar) (A)[3])) << 24)) +\
(((ulonglong) ((uchar) (A)[4])) << 32))
#define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) + \
(((uint32) ((uchar) (A)[1])) << 8) + \
(((uint32) ((uchar) (A)[2])) << 16) + \
(((uint32) ((uchar) (A)[3])) << 24)) + \
(((ulonglong) ((uchar) (A)[4])) << 32) + \
(((ulonglong) ((uchar) (A)[5])) << 40))
#define uint8korr(A) (*((ulonglong *) (A)))
#define sint8korr(A) (*((longlong *) (A)))
#define int2store(T,A) *((uint16*) (T))= (uint16) (A)
#define int3store(T,A) { *(T)= (uchar) ((A));\
*(T+1)=(uchar) (((uint) (A) >> 8));\
*(T+2)=(uchar) (((A) >> 16)); }
#define int4store(T,A) *((long *) (T))= (long) (A)
#define int5store(T,A) { *(T)= (uchar)((A));\
*((T)+1)=(uchar) (((A) >> 8));\
*((T)+2)=(uchar) (((A) >> 16));\
*((T)+3)=(uchar) (((A) >> 24)); \
*((T)+4)=(uchar) (((A) >> 32)); }
#define int6store(T,A) { *(T) =(uchar)((A)); \
*((T)+1)=(uchar) (((A) >> 8)); \
*((T)+2)=(uchar) (((A) >> 16)); \
*((T)+3)=(uchar) (((A) >> 24)); \
*((T)+4)=(uchar) (((A) >> 32)); \
*((T)+5)=(uchar) (((A) >> 40)); }
#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
#define doubleget(V,M) do { *((long *) &V) = *((long*) M); \
*(((long *) &V)+1) = *(((long*) M)+1); } while(0)
#define doublestore(T,V) do { *((long *) T) = *((long*) &V); \
*(((long *) T)+1) = *(((long*) &V)+1); } while(0)
#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
#define floatstore(T,V) memcpy((uchar*)(T), (uchar*)(&V), sizeof(float))
#define floatget(V,M) memcpy((uchar*)(&V), (uchar*)(M), sizeof(float))
#define float8get(V,M) doubleget((V),(M))
#define float4store(V,M) memcpy((uchar*) V,(uchar*) (&M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))
#endif /* _WIN64 */
/* Difference between GetSystemTimeAsFileTime() and now() */
#define OFFSET_TO_EPOCH ULL(116444736000000000)
#define HAVE_PERROR
#define HAVE_VFPRINT
@ -482,4 +417,4 @@ inline double ulonglong2double(ulonglong value)
#define HAVE_CHARSET_ujis 1
#define HAVE_CHARSET_utf8 1
#define HAVE_UCA_COLLATIONS 1
#define HAVE_BOOL 1

View File

@ -47,8 +47,9 @@ typedef struct st_hash {
/* A search iterator state */
typedef uint HASH_SEARCH_STATE;
#define hash_init(A,B,C,D,E,F,G,H) _hash_init(A,B,C,D,E,F,G, H CALLER_INFO)
my_bool _hash_init(HASH *hash, CHARSET_INFO *charset,
#define hash_init(A,B,C,D,E,F,G,H) _hash_init(A,0,B,C,D,E,F,G,H CALLER_INFO)
#define hash_init2(A,B,C,D,E,F,G,H,I) _hash_init(A,B,C,D,E,F,G,H,I CALLER_INFO)
my_bool _hash_init(HASH *hash, uint growth_size,CHARSET_INFO *charset,
ulong default_array_elements, size_t key_offset,
size_t key_length, hash_get_key get_key,
void (*free_element)(void*), uint flags CALLER_INFO_PROTO);
@ -69,7 +70,7 @@ my_bool hash_check(HASH *hash); /* Only in debug library */
#define hash_clear(H) bzero((char*) (H),sizeof(*(H)))
#define hash_inited(H) ((H)->array.buffer != 0)
#define hash_init_opt(A,B,C,D,E,F,G,H) \
(!hash_inited(A) && _hash_init(A,B,C,D,E,F,G, H CALLER_INFO))
(!hash_inited(A) && _hash_init(A,0,B,C,D,E,F,G, H CALLER_INFO))
#ifdef __cplusplus
}

View File

@ -282,6 +282,7 @@ typedef struct charset_info_st
MY_COLLATION_HANDLER *coll;
} CHARSET_INFO;
#define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
extern CHARSET_INFO my_charset_bin;

View File

@ -188,16 +188,19 @@ enum ha_extra_function {
executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY.
*/
HA_EXTRA_INSERT_WITH_UPDATE,
/* Inform handler that we will do a rename */
HA_EXTRA_PREPARE_FOR_RENAME,
/*
Orders MERGE handler to attach or detach its child tables. Used at
begin and end of a statement.
*/
HA_EXTRA_ATTACH_CHILDREN,
HA_EXTRA_DETACH_CHILDREN,
/* Inform handler that we will do a rename */
HA_EXTRA_PREPARE_FOR_RENAME
HA_EXTRA_DETACH_CHILDREN
};
/* Compatible option, to be deleted in 6.0 */
#define HA_EXTRA_PREPARE_FOR_DELETE HA_EXTRA_PREPARE_FOR_DROP
/* The following is parameter to ha_panic() */
enum ha_panic_function {
@ -414,8 +417,8 @@ enum ha_base_keytype {
/* NULLs are not supported in spatial index */
#define HA_ERR_NULL_IN_SPATIAL 158
#define HA_ERR_TABLE_DEF_CHANGED 159 /* The table changed in storage engine */
#define HA_ERR_NO_PARTITION_FOUND 160 /* There's no partition in table for
given value */
/* There's no partition in table for given value */
#define HA_ERR_NO_PARTITION_FOUND 160
#define HA_ERR_RBR_LOGGING_FAILED 161 /* Row-based binlogging of row failed */
#define HA_ERR_DROP_INDEX_FK 162 /* Index needed in foreign key constr */
/*
@ -434,14 +437,14 @@ enum ha_base_keytype {
#define HA_ERR_RECORD_IS_THE_SAME 169
/* It is not possible to log this statement */
#define HA_ERR_LOGGING_IMPOSSIBLE 170
#define HA_ERR_CORRUPT_EVENT 171 /* The event was corrupt, leading to */
/* illegal data being read */
/* The event was corrupt, leading to illegal data being read */
#define HA_ERR_CORRUPT_EVENT 171
#define HA_ERR_NEW_FILE 172 /* New file format */
#define HA_ERR_INITIALIZATION 173 /* Error during initialization */
#define HA_ERR_FILE_TOO_SHORT 174 /* File too short */
#define HA_ERR_WRONG_CRC 175 /* Wrong CRC on page */
#define HA_ERR_ROWS_EVENT_APPLY 176 /* The event could not be processed */
/* no other hanlder error happened */
/* The event could not be processed no other handler error happened */
#define HA_ERR_ROWS_EVENT_APPLY 173
#define HA_ERR_INITIALIZATION 174 /* Error during initialization */
#define HA_ERR_FILE_TOO_SHORT 175 /* File too short */
#define HA_ERR_WRONG_CRC 176 /* Wrong CRC on page */
#define HA_ERR_LAST 176 /* Copy of last error nr */
/* Number of different errors */

View File

@ -492,9 +492,6 @@ C_MODE_END
#include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */
#define HAVE_ULONG
#endif
#ifdef DONT_USE_FINITE /* HPUX 11.x has is_finite() */
#undef HAVE_FINITE
#endif
#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD)
/* Fix bug in setrlimit */
#undef setrlimit
@ -865,9 +862,13 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define SIZE_T_MAX ~((size_t) 0)
#endif
#ifndef HAVE_FINITE
#ifndef isfinite
#ifdef HAVE_FINITE
#define isfinite(x) finite(x)
#else
#define finite(x) (1.0 / fabs(x) > 0.0)
#endif
#endif /* HAVE_FINITE */
#endif /* isfinite */
#ifndef HAVE_ISNAN
#define isnan(x) ((x) != (x))
@ -877,7 +878,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* isinf() can be used in both C and C++ code */
#define my_isinf(X) isinf(X)
#else
#define my_isinf(X) (!finite(X) && !isnan(X))
#define my_isinf(X) (!isfinite(X) && !isnan(X))
#endif
/* Define missing math constants. */
@ -1074,7 +1075,7 @@ typedef off_t os_off_t;
typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */
typedef short int15; /* Most effective integer 0 <= x <= 32767 */
typedef int myf; /* Type of MyFlags in my_funcs */
#if !defined(bool) && !defined(bool_defined) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
#if !defined(bool) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
typedef char bool; /* Ordinary boolean values 0 1 */
#endif
/* Macros for converting *constants* to the right type */
@ -1145,7 +1146,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
*/
/* Optimized store functions for Intel x86 */
#if defined(__i386__) && !defined(_WIN64)
#if defined(__i386__) || defined(_WIN32)
#define sint2korr(A) (*((const int16 *) (A)))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
(((uint32) 255L << 24) | \
@ -1157,7 +1158,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
((uint32) (uchar) (A)[0])))
#define sint4korr(A) (*((const long *) (A)))
#define uint2korr(A) (*((const uint16 *) (A)))
#ifdef HAVE_purify
#if defined(HAVE_purify) && !defined(_WIN32)
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16))
@ -1169,7 +1170,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
It means, that you have to provide enough allocated space !
*/
#define uint3korr(A) (long) (*((const unsigned int *) (A)) & 0xFFFFFF)
#endif
#endif /* HAVE_purify && !_WIN32 */
#define uint4korr(A) (*((const uint32 *) (A)))
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
@ -1220,9 +1221,8 @@ do { doubleget_union _tmp; \
#define floatstore(T,V) memcpy((uchar*)(T), (const uchar*)(&V),sizeof(float))
#define floatget(V,M) memcpy((uchar*) &V,(const uchar*) (M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))
#endif /* __i386__ */
#else
#ifndef sint2korr
/*
We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines
were done before)
@ -1361,7 +1361,7 @@ do { doubleget_union _tmp; \
#define float8store(V,M) doublestore((V),(M))
#endif /* WORDS_BIGENDIAN */
#endif /* sint2korr */
#endif /* __i386__ OR _WIN32 */
/*
Macro for reading 32-bit integer from network byte order (big-endian)

View File

@ -20,6 +20,10 @@
#include "myisampack.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
There is a hard limit for the maximum number of keys as there are only
8 bits in the index file header for the number of keys in a table.
@ -118,5 +122,8 @@ extern void my_handler_error_unregister(void);
this amount of bytes.
*/
#define portable_sizeof_char_ptr 8
#ifdef __cplusplus
}
#endif
#endif /* _my_handler_h */

View File

@ -163,7 +163,7 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define pthread_mutex_unlock(A) (LeaveCriticalSection(A),0)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
#define pthread_kill(A,B) pthread_dummy(ESRCH)
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#define pthread_join(A,B) (WaitForSingleObject((A), INFINITE) != WAIT_OBJECT_0)
@ -346,14 +346,14 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define pthread_kill(A,B) pthread_dummy(ESRCH)
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#endif
#ifdef HAVE_DARWIN5_THREADS
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define pthread_kill(A,B) pthread_dummy(ESRCH)
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#define pthread_condattr_init(A) pthread_dummy(0)
#define pthread_condattr_destroy(A) pthread_dummy(0)
#undef pthread_detach_this_thread
@ -373,7 +373,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#ifndef pthread_sigmask
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#endif
#define pthread_kill(A,B) pthread_dummy(ESRCH)
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */

View File

@ -286,9 +286,11 @@ enum flush_type
FLUSH_KEEP, /* flush block and keep it in the cache */
FLUSH_RELEASE, /* flush block and remove it from the cache */
FLUSH_IGNORE_CHANGED, /* remove block from the cache */
/* as my_disable_flush_pagecache_blocks is always 0, it is
strictly equivalent to FLUSH_KEEP */
FLUSH_FORCE_WRITE,
/*
As my_disable_flush_pagecache_blocks is always 0, the following option
is strictly equivalent to FLUSH_KEEP
*/
FLUSH_FORCE_WRITE
/**
@brief like FLUSH_KEEP but return immediately if file is already being
flushed (even partially) by another thread; only for page cache,

View File

@ -44,6 +44,8 @@ extern "C" {
#define MI_MAX_KEY MAX_INDEXES /* Max allowed keys */
#endif
#define MI_MAX_POSSIBLE_KEY_BUFF HA_MAX_POSSIBLE_KEY_BUFF
#define MI_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */
#define MI_NAME_IEXT ".MYI"
#define MI_NAME_DEXT ".MYD"

View File

@ -717,6 +717,16 @@ int mysql_tmpfile(const char *prefix);
*/
int thd_killed(const MYSQL_THD thd);
/**
Return the thread id of a user thread
@param thd user thread connection handle
@return thread id
*/
unsigned long thd_get_thread_id(const MYSQL_THD thd);
/**
Allocate memory in the connection's local memory pool

View File

@ -148,6 +148,37 @@ enum enum_server_command
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
#define CLIENT_REMEMBER_OPTIONS (1UL << 31)
/* Gather all possible capabilites (flags) supported by the server */
#define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD | \
CLIENT_FOUND_ROWS | \
CLIENT_LONG_FLAG | \
CLIENT_CONNECT_WITH_DB | \
CLIENT_NO_SCHEMA | \
CLIENT_COMPRESS | \
CLIENT_ODBC | \
CLIENT_LOCAL_FILES | \
CLIENT_IGNORE_SPACE | \
CLIENT_PROTOCOL_41 | \
CLIENT_INTERACTIVE | \
CLIENT_SSL | \
CLIENT_IGNORE_SIGPIPE | \
CLIENT_TRANSACTIONS | \
CLIENT_RESERVED | \
CLIENT_SECURE_CONNECTION | \
CLIENT_MULTI_STATEMENTS | \
CLIENT_MULTI_RESULTS | \
CLIENT_SSL_VERIFY_SERVER_CERT | \
CLIENT_REMEMBER_OPTIONS)
/*
Switch off the flags that are optional and depending on build flags
If any of the optional flags is supported by the build it will be switched
on before sending to the client during the connection handshake.
*/
#define CLIENT_BASIC_FLAGS (((CLIENT_ALL_FLAGS & ~CLIENT_SSL) \
& ~CLIENT_COMPRESS) \
& ~CLIENT_SSL_VERIFY_SERVER_CERT)
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
@ -217,12 +248,12 @@ typedef struct st_net {
functions and methods to maintain proper locking.
*/
unsigned char *query_cache_query;
unsigned int client_last_errno;
unsigned int last_errno;
unsigned char error;
my_bool unused2; /* Please remove with the next incompatible ABI change. */
my_bool return_errno;
/** Client library error message buffer. Actually belongs to struct MYSQL. */
char client_last_error[MYSQL_ERRMSG_SIZE];
char last_error[MYSQL_ERRMSG_SIZE];
/** Client library sqlstate buffer. Set along with the error message. */
char sqlstate[SQLSTATE_LENGTH+1];
void *extension;

View File

@ -106,9 +106,9 @@ typedef struct st_mysql_ftparser_param MYSQL_FTPARSER_PARAM;
typedef struct st_mysql_methods MYSQL_METHODS;
# 47 "mysql_time.h"
typedef struct st_mysql_time MYSQL_TIME;
# 384 "mysql_com.h"
# 383 "mysql_com.h"
typedef struct st_udf_args UDF_ARGS;
# 398 "mysql_com.h"
# 397 "mysql_com.h"
typedef struct st_udf_init UDF_INIT;
# 26 "my_alloc.h"
typedef struct st_used_mem USED_MEM;
@ -130,7 +130,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
unsigned int mbminlen;
unsigned int mbmaxlen;
};
# 370 "mysql_com.h"
# 369 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(double)))) rand_struct
{
unsigned long int seed1;
@ -542,11 +542,11 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
my_bool compress;
my_bool unused1;
unsigned char * query_cache_query;
unsigned int client_last_errno;
unsigned int last_errno;
unsigned char error;
my_bool unused2;
my_bool return_errno;
char client_last_error[512];
char last_error[512];
char sqlstate[(5 + 1)];
void * extension;
};
@ -558,7 +558,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
char const * * type_names;
unsigned int * type_lengths;
};
# 384 "mysql_com.h"
# 383 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_udf_args
{
unsigned int arg_count;
@ -570,7 +570,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
unsigned long int * attribute_lengths;
void * extension;
};
# 398 "mysql_com.h"
# 397 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_udf_init
{
my_bool maybe_null;
@ -587,7 +587,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
unsigned int left;
unsigned int size;
};
# 381 "mysql_com.h"
# 380 "mysql_com.h"
enum Item_result
{
STRING_RESULT = 0,
@ -596,7 +596,7 @@ enum Item_result
ROW_RESULT = 3,
DECIMAL_RESULT = 4,
};
# 322 "mysql_com.h"
# 321 "mysql_com.h"
enum enum_cursor_type
{
CURSOR_TYPE_NO_CURSOR = 0,
@ -604,7 +604,7 @@ enum enum_cursor_type
CURSOR_TYPE_FOR_UPDATE = 2,
CURSOR_TYPE_SCROLLABLE = 4,
};
# 235 "mysql_com.h"
# 234 "mysql_com.h"
enum enum_field_types
{
MYSQL_TYPE_DECIMAL = 0,
@ -651,7 +651,7 @@ enum enum_ftparser_mode
MYSQL_FTPARSER_WITH_STOPWORDS = 1,
MYSQL_FTPARSER_FULL_BOOLEAN_INFO = 2,
};
# 332 "mysql_com.h"
# 331 "mysql_com.h"
enum enum_mysql_set_option
{
MYSQL_OPTION_MULTI_STATEMENTS_ON = 0,
@ -730,7 +730,7 @@ enum enum_stmt_attr_type
STMT_ATTR_CURSOR_TYPE = 1,
STMT_ATTR_PREFETCH_ROWS = 2,
};
# 297 "mysql_com.h"
# 296 "mysql_com.h"
enum mysql_enum_shutdown_level
{
SHUTDOWN_DEFAULT = 0,
@ -790,13 +790,13 @@ enum mysql_status
MYSQL_STATUS_GET_RESULT = 1,
MYSQL_STATUS_USE_RESULT = 2,
};
# 439 "mysql_com.h"
# 441 "mysql_com.h"
extern my_bool check_scramble(char const * reply, char const * message, unsigned char const * hash_stage2);
# 432 "mysql_com.h"
# 434 "mysql_com.h"
extern my_bool check_scramble_323(char const *, char const * message, unsigned long int * salt);
# 35 "typelib.h"
extern TYPELIB * copy_typelib(MEM_ROOT * root, TYPELIB * from);
# 427 "mysql_com.h"
# 429 "mysql_com.h"
extern void create_random_string(char * to, unsigned int, struct rand_struct * rand_st);
# 32 "typelib.h"
extern int find_type(char * x, TYPELIB const * typelib, unsigned int);
@ -804,15 +804,15 @@ extern int find_type(char * x, TYPELIB const * typelib, unsigned int);
extern int find_type_or_exit(char const * x, TYPELIB * typelib, char const * option);
# 29 "typelib.h"
extern my_ulonglong find_typeset(char * x, TYPELIB * typelib, int * error_position);
# 441 "mysql_com.h"
# 443 "mysql_com.h"
extern void get_salt_from_password(unsigned char * res, char const * password);
# 434 "mysql_com.h"
# 436 "mysql_com.h"
extern void get_salt_from_password_323(unsigned long int * res, char const * password);
# 447 "mysql_com.h"
# 449 "mysql_com.h"
extern char * get_tty_password(char const * opt_message);
# 34 "typelib.h"
extern char const * get_type(TYPELIB * typelib, unsigned int);
# 429 "mysql_com.h"
# 431 "mysql_com.h"
extern void hash_password(unsigned long int * to, char const * password, unsigned int);
# 30 "my_list.h"
extern LIST * list_add(LIST * root, LIST * element);
@ -828,31 +828,31 @@ extern unsigned int list_length(LIST *);
extern LIST * list_reverse(LIST * root);
# 36 "my_list.h"
extern int list_walk(LIST *, list_walk_action, unsigned char * argument);
# 442 "mysql_com.h"
# 444 "mysql_com.h"
extern void make_password_from_salt(char * to, unsigned char const * hash_stage2);
# 435 "mysql_com.h"
extern void make_password_from_salt_323(char * to, unsigned long int const * salt);
# 437 "mysql_com.h"
extern void make_password_from_salt_323(char * to, unsigned long int const * salt);
# 439 "mysql_com.h"
extern void make_scrambled_password(char * to, char const * password);
# 430 "mysql_com.h"
# 432 "mysql_com.h"
extern void make_scrambled_password_323(char * to, char const * password);
# 33 "typelib.h"
extern void make_type(char * to, unsigned int, TYPELIB * typelib);
# 367 "mysql_com.h"
# 366 "mysql_com.h"
extern int my_connect(my_socket, struct sockaddr const * name, unsigned int, unsigned int);
# 344 "mysql_com.h"
# 343 "mysql_com.h"
extern my_bool my_net_init(NET * net, Vio * vio);
# 345 "mysql_com.h"
# 344 "mysql_com.h"
extern void my_net_local_init(NET * net);
# 355 "mysql_com.h"
# 354 "mysql_com.h"
extern unsigned long int my_net_read(NET * net);
# 350 "mysql_com.h"
# 349 "mysql_com.h"
extern my_bool my_net_write(NET * net, unsigned char const * packet, size_t);
# 426 "mysql_com.h"
# 428 "mysql_com.h"
extern double my_rnd(struct rand_struct *);
# 453 "mysql_com.h"
# 455 "mysql_com.h"
extern void my_thread_end(void);
# 452 "mysql_com.h"
# 454 "mysql_com.h"
extern my_bool my_thread_init(void);
# 560 "mysql.h"
extern void myodbc_remove_escape(MYSQL * mysql, char * name);
@ -890,7 +890,7 @@ extern void mysql_enable_rpl_parse(MYSQL * mysql);
extern my_bool mysql_eof(MYSQL_RES * res);
# 423 "mysql.h"
extern unsigned int mysql_errno(MYSQL * mysql);
# 448 "mysql_com.h"
# 450 "mysql_com.h"
extern char const * mysql_errno_to_sqlstate(unsigned int);
# 424 "mysql.h"
extern char const * mysql_error(MYSQL * mysql);
@ -1108,25 +1108,25 @@ extern char * mysql_unix_port;
extern MYSQL_RES * mysql_use_result(MYSQL * mysql);
# 426 "mysql.h"
extern unsigned int mysql_warning_count(MYSQL * mysql);
# 347 "mysql_com.h"
extern void net_clear(NET * net, my_bool);
# 346 "mysql_com.h"
extern void net_clear(NET * net, my_bool);
# 345 "mysql_com.h"
extern void net_end(NET * net);
# 349 "mysql_com.h"
extern my_bool net_flush(NET * net);
# 354 "mysql_com.h"
extern int net_real_write(NET * net, unsigned char const * packet, size_t);
# 348 "mysql_com.h"
extern my_bool net_flush(NET * net);
# 353 "mysql_com.h"
extern int net_real_write(NET * net, unsigned char const * packet, size_t);
# 347 "mysql_com.h"
extern my_bool net_realloc(NET * net, size_t);
# 351 "mysql_com.h"
# 350 "mysql_com.h"
extern my_bool net_write_command(NET * net, unsigned char, unsigned char const * header, size_t, unsigned char const * packet, size_t);
# 443 "mysql_com.h"
# 445 "mysql_com.h"
extern char * octet2hex(char * to, char const * str, unsigned int);
# 424 "mysql_com.h"
# 426 "mysql_com.h"
extern void randominit(struct rand_struct *, unsigned long int, unsigned long int);
# 438 "mysql_com.h"
# 440 "mysql_com.h"
extern void scramble(char * to, char const * message, char const * password);
# 431 "mysql_com.h"
# 433 "mysql_com.h"
extern void scramble_323(char * to, char const * message, char const * password);
# 37 "typelib.h"
extern TYPELIB sql_protocol_typelib;

View File

@ -15,6 +15,7 @@
extern const char *unknown_sqlstate;
extern const char *cant_connect_sqlstate;
extern const char *not_error_sqlstate;
#ifdef __cplusplus

View File

@ -98,7 +98,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c
../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c
../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c ../mysys/mf_qsort.c
../mysys/my_getsystime.c ${LIB_SOURCES})
../mysys/my_getsystime.c ../mysys/my_sync.c ${LIB_SOURCES})
# Need to set USE_TLS for building the DLL, since __declspec(thread)
# approach to thread local storage does not work properly in DLLs.

View File

@ -440,11 +440,11 @@ static void expand_error(MYSQL* mysql, int error)
char tmp[MYSQL_ERRMSG_SIZE];
char *p;
uint err_length;
strmake(tmp, mysql->net.client_last_error, MYSQL_ERRMSG_SIZE-1);
p = strmake(mysql->net.client_last_error, ER(error), MYSQL_ERRMSG_SIZE-1);
err_length= (uint) (p - mysql->net.client_last_error);
strmake(tmp, mysql->net.last_error, MYSQL_ERRMSG_SIZE-1);
p = strmake(mysql->net.last_error, ER(error), MYSQL_ERRMSG_SIZE-1);
err_length= (uint) (p - mysql->net.last_error);
strmake(p, tmp, MYSQL_ERRMSG_SIZE-1 - err_length);
mysql->net.client_last_errno = error;
mysql->net.last_errno = error;
}
/*
@ -870,10 +870,10 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
VOID(my_net_write(net,(const uchar*) "",0)); /* Server needs one packet */
net_flush(net);
strmov(net->sqlstate, unknown_sqlstate);
net->client_last_errno=
net->last_errno=
(*options->local_infile_error)(li_ptr,
net->client_last_error,
sizeof(net->client_last_error)-1);
net->last_error,
sizeof(net->last_error)-1);
goto err;
}
@ -900,10 +900,10 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
if (readcount < 0)
{
net->client_last_errno=
net->last_errno=
(*options->local_infile_error)(li_ptr,
net->client_last_error,
sizeof(net->client_last_error)-1);
net->last_error,
sizeof(net->last_error)-1);
goto err;
}
@ -1397,7 +1397,7 @@ const char *cli_read_statistics(MYSQL *mysql)
if (!mysql->net.read_pos[0])
{
set_mysql_error(mysql, CR_WRONG_HOST_INFO, unknown_sqlstate);
return mysql->net.client_last_error;
return mysql->net.last_error;
}
return (char*) mysql->net.read_pos;
}
@ -1408,7 +1408,7 @@ mysql_stat(MYSQL *mysql)
{
DBUG_ENTER("mysql_stat");
if (simple_command(mysql,COM_STATISTICS,0,0,0))
DBUG_RETURN(mysql->net.client_last_error);
DBUG_RETURN(mysql->net.last_error);
DBUG_RETURN((*mysql->methods->read_statistics)(mysql));
}
@ -1500,7 +1500,7 @@ my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql)
const char *STDCALL mysql_sqlstate(MYSQL *mysql)
{
return mysql->net.sqlstate;
return mysql ? mysql->net.sqlstate : cant_connect_sqlstate;
}
uint STDCALL mysql_warning_count(MYSQL *mysql)
@ -1773,7 +1773,7 @@ static my_bool my_realloc_str(NET *net, ulong length)
if (res)
{
strmov(net->sqlstate, unknown_sqlstate);
strmov(net->client_last_error, ER(net->client_last_errno));
strmov(net->last_error, ER(net->last_errno));
}
net->write_pos= net->buff+ buf_length;
}
@ -1825,14 +1825,14 @@ void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net)
{
DBUG_ENTER("set_stmt_errmsg");
DBUG_PRINT("enter", ("error: %d/%s '%s'",
net->client_last_errno,
net->last_errno,
net->sqlstate,
net->client_last_error));
net->last_error));
DBUG_ASSERT(stmt != 0);
stmt->last_errno= net->client_last_errno;
if (net->client_last_error && net->client_last_error[0])
strmov(stmt->last_error, net->client_last_error);
stmt->last_errno= net->last_errno;
if (net->last_error && net->last_error[0])
strmov(stmt->last_error, net->last_error);
strmov(stmt->sqlstate, net->sqlstate);
DBUG_VOID_RETURN;
@ -2467,7 +2467,7 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
int4store(buff+5, 1); /* iteration count */
res= test(cli_advanced_command(mysql, COM_STMT_EXECUTE, buff, sizeof(buff),
(uchar*) packet, length, 1, NULL) ||
(uchar*) packet, length, 1, stmt) ||
(*mysql->methods->read_query_result)(mysql));
stmt->affected_rows= mysql->affected_rows;
stmt->server_status= mysql->server_status;
@ -2683,7 +2683,7 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
int4store(buff + 4, stmt->prefetch_rows); /* number of rows to fetch */
if ((*mysql->methods->advanced_command)(mysql, COM_STMT_FETCH,
buff, sizeof(buff), (uchar*) 0, 0,
1, NULL))
1, stmt))
{
set_stmt_errmsg(stmt, net);
return 1;
@ -3350,7 +3350,7 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
*/
if ((*mysql->methods->advanced_command)(mysql, COM_STMT_SEND_LONG_DATA,
buff, sizeof(buff), (uchar*) data,
length, 1, NULL))
length, 1, stmt))
{
set_stmt_errmsg(stmt, &mysql->net);
DBUG_RETURN(1);
@ -4747,6 +4747,13 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
MYSQL_DATA *result= &stmt->result;
DBUG_ENTER("mysql_stmt_store_result");
if (!mysql)
{
/* mysql can be reset in mysql_close called from mysql_reconnect */
set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate, NULL);
DBUG_RETURN(1);
}
mysql= mysql->last_used_con;
if (!stmt->field_count)
@ -4772,7 +4779,7 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
int4store(buff, stmt->stmt_id);
int4store(buff + 4, (int)~0); /* number of rows to fetch */
if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff),
(uchar*) 0, 0, 1, NULL))
(uchar*) 0, 0, 1, stmt))
{
set_stmt_errmsg(stmt, net);
DBUG_RETURN(1);
@ -4959,7 +4966,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
uchar buff[MYSQL_STMT_HEADER]; /* packet header: 4 bytes for stmt id */
int4store(buff, stmt->stmt_id);
if ((*mysql->methods->advanced_command)(mysql, COM_STMT_RESET, buff,
sizeof(buff), 0, 0, 0, NULL))
sizeof(buff), 0, 0, 0, stmt))
{
set_stmt_errmsg(stmt, &mysql->net);
stmt->state= MYSQL_STMT_INIT_DONE;

View File

@ -160,7 +160,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
msg_len=strlen(msg_buf);
if (my_net_write(&con->net,(uchar*) msg_buf,msg_len) || net_flush(&con->net))
{
con->last_errno=con->net.client_last_errno;
con->last_errno=con->net.last_errno;
strmov(con->last_error,"Write error on socket");
goto err;
}

View File

@ -21,13 +21,14 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(libdir)
pkgplugindir = $(pkglibdir)/plugin
EXTRA_DIST = libmysqld.def CMakeLists.txt
DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
-DDATADIR="\"$(MYSQLDATAdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
-DLIBDIR="\"$(MYSQLLIBdir)\""
-DPLUGINDIR="\"$(pkgplugindir)\""
INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_builddir)/sql -I$(top_srcdir)/sql \
-I$(top_srcdir)/sql/examples \

View File

@ -23,6 +23,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
IF(WIN32)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(WIN32)
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
../../client/mysql.cc ../../client/readline.cc
../../client/sql_string.cc)

View File

@ -38,6 +38,8 @@ C_MODE_START
#include <sql_common.h>
#include "embedded_priv.h"
extern unsigned int mysql_server_last_errno;
extern char mysql_server_last_error[MYSQL_ERRMSG_SIZE];
static my_bool emb_read_query_result(MYSQL *mysql);
@ -61,8 +63,8 @@ void embedded_get_error(MYSQL *mysql, MYSQL_DATA *data)
{
NET *net= &mysql->net;
struct embedded_query_result *ei= data->embedded_info;
net->client_last_errno= ei->last_errno;
strmake(net->client_last_error, ei->info, sizeof(net->client_last_error)-1);
net->last_errno= ei->last_errno;
strmake(net->last_error, ei->info, sizeof(net->last_error)-1);
memcpy(net->sqlstate, ei->sqlstate, sizeof(net->sqlstate));
mysql->server_status= ei->server_status;
my_free(data, MYF(0));
@ -685,7 +687,7 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
err:
{
NET *net= &mysql->net;
strmake(net->client_last_error, thd->main_da.message(), sizeof(net->client_last_error)-1);
strmake(net->last_error, thd->main_da.message(), sizeof(net->last_error)-1);
memcpy(net->sqlstate,
mysql_errno_to_sqlstate(thd->main_da.sql_errno()),
sizeof(net->sqlstate)-1);
@ -1122,3 +1124,12 @@ bool Protocol::net_store_data(const uchar *from, size_t length)
return FALSE;
}
int vprint_msg_to_log(enum loglevel level __attribute__((unused)),
const char *format, va_list argsi)
{
vsnprintf(mysql_server_last_error, sizeof(mysql_server_last_error),
format, argsi);
mysql_server_last_errno= CR_UNKNOWN_ERROR;
return 0;
}

View File

@ -210,8 +210,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
error:
DBUG_PRINT("error",("message: %u (%s)",
mysql->net.client_last_errno,
mysql->net.client_last_error));
mysql->net.last_errno,
mysql->net.last_error));
{
/* Free alloced memory */
my_bool free_me=mysql->free_me;

View File

@ -108,6 +108,23 @@ drop table t1;
set global binlog_cache_size=@bcs;
set session autocommit = @ac;
#
# Bug#33798: prepared statements improperly handle large unsigned ints
#
--disable_warnings
drop table if exists t1;
--enable_warnings
reset master;
create table t1 (a bigint unsigned, b bigint(20) unsigned);
prepare stmt from "insert into t1 values (?,?)";
set @a= 9999999999999999;
set @b= 14632475938453979136;
execute stmt using @a, @b;
deallocate prepare stmt;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
--echo End of 5.0 tests
# Test of a too big SET INSERT_ID: see if the truncated value goes

View File

@ -151,7 +151,6 @@ CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
INSERT DELAYED INTO t1 VALUES(1);
DROP TABLE t1;
# End of 4.1 tests
#
#Bug#19717: DELETE Query Error on BLACKHOLE when using WHERE on column with UNIQUE INDEX
@ -168,7 +167,6 @@ ALTER TABLE t1 ADD PRIMARY KEY(a);
DELETE FROM t1 WHERE a=10;
DROP TABLE t1;
# End of 5.0 tests
# Test that a transaction which is rolled back does not go into binlog
# and that a transaction which is committed does
@ -193,4 +191,27 @@ show binlog events;
drop table if exists t1;
# End of 5.1 tests
#
# Bug#35178 INSERT_ID not written to binary log for inserts against BLACKHOLE backed tables
#
#
# the test checks that explicitly prescribed with set insert_id= value
# preceeds the following autoincrement insert in a blachhole
#
reset master;
create table t1 (a int auto_increment, primary key (a)) engine=blackhole;
# not insert_id prescribed insert binlogs with the default set insert_id 1
insert into t1 values (11), (NULL), (NULL), (NULL);
set insert_id= 3;
insert into t1 values (NULL), (33), (NULL);
set insert_id= 5;
insert into t1 values (55), (NULL);
source include/show_binlog_events2.inc;
# cleanup
drop table t1;
# End of tests

View File

@ -404,8 +404,10 @@ DROP TABLE t4;
SET collation_connection='cp932_japanese_ci';
-- source include/ctype_filesort.inc
-- source include/ctype_like_range_f1f2.inc
SET collation_connection='cp932_bin';
-- source include/ctype_filesort.inc
-- source include/ctype_like_range_f1f2.inc
#
# Bug#29333 myisam corruption with

View File

@ -7,7 +7,7 @@
-- source include/have_log_bin.inc
-- source include/have_innodb.inc
-- source include/have_debug.inc
--disable_warnings
drop table if exists t1, t2;

View File

@ -1,9 +1,6 @@
# Replication of character sets.
# This test will fail if the server/client does not support enough charsets.
# Requires statement logging
-- source include/have_binlog_format_mixed_or_statement.inc
source include/master-slave.inc;
--disable_warnings
set timestamp=1000000000;
@ -52,14 +49,10 @@ insert into t1 (b) values(@@character_set_client);
# collation_client does not exist
insert into t1 (b) values(@@character_set_connection);
insert into t1 (b) values(@@collation_connection);
--disable_query_log
select "--- --master--" as "";
--enable_query_log
--echo --- --master--
select * from t1 order by a;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
--echo --- --slave--
select * from mysqltest2.t1 order by a;
connection master;
@ -70,14 +63,10 @@ insert into t1 (b) values(LEAST("M
set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler"));
--disable_query_log
select "--- --master--" as "";
--enable_query_log
--echo --- --master--
select * from t1 order by a;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
--echo --- --slave--
select * from mysqltest2.t1 order by a;
# Presently charset info is not logged with LOAD DATA but it will
@ -96,20 +85,15 @@ connection master;
set @a= _cp850 'Müller' collate cp850_general_ci;
truncate table t1;
insert into t1 (b) values(collation(@a));
--disable_query_log
select "--- --master--" as "";
--enable_query_log
--echo --- --master--
select * from t1 order by a;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
--echo --- --slave--
select * from mysqltest2.t1 order by a;
connection master;
drop database mysqltest2;
drop database mysqltest3;
source include/show_binlog_events.inc;
sync_slave_with_master;
# Check that we can change global.collation_server (since 5.0.3)
@ -153,10 +137,6 @@ sync_slave_with_master;
select hex(c1), hex(c2) from t1;
connection master;
# Let's have a look at generated SETs.
flush logs;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
drop table t1;
sync_slave_with_master;

View File

@ -403,45 +403,38 @@ sync_slave_with_master;
# added columns do not have default values#
# Expect: Proper error message #
###########################################
# Commented out due to Bug #23907 Extra Slave Col is not
# erroring on extra col with no default values.
# Bug#22234, Bug#23907 Extra Slave Col is not
# erroring on extra col with no default values.
########################################################
#--echo *** Create t9 on slave ***
#STOP SLAVE;
#RESET SLAVE;
#eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
# d TIMESTAMP,
# e INT DEFAULT '1')ENGINE=$engine_type;
STOP SLAVE;
RESET SLAVE;
eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
d TIMESTAMP,
e INT NOT NULL) ENGINE=$engine_type;
#--echo *** Create t9 on Master ***
#connection master;
#eval CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
# ) ENGINE=$engine_type;
#RESET MASTER;
--echo *** Create t9 on Master ***
connection master;
eval CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE=$engine_type;
RESET MASTER;
#--echo *** Start Slave ***
#connection slave;
#START SLAVE;
--echo *** Start Slave ***
connection slave;
START SLAVE;
#--echo *** Master Data Insert ***
#connection master;
#set @b1 = 'b1b1b1b1';
#set @b1 = concat(@b1,@b1);
#INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo *** Master Data Insert ***
connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
#--echo *************************************************
#--echo ** Currently giving wrong error see bug#22234 ***
#--echo *************************************************
#sync_slave_with_master;
#connection slave;
#--echo *** Select from T9 ***
#--source include/wait_for_slave_sql_to_stop.inc
#--replace_result $MASTER_MYPORT MASTER_PORT
#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
#--query_vertical SHOW SLAVE STATUS
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
#START SLAVE;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
#--echo *** Drop t9 ***
#connection master;

View File

@ -39,13 +39,6 @@ sync_with_master;
select * from t1;
select * from t3;
# We want to be sure that LOAD DATA is in the slave's binlog.
# But we can't simply read this binlog, because as the slave has not been
# restarted for this test, the file_id is uncertain (would cause test
# failures). So instead, we test if the binlog looks long enough to
# contain LOAD DATA. Since 5.0.3 we assume that binlog of 1292 is ok.
# If LOAD DATA was not logged, the binlog would be shorter.
show master status;
connection master;

View File

@ -148,5 +148,5 @@ drop table t1;
# End of 4.1 tests
sync_with_master;
sync_slave_with_master;

View File

@ -50,17 +50,30 @@ insert into t1 values (1,2);
--echo
connection master;
# here is actually a bug, since there is no begin statement, the
# query is autocommitted, and end_pos shows end of the insert and not
# end of the commit
--echo # Now check that that is in the apply_status table is consistant
--echo # with what is in the binlog
--echo
--echo # since insert is done with transactional engine, expect a BEGIN
--echo # at <start_pos>
--echo
--replace_result $start_pos <start_pos>
--replace_column 5 #
--eval show binlog events from $start_pos limit 1
--echo
--echo # Now the insert, one step after
--echo
--replace_result $start_pos <start_pos>
--replace_column 2 # 5 #
--eval show binlog events from $start_pos limit 1,1
--echo
--echo # and the COMMIT should be at <end_pos>
--echo
--replace_result $start_pos <start_pos> $end_pos <end_pos>
--replace_column 2 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--eval show binlog events from $start_pos limit 1,1
--eval show binlog events from $start_pos limit 2,1
--echo

View File

@ -1,179 +0,0 @@
# Replication of character sets.
# This test will fail if the server/client does not support enough charsets.
--disable_warnings
set timestamp=1000000000;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
--enable_warnings
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
create database mysqltest3;
--disable_query_log
select "--- --master--" as "";
--enable_query_log
show create database mysqltest2;
show create database mysqltest3;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
show create database mysqltest2;
show create database mysqltest3;
connection master;
set @@collation_server=armscii8_bin;
drop database mysqltest3;
create database mysqltest3;
--disable_query_log
select "--- --master--" as "";
--enable_query_log
show create database mysqltest3;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
show create database mysqltest3;
connection master;
use mysqltest2;
--eval create table t1 (a int auto_increment primary key, b varchar(100))engine=$engine_type;
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
insert into t1 (b) values(@@character_set_server);
insert into t1 (b) values(@@collation_server);
# character_set_database and collation_database are not tested as they
# needn't be replicated (Bar said in Jan 2005).
insert into t1 (b) values(@@character_set_client);
# collation_client does not exist
insert into t1 (b) values(@@character_set_connection);
insert into t1 (b) values(@@collation_connection);
--disable_query_log
select "--- --master--" as "";
--enable_query_log
select * from t1 order by a;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
select * from mysqltest2.t1 order by a;
select "--- --muller--" as "";
connection master;
set character_set_client=latin1, collation_connection=latin1_german1_ci;
truncate table t1;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler"));
set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler"));
--disable_query_log
select "--- --master--" as "";
--enable_query_log
select * from t1 order by a;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
select * from mysqltest2.t1 order by a;
# Presently charset info is not logged with LOAD DATA but it will
# change in Jan 2005 when Dmitri pushes his new LOAD DATA,
# before 5.0.3 goes out. When done, LOAD DATA INFILE should be tested
# here.
# See if user var is prefixed with collation in binlog and replicated well.
# Note: replication of user variables is broken as far as derivation is
# concerned. That's because when we store a user variable in the binlog,
# we lose its derivation. So later on the slave, it's impossible to
# know if the collation was explicit or not, so we use DERIVATION_NONE,
# which provokes error messages (like 'Illegal mix of collation') when
# we replay the master's INSERT/etc statements.
select "--- --INSERT--" as "";
connection master;
set @a= _cp850 'Müller' collate cp850_general_ci;
truncate table t1;
insert into t1 (b) values(collation(@a));
--disable_query_log
select "--- --master--" as "";
--enable_query_log
select * from t1 order by a;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
select * from mysqltest2.t1 order by a;
connection master;
drop database mysqltest2;
drop database mysqltest3;
source include/show_binlog_events.inc;
sync_slave_with_master;
# Check that we can change global.collation_server (since 5.0.3)
select "--- --global--" as "";
set global character_set_server=latin2;
set global character_set_server=latin1; # back
connection master;
set global character_set_server=latin2;
set global character_set_server=latin1; # back
# Check that SET ONE_SHOT is really one shot
select "--- --oneshot--" as "";
set one_shot @@character_set_server=latin5;
set @@max_join_size=1000;
select @@character_set_server;
select @@character_set_server;
set @@character_set_server=latin5;
select @@character_set_server;
select @@character_set_server;
# ONE_SHOT on not charset/collation stuff is not allowed
-- error 1382
set one_shot max_join_size=10;
# Test of wrong character set numbers;
error 1115;
set character_set_client=9999999;
error 1273;
set collation_server=9999998;
# This one was contributed by Sergey Petrunia (BUG#3943)
select "--- --3943--" as "";
use test;
--eval CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=$engine_type;
SET CHARACTER_SET_CLIENT=koi8r,
CHARACTER_SET_CONNECTION=cp1251,
CHARACTER_SET_RESULTS=koi8r;
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
SET SQL_BIG_SELECTS=1;
select hex(c1), hex(c2) from t1;
sync_slave_with_master;
SET SQL_BIG_SELECTS=1;
select hex(c1), hex(c2) from t1;
connection master;
# Let's have a look at generated SETs.
--replace_result $MYSQLTEST_VARDIR MYSQL_TEST_DIR/var
#--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
drop table t1;
sync_slave_with_master;
#
# BUG#6676: Derivation of variables must be correct on slave
#
select "--- --6676--" as "";
connection master;
eval create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
) engine=$engine_type default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
sync_slave_with_master;

View File

@ -15,7 +15,6 @@ SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
connection master;
source include/show_binlog_events.inc;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
connection master;

Some files were not shown because too many files have changed in this diff Show More