#At file:///H:/bzr/mysql-6.0-wtf/ based on revid:vvaintroub@stripped
2694 Vladislav Vaintroub 2009-05-20 [merge]
merge
removed:
BUILD/compile-alpha-ccc
BUILD/compile-alpha-cxx
mysys/make-ccc
regex/make-ccc
storage/heap/make-ccc
storage/maria/ma_ft_eval.c
storage/maria/ma_ft_eval.h
storage/maria/ma_ft_stem.c
storage/maria/ma_ft_test1.c
storage/maria/ma_ft_test1.h
storage/myisam/ft_eval.c
storage/myisam/ft_eval.h
storage/myisam/ft_stem.c
storage/myisam/ft_test1.c
storage/myisam/ft_test1.h
storage/myisam/make-ccc
storage/myisammrg/make-ccc
strings/make-ccc
added:
include/mysql/service_my_snprintf.h
include/mysql/service_thd_alloc.h
include/mysql/services.h
include/service_versions.h
libservices/
libservices/CMakeLists.txt
libservices/Makefile.am
libservices/my_snprintf_service.c
libservices/thd_alloc_service.c
mysql-test/collections/mysql-6.0-maria.push
mysql-test/collections/mysql-6.0-rpl.push
mysql-test/collections/mysql-6.0-runtime.push
mysql-test/extra/rpl_tests/rpl_row_record_find.test
mysql-test/r/drop_debug.result
mysql-test/r/log_state_bug33693.result
mysql-test/suite/binlog/r/binlog_max_extension.result
mysql-test/suite/binlog/t/binlog_max_extension.test
mysql-test/suite/rpl/include/rpl_not_null.inc
mysql-test/suite/rpl/r/rpl_bug41902.result
mysql-test/suite/rpl/r/rpl_not_null_innodb.result
mysql-test/suite/rpl/r/rpl_not_null_myisam.result
mysql-test/suite/rpl/r/rpl_row_record_find_falcon.result
mysql-test/suite/rpl/r/rpl_row_record_find_innodb.result
mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result
mysql-test/suite/rpl/t/rpl_bug41902-slave.opt
mysql-test/suite/rpl/t/rpl_bug41902.test
mysql-test/suite/rpl/t/rpl_not_null_innodb.test
mysql-test/suite/rpl/t/rpl_not_null_myisam.test
mysql-test/suite/rpl/t/rpl_row_record_find_falcon.test
mysql-test/suite/rpl/t/rpl_row_record_find_innodb.test
mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test
mysql-test/t/drop_debug.test
mysql-test/t/log_state_bug33693-master.opt
mysql-test/t/log_state_bug33693.test
sql/sql_plugin_services.h
modified:
BUILD/Makefile.am
CMakeLists.txt
Makefile.am
README
client/mysql.cc
client/mysqlbinlog.cc
client/mysqltest.cc
client/sql_string.cc
configure.in
extra/my_print_defaults.c
include/Makefile.am
include/config-win.h
include/m_string.h
include/maria.h
include/my_bitmap.h
include/my_global.h
include/my_pthread.h
include/my_sys.h
include/myisam.h
include/mysql/plugin.h
include/mysql/plugin.h.pp
libmysqld/Makefile.am
mysql-test/include/mtr_check.sql
mysql-test/include/setup_fake_relay_log.inc
mysql-test/lib/My/File/Path.pm
mysql-test/lib/My/SafeProcess.pm
mysql-test/lib/My/SafeProcess/Base.pm
mysql-test/lib/mtr_cases.pm
mysql-test/lib/mtr_process.pl
mysql-test/lib/mtr_report.pm
mysql-test/lib/mtr_unique.pm
mysql-test/mysql-test-run.pl
mysql-test/r/init_file.result
mysql-test/r/log_state.result
mysql-test/r/lowercase_table2.result
mysql-test/r/mysqltest.result
mysql-test/r/parser.result
mysql-test/r/plugin.result
mysql-test/suite/backup/r/backup_logs.result
mysql-test/suite/backup/t/backup_logs.test
mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
mysql-test/suite/binlog/t/disabled.def
mysql-test/suite/funcs_1/datadict/is_routines.inc
mysql-test/suite/funcs_1/r/is_routines.result
mysql-test/suite/rpl/r/rpl_change_master.result
mysql-test/suite/rpl/t/disabled.def
mysql-test/suite/rpl/t/rpl_change_master.test
mysql-test/t/init_file.test
mysql-test/t/log_state.test
mysql-test/t/lowercase_table2.test
mysql-test/t/myisam-system.test
mysql-test/t/mysqlbinlog.test
mysql-test/t/mysqltest.test
mysql-test/t/parser.test
mysql-test/t/plugin.test
mysys/default.c
mysys/my_getopt.c
mysys/my_getsystime.c
mysys/my_pthread.c
mysys/typelib.c
mysys/waiting_threads.c
plugin/daemon_example/Makefile.am
scripts/mysqld_safe.sh
sql-common/client.c
sql-common/my_time.c
sql-common/pack.c
sql/CMakeLists.txt
sql/Makefile.am
sql/field.cc
sql/ha_partition.cc
sql/handler.h
sql/item.cc
sql/item.h
sql/item_cmpfunc.cc
sql/item_func.cc
sql/item_strfunc.cc
sql/item_sum.cc
sql/item_sum.h
sql/item_timefunc.cc
sql/log.cc
sql/log.h
sql/log_event.cc
sql/log_event.h
sql/log_event_old.cc
sql/mysql_priv.h
sql/mysqld.cc
sql/replication.h
sql/rpl_info.h
sql/rpl_record.cc
sql/rpl_record.h
sql/set_var.cc
sql/slave.cc
sql/sql_base.cc
sql/sql_bitmap.h
sql/sql_class.cc
sql/sql_class.h
sql/sql_connect.cc
sql/sql_db.cc
sql/sql_delete.cc
sql/sql_lex.cc
sql/sql_parse.cc
sql/sql_partition.cc
sql/sql_plugin.cc
sql/sql_plugin.h
sql/sql_prepare.cc
sql/sql_repl.cc
sql/sql_select.cc
sql/sql_show.cc
sql/sql_string.cc
sql/sql_table.cc
sql/sql_udf.h
sql/sql_update.cc
sql/sql_yacc.yy
sql/thr_malloc.cc
sql/time.cc
sql/transaction.cc
storage/archive/archive_performance.c
storage/archive/archive_test.c
storage/example/Makefile.am
storage/example/ha_example.cc
storage/falcon/ha_falcon.cpp
storage/maria/Makefile.am
storage/maria/ma_bitmap.c
storage/maria/ma_blockrec.c
storage/maria/ma_create.c
storage/maria/ma_key.c
storage/maria/ma_loghandler.c
storage/maria/ma_loghandler_lsn.h
storage/maria/ma_pagecache.c
storage/maria/ma_recovery.c
storage/maria/maria_backup_engine.cc
storage/maria/maria_def.h
storage/maria/maria_pack.c
storage/maria/trnman.h
storage/maria/unittest/lockman2-t.c
storage/maria/unittest/ma_control_file-t.c
storage/maria/unittest/trnman-t.c
storage/myisam/CMakeLists.txt*
storage/myisam/Makefile.am
storage/myisam/mi_create.c
storage/myisam/myisam_backup_engine.cc
storage/myisam/myisampack.c
storage/mysql_storage_engine.cmake
storage/ndb/src/ndbapi/NdbRecAttr.cpp
storage/ndb/test/run-test/setup.cpp
strings/ctype-ucs2.c
strings/decimal.c
strings/my_strtoll10.c
strings/my_vsnprintf.c
tests/mysql_client_test.c
=== modified file 'BUILD/Makefile.am'
--- a/BUILD/Makefile.am 2009-01-07 10:58:33 +0000
+++ b/BUILD/Makefile.am 2009-04-06 23:03:28 +0000
@@ -24,8 +24,6 @@ EXTRA_DIST = FINISH.sh \
check-cpu \
cleanup \
compile-alpha \
- compile-alpha-ccc \
- compile-alpha-cxx \
compile-alpha-debug \
compile-amd64-debug-max \
compile-amd64-debug-max-no-ndb \
=== removed file 'BUILD/compile-alpha-ccc'
--- a/BUILD/compile-alpha-ccc 2009-04-03 23:38:18 +0000
+++ b/BUILD/compile-alpha-ccc 1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-#! /bin/sh
-
-/bin/rm -f */.deps/*.P */*.o
-make -k maintainer-clean
-/bin/rm -f */.deps/*.P */*.o
-/bin/rm -f config.cache mysql-*.tar.gz
-
-path=`dirname $0`
-. "$path/autorun.sh"
-
-CC=ccc CFLAGS="-fast -O3 -fomit-frame-pointer" CXX=g++ CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mcpu=ev6 -Wa,-mev6" CXXLDFLAGS='/usr/lib/compaq/libots-2.2.7/libots.so /usr/lib/compaq/cpml-5.0.0/libcpml_ev6.a' ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-thread-safe-client
-make
-rm */.deps/*
-make
-if [ $? = 0 ]
-then
- rm */.deps/*
- bin/mysqladmin shutdown
- sur make install
- if [ $? = 0 ]
- then
- scripts/make_binary_distribution
- fi
-fi
-
-exit
-
-# This should give better performance by compiling many files at once, but
-# according to our benchmarks there isn't any real difference.
-
-pwd=`pwd`
-for i in */make-ccc
-do
- cd `dirname $i`
- make-ccc
- cd $pwd
-done
-cd sql
-rm mysqld .deps/*.P
-make mysqld
-cd $pwd
=== removed file 'BUILD/compile-alpha-cxx'
--- a/BUILD/compile-alpha-cxx 2007-01-28 20:09:54 +0000
+++ b/BUILD/compile-alpha-cxx 1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
-#! /bin/sh
-
-/bin/rm -f */.deps/*.P */*.o
-make -k maintainer-clean
-/bin/rm -f */.deps/*.P */*.o
-/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache mysql-*.tar.gz
-
-path=`dirname $0`
-. "$path/autorun.sh"
-
-CC=ccc CFLAGS="-fast" CXX=cxx CXXFLAGS="-fast -noexceptions -nortti" ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-non_shared --with-client-ldflags=-non_shared --without-extra-tools --disable-dependency-tracking
-
-make -j2
-find . -name ".deps" | xargs rm -r
-make
-if [ $? = 0 ]
-then
- find . -name ".deps" | xargs rm -r
- bin/mysqladmin shutdown
- sur make install
- if [ $? = 0 ]
- then
- scripts/make_binary_distribution
- fi
- make test
-fi
-
-exit
-
-# This should give better performance by compiling many files at once, but
-# according to our benchmarks there isn't any real difference.
-
-pwd=`pwd`
-for i in */make-ccc
-do
- cd `dirname $i`
- make-ccc
- cd $pwd
-done
-cd sql
-rm mysqld .deps/*.P
-make mysqld
-cd $pwd
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt 2009-04-15 23:38:47 +0000
+++ b/CMakeLists.txt 2009-05-04 20:51:05 +0000
@@ -318,6 +318,7 @@ ADD_SUBDIRECTORY(extra)
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(sql)
ADD_SUBDIRECTORY(libmysql)
+ADD_SUBDIRECTORY(libservices)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(unittest/mytap)
ADD_SUBDIRECTORY(unittest/examples)
=== modified file 'Makefile.am'
--- a/Makefile.am 2009-02-23 11:55:35 +0000
+++ b/Makefile.am 2009-05-07 14:10:24 +0000
@@ -28,7 +28,7 @@ EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@readline_topdir@ sql-common scripts \
- @pstack_dir@ \
+ @pstack_dir@ libservices \
@sql_union_dirs@ unittest storage plugin \
@sql_server@ @man_dirs@ tests \
netware @libmysqld_dirs@ \
@@ -37,7 +37,7 @@ SUBDIRS = . include @docs_dirs@ @zlib_d
DIST_SUBDIRS = . include Docs zlib \
cmd-line-utils sql-common scripts \
- pstack \
+ pstack libservices \
strings mysys dbug mysys/tests extra regex libmysql libmysql_r client unittest storage plugin \
vio sql man tests \
netware libmysqld \
=== modified file 'README'
--- a/README 2008-03-26 10:15:03 +0000
+++ b/README 2009-05-05 14:27:35 +0000
@@ -1,11 +1,19 @@
This is a release of MySQL, a dual-license SQL database server.
-MySQL is brought to you by the MySQL team at MySQL AB.
+MySQL is brought to you by the MySQL team at Sun Microsystems, Inc.
License information can be found in these files:
- For GPL (free) distributions, see the COPYING file and
the EXCEPTIONS-CLIENT file.
- For commercial distributions, see the LICENSE.mysql file.
+GPLv2 Disclaimer
+For the avoidance of doubt, except that if any license choice
+other than GPL or LGPL is available it will apply instead, Sun
+elects to use only the General Public License version 2 (GPLv2)
+at this time for any software where a choice of GPL license versions
+is made available with the language indicating that GPLv2 or any
+later version may be used, or where a choice of which version of
+the GPL is applied is otherwise unspecified.
For further information about MySQL or additional documentation, see:
- The latest information about MySQL: http://www.mysql.com
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc 2009-05-07 20:48:24 +0000
+++ b/client/mysql.cc 2009-05-14 17:35:06 +0000
@@ -55,7 +55,6 @@ static char *server_version= NULL;
#define MAX_SERVER_ARGS 64
void* sql_alloc(unsigned size); // Don't use mysqld alloc for these
-void sql_element_free(void *ptr);
#include "sql_string.h"
extern "C" {
@@ -4936,8 +4935,4 @@ void *sql_alloc(size_t Size)
return my_malloc(Size,MYF(MY_WME));
}
-void sql_element_free(void *ptr)
-{
- my_free(ptr,MYF(0));
-}
#endif /* EMBEDDED_LIBRARY */
=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc 2009-03-17 20:07:27 +0000
+++ b/client/mysqlbinlog.cc 2009-04-21 09:28:48 +0000
@@ -1302,7 +1302,6 @@ static int parse_args(int *argc, char***
int ho_error;
result_file = stdout;
- load_defaults("my",load_default_groups,argc,argv);
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (debug_info_flag)
@@ -1956,8 +1955,9 @@ int main(int argc, char** argv)
my_init_time(); // for time functions
+ load_defaults("my", load_default_groups, &argc, &argv);
+ defaults_argv= argv;
parse_args(&argc, (char***)&argv);
- defaults_argv=argv;
if (!argc)
{
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc 2009-05-07 20:48:24 +0000
+++ b/client/mysqltest.cc 2009-05-11 17:58:07 +0000
@@ -282,6 +282,7 @@ enum enum_commands {
Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER,
Q_RESULT_FORMAT_VERSION,
+ Q_MOVE_FILE,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
@@ -377,6 +378,7 @@ const char *command_names[]=
"send_shutdown",
"shutdown_server",
"result_format",
+ "move_file",
0
};
@@ -1792,7 +1794,7 @@ void check_result()
log_file.file_name(), reject_file, errno);
show_diff(NULL, result_file_name, reject_file);
- die(mess);
+ die("%s", mess);
break;
}
default: /* impossible */
@@ -2943,6 +2945,42 @@ void do_copy_file(struct st_command *com
/*
SYNOPSIS
+ do_move_file
+ command command handle
+
+ DESCRIPTION
+ move_file <from_file> <to_file>
+ Move <from_file> to <to_file>
+*/
+
+void do_move_file(struct st_command *command)
+{
+ int error;
+ static DYNAMIC_STRING ds_from_file;
+ static DYNAMIC_STRING ds_to_file;
+ const struct command_arg move_file_args[] = {
+ { "from_file", ARG_STRING, TRUE, &ds_from_file, "Filename to move from" },
+ { "to_file", ARG_STRING, TRUE, &ds_to_file, "Filename to move to" }
+ };
+ DBUG_ENTER("do_move_file");
+
+ check_command_args(command, command->first_argument,
+ move_file_args,
+ sizeof(move_file_args)/sizeof(struct command_arg),
+ ' ');
+
+ DBUG_PRINT("info", ("Move %s to %s", ds_from_file.str, ds_to_file.str));
+ error= (my_rename(ds_from_file.str, ds_to_file.str,
+ MYF(0)) != 0);
+ handle_command_error(command, error);
+ dynstr_free(&ds_from_file);
+ dynstr_free(&ds_to_file);
+ DBUG_VOID_RETURN;
+}
+
+
+/*
+ SYNOPSIS
do_chmod_file
command command handle
@@ -7723,6 +7761,7 @@ int main(int argc, char **argv)
case Q_CHANGE_USER: do_change_user(command); break;
case Q_CAT_FILE: do_cat_file(command); break;
case Q_COPY_FILE: do_copy_file(command); break;
+ case Q_MOVE_FILE: do_move_file(command); break;
case Q_CHMOD_FILE: do_chmod_file(command); break;
case Q_PERL: do_perl(command); break;
case Q_RESULT_FORMAT_VERSION: do_result_format_version(command); break;
=== modified file 'client/sql_string.cc'
--- a/client/sql_string.cc 2009-03-24 14:24:44 +0000
+++ b/client/sql_string.cc 2009-04-24 10:04:14 +0000
@@ -34,7 +34,6 @@
*/
extern void sql_alloc(size_t size);
-extern void sql_element_free(void *ptr);
#include "sql_string.h"
=== modified file 'configure.in'
--- a/configure.in 2009-05-07 20:48:24 +0000
+++ b/configure.in 2009-05-14 17:35:06 +0000
@@ -2981,7 +2981,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile
man/Makefile BUILD/Makefile vio/Makefile dnl
libmysql/Makefile libmysql_r/Makefile client/Makefile dnl
sql/Makefile sql/share/Makefile sql/backup/Makefile dnl
- sql/sql_builtin.cc sql-common/Makefile dnl
+ sql/sql_builtin.cc sql-common/Makefile libservices/Makefile dnl
dbug/Makefile scripts/Makefile include/Makefile dnl
tests/Makefile Docs/Makefile support-files/Makefile dnl
support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile dnl
=== modified file 'extra/my_print_defaults.c'
--- a/extra/my_print_defaults.c 2007-05-10 09:59:39 +0000
+++ b/extra/my_print_defaults.c 2009-04-21 09:27:46 +0000
@@ -192,7 +192,8 @@ int main(int argc, char **argv)
}
for (argument= arguments+1 ; *argument ; argument++)
- puts(*argument);
+ if (*argument != args_separator) /* skip arguments separator */
+ puts(*argument);
my_free((char*) load_default_groups,MYF(0));
free_defaults(arguments);
=== modified file 'include/Makefile.am'
--- a/include/Makefile.am 2009-03-20 15:58:14 +0000
+++ b/include/Makefile.am 2009-05-04 20:51:05 +0000
@@ -22,7 +22,8 @@ HEADERS_ABI = mysql.h mysql_com.h mysql
my_list.h my_alloc.h typelib.h mysql/plugin.h \
mysql/plugin_audit.h mysql/plugin_ftparser.h
pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
- my_xml.h mysql_embed.h \
+ my_xml.h mysql_embed.h mysql/services.h \
+ mysql/service_my_snprintf.h mysql/service_thd_alloc.h \
my_pthread.h my_no_pthread.h \
decimal.h errmsg.h my_global.h my_net.h \
my_getopt.h sslopt-longopts.h my_dir.h \
@@ -36,7 +37,7 @@ noinst_HEADERS = config-win.h config-net
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h sha2.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
- my_handler.h my_time.h \
+ my_handler.h my_time.h service_versions.h \
my_vle.h my_user.h my_atomic.h atomic/nolock.h \
atomic/rwlock.h atomic/x86-gcc.h atomic/generic-msvc.h \
atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h \
=== modified file 'include/config-win.h'
--- a/include/config-win.h 2009-05-07 20:48:24 +0000
+++ b/include/config-win.h 2009-05-14 21:49:53 +0000
@@ -132,17 +132,9 @@ typedef int mode_t;
#undef _REENTRANT /* Crashes something for win32 */
#undef SAFE_MUTEX /* Can't be used on windows */
-#if defined(_MSC_VER) && _MSC_VER >= 1310
-#define LL(A) A##ll
-#define ULL(A) A##ull
-#else
-#define LL(A) ((__int64) A)
-#define ULL(A) ((unsigned __int64) A)
-#endif
-
-#define LONGLONG_MIN LL(0x8000000000000000)
-#define LONGLONG_MAX LL(0x7FFFFFFFFFFFFFFF)
-#define ULONGLONG_MAX ULL(0xFFFFFFFFFFFFFFFF)
+#define LONGLONG_MIN 0x8000000000000000LL
+#define LONGLONG_MAX 0x7FFFFFFFFFFFFFFFLL
+#define ULONGLONG_MAX 0xFFFFFFFFFFFFFFFFULL
/* Type information */
@@ -285,7 +277,7 @@ inline ulonglong double2ulonglong(double
#define STACK_DIRECTION -1
/* Difference between GetSystemTimeAsFileTime() and now() */
-#define OFFSET_TO_EPOCH ULL(116444736000000000)
+#define OFFSET_TO_EPOCH 116444736000000000ULL
#define HAVE_PERROR
#define HAVE_VFPRINT
=== modified file 'include/m_string.h'
--- a/include/m_string.h 2009-01-29 21:17:59 +0000
+++ b/include/m_string.h 2009-05-04 17:14:38 +0000
@@ -290,16 +290,10 @@ extern size_t my_snprintf(char *to, size
/*
LEX_STRING -- a pair of a C-string and its length.
+ (it's part of the plugin API as a MYSQL_LEX_STRING)
*/
-#ifndef _my_plugin_h
-/* This definition must match the one given in mysql/plugin.h */
-struct st_mysql_lex_string
-{
- char *str;
- size_t length;
-};
-#endif
+#include <mysql/plugin.h>
typedef struct st_mysql_lex_string LEX_STRING;
#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
=== modified file 'include/maria.h'
--- a/include/maria.h 2009-04-23 21:17:43 +0000
+++ b/include/maria.h 2009-05-14 21:49:53 +0000
@@ -66,31 +66,31 @@ extern "C" {
sets all high keys.
*/
#define MARIA_KEYMAP_BITS (8 * SIZEOF_LONG_LONG)
-#define MARIA_KEYMAP_HIGH_MASK (ULL(1) << (MARIA_KEYMAP_BITS - 1))
+#define MARIA_KEYMAP_HIGH_MASK (1ULL << (MARIA_KEYMAP_BITS - 1))
#define maria_get_mask_all_keys_active(_keys_) \
(((_keys_) < MARIA_KEYMAP_BITS) ? \
- ((ULL(1) << (_keys_)) - ULL(1)) : \
- (~ ULL(0)))
+ ((1ULL << (_keys_)) - 1ULL) : \
+ (~ 0ULL))
#if MARIA_MAX_KEY > MARIA_KEYMAP_BITS
#define maria_is_key_active(_keymap_,_keyno_) \
(((_keyno_) < MARIA_KEYMAP_BITS) ? \
- test((_keymap_) & (ULL(1) << (_keyno_))) : \
+ test((_keymap_) & (1ULL << (_keyno_))) : \
test((_keymap_) & MARIA_KEYMAP_HIGH_MASK))
#define maria_set_key_active(_keymap_,_keyno_) \
(_keymap_)|= (((_keyno_) < MARIA_KEYMAP_BITS) ? \
- (ULL(1) << (_keyno_)) : \
+ (1ULL << (_keyno_)) : \
MARIA_KEYMAP_HIGH_MASK)
#define maria_clear_key_active(_keymap_,_keyno_) \
(_keymap_)&= (((_keyno_) < MARIA_KEYMAP_BITS) ? \
- (~ (ULL(1) << (_keyno_))) : \
- (~ (ULL(0))) /*ignore*/ )
+ (~ (1ULL << (_keyno_))) : \
+ (~ (0ULL)) /*ignore*/ )
#else
#define maria_is_key_active(_keymap_,_keyno_) \
- test((_keymap_) & (ULL(1) << (_keyno_)))
+ test((_keymap_) & (1ULL << (_keyno_)))
#define maria_set_key_active(_keymap_,_keyno_) \
- (_keymap_)|= (ULL(1) << (_keyno_))
+ (_keymap_)|= (1ULL << (_keyno_))
#define maria_clear_key_active(_keymap_,_keyno_) \
- (_keymap_)&= (~ (ULL(1) << (_keyno_)))
+ (_keymap_)&= (~ (1ULL << (_keyno_)))
#endif
#define maria_is_any_key_active(_keymap_) \
test((_keymap_))
=== modified file 'include/my_bitmap.h'
--- a/include/my_bitmap.h 2007-12-12 10:14:59 +0000
+++ b/include/my_bitmap.h 2009-05-14 21:49:53 +0000
@@ -169,11 +169,11 @@ static inline my_bool bitmap_cmp(const M
*/
#define bit_is_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
- (((I) & (ULL(1) << (B))) == 0 ? 0 : 1) : -1)
+ (((I) & (1ULL << (B))) == 0 ? 0 : 1) : -1)
#define bit_do_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
- ((I) |= (ULL(1) << (B)), 1) : -1)
+ ((I) |= (1ULL << (B)), 1) : -1)
#define bit_do_clear(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
- ((I) &= ~(ULL(1) << (B)), 0) : -1)
+ ((I) &= ~(1ULL << (B)), 0) : -1)
#ifdef __cplusplus
}
=== modified file 'include/my_global.h'
--- a/include/my_global.h 2009-05-07 20:48:24 +0000
+++ b/include/my_global.h 2009-05-14 21:49:53 +0000
@@ -1126,22 +1126,6 @@ typedef char bool; /* Ordinary boolean
#define INT32(v) (int32) (v)
#define MYF(v) STATIC_CAST(myf)(v)
-#ifndef LL
-#ifdef HAVE_LONG_LONG
-#define LL(A) A ## LL
-#else
-#define LL(A) A ## L
-#endif
-#endif
-
-#ifndef ULL
-#ifdef HAVE_LONG_LONG
-#define ULL(A) A ## ULL
-#else
-#define ULL(A) A ## UL
-#endif
-#endif
-
/*
Defines to make it possible to prioritize register assignments. No
longer that important with modern compilers.
=== modified file 'include/my_pthread.h'
--- a/include/my_pthread.h 2009-03-02 21:52:37 +0000
+++ b/include/my_pthread.h 2009-05-14 21:49:53 +0000
@@ -391,8 +391,8 @@ int my_pthread_mutex_trylock(pthread_mut
#define set_timespec_time_nsec(ABSTIME,TIME,NSEC) do { \
ulonglong nsec= (NSEC); \
ulonglong now= (TIME) + (nsec/100); \
- (ABSTIME).MY_tv_sec= (now / ULL(10000000)); \
- (ABSTIME).MY_tv_nsec= (now % ULL(10000000) * 100 + (nsec % 100)); \
+ (ABSTIME).MY_tv_sec= (now / 10000000ULL); \
+ (ABSTIME).MY_tv_nsec= (now % 10000000ULL * 100 + (nsec % 100)); \
} while(0)
#endif /* !set_timespec_time_nsec */
@@ -627,7 +627,6 @@ extern my_bool my_thread_init(void);
extern void my_thread_end(void);
extern const char *my_thread_name(void);
extern my_thread_id my_thread_dbug_id(void);
-extern int pthread_no_free(void *);
extern int pthread_dummy(int);
/* All thread specific variables are in the following struct */
=== modified file 'include/my_sys.h'
--- a/include/my_sys.h 2009-05-07 20:48:24 +0000
+++ b/include/my_sys.h 2009-05-12 08:58:44 +0000
@@ -917,6 +917,7 @@ extern void *memdup_root(MEM_ROOT *root,
extern int get_defaults_options(int argc, char **argv,
char **defaults, char **extra_defaults,
char **group_suffix);
+extern const char *args_separator;
extern int my_load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv, const char ***);
extern int load_defaults(const char *conf_file, const char **groups,
=== modified file 'include/myisam.h'
--- a/include/myisam.h 2009-02-13 16:30:54 +0000
+++ b/include/myisam.h 2009-05-14 21:49:53 +0000
@@ -76,35 +76,35 @@ extern "C" {
sets all high keys.
*/
#define MI_KEYMAP_BITS (8 * SIZEOF_LONG_LONG)
-#define MI_KEYMAP_HIGH_MASK (ULL(1) << (MI_KEYMAP_BITS - 1))
+#define MI_KEYMAP_HIGH_MASK (1ULL << (MI_KEYMAP_BITS - 1))
#define mi_get_mask_all_keys_active(_keys_) \
(((_keys_) < MI_KEYMAP_BITS) ? \
- ((ULL(1) << (_keys_)) - ULL(1)) : \
- (~ ULL(0)))
+ ((1ULL << (_keys_)) - 1ULL) : \
+ (~ 0ULL))
#if MI_MAX_KEY > MI_KEYMAP_BITS
#define mi_is_key_active(_keymap_,_keyno_) \
(((_keyno_) < MI_KEYMAP_BITS) ? \
- test((_keymap_) & (ULL(1) << (_keyno_))) : \
+ test((_keymap_) & (1ULL << (_keyno_))) : \
test((_keymap_) & MI_KEYMAP_HIGH_MASK))
#define mi_set_key_active(_keymap_,_keyno_) \
(_keymap_)|= (((_keyno_) < MI_KEYMAP_BITS) ? \
- (ULL(1) << (_keyno_)) : \
+ (1ULL << (_keyno_)) : \
MI_KEYMAP_HIGH_MASK)
#define mi_clear_key_active(_keymap_,_keyno_) \
(_keymap_)&= (((_keyno_) < MI_KEYMAP_BITS) ? \
- (~ (ULL(1) << (_keyno_))) : \
- (~ (ULL(0))) /*ignore*/ )
+ (~ (1ULL << (_keyno_))) : \
+ (~ (0ULL)) /*ignore*/ )
#else
#define mi_is_key_active(_keymap_,_keyno_) \
- test((_keymap_) & (ULL(1) << (_keyno_)))
+ test((_keymap_) & (1ULL << (_keyno_)))
#define mi_set_key_active(_keymap_,_keyno_) \
- (_keymap_)|= (ULL(1) << (_keyno_))
+ (_keymap_)|= (1ULL << (_keyno_))
#define mi_clear_key_active(_keymap_,_keyno_) \
- (_keymap_)&= (~ (ULL(1) << (_keyno_)))
+ (_keymap_)&= (~ (1ULL << (_keyno_)))
#endif
=== modified file 'include/mysql/plugin.h'
--- a/include/mysql/plugin.h 2009-04-15 08:35:38 +0000
+++ b/include/mysql/plugin.h 2009-05-14 08:56:34 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,12 +16,6 @@
#ifndef _my_plugin_h
#define _my_plugin_h
-/* size_t */
-#include <stdlib.h>
-
-typedef struct st_mysql MYSQL;
-
-
/*
On Windows, exports from DLL need to be declared
*/
@@ -39,15 +33,7 @@ class Item;
#define MYSQL_THD void*
#endif
-#ifndef _m_string_h
-/* This definition must match the one given in m_string.h */
-struct st_mysql_lex_string
-{
- char *str;
- unsigned int length;
-};
-#endif /* _m_string_h */
-typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+#include <mysql/services.h>
#define MYSQL_XIDDATASIZE 128
/**
@@ -127,7 +113,8 @@ enum enum_mysql_show_type
{
SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
- SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
+ SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE,
+ SHOW_always_last
};
struct st_mysql_show_var {
@@ -574,54 +561,6 @@ int thd_killed(const MYSQL_THD thd);
*/
unsigned long thd_get_thread_id(const MYSQL_THD thd);
-
-/**
- Allocate memory in the connection's local memory pool
-
- @details
- When properly used in place of @c my_malloc(), this can significantly
- improve concurrency. Don't use this or related functions to allocate
- large chunks of memory. Use for temporary storage only. The memory
- will be freed automatically at the end of the statement; no explicit
- code is required to prevent memory leaks.
-
- @see alloc_root()
-*/
-void *thd_alloc(MYSQL_THD thd, unsigned int size);
-/**
- @see thd_alloc()
-*/
-void *thd_calloc(MYSQL_THD thd, unsigned int size);
-/**
- @see thd_alloc()
-*/
-char *thd_strdup(MYSQL_THD thd, const char *str);
-/**
- @see thd_alloc()
-*/
-char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size);
-/**
- @see thd_alloc()
-*/
-void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size);
-
-/**
- Create a LEX_STRING in this connection's local memory pool
-
- @param thd user thread connection handle
- @param lex_str pointer to LEX_STRING object to be initialized
- @param str initializer to be copied into lex_str
- @param size length of str, in bytes
- @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object,
- instead of using lex_str value
- @return NULL on failure, or pointer to the LEX_STRING object
-
- @see thd_alloc()
-*/
-MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str,
- const char *str, unsigned int size,
- int allocate_lex_string);
-
/**
Get the XID for this connection's transaction
=== modified file 'include/mysql/plugin.h.pp'
--- a/include/mysql/plugin.h.pp 2009-04-14 12:42:21 +0000
+++ b/include/mysql/plugin.h.pp 2009-05-14 08:56:34 +0000
@@ -1,11 +1,38 @@
+#include <mysql/services.h>
+#include <mysql/service_my_snprintf.h>
+#include <stdarg.h>
+#include <stdlib.h>
+extern struct my_snprintf_service_st {
+ size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
+ size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
+} *my_snprintf_service;
+size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
+size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
+#include <mysql/service_thd_alloc.h>
#include <stdlib.h>
-typedef struct st_mysql MYSQL;
struct st_mysql_lex_string
{
char *str;
- unsigned int length;
+ size_t length;
};
typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+extern struct thd_alloc_service_st {
+ void *(*thd_alloc_func)(void*, unsigned int);
+ void *(*thd_calloc_func)(void*, unsigned int);
+ char *(*thd_strdup_func)(void*, const char *);
+ char *(*thd_strmake_func)(void*, const char *, unsigned int);
+ void *(*thd_memdup_func)(void*, const void*, unsigned int);
+ MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *,
+ const char *, unsigned int, int);
+} *thd_alloc_service;
+void *thd_alloc(void* thd, unsigned int size);
+void *thd_calloc(void* thd, unsigned int size);
+char *thd_strdup(void* thd, const char *str);
+char *thd_strmake(void* thd, const char *str, unsigned int size);
+void *thd_memdup(void* thd, const void* str, unsigned int size);
+MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
+ const char *str, unsigned int size,
+ int allocate_lex_string);
struct st_mysql_xid {
long formatID;
long gtrid_length;
@@ -17,7 +44,8 @@ enum enum_mysql_show_type
{
SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
- SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
+ SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE,
+ SHOW_always_last
};
struct st_mysql_show_var {
const char *name;
@@ -133,14 +161,6 @@ const char *set_thd_proc_info(void*, con
int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd);
unsigned long thd_get_thread_id(const void* thd);
-void *thd_alloc(void* thd, unsigned int size);
-void *thd_calloc(void* thd, unsigned int size);
-char *thd_strdup(void* thd, const char *str);
-char *thd_strmake(void* thd, const char *str, unsigned int size);
-void *thd_memdup(void* thd, const void* str, unsigned int size);
-MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
- const char *str, unsigned int size,
- int allocate_lex_string);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd,
const char *key, unsigned int key_length,
=== added file 'include/mysql/service_my_snprintf.h'
--- a/include/mysql/service_my_snprintf.h 1970-01-01 00:00:00 +0000
+++ b/include/mysql/service_my_snprintf.h 2009-05-04 17:14:38 +0000
@@ -0,0 +1,79 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/**
+ @file
+ my_snprintf service
+
+ Portable and limited vsnprintf() implementation.
+
+ This is a portable, limited vsnprintf() implementation, with some
+ extra features. "Portable" means that it'll produce identical result
+ on all platforms (for example, on Windows and Linux %e formats the
+ exponent differently, on different systems %p either prints leading
+ 0x or not, %s may accept null pointer or crash on it). "Limited"
+ means that it does not support all the C89 features. But it supports
+ few extensions, not in any standard.
+
+ my_vsnprintf(to, n, fmt, ap)
+
+ @param[out] to A buffer to store the result in
+ @param[in] n Store up to n-1 characters, followed by an end 0
+ @param[in] fmt printf-like format string
+ @param[in] ap Arguments
+
+ @return a number of bytes written to a buffer
+
+ @post
+ The syntax of a format string is generally the same:
+ % <flag> <width> <precision> <length modifier> <format>
+ where everithing but the format is optional.
+
+ The only possible <flag> is '0'. It has the standard zero-padding semantics.
+ Both <width> and <precision> can be specified as numbers or '*'.
+
+ <length modifier> can be 'l', 'll', or 'z'.
+
+ Supported formats are 's' (null pointer is accepted, printed as
+ "(null)"), 'b' (extension, see below), 'c', 'f', 'g', 'd', 'u', 'x',
+ 'X', 'p' (works as 0x%x).
+
+ Extensions:
+
+ Format 'b': binary buffer, prints exactly <precision> bytes from the
+ argument, without stopping at '\0'.
+
+ More to come (identifier quoting, escaping, see WL#751).
+*/
+
+#include <stdarg.h>
+#include <stdlib.h>
+extern struct my_snprintf_service_st {
+ size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
+ size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
+} *my_snprintf_service;
+
+#ifdef MYSQL_DYNAMIC_PLUGIN
+
+#define my_vsnprintf my_snprintf_service->my_vsnprintf_type
+#define my_snprintf my_snprintf_service->my_snprintf_type
+
+#else
+
+size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
+size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
+
+#endif
+
=== added file 'include/mysql/service_thd_alloc.h'
--- a/include/mysql/service_thd_alloc.h 1970-01-01 00:00:00 +0000
+++ b/include/mysql/service_thd_alloc.h 2009-05-04 17:14:38 +0000
@@ -0,0 +1,116 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/**
+ @file
+ This service provdes functions to allocate memory in a connection local
+ memory pool. The memory allocated there will be automatically freed at the
+ end of the statement, don't use it for allocations that should live longer
+ than that. For short living allocations this is more efficient than
+ using my_malloc and friends, and automatic "garbage collection" allows not
+ to think about memory leaks.
+
+ The pool is best for small to medium objects, don't use it for large
+ allocations - they are better served with my_malloc.
+*/
+
+#include <stdlib.h>
+
+struct st_mysql_lex_string
+{
+ char *str;
+ size_t length;
+};
+typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+
+extern struct thd_alloc_service_st {
+ void *(*thd_alloc_func)(MYSQL_THD, unsigned int);
+ void *(*thd_calloc_func)(MYSQL_THD, unsigned int);
+ char *(*thd_strdup_func)(MYSQL_THD, const char *);
+ char *(*thd_strmake_func)(MYSQL_THD, const char *, unsigned int);
+ void *(*thd_memdup_func)(MYSQL_THD, const void*, unsigned int);
+ MYSQL_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD, MYSQL_LEX_STRING *,
+ const char *, unsigned int, int);
+} *thd_alloc_service;
+
+#ifdef MYSQL_DYNAMIC_PLUGIN
+
+#define thd_alloc(thd,size) (thd_alloc_service->thd_alloc_func((thd), (size)))
+
+#define thd_calloc(thd,size) (thd_alloc_service->thd_calloc_func((thd), (size)))
+
+#define thd_strdup(thd,str) (thd_alloc_service->thd_strdup_func((thd), (str)))
+
+#define thd_strmake(thd,str,size) \
+ (thd_alloc_service->thd_strmake_func((thd), (str), (size)))
+
+#define thd_memdup(thd,str,size) \
+ (thd_alloc_service->thd_memdup_func((thd), (str), (size)))
+
+#define thd_make_lex_string(thd, lex_str, str, size, allocate_lex_string) \
+ (thd_alloc_service->thd_make_lex_string_func((thd), (lex_str), (str), \
+ (size), (allocate_lex_string)))
+
+#else
+
+/**
+ Allocate memory in the connection's local memory pool
+
+ @details
+ When properly used in place of @c my_malloc(), this can significantly
+ improve concurrency. Don't use this or related functions to allocate
+ large chunks of memory. Use for temporary storage only. The memory
+ will be freed automatically at the end of the statement; no explicit
+ code is required to prevent memory leaks.
+
+ @see alloc_root()
+*/
+void *thd_alloc(MYSQL_THD thd, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+void *thd_calloc(MYSQL_THD thd, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+char *thd_strdup(MYSQL_THD thd, const char *str);
+/**
+ @see thd_alloc()
+*/
+char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size);
+
+/**
+ Create a LEX_STRING in this connection's local memory pool
+
+ @param thd user thread connection handle
+ @param lex_str pointer to LEX_STRING object to be initialized
+ @param str initializer to be copied into lex_str
+ @param size length of str, in bytes
+ @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object,
+ instead of using lex_str value
+ @return NULL on failure, or pointer to the LEX_STRING object
+
+ @see thd_alloc()
+*/
+MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str,
+ const char *str, unsigned int size,
+ int allocate_lex_string);
+
+#endif
+
=== added file 'include/mysql/services.h'
--- a/include/mysql/services.h 1970-01-01 00:00:00 +0000
+++ b/include/mysql/services.h 2009-04-30 16:22:40 +0000
@@ -0,0 +1,31 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef MYSQL_SERVICES_INCLUDED
+#define MYSQL_SERVICES_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <mysql/service_my_snprintf.h>
+#include <mysql/service_thd_alloc.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
=== added file 'include/service_versions.h'
--- a/include/service_versions.h 1970-01-01 00:00:00 +0000
+++ b/include/service_versions.h 2009-05-06 18:17:49 +0000
@@ -0,0 +1,24 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifdef _WIN32
+#define SERVICE_VERSION __declspec(dllexport) void *
+#else
+#define SERVICE_VERSION void *
+#endif
+
+#define VERSION_my_snprintf 0x0100
+#define VERSION_thd_alloc 0x0100
+
=== modified file 'libmysqld/Makefile.am'
--- a/libmysqld/Makefile.am 2009-03-09 14:00:03 +0000
+++ b/libmysqld/Makefile.am 2009-05-04 15:51:55 +0000
@@ -1,242 +1,242 @@
-# Copyright (C) 2001-2006 MySQL AB
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-#
-# This file is public domain and comes with NO WARRANTY of any kind
-
-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)\"" \
- @DEFS@ \
- -DLIBDIR="\"$(MYSQLLIBdir)\"" \
- -DPLUGINDIR="\"$(pkgplugindir)\""
-AM_CPPFLAGS = -I$(top_srcdir)/include \
- -I$(top_builddir)/sql -I$(top_srcdir)/sql \
- -I$(top_srcdir)/sql/examples \
- -I$(top_srcdir)/regex \
- $(openssl_includes) @ZLIB_INCLUDES@ \
- @condition_dependent_plugin_includes@
-
-noinst_LIBRARIES = libmysqld_int.a
-pkglib_LIBRARIES = libmysqld.a
-SUBDIRS = . examples
-libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc
-libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
- my_time.c
-
-noinst_HEADERS = embedded_priv.h emb_qcache.h
-
-sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
- ha_ndbcluster.cc ha_ndbcluster_cond.cc \
- ha_ndbcluster_connection.cc \
- ha_ndbcluster_binlog.cc ha_partition.cc \
- handler.cc sql_handler.cc \
- hostname.cc init.cc password.c \
- item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
- item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
- item_geofunc.cc item_subselect.cc item_row.cc\
- item_xmlfunc.cc \
- sha2.cc des_key_file.cc \
- key.cc lock.cc log.cc sql_state.c \
- log_event.cc rpl_record.cc \
- log_event_old.cc rpl_record_old.cc \
- protocol.cc net_serv.cc opt_range.cc \
- opt_sum.cc procedure.cc records.cc sql_acl.cc \
- sql_load.cc discover.cc sql_locale.cc \
- sql_profile.cc \
- sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
- sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
- sql_join_cache.cc \
- sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc \
- scheduler.cc sql_connect.cc sql_parse.cc \
- sql_prepare.cc sql_derived.cc sql_rename.cc \
- sql_select.cc sql_do.cc sql_show.cc set_var.cc \
- sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
- sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
- unireg.cc uniques.cc sql_union.cc hash_filo.cc \
- spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
- sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
- parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
- rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
- debug_sync.cc sql_tablespace.cc transaction.cc \
- rpl_injector.cc my_user.c partition_info.cc \
- sql_servers.cc bml.cc si_objects.cc sql_audit.cc \
- event_parse_data.cc mdl.cc sql_signal.cc \
- rpl_handler.cc
-
-libmysqld_int_a_SOURCES= $(libmysqld_sources)
-nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
-libmysqld_a_SOURCES=
-
-sqlstoragesources = $(EXTRA_libmysqld_a_SOURCES)
-storagesources = @condition_dependent_plugin_modules@
-storageobjects = @condition_dependent_plugin_objects@
-storagesourceslinks = @condition_dependent_plugin_links@
-
-# automake misses these
-sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
-
-# The following libraries should be included in libmysqld.a
-INC_LIB= $(top_builddir)/regex/libregex.a \
- $(top_builddir)/mysys/.libs/libmysys.a \
- $(top_builddir)/strings/.libs/libmystrings.a \
- $(top_builddir)/dbug/.libs/libdbug.a \
- $(top_builddir)/vio/libvio.a \
- @NDB_SCI_LIBS@ \
- @mysql_plugin_libs@ \
- $(yassl_inc_libs)
-
-if HAVE_YASSL
-yassl_inc_libs= $(top_builddir)/extra/yassl/src/.libs/libyassl.a \
- $(top_builddir)/extra/yassl/taocrypt/src/.libs/libtaocrypt.a
-endif
-
-# Storage engine specific compilation options
-ha_ndbcluster.o:ha_ndbcluster.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_cond.o:ha_ndbcluster_cond.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_binlog.o: ha_ndbcluster_binlog.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_connection.o: ha_ndbcluster_connection.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-# Until we can remove dependency on ha_ndbcluster.h
-handler.o: handler.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-# We need rules to compile these as no good way
-# found to append fileslists that collected by configure
-# to the sources list
-
-ha_federated.o:ha_federated.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_heap.o:ha_heap.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_innodb.o:ha_innodb.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_myisam.o:ha_myisam.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_myisammrg.o:ha_myisammrg.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-#
-# To make it easy for the end user to use the embedded library we
-# generate a total libmysqld.a from all library files,
-
-# note - InnoDB libraries have circular dependencies, so in INC_LIB
-# few libraries are present two times. Metrowerks linker doesn't like
-# it at all. Traditional ar has no problems with it, but still there's no
-# need to add the same file twice to the library, so 'sort -u' save us
-# some time and spares unnecessary work.
-
-libmysqld.a: libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobjects)
-if DARWIN_MWCC
- mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects)
-else
- -rm -f libmysqld.a
- if test "$(host_os)" = "netware" ; \
- then \
- $(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \
- else \
- current_dir=`pwd`; \
- rm -rf tmp; mkdir tmp; \
- (for arc in $(INC_LIB) ./libmysqld_int.a; do \
- arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
- artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
- for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
- if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \
- mkdir $$artmp; cd $$artmp > /dev/null; \
- $(AR) x ../../$$arc; \
- cd $$current_dir > /dev/null; \
- ls $$artmp/* | grep -v SYMDEF; \
- continue 2; fi; done; \
- done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a ; \
- $(AR) r libmysqld.a $(storageobjects); \
- $(RANLIB) libmysqld.a ; \
- rm -rf tmp; \
- fi
-endif
-
-## XXX: any time the client interface changes, we'll need to bump
-## the version info for libmysqld; however, it's possible for the
-## libmysqld interface to change without affecting the standard
-## libmysqlclient interface. Should we make a separate version
-## string for the two?
-#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
-#CLEANFILES = $(libmysqld_la_LIBADD) libmysqld.la
-
-BUILT_SOURCES = link_sources
-
-CLEANFILES = $(BUILT_SOURCES)
-
-link_sources:
- for f in $(sqlsources); do \
- rm -f $$f; \
- if test -e $(top_srcdir)/sql/$$f ; \
- then \
- @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
- else \
- @LN_CP_F@ $(top_builddir)/sql/$$f $$f; \
- fi ; \
- done; \
- for f in $(libmysqlsources); do \
- rm -f $$f; \
- if test -e $(top_srcdir)/libmysql/$$f ; \
- then \
- @LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \
- else \
- @LN_CP_F@ $(top_builddir)/libmysql/$$f $$f; \
- fi ; \
- done; \
- if test -n "$(sqlstoragesources)" ; \
- then \
- for f in "$(sqlstoragesources)"; do \
- rm -f "$$f"; \
- @LN_CP_F@ `find $(srcdir)/../sql -name "$$f"` "$$f"; \
- done; \
- fi; \
- if test -n "$(storagesources)" ; \
- then \
- rm -f $(storagesources); \
- for f in $(storagesourceslinks); do \
- @LN_CP_F@ $(top_srcdir)/$$f . ; \
- done; \
- fi; \
- rm -f client_settings.h; \
- @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h \
- client_settings.h; \
- echo timestamp > link_sources
-
-
-clean-local:
- rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) $(storagesources) | sed "s;\.lo;.c;g"`; \
- rm -f client_settings.h
+# Copyright (C) 2001-2006 MySQL AB
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+#
+# This file is public domain and comes with NO WARRANTY of any kind
+
+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)\"" \
+ @DEFS@ \
+ -DLIBDIR="\"$(MYSQLLIBdir)\"" \
+ -DPLUGINDIR="\"$(pkgplugindir)\""
+AM_CPPFLAGS = -I$(top_srcdir)/include \
+ -I$(top_builddir)/sql -I$(top_srcdir)/sql \
+ -I$(top_srcdir)/sql/examples \
+ -I$(top_srcdir)/regex \
+ $(openssl_includes) @ZLIB_INCLUDES@ \
+ @condition_dependent_plugin_includes@
+
+noinst_LIBRARIES = libmysqld_int.a
+pkglib_LIBRARIES = libmysqld.a
+SUBDIRS = . examples
+libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc
+libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
+ my_time.c
+
+noinst_HEADERS = embedded_priv.h emb_qcache.h
+
+sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
+ ha_ndbcluster.cc ha_ndbcluster_cond.cc \
+ ha_ndbcluster_connection.cc \
+ ha_ndbcluster_binlog.cc ha_partition.cc \
+ handler.cc sql_handler.cc \
+ hostname.cc init.cc password.c \
+ item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
+ item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
+ item_geofunc.cc item_subselect.cc item_row.cc\
+ item_xmlfunc.cc \
+ sha2.cc des_key_file.cc \
+ key.cc lock.cc log.cc sql_state.c \
+ log_event.cc rpl_record.cc \
+ log_event_old.cc rpl_record_old.cc \
+ protocol.cc net_serv.cc opt_range.cc \
+ opt_sum.cc procedure.cc records.cc sql_acl.cc \
+ sql_load.cc discover.cc sql_locale.cc \
+ sql_profile.cc \
+ sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
+ sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
+ sql_join_cache.cc \
+ sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc \
+ scheduler.cc sql_connect.cc sql_parse.cc \
+ sql_prepare.cc sql_derived.cc sql_rename.cc \
+ sql_select.cc sql_do.cc sql_show.cc set_var.cc \
+ sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
+ sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
+ unireg.cc uniques.cc sql_union.cc hash_filo.cc \
+ spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
+ sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
+ parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
+ rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
+ debug_sync.cc sql_tablespace.cc transaction.cc \
+ rpl_injector.cc my_user.c partition_info.cc \
+ sql_servers.cc bml.cc si_objects.cc sql_audit.cc \
+ event_parse_data.cc mdl.cc sql_signal.cc \
+ rpl_handler.cc
+
+libmysqld_int_a_SOURCES= $(libmysqld_sources)
+nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
+libmysqld_a_SOURCES=
+
+sqlstoragesources = $(EXTRA_libmysqld_a_SOURCES)
+storagesources = @condition_dependent_plugin_modules@
+storageobjects = @condition_dependent_plugin_objects@
+storagesourceslinks = @condition_dependent_plugin_links@
+
+# automake misses these
+sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
+
+# The following libraries should be included in libmysqld.a
+INC_LIB= $(top_builddir)/regex/libregex.a \
+ $(top_builddir)/mysys/.libs/libmysys.a \
+ $(top_builddir)/strings/.libs/libmystrings.a \
+ $(top_builddir)/dbug/.libs/libdbug.a \
+ $(top_builddir)/vio/libvio.a \
+ @NDB_SCI_LIBS@ \
+ @mysql_plugin_libs@ \
+ $(yassl_inc_libs)
+
+if HAVE_YASSL
+yassl_inc_libs= $(top_builddir)/extra/yassl/src/.libs/libyassl.a \
+ $(top_builddir)/extra/yassl/taocrypt/src/.libs/libtaocrypt.a
+endif
+
+# Storage engine specific compilation options
+ha_ndbcluster.o:ha_ndbcluster.cc
+ $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
+
+ha_ndbcluster_cond.o:ha_ndbcluster_cond.cc
+ $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
+
+ha_ndbcluster_binlog.o: ha_ndbcluster_binlog.cc
+ $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
+
+ha_ndbcluster_connection.o: ha_ndbcluster_connection.cc
+ $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
+
+# Until we can remove dependency on ha_ndbcluster.h
+handler.o: handler.cc
+ $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
+
+# We need rules to compile these as no good way
+# found to append fileslists that collected by configure
+# to the sources list
+
+ha_federated.o:ha_federated.cc
+ $(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_heap.o:ha_heap.cc
+ $(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_innodb.o:ha_innodb.cc
+ $(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_myisam.o:ha_myisam.cc
+ $(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_myisammrg.o:ha_myisammrg.cc
+ $(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+#
+# To make it easy for the end user to use the embedded library we
+# generate a total libmysqld.a from all library files,
+
+# note - InnoDB libraries have circular dependencies, so in INC_LIB
+# few libraries are present two times. Metrowerks linker doesn't like
+# it at all. Traditional ar has no problems with it, but still there's no
+# need to add the same file twice to the library, so 'sort -u' save us
+# some time and spares unnecessary work.
+
+libmysqld.a: libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobjects)
+if DARWIN_MWCC
+ mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects)
+else
+ -rm -f libmysqld.a
+ if test "$(host_os)" = "netware" ; \
+ then \
+ $(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \
+ else \
+ current_dir=`pwd`; \
+ rm -rf tmp; mkdir tmp; \
+ (for arc in $(INC_LIB) ./libmysqld_int.a; do \
+ arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
+ artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
+ for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
+ if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \
+ mkdir $$artmp; cd $$artmp > /dev/null; \
+ $(AR) x ../../$$arc; \
+ cd $$current_dir > /dev/null; \
+ ls $$artmp/* | grep -v SYMDEF; \
+ continue 2; fi; done; \
+ done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a ; \
+ $(AR) r libmysqld.a $(storageobjects); \
+ $(RANLIB) libmysqld.a ; \
+ rm -rf tmp; \
+ fi
+endif
+
+## XXX: any time the client interface changes, we'll need to bump
+## the version info for libmysqld; however, it's possible for the
+## libmysqld interface to change without affecting the standard
+## libmysqlclient interface. Should we make a separate version
+## string for the two?
+#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
+#CLEANFILES = $(libmysqld_la_LIBADD) libmysqld.la
+
+BUILT_SOURCES = link_sources
+
+CLEANFILES = $(BUILT_SOURCES)
+
+link_sources:
+ for f in $(sqlsources); do \
+ rm -f $$f; \
+ if test -e $(top_srcdir)/sql/$$f ; \
+ then \
+ @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
+ else \
+ @LN_CP_F@ $(top_builddir)/sql/$$f $$f; \
+ fi ; \
+ done; \
+ for f in $(libmysqlsources); do \
+ rm -f $$f; \
+ if test -e $(top_srcdir)/libmysql/$$f ; \
+ then \
+ @LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \
+ else \
+ @LN_CP_F@ $(top_builddir)/libmysql/$$f $$f; \
+ fi ; \
+ done; \
+ if test -n "$(sqlstoragesources)" ; \
+ then \
+ for f in "$(sqlstoragesources)"; do \
+ rm -f "$$f"; \
+ @LN_CP_F@ `find $(srcdir)/../sql -name "$$f"` "$$f"; \
+ done; \
+ fi; \
+ if test -n "$(storagesources)" ; \
+ then \
+ rm -f $(storagesources); \
+ for f in $(storagesourceslinks); do \
+ @LN_CP_F@ $(top_srcdir)/$$f . ; \
+ done; \
+ fi; \
+ rm -f client_settings.h; \
+ @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h \
+ client_settings.h; \
+ echo timestamp > link_sources
+
+
+clean-local:
+ rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) $(storagesources) | sed "s;\.lo;.c;g"`; \
+ rm -f client_settings.h
=== added directory 'libservices'
=== added file 'libservices/CMakeLists.txt'
--- a/libservices/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ b/libservices/CMakeLists.txt 2009-05-05 18:58:20 +0000
@@ -0,0 +1,20 @@
+# Copyright (C) 2006 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+SET(LIBSERVICES_SOURCES my_snprintf_service.c thd_alloc_service.c)
+
+ADD_LIBRARY(libservices ${LIBSERVICES_SOURCES})
=== added file 'libservices/Makefile.am'
--- a/libservices/Makefile.am 1970-01-01 00:00:00 +0000
+++ b/libservices/Makefile.am 2009-05-06 10:55:56 +0000
@@ -0,0 +1,19 @@
+# Copyright 2009 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+AM_CPPFLAGS = -I$(top_srcdir)/include
+pkglib_LIBRARIES = libmysqlservices.a
+libmysqlservices_a_SOURCES = my_snprintf_service.c thd_alloc_service.c
+EXTRA_DIST = CMakeLists.txt
=== added file 'libservices/my_snprintf_service.c'
--- a/libservices/my_snprintf_service.c 1970-01-01 00:00:00 +0000
+++ b/libservices/my_snprintf_service.c 2009-05-06 18:17:49 +0000
@@ -0,0 +1,17 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION my_snprintf_service= (void*)VERSION_my_snprintf;
=== added file 'libservices/thd_alloc_service.c'
--- a/libservices/thd_alloc_service.c 1970-01-01 00:00:00 +0000
+++ b/libservices/thd_alloc_service.c 2009-05-06 18:17:49 +0000
@@ -0,0 +1,17 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION thd_alloc_servicee= (void*)VERSION_thd_alloc;
=== added file 'mysql-test/collections/mysql-6.0-maria.push'
--- a/mysql-test/collections/mysql-6.0-maria.push 1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/mysql-6.0-maria.push 2009-04-28 06:27:19 +0000
@@ -0,0 +1,7 @@
+perl mysql-test-run.pl --comment=n_mix --mysqld=--binlog-format=mixed --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=embedded --embedded --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=ps_stm_threadpool --ps-protocol --mysqld=--binlog-format=statement --mysqld=--thread-handling=pool-of-threads --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=falcon --suite=falcon --experimental=collections/default.experimental --timer --force
=== added file 'mysql-test/collections/mysql-6.0-rpl.push'
--- a/mysql-test/collections/mysql-6.0-rpl.push 1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/mysql-6.0-rpl.push 2009-04-28 06:31:48 +0000
@@ -0,0 +1,7 @@
+perl mysql-test-run.pl --comment=n_mix --mysqld=--binlog-format=mixed --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=embedded --embedded --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=ps_stm_threadpool --ps-protocol --mysqld=--binlog-format=statement --mysqld=--thread-handling=pool-of-threads --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=falcon --suite=falcon --experimental=collections/default.experimental --timer --force
=== added file 'mysql-test/collections/mysql-6.0-runtime.push'
--- a/mysql-test/collections/mysql-6.0-runtime.push 1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/mysql-6.0-runtime.push 2009-04-22 09:22:10 +0000
@@ -0,0 +1,8 @@
+perl mysql-test-run.pl --comment=n_mix --mysqld=--binlog-format=mixed --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=embedded --embedded --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=ps_stm_threadpool --ps-protocol --mysqld=--binlog-format=statement --mysqld=--thread-handling=pool-of-threads --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=falcon --suite=falcon --experimental=collections/default.experimental --timer --force
+
=== added file 'mysql-test/extra/rpl_tests/rpl_row_record_find.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_record_find.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_record_find.test 2009-04-29 16:48:59 +0000
@@ -0,0 +1,173 @@
+# USAGE:
+# Before including this file the following variables should be set:
+# * $master_engine
+# * slave_engine
+#
+# Example:
+#
+# let $master_engine= Falcon;
+# let $slave_engine= MyISAM;
+#
+# -- source extra/rpl_tests/rpl_row_record_find.test
+#
+
+
+connection master;
+
+--disable_warnings
+DROP TABLE IF EXISTS t;
+--enable_warnings
+
+sync_slave_with_master;
+connection master;
+
+let $i= 10;
+while($i)
+{
+ let $step= "";
+
+ connection master;
+ SET SQL_LOG_BIN=0;
+
+ if (`SELECT $i=1`) {
+ let $step= No keys ($master_engine -> $slave_engine);
+ --echo ******* TEST: $step
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $master_engine;
+ connection slave;
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $slave_engine;
+ }
+ if (`SELECT $i=2`)
+ {
+ let $step= One key ($master_engine -> $slave_engine);
+ --echo ******* TEST: $step
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $master_engine;
+ connection slave;
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $slave_engine;
+ }
+ if (`SELECT $i=3`)
+ {
+ let $step= One Composite key ($master_engine -> $slave_engine);
+ --echo ****** TEST: $step
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $master_engine;
+ connection slave;
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $slave_engine;
+ }
+ if (`SELECT $i=4`)
+ {
+ let $step= One Unique key ($master_engine -> $slave_engine);
+ --echo ****** TEST: $step
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $master_engine;
+ connection slave;
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $slave_engine;
+ }
+ if (`SELECT $i=5`)
+ {
+ let $step= One Composite Unique key ($master_engine -> $slave_engine);
+ --echo ****** TEST: $step
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $master_engine;
+ connection slave;
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $slave_engine;
+ }
+ if (`SELECT $i=6`)
+ {
+ let $step= One Primary key ($master_engine -> $slave_engine);
+ --echo ****** TEST: $step
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $master_engine;
+ connection slave;
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $slave_engine;
+ }
+ if (`SELECT $i=7`)
+ {
+ let $step= One Composite Primary Key ($master_engine -> $slave_engine);
+ --echo ****** TEST: $step
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $master_engine;
+ connection slave;
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $slave_engine;
+ }
+ if (`SELECT $i=8`)
+ {
+ let $step= One Composite key with holes ($master_engine -> $slave_engine);
+ --echo ****** TEST: $step
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $master_engine;
+ connection slave;
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $slave_engine;
+ }
+ if (`SELECT $i=9`)
+ {
+ let $step= One Composite Unique key with holes ($master_engine -> $slave_engine);
+ --echo ****** TEST: $step
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $master_engine;
+ connection slave;
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $slave_engine;
+ }
+ if (`SELECT $i=10`)
+ {
+ let $step= One Composite Primary Key with holes ($master_engine -> $slave_engine);
+ --echo ****** TEST: $step
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $master_engine;
+ connection slave;
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $slave_engine;
+ }
+ if (`SELECT $i=11`)
+ {
+ let $step= One key ($master_engine -> $slave_engine);
+ --echo ******* TEST: $step
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c4)) engine= $master_engine;
+ connection slave;
+ --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c4)) engine= $slave_engine;
+ }
+
+
+ connection master;
+ SET SQL_LOG_BIN=1;
+
+ connection master;
+ INSERT INTO t VALUES (1, '1', '1', '1' );
+ INSERT INTO t VALUES (4, '4', '4', '4' );
+ INSERT INTO t VALUES (7, '7', '7', '7' );
+
+ INSERT INTO t VALUES (9, '9', '9', NULL );
+
+ INSERT INTO t VALUES (2, '1', '2', '2' );
+ INSERT INTO t VALUES (3, '1', '3', '2' );
+
+ sync_slave_with_master;
+
+ connection master;
+ UPDATE t SET c4 = '7';
+
+ UPDATE t SET c4 = '5' WHERE c1 = 1;
+ UPDATE t SET c2 = '5' WHERE c1 = 1;
+ UPDATE t SET c1 = '5' WHERE c1 = 1;
+
+ UPDATE t SET c4 = '8' WHERE c2 = '4';
+ UPDATE t SET c1 = '8' WHERE c2 = '4';
+ UPDATE t SET c2 = '8' WHERE c2 = '4';
+
+ UPDATE t SET c3 = '0' WHERE c4 = NULL;
+ UPDATE t SET c2 = '0' WHERE c4 = '0';
+
+ UPDATE t SET c2 = '2' WHERE c4 = '2';
+
+ sync_slave_with_master;
+
+ let $diff_table_1=master:test.t;
+ let $diff_table_2=slave:test.t;
+ source include/diff_tables.inc;
+
+ connection master;
+ DELETE FROM t WHERE c1 = 7;
+ DELETE FROM t WHERE c1 = 8;
+ DELETE FROM t;
+
+ sync_slave_with_master;
+
+ let $diff_table_1=master:test.t;
+ let $diff_table_2=slave:test.t;
+ source include/diff_tables.inc;
+
+ DROP TABLE t;
+ sync_slave_with_master;
+
+ dec $i;
+}
=== modified file 'mysql-test/include/mtr_check.sql'
--- a/mysql-test/include/mtr_check.sql 2009-02-01 09:18:09 +0000
+++ b/mysql-test/include/mtr_check.sql 2009-03-31 13:39:40 +0000
@@ -57,3 +57,13 @@ BEGIN
mysql.user;
END||
+
+--
+-- Procedure used by test case used to force all
+-- servers to restart after testcase and thus skipping
+-- check test case after test
+--
+CREATE DEFINER=root@localhost PROCEDURE force_restart()
+BEGIN
+ SELECT 1 INTO OUTFILE 'force_restart';
+END||
=== modified file 'mysql-test/include/setup_fake_relay_log.inc'
--- a/mysql-test/include/setup_fake_relay_log.inc 2009-02-09 13:17:04 +0000
+++ b/mysql-test/include/setup_fake_relay_log.inc 2009-04-23 10:06:29 +0000
@@ -69,7 +69,21 @@ let $_fake_relay_log_purge= `SELECT @@gl
# Create relay log file.
copy_file $fake_relay_log $_fake_relay_log;
# Create relay log index.
---exec echo $_fake_filename-fake.000001 > $_fake_relay_index
+
+# After patch for BUG#12190, the filename used in CHANGE MASTER
+# RELAY_LOG_FILE will be automatically added the directory of the
+# relay log before comparison, thus we need to added the directory
+# part (./ on unix .\ on windows) when faking the relay-log-bin.index.
+
+if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`)
+{
+ eval select './$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index';
+}
+
+if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`)
+{
+ eval select '.\\\\$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index';
+}
# Setup replication from existing relay log.
eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4;
=== modified file 'mysql-test/lib/My/File/Path.pm'
--- a/mysql-test/lib/My/File/Path.pm 2009-01-24 14:07:57 +0000
+++ b/mysql-test/lib/My/File/Path.pm 2009-04-01 14:23:10 +0000
@@ -164,6 +164,9 @@ sub copytree {
copytree("$from_dir/$_", "$to_dir/$_");
next;
}
+
+ # Only copy plain files
+ next unless -f "$from_dir/$_";
copy("$from_dir/$_", "$to_dir/$_");
}
closedir(DIR);
=== modified file 'mysql-test/lib/My/SafeProcess.pm'
--- a/mysql-test/lib/My/SafeProcess.pm 2009-03-09 13:31:39 +0000
+++ b/mysql-test/lib/My/SafeProcess.pm 2009-04-29 14:13:38 +0000
@@ -536,7 +536,37 @@ sub wait_any {
return $proc;
}
+
+#
+# Wait for all processes to exit
+#
+sub wait_all {
+ while(keys %running)
+ {
+ wait_any();
+ }
+}
+
+
#
+# Check if any process has exited, but don't wait.
+#
+# Returns a reference to the SafeProcess that
+# exited or undefined
+#
+sub check_any {
+ for my $proc (values %running){
+ if ( $proc->is_child($$) ) {
+ if (not $proc->wait_one(0)) {
+ _verbose ("Found exited $proc");
+ return $proc;
+ }
+ }
+ }
+ return undef;
+}
+
+
# Overload string operator
# and fallback to default functions if no
# overloaded function is found
=== modified file 'mysql-test/lib/My/SafeProcess/Base.pm'
--- a/mysql-test/lib/My/SafeProcess/Base.pm 2008-10-08 20:06:10 +0000
+++ b/mysql-test/lib/My/SafeProcess/Base.pm 2009-04-23 11:35:02 +0000
@@ -83,6 +83,13 @@ sub exit_status {
};
}
+# threads.pm may not exist everywhere, so use only on Windows.
+
+use if $^O eq "MSWin32", "threads";
+use if $^O eq "MSWin32", "threads::shared";
+
+my $win32_spawn_lock :shared;
+
#
# Create a new process
@@ -104,6 +111,8 @@ sub create_process {
if ($^O eq "MSWin32"){
+ lock($win32_spawn_lock);
+
#printf STDERR "stdin %d, stdout %d, stderr %d\n",
# fileno STDIN, fileno STDOUT, fileno STDERR;
=== modified file 'mysql-test/lib/mtr_cases.pm'
--- a/mysql-test/lib/mtr_cases.pm 2009-02-16 21:18:45 +0000
+++ b/mysql-test/lib/mtr_cases.pm 2009-05-12 13:54:12 +0000
@@ -33,7 +33,7 @@ our $print_testcases;
our $skip_rpl;
our $do_test;
our $skip_test;
-our $opt_skip_combination;
+our $skip_combinations;
our $binlog_format;
our $enable_disabled;
our $default_storage_engine;
@@ -93,7 +93,6 @@ sub init_pattern {
sub collect_test_cases ($$) {
my $suites= shift; # Semicolon separated list of test suites
- my %found_suites;
my $opt_cases= shift;
my $cases= []; # Array of hash(one hash for each testcase)
@@ -103,7 +102,6 @@ sub collect_test_cases ($$) {
foreach my $suite (split(",", $suites))
{
push(@$cases, collect_one_suite($suite, $opt_cases));
- $found_suites{$suite}= 1;
}
if ( @$opt_cases )
@@ -115,23 +113,28 @@ sub collect_test_cases ($$) {
{
my $found= 0;
my ($sname, $tname, $extension)= split_testname($test_name_spec);
- if (defined($sname) && !defined($found_suites{$sname}))
- {
- $found_suites{$sname}= 1;
- push(@$cases, collect_one_suite($sname));
- }
-
foreach my $test ( @$cases )
{
# test->{name} is always in suite.name format
if ( $test->{name} =~ /.*\.$tname/ )
{
$found= 1;
+ last;
}
}
if ( not $found )
{
- mtr_error("Could not find '$tname' in '$suites' suite(s)");
+ mtr_error("Could not find '$tname' in '$suites' suite(s)") unless $sname;
+ # If suite was part of name, find it there
+ my ($this_case) = collect_one_suite($sname, [ $tname ]);
+ if ($this_case)
+ {
+ push (@$cases, $this_case);
+ }
+ else
+ {
+ mtr_error("Could not find '$tname' in '$sname' suite");
+ }
}
}
}
@@ -383,7 +386,7 @@ sub collect_one_suite($)
# Read combinations for this suite and build testcases x combinations
# if any combinations exists
# ----------------------------------------------------------------------
- if ( ! $opt_skip_combination )
+ if ( ! $skip_combinations )
{
my @combinations;
my $combination_file= "$suitedir/combinations";
=== modified file 'mysql-test/lib/mtr_process.pl'
--- a/mysql-test/lib/mtr_process.pl 2009-02-13 16:30:54 +0000
+++ b/mysql-test/lib/mtr_process.pl 2009-05-07 23:16:34 +0000
@@ -21,7 +21,25 @@
use strict;
use Socket;
use Errno;
+use My::Platform;
+use if IS_WINDOWS, "Net::Ping";
+# Ancient perl might not have port_number method for Net::Ping.
+# Check it and use fallback to connect() if it is not present.
+BEGIN
+{
+ my $use_netping= 0;
+ if (IS_WINDOWS)
+ {
+ my $ping = Net::Ping->new();
+ if ($ping->can("port_number"))
+ {
+ $use_netping= 1;
+ }
+ }
+ eval 'sub USE_NETPING { $use_netping }';
+}
+
sub sleep_until_file_created ($$$);
sub mtr_ping_port ($);
@@ -30,6 +48,24 @@ sub mtr_ping_port ($) {
mtr_verbose("mtr_ping_port: $port");
+ if (IS_WINDOWS && USE_NETPING)
+ {
+ # Under Windows, connect to a port that is not open is slow
+ # It takes ~1sec. Net::Ping with small timeout is much faster.
+ my $ping = Net::Ping->new();
+ $ping->port_number($port);
+ if ($ping->ping("localhost",0.1))
+ {
+ mtr_verbose("USED");
+ return 1;
+ }
+ else
+ {
+ mtr_verbose("FREE");
+ return 0;
+ }
+ }
+
my $remote= "localhost";
my $iaddr= inet_aton($remote);
if ( ! $iaddr )
=== modified file 'mysql-test/lib/mtr_report.pm'
--- a/mysql-test/lib/mtr_report.pm 2009-04-01 20:48:42 +0000
+++ b/mysql-test/lib/mtr_report.pm 2009-04-28 10:42:25 +0000
@@ -259,6 +259,17 @@ sub mtr_report_stats ($) {
$tot_restarts++;
}
+ # Add counts for repeated runs, if any.
+ # Note that the last run has already been counted above.
+ my $num_repeat = $tinfo->{'repeat'} - 1;
+ if ( $num_repeat > 0 )
+ {
+ $tot_tests += $num_repeat;
+ my $rep_failed = $tinfo->{'rep_failures'} || 0;
+ $tot_failed += $rep_failed;
+ $tot_passed += $num_repeat - $rep_failed;
+ }
+
# Look for warnings produced by mysqltest
my $base_file= mtr_match_extension($tinfo->{'result_file'},
"result"); # Trim extension
@@ -337,7 +348,7 @@ sub mtr_report_stats ($) {
foreach my $tinfo (@$tests)
{
my $tname= $tinfo->{'name'};
- if ( $tinfo->{failures} and ! $seen{$tname})
+ if ( ($tinfo->{failures} || $tinfo->{rep_failures}) and ! $seen{$tname})
{
print " $tname";
$seen{$tname}= 1;
=== modified file 'mysql-test/lib/mtr_unique.pm'
--- a/mysql-test/lib/mtr_unique.pm 2009-03-11 17:17:00 +0000
+++ b/mysql-test/lib/mtr_unique.pm 2009-04-28 10:42:25 +0000
@@ -28,32 +28,36 @@ sub msg {
# print "### unique($$) - ", join(" ", @_), "\n";
}
-my $file;
+my $dir;
if(!IS_WINDOWS)
{
- $file= "/tmp/mysql-test-ports";
+ $dir= "/tmp/mysql-unique-ids";
}
else
{
- $file= $ENV{'TEMP'}."/mysql-test-ports";
+ # Try to use machine-wide directory location for unique IDs,
+ # $ALLUSERSPROFILE . IF it is not available, fallback to $TEMP
+ # which is typically a per-user temporary directory
+ if (exists $ENV{'ALLUSERSPROFILE'} && -w $ENV{'ALLUSERSPROFILE'})
+ {
+ $dir= $ENV{'ALLUSERSPROFILE'}."/mysql-unique-ids";
+ }
+ else
+ {
+ $dir= $ENV{'TEMP'}."/mysql-unique-ids";
+ }
}
-
-my %mtr_unique_ids;
+my $mtr_unique_fh = undef;
-END {
- my $allocated_id= $mtr_unique_ids{$$};
- if (defined $allocated_id)
- {
- mtr_release_unique_id($allocated_id);
- }
- delete $mtr_unique_ids{$$};
+END
+{
+ mtr_release_unique_id();
}
#
-# Get a unique, numerical ID, given a file name (where all
-# requested IDs are stored), a minimum and a maximum value.
+# Get a unique, numerical ID in a specified range.
#
# If no unique ID within the specified parameters can be
# obtained, return undef.
@@ -61,135 +65,63 @@ END {
sub mtr_get_unique_id($$) {
my ($min, $max)= @_;;
- msg("get, '$file', $min-$max");
-
- die "Can only get one unique id per process!" if $mtr_unique_ids{$$};
+ msg("get $min-$max, $$");
- my $ret = undef;
- my $changed = 0;
-
- if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
- die 'lock file is a symbolic link';
- }
+ die "Can only get one unique id per process!" if defined $mtr_unique_fh;
- chmod 0777, "$file.sem";
- open SEM, ">", "$file.sem" or die "can't write to $file.sem";
- flock SEM, LOCK_EX or die "can't lock $file.sem";
- if(! -e $file) {
- open FILE, ">", $file or die "can't create $file";
- close FILE;
- }
- msg("HAVE THE LOCK");
+ # Make sure our ID directory exists
+ if (! -d $dir)
+ {
+ # If there is a file with the reserved
+ # directory name, just delete the file.
+ if (-e $dir)
+ {
+ unlink($dir);
+ }
- if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
- die 'lock file is a symbolic link';
- }
+ mkdir $dir;
+ chmod 0777, $dir;
- chmod 0777, $file;
- open FILE, "+<", $file or die "can't open $file";
- #select undef,undef,undef,0.2;
- seek FILE, 0, 0;
- my %taken = ();
- while(<FILE>) {
- chomp;
- my ($id, $pid) = split / /;
- $taken{$id} = $pid;
- msg("taken: $id, $pid");
- # Check if process with given pid is alive
- if(!process_alive($pid)) {
- print "Removing slot $id used by missing process $pid\n";
- msg("Removing slot $id used by missing process $pid");
- delete $taken{$id};
- $changed++;
+ if(! -d $dir)
+ {
+ die "can't make directory $dir";
}
}
- for(my $i=$min; $i<=$max; ++$i) {
- if(! exists $taken{$i}) {
- $ret = $i;
- $taken{$i} = $$;
- $changed++;
- # Remember the id this process got
- $mtr_unique_ids{$$}= $i;
- msg(" got $i");
- last;
+
+
+ my $fh;
+ for(my $id = $min; $id <= $max; $id++)
+ {
+ open( $fh, ">$dir/$id");
+ chmod 0666, "$dir/$id";
+ # Try to lock the file exclusively. If lock succeeds, we're done.
+ if (flock($fh, LOCK_EX|LOCK_NB))
+ {
+ # Store file handle - we would need it to release the ID (==unlock the file)
+ $mtr_unique_fh = $fh;
+ return $id;
}
- }
- if($changed) {
- seek FILE, 0, 0;
- truncate FILE, 0 or die "can't truncate $file";
- for my $k (keys %taken) {
- print FILE $k . ' ' . $taken{$k} . "\n";
+ else
+ {
+ close $fh;
}
}
- close FILE;
-
- msg("RELEASING THE LOCK");
- flock SEM, LOCK_UN or warn "can't unlock $file.sem";
- close SEM;
-
- return $ret;
+ return undef;
}
#
# Release a unique ID.
#
-sub mtr_release_unique_id($) {
- my ($myid)= @_;
-
- msg("release, $myid");
-
-
- if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
- die 'lock file is a symbolic link';
- }
-
- open SEM, ">", "$file.sem" or die "can't write to $file.sem";
- flock SEM, LOCK_EX or die "can't lock $file.sem";
-
- msg("HAVE THE LOCK");
-
- if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
- die 'lock file is a symbolic link';
- }
-
- if(! -e $file) {
- open FILE, ">", $file or die "can't create $file";
- close FILE;
- }
- open FILE, "+<", $file or die "can't open $file";
- #select undef,undef,undef,0.2;
- seek FILE, 0, 0;
- my %taken = ();
- while(<FILE>) {
- chomp;
- my ($id, $pid) = split / /;
- msg(" taken, $id $pid");
- $taken{$id} = $pid;
- }
-
- if ($taken{$myid} != $$)
+sub mtr_release_unique_id()
+{
+ msg("release $$");
+ if (defined $mtr_unique_fh)
{
- msg(" The unique id for this process does not match pid");
+ close $mtr_unique_fh;
+ $mtr_unique_fh = undef;
}
-
-
- msg(" removing $myid");
- delete $taken{$myid};
- seek FILE, 0, 0;
- truncate FILE, 0 or die "can't truncate $file";
- for my $k (keys %taken) {
- print FILE $k . ' ' . $taken{$k} . "\n";
- }
- close FILE;
-
- msg("RELEASE THE LOCK");
-
- flock SEM, LOCK_UN or warn "can't unlock $file.sem";
- close SEM;
-
- delete $mtr_unique_ids{$$};
}
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl 2009-05-07 20:48:24 +0000
+++ b/mysql-test/mysql-test-run.pl 2009-05-12 13:54:12 +0000
@@ -215,6 +215,7 @@ sub check_timeout { return $opt_testcase
my $opt_start;
my $opt_start_dirty;
+my $opt_wait_all;
my $opt_repeat= 1;
my $opt_retry= 3;
my $opt_retry_failure= 2;
@@ -528,6 +529,7 @@ sub run_test_server ($$$) {
}
}
$num_saved_datadir++;
+ $num_failed_test++ unless $result->{retries};
if ( !$opt_force ) {
# Test has failed, force is off
@@ -542,7 +544,6 @@ sub run_test_server ($$$) {
"Terminating...");
return undef;
}
- $num_failed_test++;
}
# Retry test run after test failure
@@ -567,9 +568,11 @@ sub run_test_server ($$$) {
# Repeat test $opt_repeat number of times
my $repeat= $result->{repeat} || 1;
- if ($repeat < $opt_repeat)
+ # Don't repeat if test was skipped
+ if ($repeat < $opt_repeat && $result->{'result'} ne 'MTR_RES_SKIPPED')
{
$result->{retries}= 0;
+ $result->{rep_failures}++ if $result->{failures};
$result->{failures}= 0;
delete($result->{result});
$result->{repeat}= $repeat+1;
@@ -893,6 +896,7 @@ sub command_line_setup {
'sleep=i' => \$opt_sleep,
'start-dirty' => \$opt_start_dirty,
'start' => \$opt_start,
+ 'wait-all' => \$opt_wait_all,
'print-testcases' => \&collect_option,
'repeat=i' => \$opt_repeat,
'retry=i' => \$opt_retry,
@@ -1255,6 +1259,15 @@ sub command_line_setup {
}
# --------------------------------------------------------------------------
+ # Check use of wait-all
+ # --------------------------------------------------------------------------
+
+ if ($opt_wait_all && ! ($opt_start_dirty || $opt_start))
+ {
+ mtr_error("--wait-all can only be used with --start or --start-dirty");
+ }
+
+ # --------------------------------------------------------------------------
# Check timeout arguments
# --------------------------------------------------------------------------
@@ -1344,29 +1357,31 @@ sub set_build_thread_ports($) {
if ( lc($opt_build_thread) eq 'auto' ) {
my $found_free = 0;
- $build_thread = 250; # Start attempts from here
+ $build_thread = 300; # Start attempts from here
while (! $found_free)
{
- $build_thread= mtr_get_unique_id($build_thread, 299);
+ $build_thread= mtr_get_unique_id($build_thread, 349);
if ( !defined $build_thread ) {
- mtr_error("Could not get a unique build thread id");
+ mtr_error("Could not get a unique build thread id");
}
$found_free= check_ports_free($build_thread);
# If not free, release and try from next number
- mtr_release_unique_id($build_thread++) unless $found_free;
+ if (! $found_free) {
+ mtr_release_unique_id();
+ $build_thread++;
+ }
}
}
else
{
$build_thread = $opt_build_thread + $thread - 1;
+ if (! check_ports_free($build_thread)) {
+ # Some port was not free(which one has already been printed)
+ mtr_error("Some port(s) was not free")
+ }
}
$ENV{MTR_BUILD_THREAD}= $build_thread;
- if (! check_ports_free($build_thread)) {
- # Some port was not free(which one has already been printed)
- mtr_error("Some port(s) was not free")
- }
-
# Calculate baseport
$baseport= $build_thread * 10 + 10000;
if ( $baseport < 5001 or $baseport + 9 >= 32767 )
@@ -1603,24 +1618,6 @@ sub client_debug_arg($$) {
}
-sub mysql_fix_arguments () {
-
- return "" if ( IS_WINDOWS );
-
- my $exe=
- mtr_script_exists("$basedir/scripts/mysql_fix_privilege_tables",
- "$path_client_bindir/mysql_fix_privilege_tables");
- my $args;
- mtr_init_args(\$args);
- mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
-
- mtr_add_arg($args, "--basedir=%s", $basedir);
- mtr_add_arg($args, "--bindir=%s", $path_client_bindir);
- mtr_add_arg($args, "--verbose");
- return mtr_args2str($exe, @$args);
-}
-
-
sub client_arguments ($;$) {
my $client_name= shift;
my $group_suffix= shift;
@@ -3201,6 +3198,26 @@ sub find_analyze_request
}
+# The test can leave a file in var/tmp/ to signal
+# that all servers should be restarted
+sub restart_forced_by_test
+{
+ my $restart = 0;
+ foreach my $mysqld ( mysqlds() )
+ {
+ my $datadir = $mysqld->value('datadir');
+ my $force_restart_file = "$datadir/mtr/force_restart";
+ if ( -f $force_restart_file )
+ {
+ mtr_verbose("Restart of servers forced by test");
+ $restart = 1;
+ last;
+ }
+ }
+ return $restart;
+}
+
+
# Return timezone value of tinfo or default value
sub timezone {
my ($tinfo)= @_;
@@ -3242,7 +3259,7 @@ sub run_testcase ($) {
{
# Remove old datadirs
- clean_datadir();
+ clean_datadir() unless $opt_start_dirty;
# Restore old ENV
while (my ($option, $value)= each( %old_env )) {
@@ -3309,19 +3326,29 @@ sub run_testcase ($) {
# --------------------------------------------------------------------
# If --start or --start-dirty given, stop here to let user manually
# run tests
+ # If --wait-all is also given, do the same, but don't die if one
+ # server exits
# ----------------------------------------------------------------------
+
if ( $opt_start or $opt_start_dirty )
{
mtr_print("\nStarted", started(all_servers()));
mtr_print("Waiting for server(s) to exit...");
- my $proc= My::SafeProcess->wait_any();
- if ( grep($proc eq $_, started(all_servers())) )
- {
- mtr_print("Server $proc died");
+ if ( $opt_wait_all ) {
+ My::SafeProcess->wait_all();
+ mtr_print( "All servers exited" );
+ exit(1);
+ }
+ else {
+ my $proc= My::SafeProcess->wait_any();
+ if ( grep($proc eq $_, started(all_servers())) )
+ {
+ mtr_print("Server $proc died");
+ exit(1);
+ }
+ mtr_print("Unknown process $proc died");
exit(1);
}
- mtr_print("Unknown process $proc died");
- exit(1);
}
my $test_timeout_proc= My::SafeProcess->timer(testcase_timeout());
@@ -3339,10 +3366,38 @@ sub run_testcase ($) {
}
my $test= start_mysqltest($tinfo);
+ # Set only when we have to keep waiting after expectedly died server
+ my $keep_waiting_proc = 0;
while (1)
{
- my $proc= My::SafeProcess->wait_any();
+ my $proc;
+ if ($keep_waiting_proc)
+ {
+ # Any other process exited?
+ $proc = My::SafeProcess->check_any();
+ if ($proc)
+ {
+ mtr_verbose ("Found exited process $proc");
+ # If that was the timeout, cancel waiting
+ if ( $proc eq $test_timeout_proc )
+ {
+ $keep_waiting_proc = 0;
+ }
+ }
+ else
+ {
+ $proc = $keep_waiting_proc;
+ }
+ }
+ else
+ {
+ $proc= My::SafeProcess->wait_any();
+ }
+
+ # Will be restored if we need to keep waiting
+ $keep_waiting_proc = 0;
+
unless ( defined $proc )
{
mtr_error("wait_any failed");
@@ -3369,7 +3424,11 @@ sub run_testcase ($) {
if ( $res == 0 )
{
my $check_res;
- if ( $opt_check_testcases and
+ if ( restart_forced_by_test() )
+ {
+ stop_all_servers();
+ }
+ elsif ( $opt_check_testcases and
$check_res= check_testcase($tinfo, "after"))
{
if ($check_res == 1) {
@@ -3434,8 +3493,12 @@ sub run_testcase ($) {
# ----------------------------------------------------
# Check if it was an expected crash
# ----------------------------------------------------
- if ( check_expected_crash_and_restart($proc) )
+ my $check_crash = check_expected_crash_and_restart($proc);
+ if ($check_crash)
{
+ # Keep waiting if it returned 2, if 1 don't wait or stop waiting.
+ $keep_waiting_proc = 0 if $check_crash == 1;
+ $keep_waiting_proc = $proc if $check_crash == 2;
next;
}
@@ -3777,16 +3840,16 @@ sub check_expected_crash_and_restart {
{
mtr_verbose("Crash was expected, file '$expect_file' exists");
- while (1){
-
+ for (my $waits = 0; $waits < 50; $waits++)
+ {
# If last line in expect file starts with "wait"
# sleep a little and try again, thus allowing the
# test script to control when the server should start
- # up again
+ # up again. Keep trying for up to 5s at a time.
my $last_line= mtr_lastlinesfromfile($expect_file, 1);
if ($last_line =~ /^wait/ )
{
- mtr_verbose("Test says wait before restart");
+ mtr_verbose("Test says wait before restart") if $waits == 0;
mtr_milli_sleep(100);
next;
}
@@ -3796,11 +3859,11 @@ sub check_expected_crash_and_restart {
# Start server with same settings as last time
mysqld_start($mysqld, $mysqld->{'started_opts'});
- last;
+ return 1;
}
+ # Loop ran through: we should keep waiting after a re-check
+ return 2;
}
-
- return 1;
}
# Not an expected crash
@@ -4518,14 +4581,17 @@ sub start_servers($) {
my $mysqld_basedir= $mysqld->value('basedir');
if ( $basedir eq $mysqld_basedir )
{
- # Copy datadir from installed system db
- for my $path ( "$opt_vardir", "$opt_vardir/..") {
- my $install_db= "$path/install.db";
- copytree($install_db, $datadir)
- if -d $install_db;
+ if (! $opt_start_dirty) # If dirty, keep possibly grown system db
+ {
+ # Copy datadir from installed system db
+ for my $path ( "$opt_vardir", "$opt_vardir/..") {
+ my $install_db= "$path/install.db";
+ copytree($install_db, $datadir)
+ if -d $install_db;
+ }
+ mtr_error("Failed to copy system db to '$datadir'")
+ unless -d $datadir;
}
- mtr_error("Failed to copy system db to '$datadir'")
- unless -d $datadir;
}
else
{
@@ -5066,10 +5132,13 @@ Options to control what engine/variation
vs-config Visual Studio configuration used to create executables
(default: MTR_VS_CONFIG environment variable)
- config|defaults-file=<config template> Use fixed config template for all
+ defaults-file=<config template> Use fixed config template for all
tests
defaults-extra-file=<config template> Extra config template to add to
all generated configs
+ combination=<opt> Use at least twice to run tests with specified
+ options to mysqld
+ skip-combinations Ignore combination file (or options)
Options to control directories to use
tmpdir=DIR The directory where temporary files are stored
@@ -5092,7 +5161,6 @@ Options to control what test suites or c
force Continue to run the suite after failure
with-ndbcluster-only Run only tests that include "ndb" in the filename
skip-ndb[cluster] Skip all tests that need cluster
- skip-ndb[cluster]-slave Skip all tests that need a slave cluster
do-test=PREFIX or REGEX
Run test cases which name are prefixed with PREFIX
or fulfills REGEX
@@ -5107,6 +5175,9 @@ Options to control what test suites or c
The default is: "$DEFAULT_SUITES"
skip-rpl Skip the replication test cases.
big-test Also run tests marked as "big"
+ enable-disabled Run also tests marked as disabled
+ print_testcases Don't run the tests but print details about all the
+ selected tests, in the order they would be run.
Options that specify ports
@@ -5176,7 +5247,7 @@ Options for valgrind
valgrind-options=ARGS Deprecated, use --valgrind-option
valgrind-option=ARGS Option to give valgrind, replaces default option(s),
can be specified more then once
- valgrind-path=[EXE] Path to the valgrind executable
+ valgrind-path=<EXE> Path to the valgrind executable
callgrind Instruct valgrind to use callgrind
Misc options
@@ -5184,14 +5255,18 @@ Misc options
comment=STR Write STR to the output
notimer Don't show test case execution time
verbose More verbose output(use multiple times for even more)
+ verbose-restart Write when and why servers are restarted
start Only initialize and start the servers, using the
startup settings for the first specified test case
Example:
$0 --start alias &
start-dirty Only start the servers (without initialization) for
the first specified test case
+ wait-all If --start or --start-dirty option is used, wait for all
+ servers to exit before finishing the process
fast Run as fast as possible, dont't wait for servers
to shutdown etc.
+ parallel=N Run tests in N parallel threads (default=1)
repeat=N Run each test N number of times
retry=N Retry tests that fail N times, limit number of failures
to $opt_retry_failure
@@ -5211,6 +5286,12 @@ Misc options
actions. Disable facility with NUM=0.
gcov Collect coverage information after the test.
The result is a gcov file per source and header file.
+ experimental=<file> Refer to list of tests considered experimental;
+ failures will be marked exp-fail instead of fail.
+ report-features First run a "test" that reports mysql features
+ timestamp Print timestamp before each test report line
+ timediff With --timestamp, also print time passed since
+ *previous* test started
HERE
exit(1);
=== added file 'mysql-test/r/drop_debug.result'
--- a/mysql-test/r/drop_debug.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/drop_debug.result 2009-05-07 11:15:54 +0000
@@ -0,0 +1,25 @@
+
+# --
+# -- Bug#43138: DROP DATABASE failure does not clean up message list.
+# --
+
+DROP DATABASE IF EXISTS mysql_test;
+
+CREATE DATABASE mysql_test;
+CREATE TABLE mysql_test.t1(a INT);
+CREATE TABLE mysql_test.t2(b INT);
+CREATE TABLE mysql_test.t3(c INT);
+
+SET SESSION DEBUG = "+d,bug43138";
+
+DROP DATABASE mysql_test;
+Warnings:
+Error 1051 Unknown table 't1'
+Error 1051 Unknown table 't2'
+Error 1051 Unknown table 't3'
+
+SET SESSION DEBUG = "-d,bug43138";
+
+# --
+# -- End of Bug#43138.
+# --
=== modified file 'mysql-test/r/init_file.result'
--- a/mysql-test/r/init_file.result 2009-02-01 09:18:09 +0000
+++ b/mysql-test/r/init_file.result 2009-04-02 11:00:44 +0000
@@ -4,6 +4,7 @@ SELECT * INTO @Y FROM init_file.startup
SELECT YEAR(@X)-YEAR(@Y);
YEAR(@X)-YEAR(@Y)
0
+DROP DATABASE init_file;
ok
end of 4.1 tests
select * from t1;
@@ -19,3 +20,5 @@ y
3
11
13
+drop table t1, t2;
+call mtr.force_restart();
=== modified file 'mysql-test/r/log_state.result'
--- a/mysql-test/r/log_state.result 2009-01-26 16:32:29 +0000
+++ b/mysql-test/r/log_state.result 2009-03-31 16:47:35 +0000
@@ -311,6 +311,30 @@ SET @@global.general_log_file = @old_gen
SET @@global.slow_query_log = @old_slow_query_log;
SET @@global.slow_query_log_file = @old_slow_query_log_file;
End of 5.1 tests
+
+# --
+# -- Bug#38124: "general_log_file" variable silently unset when
+# -- using expression
+# --
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file INTO @my_glf;
+SET GLOBAL general_log_file = 'BUG38124.LOG';
+SELECT @@general_log_file;
+@@general_log_file
+BUG38124.LOG
+SET GLOBAL general_log_file = concat('BUG38124-2.LOG');
+SELECT @@general_log_file;
+@@general_log_file
+BUG38124-2.LOG
+SET GLOBAL general_log_file = substr('BUG38124-2.LOG',3,6);
+SELECT @@general_log_file;
+@@general_log_file
+G38124
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file = @my_glf;
+@@general_log_file = @my_glf
+1
+SET GLOBAL general_log_file = @old_general_log_file;
# Close connection con1
SET global general_log = @old_general_log;
SET global general_log_file = @old_general_log_file;
=== added file 'mysql-test/r/log_state_bug33693.result'
--- a/mysql-test/r/log_state_bug33693.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/log_state_bug33693.result 2009-04-01 18:00:07 +0000
@@ -0,0 +1,3 @@
+SELECT INSTR(@@general_log_file, 'MYSQLTEST_VARDIR/run');;
+INSTR(@@general_log_file, 'MYSQLTEST_VARDIR/run')
+0
=== modified file 'mysql-test/r/lowercase_table2.result'
--- a/mysql-test/r/lowercase_table2.result 2006-06-14 05:54:56 +0000
+++ b/mysql-test/r/lowercase_table2.result 2009-05-15 08:00:35 +0000
@@ -174,3 +174,79 @@ TABLE_SCHEMA TABLE_NAME
mysqltest_LC2 myUC
use test;
drop database mysqltest_LC2;
+# End of 5.1 tests
+#
+# Test for bug #44738 "fill_schema_table_from_frm() opens tables without
+# lowercasing table name". Due to not properly normalizing table names
+# in lower_case_table_names modes in this function queries to I_S which
+# were executed through it left entries with incorrect key in table
+# definition cache. This issue combined with a similar problem in
+# CREATE TABLE (it also has peeked into table definition cache using
+# non-normalized key) led to spurious ER_TABLE_EXISTS_ERROR errors
+# when one tried to create table with the same name as a previously
+# existing but dropped table.
+#
+drop database if exists mysqltest_UPPERCASE;
+drop table if exists t_bug44738_UPPERCASE;
+create database mysqltest_UPPERCASE;
+use mysqltest_UPPERCASE;
+create table t_bug44738_UPPERCASE (i int);
+# Ensure that we don't have any leftovers in table definition
+# cache from previous tests.
+flush tables;
+# There should be no entries for our table in table definition cache
+show open tables like 't_bug44738_%';
+Database Table In_use Name_locked
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%';
+table_schema table_name table_comment
+mysqltest_UPPERCASE t_bug44738_UPPERCASE
+# Due to --lower-case-table-names > 0 mode database and table name for
+# TDC entry for our table should be 'normalized' (i.e. lowercased).
+show open tables like 't_bug44738_%';
+Database Table In_use Name_locked
+mysqltest_uppercase t_bug44738_uppercase 0 0
+drop table t_bug44738_UPPERCASE;
+# After DROP TABLE this entry should be removed.
+show open tables like 't_bug44738_%';
+Database Table In_use Name_locked
+drop database mysqltest_UPPERCASE;
+use test;
+# Let us check that the original test case which led to discovery
+# of this problem also works.
+create table t_bug44738_UPPERCASE (i int);
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema = 'test' and table_name like 't_bug44738_%';
+table_schema table_name table_comment
+test t_bug44738_UPPERCASE
+drop table t_bug44738_UPPERCASE;
+# Check that after the above DROP TABLE there are no entries in TDC
+# which correspond to our table.
+show open tables like 't_bug44738_%';
+Database Table In_use Name_locked
+# Therefore the below statement should succeed.
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;
+# Finally, let us check that another issue which was exposed by
+# the original test case is solved. I.e. that fuse in CREATE TABLE
+# which ensures that table is not created if there is an entry for
+# it in TDC even though it was removed from disk uses normalized
+# version of the table name.
+create table t_bug44738_UPPERCASE (i int) engine = myisam;
+# Load table definition in TDC.
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema = 'test' and table_name like 't_bug44738_%';
+table_schema table_name table_comment
+test t_bug44738_UPPERCASE
+# Simulate manual removal of the table.
+# Check that still there is an entry for table in TDC.
+show open tables like 't_bug44738_%';
+Database Table In_use Name_locked
+test t_bug44738_uppercase 0 0
+# So attempt to create table with the same name should fail.
+create table t_bug44738_UPPERCASE (i int);
+ERROR 42S01: Table 't_bug44738_uppercase' already exists
+# And should succeed after FLUSH TABLES.
+flush tables;
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;
=== modified file 'mysql-test/r/mysqltest.result'
--- a/mysql-test/r/mysqltest.result 2009-03-06 20:33:52 +0000
+++ b/mysql-test/r/mysqltest.result 2009-04-01 08:16:35 +0000
@@ -545,6 +545,8 @@ mysqltest: At line 1: Failed to open fil
mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists'
mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file'
mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file'
+mysqltest: At line 1: Missing required argument 'from_file' to command 'move_file'
+mysqltest: At line 1: Missing required argument 'to_file' to command 'move_file'
mysqltest: At line 1: Missing required argument 'mode' to command 'chmod'
mysqltest: At line 1: You must write a 4 digit octal number for mode
mysqltest: At line 1: You must write a 4 digit octal number for mode
=== modified file 'mysql-test/r/parser.result'
--- a/mysql-test/r/parser.result 2009-04-17 20:33:59 +0000
+++ b/mysql-test/r/parser.result 2009-05-11 17:58:07 +0000
@@ -623,10 +623,43 @@ UPDATE t3 SET a4={d '1789-07-14'} WHERE
SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
a1 a4
DROP TABLE t1, t2, t3;
+#
+# End of 5.1 tests
+#
BACKUP DATABASE *, test to 'broken.bak';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' test to 'broken.bak'' at line 1
BACKUP DATABASE *, db1, db2, db3 to 'broken.bak';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' db1, db2, db3 to 'broken.bak'' at line 1
-#
-# End of 5.1 tests
-#
+# Should use myisam
+create logfile group ndb_lg1 add undofile 'ndb_undo1' initial_size=32M;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create logfile group ndb_lg1 add undofile 'ndb_undo1';
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam initial_size=32M;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' wait;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter logfile group ndb_lg1 add undofile 'ndb_undo1';
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' initial_size=32M;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat';
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop logfile group ndb_lg1 engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop logfile group ndb_lg1;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop tablespace ndb_ts1 engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop tablespace ndb_ts1;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
=== modified file 'mysql-test/r/plugin.result'
--- a/mysql-test/r/plugin.result 2009-04-16 15:17:31 +0000
+++ b/mysql-test/r/plugin.result 2009-04-30 16:22:40 +0000
@@ -12,6 +12,15 @@ CREATE TABLE t1(a int) ENGINE=EXAMPLE;
SELECT * FROM t1;
a
DROP TABLE t1;
+set global example_ulong_var=500;
+set global example_enum_var= e1;
+show status like 'example%';
+Variable_name Value
+example_func_example enum_var is 0, ulong_var is 500, really
+show variables like 'example%';
+Variable_name Value
+example_enum_var e1
+example_ulong_var 500
UNINSTALL PLUGIN example;
UNINSTALL PLUGIN EXAMPLE;
ERROR 42000: PLUGIN EXAMPLE does not exist
=== modified file 'mysql-test/suite/backup/r/backup_logs.result'
--- a/mysql-test/suite/backup/r/backup_logs.result 2009-02-26 22:19:09 +0000
+++ b/mysql-test/suite/backup/r/backup_logs.result 2009-04-30 16:53:50 +0000
@@ -367,9 +367,9 @@ Attempt to set the backup log paths to a
SET global max_allowed_packet=1024*100;
-Now attempt to set the backup_progress_log_file to 512 characters.
+Now attempt to set the backup_progress_log_file to 255 characters.
-SET @@global.backup_progress_log_file = repeat('a',512);
+SET @@global.backup_progress_log_file = repeat('a',255);
Now attempt to set the backup_progress_log_file to 513 characters.
@@ -382,9 +382,9 @@ SET @@global.backup_progress_log_file =
ERROR HY000: The path specified for backup_progress_log_file is too long.
SET @@global.backup_progress_log_file = DEFAULT;
-Now attempt to set the backup_history_log_file to 512 characters.
+Now attempt to set the backup_history_log_file to 255 characters.
-SET @@global.backup_history_log_file = repeat('a',512);
+SET @@global.backup_history_log_file = repeat('a',255);
Now attempt to set the backup_history_log_file to 513 characters.
=== modified file 'mysql-test/suite/backup/t/backup_logs.test'
--- a/mysql-test/suite/backup/t/backup_logs.test 2009-03-09 14:00:03 +0000
+++ b/mysql-test/suite/backup/t/backup_logs.test 2009-04-30 16:53:50 +0000
@@ -479,9 +479,9 @@ BACKUP DATABASE backup_logs to 'backup_l
SET global max_allowed_packet=1024*100;
--echo
---echo Now attempt to set the backup_progress_log_file to 512 characters.
+--echo Now attempt to set the backup_progress_log_file to 255 characters.
--echo
-SET @@global.backup_progress_log_file = repeat('a',512);
+SET @@global.backup_progress_log_file = repeat('a',255);
--echo
--echo Now attempt to set the backup_progress_log_file to 513 characters.
@@ -497,9 +497,9 @@ SET @@global.backup_progress_log_file =
SET @@global.backup_progress_log_file = DEFAULT;
--echo
---echo Now attempt to set the backup_history_log_file to 512 characters.
+--echo Now attempt to set the backup_history_log_file to 255 characters.
--echo
-SET @@global.backup_history_log_file = repeat('a',512);
+SET @@global.backup_history_log_file = repeat('a',255);
--echo
--echo Now attempt to set the backup_history_log_file to 513 characters.
=== added file 'mysql-test/suite/binlog/r/binlog_max_extension.result'
--- a/mysql-test/suite/binlog/r/binlog_max_extension.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/binlog/r/binlog_max_extension.result 2009-04-24 12:55:11 +0000
@@ -0,0 +1,12 @@
+RESET MASTER;
+**** Stop master server ****
+INDEX: MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index
+BINLOG: MYSQLTEST_VARDIR/mysqld.1/data//master-bin.000001
+RENAMED BINLOG: MYSQLTEST_VARDIR/mysqld.1/data//master-bin.2147483646
+WROTE into index file last entry: ./master-bin.2147483646
+**** ReStart master server ****
+FLUSH LOGS;
+Warnings:
+Warning 1098 Can't generate a unique log-filename master-bin.(1-999)
+
+RESET MASTER;
=== modified file 'mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test'
--- a/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test 2009-03-06 18:19:29 +0000
+++ b/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test 2009-04-23 10:06:29 +0000
@@ -25,9 +25,22 @@ let $MYSQLD_DATADIR= `select @@datadir`;
copy_file $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001 $MYSQLD_DATADIR/slave-relay-bin.000001;
-write_file $MYSQLD_DATADIR/slave-relay-bin.index;
-slave-relay-bin.000001
-EOF
+
+# After patch for BUG#12190, the filename used in CHANGE MASTER
+# RELAY_LOG_FILE will be automatically added the directory of the
+# relay log before comparison, thus we need to added the directory
+# part (./ on unix .\ on windows) when faking the relay-log-bin.index.
+disable_query_log;
+if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`)
+{
+ eval select './slave-relay-bin.000001\n' into dumpfile '$MYSQLD_DATADIR/slave-relay-bin.index';
+}
+
+if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`)
+{
+ eval select '.\\\\slave-relay-bin.000001\n' into dumpfile '$MYSQLD_DATADIR/slave-relay-bin.index';
+}
+enable_query_log;
change master to
MASTER_HOST='dummy.localdomain',
=== added file 'mysql-test/suite/binlog/t/binlog_max_extension.test'
--- a/mysql-test/suite/binlog/t/binlog_max_extension.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/binlog/t/binlog_max_extension.test 2009-04-24 12:55:11 +0000
@@ -0,0 +1,72 @@
+# BUG#40611: MySQL cannot make a binary log after sequential number beyond
+# unsigned long.
+#
+# Problem statement
+# =================
+#
+# Extension for log file names might be created with negative
+# numbers (when counter used would wrap around), causing server
+# failure when incrementing -00001 (reaching number 000000
+# extension).
+#
+# Test
+# ====
+# This tests aims at testing the a patch that removes negatives
+# numbers from log name extensions and checks that the server
+# reports gracefully that the limit has been reached.
+#
+# It instruments index file to point to a log file close to
+# the new maximum and calls flush logs to get warning.
+#
+
+source include/have_log_bin.inc;
+RESET MASTER;
+
+let $MYSQLTEST_DATADIR= `select @@datadir`;
+
+let DATADIR= $MYSQLTEST_DATADIR;
+
+###############################################
+# check hitting maximum file name extension:
+###############################################
+
+# Stop master server
+--echo **** Stop master server ****
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait
+EOF
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+perl;
+
+my $index_file= $ENV{'DATADIR'} . "/master-bin.index";
+my $bin_file= $ENV{'DATADIR'} . "/master-bin.000001";
+my $bin_long_file= $ENV{'DATADIR'} . "/master-bin.2147483646";
+
+print("INDEX: $index_file\n");
+print("BINLOG: $bin_file\n");
+print("RENAMED BINLOG: $bin_long_file\n");
+
+use File::Copy;
+copy($bin_file, $bin_long_file) or die "File cannot be copied.";
+
+open (F, ">>$index_file");
+print F "./master-bin.2147483646\n";
+close F;
+print("WROTE into index file last entry: ./master-bin.2147483646\n");
+
+EOF
+
+--echo **** ReStart master server ****
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+# should throw warning
+FLUSH LOGS;
+
+RESET MASTER;
=== modified file 'mysql-test/suite/binlog/t/disabled.def'
--- a/mysql-test/suite/binlog/t/disabled.def 2009-02-18 10:23:38 +0000
+++ b/mysql-test/suite/binlog/t/disabled.def 2009-05-11 10:22:35 +0000
@@ -13,3 +13,4 @@ binlog_truncate_innodb : BUG#42643 2009-
binlog_multi_engine : Bug#30544 istruewing 2007-11-26
binlog_row_ctype_cp932 : Bug#33376 2007-12-19 mats Write set for table not set correctly when inserting an empty set
+binlog_max_extension : BUG#44779 2009-05-11 lsoares binlog_max_extension may be causing failure on next test in PB in windows x86 max-nt
=== modified file 'mysql-test/suite/funcs_1/datadict/is_routines.inc'
--- a/mysql-test/suite/funcs_1/datadict/is_routines.inc 2009-02-13 16:30:54 +0000
+++ b/mysql-test/suite/funcs_1/datadict/is_routines.inc 2009-04-01 09:11:21 +0000
@@ -97,10 +97,11 @@ CREATE FUNCTION function_for_routines()
SELECT specific_name,routine_catalog,routine_schema,routine_name,routine_type,
routine_body,external_name,external_language,parameter_style,sql_path
FROM information_schema.routines
-WHERE routine_catalog IS NOT NULL OR external_name IS NOT NULL
+WHERE routine_schema = 'test' AND
+ (routine_catalog IS NOT NULL OR external_name IS NOT NULL
OR external_language IS NOT NULL OR sql_path IS NOT NULL
OR routine_body <> 'SQL' OR parameter_style <> 'SQL'
- OR specific_name <> routine_name;
+ OR specific_name <> routine_name);
DROP PROCEDURE sp_for_routines;
DROP FUNCTION function_for_routines;
=== modified file 'mysql-test/suite/funcs_1/r/is_routines.result'
--- a/mysql-test/suite/funcs_1/r/is_routines.result 2009-02-16 14:47:53 +0000
+++ b/mysql-test/suite/funcs_1/r/is_routines.result 2009-04-01 09:37:16 +0000
@@ -132,14 +132,12 @@ CREATE FUNCTION function_for_routines()
SELECT specific_name,routine_catalog,routine_schema,routine_name,routine_type,
routine_body,external_name,external_language,parameter_style,sql_path
FROM information_schema.routines
-WHERE routine_catalog IS NOT NULL OR external_name IS NOT NULL
+WHERE routine_schema = 'test' AND
+(routine_catalog IS NOT NULL OR external_name IS NOT NULL
OR external_language IS NOT NULL OR sql_path IS NOT NULL
OR routine_body <> 'SQL' OR parameter_style <> 'SQL'
- OR specific_name <> routine_name;
+ OR specific_name <> routine_name);
specific_name routine_catalog routine_schema routine_name routine_type routine_body external_name external_language parameter_style sql_path
-add_suppression def mtr add_suppression PROCEDURE SQL NULL NULL SQL NULL
-check_testcase def mtr check_testcase PROCEDURE SQL NULL NULL SQL NULL
-check_warnings def mtr check_warnings PROCEDURE SQL NULL NULL SQL NULL
function_for_routines def test function_for_routines FUNCTION SQL NULL NULL SQL NULL
sp_for_routines def test sp_for_routines PROCEDURE SQL NULL NULL SQL NULL
DROP PROCEDURE sp_for_routines;
=== added file 'mysql-test/suite/rpl/include/rpl_not_null.inc'
--- a/mysql-test/suite/rpl/include/rpl_not_null.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/include/rpl_not_null.inc 2009-04-23 23:54:59 +0000
@@ -0,0 +1,364 @@
+#################################################################################
+# This test checks if the replication between "null" fields to either "null"
+# fields or "not null" fields works properly. In the first case, the execution
+# should work fine. In the second case, it may fail according to the sql_mode
+# being used.
+#
+# The test is devided in three main parts:
+#
+# 1 - NULL --> NULL (no failures)
+# 2 - NULL --> NOT NULL ( sql-mode = STRICT and failures)
+# 3 - NULL --> NOT NULL ( sql-mode != STRICT and no failures)
+#
+#################################################################################
+connection master;
+
+SET SQL_LOG_BIN= 0;
+eval CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t3(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t4(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+SET SQL_LOG_BIN= 1;
+
+connection slave;
+
+eval CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t3(`a` INT, `b` DATE DEFAULT '0000-00-00',
+`c` INT DEFAULT 500,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+eval CREATE TABLE t4(`a` INT, `b` DATE DEFAULT '0000-00-00',
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+--echo ************* EXECUTION WITH INSERTS *************
+connection master;
+INSERT INTO t1(a,b,c) VALUES (1, null, 1);
+INSERT INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
+INSERT INTO t1(a,b) VALUES (3, null);
+INSERT INTO t1(a,c) VALUES (4, 4);
+INSERT INTO t1(a) VALUES (5);
+
+INSERT INTO t2(a,b) VALUES (1, null);
+INSERT INTO t2(a,b) VALUES (2,'1111-11-11');
+INSERT INTO t2(a) VALUES (3);
+
+INSERT INTO t3(a,b) VALUES (1, null);
+INSERT INTO t3(a,b) VALUES (2,'1111-11-11');
+INSERT INTO t3(a) VALUES (3);
+
+INSERT INTO t4(a,b,c) VALUES (1, null, 1);
+INSERT INTO t4(a,b,c) VALUES (2,'1111-11-11', 2);
+INSERT INTO t4(a,b) VALUES (3, null);
+INSERT INTO t4(a,c) VALUES (4, 4);
+INSERT INTO t4(a) VALUES (5);
+
+--echo ************* SHOWING THE RESULT SETS WITH INSERTS *************
+sync_slave_with_master;
+
+--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+source include/diff_tables.inc;
+
+let $diff_table_1=master:test.t2;
+let $diff_table_2=slave:test.t2;
+source include/diff_tables.inc;
+
+--echo TABLES t2 and t3 must be different.
+connection master;
+SELECT * FROM t3;
+connection slave;
+SELECT * FROM t3;
+connection master;
+SELECT * FROM t4;
+connection slave;
+SELECT * FROM t4;
+
+--echo ************* EXECUTION WITH UPDATES and REPLACES *************
+connection master;
+DELETE FROM t1;
+INSERT INTO t1(a,b,c) VALUES (1,'1111-11-11', 1);
+REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
+UPDATE t1 set b= NULL, c= 300 where a= 1;
+REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
+
+--echo ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
+sync_slave_with_master;
+
+--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+source include/diff_tables.inc;
+
+--echo ************* CLEANING *************
+connection master;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+
+sync_slave_with_master;
+
+connection master;
+
+SET SQL_LOG_BIN= 0;
+eval CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL,
+PRIMARY KEY (`a`)) ENGINE= $engine;
+SET SQL_LOG_BIN= 1;
+
+connection slave;
+
+eval CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT b'01', `c` BIT DEFAULT NULL,
+PRIMARY KEY (`a`)) ENGINE= $engine;
+
+--echo ************* EXECUTION WITH INSERTS *************
+connection master;
+INSERT INTO t1(a,b,c) VALUES (1, null, b'01');
+INSERT INTO t1(a,b,c) VALUES (2,b'00', b'01');
+INSERT INTO t1(a,b) VALUES (3, null);
+INSERT INTO t1(a,c) VALUES (4, b'01');
+INSERT INTO t1(a) VALUES (5);
+
+--echo ************* SHOWING THE RESULT SETS WITH INSERTS *************
+--echo TABLES t1 and t2 must be different.
+sync_slave_with_master;
+connection master;
+SELECT a,b+0,c+0 FROM t1;
+connection slave;
+SELECT a,b+0,c+0 FROM t1;
+
+--echo ************* EXECUTION WITH UPDATES AND REPLACES *************
+connection master;
+DELETE FROM t1;
+INSERT INTO t1(a,b,c) VALUES (1,b'00', b'01');
+REPLACE INTO t1(a,b,c) VALUES (2,b'00',b'01');
+UPDATE t1 set b= NULL, c= b'00' where a= 1;
+REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
+
+--echo ************* SHOWING THE RESULT SETS WITH UPDATES AND REPLACES *************
+--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
+sync_slave_with_master;
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+source include/diff_tables.inc;
+
+connection master;
+
+DROP TABLE t1;
+
+sync_slave_with_master;
+
+--echo ################################################################################
+--echo # NULL ---> NOT NULL (STRICT MODE)
+--echo # UNCOMMENT THIS AFTER FIXING BUG#43992
+--echo ################################################################################
+#connection slave;
+#SET GLOBAL sql_mode="TRADITIONAL";
+#
+#STOP SLAVE;
+#--source include/wait_for_slave_to_stop.inc
+#START SLAVE;
+#--source include/wait_for_slave_to_start.inc
+#
+#let $y=0;
+#while (`select $y < 6`)
+#{
+# connection master;
+#
+# SET SQL_LOG_BIN= 0;
+# eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+# eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+# eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+# SET SQL_LOG_BIN= 1;
+#
+# connection slave;
+#
+# eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
+# `c` INT NOT NULL,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+# eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT NOT NULL,
+# `c` INT,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+# eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
+# `c` INT DEFAULT 500,
+# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+#
+# if (`select $y=0`)
+# {
+# --echo ************* EXECUTION WITH INSERTS *************
+# connection master;
+# INSERT INTO t1(a) VALUES (1);
+# }
+#
+# if (`select $y=1`)
+# {
+# --echo ************* EXECUTION WITH INSERTS *************
+# connection master;
+# INSERT INTO t1(a, b) VALUES (1, NULL);
+# }
+#
+# if (`select $y=2`)
+# {
+# --echo ************* EXECUTION WITH UPDATES *************
+# connection master;
+# INSERT INTO t3(a, b) VALUES (1, 1);
+# INSERT INTO t3(a, b) VALUES (2, 1);
+# UPDATE t3 SET b = NULL where a= 1;
+# }
+#
+# if (`select $y=3`)
+# {
+# --echo ************* EXECUTION WITH INSERTS/REPLACES *************
+# connection master;
+# REPLACE INTO t3(a, b) VALUES (1, null);
+# }
+#
+# if (`select $y=4`)
+# {
+# --echo ************* EXECUTION WITH UPDATES/REPLACES *************
+# connection master;
+# INSERT INTO t3(a, b) VALUES (1, 1);
+# REPLACE INTO t3(a, b) VALUES (1, null);
+# }
+#
+# if (`select $y=5`)
+# {
+# --echo ************* EXECUTION WITH MULTI-ROW INSERTS *************
+# connection master;
+#
+# SET SQL_LOG_BIN= 0;
+# INSERT INTO t2(a, b) VALUES (1, 1);
+# INSERT INTO t2(a, b) VALUES (2, 1);
+# INSERT INTO t2(a, b) VALUES (3, null);
+# INSERT INTO t2(a, b) VALUES (4, 1);
+# INSERT INTO t2(a, b) VALUES (5, 1);
+# SET SQL_LOG_BIN= 1;
+#
+# INSERT INTO t2 SELECT a + 10, b from t2;
+# --echo The statement below is just executed to stop processing
+# INSERT INTO t1(a) VALUES (1);
+# }
+#
+# --echo ************* SHOWING THE RESULT SETS *************
+# connection slave;
+# --source include/wait_for_slave_sql_to_stop.inc
+# connection master;
+# SELECT * FROM t1;
+# connection slave;
+# SELECT * FROM t1;
+# connection master;
+# SELECT * FROM t2;
+# connection slave;
+# SELECT * FROM t2;
+# connection master;
+# SELECT * FROM t3;
+# connection slave;
+# SELECT * FROM t3;
+# --source include/reset_master_and_slave.inc
+#
+# connection master;
+#
+# DROP TABLE t1;
+# DROP TABLE t2;
+# DROP TABLE t3;
+#
+# sync_slave_with_master;
+#
+# inc $y;
+#}
+#connection slave;
+#SET GLOBAL sql_mode="";
+#
+#STOP SLAVE;
+#source include/wait_for_slave_to_stop.inc;
+#START SLAVE;
+#--source include/wait_for_slave_to_start.inc
+
+--echo ################################################################################
+--echo # NULL ---> NOT NULL (NON-STRICT MODE)
+--echo ################################################################################
+connection master;
+
+SET SQL_LOG_BIN= 0;
+eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+SET SQL_LOG_BIN= 1;
+
+connection slave;
+
+eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT NOT NULL,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT DEFAULT 500,
+PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
+
+--echo ************* EXECUTION WITH INSERTS *************
+connection master;
+INSERT INTO t1(a) VALUES (1);
+INSERT INTO t1(a, b) VALUES (2, NULL);
+INSERT INTO t1(a, b) VALUES (3, 1);
+
+INSERT INTO t2(a) VALUES (1);
+INSERT INTO t2(a, b) VALUES (2, NULL);
+INSERT INTO t2(a, b) VALUES (3, 1);
+
+INSERT INTO t3(a) VALUES (1);
+INSERT INTO t3(a, b) VALUES (2, NULL);
+INSERT INTO t3(a, b) VALUES (3, 1);
+INSERT INTO t3(a, b) VALUES (4, 1);
+REPLACE INTO t3(a, b) VALUES (5, null);
+
+REPLACE INTO t3(a, b) VALUES (3, null);
+UPDATE t3 SET b = NULL where a = 4;
+
+--echo ************* SHOWING THE RESULT SETS *************
+connection master;
+sync_slave_with_master;
+
+connection master;
+SELECT * FROM t1;
+connection slave;
+SELECT * FROM t1;
+connection master;
+SELECT * FROM t2;
+connection slave;
+SELECT * FROM t2;
+connection master;
+SELECT * FROM t3;
+connection slave;
+SELECT * FROM t3;
+
+connection master;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+sync_slave_with_master;
=== added file 'mysql-test/suite/rpl/r/rpl_bug41902.result'
--- a/mysql-test/suite/rpl/r/rpl_bug41902.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_bug41902.result 2009-04-20 12:16:34 +0000
@@ -0,0 +1,34 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+stop slave;
+SET @@debug="d,simulate_find_log_pos_error";
+reset slave;
+ERROR HY000: Target log not found in binlog index
+show warnings;
+Level Code Message
+Error 1373 Target log not found in binlog index
+Error 1371 Failed purging old relay logs: Failed during log reset
+SET @@debug="";
+reset slave;
+change master to master_host='dummy';
+SET @@debug="d,simulate_find_log_pos_error";
+change master to master_host='dummy';
+ERROR HY000: Target log not found in binlog index
+SET @@debug="";
+reset slave;
+change master to master_host='dummy';
+SET @@debug="d,simulate_find_log_pos_error";
+reset master;
+ERROR HY000: Target log not found in binlog index
+SET @@debug="";
+reset master;
+SET @@debug="d,simulate_find_log_pos_error";
+purge binary logs to 'master-bin.000001';
+ERROR HY000: Target log not found in binlog index
+SET @@debug="";
+purge binary logs to 'master-bin.000001';
+End of the tests
=== modified file 'mysql-test/suite/rpl/r/rpl_change_master.result'
--- a/mysql-test/suite/rpl/r/rpl_change_master.result 2008-07-17 19:11:37 +0000
+++ b/mysql-test/suite/rpl/r/rpl_change_master.result 2009-04-21 09:40:24 +0000
@@ -100,3 +100,20 @@ n
1
2
drop table t1;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table t1 (a int);
+insert into t1 values (1);
+flush logs;
+insert into t1 values (2);
+include/stop_slave.inc
+delete from t1 where a=2;
+CHANGE MASTER TO relay_log_file='slave-relay-bin.000005', relay_log_pos=4;
+start slave sql_thread;
+start slave io_thread;
+set global relay_log_purge=1;
+drop table t1;
=== added file 'mysql-test/suite/rpl/r/rpl_not_null_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_not_null_innodb.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_not_null_innodb.result 2009-04-23 23:54:59 +0000
@@ -0,0 +1,202 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+SET SQL_LOG_BIN= 0;
+CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t4(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+SET SQL_LOG_BIN= 1;
+CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT, `b` DATE DEFAULT '0000-00-00',
+`c` INT DEFAULT 500,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t4(`a` INT, `b` DATE DEFAULT '0000-00-00',
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+************* EXECUTION WITH INSERTS *************
+INSERT INTO t1(a,b,c) VALUES (1, null, 1);
+INSERT INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
+INSERT INTO t1(a,b) VALUES (3, null);
+INSERT INTO t1(a,c) VALUES (4, 4);
+INSERT INTO t1(a) VALUES (5);
+INSERT INTO t2(a,b) VALUES (1, null);
+INSERT INTO t2(a,b) VALUES (2,'1111-11-11');
+INSERT INTO t2(a) VALUES (3);
+INSERT INTO t3(a,b) VALUES (1, null);
+INSERT INTO t3(a,b) VALUES (2,'1111-11-11');
+INSERT INTO t3(a) VALUES (3);
+INSERT INTO t4(a,b,c) VALUES (1, null, 1);
+INSERT INTO t4(a,b,c) VALUES (2,'1111-11-11', 2);
+INSERT INTO t4(a,b) VALUES (3, null);
+INSERT INTO t4(a,c) VALUES (4, 4);
+INSERT INTO t4(a) VALUES (5);
+************* SHOWING THE RESULT SETS WITH INSERTS *************
+TABLES t1 and t2 must be equal otherwise an error will be thrown.
+Comparing tables master:test.t1 and slave:test.t1
+Comparing tables master:test.t2 and slave:test.t2
+TABLES t2 and t3 must be different.
+SELECT * FROM t3;
+a b
+1 NULL
+2 1111-11-11
+3 NULL
+SELECT * FROM t3;
+a b c
+1 NULL 500
+2 1111-11-11 500
+3 0000-00-00 500
+SELECT * FROM t4;
+a b c
+1 NULL 1
+2 1111-11-11 2
+3 NULL NULL
+4 NULL 4
+5 NULL NULL
+SELECT * FROM t4;
+a b
+1 NULL
+2 1111-11-11
+3 NULL
+4 0000-00-00
+5 0000-00-00
+************* EXECUTION WITH UPDATES and REPLACES *************
+DELETE FROM t1;
+INSERT INTO t1(a,b,c) VALUES (1,'1111-11-11', 1);
+REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
+UPDATE t1 set b= NULL, c= 300 where a= 1;
+REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
+************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
+TABLES t1 and t2 must be equal otherwise an error will be thrown.
+Comparing tables master:test.t1 and slave:test.t1
+************* CLEANING *************
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+SET SQL_LOG_BIN= 0;
+CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL,
+PRIMARY KEY (`a`)) ENGINE= Innodb;
+SET SQL_LOG_BIN= 1;
+CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT b'01', `c` BIT DEFAULT NULL,
+PRIMARY KEY (`a`)) ENGINE= Innodb;
+************* EXECUTION WITH INSERTS *************
+INSERT INTO t1(a,b,c) VALUES (1, null, b'01');
+INSERT INTO t1(a,b,c) VALUES (2,b'00', b'01');
+INSERT INTO t1(a,b) VALUES (3, null);
+INSERT INTO t1(a,c) VALUES (4, b'01');
+INSERT INTO t1(a) VALUES (5);
+************* SHOWING THE RESULT SETS WITH INSERTS *************
+TABLES t1 and t2 must be different.
+SELECT a,b+0,c+0 FROM t1;
+a b+0 c+0
+1 NULL 1
+2 0 1
+3 NULL NULL
+4 NULL 1
+5 NULL NULL
+SELECT a,b+0,c+0 FROM t1;
+a b+0 c+0
+1 NULL 1
+2 0 1
+3 NULL NULL
+4 1 1
+5 1 NULL
+************* EXECUTION WITH UPDATES AND REPLACES *************
+DELETE FROM t1;
+INSERT INTO t1(a,b,c) VALUES (1,b'00', b'01');
+REPLACE INTO t1(a,b,c) VALUES (2,b'00',b'01');
+UPDATE t1 set b= NULL, c= b'00' where a= 1;
+REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
+************* SHOWING THE RESULT SETS WITH UPDATES AND REPLACES *************
+TABLES t1 and t2 must be equal otherwise an error will be thrown.
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE t1;
+################################################################################
+# NULL ---> NOT NULL (STRICT MODE)
+# UNCOMMENT THIS AFTER FIXING BUG#43992
+################################################################################
+################################################################################
+# NULL ---> NOT NULL (NON-STRICT MODE)
+################################################################################
+SET SQL_LOG_BIN= 0;
+CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+SET SQL_LOG_BIN= 1;
+CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT NOT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT DEFAULT 500,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+************* EXECUTION WITH INSERTS *************
+INSERT INTO t1(a) VALUES (1);
+INSERT INTO t1(a, b) VALUES (2, NULL);
+INSERT INTO t1(a, b) VALUES (3, 1);
+INSERT INTO t2(a) VALUES (1);
+INSERT INTO t2(a, b) VALUES (2, NULL);
+INSERT INTO t2(a, b) VALUES (3, 1);
+INSERT INTO t3(a) VALUES (1);
+INSERT INTO t3(a, b) VALUES (2, NULL);
+INSERT INTO t3(a, b) VALUES (3, 1);
+INSERT INTO t3(a, b) VALUES (4, 1);
+REPLACE INTO t3(a, b) VALUES (5, null);
+REPLACE INTO t3(a, b) VALUES (3, null);
+UPDATE t3 SET b = NULL where a = 4;
+************* SHOWING THE RESULT SETS *************
+SELECT * FROM t1;
+a b
+1 NULL
+2 NULL
+3 1
+SELECT * FROM t1;
+a b c
+1 0 0
+2 0 0
+3 1 0
+SELECT * FROM t2;
+a b
+1 NULL
+2 NULL
+3 1
+SELECT * FROM t2;
+a b c
+1 0 NULL
+2 0 NULL
+3 1 NULL
+SELECT * FROM t3;
+a b
+1 NULL
+2 NULL
+3 NULL
+4 NULL
+5 NULL
+SELECT * FROM t3;
+a b c
+1 0 500
+2 0 500
+3 0 500
+4 0 500
+5 0 500
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
=== added file 'mysql-test/suite/rpl/r/rpl_not_null_myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_not_null_myisam.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_not_null_myisam.result 2009-04-23 23:54:59 +0000
@@ -0,0 +1,202 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+SET SQL_LOG_BIN= 0;
+CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+CREATE TABLE t4(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+SET SQL_LOG_BIN= 1;
+CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT, `b` DATE DEFAULT '0000-00-00',
+`c` INT DEFAULT 500,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+CREATE TABLE t4(`a` INT, `b` DATE DEFAULT '0000-00-00',
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+************* EXECUTION WITH INSERTS *************
+INSERT INTO t1(a,b,c) VALUES (1, null, 1);
+INSERT INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
+INSERT INTO t1(a,b) VALUES (3, null);
+INSERT INTO t1(a,c) VALUES (4, 4);
+INSERT INTO t1(a) VALUES (5);
+INSERT INTO t2(a,b) VALUES (1, null);
+INSERT INTO t2(a,b) VALUES (2,'1111-11-11');
+INSERT INTO t2(a) VALUES (3);
+INSERT INTO t3(a,b) VALUES (1, null);
+INSERT INTO t3(a,b) VALUES (2,'1111-11-11');
+INSERT INTO t3(a) VALUES (3);
+INSERT INTO t4(a,b,c) VALUES (1, null, 1);
+INSERT INTO t4(a,b,c) VALUES (2,'1111-11-11', 2);
+INSERT INTO t4(a,b) VALUES (3, null);
+INSERT INTO t4(a,c) VALUES (4, 4);
+INSERT INTO t4(a) VALUES (5);
+************* SHOWING THE RESULT SETS WITH INSERTS *************
+TABLES t1 and t2 must be equal otherwise an error will be thrown.
+Comparing tables master:test.t1 and slave:test.t1
+Comparing tables master:test.t2 and slave:test.t2
+TABLES t2 and t3 must be different.
+SELECT * FROM t3;
+a b
+1 NULL
+2 1111-11-11
+3 NULL
+SELECT * FROM t3;
+a b c
+1 NULL 500
+2 1111-11-11 500
+3 0000-00-00 500
+SELECT * FROM t4;
+a b c
+1 NULL 1
+2 1111-11-11 2
+3 NULL NULL
+4 NULL 4
+5 NULL NULL
+SELECT * FROM t4;
+a b
+1 NULL
+2 1111-11-11
+3 NULL
+4 0000-00-00
+5 0000-00-00
+************* EXECUTION WITH UPDATES and REPLACES *************
+DELETE FROM t1;
+INSERT INTO t1(a,b,c) VALUES (1,'1111-11-11', 1);
+REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
+UPDATE t1 set b= NULL, c= 300 where a= 1;
+REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
+************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
+TABLES t1 and t2 must be equal otherwise an error will be thrown.
+Comparing tables master:test.t1 and slave:test.t1
+************* CLEANING *************
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+SET SQL_LOG_BIN= 0;
+CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL,
+PRIMARY KEY (`a`)) ENGINE= MyISAM;
+SET SQL_LOG_BIN= 1;
+CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT b'01', `c` BIT DEFAULT NULL,
+PRIMARY KEY (`a`)) ENGINE= MyISAM;
+************* EXECUTION WITH INSERTS *************
+INSERT INTO t1(a,b,c) VALUES (1, null, b'01');
+INSERT INTO t1(a,b,c) VALUES (2,b'00', b'01');
+INSERT INTO t1(a,b) VALUES (3, null);
+INSERT INTO t1(a,c) VALUES (4, b'01');
+INSERT INTO t1(a) VALUES (5);
+************* SHOWING THE RESULT SETS WITH INSERTS *************
+TABLES t1 and t2 must be different.
+SELECT a,b+0,c+0 FROM t1;
+a b+0 c+0
+1 NULL 1
+2 0 1
+3 NULL NULL
+4 NULL 1
+5 NULL NULL
+SELECT a,b+0,c+0 FROM t1;
+a b+0 c+0
+1 NULL 1
+2 0 1
+3 NULL NULL
+4 1 1
+5 1 NULL
+************* EXECUTION WITH UPDATES AND REPLACES *************
+DELETE FROM t1;
+INSERT INTO t1(a,b,c) VALUES (1,b'00', b'01');
+REPLACE INTO t1(a,b,c) VALUES (2,b'00',b'01');
+UPDATE t1 set b= NULL, c= b'00' where a= 1;
+REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
+************* SHOWING THE RESULT SETS WITH UPDATES AND REPLACES *************
+TABLES t1 and t2 must be equal otherwise an error will be thrown.
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE t1;
+################################################################################
+# NULL ---> NOT NULL (STRICT MODE)
+# UNCOMMENT THIS AFTER FIXING BUG#43992
+################################################################################
+################################################################################
+# NULL ---> NOT NULL (NON-STRICT MODE)
+################################################################################
+SET SQL_LOG_BIN= 0;
+CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+SET SQL_LOG_BIN= 1;
+CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT NOT NULL,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT DEFAULT 500,
+PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
+************* EXECUTION WITH INSERTS *************
+INSERT INTO t1(a) VALUES (1);
+INSERT INTO t1(a, b) VALUES (2, NULL);
+INSERT INTO t1(a, b) VALUES (3, 1);
+INSERT INTO t2(a) VALUES (1);
+INSERT INTO t2(a, b) VALUES (2, NULL);
+INSERT INTO t2(a, b) VALUES (3, 1);
+INSERT INTO t3(a) VALUES (1);
+INSERT INTO t3(a, b) VALUES (2, NULL);
+INSERT INTO t3(a, b) VALUES (3, 1);
+INSERT INTO t3(a, b) VALUES (4, 1);
+REPLACE INTO t3(a, b) VALUES (5, null);
+REPLACE INTO t3(a, b) VALUES (3, null);
+UPDATE t3 SET b = NULL where a = 4;
+************* SHOWING THE RESULT SETS *************
+SELECT * FROM t1;
+a b
+1 NULL
+2 NULL
+3 1
+SELECT * FROM t1;
+a b c
+1 0 0
+2 0 0
+3 1 0
+SELECT * FROM t2;
+a b
+1 NULL
+2 NULL
+3 1
+SELECT * FROM t2;
+a b c
+1 0 NULL
+2 0 NULL
+3 1 NULL
+SELECT * FROM t3;
+a b
+1 NULL
+2 NULL
+3 NULL
+4 NULL
+5 NULL
+SELECT * FROM t3;
+a b c
+1 0 500
+2 0 500
+3 0 500
+4 0 500
+5 0 500
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
=== added file 'mysql-test/suite/rpl/r/rpl_row_record_find_falcon.result'
--- a/mysql-test/suite/rpl/r/rpl_row_record_find_falcon.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_record_find_falcon.result 2009-04-29 16:48:59 +0000
@@ -0,0 +1,828 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+#################################################################
+# CASE 2: Falcon - master, Falcon - slave
+#################################################################
+DROP TABLE IF EXISTS t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes (Falcon -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes (Falcon -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes (Falcon -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key (Falcon -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key (Falcon -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key (Falcon -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key (Falcon -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key (Falcon -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: One key (Falcon -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys (Falcon -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+#################################################################
+# CASE 3: Falcon - master, MyISAM - slave
+#################################################################
+DROP TABLE IF EXISTS t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes (Falcon -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes (Falcon -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes (Falcon -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key (Falcon -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key (Falcon -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key (Falcon -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key (Falcon -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key (Falcon -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: One key (Falcon -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys (Falcon -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= Falcon;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+#################################################################
+# CASE 4: MyISAM - master, Falcon - slave
+#################################################################
+DROP TABLE IF EXISTS t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes (MyISAM -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes (MyISAM -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes (MyISAM -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key (MyISAM -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key (MyISAM -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key (MyISAM -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key (MyISAM -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key (MyISAM -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: One key (MyISAM -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys (MyISAM -> Falcon)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= Falcon;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
=== added file 'mysql-test/suite/rpl/r/rpl_row_record_find_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_row_record_find_innodb.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_record_find_innodb.result 2009-04-29 16:48:59 +0000
@@ -0,0 +1,828 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+#################################################################
+# CASE 5: InnoDB - master, MyISAM - slave
+#################################################################
+DROP TABLE IF EXISTS t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes (InnoDB -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes (InnoDB -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes (InnoDB -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key (InnoDB -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key (InnoDB -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key (InnoDB -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key (InnoDB -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key (InnoDB -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: One key (InnoDB -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys (InnoDB -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+#################################################################
+# CASE 6: InnoDB - master, InnoDB - slave
+#################################################################
+DROP TABLE IF EXISTS t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes (InnoDB -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes (InnoDB -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes (InnoDB -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key (InnoDB -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key (InnoDB -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key (InnoDB -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key (InnoDB -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key (InnoDB -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: One key (InnoDB -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys (InnoDB -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+#################################################################
+# CASE 7: MyISAM - master, InnoDB - slave
+#################################################################
+DROP TABLE IF EXISTS t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes (MyISAM -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes (MyISAM -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes (MyISAM -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key (MyISAM -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key (MyISAM -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key (MyISAM -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key (MyISAM -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key (MyISAM -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: One key (MyISAM -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys (MyISAM -> InnoDB)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
=== added file 'mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result 2009-04-29 16:48:59 +0000
@@ -0,0 +1,288 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE TABLE t1 ( i1 int, c1 char(1), key ( i1 ));
+INSERT IGNORE INTO t1 VALUES (1, 'a');
+UPDATE t1 SET c1 = 'b' WHERE i1 = 1;
+DROP TABLE t1;
+CREATE TABLE table1_myisam ( `bit_key` bit, `int_key` int, key (`bit_key` ), key (`int_key` ));
+INSERT IGNORE INTO table1_myisam VALUES ('1', '-2146992385');
+UPDATE `table1_myisam` SET `bit_key` = 0 WHERE `bit_key` = 1;
+DROP TABLE table1_myisam;
+#################################################################
+# CASE 1: MyISAM - master, MyISAM - slave
+#################################################################
+DROP TABLE IF EXISTS t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes (MyISAM -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes (MyISAM -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes (MyISAM -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key (MyISAM -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key (MyISAM -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key (MyISAM -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key (MyISAM -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key (MyISAM -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: One key (MyISAM -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys (MyISAM -> MyISAM)
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+SET SQL_LOG_BIN=1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+Comparing tables master:test.t and slave:test.t
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+Comparing tables master:test.t and slave:test.t
+DROP TABLE t;
=== modified file 'mysql-test/suite/rpl/t/disabled.def'
--- a/mysql-test/suite/rpl/t/disabled.def 2009-05-07 20:48:24 +0000
+++ b/mysql-test/suite/rpl/t/disabled.def 2009-05-12 08:58:44 +0000
@@ -10,12 +10,12 @@
#
##############################################################################
-rpl_extraColmaster_innodb : BUG#41097 2008-12-12 sven result files for rpl_extraColmaster_myisam, rpl_extraColmaster_innodb are gone
-rpl_extraColmaster_myisam : BUG#41097 2008-12-12 sven result files for rpl_extraColmaster_myisam, rpl_extraColmaster_innodb are gone
+rpl_extraColmaster_innodb : BUG#40796 2009-04-22 alfranio Crash due to heap corruption in rpl.rpl_extraColmaster_myisam
+rpl_extraColmaster_myisam : BUG#40796 2009-04-22 alfranio Crash due to heap corruption in rpl.rpl_extraColmaster_myisam
rpl_cross_version : BUG#42311 2009-03-27 joro rpl_cross_version fails on macosx
rpl_extraCol_falcon : Bug#40930 2008-11-21 johnemb rpl.rpl_extraCol_falcon fails doing STOP SLAVE (on Windows PB2)
rpl_cross_version : Bug#42311 2009-01-23 aelkin
rpl_heartbeat_basic : Bug#43828 Sporadic failures (Serge.Kozlov@stripped)
-rpl_heartbeat_2slaves : Bug#43828 Sporadic failrues (Serge.Kozlov@stripped)
+rpl_heartbeat_2slaves : Bug#43828 Sporadic failures (Serge.Kozlov@stripped)
rpl_failed_optimize : WL#4284: Can't optimize table used by a pending transaction (there is metadata lock on the table).
rpl_read_only : WL#4284: Setting Read only won't succeed until all metadata locks are released.
=== added file 'mysql-test/suite/rpl/t/rpl_bug41902-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_bug41902-slave.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_bug41902-slave.opt 2009-04-20 12:16:34 +0000
@@ -0,0 +1 @@
+--loose-debug=-d,simulate_find_log_pos_error
=== added file 'mysql-test/suite/rpl/t/rpl_bug41902.test'
--- a/mysql-test/suite/rpl/t/rpl_bug41902.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_bug41902.test 2009-04-20 12:16:34 +0000
@@ -0,0 +1,53 @@
+# Test for Bug #41902 MYSQL_BIN_LOG::reset_logs() doesn't call my_error()
+# in face of an error
+#
+
+source include/have_debug.inc;
+source include/master-slave.inc;
+
+#
+# test checks that
+# a. there is no crash when find_log_pos() returns with an error
+# that tests expect to receive;
+# b. in the case of multiple error messages the first error message is
+# reported to the user and others are available as warnings.
+#
+
+connection slave;
+stop slave;
+
+SET @@debug="d,simulate_find_log_pos_error";
+
+--error ER_UNKNOWN_TARGET_BINLOG
+reset slave;
+show warnings;
+
+SET @@debug="";
+reset slave;
+change master to master_host='dummy';
+
+SET @@debug="d,simulate_find_log_pos_error";
+
+--error ER_UNKNOWN_TARGET_BINLOG
+change master to master_host='dummy';
+
+SET @@debug="";
+reset slave;
+change master to master_host='dummy';
+
+connection master;
+SET @@debug="d,simulate_find_log_pos_error";
+--error ER_UNKNOWN_TARGET_BINLOG
+reset master;
+
+SET @@debug="";
+reset master;
+
+SET @@debug="d,simulate_find_log_pos_error";
+--error ER_UNKNOWN_TARGET_BINLOG
+purge binary logs to 'master-bin.000001';
+
+SET @@debug="";
+purge binary logs to 'master-bin.000001';
+
+--echo End of the tests
=== modified file 'mysql-test/suite/rpl/t/rpl_change_master.test'
--- a/mysql-test/suite/rpl/t/rpl_change_master.test 2008-06-22 20:05:19 +0000
+++ b/mysql-test/suite/rpl/t/rpl_change_master.test 2009-04-21 09:40:24 +0000
@@ -31,3 +31,56 @@ drop table t1;
sync_slave_with_master;
# End of 4.1 tests
+
+#
+# BUG#12190 CHANGE MASTER has differ path requiremts on MASTER_LOG_FILE and RELAY_LOG_FILE
+#
+
+source include/master-slave-reset.inc;
+
+connection master;
+create table t1 (a int);
+insert into t1 values (1);
+flush logs;
+insert into t1 values (2);
+
+# Note: the master positon saved by this will also be used by the
+# 'sync_with_master' below.
+sync_slave_with_master;
+
+# Check if the table t1 and t2 are identical on master and slave;
+let $diff_table_1= master:test.t1
+let $diff_table_2= slave:test.t1
+source include/diff_tables.inc;
+
+connection slave;
+source include/stop_slave.inc;
+delete from t1 where a=2;
+
+# start replication from the second insert, after fix of BUG#12190,
+# relay_log_file does not use absolute path, only the filename is
+# required
+#
+# Note: the follow change master will automatically reset
+# relay_log_purge to false, save the old value to restore
+let $relay_log_purge= `select @@global.relay_log_purge`;
+CHANGE MASTER TO relay_log_file='slave-relay-bin.000005', relay_log_pos=4;
+start slave sql_thread;
+source include/wait_for_slave_sql_to_start.inc;
+
+# Sync to the same position saved by the 'sync_slave_with_master' above.
+sync_with_master;
+
+# Check if the table t1 and t2 are identical on master and slave;
+let $diff_table_1= master:test.t1
+let $diff_table_2= slave:test.t1
+source include/diff_tables.inc;
+
+# clean up
+connection slave;
+start slave io_thread;
+source include/wait_for_slave_io_to_start.inc;
+eval set global relay_log_purge=$relay_log_purge;
+connection master;
+drop table t1;
+sync_slave_with_master;
=== added file 'mysql-test/suite/rpl/t/rpl_not_null_innodb.test'
--- a/mysql-test/suite/rpl/t/rpl_not_null_innodb.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_not_null_innodb.test 2009-04-23 23:54:59 +0000
@@ -0,0 +1,19 @@
+#################################################################################
+# This test checks if the replication between "null" fields to either "null"
+# fields or "not null" fields works properly. In the first case, the execution
+# should work fine. In the second case, it may fail according to the sql_mode
+# being used.
+#
+# The test is devided in three main parts:
+#
+# 1 - NULL --> NULL (no failures)
+# 2 - NULL --> NOT NULL ( sql-mode = STRICT and failures)
+# 3 - NULL --> NOT NULL ( sql-mode != STRICT and no failures)
+#
+#################################################################################
+--source include/master-slave.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_row.inc
+
+let $engine=Innodb;
+--source suite/rpl/include/rpl_not_null.inc
=== added file 'mysql-test/suite/rpl/t/rpl_not_null_myisam.test'
--- a/mysql-test/suite/rpl/t/rpl_not_null_myisam.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_not_null_myisam.test 2009-04-23 23:54:59 +0000
@@ -0,0 +1,19 @@
+#################################################################################
+# This test checks if the replication between "null" fields to either "null"
+# fields or "not null" fields works properly. In the first case, the execution
+# should work fine. In the second case, it may fail according to the sql_mode
+# being used.
+#
+# The test is devided in three main parts:
+#
+# 1 - NULL --> NULL (no failures)
+# 2 - NULL --> NOT NULL ( sql-mode = STRICT and failures)
+# 3 - NULL --> NOT NULL ( sql-mode != STRICT and no failures)
+#
+#################################################################################
+--source include/master-slave.inc
+--source include/have_myisam_or_maria_default.inc
+--source include/have_binlog_format_row.inc
+
+let $engine=MyISAM;
+--source suite/rpl/include/rpl_not_null.inc
=== added file 'mysql-test/suite/rpl/t/rpl_row_record_find_falcon.test'
--- a/mysql-test/suite/rpl/t/rpl_row_record_find_falcon.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_record_find_falcon.test 2009-04-29 16:48:59 +0000
@@ -0,0 +1,47 @@
+#
+# BUG#40045: Replication failure on RBR + no PK + UPDATE + integer key +
+# char with no key
+#
+# BUG#40007: Replication failure with RBR + no PK + 2 indexed fields
+#
+# Test Description
+# ================
+#
+# (see rpl_row_record_find_myisam.test)
+#
+
+source include/master-slave.inc;
+source include/have_binlog_format_row.inc;
+connection master;
+source include/have_falcon.inc;
+connection slave;
+source include/have_falcon.inc;
+connection master;
+
+--echo #################################################################
+--echo # CASE 2: Falcon - master, Falcon - slave
+--echo #################################################################
+
+let $master_engine= Falcon;
+let $slave_engine= Falcon;
+
+-- source extra/rpl_tests/rpl_row_record_find.test
+
+--echo #################################################################
+--echo # CASE 3: Falcon - master, MyISAM - slave
+--echo #################################################################
+
+let $master_engine= Falcon;
+let $slave_engine= MyISAM;
+
+-- source extra/rpl_tests/rpl_row_record_find.test
+
+--echo #################################################################
+--echo # CASE 4: MyISAM - master, Falcon - slave
+--echo #################################################################
+
+let $master_engine= MyISAM;
+let $slave_engine= Falcon;
+
+-- source extra/rpl_tests/rpl_row_record_find.test
+
=== added file 'mysql-test/suite/rpl/t/rpl_row_record_find_innodb.test'
--- a/mysql-test/suite/rpl/t/rpl_row_record_find_innodb.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_record_find_innodb.test 2009-04-29 16:48:59 +0000
@@ -0,0 +1,46 @@
+#
+# BUG#40045: Replication failure on RBR + no PK + UPDATE + integer key +
+# char with no key
+#
+# BUG#40007: Replication failure with RBR + no PK + 2 indexed fields
+#
+# Test Description
+# ================
+#
+# (see rpl_row_record_find_myisam.test)
+#
+
+source include/master-slave.inc;
+source include/have_binlog_format_row.inc;
+connection master;
+source include/have_innodb.inc;
+connection slave;
+source include/have_innodb.inc;
+connection master;
+
+--echo #################################################################
+--echo # CASE 5: InnoDB - master, MyISAM - slave
+--echo #################################################################
+
+let $master_engine= InnoDB;
+let $slave_engine= MyISAM;
+
+-- source extra/rpl_tests/rpl_row_record_find.test
+
+--echo #################################################################
+--echo # CASE 6: InnoDB - master, InnoDB - slave
+--echo #################################################################
+
+let $master_engine= InnoDB;
+let $slave_engine= InnoDB;
+
+-- source extra/rpl_tests/rpl_row_record_find.test
+
+--echo #################################################################
+--echo # CASE 7: MyISAM - master, InnoDB - slave
+--echo #################################################################
+
+let $master_engine= MyISAM;
+let $slave_engine= InnoDB;
+
+-- source extra/rpl_tests/rpl_row_record_find.test
=== added file 'mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test'
--- a/mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test 2009-04-29 16:48:59 +0000
@@ -0,0 +1,78 @@
+#
+# BUG#40045: Replication failure on RBR + no PK + UPDATE + integer key + char
+# with no key
+#
+# BUG#40007: Replication failure with RBR + no PK + 2 indexed fields
+#
+# TEST DESCRIPTION
+# ================
+#
+# This test is structure in seven cases. In all of them, roughly the same
+# update and delete operations are performed, but what changes are the keys
+# in the table:
+# no keys, one key, composite key (but only half is used in query),
+# unique key, primary key
+#
+# The seven cases are distinct because the engine on both and master and
+# slave varies:
+#
+# - On rpl_row_record_find_myisam.test (this) test file:
+# CASE 1: MyISAM - master, MyISAM - slave
+# test without HA_PARTIAL_COLUMN_READ engine on master and on slave
+#
+# - On rpl_row_record_find_falcon.test:
+# CASE 2: Falcon - master, Falcon - slave
+# test with HA_PARTIAL_COLUMN_READ engine on master and on slave
+# CASE 3: Falcon - master, MyISAM - slave
+# test with HA_PARTIAL_COLUMN_READ engine on master but not on slave
+# CASE 4: MyISAM - master, Falcon - slave
+# test without HA_PARTIAL_COLUMN_READ engine on master but with it on slave
+# (Falcon)
+#
+# - On rpl_row_record_find_innodb.test:
+# CASE 5: InnoDB - master, MyISAM - slave
+# test with HA_PARTIAL_COLUMN_READ engine on master but not on slave
+# (InnoDB)
+# CASE 6: InnoDB - master, InnoDB - slave
+# test with HA_PARTIAL_COLUMN_READ engine on master and on slave
+# (InnoDB)
+# CASE 7: MyISAM - master, InnoDB - slave
+# test without HA_PARTIAL_COLUMN_READ engine on master but with it on slave
+# (InnoDB)
+#
+# NOTE: In this file we also perform a sanity check by running the test
+# cases to verify some of the BUGS.
+
+source include/master-slave.inc;
+source include/have_binlog_format_row.inc;
+connection master;
+
+### SANITY TESTS for BUG#40045 and BUG#40007
+
+# TEST CASE USED for verifying BUG#40045
+CREATE TABLE t1 ( i1 int, c1 char(1), key ( i1 ));
+INSERT IGNORE INTO t1 VALUES (1, 'a');
+UPDATE t1 SET c1 = 'b' WHERE i1 = 1;
+DROP TABLE t1;
+sync_slave_with_master;
+
+# TEST CASE USED for verifying BUG#40007
+connection master;
+CREATE TABLE table1_myisam ( `bit_key` bit, `int_key` int, key (`bit_key` ), key (`int_key` ));
+disable_warnings;
+INSERT IGNORE INTO table1_myisam VALUES ('1', '-2146992385');
+enable_warnings;
+UPDATE `table1_myisam` SET `bit_key` = 0 WHERE `bit_key` = 1;
+DROP TABLE table1_myisam;
+sync_slave_with_master;
+
+connection master;
+
+--echo #################################################################
+--echo # CASE 1: MyISAM - master, MyISAM - slave
+--echo #################################################################
+
+let $master_engine= MyISAM;
+let $slave_engine= MyISAM;
+
+-- source extra/rpl_tests/rpl_row_record_find.test
=== added file 'mysql-test/t/drop_debug.test'
--- a/mysql-test/t/drop_debug.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/drop_debug.test 2009-05-07 11:15:54 +0000
@@ -0,0 +1,38 @@
+#
+# DROP-related tests which execution requires debug server.
+#
+--source include/have_debug.inc
+
+###########################################################################
+--echo
+--echo # --
+--echo # -- Bug#43138: DROP DATABASE failure does not clean up message list.
+--echo # --
+--echo
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysql_test;
+--enable_warnings
+
+--echo
+CREATE DATABASE mysql_test;
+CREATE TABLE mysql_test.t1(a INT);
+CREATE TABLE mysql_test.t2(b INT);
+CREATE TABLE mysql_test.t3(c INT);
+
+--echo
+SET SESSION DEBUG = "+d,bug43138";
+
+--echo
+--sorted_result
+DROP DATABASE mysql_test;
+
+--echo
+SET SESSION DEBUG = "-d,bug43138";
+
+--echo
+--echo # --
+--echo # -- End of Bug#43138.
+--echo # --
+
+###########################################################################
=== modified file 'mysql-test/t/init_file.test'
--- a/mysql-test/t/init_file.test 2009-02-01 09:18:09 +0000
+++ b/mysql-test/t/init_file.test 2009-04-02 11:00:44 +0000
@@ -14,7 +14,7 @@ SELECT * INTO @X FROM init_file.startup
SELECT * INTO @Y FROM init_file.startup limit 1,1;
SELECT YEAR(@X)-YEAR(@Y);
# Enable this DROP DATABASE only after resolving bug #42507
-# DROP DATABASE init_file;
+DROP DATABASE init_file;
--echo ok
--echo end of 4.1 tests
@@ -28,4 +28,9 @@ select * from t1;
# 30, 3, 11, 13
select * from t2;
# Enable this DROP TABLE only after resolving bug #42507
-#drop table t1, t2;
+drop table t1, t2;
+
+# MTR will restart server anyway, but by forcing it we avoid being warned
+# about the apparent side effect
+
+call mtr.force_restart();
=== modified file 'mysql-test/t/log_state.test'
--- a/mysql-test/t/log_state.test 2009-01-26 16:32:29 +0000
+++ b/mysql-test/t/log_state.test 2009-04-01 18:00:07 +0000
@@ -1,16 +1,5 @@
### t/log_state.test ###
#
-# This test suffers from server
-# Bug#38124 "general_log_file" variable silently unset when using expression
-# In short:
-# SET GLOBAL general_log_file = @<whatever>
-# SET GLOBAL slow_query_log = @<whatever>
-# cause that the value of these server system variables is set to default
-# instead of the assigned values. There comes no error message or warning.
-# If this bug is fixed please
-# 1. try this test with "let $fixed_bug38124 = 0;"
-# 2. remove all workarounds if 1. was successful.
-let $fixed_bug38124 = 0;
--source include/not_embedded.inc
--source include/have_csv.inc
@@ -166,16 +155,6 @@ SET @@global.general_log = @old_general_
SET @@global.general_log_file = @old_general_log_file;
SET @@global.slow_query_log = @old_slow_query_log;
SET @@global.slow_query_log_file = @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
- --disable_query_log
- let $my_var = `SELECT @old_general_log_file`;
- eval SET @@global.general_log_file = '$my_var';
- let $my_var = `SELECT @old_slow_query_log_file`;
- eval SET @@global.slow_query_log_file = '$my_var';
- --enable_query_log
-}
-
###########################################################################
@@ -278,15 +257,6 @@ SET GLOBAL slow_query_log_file= NULL;
# Reset to initial values in case a setting above was successful.
SET GLOBAL general_log_file= @old_general_log_file;
SET GLOBAL slow_query_log_file= @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
- --disable_query_log
- let $my_var = `SELECT @old_general_log_file`;
- eval SET @@global.general_log_file = '$my_var';
- let $my_var = `SELECT @old_slow_query_log_file`;
- eval SET @@global.slow_query_log_file = '$my_var';
- --enable_query_log
-}
###########################################################################
@@ -308,15 +278,6 @@ show variables like 'slow_query_log_file
--echo
SET GLOBAL general_log_file = @old_general_log_file;
SET GLOBAL slow_query_log_file = @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
- --disable_query_log
- let $my_var = `SELECT @old_general_log_file`;
- eval SET @@global.general_log_file = '$my_var';
- let $my_var = `SELECT @old_slow_query_log_file`;
- eval SET @@global.slow_query_log_file = '$my_var';
- --enable_query_log
-}
--echo
--echo # -- End of Bug#32748.
@@ -352,19 +313,43 @@ SET @@global.general_log = @old_general_
SET @@global.general_log_file = @old_general_log_file;
SET @@global.slow_query_log = @old_slow_query_log;
SET @@global.slow_query_log_file = @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
- --disable_query_log
- let $my_var = `SELECT @old_general_log_file`;
- eval SET @@global.general_log_file = '$my_var';
- let $my_var = `SELECT @old_slow_query_log_file`;
- eval SET @@global.slow_query_log_file = '$my_var';
- --enable_query_log
-}
-
--echo End of 5.1 tests
+
+###########################################################################
+
+--echo
+--echo # --
+--echo # -- Bug#38124: "general_log_file" variable silently unset when
+--echo # -- using expression
+--echo # --
+
+# Store away the special DEFAULT value so we
+# can compare it later, then try to set the
+# general_log_file using different functions
+# and expressions.
+
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file INTO @my_glf;
+
+SET GLOBAL general_log_file = 'BUG38124.LOG';
+SELECT @@general_log_file;
+
+SET GLOBAL general_log_file = concat('BUG38124-2.LOG');
+SELECT @@general_log_file;
+
+SET GLOBAL general_log_file = substr('BUG38124-2.LOG',3,6);
+SELECT @@general_log_file;
+
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file = @my_glf;
+
+
+## Reset to initial values
+SET GLOBAL general_log_file = @old_general_log_file;
+
+
--enable_ps_protocol
#
@@ -381,17 +366,7 @@ SET global general_log = @old_general_lo
SET global general_log_file = @old_general_log_file;
SET global slow_query_log = @old_slow_query_log;
SET global slow_query_log_file = @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
- --disable_query_log
- let $my_var = `SELECT @old_general_log_file`;
- eval SET @@global.general_log_file = '$my_var';
- let $my_var = `SELECT @old_slow_query_log_file`;
- eval SET @@global.slow_query_log_file = '$my_var';
- --enable_query_log
-}
-# Remove the log files that was created in the "default location"
+# Remove the log file that was created in the "default location"
# i.e var/run
---remove_file $MYSQLTEST_VARDIR/run/mysqld.log
--remove_file $MYSQLTEST_VARDIR/tmp/log.master
=== added file 'mysql-test/t/log_state_bug33693-master.opt'
--- a/mysql-test/t/log_state_bug33693-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/log_state_bug33693-master.opt 2009-04-01 18:00:07 +0000
@@ -0,0 +1 @@
+--pid-file=$MYSQLTEST_VARDIR/run/mysqld.1.pid --log=
=== added file 'mysql-test/t/log_state_bug33693.test'
--- a/mysql-test/t/log_state_bug33693.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/log_state_bug33693.test 2009-04-01 18:00:07 +0000
@@ -0,0 +1,18 @@
+### t/log_state_bug33693.test
+#
+# Regression test for bug #33693
+# "general log name and location depend on PID
+# file, not on predefined values"
+#
+# The server is started with a hard-coded
+# PID file in the $MYSQLTEST_VARDIR/run
+# directory, and an unspecified general log
+# file name.
+#
+# The correct result should show the log file to
+# rest in the database directory. Unfixed, the
+# log file will be in the same directory as the
+# PID.
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT INSTR(@@general_log_file, '$MYSQLTEST_VARDIR/run');
=== modified file 'mysql-test/t/lowercase_table2.test'
--- a/mysql-test/t/lowercase_table2.test 2006-06-06 06:25:31 +0000
+++ b/mysql-test/t/lowercase_table2.test 2009-05-15 08:00:35 +0000
@@ -150,3 +150,76 @@ select TABLE_SCHEMA,TABLE_NAME FROM info
where TABLE_SCHEMA ='mysqltest_LC2';
use test;
drop database mysqltest_LC2;
+
+--echo # End of 5.1 tests
+
+--echo #
+--echo # Test for bug #44738 "fill_schema_table_from_frm() opens tables without
+--echo # lowercasing table name". Due to not properly normalizing table names
+--echo # in lower_case_table_names modes in this function queries to I_S which
+--echo # were executed through it left entries with incorrect key in table
+--echo # definition cache. This issue combined with a similar problem in
+--echo # CREATE TABLE (it also has peeked into table definition cache using
+--echo # non-normalized key) led to spurious ER_TABLE_EXISTS_ERROR errors
+--echo # when one tried to create table with the same name as a previously
+--echo # existing but dropped table.
+--echo #
+--disable_warnings
+drop database if exists mysqltest_UPPERCASE;
+drop table if exists t_bug44738_UPPERCASE;
+--enable_warnings
+create database mysqltest_UPPERCASE;
+use mysqltest_UPPERCASE;
+create table t_bug44738_UPPERCASE (i int);
+--echo # Ensure that we don't have any leftovers in table definition
+--echo # cache from previous tests.
+flush tables;
+--echo # There should be no entries for our table in table definition cache
+show open tables like 't_bug44738_%';
+select table_schema, table_name, table_comment from information_schema.tables
+ where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%';
+--echo # Due to --lower-case-table-names > 0 mode database and table name for
+--echo # TDC entry for our table should be 'normalized' (i.e. lowercased).
+show open tables like 't_bug44738_%';
+drop table t_bug44738_UPPERCASE;
+--echo # After DROP TABLE this entry should be removed.
+show open tables like 't_bug44738_%';
+drop database mysqltest_UPPERCASE;
+use test;
+
+--echo # Let us check that the original test case which led to discovery
+--echo # of this problem also works.
+create table t_bug44738_UPPERCASE (i int);
+select table_schema, table_name, table_comment from information_schema.tables
+ where table_schema = 'test' and table_name like 't_bug44738_%';
+drop table t_bug44738_UPPERCASE;
+--echo # Check that after the above DROP TABLE there are no entries in TDC
+--echo # which correspond to our table.
+show open tables like 't_bug44738_%';
+--echo # Therefore the below statement should succeed.
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;
+
+--echo # Finally, let us check that another issue which was exposed by
+--echo # the original test case is solved. I.e. that fuse in CREATE TABLE
+--echo # which ensures that table is not created if there is an entry for
+--echo # it in TDC even though it was removed from disk uses normalized
+--echo # version of the table name.
+create table t_bug44738_UPPERCASE (i int) engine = myisam;
+--echo # Load table definition in TDC.
+select table_schema, table_name, table_comment from information_schema.tables
+ where table_schema = 'test' and table_name like 't_bug44738_%';
+--echo # Simulate manual removal of the table.
+let $MYSQLD_DATADIR= `select @@datadir`;
+--remove_file $MYSQLD_DATADIR/test/t_bug44738_UPPERCASE.frm
+--remove_file $MYSQLD_DATADIR/test/t_bug44738_UPPERCASE.MYD
+--remove_file $MYSQLD_DATADIR/test/t_bug44738_UPPERCASE.MYI
+--echo # Check that still there is an entry for table in TDC.
+show open tables like 't_bug44738_%';
+--echo # So attempt to create table with the same name should fail.
+--error ER_TABLE_EXISTS_ERROR
+create table t_bug44738_UPPERCASE (i int);
+--echo # And should succeed after FLUSH TABLES.
+flush tables;
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;
=== modified file 'mysql-test/t/myisam-system.test'
--- a/mysql-test/t/myisam-system.test 2007-12-12 17:19:24 +0000
+++ b/mysql-test/t/myisam-system.test 2009-04-30 15:31:30 +0000
@@ -12,11 +12,11 @@ let $MYSQLD_DATADIR= `select @@datadir`;
drop table if exists t1;
create table t1 (a int) engine=myisam;
--remove_file $MYSQLD_DATADIR/test/t1.MYI
---error 1051,6
+--error ER_BAD_TABLE_ERROR,6
drop table t1;
create table t1 (a int) engine=myisam;
--remove_file $MYSQLD_DATADIR/test/t1.MYD
---error 1105,6,29
+--error ER_BAD_TABLE_ERROR,6,29
drop table t1;
---error 1051
+--error ER_BAD_TABLE_ERROR
drop table t1;
=== modified file 'mysql-test/t/mysqlbinlog.test'
--- a/mysql-test/t/mysqlbinlog.test 2009-03-06 20:33:52 +0000
+++ b/mysql-test/t/mysqlbinlog.test 2009-04-21 09:28:48 +0000
@@ -368,3 +368,27 @@ eval SET @@global.server_id= $save_serve
--remove_file $binlog_file
--echo End of 5.1 tests
+
+#
+# BUG#38468 Memory leak detected when using mysqlbinlog utility;
+#
+disable_query_log;
+RESET MASTER;
+CREATE TABLE t1 SELECT 1;
+FLUSH LOGS;
+DROP TABLE t1;
+enable_query_log;
+
+# Write an empty file for comparison
+write_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty;
+EOF
+
+# Before fix of BUG#38468, this would generate some warnings
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 >/dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
+
+# Make sure the command above does not generate any error or warnings
+diff_files $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty;
+
+# Cleanup for this part of test
+remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty;
+remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn;
=== modified file 'mysql-test/t/mysqltest.test'
--- a/mysql-test/t/mysqltest.test 2009-03-06 20:33:52 +0000
+++ b/mysql-test/t/mysqltest.test 2009-04-01 08:16:35 +0000
@@ -1780,6 +1780,56 @@ remove_file $MYSQLTEST_VARDIR/tmp/file2.
--error 1
--exec echo "copy_file from_file;" | $MYSQL_TEST 2>&1
+
+# ----------------------------------------------------------------------------
+# test for move_file
+# ----------------------------------------------------------------------------
+
+# - Check that if source file does not exist, nothing will be created.
+
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file1.tmp;
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file2.tmp;
+--error 1
+move_file $MYSQLTEST_VARDIR/tmp/file1.tmp $MYSQLTEST_VARDIR/tmp/file2.tmp;
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file1.tmp;
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file2.tmp;
+
+# - Check that if source file exists, everything works properly.
+
+--write_file $MYSQLTEST_VARDIR/tmp/file1.tmp
+file1
+EOF
+
+move_file $MYSQLTEST_VARDIR/tmp/file1.tmp $MYSQLTEST_VARDIR/tmp/file2.tmp;
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file1.tmp;
+file_exists $MYSQLTEST_VARDIR/tmp/file2.tmp;
+
+# - Check that if destination file exists, everything works properly.
+# (file2.tmp exists from the previous check; file1.tmp needs to be created)
+
+--write_file $MYSQLTEST_VARDIR/tmp/file1.tmp
+file1
+EOF
+
+move_file $MYSQLTEST_VARDIR/tmp/file1.tmp $MYSQLTEST_VARDIR/tmp/file2.tmp;
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file1.tmp;
+file_exists $MYSQLTEST_VARDIR/tmp/file2.tmp;
+remove_file $MYSQLTEST_VARDIR/tmp/file2.tmp;
+
+# - Check usage.
+
+--error 1
+--exec echo "move_file ;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "move_file from_file;" | $MYSQL_TEST 2>&1
+
# ----------------------------------------------------------------------------
# test for chmod
# ----------------------------------------------------------------------------
=== modified file 'mysql-test/t/parser.test'
--- a/mysql-test/t/parser.test 2009-04-17 20:33:59 +0000
+++ b/mysql-test/t/parser.test 2009-05-11 17:58:07 +0000
@@ -754,6 +754,10 @@ UPDATE t3 SET a4={d '1789-07-14'} WHERE
SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
DROP TABLE t1, t2, t3;
+--echo #
+--echo # End of 5.1 tests
+--echo #
+
#
# Bug#31765 (BACKUP DATABASE broken syntax)
#
@@ -764,6 +768,46 @@ BACKUP DATABASE *, test to 'broken.bak';
--error ER_PARSE_ERROR
BACKUP DATABASE *, db1, db2, db3 to 'broken.bak';
---echo #
---echo # End of 5.1 tests
---echo #
+#
+# Bug#31293 - Incorrect parser errors for create/alter/drop logfile group/tablespace
+#
+
+--echo # Should use myisam
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create logfile group ndb_lg1 add undofile 'ndb_undo1' initial_size=32M;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create logfile group ndb_lg1 add undofile 'ndb_undo1';
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam initial_size=32M;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1;
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' wait;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter logfile group ndb_lg1 add undofile 'ndb_undo1';
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' initial_size=32M;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat';
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop logfile group ndb_lg1 engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop logfile group ndb_lg1;
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop tablespace ndb_ts1 engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop tablespace ndb_ts1;
=== modified file 'mysql-test/t/plugin.test'
--- a/mysql-test/t/plugin.test 2009-04-22 22:12:25 +0000
+++ b/mysql-test/t/plugin.test 2009-05-04 15:49:30 +0000
@@ -21,6 +21,12 @@ SELECT * FROM t1;
DROP TABLE t1;
+# a couple of tests for variables
+set global example_ulong_var=500;
+set global example_enum_var= e1;
+show status like 'example%';
+show variables like 'example%';
+
UNINSTALL PLUGIN example;
--error 1305
UNINSTALL PLUGIN EXAMPLE;
=== modified file 'mysys/default.c'
--- a/mysys/default.c 2009-03-24 14:24:44 +0000
+++ b/mysys/default.c 2009-04-23 10:06:29 +0000
@@ -41,6 +41,29 @@
#include <winbase.h>
#endif
+/**
+ arguments separator
+
+ load_defaults() loads arguments from config file and put them
+ before the arguments from command line, this separator is used to
+ separate the arguments loaded from config file and arguments user
+ provided on command line.
+
+ Options with value loaded from config file are always in the form
+ '--option=value', while for command line options, the value can be
+ given as the next argument. Thus we used a separator so that
+ handle_options() can distinguish them.
+
+ Note: any other places that does not need to distinguish them
+ should skip the separator.
+
+ The content of arguments separator does not matter, one should only
+ check the pointer, use "----args-separator----" here to ease debug
+ if someone misused it.
+
+ See BUG#25192
+*/
+const char *args_separator= "----args-separator----";
const char *my_defaults_file=0;
const char *my_defaults_group_suffix=0;
char *my_defaults_extra_file=0;
@@ -454,10 +477,11 @@ int my_load_defaults(const char *conf_fi
goto err;
res= (char**) (ptr+sizeof(alloc));
res[0]= **argv; /* Copy program name */
+ /* set arguments separator */
+ res[1]= (char *)args_separator;
for (i=2 ; i < (uint) *argc ; i++)
- res[i-1]=argv[0][i];
- res[i-1]=0; /* End pointer */
- (*argc)--;
+ res[i]=argv[0][i];
+ res[i]=0; /* End pointer */
*argv=res;
*(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */
if (default_directories)
@@ -487,7 +511,7 @@ int my_load_defaults(const char *conf_fi
or a forced default file
*/
if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+
- (args.elements + *argc +1) *sizeof(char*))))
+ (args.elements + *argc + 1 + 1) *sizeof(char*))))
goto err;
res= (char**) (ptr+sizeof(alloc));
@@ -508,12 +532,16 @@ int my_load_defaults(const char *conf_fi
--*argc; ++*argv; /* skip argument */
}
+ /* set arguments separator for arguments from config file and
+ command line */
+ res[args.elements+1]= (char *)args_separator;
+
if (*argc)
- memcpy((uchar*) (res+1+args.elements), (char*) ((*argv)+1),
+ memcpy((uchar*) (res+1+args.elements+1), (char*) ((*argv)+1),
(*argc-1)*sizeof(char*));
- res[args.elements+ *argc]=0; /* last null */
+ res[args.elements+ *argc+1]=0; /* last null */
- (*argc)+=args.elements;
+ (*argc)+=args.elements+1;
*argv= (char**) res;
*(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */
delete_dynamic(&args);
@@ -523,7 +551,8 @@ int my_load_defaults(const char *conf_fi
printf("%s would have been started with the following arguments:\n",
**argv);
for (i=1 ; i < *argc ; i++)
- printf("%s ", (*argv)[i]);
+ if ((*argv)[i] != args_separator) /* skip arguments separator */
+ printf("%s ", (*argv)[i]);
puts("");
exit(0);
}
=== removed file 'mysys/make-ccc'
--- a/mysys/make-ccc 2006-09-15 05:29:44 +0000
+++ b/mysys/make-ccc 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
-rm -f .deps/* raid.o mf_iocache.o libmysys.a
-ccc -DDEFAULT_BASEDIR="\"/usr/local/mysql\"" -DDATADIR="\"/usr/local/mysql/var\"" -DHAVE_CONFIG_H -I./../include -I../include -I.. -DDBUG_OFF -fast -O3 -fomit-frame-pointer -c array.c checksum.c default.c errors.c getopt.c getopt1.c getvar.c hash.c list.c mf_brkhant.c mf_cache.c mf_casecnv.c mf_dirname.c mf_fn_ext.c mf_format.c mf_getdate.c mf_keycache.c mf_loadpath.c mf_pack.c mf_pack2.c mf_path.c mf_qsort.c mf_qsort2.c mf_radix.c mf_reccache.c mf_same.c mf_sort.c mf_soundex.c mf_stripp.c mf_unixpath.c mf_wcomp.c mf_wfile.c mulalloc.c my_alarm.c my_alloc.c my_append.c my_chsize.c my_clock.c my_compress.c my_copy.c my_create.c my_delete.c my_div.c my_error.c my_fopen.c my_fstream.c my_getwd.c my_init.c my_lib.c my_lockmem.c my_malloc.c my_messnc.c my_mkdir.c my_net.c my_once.c my_open.c my_pread.c my_pthread.c my_quick.c my_read.c my_realloc.c my_redel.c my_rename.c my_seek.c my_static.c my_tempnam.c my_thr_init.c my_write.c ptr_cmp.c queues.c safemalloc.c string.c thr_alar!
m.c thr_l
-make raid.o mf_iocache.o my_lock.o
-ar -cr libmysys.a array.o raid.o mf_iocache.o my_lock.o
=== modified file 'mysys/my_getopt.c'
--- a/mysys/my_getopt.c 2009-05-07 20:48:24 +0000
+++ b/mysys/my_getopt.c 2009-05-14 08:56:34 +0000
@@ -27,23 +27,15 @@ typedef void (*init_func_p)(const struct
static void default_reporter(enum loglevel level, const char *format, ...);
my_error_reporter my_getopt_error_reporter= &default_reporter;
-static int findopt(char *optpat, uint length,
- const struct my_option **opt_res,
- char **ffname);
-my_bool getopt_compare_strings(const char *s,
- const char *t,
- uint length);
-static longlong getopt_ll(char *arg, const struct my_option *optp, int *err);
-static ulonglong getopt_ull(char *arg, const struct my_option *optp,
- int *err);
-static double getopt_double(char *arg, const struct my_option *optp, int *err);
-static void init_variables(const struct my_option *options,
- init_func_p init_one_value);
-static void init_one_value(const struct my_option *opt, uchar* *, longlong);
-static void fini_one_value(const struct my_option *option, uchar* *variable,
- longlong value);
-static int setval(const struct my_option *opts, uchar **value, char *argument,
- my_bool set_maximum_value);
+static int findopt(char *, uint, const struct my_option **, char **);
+my_bool getopt_compare_strings(const char *, const char *, uint);
+static longlong getopt_ll(char *, const struct my_option *, int *);
+static ulonglong getopt_ull(char *, const struct my_option *, int *);
+static double getopt_double(char *, const struct my_option *, int *);
+static void init_variables(const struct my_option *, init_func_p);
+static void init_one_value(const struct my_option *opt, uchar **, longlong);
+static void fini_one_value(const struct my_option *, uchar **, longlong);
+static int setval(const struct my_option *, uchar **, char *, my_bool);
static char *check_struct_option(char *cur_arg, char *key_name);
/*
@@ -119,6 +111,7 @@ int handle_options(int *argc, char ***ar
const struct my_option *optp;
uchar* *value;
int error, i;
+ my_bool is_cmdline_arg= 1;
LINT_INIT(opt_found);
/* handle_options() assumes arg0 (program name) always exists */
@@ -128,10 +121,34 @@ int handle_options(int *argc, char ***ar
(*argv)++; /* --- || ---- */
init_variables(longopts, init_one_value);
+ /*
+ Search for args_separator, if found, then the first part of the
+ arguments are loaded from configs
+ */
+ for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++)
+ {
+ if (*pos == args_separator)
+ {
+ is_cmdline_arg= 0;
+ break;
+ }
+ }
+
for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++)
{
char **first= pos;
char *cur_arg= *pos;
+ if (!is_cmdline_arg && (cur_arg == args_separator))
+ {
+ is_cmdline_arg= 1;
+
+ /* save the separator too if skip unkown options */
+ if (my_getopt_skip_unknown)
+ (*argv)[argvpos++]= cur_arg;
+ else
+ (*argc)--;
+ continue;
+ }
if (cur_arg[0] == '-' && cur_arg[1] && !end_of_options) /* must be opt */
{
char *argument= 0;
@@ -423,8 +440,12 @@ invalid value '%s'",
}
else if (optp->arg_type == REQUIRED_ARG && !optend)
{
- /* Check if there are more arguments after this one */
- if (!*++pos)
+ /* Check if there are more arguments after this one,
+
+ Note: options loaded from config file that requires value
+ should always be in the form '--option=value'.
+ */
+ if (!is_cmdline_arg || !*++pos)
{
if (my_getopt_print_errors)
my_getopt_error_reporter(ERROR_LEVEL,
=== modified file 'mysys/my_getsystime.c'
--- a/mysys/my_getsystime.c 2008-05-29 15:44:11 +0000
+++ b/mysys/my_getsystime.c 2009-05-14 21:49:53 +0000
@@ -150,7 +150,7 @@ ulonglong my_micro_time()
Value in microseconds from some undefined point in time
*/
-#define DELTA_FOR_SECONDS LL(500000000) /* Half a second */
+#define DELTA_FOR_SECONDS 500000000LL /* Half a second */
ulonglong my_micro_time_and_time(time_t *time_arg)
{
=== modified file 'mysys/my_pthread.c'
--- a/mysys/my_pthread.c 2008-12-04 21:02:09 +0000
+++ b/mysys/my_pthread.c 2009-04-06 18:36:46 +0000
@@ -494,11 +494,6 @@ int my_pthread_mutex_trylock(pthread_mut
/* Some help functions */
-int pthread_no_free(void *not_used __attribute__((unused)))
-{
- return 0;
-}
-
int pthread_dummy(int ret)
{
return ret;
=== modified file 'mysys/typelib.c'
--- a/mysys/typelib.c 2008-03-27 18:40:00 +0000
+++ b/mysys/typelib.c 2009-05-14 21:49:53 +0000
@@ -185,7 +185,7 @@ my_ulonglong find_typeset(char *x, TYPEL
while (*x && *x != field_separator) x++;
if ((find= find_type(i, lib, 2 | 8) - 1) < 0)
DBUG_RETURN(0);
- result|= (ULL(1) << find);
+ result|= (1ULL << find);
}
*err= 0;
DBUG_RETURN(result);
=== modified file 'mysys/waiting_threads.c'
--- a/mysys/waiting_threads.c 2009-02-23 11:55:35 +0000
+++ b/mysys/waiting_threads.c 2009-05-14 21:49:53 +0000
@@ -1072,7 +1072,7 @@ int wt_thd_cond_timedwait(WT_THD *thd, p
ret= WT_OK;
rc_unlock(rc);
- set_timespec_time_nsec(timeout, starttime, (*thd->timeout_short)*ULL(1000));
+ set_timespec_time_nsec(timeout, starttime, (*thd->timeout_short)*1000ULL);
if (ret == WT_TIMEOUT && !thd->killed)
ret= pthread_cond_timedwait(&rc->cond, mutex, &timeout);
if (ret == WT_TIMEOUT && !thd->killed)
@@ -1084,7 +1084,7 @@ int wt_thd_cond_timedwait(WT_THD *thd, p
ret= WT_DEADLOCK;
else if (*thd->timeout_long > *thd->timeout_short)
{
- set_timespec_time_nsec(timeout, starttime, (*thd->timeout_long)*ULL(1000));
+ set_timespec_time_nsec(timeout, starttime, (*thd->timeout_long)*1000ULL);
if (!thd->killed)
ret= pthread_cond_timedwait(&rc->cond, mutex, &timeout);
}
=== modified file 'plugin/daemon_example/Makefile.am'
--- a/plugin/daemon_example/Makefile.am 2009-01-07 10:58:33 +0000
+++ b/plugin/daemon_example/Makefile.am 2009-04-25 21:20:45 +0000
@@ -26,7 +26,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
EXTRA_LTLIBRARIES = libdaemon_example.la
pkgplugin_LTLIBRARIES = @plugin_daemon_example_shared_target@
-libdaemon_example_la_LDFLAGS = -module -rpath $(pkgplugindir)
+libdaemon_example_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
libdaemon_example_la_CPPFLAGS= $(AM_CPPFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libdaemon_example_la_SOURCES = daemon_example.cc
=== removed file 'regex/make-ccc'
--- a/regex/make-ccc 2000-07-31 19:29:14 +0000
+++ b/regex/make-ccc 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
-ccc -DHAVE_CONFIG_H -I. -I. -I.. -I./../include -I../include -O -DDBUG_OFF -fast -O3 -c regerror.c regcomp.c regexec.c regfree.c reginit.c
-rm libregex.a
-ar -cr libregex.a regerror.o
=== modified file 'scripts/mysqld_safe.sh'
--- a/scripts/mysqld_safe.sh 2009-03-18 21:59:44 +0000
+++ b/scripts/mysqld_safe.sh 2009-05-05 11:36:02 +0000
@@ -155,7 +155,13 @@ parse_arguments() {
fi
for arg do
- val=`echo "$arg" | sed -e "s;--[^=]*=;;"`
+ # the parameter after "=", or the whole $arg if no match
+ val=`echo "$arg" | sed -e 's;^--[^=]*=;;'`
+ # what's before "=", or the whole $arg if no match
+ optname=`echo "$arg" | sed -e 's/^\(--[^=]*\)=.*$/\1/'`
+ # replace "_" by "-" ; mysqld_safe must accept "_" like mysqld does.
+ optname_subst=`echo "$optname" | sed 's/_/-/g'`
+ arg=`echo $arg | sed "s/^$optname/$optname_subst/"`
case "$arg" in
# these get passed explicitly to mysqld
--basedir=*) MY_BASEDIR_VERSION="$val" ;;
=== modified file 'sql-common/client.c'
--- a/sql-common/client.c 2009-03-19 16:42:23 +0000
+++ b/sql-common/client.c 2009-04-21 09:27:46 +0000
@@ -1135,6 +1135,8 @@ void mysql_read_default_options(struct s
char **option=argv;
while (*++option)
{
+ if (option[0] == args_separator) /* skip arguments separator */
+ continue;
/* DBUG_PRINT("info",("option: %s",option[0])); */
if (option[0][0] == '-' && option[0][1] == '-')
{
=== modified file 'sql-common/my_time.c'
--- a/sql-common/my_time.c 2009-02-13 18:07:03 +0000
+++ b/sql-common/my_time.c 2009-05-14 21:49:53 +0000
@@ -22,10 +22,10 @@
ulonglong log_10_int[20]=
{
1, 10, 100, 1000, 10000UL, 100000UL, 1000000UL, 10000000UL,
- ULL(100000000), ULL(1000000000), ULL(10000000000), ULL(100000000000),
- ULL(1000000000000), ULL(10000000000000), ULL(100000000000000),
- ULL(1000000000000000), ULL(10000000000000000), ULL(100000000000000000),
- ULL(1000000000000000000), ULL(10000000000000000000)
+ 100000000ULL, 1000000000ULL, 10000000000ULL, 100000000000ULL,
+ 1000000000000ULL, 10000000000000ULL, 100000000000000ULL,
+ 1000000000000000ULL, 10000000000000000ULL, 100000000000000000ULL,
+ 1000000000000000000ULL, 10000000000000000000ULL
};
@@ -1120,7 +1120,7 @@ longlong number_to_datetime(longlong nr,
bzero((char*) time_res, sizeof(*time_res));
time_res->time_type=MYSQL_TIMESTAMP_DATE;
- if (nr == LL(0) || nr >= LL(10000101000000))
+ if (nr == 0LL || nr >= 10000101000000LL)
{
time_res->time_type=MYSQL_TIMESTAMP_DATETIME;
goto ok;
@@ -1151,19 +1151,19 @@ longlong number_to_datetime(longlong nr,
time_res->time_type=MYSQL_TIMESTAMP_DATETIME;
- if (nr <= (YY_PART_YEAR-1)*LL(10000000000)+LL(1231235959))
+ if (nr <= (YY_PART_YEAR-1)*10000000000LL+1231235959LL)
{
- nr= nr+LL(20000000000000); /* YYMMDDHHMMSS, 2000-2069 */
+ nr= nr+20000000000000LL; /* YYMMDDHHMMSS, 2000-2069 */
goto ok;
}
- if (nr < YY_PART_YEAR*LL(10000000000)+ LL(101000000))
+ if (nr < YY_PART_YEAR*10000000000LL+ 101000000LL)
goto err;
- if (nr <= LL(991231235959))
- nr= nr+LL(19000000000000); /* YYMMDDHHMMSS, 1970-1999 */
+ if (nr <= 991231235959LL)
+ nr= nr+19000000000000LL; /* YYMMDDHHMMSS, 1970-1999 */
ok:
- part1=(long) (nr/LL(1000000));
- part2=(long) (nr - (longlong) part1*LL(1000000));
+ part1=(long) (nr/1000000LL);
+ part2=(long) (nr - (longlong) part1*1000000LL);
time_res->year= (int) (part1/10000L); part1%=10000L;
time_res->month= (int) part1 / 100;
time_res->day= (int) part1 % 100;
@@ -1179,11 +1179,11 @@ longlong number_to_datetime(longlong nr,
/* Don't want to have was_cut get set if NO_ZERO_DATE was violated. */
if (!nr && (flags & TIME_NO_ZERO_DATE))
- return LL(-1);
+ return -1LL;
err:
*was_cut= 1;
- return LL(-1);
+ return -1LL;
}
@@ -1193,7 +1193,7 @@ ulonglong TIME_to_ulonglong_datetime(con
{
return ((ulonglong) (my_time->year * 10000UL +
my_time->month * 100UL +
- my_time->day) * ULL(1000000) +
+ my_time->day) * 1000000ULL +
(ulonglong) (my_time->hour * 10000UL +
my_time->minute * 100UL +
my_time->second));
@@ -1254,7 +1254,7 @@ ulonglong TIME_to_ulonglong(const MYSQL_
return TIME_to_ulonglong_time(my_time);
case MYSQL_TIMESTAMP_NONE:
case MYSQL_TIMESTAMP_ERROR:
- return ULL(0);
+ return 0ULL;
default:
DBUG_ASSERT(0);
}
=== modified file 'sql-common/pack.c'
--- a/sql-common/pack.c 2007-08-13 13:11:25 +0000
+++ b/sql-common/pack.c 2009-05-14 21:49:53 +0000
@@ -87,8 +87,6 @@ my_ulonglong net_field_length_ll(uchar *
NOTES
This is mostly used to store lengths of strings.
- We have to cast the result for the LL() becasue of a bug in Forte CC
- compiler.
RETURN
Position in 'pkg' after the packed length
@@ -96,19 +94,19 @@ my_ulonglong net_field_length_ll(uchar *
uchar *net_store_length(uchar *packet, ulonglong length)
{
- if (length < (ulonglong) LL(251))
+ if (length < 251ULL)
{
*packet=(uchar) length;
return packet+1;
}
/* 251 is reserved for NULL */
- if (length < (ulonglong) LL(65536))
+ if (length < 65536ULL)
{
*packet++=252;
int2store(packet,(uint) length);
return packet+2;
}
- if (length < (ulonglong) LL(16777216))
+ if (length < 16777216ULL)
{
*packet++=253;
int3store(packet,(ulong) length);
=== modified file 'sql/CMakeLists.txt'
--- a/sql/CMakeLists.txt 2009-04-20 17:08:21 +0000
+++ b/sql/CMakeLists.txt 2009-05-04 20:51:05 +0000
@@ -47,7 +47,7 @@ SET (SQL_SOURCE
../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
filesort.cc gstream.cc sha2.cc ha_partition.cc
- handler.cc hash_filo.cc hash_filo.h
+ handler.cc hash_filo.cc hash_filo.h sql_plugin_services.h
hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc
item_create.cc item_func.cc item_geofunc.cc item_row.cc
item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc
=== modified file 'sql/Makefile.am'
--- a/sql/Makefile.am 2009-04-02 16:14:14 +0000
+++ b/sql/Makefile.am 2009-05-04 20:51:05 +0000
@@ -1,245 +1,245 @@
-# Copyright (C) 2000-2006 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
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-#called from the top level Makefile
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(pkglibdir)/plugin
-AM_CPPFLAGS = @ZLIB_INCLUDES@ \
- -I$(top_srcdir)/include \
- -I$(top_srcdir)/regex $(openssl_includes) \
- $(libevent_includes)
-WRAPLIBS= @WRAPLIBS@
-SUBDIRS = share backup
-libexec_PROGRAMS = mysqld
-EXTRA_PROGRAMS = gen_lex_hash
-bin_PROGRAMS = mysql_tzinfo_to_sql
-DTRACE = @DTRACE@
-DTRACEFLAGS = @DTRACEFLAGS@
-DTRACEFILES = filesort.o \
- handler.o \
- mysqld.o \
- net_serv.o \
- scheduler.o \
- sp_head.o \
- sql_cache.o \
- sql_connect.o \
- sql_cursor.o \
- sql_delete.o \
- sql_insert.o \
- sql_parse.o \
- sql_prepare.o \
- sql_select.o \
- sql_update.o
-
-noinst_LTLIBRARIES= libndb.la \
- udf_example.la
-
-SUPPORTING_LIBS = $(top_builddir)/vio/libvio.a \
- $(top_builddir)/mysys/libmysyswrap.la \
- $(top_builddir)/mysys/libmysyslt.la \
- $(top_builddir)/dbug/libdbuglt.la \
- $(top_builddir)/regex/libregex.a \
- $(top_builddir)/strings/libmystringsextra.la \
- $(top_builddir)/strings/libmystringslt.la
-mysqld_DEPENDENCIES= @mysql_plugin_libs@ $(SUPPORTING_LIBS) backup/libbackup.la libndb.la
-LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@
-mysqld_LDADD = libndb.la \
- @MYSQLD_EXTRA_LDFLAGS@ \
- @pstack_libs@ $(libevent_libs) \
- @mysql_plugin_libs@ \
- $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \
- $(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@ \
- backup/libbackup.la
-
-noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
- item_strfunc.h item_timefunc.h \
- item_xmlfunc.h \
- item_create.h item_subselect.h item_row.h \
- mysql_priv.h item_geofunc.h sql_bitmap.h \
- procedure.h sql_class.h sql_lex.h sql_list.h \
- sql_map.h sql_string.h unireg.h \
- sql_error.h field.h handler.h mysqld_suffix.h \
- sql_profile.h \
- ha_ndbcluster.h ha_ndbcluster_cond.h \
- ha_ndbcluster_binlog.h ha_ndbcluster_tables.h \
- ha_ndbcluster_connection.h ha_ndbcluster_connection.h \
- ha_ndbcluster_lock_ext.h \
- ha_partition.h rpl_constants.h \
- debug_sync.h \
- opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \
- rpl_reporting.h \
- log.h sql_show.h rpl_info.h \
- rpl_rli.h rpl_rli_file.h rpl_mi.h rpl_mi_file.h \
- sql_select.h structs.h table.h sql_udf.h hash_filo.h \
- lex.h lex_symbol.h sql_acl.h sql_crypt.h \
- sql_repl.h slave.h rpl_filter.h rpl_injector.h \
- log_event.h rpl_record.h \
- log_event_old.h rpl_record_old.h \
- sql_sort.h sql_cache.h set_var.h \
- spatial.h gstream.h client_settings.h tzfile.h \
- tztime.h my_decimal.h\
- sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
- parse_file.h sql_view.h sql_trigger.h \
- sql_array.h sql_cursor.h events.h scheduler.h \
- event_db_repository.h event_queue.h \
- sql_plugin.h authors.h event_parse_data.h \
- event_data_objects.h event_scheduler.h \
- sql_partition.h partition_info.h partition_element.h \
- probes.h sql_audit.h transaction.h \
- contributors.h sql_servers.h bml.h \
- si_objects.h si_logs.h sql_plist.h mdl.h records.h \
- sql_signal.h \
- rpl_handler.h replication.h sql_prepare.h debug_sync.h
-
-mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
- item.cc item_sum.cc item_buff.cc item_func.cc \
- item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
- thr_malloc.cc item_create.cc item_subselect.cc \
- item_row.cc item_geofunc.cc item_xmlfunc.cc \
- field.cc strfunc.cc key.cc sql_class.cc sql_list.cc \
- net_serv.cc protocol.cc sql_state.c \
- lock.cc my_lock.c \
- sql_string.cc sql_manager.cc sql_map.cc \
- mysqld.cc password.c hash_filo.cc hostname.cc \
- sql_connect.cc scheduler.cc sql_parse.cc \
- set_var.cc sql_yacc.yy \
- sql_join_cache.cc \
- sql_base.cc table.cc sql_select.cc sql_insert.cc \
- sql_profile.cc \
- sql_prepare.cc sql_error.cc sql_locale.cc \
- sql_update.cc sql_delete.cc uniques.cc sql_do.cc \
- procedure.cc sql_test.cc \
- log.cc init.cc derror.cc sql_acl.cc \
- unireg.cc des_key_file.cc \
- log_event.cc rpl_record.cc \
- log_event_old.cc rpl_record_old.cc \
- discover.cc time.cc opt_range.cc opt_sum.cc \
- records.cc filesort.cc handler.cc \
- ha_partition.cc \
- debug_sync.cc \
- sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc \
- sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
- sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
- slave.cc sql_repl.cc rpl_filter.cc rpl_tblmap.cc \
- rpl_utility.cc rpl_injector.cc rpl_rli.cc rpl_mi.cc \
- rpl_info.cc rpl_rli_file.cc rpl_mi_file.cc \
- rpl_reporting.cc \
- sql_union.cc sql_derived.cc \
- sql_client.cc \
- repl_failsafe.h repl_failsafe.cc \
- sql_olap.cc sql_view.cc \
- gstream.cc spatial.cc sql_help.cc sql_cursor.cc \
- tztime.cc my_decimal.cc\
- sp_head.cc sp_pcontext.cc sp_rcontext.cc sp.cc \
- sp_cache.cc parse_file.cc sql_trigger.cc \
- event_scheduler.cc event_data_objects.cc \
- event_queue.cc event_db_repository.cc events.cc \
- sql_plugin.cc sql_binlog.cc \
- sql_builtin.cc sql_tablespace.cc partition_info.cc \
- sql_servers.cc sql_audit.cc sha2.cc \
- bml.cc si_objects.cc si_logs.cc \
- event_parse_data.cc mdl.cc transaction.cc \
- sql_signal.cc \
- rpl_handler.cc
-
-if HAVE_DTRACE
- mysqld_SOURCES += probes.d
-endif
-
-nodist_mysqld_SOURCES = mini_client_errors.c pack.c client.c my_time.c my_user.c
-
-libndb_la_CPPFLAGS= @ndbcluster_includes@ $(AM_CPPFLAGS)
-libndb_la_SOURCES= ha_ndbcluster.cc \
- ha_ndbcluster_binlog.cc \
- ha_ndbcluster_connection.cc \
- ha_ndbcluster_cond.cc
-
-gen_lex_hash_SOURCES = gen_lex_hash.cc
-gen_lex_hash_LDFLAGS = @NOINST_LDFLAGS@
-
-mysql_tzinfo_to_sql_SOURCES = tztime.cc
-mysql_tzinfo_to_sql_CXXFLAGS= -DTZINFO2SQL
-
-DEFS = -DMYSQL_SERVER \
- -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
- -DDATADIR="\"$(MYSQLDATAdir)\"" \
- -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
- -DPLUGINDIR="\"$(pkgplugindir)\"" \
- -DHAVE_EVENT_SCHEDULER \
- @DEFS@
-
-BUILT_MAINT_SRC = sql_yacc.cc sql_yacc.h
-BUILT_SOURCES = $(BUILT_MAINT_SRC) lex_hash.h link_sources
-EXTRA_DIST = udf_example.c udf_example.def $(BUILT_MAINT_SRC) \
- nt_servc.cc nt_servc.h CMakeLists.txt \
- probes.d \
- message.mc message.h message.rc MSG00001.bin \
- nt_servc.cc nt_servc.h \
- CMakeLists.txt
-
-CLEANFILES = lex_hash.h sql_yacc.output link_sources
-DISTCLEANFILES = $(EXTRA_PROGRAMS)
-MAINTAINERCLEANFILES = $(BUILT_MAINT_SRC)
-AM_YFLAGS = -d --verbose
-
-# These are listed in 'nodist_mysqld_SOURCES'
-link_sources:
- rm -f mini_client_errors.c
- @LN_CP_F@ $(top_srcdir)/libmysql/errmsg.c mini_client_errors.c
- rm -f pack.c
- @LN_CP_F@ $(top_srcdir)/sql-common/pack.c pack.c
- rm -f client.c
- @LN_CP_F@ $(top_srcdir)/sql-common/client.c client.c
- rm -f my_time.c
- @LN_CP_F@ $(top_srcdir)/sql-common/my_time.c my_time.c
- rm -f my_user.c
- @LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c
- echo timestamp > link_sources
-
-# This generates lex_hash.h
-# NOTE Built sources should depend on their sources not the tool
-# this avoid the rebuild of the built files in a source dist
-lex_hash.h: gen_lex_hash.cc lex.h
- $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT)
- ./gen_lex_hash$(EXEEXT) > $@-t
- $(MV) $@-t $@
-
-# For testing of udf_example.so
-udf_example_la_SOURCES= udf_example.c
-udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
-
-probes.h: probes.d
- $(DTRACE) $(DTRACEFLAGS) -h -s probes.d
- mv probes.h probes.h.bak
- sed "s/#include <unistd.h>//g" probes.h.bak > probes.h
- rm probes.h.bak
-
-# We might have some stuff not built in this build, but that we want to install
-install-exec-hook:
- $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(pkglibdir)
- test ! -x mysqld-debug$(EXEEXT) || $(INSTALL_PROGRAM) mysqld-debug$(EXEEXT) $(DESTDIR)$(libexecdir)
- test ! -f mysqld-debug.sym.gz || $(INSTALL_DATA) mysqld-debug.sym.gz $(DESTDIR)$(pkglibdir)
- test ! -f mysqld.sym.gz || $(INSTALL_DATA) mysqld.sym.gz $(DESTDIR)$(pkglibdir)
-
-SUFFIXES : .d
-
-.d.o :
- $(DTRACE) $(DTRACEFLAGS) -G -s $< $(DTRACEFILES)
-
-probes.o : $(DTRACEFILES)
+# Copyright (C) 2000-2006 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+#called from the top level Makefile
+
+MYSQLDATAdir = $(localstatedir)
+MYSQLSHAREdir = $(pkgdatadir)
+MYSQLBASEdir= $(prefix)
+MYSQLLIBdir= $(pkglibdir)
+pkgplugindir = $(pkglibdir)/plugin
+AM_CPPFLAGS = @ZLIB_INCLUDES@ \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/regex $(openssl_includes) \
+ $(libevent_includes)
+WRAPLIBS= @WRAPLIBS@
+SUBDIRS = share backup
+libexec_PROGRAMS = mysqld
+EXTRA_PROGRAMS = gen_lex_hash
+bin_PROGRAMS = mysql_tzinfo_to_sql
+DTRACE = @DTRACE@
+DTRACEFLAGS = @DTRACEFLAGS@
+DTRACEFILES = filesort.o \
+ handler.o \
+ mysqld.o \
+ net_serv.o \
+ scheduler.o \
+ sp_head.o \
+ sql_cache.o \
+ sql_connect.o \
+ sql_cursor.o \
+ sql_delete.o \
+ sql_insert.o \
+ sql_parse.o \
+ sql_prepare.o \
+ sql_select.o \
+ sql_update.o
+
+noinst_LTLIBRARIES= libndb.la \
+ udf_example.la
+
+SUPPORTING_LIBS = $(top_builddir)/vio/libvio.a \
+ $(top_builddir)/mysys/libmysyswrap.la \
+ $(top_builddir)/mysys/libmysyslt.la \
+ $(top_builddir)/dbug/libdbuglt.la \
+ $(top_builddir)/regex/libregex.a \
+ $(top_builddir)/strings/libmystringsextra.la \
+ $(top_builddir)/strings/libmystringslt.la
+mysqld_DEPENDENCIES= @mysql_plugin_libs@ $(SUPPORTING_LIBS) backup/libbackup.la libndb.la
+LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@
+mysqld_LDADD = libndb.la \
+ @MYSQLD_EXTRA_LDFLAGS@ \
+ @pstack_libs@ $(libevent_libs) \
+ @mysql_plugin_libs@ \
+ $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \
+ $(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@ \
+ backup/libbackup.la
+
+noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
+ item_strfunc.h item_timefunc.h \
+ item_xmlfunc.h sql_plugin_services.h \
+ item_create.h item_subselect.h item_row.h \
+ mysql_priv.h item_geofunc.h sql_bitmap.h \
+ procedure.h sql_class.h sql_lex.h sql_list.h \
+ sql_map.h sql_string.h unireg.h \
+ sql_error.h field.h handler.h mysqld_suffix.h \
+ sql_profile.h \
+ ha_ndbcluster.h ha_ndbcluster_cond.h \
+ ha_ndbcluster_binlog.h ha_ndbcluster_tables.h \
+ ha_ndbcluster_connection.h ha_ndbcluster_connection.h \
+ ha_ndbcluster_lock_ext.h \
+ ha_partition.h rpl_constants.h \
+ debug_sync.h \
+ opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \
+ rpl_reporting.h \
+ log.h sql_show.h rpl_info.h \
+ rpl_rli.h rpl_rli_file.h rpl_mi.h rpl_mi_file.h \
+ sql_select.h structs.h table.h sql_udf.h hash_filo.h \
+ lex.h lex_symbol.h sql_acl.h sql_crypt.h \
+ sql_repl.h slave.h rpl_filter.h rpl_injector.h \
+ log_event.h rpl_record.h \
+ log_event_old.h rpl_record_old.h \
+ sql_sort.h sql_cache.h set_var.h \
+ spatial.h gstream.h client_settings.h tzfile.h \
+ tztime.h my_decimal.h\
+ sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
+ parse_file.h sql_view.h sql_trigger.h \
+ sql_array.h sql_cursor.h events.h scheduler.h \
+ event_db_repository.h event_queue.h \
+ sql_plugin.h authors.h event_parse_data.h \
+ event_data_objects.h event_scheduler.h \
+ sql_partition.h partition_info.h partition_element.h \
+ probes.h sql_audit.h transaction.h \
+ contributors.h sql_servers.h bml.h \
+ si_objects.h si_logs.h sql_plist.h mdl.h records.h \
+ sql_signal.h \
+ rpl_handler.h replication.h sql_prepare.h debug_sync.h
+
+mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
+ item.cc item_sum.cc item_buff.cc item_func.cc \
+ item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
+ thr_malloc.cc item_create.cc item_subselect.cc \
+ item_row.cc item_geofunc.cc item_xmlfunc.cc \
+ field.cc strfunc.cc key.cc sql_class.cc sql_list.cc \
+ net_serv.cc protocol.cc sql_state.c \
+ lock.cc my_lock.c \
+ sql_string.cc sql_manager.cc sql_map.cc \
+ mysqld.cc password.c hash_filo.cc hostname.cc \
+ sql_connect.cc scheduler.cc sql_parse.cc \
+ set_var.cc sql_yacc.yy \
+ sql_join_cache.cc \
+ sql_base.cc table.cc sql_select.cc sql_insert.cc \
+ sql_profile.cc \
+ sql_prepare.cc sql_error.cc sql_locale.cc \
+ sql_update.cc sql_delete.cc uniques.cc sql_do.cc \
+ procedure.cc sql_test.cc \
+ log.cc init.cc derror.cc sql_acl.cc \
+ unireg.cc des_key_file.cc \
+ log_event.cc rpl_record.cc \
+ log_event_old.cc rpl_record_old.cc \
+ discover.cc time.cc opt_range.cc opt_sum.cc \
+ records.cc filesort.cc handler.cc \
+ ha_partition.cc \
+ debug_sync.cc \
+ sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc \
+ sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
+ sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
+ slave.cc sql_repl.cc rpl_filter.cc rpl_tblmap.cc \
+ rpl_utility.cc rpl_injector.cc rpl_rli.cc rpl_mi.cc \
+ rpl_info.cc rpl_rli_file.cc rpl_mi_file.cc \
+ rpl_reporting.cc \
+ sql_union.cc sql_derived.cc \
+ sql_client.cc \
+ repl_failsafe.h repl_failsafe.cc \
+ sql_olap.cc sql_view.cc \
+ gstream.cc spatial.cc sql_help.cc sql_cursor.cc \
+ tztime.cc my_decimal.cc\
+ sp_head.cc sp_pcontext.cc sp_rcontext.cc sp.cc \
+ sp_cache.cc parse_file.cc sql_trigger.cc \
+ event_scheduler.cc event_data_objects.cc \
+ event_queue.cc event_db_repository.cc events.cc \
+ sql_plugin.cc sql_binlog.cc \
+ sql_builtin.cc sql_tablespace.cc partition_info.cc \
+ sql_servers.cc sql_audit.cc sha2.cc \
+ bml.cc si_objects.cc si_logs.cc \
+ event_parse_data.cc mdl.cc transaction.cc \
+ sql_signal.cc \
+ rpl_handler.cc
+
+if HAVE_DTRACE
+ mysqld_SOURCES += probes.d
+endif
+
+nodist_mysqld_SOURCES = mini_client_errors.c pack.c client.c my_time.c my_user.c
+
+libndb_la_CPPFLAGS= @ndbcluster_includes@ $(AM_CPPFLAGS)
+libndb_la_SOURCES= ha_ndbcluster.cc \
+ ha_ndbcluster_binlog.cc \
+ ha_ndbcluster_connection.cc \
+ ha_ndbcluster_cond.cc
+
+gen_lex_hash_SOURCES = gen_lex_hash.cc
+gen_lex_hash_LDFLAGS = @NOINST_LDFLAGS@
+
+mysql_tzinfo_to_sql_SOURCES = tztime.cc
+mysql_tzinfo_to_sql_CXXFLAGS= -DTZINFO2SQL
+
+DEFS = -DMYSQL_SERVER \
+ -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
+ -DDATADIR="\"$(MYSQLDATAdir)\"" \
+ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
+ -DPLUGINDIR="\"$(pkgplugindir)\"" \
+ -DHAVE_EVENT_SCHEDULER \
+ @DEFS@
+
+BUILT_MAINT_SRC = sql_yacc.cc sql_yacc.h
+BUILT_SOURCES = $(BUILT_MAINT_SRC) lex_hash.h link_sources
+EXTRA_DIST = udf_example.c udf_example.def $(BUILT_MAINT_SRC) \
+ nt_servc.cc nt_servc.h CMakeLists.txt \
+ probes.d \
+ message.mc message.h message.rc MSG00001.bin \
+ nt_servc.cc nt_servc.h \
+ CMakeLists.txt
+
+CLEANFILES = lex_hash.h sql_yacc.output link_sources
+DISTCLEANFILES = $(EXTRA_PROGRAMS)
+MAINTAINERCLEANFILES = $(BUILT_MAINT_SRC)
+AM_YFLAGS = -d --verbose
+
+# These are listed in 'nodist_mysqld_SOURCES'
+link_sources:
+ rm -f mini_client_errors.c
+ @LN_CP_F@ $(top_srcdir)/libmysql/errmsg.c mini_client_errors.c
+ rm -f pack.c
+ @LN_CP_F@ $(top_srcdir)/sql-common/pack.c pack.c
+ rm -f client.c
+ @LN_CP_F@ $(top_srcdir)/sql-common/client.c client.c
+ rm -f my_time.c
+ @LN_CP_F@ $(top_srcdir)/sql-common/my_time.c my_time.c
+ rm -f my_user.c
+ @LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c
+ echo timestamp > link_sources
+
+# This generates lex_hash.h
+# NOTE Built sources should depend on their sources not the tool
+# this avoid the rebuild of the built files in a source dist
+lex_hash.h: gen_lex_hash.cc lex.h
+ $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT)
+ ./gen_lex_hash$(EXEEXT) > $@-t
+ $(MV) $@-t $@
+
+# For testing of udf_example.so
+udf_example_la_SOURCES= udf_example.c
+udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
+
+probes.h: probes.d
+ $(DTRACE) $(DTRACEFLAGS) -h -s probes.d
+ mv probes.h probes.h.bak
+ sed "s/#include <unistd.h>//g" probes.h.bak > probes.h
+ rm probes.h.bak
+
+# We might have some stuff not built in this build, but that we want to install
+install-exec-hook:
+ $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(pkglibdir)
+ test ! -x mysqld-debug$(EXEEXT) || $(INSTALL_PROGRAM) mysqld-debug$(EXEEXT) $(DESTDIR)$(libexecdir)
+ test ! -f mysqld-debug.sym.gz || $(INSTALL_DATA) mysqld-debug.sym.gz $(DESTDIR)$(pkglibdir)
+ test ! -f mysqld.sym.gz || $(INSTALL_DATA) mysqld.sym.gz $(DESTDIR)$(pkglibdir)
+
+SUFFIXES : .d
+
+.d.o :
+ $(DTRACE) $(DTRACEFLAGS) -G -s $< $(DTRACEFILES)
+
+probes.o : $(DTRACEFILES)
=== modified file 'sql/field.cc'
--- a/sql/field.cc 2009-04-09 09:51:50 +0000
+++ b/sql/field.cc 2009-05-14 21:49:53 +0000
@@ -54,7 +54,7 @@ const char field_separator=',';
#define LONGLONG_TO_STRING_CONVERSION_BUFFER_SIZE 128
#define DECIMAL_TO_STRING_CONVERSION_BUFFER_SIZE 128
#define BLOB_PACK_LENGTH_TO_MAX_LENGH(arg) \
-((ulong) ((LL(1) << min(arg, 4) * 8) - LL(1)))
+((ulong) ((1LL << min(arg, 4) * 8) - 1LL))
#define ASSERT_COLUMN_MARKED_FOR_READ DBUG_ASSERT(!table || (!table->read_set || bitmap_is_set(table->read_set, field_index)))
#define ASSERT_COLUMN_MARKED_FOR_WRITE DBUG_ASSERT(!table || (!table->write_set || bitmap_is_set(table->write_set, field_index)))
@@ -3637,7 +3637,7 @@ int Field_long::store(longlong nr, bool
res=0;
error= 1;
}
- else if ((ulonglong) nr >= (LL(1) << 32))
+ else if ((ulonglong) nr >= (1LL << 32))
{
res=(int32) (uint32) ~0L;
error= 1;
@@ -4775,7 +4775,7 @@ int Field_timestamp::store(longlong nr,
longlong tmp= number_to_datetime(nr, &l_time, (thd->variables.sql_mode &
MODE_NO_ZERO_DATE) |
MODE_NO_ZERO_IN_DATE, &error);
- if (tmp == LL(-1))
+ if (tmp == -1LL)
{
error= 2;
}
@@ -4831,7 +4831,7 @@ longlong Field_timestamp::val_int(void)
thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, (my_time_t)temp);
- return time_tmp.year * LL(10000000000) + time_tmp.month * LL(100000000) +
+ return time_tmp.year * 10000000000LL + time_tmp.month * 100000000LL +
time_tmp.day * 1000000L + time_tmp.hour * 10000L +
time_tmp.minute * 100 + time_tmp.second;
}
@@ -5434,7 +5434,7 @@ int Field_date::store(double nr)
nr=floor(nr/1000000.0); // Timestamp to date
if (nr < 0.0 || nr > 99991231.0)
{
- tmp= LL(0);
+ tmp= 0LL;
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_OUT_OF_RANGE,
nr, MYSQL_TIMESTAMP_DATE);
@@ -5460,7 +5460,7 @@ int Field_date::store(longlong nr, bool
MODE_NO_ZERO_DATE |
MODE_INVALID_DATES))), &error);
- if (nr == LL(-1))
+ if (nr == -1LL)
{
nr= 0;
error= 2;
@@ -5687,7 +5687,7 @@ int Field_newdate::store(longlong nr, bo
(thd->variables.sql_mode &
(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
MODE_INVALID_DATES))),
- &error) == LL(-1))
+ &error) == -1LL)
{
tmp= 0L;
error= 2;
@@ -5925,7 +5925,7 @@ int Field_datetime::store(longlong nr, b
MODE_NO_ZERO_DATE |
MODE_INVALID_DATES))), &error);
- if (nr == LL(-1))
+ if (nr == -1LL)
{
nr= 0;
error= 2;
@@ -5961,7 +5961,7 @@ int Field_datetime::store_time(MYSQL_TIM
if (time_type == MYSQL_TIMESTAMP_DATE ||
time_type == MYSQL_TIMESTAMP_DATETIME)
{
- tmp=((ltime->year*10000L+ltime->month*100+ltime->day)*LL(1000000)+
+ tmp=((ltime->year*10000L+ltime->month*100+ltime->day)*1000000LL+
(ltime->hour*10000L+ltime->minute*100+ltime->second));
if (check_date(ltime, tmp != 0,
(TIME_FUZZY_DATE |
@@ -6043,8 +6043,8 @@ String *Field_datetime::val_str(String *
Avoid problem with slow longlong arithmetic and sprintf
*/
- part1=(long) (tmp/LL(1000000));
- part2=(long) (tmp - (ulonglong) part1*LL(1000000));
+ part1=(long) (tmp/1000000LL);
+ part2=(long) (tmp - (ulonglong) part1*1000000LL);
pos=(char*) val_buffer->ptr() + MAX_DATETIME_WIDTH;
*pos--=0;
@@ -6074,8 +6074,8 @@ bool Field_datetime::get_date(MYSQL_TIME
{
longlong tmp=Field_datetime::val_int();
uint32 part1,part2;
- part1=(uint32) (tmp/LL(1000000));
- part2=(uint32) (tmp - (ulonglong) part1*LL(1000000));
+ part1=(uint32) (tmp/1000000LL);
+ part2=(uint32) (tmp - (ulonglong) part1*1000000LL);
ltime->time_type= MYSQL_TIMESTAMP_DATETIME;
ltime->neg= 0;
=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc 2009-04-01 21:36:07 +0000
+++ b/sql/ha_partition.cc 2009-04-25 21:24:53 +0000
@@ -1174,7 +1174,7 @@ bool ha_partition::check_and_repair(THD
/**
- @breif Check if the table can be automatically repaired
+ Check if the table can be automatically repaired
@retval TRUE Can be auto repaired
@retval FALSE Cannot be auto repaired
@@ -1193,7 +1193,7 @@ bool ha_partition::auto_repair() const
/**
- @breif Check if the table is crashed
+ Check if the table is crashed
@retval TRUE Crashed
@retval FALSE Not crashed
=== modified file 'sql/handler.h'
--- a/sql/handler.h 2009-03-28 00:27:25 +0000
+++ b/sql/handler.h 2009-05-14 21:49:53 +0000
@@ -168,21 +168,21 @@ typedef Bitmap<HA_MAX_ALTER_FLAGS> HA_AL
#define HA_NO_VARCHAR (1 << 27)
#define HA_CAN_BIT_FIELD (1 << 28) /* supports bit fields */
#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
-#define HA_NO_COPY_ON_ALTER (LL(1) << 31)
-#define HA_HAS_RECORDS (LL(1) << 32) /* records() gives exact count*/
+#define HA_NO_COPY_ON_ALTER (1LL << 31)
+#define HA_HAS_RECORDS (1LL << 32) /* records() gives exact count*/
/* Has it's own method of binlog logging */
-#define HA_HAS_OWN_BINLOGGING (LL(1) << 33)
+#define HA_HAS_OWN_BINLOGGING (1LL << 33)
/*
Engine is capable of row-format and statement-format logging,
respectively
*/
-#define HA_BINLOG_ROW_CAPABLE (LL(1) << 35)
-#define HA_BINLOG_STMT_CAPABLE (LL(1) << 36)
+#define HA_BINLOG_ROW_CAPABLE (1LL << 35)
+#define HA_BINLOG_STMT_CAPABLE (1LL << 36)
-#define HA_ONLINE_ALTER (LL(1) << 37)
-#define HA_CAN_READ_ORDER_IF_LIMIT (LL(1) << 38)
+#define HA_ONLINE_ALTER (1LL << 37)
+#define HA_CAN_READ_ORDER_IF_LIMIT (1LL << 38)
/* Has automatic checksums and uses the new checksum format */
-#define HA_HAS_NEW_CHECKSUM (LL(1) << 39)
+#define HA_HAS_NEW_CHECKSUM (1LL << 39)
/*
When a multiple key conflict happens in a REPLACE command mysql
@@ -206,7 +206,7 @@ typedef Bitmap<HA_MAX_ALTER_FLAGS> HA_AL
This flag helps the underlying SE to inform the server that the keys are not
ordered.
*/
-#define HA_DUPLICATE_KEY_NOT_IN_ORDER (LL(1) << 40)
+#define HA_DUPLICATE_KEY_NOT_IN_ORDER (1LL << 40)
/*
Set of all binlog flags. Currently only contain the capabilities
=== modified file 'sql/item.cc'
--- a/sql/item.cc 2009-05-07 20:48:24 +0000
+++ b/sql/item.cc 2009-05-14 21:49:53 +0000
@@ -954,7 +954,7 @@ bool Item::get_date(MYSQL_TIME *ltime,ui
{
longlong value= val_int();
int was_cut;
- if (number_to_datetime(value, ltime, fuzzydate, &was_cut) == LL(-1))
+ if (number_to_datetime(value, ltime, fuzzydate, &was_cut) == -1LL)
{
char buff[22], *end;
end= longlong10_to_str(value, buff, -10);
=== modified file 'sql/item.h'
--- a/sql/item.h 2009-05-07 20:48:24 +0000
+++ b/sql/item.h 2009-05-14 21:49:53 +0000
@@ -2564,7 +2564,7 @@ public:
longlong val_int()
{
int err;
- return null_value ? LL(0) : my_strntoll(str_value.charset(),str_value.ptr(),
+ return null_value ? 0LL : my_strntoll(str_value.charset(),str_value.ptr(),
str_value.length(),10, (char**) 0,
&err);
}
=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc 2009-04-14 21:36:40 +0000
+++ b/sql/item_cmpfunc.cc 2009-05-07 14:10:24 +0000
@@ -157,7 +157,7 @@ static int agg_cmp_type(Item_result *typ
@brief Aggregates field types from the array of items.
@param[in] items array of items to aggregate the type from
- @paran[in] nitems number of items in the array
+ @param[in] nitems number of items in the array
@details This function aggregates field types from the array of items.
Found type is supposed to be used later as the result field type
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc 2009-05-07 20:48:24 +0000
+++ b/sql/item_func.cc 2009-05-14 21:49:53 +0000
@@ -1802,7 +1802,7 @@ longlong Item_func_shift_left::val_int()
return 0;
}
null_value=0;
- return (shift < sizeof(longlong)*8 ? (longlong) res : LL(0));
+ return (shift < sizeof(longlong)*8 ? (longlong) res : 0LL);
}
longlong Item_func_shift_right::val_int()
@@ -1817,7 +1817,7 @@ longlong Item_func_shift_right::val_int(
return 0;
}
null_value=0;
- return (shift < sizeof(longlong)*8 ? (longlong) res : LL(0));
+ return (shift < sizeof(longlong)*8 ? (longlong) res : 0LL);
}
@@ -2733,7 +2733,7 @@ void Item_func_find_in_set::fix_length_a
find->length(), 0);
enum_bit=0;
if (enum_value)
- enum_bit=LL(1) << (enum_value-1);
+ enum_bit=1LL << (enum_value-1);
}
}
}
@@ -2803,7 +2803,7 @@ longlong Item_func_find_in_set::val_int(
wc == (my_wc_t) separator)
return (longlong) ++position;
else
- return LL(0);
+ return 0LL;
}
}
return 0;
@@ -3517,7 +3517,7 @@ void debug_sync_point(const char* lock_n
@retval return value from pthread_cond_timedwait
*/
-#define INTERRUPT_INTERVAL (5 * ULL(1000000000))
+#define INTERRUPT_INTERVAL (5 * 1000000000ULL)
static int interruptible_wait(THD *thd, pthread_cond_t *cond,
pthread_mutex_t *lock, double time)
@@ -4151,7 +4151,7 @@ double user_var_entry::val_real(my_bool
longlong user_var_entry::val_int(my_bool *null_value) const
{
if ((*null_value= (value == 0)))
- return LL(0);
+ return 0LL;
switch (type) {
case REAL_RESULT:
@@ -4176,7 +4176,7 @@ longlong user_var_entry::val_int(my_bool
default:
break;
}
- return LL(0); // Impossible
+ return 0LL; // Impossible
}
@@ -4628,7 +4628,7 @@ longlong Item_func_get_user_var::val_int
{
DBUG_ASSERT(fixed == 1);
if (!var_entry)
- return LL(0); // No such variable
+ return 0LL; // No such variable
return (var_entry->val_int(&null_value));
}
=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc 2009-05-07 20:48:24 +0000
+++ b/sql/item_strfunc.cc 2009-05-14 21:49:53 +0000
@@ -3288,7 +3288,7 @@ String* Item_func_inet_ntoa::val_str(Str
Also return null if n > 255.255.255.255
*/
- if ((null_value= (args[0]->null_value || n > (ulonglong) LL(4294967295))))
+ if ((null_value= (args[0]->null_value || n > 4294967295ULL)))
return 0; // Null value
str->length(0);
=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc 2009-03-11 12:52:04 +0000
+++ b/sql/item_sum.cc 2009-05-14 21:49:53 +0000
@@ -2765,7 +2765,7 @@ longlong Item_sum_count_distinct::val_in
int error;
DBUG_ASSERT(fixed == 1);
if (!table) // Empty query
- return LL(0);
+ return 0LL;
if (tree)
{
if (is_evaluated)
=== modified file 'sql/item_sum.h'
--- a/sql/item_sum.h 2008-12-10 09:02:11 +0000
+++ b/sql/item_sum.h 2009-05-14 21:49:53 +0000
@@ -930,7 +930,7 @@ public:
class Item_sum_or :public Item_sum_bit
{
public:
- Item_sum_or(Item *item_par) :Item_sum_bit(item_par,LL(0)) {}
+ Item_sum_or(Item *item_par) :Item_sum_bit(item_par,0LL) {}
Item_sum_or(THD *thd, Item_sum_or *item) :Item_sum_bit(thd, item) {}
bool add();
const char *func_name() const { return "bit_or("; }
@@ -951,7 +951,7 @@ class Item_sum_and :public Item_sum_bit
class Item_sum_xor :public Item_sum_bit
{
public:
- Item_sum_xor(Item *item_par) :Item_sum_bit(item_par,LL(0)) {}
+ Item_sum_xor(Item *item_par) :Item_sum_bit(item_par,0LL) {}
Item_sum_xor(THD *thd, Item_sum_xor *item) :Item_sum_bit(thd, item) {}
bool add();
const char *func_name() const { return "bit_xor("; }
=== modified file 'sql/item_timefunc.cc'
--- a/sql/item_timefunc.cc 2009-04-14 21:36:40 +0000
+++ b/sql/item_timefunc.cc 2009-05-14 21:49:53 +0000
@@ -880,7 +880,7 @@ static bool get_interval_info(const char
longlong value;
const char *start= str;
for (value=0; str != end && my_isdigit(cs,*str) ; str++)
- value= value*LL(10) + (longlong) (*str - '0');
+ value= value*10LL + (longlong) (*str - '0');
msec_length= 6 - (str - start);
values[i]= value;
while (str != end && !my_isdigit(cs,*str))
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2009-05-07 20:48:24 +0000
+++ b/sql/log.cc 2009-05-14 08:56:34 +0000
@@ -55,7 +55,7 @@ LOGGER logger;
MYSQL_BIN_LOG mysql_bin_log(&sync_binlog_period);
static bool test_if_number(const char *str,
- long *res, bool allow_wildcards);
+ ulong *res, bool allow_wildcards);
static int binlog_init(void *p);
static int binlog_close_connection(handlerton *hton, THD *thd);
static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv);
@@ -65,6 +65,35 @@ static int binlog_rollback(handlerton *h
static int binlog_prepare(handlerton *hton, THD *thd, bool all);
/**
+ purge logs, master and slave sides both, related error code
+ convertor.
+ Called from @c purge_error_message(), @c MYSQL_BIN_LOG::reset_logs()
+
+ @param res an internal to purging routines error code
+
+ @return the user level error code ER_*
+*/
+uint purge_log_get_error_code(int res)
+{
+ uint errcode= 0;
+
+ switch (res) {
+ case 0: break;
+ case LOG_INFO_EOF: errcode= ER_UNKNOWN_TARGET_BINLOG; break;
+ case LOG_INFO_IO: errcode= ER_IO_ERR_LOG_INDEX_READ; break;
+ case LOG_INFO_INVALID:errcode= ER_BINLOG_PURGE_PROHIBITED; break;
+ case LOG_INFO_SEEK: errcode= ER_FSEEK_FAIL; break;
+ case LOG_INFO_MEM: errcode= ER_OUT_OF_RESOURCES; break;
+ case LOG_INFO_FATAL: errcode= ER_BINLOG_PURGE_FATAL_ERR; break;
+ case LOG_INFO_IN_USE: errcode= ER_LOG_IN_USE; break;
+ case LOG_INFO_EMFILE: errcode= ER_BINLOG_PURGE_EMFILE; break;
+ default: errcode= ER_LOG_PURGE_UNKNOWN_ERR; break;
+ }
+
+ return errcode;
+}
+
+/**
Silence all errors and warnings reported when performing a write
to a log table.
Errors and warnings are not reported to the client or SQL exception
@@ -119,9 +148,16 @@ sql_print_message_func sql_print_message
};
+/**
+ Create the name of the default general log file
+
+ @param[IN] buff Location for building new string.
+ @param[IN] log_ext The extension for the file (e.g .log)
+ @returns Pointer to a new string containing the name
+*/
char *make_default_log_name(char *buff,const char* log_ext)
{
- strmake(buff, pidfile_name, FN_REFLEN-5);
+ strmake(buff, default_logfile_name, FN_REFLEN-5);
return fn_format(buff, buff, mysql_data_home, log_ext,
MYF(MY_UNPACK_FILENAME|MY_REPLACE_EXT));
}
@@ -2963,22 +2999,27 @@ static void setup_windows_event_source()
/**
Find a unique filename for 'filename.#'.
- Set '#' to a number as low as possible.
+ Set '#' to the number next to the maximum found in the most
+ recent log file extension.
+
+ This function will return nonzero if: (i) the generated name
+ exceeds FN_REFLEN; (ii) if the number of extensions is exhausted;
+ or (iii) some other error happened while examining the filesystem.
@return
- nonzero if not possible to get unique filename
+ nonzero if not possible to get unique filename.
*/
static int find_uniq_filename(char *name)
{
- long number;
uint i;
- char buff[FN_REFLEN];
+ char buff[FN_REFLEN], ext_buf[FN_REFLEN];
struct st_my_dir *dir_info;
reg1 struct fileinfo *file_info;
- ulong max_found=0;
+ ulong max_found= 0, next= 0, number= 0;
size_t buf_length, length;
char *start, *end;
+ int error= 0;
DBUG_ENTER("find_uniq_filename");
length= dirname_part(buff, name, &buf_length);
@@ -2986,15 +3027,15 @@ static int find_uniq_filename(char *name
end= strend(start);
*end='.';
- length= (size_t) (end-start+1);
+ length= (size_t) (end - start + 1);
- if (!(dir_info = my_dir(buff,MYF(MY_DONT_SORT))))
+ if (!(dir_info= my_dir(buff,MYF(MY_DONT_SORT))))
{ // This shouldn't happen
strmov(end,".1"); // use name+1
- DBUG_RETURN(0);
+ DBUG_RETURN(1);
}
file_info= dir_info->dir_entry;
- for (i=dir_info->number_off_files ; i-- ; file_info++)
+ for (i= dir_info->number_off_files ; i-- ; file_info++)
{
if (bcmp((uchar*) file_info->name, (uchar*) start, length) == 0 &&
test_if_number(file_info->name+length, &number,0))
@@ -3004,9 +3045,44 @@ static int find_uniq_filename(char *name
}
my_dirend(dir_info);
+ /* check if reached the maximum possible extension number */
+ if ((max_found == MAX_LOG_UNIQUE_FN_EXT))
+ {
+ sql_print_error("Log filename extension number exhausted: %06lu. \
+Please fix this by archiving old logs and \
+updating the index files.", max_found);
+ error= 1;
+ goto end;
+ }
+
+ next= max_found + 1;
+ sprintf(ext_buf, "%06lu", next);
*end++='.';
- sprintf(end,"%06ld",max_found+1);
- DBUG_RETURN(0);
+
+ /*
+ Check if the generated extension size + the file name exceeds the
+ buffer size used. If one did not check this, then the filename might be
+ truncated, resulting in error.
+ */
+ if (((strlen(ext_buf) + (end - name)) >= FN_REFLEN))
+ {
+ sql_print_error("Log filename too large: %s%s (%lu). \
+Please fix this by archiving old logs and updating the \
+index files.", name, ext_buf, (strlen(ext_buf) + (end - name)));
+ error= 1;
+ goto end;
+ }
+
+ sprintf(end, "%06lu", next);
+
+ /* print warning if reaching the end of available extensions. */
+ if ((next > (MAX_LOG_UNIQUE_FN_EXT - LOG_WARN_UNIQUE_FN_EXT_LEFT)))
+ sql_print_warning("Next log extension: %lu. \
+Remaining log filename extensions: %lu. \
+Please consider archiving some logs.", next, (MAX_LOG_UNIQUE_FN_EXT - next));
+
+end:
+ DBUG_RETURN(error);
}
@@ -3205,6 +3281,13 @@ int MYSQL_LOG::generate_new_name(char *n
{
if (find_uniq_filename(new_name))
{
+ /*
+ The warning below should turn into error once propagation of return
+ value, further up in the stack, gets proper handling.
+ */
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_NO_UNIQUE_LOGFILE, ER(ER_NO_UNIQUE_LOGFILE),
+ log_name);
sql_print_error(ER(ER_NO_UNIQUE_LOGFILE), log_name);
return 1;
}
@@ -4498,8 +4581,10 @@ int MYSQL_BIN_LOG::find_log_pos(LOG_INFO
{
uint length;
my_off_t offset= my_b_tell(&index_file);
- /* If we get 0 or 1 characters, this is the end of the file */
+ DBUG_EXECUTE_IF("simulate_find_log_pos_error",
+ error= LOG_INFO_EOF; break;);
+ /* If we get 0 or 1 characters, this is the end of the file */
if ((length= my_b_gets(&index_file, fname, FN_REFLEN)) <= 1)
{
/* Did not find the given entry; Return not found or error */
@@ -4601,6 +4686,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
{
LOG_INFO linfo;
bool error=0;
+ int err;
const char* save_name;
DBUG_ENTER("reset_logs");
@@ -4631,9 +4717,12 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
/* First delete all old log files */
- if (find_log_pos(&linfo, NullS, 0))
+ if ((err= find_log_pos(&linfo, NullS, 0)) != 0)
{
- error=1;
+ uint errcode= purge_log_get_error_code(err);
+ sql_print_error("Failed to locate old binlog or relay log files");
+ my_message(errcode, ER(errcode), MYF(0));
+ error= 1;
goto err;
}
@@ -4702,6 +4791,8 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
my_free((uchar*) save_name, MYF(0));
err:
+ if (error == 1)
+ name= const_cast<char*>(save_name);
pthread_mutex_unlock(&LOCK_thread_count);
pthread_mutex_unlock(&LOCK_index);
pthread_mutex_unlock(&LOCK_log);
@@ -6472,11 +6563,11 @@ void MYSQL_BIN_LOG::set_max_size(ulong m
@retval
1 String is a number
@retval
- 0 Error
+ 0 String is not a number
*/
static bool test_if_number(register const char *str,
- long *res, bool allow_wildcards)
+ ulong *res, bool allow_wildcards)
{
reg2 int flag;
const char *start;
=== modified file 'sql/log.h'
--- a/sql/log.h 2009-01-26 16:32:29 +0000
+++ b/sql/log.h 2009-04-24 12:55:11 +0000
@@ -166,6 +166,19 @@ extern TC_LOG_DUMMY tc_log_dummy;
#define LOG_CLOSE_TO_BE_OPENED 2
#define LOG_CLOSE_STOP_EVENT 4
+/*
+ Maximum unique log filename extension.
+ Note: setting to 0x7FFFFFFF due to atol windows
+ overflow/truncate.
+ */
+#define MAX_LOG_UNIQUE_FN_EXT 0x7FFFFFFF
+
+/*
+ Number of warnings that will be printed to error log
+ before extension number is exhausted.
+*/
+#define LOG_WARN_UNIQUE_FN_EXT_LEFT 1000
+
class Relay_log_info;
typedef struct st_log_info
@@ -813,4 +826,6 @@ enum enum_binlog_format {
};
extern TYPELIB binlog_format_typelib;
+uint purge_log_get_error_code(int res);
+
#endif /* LOG_H */
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2009-05-07 20:48:24 +0000
+++ b/sql/log_event.cc 2009-05-13 16:04:01 +0000
@@ -8461,15 +8461,16 @@ Rows_log_event::write_row(const Relay_lo
values filled in and one flag to handle the case that the default
values should be checked. Maybe these two flags can be combined.
*/
+ bool abort_on_warnings= (rli->info_thd->variables.sql_mode &
+ (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES));
if ((error= prepare_record(table, &m_cols, m_width,
table->file->ht->db_type != DB_TYPE_NDBCLUSTER,
- (rli->info_thd->variables.sql_mode &
- (MODE_STRICT_TRANS_TABLES |
- MODE_STRICT_ALL_TABLES)))))
+ abort_on_warnings, m_curr_row == m_rows_buf)))
DBUG_RETURN(error);
/* unpack row into table->record[0] */
- error= unpack_current_row(rli, &m_cols);
+ if ((error= unpack_current_row(rli, &m_cols, abort_on_warnings)))
+ DBUG_RETURN(error);
// Temporary fix to find out why it fails [/Matz]
memcpy(m_table->write_set->bitmap, m_cols.bitmap, (m_table->write_set->n_bits + 7) / 8);
@@ -8695,7 +8696,7 @@ void Write_rows_log_event::print(FILE *f
Returns TRUE if different.
*/
-static bool record_compare(TABLE *table)
+static bool record_compare(TABLE *table, const MY_BITMAP *cols_in_readset)
{
/*
Need to set the X bit and the filler bits in both records since
@@ -8727,14 +8728,23 @@ static bool record_compare(TABLE *table)
}
}
- if (table->s->blob_fields + table->s->varchar_fields == 0)
+ /*
+ We can compare the record straight away if:
+ i) there are no blob and varchar fields
+ ii) all columns were read or the slave SE provides partial reads
+ */
+ if ((table->s->blob_fields + table->s->varchar_fields == 0) &&
+ (bitmap_is_set_all(cols_in_readset) ||
+ (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ)))
{
result= cmp_record(table,record[1]);
goto record_compare_exit;
}
- /* Compare null bits */
- if (memcmp(table->null_flags,
+ /* Compare null bits only if all fields were read or slave SE has partial reads */
+ if ((bitmap_is_set_all(cols_in_readset) ||
+ (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ)) &&
+ memcmp(table->null_flags,
table->null_flags+table->s->rec_buff_length,
table->s->null_bytes))
{
@@ -8745,10 +8755,14 @@ static bool record_compare(TABLE *table)
/* Compare updated fields */
for (Field **ptr=table->field ; *ptr ; ptr++)
{
- if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length))
- {
- result= TRUE;
- goto record_compare_exit;
+ /* compare field if it is set */
+ if (bitmap_is_set(cols_in_readset, (*ptr)->field_index))
+ {
+ if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length))
+ {
+ result= TRUE;
+ goto record_compare_exit;
+ }
}
}
@@ -8959,7 +8973,7 @@ int Rows_log_event::find_row(const Relay
*/
DBUG_PRINT("info",("non-unique index, scanning it to find matching record"));
- while (record_compare(table))
+ while (record_compare(table, &m_cols))
{
/*
We need to set the null bytes to ensure that the filler bit
@@ -9040,7 +9054,7 @@ int Rows_log_event::find_row(const Relay
goto err;
}
}
- while (restart_count < 2 && record_compare(table));
+ while (restart_count < 2 && record_compare(table, &m_cols));
/*
Note: above record_compare will take into accout all record fields
@@ -9273,8 +9287,12 @@ Update_rows_log_event::do_exec_row(const
store_record(m_table,record[1]);
+ bool abort_on_warnings= (rli->info_thd->variables.sql_mode &
+ (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES));
m_curr_row= m_curr_row_end;
- error= unpack_current_row(rli, &m_cols_ai); // this also updates m_curr_row_end
+ /* this also updates m_curr_row_end */
+ if ((error= unpack_current_row(rli, &m_cols_ai, abort_on_warnings)))
+ return error;
/*
Now we have the right row to update. The old row (the one we're
=== modified file 'sql/log_event.h'
--- a/sql/log_event.h 2009-04-08 23:46:45 +0000
+++ b/sql/log_event.h 2009-05-14 21:49:53 +0000
@@ -510,7 +510,7 @@ struct sql_ex_info
/* Shouldn't be defined before */
#define EXPECTED_OPTIONS \
- ((ULL(1) << 14) | (ULL(1) << 26) | (ULL(1) << 27) | (ULL(1) << 19))
+ ((1ULL << 14) | (1ULL << 26) | (1ULL << 27) | (1ULL << 19))
#if OPTIONS_WRITTEN_TO_BIN_LOG != EXPECTED_OPTIONS
#error OPTIONS_WRITTEN_TO_BIN_LOG must NOT change their values!
@@ -3564,12 +3564,16 @@ protected:
// Unpack the current row into m_table->record[0]
int unpack_current_row(const Relay_log_info *const rli,
- MY_BITMAP const *cols)
+ MY_BITMAP const *cols,
+ const bool abort_on_warning= TRUE)
{
DBUG_ASSERT(m_table);
+
+ bool first_row= (m_curr_row == m_rows_buf);
ASSERT_OR_RETURN_ERROR(m_curr_row < m_rows_end, HA_ERR_CORRUPT_EVENT);
int const result= ::unpack_row(rli, m_table, m_width, m_curr_row, cols,
- &m_curr_row_end, &m_master_reclength, TRUE);
+ &m_curr_row_end, &m_master_reclength, TRUE,
+ abort_on_warning, first_row);
if (m_curr_row_end > m_rows_end)
my_error(ER_SLAVE_CORRUPT_EVENT, MYF(0));
ASSERT_OR_RETURN_ERROR(m_curr_row_end <= m_rows_end, HA_ERR_CORRUPT_EVENT);
=== modified file 'sql/log_event_old.cc'
--- a/sql/log_event_old.cc 2009-04-13 13:24:28 +0000
+++ b/sql/log_event_old.cc 2009-04-29 16:48:59 +0000
@@ -313,7 +313,7 @@ last_uniq_key(TABLE *table, uint keyno)
Returns TRUE if different.
*/
-static bool record_compare(TABLE *table)
+static bool record_compare(TABLE *table, const MY_BITMAP *cols_in_readset)
{
/*
Need to set the X bit and the filler bits in both records since
@@ -342,16 +342,25 @@ static bool record_compare(TABLE *table)
}
}
- if (table->s->blob_fields + table->s->varchar_fields == 0)
+ /*
+ We can compare the record straight away if:
+ i) there are no blob and varchar fields
+ ii) all columns were read or the slave SE provides partial reads
+ */
+ if ((table->s->blob_fields + table->s->varchar_fields == 0) &&
+ (bitmap_is_set_all(cols_in_readset) ||
+ (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ)))
{
result= cmp_record(table,record[1]);
goto record_compare_exit;
}
- /* Compare null bits */
- if (memcmp(table->null_flags,
- table->null_flags+table->s->rec_buff_length,
- table->s->null_bytes))
+ /* Compare null bits only if all fields were read or slave SE has partial reads */
+ if ((bitmap_is_set_all(cols_in_readset) ||
+ (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ)) &&
+ memcmp(table->null_flags,
+ table->null_flags+table->s->rec_buff_length,
+ table->s->null_bytes))
{
result= TRUE; // Diff in NULL value
goto record_compare_exit;
@@ -360,10 +369,14 @@ static bool record_compare(TABLE *table)
/* Compare updated fields */
for (Field **ptr=table->field ; *ptr ; ptr++)
{
- if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length))
- {
- result= TRUE;
- goto record_compare_exit;
+ /* compare field if it is set */
+ if (bitmap_is_set(cols_in_readset, (*ptr)->field_index))
+ {
+ if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length))
+ {
+ result= TRUE;
+ goto record_compare_exit;
+ }
}
}
@@ -644,6 +657,7 @@ replace_record(THD *thd, TABLE *table,
@param table Pointer to table to search
@param key Pointer to key to use for search, if table has key
+ @param cols Bitmap denoting the columns read in the BI image.
@pre <code>table->record[0]</code> shall contain the row to locate
and <code>key</code> shall contain a key to use for searching, if
@@ -659,7 +673,7 @@ replace_record(THD *thd, TABLE *table,
<code>table->record[1]</code>, error code otherwise.
*/
-static int find_and_fetch_row(TABLE *table, uchar *key)
+static int find_and_fetch_row(TABLE *table, uchar *key, MY_BITMAP *cols)
{
DBUG_ENTER("find_and_fetch_row(TABLE *table, uchar *key, uchar *record)");
DBUG_PRINT("enter", ("table: %p, key: %p record: %p",
@@ -761,7 +775,7 @@ static int find_and_fetch_row(TABLE *tab
DBUG_RETURN(0);
}
- while (record_compare(table))
+ while (record_compare(table, cols))
{
int error;
@@ -837,7 +851,7 @@ static int find_and_fetch_row(TABLE *tab
DBUG_RETURN(error);
}
}
- while (restart_count < 2 && record_compare(table));
+ while (restart_count < 2 && record_compare(table, cols));
/*
Have to restart the scan to be able to fetch the next row.
@@ -1060,7 +1074,7 @@ int Delete_rows_log_event_old::do_exec_r
int error;
DBUG_ASSERT(table != NULL);
- if (!(error= ::find_and_fetch_row(table, m_key)))
+ if (!(error= ::find_and_fetch_row(table, m_key, &m_cols)))
{
/*
Now we should have the right row to delete. We are using
@@ -1168,7 +1182,7 @@ int Update_rows_log_event_old::do_exec_r
{
DBUG_ASSERT(table != NULL);
- int error= ::find_and_fetch_row(table, m_key);
+ int error= ::find_and_fetch_row(table, m_key, &m_cols);
if (error)
return error;
@@ -2387,7 +2401,7 @@ int Old_rows_log_event::find_row(const R
*/
DBUG_PRINT("info",("non-unique index, scanning it to find matching record"));
- while (record_compare(table))
+ while (record_compare(table, &m_cols))
{
/*
We need to set the null bytes to ensure that the filler bit
@@ -2463,7 +2477,7 @@ int Old_rows_log_event::find_row(const R
DBUG_RETURN(error);
}
}
- while (restart_count < 2 && record_compare(table));
+ while (restart_count < 2 && record_compare(table, &m_cols));
/*
Note: above record_compare will take into accout all record fields
=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h 2009-05-07 20:48:24 +0000
+++ b/sql/mysql_priv.h 2009-05-14 21:49:53 +0000
@@ -28,6 +28,16 @@
#ifndef MYSQL_CLIENT
+/*
+ the following #define adds server-only members to enum_mysql_show_type,
+ that is defined in mysql/plugin.h
+ it has to be before mysql/plugin.h is included.
+*/
+#define SHOW_always_last SHOW_KEY_CACHE_LONG, \
+ SHOW_KEY_CACHE_LONGLONG, SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, \
+ SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, \
+ SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS
+
#include <my_global.h>
#include <mysql_version.h>
#include <mysql_embed.h>
@@ -110,7 +120,6 @@ void *sql_calloc(size_t);
char *sql_strdup(const char *str);
char *sql_strmake(const char *str, size_t len);
void *sql_memdup(const void * ptr, size_t size);
-void sql_element_free(void *ptr);
char *sql_strmake_with_convert(const char *str, size_t arg_length,
CHARSET_INFO *from_cs,
size_t max_res_length,
@@ -118,12 +127,10 @@ char *sql_strmake_with_convert(const cha
uint kill_one_thread(THD *thd, ulong id, bool only_kill_query);
void sql_kill(THD *thd, ulong id, bool only_kill_query);
bool net_request_file(NET* net, const char* fname);
-char* query_table_status(THD *thd,const char *db,const char *table_name);
#define x_free(A) { my_free((uchar*) (A),MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); }
#define safeFree(x) { if(x) { my_free((uchar*) x,MYF(0)); x = NULL; } }
#define PREV_BITS(type,A) ((type) (((type) 1 << (A)) -1))
-#define all_bits_set(A,B) ((A) & (B) != (B))
/*
Generates a warning that a feature is deprecated. After a specified version
@@ -345,7 +352,6 @@ enum open_table_mode
#ifndef MYSQLD_NET_RETRY_COUNT
#define MYSQLD_NET_RETRY_COUNT 10 ///< Abort read after this many int.
#endif
-#define TEMP_POOL_SIZE 128
#define QUERY_ALLOC_BLOCK_SIZE 8192
#define QUERY_ALLOC_PREALLOC_SIZE 8192
@@ -355,11 +361,8 @@ enum open_table_mode
#define ACL_ALLOC_BLOCK_SIZE 1024
#define UDF_ALLOC_BLOCK_SIZE 1024
#define TABLE_ALLOC_BLOCK_SIZE 1024
-#define BDB_LOG_ALLOC_BLOCK_SIZE 1024
#define WARN_ALLOC_BLOCK_SIZE 2048
#define WARN_ALLOC_PREALLOC_SIZE 1024
-#define PROFILE_ALLOC_BLOCK_SIZE 2048
-#define PROFILE_ALLOC_PREALLOC_SIZE 1024
/*
The following parameters is to decide when to use an extra cache to
@@ -482,58 +485,58 @@ enum open_table_mode
TODO: separate three contexts above, move them to separate bitfields.
*/
-#define SELECT_DISTINCT (ULL(1) << 0) // SELECT, user
-#define SELECT_STRAIGHT_JOIN (ULL(1) << 1) // SELECT, user
-#define SELECT_DESCRIBE (ULL(1) << 2) // SELECT, user
-#define SELECT_SMALL_RESULT (ULL(1) << 3) // SELECT, user
-#define SELECT_BIG_RESULT (ULL(1) << 4) // SELECT, user
-#define OPTION_FOUND_ROWS (ULL(1) << 5) // SELECT, user
-#define OPTION_TO_QUERY_CACHE (ULL(1) << 6) // SELECT, user
-#define SELECT_NO_JOIN_CACHE (ULL(1) << 7) // intern
-#define OPTION_BIG_TABLES (ULL(1) << 8) // THD, user
-#define OPTION_BIG_SELECTS (ULL(1) << 9) // THD, user
-#define OPTION_LOG_OFF (ULL(1) << 10) // THD, user
-#define OPTION_QUOTE_SHOW_CREATE (ULL(1) << 11) // THD, user, unused
-#define TMP_TABLE_ALL_COLUMNS (ULL(1) << 12) // SELECT, intern
-#define OPTION_WARNINGS (ULL(1) << 13) // THD, user
-#define OPTION_AUTO_IS_NULL (ULL(1) << 14) // THD, user, binlog
-#define OPTION_FOUND_COMMENT (ULL(1) << 15) // SELECT, intern, parser
-#define OPTION_SAFE_UPDATES (ULL(1) << 16) // THD, user
-#define OPTION_BUFFER_RESULT (ULL(1) << 17) // SELECT, user
-#define OPTION_BIN_LOG (ULL(1) << 18) // THD, user
-#define OPTION_NOT_AUTOCOMMIT (ULL(1) << 19) // THD, user
-#define OPTION_BEGIN (ULL(1) << 20) // THD, intern
-#define OPTION_TABLE_LOCK (ULL(1) << 21) // THD, intern
-#define OPTION_QUICK (ULL(1) << 22) // SELECT (for DELETE)
-#define OPTION_KEEP_LOG (ULL(1) << 23) // THD, user
+#define SELECT_DISTINCT (1ULL << 0) // SELECT, user
+#define SELECT_STRAIGHT_JOIN (1ULL << 1) // SELECT, user
+#define SELECT_DESCRIBE (1ULL << 2) // SELECT, user
+#define SELECT_SMALL_RESULT (1ULL << 3) // SELECT, user
+#define SELECT_BIG_RESULT (1ULL << 4) // SELECT, user
+#define OPTION_FOUND_ROWS (1ULL << 5) // SELECT, user
+#define OPTION_TO_QUERY_CACHE (1ULL << 6) // SELECT, user
+#define SELECT_NO_JOIN_CACHE (1ULL << 7) // intern
+#define OPTION_BIG_TABLES (1ULL << 8) // THD, user
+#define OPTION_BIG_SELECTS (1ULL << 9) // THD, user
+#define OPTION_LOG_OFF (1ULL << 10) // THD, user
+#define OPTION_QUOTE_SHOW_CREATE (1ULL << 11) // THD, user, unused
+#define TMP_TABLE_ALL_COLUMNS (1ULL << 12) // SELECT, intern
+#define OPTION_WARNINGS (1ULL << 13) // THD, user
+#define OPTION_AUTO_IS_NULL (1ULL << 14) // THD, user, binlog
+#define OPTION_FOUND_COMMENT (1ULL << 15) // SELECT, intern, parser
+#define OPTION_SAFE_UPDATES (1ULL << 16) // THD, user
+#define OPTION_BUFFER_RESULT (1ULL << 17) // SELECT, user
+#define OPTION_BIN_LOG (1ULL << 18) // THD, user
+#define OPTION_NOT_AUTOCOMMIT (1ULL << 19) // THD, user
+#define OPTION_BEGIN (1ULL << 20) // THD, intern
+#define OPTION_TABLE_LOCK (1ULL << 21) // THD, intern
+#define OPTION_QUICK (1ULL << 22) // SELECT (for DELETE)
+#define OPTION_KEEP_LOG (1ULL << 23) // THD, user
/* The following is used to detect a conflict with DISTINCT */
-#define SELECT_ALL (ULL(1) << 24) // SELECT, user, parser
+#define SELECT_ALL (1ULL << 24) // SELECT, user, parser
/** The following can be set when importing tables in a 'wrong order'
to suppress foreign key checks */
-#define OPTION_NO_FOREIGN_KEY_CHECKS (ULL(1) << 26) // THD, user, binlog
+#define OPTION_NO_FOREIGN_KEY_CHECKS (1ULL << 26) // THD, user, binlog
/** The following speeds up inserts to InnoDB tables by suppressing unique
key checks in some cases */
-#define OPTION_RELAXED_UNIQUE_CHECKS (ULL(1) << 27) // THD, user, binlog
-#define SELECT_NO_UNLOCK (ULL(1) << 28) // SELECT, intern
-#define OPTION_SCHEMA_TABLE (ULL(1) << 29) // SELECT, intern
+#define OPTION_RELAXED_UNIQUE_CHECKS (1ULL << 27) // THD, user, binlog
+#define SELECT_NO_UNLOCK (1ULL << 28) // SELECT, intern
+#define OPTION_SCHEMA_TABLE (1ULL << 29) // SELECT, intern
/** Flag set if setup_tables already done */
-#define OPTION_SETUP_TABLES_DONE (ULL(1) << 30) // intern
+#define OPTION_SETUP_TABLES_DONE (1ULL << 30) // intern
/** If not set then the thread will ignore all warnings with level notes. */
-#define OPTION_SQL_NOTES (ULL(1) << 31) // THD, user
+#define OPTION_SQL_NOTES (1ULL << 31) // THD, user
/**
Force the used temporary table to be a MyISAM table (because we will use
fulltext functions when reading from it.
*/
-#define TMP_TABLE_FORCE_MYISAM (ULL(1) << 32)
-#define OPTION_PROFILING (ULL(1) << 33)
+#define TMP_TABLE_FORCE_MYISAM (1ULL << 32)
+#define OPTION_PROFILING (1ULL << 33)
/*
Dont report errors for individual rows,
But just report error on commit (or read ofcourse)
*/
-#define OPTION_ALLOW_BATCH (ULL(1) << 34) // THD, intern (slave)
+#define OPTION_ALLOW_BATCH (1ULL << 34) // THD, intern (slave)
/**
Maximum length of time zone name that we support
@@ -576,7 +579,7 @@ enum open_table_mode
#define MODE_NO_AUTO_CREATE_USER (MODE_TRADITIONAL*2)
#define MODE_HIGH_NOT_PRECEDENCE (MODE_NO_AUTO_CREATE_USER*2)
#define MODE_NO_ENGINE_SUBSTITUTION (MODE_HIGH_NOT_PRECEDENCE*2)
-#define MODE_PAD_CHAR_TO_FULL_LENGTH (ULL(1) << 31)
+#define MODE_PAD_CHAR_TO_FULL_LENGTH (1ULL << 31)
/* @@optimizer_switch flags. These must be in sync with optimizer_switch_typelib */
#define OPTIMIZER_SWITCH_FIRSTMATCH 1
@@ -612,8 +615,6 @@ enum open_table_mode
*/
-#define RAID_BLOCK_SIZE 1024
-
#define MY_CHARSET_BIN_MB_MAXLEN 1
// uncachable cause
@@ -635,10 +636,6 @@ enum open_table_mode
#define BINLOG_DUMP_NON_BLOCK 1
-/* sql_show.cc:show_log_files() */
-#define SHOW_LOG_STATUS_FREE "FREE"
-#define SHOW_LOG_STATUS_INUSE "IN USE"
-
struct TABLE_LIST;
class String;
void view_store_options(THD *thd, TABLE_LIST *table, String *buff);
@@ -1968,6 +1965,7 @@ extern MYSQL_PLUGIN_IMPORT uint reg_ext_
#ifdef MYSQL_SERVER
extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
+extern char default_logfile_name[FN_REFLEN];
extern char log_error_file[FN_REFLEN], *opt_tc_log_file;
extern const double log_10[309];
extern ulonglong log_10_int[20];
@@ -2202,8 +2200,6 @@ bool wait_if_global_read_lock(THD *thd,
bool is_not_commit);
void start_waiting_global_read_lock(THD *thd);
bool make_global_read_lock_block_commit(THD *thd);
-bool set_protect_against_global_read_lock(void);
-void unset_protect_against_global_read_lock(void);
void broadcast_refresh(void);
int try_transactional_lock(THD *thd, TABLE_LIST *table_list);
int check_transactional_lock(THD *thd, TABLE_LIST *table_list);
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2009-05-07 20:48:24 +0000
+++ b/sql/mysqld.cc 2009-05-11 17:58:07 +0000
@@ -643,6 +643,7 @@ const double log_10[] = {
time_t server_start_time, flush_status_time;
char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
+char default_logfile_name[FN_REFLEN];
char *default_tz_name;
char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN];
char mysql_real_data_home[FN_REFLEN],
@@ -3363,10 +3364,13 @@ static int init_common_variables(const c
strmake(glob_hostname, STRING_WITH_LEN("localhost"));
sql_print_warning("gethostname failed, using '%s' as hostname",
glob_hostname);
- strmake(pidfile_name, STRING_WITH_LEN("mysql"));
+ strmake(default_logfile_name, STRING_WITH_LEN("mysql"));
}
else
- strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5);
+ strmake(default_logfile_name, glob_hostname,
+ sizeof(default_logfile_name)-5);
+
+ strmake(pidfile_name, default_logfile_name, sizeof(pidfile_name)-5);
strmov(fn_ext(pidfile_name),".pid"); // Add proper extension
/*
=== modified file 'sql/replication.h'
--- a/sql/replication.h 2008-09-23 15:06:18 +0000
+++ b/sql/replication.h 2009-05-14 08:56:34 +0000
@@ -132,6 +132,7 @@ typedef struct Binlog_storage_observer {
uint32 flags);
} Binlog_storage_observer;
+#ifdef HAVE_REPLICATION
/**
Replication binlog transmitter (binlog dump) observer parameter.
*/
@@ -343,6 +344,7 @@ typedef struct Binlog_relay_IO_observer
*/
int (*after_reset_slave)(Binlog_relay_IO_param *param);
} Binlog_relay_IO_observer;
+#endif
/**
@@ -389,6 +391,7 @@ int register_binlog_storage_observer(Bin
*/
int unregister_binlog_storage_observer(Binlog_storage_observer *observer, void *p);
+#ifdef HAVE_REPLICATION
/**
Register a binlog transmit observer
@@ -454,6 +457,36 @@ int unregister_binlog_relay_io_observer(
@return address of MYSQL structure on success, NULL on failure
*/
MYSQL *rpl_connect_master(MYSQL *mysql);
+#endif
+
+/**
+ Set thread entering a condition
+
+ This function should be called before putting a thread to wait for
+ a condition. @a mutex should be held before calling this
+ function. After being waken up, @f thd_exit_cond should be called.
+
+ @param thd The thread entering the condition, NULL means current thread
+ @param cond The condition the thread is going to wait for
+ @param mutex The mutex associated with the condition, this must be
+ held before call this function
+ @param msg The new process message for the thread
+*/
+const char* thd_enter_cond(MYSQL_THD thd, pthread_cond_t *cond,
+ pthread_mutex_t *mutex, const char *msg);
+
+/**
+ Set thread leaving a condition
+
+ This function should be called after a thread being waken up for a
+ condition.
+
+ @param thd The thread entering the condition, NULL means current thread
+ @param old_msg The process message, ususally this should be the old process
+ message before calling @f thd_enter_cond
+*/
+void thd_exit_cond(MYSQL_THD thd, const char *old_msg);
+
#ifdef __cplusplus
}
=== modified file 'sql/rpl_info.h'
--- a/sql/rpl_info.h 2009-04-02 16:14:14 +0000
+++ b/sql/rpl_info.h 2009-04-27 21:18:21 +0000
@@ -35,7 +35,13 @@ public:
THD *info_thd;
- bool inited;
+ /*
+ inited changes its value within LOCK_active_mi-guarded critical
+ sections at times of start_slave_threads() (0->1) and end_slave() (1->0).
+ Readers may not acquire the mutex while they realize potential concurrency
+ issue.
+ */
+ volatile bool inited;
volatile bool abort_slave;
volatile uint slave_running;
volatile ulong slave_run_id;
=== modified file 'sql/rpl_record.cc'
--- a/sql/rpl_record.cc 2009-04-08 13:09:37 +0000
+++ b/sql/rpl_record.cc 2009-04-23 23:54:59 +0000
@@ -208,7 +208,7 @@ unpack_row(Relay_log_info const *rli,
TABLE *table, uint const colcnt,
uchar const *const row_data, MY_BITMAP const *cols,
uchar const **const row_end, ulong *const master_reclength,
- bool unpack_blobs)
+ bool unpack_blobs, const bool abort_on_warning, const bool first_row)
{
DBUG_ENTER("unpack_row");
DBUG_ASSERT(row_data);
@@ -265,12 +265,34 @@ unpack_row(Relay_log_info const *rli,
/* Field...::unpack() cannot return 0 */
DBUG_ASSERT(pack_ptr != NULL);
- if ((null_bits & null_mask) && f->maybe_null())
+ if (null_bits & null_mask)
{
- DBUG_PRINT("debug", ("Was NULL; null mask: 0x%x; null bits: 0x%x",
- null_mask, null_bits));
-
- f->set_null();
+ if (f->maybe_null())
+ {
+ DBUG_PRINT("debug", ("Was NULL; null mask: 0x%x; null bits: 0x%x",
+ null_mask, null_bits));
+ f->set_null();
+ }
+ else
+ {
+ MYSQL_ERROR::enum_warning_level error_type=
+ MYSQL_ERROR::WARN_LEVEL_NOTE;
+ if (abort_on_warning && (table->file->has_transactions() ||
+ first_row))
+ {
+ error = HA_ERR_ROWS_EVENT_APPLY;
+ error_type= MYSQL_ERROR::WARN_LEVEL_ERROR;
+ }
+ else
+ {
+ f->set_default();
+ error_type= MYSQL_ERROR::WARN_LEVEL_WARN;
+ }
+ push_warning_printf(current_thd, error_type,
+ ER_BAD_NULL_ERROR,
+ ER(ER_BAD_NULL_ERROR),
+ f->field_name);
+ }
}
else if (!unpack_blobs && f->unireg_check==Field::BLOB_FIELD)
{
@@ -382,7 +404,8 @@ unpack_row(Relay_log_info const *rli,
@retval ER_NO_DEFAULT_FOR_FIELD Default value could not be checked for a field
*/
int prepare_record(TABLE *const table, const MY_BITMAP *cols, uint width,
- const bool check, const bool abort_on_warning)
+ const bool check, const bool abort_on_warning,
+ const bool first_row)
{
DBUG_ENTER("prepare_record");
@@ -409,14 +432,23 @@ int prepare_record(TABLE *const table, c
if ((f->flags & NO_DEFAULT_VALUE_FLAG) &&
(f->real_type() != MYSQL_TYPE_ENUM))
{
- push_warning_printf(current_thd, abort_on_warning?
- MYSQL_ERROR::WARN_LEVEL_ERROR :
- MYSQL_ERROR::WARN_LEVEL_WARN,
+ MYSQL_ERROR::enum_warning_level error_type=
+ MYSQL_ERROR::WARN_LEVEL_NOTE;
+ if (abort_on_warning && (table->file->has_transactions() ||
+ first_row))
+ {
+ error= HA_ERR_ROWS_EVENT_APPLY;
+ error_type= MYSQL_ERROR::WARN_LEVEL_ERROR;
+ }
+ else
+ {
+ f->set_default();
+ error_type= MYSQL_ERROR::WARN_LEVEL_WARN;
+ }
+ push_warning_printf(current_thd, error_type,
ER_NO_DEFAULT_FOR_FIELD,
ER(ER_NO_DEFAULT_FOR_FIELD),
f->field_name);
- if (abort_on_warning)
- error = HA_ERR_ROWS_EVENT_APPLY;
}
}
}
=== modified file 'sql/rpl_record.h'
--- a/sql/rpl_record.h 2009-04-08 13:09:37 +0000
+++ b/sql/rpl_record.h 2009-04-23 23:54:59 +0000
@@ -29,11 +29,11 @@ int unpack_row(Relay_log_info const *rli
TABLE *table, uint const colcnt,
uchar const *const row_data, MY_BITMAP const *cols,
uchar const **const row_end, ulong *const master_reclength,
- bool unpack_blobs);
+ bool unpack_blobs, const bool= TRUE, const bool= TRUE);
// Fill table's record[0] with default values.
int prepare_record(TABLE *const, const MY_BITMAP *cols, uint width,
- const bool, const bool= FALSE);
+ const bool, const bool= TRUE, const bool= TRUE);
#endif
#endif
=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc 2009-05-07 20:48:24 +0000
+++ b/sql/set_var.cc 2009-05-14 21:49:53 +0000
@@ -1989,7 +1989,7 @@ bool sys_var::check_set(THD *thd, set_va
For when the enum is made to contain 64 elements, as 1ULL<<64 is
undefined, we guard with a "count<64" test.
*/
- if (unlikely((tmp >= ((ULL(1)) << enum_names->count)) &&
+ if (unlikely((tmp >= ((1ULL) << enum_names->count)) &&
(enum_names->count < 64)))
{
llstr(tmp, buff);
@@ -2639,6 +2639,13 @@ static int sys_check_log_path(THD *thd,
/* Get dirname of the file path. */
(void) dirname_part(path, log_file_str, &path_length);
+ /* Test if the file name itself is too long */
+ if (res->length()-path_length >= FN_LEN)
+ {
+ my_error(ER_PATH_LENGTH, MYF(0), var->var->name);
+ return 1;
+ }
+
/* Dirname is empty if file path is relative. */
if (!path_length)
return 0;
@@ -2676,9 +2683,20 @@ bool update_sys_var_str_path(THD *thd, s
MYSQL_QUERY_LOG *file_log= 0;
MYSQL_BACKUP_LOG *backup_log= 0;
char buff[FN_REFLEN];
- char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0);
+ char *res= 0, *old_value= 0;
bool result= 0;
- uint str_length= (var ? var->value->str_value.length() : 0);
+ uint str_length= 0;
+
+ if (var)
+ {
+ String str(buff, sizeof(buff), system_charset_info), *newval;
+
+ newval= var->value->val_str(&str);
+ old_value= newval->c_ptr_safe();
+ str_length= strlen(old_value);
+ }
+
+
/*
Added support for backup log types.
=== modified file 'sql/slave.cc'
--- a/sql/slave.cc 2009-05-07 20:48:24 +0000
+++ b/sql/slave.cc 2009-05-13 16:04:01 +0000
@@ -745,11 +745,15 @@ int start_slave_thread(pthread_handler h
DBUG_PRINT("sleep",("Waiting for slave thread to start"));
const char* old_msg = thd->enter_cond(start_cond,cond_lock,
"Waiting for slave thread to start");
- pthread_cond_wait(start_cond,cond_lock);
+ pthread_cond_wait(start_cond, cond_lock);
thd->exit_cond(old_msg);
pthread_mutex_lock(cond_lock); // re-acquire it as exit_cond() released
if (thd->killed)
+ {
+ if (start_lock)
+ pthread_mutex_unlock(start_lock);
DBUG_RETURN(thd->killed_errno());
+ }
}
}
if (start_lock)
@@ -2528,6 +2532,7 @@ pthread_handler_t handle_slave_io(void *
thd= new THD; // note that contructor of THD uses DBUG_ !
THD_CHECK_SENTRY(thd);
+ DBUG_ASSERT(mi->info_thd == 0);
mi->info_thd = thd;
pthread_detach_this_thread();
@@ -4412,9 +4417,6 @@ void rotate_relay_log(Master_info* mi)
DBUG_EXECUTE_IF("crash_before_rotate_relaylog", DBUG_ABORT(););
- /* We don't lock rli->run_lock. This would lead to deadlocks. */
- pthread_mutex_lock(&mi->run_lock);
-
/*
We need to test inited because otherwise, new_file() will attempt to lock
LOCK_log, which may not be inited (if we're not a slave).
@@ -4443,7 +4445,6 @@ void rotate_relay_log(Master_info* mi)
*/
rli->relay_log.harvest_bytes_written(&rli->log_space_total);
end:
- pthread_mutex_unlock(&mi->run_lock);
DBUG_VOID_RETURN;
}
=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc 2009-05-07 20:48:24 +0000
+++ b/sql/sql_base.cc 2009-05-12 16:41:11 +0000
@@ -3044,7 +3044,7 @@ Locked_tables_list::unlock_locked_tables
the locked tables list. Passing a TABLE_LIST
instance that is not part of locked tables
list will lead to a crash.
- @parma remove_from_locked_tables
+ @param remove_from_locked_tables
TRUE if the table is removed from the list
permanently.
=== modified file 'sql/sql_bitmap.h'
--- a/sql/sql_bitmap.h 2008-07-09 07:12:43 +0000
+++ b/sql/sql_bitmap.h 2009-05-14 21:49:53 +0000
@@ -58,7 +58,7 @@ public:
intersect(map2buff);
if (map.n_bits > sizeof(ulonglong) * 8)
bitmap_set_above(&map, sizeof(ulonglong),
- test(map2buff & (LL(1) << (sizeof(ulonglong) * 8 - 1))));
+ test(map2buff & (1LL << (sizeof(ulonglong) * 8 - 1))));
}
void subtract(Bitmap& map2) { bitmap_subtract(&map, &map2.map); }
void merge(Bitmap& map2) { bitmap_union(&map, &map2.map); }
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2009-05-07 20:48:24 +0000
+++ b/sql/sql_class.cc 2009-05-14 08:56:34 +0000
@@ -266,6 +266,25 @@ const char *set_thd_proc_info(THD *thd,
}
extern "C"
+const char* thd_enter_cond(MYSQL_THD thd, pthread_cond_t *cond,
+ pthread_mutex_t *mutex, const char *msg)
+{
+ if (!thd)
+ thd= current_thd;
+
+ return thd->enter_cond(cond, mutex, msg);
+}
+
+extern "C"
+void thd_exit_cond(MYSQL_THD thd, const char *old_msg)
+{
+ if (!thd)
+ thd= current_thd;
+
+ thd->exit_cond(old_msg);
+}
+
+extern "C"
void **thd_ha_data(const THD *thd, const struct handlerton *hton)
{
return (void **) &thd->ha_data[hton->slot].ha_ptr;
@@ -388,6 +407,33 @@ char *thd_security_context(THD *thd, cha
}
+/**
+ Implementation of Internal_error_handler::handle_condition().
+ The reason in having this implementation is to silence technical low-level
+ warnings during DROP TABLE operation. Currently we don't want to expose
+ the following warnings during DROP TABLE:
+ - Some of table files are missed or invalid (the table is going to be
+ deleted anyway, so why bother that something was missed);
+ - A trigger associated with the table does not have DEFINER (One of the
+ MySQL specifics now is that triggers are loaded for the table being
+ dropped. So, we may have a warning that trigger does not have DEFINER
+ attribute during DROP TABLE operation).
+
+ @return TRUE if the condition is handled.
+*/
+bool Drop_table_error_handler::handle_condition(THD *thd,
+ uint sql_errno,
+ const char *sqlstate,
+ MYSQL_ERROR::enum_warning_level
+ level,
+ const char *msg,
+ MYSQL_ERROR **condition)
+{
+ return (sql_errno == EE_DELETE && my_errno == ENOENT)
+ || sql_errno == ER_TRG_NO_DEFINER;
+}
+
+
THD::THD()
:Statement(&main_lex, &main_mem_root, CONVENTIONAL_EXECUTION,
/* statement id */ 0),
@@ -548,12 +594,15 @@ THD::THD()
void THD::push_internal_handler(Internal_error_handler *handler)
{
- /*
- TODO: The current implementation is limited to 1 handler at a time only.
- THD and sp_rcontext need to be modified to use a common handler stack.
- */
- DBUG_ASSERT(m_internal_handler == NULL);
- m_internal_handler= handler;
+ if (m_internal_handler)
+ {
+ handler->m_prev_internal_handler= m_internal_handler;
+ m_internal_handler= handler;
+ }
+ else
+ {
+ m_internal_handler= handler;
+ }
}
@@ -563,17 +612,23 @@ bool THD::handle_condition(uint sql_errn
const char* msg,
MYSQL_ERROR ** cond_hdl)
{
- if (m_internal_handler)
+ if (!m_internal_handler)
{
- return m_internal_handler->handle_condition(this,
- sql_errno,
- sqlstate,
- level,
- msg,
- cond_hdl);
+ *cond_hdl= NULL;
+ return FALSE;
+ }
+
+ for (Internal_error_handler *error_handler= m_internal_handler;
+ error_handler;
+ error_handler= m_internal_handler->m_prev_internal_handler)
+ {
+ if (error_handler-> handle_condition(this, sql_errno, sqlstate, level, msg,
+ cond_hdl))
+ {
+ return TRUE;
+ }
}
- *cond_hdl= NULL;
return FALSE;
}
@@ -581,7 +636,7 @@ bool THD::handle_condition(uint sql_errn
void THD::pop_internal_handler()
{
DBUG_ASSERT(m_internal_handler != NULL);
- m_internal_handler= NULL;
+ m_internal_handler= m_internal_handler->m_prev_internal_handler;
}
void THD::raise_error(uint sql_errno)
=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h 2009-05-07 20:48:24 +0000
+++ b/sql/sql_class.h 2009-05-14 08:56:34 +0000
@@ -24,7 +24,7 @@
#include "log.h"
#include "rpl_tblmap.h"
#include "mdl.h"
-
+// #include "replication.h"
#include <waiting_threads.h>
@@ -1110,7 +1110,10 @@ show_system_thread(enum_thread_type thre
class Internal_error_handler
{
protected:
- Internal_error_handler() {}
+ Internal_error_handler() :
+ m_prev_internal_handler(NULL)
+ { }
+
virtual ~Internal_error_handler() {}
public:
@@ -1145,6 +1148,36 @@ public:
const char* msg,
MYSQL_ERROR ** cond_hdl) = 0;
+private:
+ Internal_error_handler *m_prev_internal_handler;
+ friend class THD;
+};
+
+
+/**
+ This class is an internal error handler implementation for DROP DATABASE
+ and DROP TABLE statements. The thing is that there may be warnings during
+ execution of these statements, which should not be exposed to the user.
+ This class is intended to silence such warnings.
+*/
+
+class Drop_table_error_handler : public Internal_error_handler
+{
+public:
+ Drop_table_error_handler(Internal_error_handler *err_handler)
+ :m_err_handler(err_handler)
+ { }
+
+public:
+ virtual bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char *sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char *msg,
+ MYSQL_ERROR **condition);
+
+private:
+ Internal_error_handler *m_err_handler;
};
/**
@@ -1964,7 +1997,7 @@ public:
inline void exit_cond(const char* old_msg)
{
/*
- Putting the mutex unlock in exit_cond() ensures that
+ Putting the mutex unlock in thd_exit_cond() ensures that
mysys_var->current_mutex is always unlocked _before_ mysys_var->mutex is
locked (if that would not be the case, you'll get a deadlock if someone
does a THD::awake() on you).
@@ -2282,6 +2315,9 @@ public:
thd_scheduler scheduler;
public:
+ inline Internal_error_handler *get_internal_handler()
+ { return m_internal_handler; }
+
/**
Add an internal error handler to the thread execution context.
@param handler the exception handler to add
=== modified file 'sql/sql_connect.cc'
--- a/sql/sql_connect.cc 2009-03-17 20:26:16 +0000
+++ b/sql/sql_connect.cc 2009-05-14 21:49:53 +0000
@@ -218,7 +218,7 @@ void time_out_user_resource_limits(THD *
DBUG_ENTER("time_out_user_resource_limits");
/* If more than a hour since last check, reset resource checking */
- if (check_time - uc->reset_utime >= LL(3600000000))
+ if (check_time - uc->reset_utime >= 3600000000LL)
{
uc->questions=1;
uc->updates=0;
=== modified file 'sql/sql_db.cc'
--- a/sql/sql_db.cc 2009-04-08 23:46:45 +0000
+++ b/sql/sql_db.cc 2009-05-11 17:58:07 +0000
@@ -913,6 +913,9 @@ bool mysql_rm_db(THD *thd,char *db,bool
}
else
{
+ Drop_table_error_handler err_handler(thd->get_internal_handler());
+ thd->push_internal_handler(&err_handler);
+
error= -1;
/*
We temporarily disable the binary log while dropping the objects
@@ -945,6 +948,8 @@ bool mysql_rm_db(THD *thd,char *db,bool
error = 0;
reenable_binlog(thd);
}
+
+ thd->pop_internal_handler();
}
if (!silent && deleted>=0)
{
=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc 2009-05-07 20:48:24 +0000
+++ b/sql/sql_delete.cc 2009-05-14 21:49:53 +0000
@@ -1021,7 +1021,7 @@ static bool mysql_truncate_by_delete(THD
mysql_init_select(thd->lex);
thd->clear_current_stmt_binlog_row_based();
/* Delete all rows from table */
- error= mysql_delete(thd, table_list, NULL, NULL, HA_POS_ERROR, LL(0), TRUE);
+ error= mysql_delete(thd, table_list, NULL, NULL, HA_POS_ERROR, 0LL, TRUE);
/*
All effects of a TRUNCATE TABLE operation are rolled back if a row by row
deletion fails. Otherwise, operation is automatically committed at the end.
=== modified file 'sql/sql_lex.cc'
--- a/sql/sql_lex.cc 2009-04-10 14:33:30 +0000
+++ b/sql/sql_lex.cc 2009-05-14 21:49:53 +0000
@@ -2131,7 +2131,7 @@ void st_select_lex::print_limit(THD *thd
((Item_in_subselect*)item)->exec_method ==
Item_in_subselect::MATERIALIZATION) ?
TRUE :
- (select_limit->val_int() == LL(1)) &&
+ (select_limit->val_int() == 1LL) &&
offset_limit == 0));
return;
}
@@ -2534,7 +2534,7 @@ void st_select_lex_unit::set_limit(st_se
if (val != (ulonglong)select_limit_val)
select_limit_val= HA_POS_ERROR;
#endif
- val= sl->offset_limit ? sl->offset_limit->val_uint() : ULL(0);
+ val= sl->offset_limit ? sl->offset_limit->val_uint() : 0ULL;
offset_limit_cnt= (ha_rows)val;
#ifndef BIG_TABLES
/* Check for truncation. */
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc 2009-05-07 20:48:24 +0000
+++ b/sql/sql_parse.cc 2009-05-16 08:36:58 +0000
@@ -210,8 +210,8 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_CREATE_VIEW]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_DROP_VIEW]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_CREATE_TRIGGER]= CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_DROP_TRIGGER]= CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_CREATE_TRIGGER]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_DROP_TRIGGER]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_CREATE_EVENT]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_ALTER_EVENT]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_DROP_EVENT]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
@@ -233,8 +233,7 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_REPLACE_SELECT]= CF_CHANGES_DATA | CF_HAS_ROW_COUNT |
CF_REEXECUTION_FRAGILE;
sql_command_flags[SQLCOM_SELECT]= CF_REEXECUTION_FRAGILE;
- sql_command_flags[SQLCOM_SET_OPTION]= CF_REEXECUTION_FRAGILE |
- CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_SET_OPTION]= CF_REEXECUTION_FRAGILE | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_DO]= CF_REEXECUTION_FRAGILE;
sql_command_flags[SQLCOM_SHOW_STATUS_PROC]= CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
@@ -249,34 +248,35 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_SHOW_VARIABLES]= CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
sql_command_flags[SQLCOM_SHOW_CHARSETS]= CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
sql_command_flags[SQLCOM_SHOW_COLLATIONS]= CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
- sql_command_flags[SQLCOM_SHOW_NEW_MASTER]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_BINLOGS]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_NEW_MASTER]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_BINLOGS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_SLAVE_HOSTS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_BINLOG_EVENTS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_STORAGE_ENGINES]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_AUTHORS]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_AUTHORS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_CONTRIBUTORS]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_PRIVILEGES]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_WARNS]= CF_STATUS_COMMAND | CF_DIAGNOSTIC_STMT;
- sql_command_flags[SQLCOM_SHOW_ERRORS]= CF_STATUS_COMMAND | CF_DIAGNOSTIC_STMT;
+ sql_command_flags[SQLCOM_SHOW_PRIVILEGES]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_WARNS]= CF_STATUS_COMMAND | CF_DIAGNOSTIC_STMT;
+ sql_command_flags[SQLCOM_SHOW_ERRORS]= CF_STATUS_COMMAND | CF_DIAGNOSTIC_STMT;
sql_command_flags[SQLCOM_SHOW_ENGINE_STATUS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_ENGINE_MUTEX]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_ENGINE_LOGS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_PROCESSLIST]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_GRANTS]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_CREATE_DB]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_GRANTS]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_CREATE_DB]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_CREATE]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_MASTER_STAT]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_MASTER_STAT]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_SLAVE_STAT]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_CREATE_PROC]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_CREATE_PROC]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_CREATE_TRIGGER]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_STATUS_FUNC]= CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
- sql_command_flags[SQLCOM_SHOW_PROC_CODE]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_FUNC_CODE]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_CREATE_EVENT]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_PROFILES]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_PROFILE]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_STATUS_FUNC]= CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
+ sql_command_flags[SQLCOM_SHOW_PROC_CODE]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_FUNC_CODE]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_CREATE_EVENT]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_PROFILES]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_PROFILE]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_BINLOG_BASE64_EVENT]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_TABLES]= (CF_STATUS_COMMAND |
CF_SHOW_TABLE_COMMAND |
@@ -285,37 +285,52 @@ void init_update_queries(void)
CF_SHOW_TABLE_COMMAND |
CF_REEXECUTION_FRAGILE);
+
+ sql_command_flags[SQLCOM_CREATE_USER]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_RENAME_USER]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_DROP_USER]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_GRANT]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_REVOKE]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_ALTER_DB]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_CREATE_FUNCTION]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_DROP_FUNCTION]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_OPTIMIZE]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_CREATE_PROCEDURE]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_CREATE_SPFUNCTION]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_DROP_PROCEDURE]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_ALTER_PROCEDURE]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_ALTER_FUNCTION]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_INSTALL_PLUGIN]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_UNINSTALL_PLUGIN]= CF_CHANGES_DATA;
+
/*
The following is used to preserver CF_ROW_COUNT during the
a CALL or EXECUTE statement, so the value generated by the
last called (or executed) statement is preserved.
See mysql_execute_command() for how CF_ROW_COUNT is used.
*/
- sql_command_flags[SQLCOM_CALL]= CF_HAS_ROW_COUNT | CF_REEXECUTION_FRAGILE;
- sql_command_flags[SQLCOM_EXECUTE]= CF_HAS_ROW_COUNT;
+ sql_command_flags[SQLCOM_CALL]= CF_HAS_ROW_COUNT | CF_REEXECUTION_FRAGILE;
+ sql_command_flags[SQLCOM_EXECUTE]= CF_HAS_ROW_COUNT;
/*
The following admin table operations are allowed
on log tables.
*/
- sql_command_flags[SQLCOM_REPAIR]= CF_WRITE_LOGS_COMMAND |
- CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_OPTIMIZE]= CF_WRITE_LOGS_COMMAND |
- CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_ANALYZE]= CF_WRITE_LOGS_COMMAND |
- CF_AUTO_COMMIT_TRANS;
-
- sql_command_flags[SQLCOM_CREATE_USER]= CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_DROP_USER]= CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_RENAME_USER]= CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_REVOKE_ALL]= CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_REVOKE]= CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_GRANT]= CF_AUTO_COMMIT_TRANS;
-
- sql_command_flags[SQLCOM_CREATE_PROCEDURE]= CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_CREATE_SPFUNCTION]= CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_ALTER_PROCEDURE]= CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_ALTER_FUNCTION]= CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_REPAIR]= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_OPTIMIZE]|= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_ANALYZE]= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS;
+
+ sql_command_flags[SQLCOM_CREATE_USER]|= CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_DROP_USER]|= CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_RENAME_USER]|= CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_REVOKE_ALL]= CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_REVOKE]|= CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_GRANT]|= CF_AUTO_COMMIT_TRANS;
+
+ sql_command_flags[SQLCOM_CREATE_PROCEDURE]|= CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_CREATE_SPFUNCTION]|= CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_ALTER_PROCEDURE]|= CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_ALTER_FUNCTION]|= CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_ASSIGN_TO_KEYCACHE]= CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_PRELOAD_KEYS]= CF_AUTO_COMMIT_TRANS;
@@ -1328,7 +1343,7 @@ bool dispatch_command(enum enum_server_c
if (!(uptime= (ulong) (thd->start_time - server_start_time)))
queries_per_second1000= 0;
else
- queries_per_second1000= thd->query_id * LL(1000) / uptime;
+ queries_per_second1000= thd->query_id * 1000LL / uptime;
#if defined(SAFEMALLOC) || !defined(EMBEDDED_LIBRARY)
length=
@@ -6594,11 +6609,11 @@ void st_select_lex::set_lock_for_tables(
operation and also for any single select union construct of the form
@verbatim
(SELECT ... ORDER BY order_list [LIMIT n]) ORDER BY ...
- @endvarbatim
+ @endverbatim
or of the form
- @varbatim
+ @verbatim
(SELECT ... ORDER BY LIMIT n) ORDER BY ...
- @endvarbatim
+ @endverbatim
@param thd_arg thread handle
=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc 2009-04-01 09:15:50 +0000
+++ b/sql/sql_partition.cc 2009-05-14 21:49:53 +0000
@@ -4314,7 +4314,7 @@ uint prep_alter_part_table(THD *thd, TAB
alt_part_info->part_type= tab_part_info->part_type;
alt_part_info->subpart_type= tab_part_info->subpart_type;
if (alt_part_info->set_up_defaults_for_partitioning(table->file,
- ULL(0),
+ 0ULL,
tab_part_info->no_parts))
{
DBUG_RETURN(TRUE);
@@ -4735,7 +4735,7 @@ state of p1.
alt_part_info->no_subparts= tab_part_info->no_subparts;
DBUG_ASSERT(!alt_part_info->use_default_partitions);
if (alt_part_info->set_up_defaults_for_partitioning(table->file,
- ULL(0),
+ 0ULL,
0))
{
DBUG_RETURN(TRUE);
@@ -4876,7 +4876,7 @@ the generated partition syntax in a corr
tab_part_info->use_default_no_subpartitions= FALSE;
}
if (tab_part_info->check_partition_info(thd, (handlerton**)NULL,
- table->file, ULL(0), FALSE))
+ table->file, 0ULL, FALSE))
{
DBUG_RETURN(TRUE);
}
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2009-04-14 16:05:26 +0000
+++ b/sql/sql_plugin.cc 2009-05-14 21:49:53 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -96,7 +96,9 @@ static int cur_plugin_info_interface_ver
MYSQL_REPLICATION_INTERFACE_VERSION
};
-static bool initialized= 0;
+/* support for Services */
+
+#include "sql_plugin_services.h"
/*
A mutex LOCK_plugin must be acquired before accessing the
@@ -110,6 +112,8 @@ static HASH plugin_hash[MYSQL_MAX_PLUGIN
static bool reap_needed= false;
static int plugin_array_version=0;
+static bool initialized= 0;
+
/*
write-lock on LOCK_system_variables_hash is required before modifying
the following variables/structures
@@ -222,6 +226,22 @@ extern bool throw_bounds_warning(THD *th
extern bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists);
#endif /* EMBEDDED_LIBRARY */
+static void report_error(int where_to, uint error, ...)
+{
+ va_list args;
+ if (where_to & REPORT_TO_USER)
+ {
+ va_start(args, error);
+ my_printv_error(error, ER(error), MYF(0), args);
+ va_end(args);
+ }
+ if (where_to & REPORT_TO_LOG)
+ {
+ va_start(args, error);
+ error_log_print(ERROR_LEVEL, ER(error), args);
+ va_end(args);
+ }
+}
/****************************************************************************
Value type thunks, allows the C world to play in the C++ world
@@ -342,7 +362,7 @@ static st_plugin_dl *plugin_dl_add(const
{
#ifdef HAVE_DLOPEN
char dlpath[FN_REFLEN];
- uint plugin_dir_len, dummy_errors, dlpathlen;
+ uint plugin_dir_len, dummy_errors, dlpathlen, i;
struct st_plugin_dl *tmp, plugin_dl;
void *sym;
DBUG_ENTER("plugin_dl_add");
@@ -357,10 +377,7 @@ static st_plugin_dl *plugin_dl_add(const
system_charset_info, 1) ||
plugin_dir_len + dl->length + 1 >= FN_REFLEN)
{
- if (report & REPORT_TO_USER)
- my_error(ER_UDF_NO_PATHS, MYF(0));
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_UDF_NO_PATHS));
+ report_error(report, ER_UDF_NO_PATHS);
DBUG_RETURN(0);
}
/* If this dll is already loaded just increase ref_count. */
@@ -385,20 +402,14 @@ static st_plugin_dl *plugin_dl_add(const
if (*errmsg == ':') errmsg++;
if (*errmsg == ' ') errmsg++;
}
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_OPEN_LIBRARY, MYF(0), dlpath, errno, errmsg);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_OPEN_LIBRARY), dlpath, errno, errmsg);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, errno, errmsg);
DBUG_RETURN(0);
}
/* Determine interface version */
if (!(sym= dlsym(plugin_dl.handle, plugin_interface_version_sym)))
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), plugin_interface_version_sym);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), plugin_interface_version_sym);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_interface_version_sym);
DBUG_RETURN(0);
}
plugin_dl.version= *(int *)sym;
@@ -407,28 +418,38 @@ static st_plugin_dl *plugin_dl_add(const
(plugin_dl.version >> 8) > (MYSQL_PLUGIN_INTERFACE_VERSION >> 8))
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_OPEN_LIBRARY, MYF(0), dlpath, 0,
- "plugin interface version mismatch");
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_OPEN_LIBRARY), dlpath, 0,
- "plugin interface version mismatch");
+ report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0,
+ "plugin interface version mismatch");
DBUG_RETURN(0);
}
+ for (i= 0; i < array_elements(list_of_services); i++)
+ {
+ if ((sym= dlsym(plugin_dl.handle, list_of_services[i].name)))
+ {
+ uint ver= (uint)(intptr)*(void**)sym;
+ if (ver > list_of_services[i].version ||
+ (ver >> 8) < (list_of_services[i].version >> 8))
+ {
+ char buf[MYSQL_ERRMSG_SIZE];
+ my_snprintf(buf, sizeof(buf),
+ "service '%s' interface version mismatch",
+ list_of_services[i].name);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0, buf);
+ DBUG_RETURN(0);
+ }
+ *(void**)sym= list_of_services[i].service;
+ }
+ }
/* Find plugin declarations */
if (!(sym= dlsym(plugin_dl.handle, plugin_declarations_sym)))
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), plugin_declarations_sym);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), plugin_declarations_sym);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_declarations_sym);
DBUG_RETURN(0);
}
if (plugin_dl.version != MYSQL_PLUGIN_INTERFACE_VERSION)
{
- int i;
uint sizeof_st_plugin;
struct st_mysql_plugin *old, *cur;
char *ptr= (char *)sym;
@@ -439,10 +460,7 @@ static st_plugin_dl *plugin_dl_add(const
{
#ifdef ERROR_ON_NO_SIZEOF_PLUGIN_SYMBOL
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), sizeof_st_plugin_sym);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), sizeof_st_plugin_sym);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, sizeof_st_plugin_sym);
DBUG_RETURN(0);
#else
/*
@@ -464,10 +482,7 @@ static st_plugin_dl *plugin_dl_add(const
if (!cur)
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_OUTOFMEMORY, MYF(0), plugin_dl.dl.length);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_OUTOFMEMORY), plugin_dl.dl.length);
+ report_error(report, ER_OUTOFMEMORY, plugin_dl.dl.length);
DBUG_RETURN(0);
}
/*
@@ -489,10 +504,7 @@ static st_plugin_dl *plugin_dl_add(const
if (! (plugin_dl.dl.str= (char*) my_malloc(plugin_dl.dl.length, MYF(0))))
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_OUTOFMEMORY, MYF(0), plugin_dl.dl.length);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_OUTOFMEMORY), plugin_dl.dl.length);
+ report_error(report, ER_OUTOFMEMORY, plugin_dl.dl.length);
DBUG_RETURN(0);
}
plugin_dl.dl.length= copy_and_convert(plugin_dl.dl.str, plugin_dl.dl.length,
@@ -503,19 +515,13 @@ static st_plugin_dl *plugin_dl_add(const
if (! (tmp= plugin_dl_insert_or_reuse(&plugin_dl)))
{
free_plugin_mem(&plugin_dl);
- if (report & REPORT_TO_USER)
- my_error(ER_OUTOFMEMORY, MYF(0), sizeof(struct st_plugin_dl));
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_OUTOFMEMORY), sizeof(struct st_plugin_dl));
+ report_error(report, ER_OUTOFMEMORY, sizeof(struct st_plugin_dl));
DBUG_RETURN(0);
}
DBUG_RETURN(tmp);
#else
DBUG_ENTER("plugin_dl_add");
- if (report & REPORT_TO_USER)
- my_error(ER_FEATURE_DISABLED, MYF(0), "plugin", "HAVE_DLOPEN");
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_FEATURE_DISABLED), "plugin", "HAVE_DLOPEN");
+ report_error(report, ER_FEATURE_DISABLED, "plugin", "HAVE_DLOPEN");
DBUG_RETURN(0);
#endif
}
@@ -632,7 +638,7 @@ static plugin_ref intern_plugin_lock(LEX
/*
For debugging, we do an additional malloc which allows the
memory manager and/or valgrind to track locked references and
- double unlocks to aid resolving reference counting.problems.
+ double unlocks to aid resolving reference counting problems.
*/
if (!(plugin= (plugin_ref) my_malloc_ci(sizeof(pi), MYF(MY_WME))))
DBUG_RETURN(NULL);
@@ -715,10 +721,7 @@ static bool plugin_add(MEM_ROOT *tmp_roo
DBUG_ENTER("plugin_add");
if (plugin_find_internal(name, MYSQL_ANY_PLUGIN))
{
- if (report & REPORT_TO_USER)
- my_error(ER_UDF_EXISTS, MYF(0), name->str);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_UDF_EXISTS), name->str);
+ report_error(report, ER_UDF_EXISTS, name->str);
DBUG_RETURN(TRUE);
}
/* Clear the whole struct to catch future extensions. */
@@ -745,10 +748,7 @@ static bool plugin_add(MEM_ROOT *tmp_roo
strxnmov(buf, sizeof(buf) - 1, "API version for ",
plugin_type_names[plugin->type].str,
" plugin is too different", NullS);
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_OPEN_LIBRARY, MYF(0), dl->str, 0, buf);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_OPEN_LIBRARY), dl->str, 0, buf);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, 0, buf);
goto err;
}
tmp.plugin= plugin;
@@ -777,10 +777,7 @@ static bool plugin_add(MEM_ROOT *tmp_roo
DBUG_RETURN(FALSE);
}
}
- if (report & REPORT_TO_USER)
- my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), name->str);
- if (report & REPORT_TO_LOG)
- sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), name->str);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, name->str);
err:
plugin_dl_del(dl);
DBUG_RETURN(TRUE);
@@ -1002,7 +999,9 @@ static int plugin_initialize(struct st_p
DBUG_ENTER("plugin_initialize");
safe_mutex_assert_owner(&LOCK_plugin);
- DBUG_ASSERT(plugin->state == PLUGIN_IS_UNINITIALIZED);
+ uint state= plugin->state;
+ int ret= 1;
+ DBUG_ASSERT(state == PLUGIN_IS_UNINITIALIZED);
pthread_mutex_unlock(&LOCK_plugin);
@@ -1024,10 +1023,7 @@ static int plugin_initialize(struct st_p
goto err;
}
}
-
- pthread_mutex_lock(&LOCK_plugin);
-
- plugin->state= PLUGIN_IS_READY;
+ state= PLUGIN_IS_READY; // plugin->init() succeeded
if (plugin->plugin->status_vars)
{
@@ -1044,10 +1040,10 @@ static int plugin_initialize(struct st_p
{0, 0, SHOW_UNDEF}
};
if (add_status_vars(array)) // add_status_vars makes a copy
- goto err1;
+ goto err;
#else
if (add_status_vars(plugin->plugin->status_vars))
- goto err1;
+ goto err;
#endif /* FIX_LATER */
}
@@ -1067,11 +1063,12 @@ static int plugin_initialize(struct st_p
}
}
- DBUG_RETURN(0);
+ ret= 0;
+
err:
pthread_mutex_lock(&LOCK_plugin);
-err1:
- DBUG_RETURN(1);
+ plugin->state= state;
+ DBUG_RETURN(ret);
}
@@ -1736,7 +1733,16 @@ bool mysql_uninstall_plugin(THD *thd, co
DBUG_RETURN(TRUE);
pthread_mutex_lock(&LOCK_plugin);
- if (!(plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))
+ /*
+ Note - it's important that UNINSTALL PLUGIN does not "see" plugins
+ in the intermediate states. To avoid deadlocks and improve concurrency
+ LOCK_plugin is often released when a work is done on a plugin in
+ the intermediate state (e.g. plugin initialization happens outside of
+ LOCK_plugin). Thus we should not allow a plugin to be dropped until
+ it reaches one of the final states.
+ */
+ if (!(plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)) ||
+ !(plugin->state == PLUGIN_IS_READY || plugin->state == PLUGIN_IS_DISABLED))
{
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str);
goto err;
@@ -2087,7 +2093,7 @@ static int check_func_set(THD *thd, stru
{
if (value->val_int(value, (long long *)&result))
goto err;
- if (unlikely((result >= (ULL(1) << typelib->count)) &&
+ if (unlikely((result >= (1ULL << typelib->count)) &&
(typelib->count < sizeof(long)*8)))
{
llstr(result, buff);
@@ -2823,7 +2829,7 @@ static void plugin_opt_set_limits(struct
options->typelib= ((sysvar_set_t*) opt)->typelib;
options->def_value= ((sysvar_set_t*) opt)->def_val;
options->min_value= options->block_size= 0;
- options->max_value= (ULL(1) << options->typelib->count) - 1;
+ options->max_value= (1ULL << options->typelib->count) - 1;
break;
case PLUGIN_VAR_BOOL:
options->var_type= GET_BOOL;
@@ -2865,7 +2871,7 @@ static void plugin_opt_set_limits(struct
options->typelib= ((thdvar_set_t*) opt)->typelib;
options->def_value= ((thdvar_set_t*) opt)->def_val;
options->min_value= options->block_size= 0;
- options->max_value= (ULL(1) << options->typelib->count) - 1;
+ options->max_value= (1ULL << options->typelib->count) - 1;
break;
case PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL:
options->var_type= GET_BOOL;
=== modified file 'sql/sql_plugin.h'
--- a/sql/sql_plugin.h 2009-01-26 16:03:39 +0000
+++ b/sql/sql_plugin.h 2009-05-04 17:14:38 +0000
@@ -35,16 +35,6 @@ class sys_var;
#define INITIAL_LEX_PLUGIN_LIST_SIZE 16
-/*
- the following #define adds server-only members to enum_mysql_show_type,
- that is defined in plugin.h
-*/
-#define SHOW_FUNC SHOW_FUNC, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_LONGLONG, \
- SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, SHOW_HAVE, \
- SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, SHOW_LONG_NOFLUSH, \
- SHOW_LONGLONG_STATUS
-#include <mysql/plugin.h>
-#undef SHOW_FUNC
typedef enum enum_mysql_show_type SHOW_TYPE;
typedef struct st_mysql_show_var SHOW_VAR;
=== added file 'sql/sql_plugin_services.h'
--- a/sql/sql_plugin_services.h 1970-01-01 00:00:00 +0000
+++ b/sql/sql_plugin_services.h 2009-04-30 16:22:40 +0000
@@ -0,0 +1,44 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/* support for Services */
+#include <service_versions.h>
+
+struct st_service_ref {
+ const char *name;
+ uint version;
+ void *service;
+};
+
+static struct my_snprintf_service_st my_snprintf_handler = {
+ my_snprintf,
+ my_vsnprintf
+};
+
+static struct thd_alloc_service_st thd_alloc_handler= {
+ thd_alloc,
+ thd_calloc,
+ thd_strdup,
+ thd_strmake,
+ thd_memdup,
+ thd_make_lex_string
+};
+
+static struct st_service_ref list_of_services[]=
+{
+ { "my_snprintf_service", VERSION_my_snprintf, &my_snprintf_handler },
+ { "thd_alloc_service", VERSION_thd_alloc, &thd_alloc_handler }
+};
+
=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc 2009-04-16 10:06:41 +0000
+++ b/sql/sql_prepare.cc 2009-05-14 14:27:03 +0000
@@ -2003,29 +2003,6 @@ static bool check_prepared_statement(Pre
Note that we don't need to have cases in this list if they are
marked with CF_STATUS_COMMAND in sql_command_flags
*/
- case SQLCOM_SHOW_PROCESSLIST:
- case SQLCOM_SHOW_STORAGE_ENGINES:
- case SQLCOM_SHOW_PRIVILEGES:
- case SQLCOM_SHOW_ENGINE_LOGS:
- case SQLCOM_SHOW_ENGINE_STATUS:
- case SQLCOM_SHOW_ENGINE_MUTEX:
- case SQLCOM_SHOW_CREATE_DB:
- case SQLCOM_SHOW_GRANTS:
- case SQLCOM_SHOW_BINLOG_EVENTS:
- case SQLCOM_SHOW_MASTER_STAT:
- case SQLCOM_SHOW_SLAVE_STAT:
- case SQLCOM_SHOW_CREATE_PROC:
- case SQLCOM_SHOW_CREATE_FUNC:
- case SQLCOM_SHOW_CREATE_EVENT:
- case SQLCOM_SHOW_CREATE_TRIGGER:
- case SQLCOM_SHOW_CREATE:
- case SQLCOM_SHOW_PROC_CODE:
- case SQLCOM_SHOW_FUNC_CODE:
- case SQLCOM_SHOW_AUTHORS:
- case SQLCOM_SHOW_CONTRIBUTORS:
- case SQLCOM_SHOW_WARNS:
- case SQLCOM_SHOW_ERRORS:
- case SQLCOM_SHOW_BINLOGS:
case SQLCOM_DROP_TABLE:
case SQLCOM_RENAME_TABLE:
case SQLCOM_ALTER_TABLE:
=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc 2009-04-30 14:51:06 +0000
+++ b/sql/sql_repl.cc 2009-05-14 21:49:53 +0000
@@ -235,24 +235,11 @@ bool log_in_use(const char* log_name)
bool purge_error_message(THD* thd, int res)
{
- uint errmsg= 0;
+ uint errcode;
- switch (res) {
- case 0: break;
- case LOG_INFO_EOF: errmsg= ER_UNKNOWN_TARGET_BINLOG; break;
- case LOG_INFO_IO: errmsg= ER_IO_ERR_LOG_INDEX_READ; break;
- case LOG_INFO_INVALID:errmsg= ER_BINLOG_PURGE_PROHIBITED; break;
- case LOG_INFO_SEEK: errmsg= ER_FSEEK_FAIL; break;
- case LOG_INFO_MEM: errmsg= ER_OUT_OF_RESOURCES; break;
- case LOG_INFO_FATAL: errmsg= ER_BINLOG_PURGE_FATAL_ERR; break;
- case LOG_INFO_IN_USE: errmsg= ER_LOG_IN_USE; break;
- case LOG_INFO_EMFILE: errmsg= ER_BINLOG_PURGE_EMFILE; break;
- default: errmsg= ER_LOG_PURGE_UNKNOWN_ERR; break;
- }
-
- if (errmsg)
+ if ((errcode= purge_log_get_error_code(res)) != 0)
{
- my_message(errmsg, ER(errmsg), MYF(0));
+ my_message(errcode, ER(errcode), MYF(0));
return TRUE;
}
my_ok(thd);
@@ -471,7 +458,7 @@ void mysql_binlog_send(THD* thd, char* l
struct event_coordinates coord_buf;
struct timespec *heartbeat_ts= NULL;
struct event_coordinates *coord= NULL;
- if (heartbeat_period != LL(0))
+ if (heartbeat_period != 0LL)
{
heartbeat_ts= &heartbeat_buf;
set_timespec_nsec(*heartbeat_ts, 0);
@@ -843,11 +830,11 @@ impossible position";
{
if (coord)
{
- DBUG_ASSERT(heartbeat_ts && heartbeat_period != LL(0));
+ DBUG_ASSERT(heartbeat_ts && heartbeat_period != 0LL);
set_timespec_nsec(*heartbeat_ts, heartbeat_period);
}
ret= mysql_bin_log.wait_for_update_bin_log(thd, heartbeat_ts);
- DBUG_ASSERT(ret == 0 || heartbeat_period != LL(0) && coord != NULL);
+ DBUG_ASSERT(ret == 0 || heartbeat_period != 0LL && coord != NULL);
if (ret == ETIMEDOUT || ret == ETIME)
{
#ifndef DBUG_OFF
@@ -1459,7 +1446,7 @@ bool change_master(THD* thd, Master_info
else
mi->heartbeat_period= (float) min(SLAVE_MAX_HEARTBEAT_PERIOD,
(slave_net_timeout/2.0));
- mi->received_heartbeats= LL(0); // counter lives until master is CHANGEd
+ mi->received_heartbeats= 0LL; // counter lives until master is CHANGEd
/*
reset the last time server_id list if the current CHANGE MASTER
is mentioning IGNORE_SERVER_IDS= (...)
@@ -1516,9 +1503,11 @@ bool change_master(THD* thd, Master_info
if (lex_mi->relay_log_name)
{
need_relay_log_purge= 0;
- strmake(mi->rli->group_relay_log_name,lex_mi->relay_log_name,
+ char relay_log_name[FN_REFLEN];
+ mi->rli->relay_log.make_log_name(relay_log_name, lex_mi->relay_log_name);
+ strmake(mi->rli->group_relay_log_name, relay_log_name,
sizeof(mi->rli->group_relay_log_name)-1);
- strmake(mi->rli->event_relay_log_name,lex_mi->relay_log_name,
+ strmake(mi->rli->event_relay_log_name, relay_log_name,
sizeof(mi->rli->event_relay_log_name)-1);
}
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2009-05-07 20:48:24 +0000
+++ b/sql/sql_select.cc 2009-05-14 21:49:53 +0000
@@ -2220,7 +2220,7 @@ JOIN::reinit()
unit->offset_limit_cnt= (ha_rows)(select_lex->offset_limit ?
select_lex->offset_limit->val_uint() :
- ULL(0));
+ 0ULL);
first_record= 0;
@@ -8322,7 +8322,7 @@ inline void add_cond_and_fix(Item **e1,
@code
SELECT A.f2 FROM t1 LEFT JOIN t2 A ON A.f2 = f1
WHERE A.f3=(SELECT MIN(f3) FROM t2 C WHERE A.f4 = C.f4) OR A.f3 IS NULL;
- @endocde
+ @endcode
Here condition A.f3 IS NOT NULL is going to be added to the WHERE
condition of the embedding query.
Another example:
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2009-05-07 20:48:24 +0000
+++ b/sql/sql_show.cc 2009-05-15 08:00:35 +0000
@@ -1713,6 +1713,30 @@ public:
template class I_List<thread_info>;
#endif
+static const char *thread_state_info(THD *tmp)
+{
+#ifndef EMBEDDED_LIBRARY
+ if (tmp->net.reading_or_writing)
+ {
+ if (tmp->net.reading_or_writing == 2)
+ return "Writing to net";
+ else if (tmp->command == COM_SLEEP)
+ return NULL;
+ else
+ return "Reading from net";
+ }
+ else
+#endif
+ {
+ if (tmp->proc_info)
+ return tmp->proc_info;
+ else if (tmp->mysys_var && tmp->mysys_var->current_cond)
+ return "Waiting on cond";
+ else
+ return NULL;
+ }
+}
+
void mysqld_list_processes(THD *thd,const char *user, bool verbose)
{
Item *field;
@@ -1775,19 +1799,7 @@ void mysqld_list_processes(THD *thd,cons
if ((mysys_var= tmp->mysys_var))
pthread_mutex_lock(&mysys_var->mutex);
thd_info->proc_info= (char*) (tmp->killed == THD::KILL_CONNECTION? "Killed" : 0);
-#ifndef EMBEDDED_LIBRARY
- thd_info->state_info= (char*) (tmp->net.reading_or_writing ?
- (tmp->net.reading_or_writing == 2 ?
- "Writing to net" :
- thd_info->command == COM_SLEEP ? NullS :
- "Reading from net") :
- tmp->proc_info ? tmp->proc_info :
- tmp->mysys_var &&
- tmp->mysys_var->current_cond ?
- "Waiting on cond" : NullS);
-#else
- thd_info->state_info= (char*)"Writing to net";
-#endif
+ thd_info->state_info= thread_state_info(tmp);
if (mysys_var)
pthread_mutex_unlock(&mysys_var->mutex);
pthread_mutex_unlock(&tmp->LOCK_delete);
@@ -1902,20 +1914,7 @@ int fill_schema_processlist(THD* thd, TA
table->field[5]->store((longlong)(tmp->start_time ?
now - tmp->start_time : 0), FALSE);
/* STATE */
-#ifndef EMBEDDED_LIBRARY
- val= (char*) (tmp->net.reading_or_writing ?
- (tmp->net.reading_or_writing == 2 ?
- "Writing to net" :
- tmp->command == COM_SLEEP ? NullS :
- "Reading from net") :
- tmp->proc_info ? tmp->proc_info :
- tmp->mysys_var &&
- tmp->mysys_var->current_cond ?
- "Waiting on cond" : NullS);
-#else
- val= (char *) "Writing to net";
-#endif
- if (val)
+ if ((val= thread_state_info(tmp)))
{
table->field[6]->store(val, strlen(val), cs);
table->field[6]->set_notnull();
@@ -3166,13 +3165,31 @@ static int fill_schema_table_from_frm(TH
int error;
char key[MAX_DBKEY_LENGTH];
uint key_length;
+ char db_name_buff[NAME_LEN + 1], table_name_buff[NAME_LEN + 1];
MDL_request mdl_request;
bzero((char*) &table_list, sizeof(TABLE_LIST));
bzero((char*) &tbl, sizeof(TABLE));
- table_list.table_name= table_name->str;
- table_list.db= db_name->str;
+ if (lower_case_table_names)
+ {
+ /*
+ In lower_case_table_names > 0 metadata locking and table definition
+ cache subsystems require normalized (lowercased) database and table
+ names as input.
+ */
+ strmov(db_name_buff, db_name->str);
+ strmov(table_name_buff, table_name->str);
+ my_casedn_str(files_charset_info, db_name_buff);
+ my_casedn_str(files_charset_info, table_name_buff);
+ table_list.db= db_name_buff;
+ table_list.table_name= table_name_buff;
+ }
+ else
+ {
+ table_list.table_name= table_name->str;
+ table_list.db= db_name->str;
+ }
/*
TODO: investigate if in this particular situation we can get by
=== modified file 'sql/sql_string.cc'
--- a/sql/sql_string.cc 2009-03-24 14:24:44 +0000
+++ b/sql/sql_string.cc 2009-04-24 10:04:14 +0000
@@ -34,7 +34,6 @@
*/
extern uchar* sql_alloc(unsigned size);
-extern void sql_element_free(void *ptr);
#include "sql_string.h"
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2009-05-07 20:48:24 +0000
+++ b/sql/sql_table.cc 2009-05-15 08:00:35 +0000
@@ -1498,6 +1498,8 @@ bool mysql_rm_table(THD *thd,TABLE_LIST
my_bool drop_temporary)
{
bool error, need_start_waiting= FALSE;
+ Drop_table_error_handler err_handler(thd->get_internal_handler());
+
DBUG_ENTER("mysql_rm_table");
/* mark for close and remove all cached entries */
@@ -1509,7 +1511,9 @@ bool mysql_rm_table(THD *thd,TABLE_LIST
DBUG_RETURN(TRUE);
}
+ thd->push_internal_handler(&err_handler);
error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 0, 0);
+ thd->pop_internal_handler();
if (need_start_waiting)
start_waiting_global_read_lock(thd);
@@ -1649,9 +1653,6 @@ int mysql_rm_table_part2(THD *thd, TABLE
}
}
- /* Don't give warnings for not found errors, as we already generate notes */
- thd->no_warnings_for_error= 1;
-
for (table= tables; table; table= table->next_local)
{
char *db=table->db;
@@ -1793,11 +1794,18 @@ int mysql_rm_table_part2(THD *thd, TABLE
wrong_tables.append(',');
wrong_tables.append(String(table->table_name,system_charset_info));
}
+
+ DBUG_EXECUTE_IF("bug43138",
+ my_printf_error(ER_BAD_TABLE_ERROR,
+ ER(ER_BAD_TABLE_ERROR), MYF(0),
+ table->table_name););
+
DBUG_PRINT("table", ("table: %p s: %p", table->table,
table->table ? table->table->s : (TABLE_SHARE *)-1));
}
thd->thread_specific_used|= tmp_table_deleted;
error= 0;
+
if (wrong_tables.length())
{
if (!foreign_key_error)
@@ -1890,7 +1898,6 @@ err:
}
end:
- thd->no_warnings_for_error= 0;
DBUG_RETURN(error);
}
@@ -3593,7 +3600,7 @@ bool mysql_create_table_no_lock(THD *thd
Then she could create the table. This case is pretty obscure and
therefore we don't introduce a new error message only for it.
*/
- if (get_cached_table_share(db, alias))
+ if (get_cached_table_share(db, table_name))
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
goto unlock_and_end;
=== modified file 'sql/sql_udf.h'
--- a/sql/sql_udf.h 2007-07-06 12:18:49 +0000
+++ b/sql/sql_udf.h 2009-05-14 21:49:53 +0000
@@ -99,14 +99,14 @@ class udf_handler :public Sql_alloc
if (get_arguments())
{
*null_value=1;
- return LL(0);
+ return 0LL;
}
Udf_func_longlong func= (Udf_func_longlong) u_d->func;
longlong tmp=func(&initid, &f_args, &is_null, &error);
if (is_null || error)
{
*null_value=1;
- return LL(0);
+ return 0LL;
}
*null_value=0;
return tmp;
=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc 2009-04-08 23:46:45 +0000
+++ b/sql/sql_update.cc 2009-05-07 11:44:40 +0000
@@ -338,6 +338,7 @@ int mysql_update(THD *thd,
/* Update the table->file->stats.records number */
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
+ table->mark_columns_needed_for_update();
select= make_select(table, 0, 0, conds, 0, &error);
if (error || !limit ||
(select && select->check_quick(thd, safe_update, limit)))
@@ -368,7 +369,6 @@ int mysql_update(THD *thd,
}
init_ftfuncs(thd, select_lex, 1);
- table->mark_columns_needed_for_update();
/* Check if we are modifying a key that we are used to search with */
=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy 2009-05-07 20:48:24 +0000
+++ b/sql/sql_yacc.yy 2009-05-11 17:58:07 +0000
@@ -3736,7 +3736,8 @@ change_ts_option:
;
tablespace_option_list:
- tablespace_options
+ /* empty */
+ | tablespace_options
;
tablespace_options:
@@ -3757,7 +3758,8 @@ tablespace_option:
;
alter_tablespace_option_list:
- alter_tablespace_options
+ /* empty */
+ | alter_tablespace_options
;
alter_tablespace_options:
@@ -3775,7 +3777,8 @@ alter_tablespace_option:
;
logfile_group_option_list:
- logfile_group_options
+ /* empty */
+ | logfile_group_options
;
logfile_group_options:
@@ -3795,7 +3798,8 @@ logfile_group_option:
;
alter_logfile_group_option_list:
- alter_logfile_group_options
+ /* empty */
+ | alter_logfile_group_options
;
alter_logfile_group_options:
@@ -3965,11 +3969,6 @@ opt_ts_engine:
}
;
-opt_ts_wait:
- /* empty */
- | ts_wait
- ;
-
ts_wait:
WAIT_SYM
{
@@ -10163,12 +10162,12 @@ drop:
lex->drop_if_exists= $3;
lex->spname= $4;
}
- | DROP TABLESPACE tablespace_name opt_ts_engine opt_ts_wait
+ | DROP TABLESPACE tablespace_name drop_ts_options_list
{
LEX *lex= Lex;
lex->alter_tablespace_info->ts_cmd_type= DROP_TABLESPACE;
}
- | DROP LOGFILE_SYM GROUP_SYM logfile_group_name opt_ts_engine opt_ts_wait
+ | DROP LOGFILE_SYM GROUP_SYM logfile_group_name drop_ts_options_list
{
LEX *lex= Lex;
lex->alter_tablespace_info->ts_cmd_type= DROP_LOGFILE_GROUP;
@@ -10219,6 +10218,21 @@ opt_temporary:
/* empty */ { $$= 0; }
| TEMPORARY { $$= 1; }
;
+
+drop_ts_options_list:
+ /* empty */
+ | drop_ts_options
+
+drop_ts_options:
+ drop_ts_option
+ | drop_ts_options drop_ts_option
+ | drop_ts_options_list ',' drop_ts_option
+ ;
+
+drop_ts_option:
+ opt_ts_engine
+ | ts_wait
+
/*
** Insert : add new data to table
*/
=== modified file 'sql/thr_malloc.cc'
--- a/sql/thr_malloc.cc 2009-02-04 20:48:02 +0000
+++ b/sql/thr_malloc.cc 2009-04-06 18:36:46 +0000
@@ -106,10 +106,6 @@ void* sql_memdup(const void *ptr, size_t
return pos;
}
-void sql_element_free(void *ptr __attribute__((unused)))
-{} /* purecov: deadcode */
-
-
char *sql_strmake_with_convert(const char *str, size_t arg_length,
CHARSET_INFO *from_cs,
=== modified file 'sql/time.cc'
--- a/sql/time.cc 2008-11-18 19:41:51 +0000
+++ b/sql/time.cc 2009-05-14 21:49:53 +0000
@@ -799,19 +799,19 @@ bool date_add_interval(MYSQL_TIME *ltime
sec=((ltime->day-1)*3600*24L+ltime->hour*3600+ltime->minute*60+
ltime->second +
sign* (longlong) (interval.day*3600*24L +
- interval.hour*LL(3600)+interval.minute*LL(60)+
+ interval.hour*3600LL+interval.minute*60LL+
interval.second))+ extra_sec;
if (microseconds < 0)
{
- microseconds+= LL(1000000);
+ microseconds+= 1000000LL;
sec--;
}
- days= sec/(3600*LL(24));
- sec-= days*3600*LL(24);
+ days= sec/(3600*24LL);
+ sec-= days*3600*24LL;
if (sec < 0)
{
days--;
- sec+= 3600*LL(24);
+ sec+= 3600*24LL;
}
ltime->second_part= (uint) microseconds;
ltime->second= (uint) (sec % 60);
@@ -929,13 +929,13 @@ calc_time_diff(MYSQL_TIME *l_time1, MYSQ
(uint) l_time2->day);
}
- microseconds= ((longlong)days*LL(86400) +
+ microseconds= ((longlong)days*86400LL +
(longlong)(l_time1->hour*3600L +
l_time1->minute*60L +
l_time1->second) -
l_sign*(longlong)(l_time2->hour*3600L +
l_time2->minute*60L +
- l_time2->second)) * LL(1000000) +
+ l_time2->second)) * 1000000LL +
(longlong)l_time1->second_part -
l_sign*(longlong)l_time2->second_part;
=== modified file 'sql/transaction.cc'
--- a/sql/transaction.cc 2009-03-06 22:17:00 +0000
+++ b/sql/transaction.cc 2009-05-12 16:41:11 +0000
@@ -18,8 +18,8 @@
#pragma implementation // gcc: Class implementation
#endif
-#include "transaction.h"
#include "mysql_priv.h"
+#include "transaction.h"
#include "rpl_handler.h"
#ifdef WITH_MARIA_STORAGE_ENGINE
@@ -100,11 +100,15 @@ bool trans_begin(THD *thd, uint flags)
DBUG_ASSERT(!thd->locked_tables_mode);
- thd->mdl_context.release_all_locks();
-
if (trans_commit_implicit(thd))
DBUG_RETURN(TRUE);
+ /*
+ Release transactional metadata locks only after the
+ transaction has been committed.
+ */
+ thd->mdl_context.release_all_locks();
+
thd->options|= OPTION_BEGIN;
thd->server_status|= SERVER_STATUS_IN_TRANS;
=== modified file 'storage/archive/archive_performance.c'
--- a/storage/archive/archive_performance.c 2007-10-21 21:19:52 +0000
+++ b/storage/archive/archive_performance.c 2009-05-14 21:49:53 +0000
@@ -37,7 +37,7 @@
char test_string[BUFFER_LEN];
-#define ROWS_TO_TEST LL(2000000)
+#define ROWS_TO_TEST 2000000LL
/* prototypes */
long int timedif(struct timeval a, struct timeval b);
=== modified file 'storage/archive/archive_test.c'
--- a/storage/archive/archive_test.c 2007-10-21 21:57:05 +0000
+++ b/storage/archive/archive_test.c 2009-05-14 21:49:53 +0000
@@ -33,8 +33,8 @@
char test_string[BUFFER_LEN];
-unsigned long long row_lengths[]= {LL(536870912), LL(2147483648), LL(4294967296), LL(8589934592)};
-unsigned long long row_numbers[]= {LL(524288), LL(2097152), LL(4194304), LL(8388608)};
+unsigned long long row_lengths[]= {536870912LL, 2147483648LL, 4294967296LL, 8589934592LL};
+unsigned long long row_numbers[]= {524288LL, 2097152LL, 4194304LL, 8388608LL};
/* prototypes */
int size_test(unsigned long long length, unsigned long long rows_to_test_for, az_method method);
=== modified file 'storage/example/Makefile.am'
--- a/storage/example/Makefile.am 2009-01-07 10:58:33 +0000
+++ b/storage/example/Makefile.am 2009-04-25 21:20:45 +0000
@@ -33,7 +33,7 @@ noinst_HEADERS = ha_example.h
EXTRA_LTLIBRARIES = ha_example.la
pkgplugin_LTLIBRARIES = @plugin_example_shared_target@
-ha_example_la_LDFLAGS = -module -rpath $(pkgplugindir)
+ha_example_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
ha_example_la_CPPFLAGS= $(AM_CPPFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_example_la_SOURCES = ha_example.cc
=== modified file 'storage/example/ha_example.cc'
--- a/storage/example/ha_example.cc 2009-01-27 02:08:48 +0000
+++ b/storage/example/ha_example.cc 2009-04-25 21:20:45 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (C) 2003 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -890,6 +890,24 @@ static struct st_mysql_sys_var* example_
NULL
};
+// this is an example of SHOW_FUNC and of my_snprintf() service
+static int show_func_example(MYSQL_THD *thd, struct st_mysql_show_var *var,
+ char *buf)
+{
+ var->type= SHOW_CHAR;
+ var->value= buf; // it's of SHOW_VAR_FUNC_BUFF_SIZE bytes
+ my_snprintf(buf, SHOW_VAR_FUNC_BUFF_SIZE,
+ "enum_var is %u, ulong_var is %lu, %.6b", // %b is MySQL extension
+ srv_enum_var, srv_ulong_var, "really");
+ return 0;
+}
+
+static struct st_mysql_show_var func_status[]=
+{
+ {"example_func_example", (char *)show_func_example, SHOW_FUNC},
+ {0,0,SHOW_UNDEF}
+};
+
mysql_declare_plugin(example)
{
MYSQL_STORAGE_ENGINE_PLUGIN,
@@ -901,7 +919,7 @@ mysql_declare_plugin(example)
example_init_func, /* Plugin Init */
example_done_func, /* Plugin Deinit */
0x0001 /* 0.1 */,
- NULL, /* status variables */
+ func_status, /* status variables */
example_system_variables, /* system variables */
NULL /* config options */
}
=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp 2009-03-31 18:19:17 +0000
+++ b/storage/falcon/ha_falcon.cpp 2009-05-14 21:49:53 +0000
@@ -102,7 +102,7 @@ FILE *falcon_log_file;
// Determine the largest memory address, assume 64-bits max
-static const ulonglong MSB = ULL(1) << ((sizeof(void *)*8 - 1) & 63);
+static const ulonglong MSB = 1ULL << ((sizeof(void *)*8 - 1) & 63);
ulonglong max_memory_address = MSB | (MSB - 1);
// These are the isolation levels we actually use.
@@ -3018,7 +3018,7 @@ void StorageInterface::encodeRecord(ucha
// encode it as a BigInt to support unsigned values
// with the MSB set in the index
- if (((Field_num*)field)->unsigned_flag && (temp & LL(0x8000000000000000)))
+ if (((Field_num*)field)->unsigned_flag && (temp & 0x8000000000000000ULL))
{
BigInt bigInt;
bigInt.set((uint64)temp);
@@ -4011,12 +4011,12 @@ static MYSQL_SYSVAR_STR(scavenge_schedul
static MYSQL_SYSVAR_ULONGLONG(record_memory_max, falcon_record_memory_max,
PLUGIN_VAR_RQCMDARG, // | PLUGIN_VAR_READONLY,
"The maximum size of the record memory cache.",
- NULL, StorageInterface::updateRecordMemoryMax, LL(250)<<20, 0, (ulonglong) max_memory_address, LL(1)<<20);
+ NULL, StorageInterface::updateRecordMemoryMax, 250LL<<20, 0, (ulonglong) max_memory_address, 1LL<<20);
static MYSQL_SYSVAR_ULONGLONG(serial_log_file_size, falcon_serial_log_file_size,
PLUGIN_VAR_RQCMDARG,
"If serial log file grows larger than this value, it will be truncated when it is reused",
- NULL, NULL , LL(10)<<20, LL(1)<<20,LL(0x7fffffffffffffff), LL(1)<<20);
+ NULL, NULL , 10LL<<20, 1LL<<20,0x7fffffffffffffffLL, 1LL<<20);
/***
static MYSQL_SYSVAR_UINT(allocation_extent, falcon_allocation_extent,
@@ -4028,7 +4028,7 @@ static MYSQL_SYSVAR_UINT(allocation_exte
static MYSQL_SYSVAR_ULONGLONG(page_cache_size, falcon_page_cache_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"The amount of memory to be used for the database page cache.",
- NULL, NULL, LL(4)<<20, LL(2)<<20, (ulonglong) max_memory_address, LL(1)<<20);
+ NULL, NULL, 4LL<<20, 2LL<<20, (ulonglong) max_memory_address, 1LL<<20);
static MYSQL_THDVAR_BOOL(consistent_read, PLUGIN_VAR_OPCMDARG,
"Enable Consistent Read Mode for Repeatable Reads",
=== removed file 'storage/heap/make-ccc'
--- a/storage/heap/make-ccc 2005-04-27 01:19:54 +0000
+++ b/storage/heap/make-ccc 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
-ccc -I./../include -I../include -DDBUG_OFF -fast -O3 -c _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c hp_delete.c hp_extra.c hp_hash.c hp_info.c hp_open.c hp_panic.c hp_rename.c hp_rfirst.c hp_rkey.c hp_rlast.c hp_rnext.c hp_rprev.c hp_rrnd.c hp_rsame.c hp_scan.c hp_static.c hp_update.c hp_write.c
-rm libheap.a
-ar -cr libheap.a _check.o
-
=== modified file 'storage/maria/Makefile.am'
--- a/storage/maria/Makefile.am 2009-02-16 21:18:45 +0000
+++ b/storage/maria/Makefile.am 2009-04-06 18:36:46 +0000
@@ -30,7 +30,7 @@ DEFS = @DEFS@
SUBDIRS = . unittest
EXTRA_DIST = ma_test_all.sh ma_test_all.res ma_test_big.sh \
- ma_ft_stem.c CMakeLists.txt plug.in ma_test_recovery
+ CMakeLists.txt plug.in ma_test_recovery
pkgdata_DATA = ma_test_all ma_test_all.res ma_test_recovery
pkglib_LIBRARIES = libmaria.a
bin_PROGRAMS = maria_chk maria_pack maria_ftdump maria_read_log \
@@ -72,8 +72,8 @@ maria_dump_log_SOURCES= ma_loghandler.c
maria_dump_log_CPPFLAGS= $(AM_CPPFLAGS) -DMARIA_DUMP_LOG
noinst_PROGRAMS = ma_test1 ma_test2 ma_test3 ma_rt_test ma_sp_test
noinst_HEADERS = maria_def.h ma_rt_index.h ma_rt_key.h ma_rt_mbr.h \
- ma_sp_defs.h ma_fulltext.h ma_ftdefs.h ma_ft_test1.h \
- ma_ft_eval.h trnman.h lockman.h tablockman.h \
+ ma_sp_defs.h ma_fulltext.h ma_ftdefs.h \
+ trnman.h lockman.h tablockman.h \
ma_control_file.h ha_maria.h ma_blockrec.h \
ma_loghandler.h ma_loghandler_lsn.h ma_pagecache.h \
ma_checkpoint.h ma_recovery.h ma_commit.h ma_state.h \
@@ -97,8 +97,6 @@ ma_test3_LDADD= @CLIENT_EXTRA_LDFLAGS@
$(top_builddir)/mysys/libmysyslt.la \
$(top_builddir)/dbug/libdbuglt.la \
$(top_builddir)/strings/libmystringslt.la @ZLIB_LIBS@
-#ma_ft_test1_DEPENDENCIES= $(LIBRARIES)
-#ma_ft_eval_DEPENDENCIES= $(LIBRARIES)
maria_ftdump_DEPENDENCIES= $(LIBRARIES)
maria_ftdump_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmaria.a \
$(top_builddir)/storage/myisam/libmyisam.a \
=== modified file 'storage/maria/ma_bitmap.c'
--- a/storage/maria/ma_bitmap.c 2009-02-10 14:51:40 +0000
+++ b/storage/maria/ma_bitmap.c 2009-05-14 21:49:53 +0000
@@ -944,7 +944,7 @@ static my_bool allocate_head(MARIA_FILE_
a full page or a tail page
*/
if ((!bits && best_data) ||
- ((bits & LL(04444444444444444)) == LL(04444444444444444)))
+ ((bits & 04444444444444444LL) == 04444444444444444LL))
continue;
for (i= 0; i < 16 ; i++, bits >>= 3)
{
@@ -1029,8 +1029,8 @@ static my_bool allocate_tail(MARIA_FILE_
quite common case if we have blobs.
*/
- if ((!bits && best_data) || bits == LL(0xffffffffffff) ||
- bits == LL(04444444444444444))
+ if ((!bits && best_data) || bits == 0xffffffffffffLL ||
+ bits == 04444444444444444LL)
continue;
for (i= 0; i < 16; i++, bits >>= 3)
{
@@ -1160,14 +1160,14 @@ static ulong allocate_full_pages(MARIA_F
bits= prefix_bits= uint6korr(data_start - 6);
DBUG_ASSERT(bits != 0);
/* 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 */
- if (!(bits & LL(07000000000000000)))
+ if (!(bits & 07000000000000000LL))
{
data_start-= 6;
do
{
prefix_area_size++;
bits<<= 3;
- } while (!(bits & LL(07000000000000000)));
+ } while (!(bits & 07000000000000000LL));
area_size+= prefix_area_size;
/* Calculate offset to page from data_start */
prefix_area_size= 16 - prefix_area_size;
@@ -1217,11 +1217,11 @@ static ulong allocate_full_pages(MARIA_F
best_prefix_area_size= 16 - best_prefix_area_size;
if (best_area_size < best_prefix_area_size)
{
- tmp= (LL(1) << best_area_size*3) - 1;
+ tmp= (1LL << best_area_size*3) - 1;
best_area_size= best_prefix_area_size; /* for easy end test */
}
else
- tmp= (LL(1) << best_prefix_area_size*3) - 1;
+ tmp= (1LL << best_prefix_area_size*3) - 1;
tmp<<= (16 - best_prefix_area_size) * 3;
DBUG_ASSERT((best_prefix_bits & tmp) == 0);
best_prefix_bits|= tmp;
=== modified file 'storage/maria/ma_blockrec.c'
--- a/storage/maria/ma_blockrec.c 2009-02-05 22:38:30 +0000
+++ b/storage/maria/ma_blockrec.c 2009-05-14 21:49:53 +0000
@@ -5238,7 +5238,7 @@ restart_bitmap_scan:
{
bits= uint6korr(data);
/* Skip not allocated pages and blob / full tail pages */
- if (bits && bits != LL(07777777777777777))
+ if (bits && bits != 07777777777777777LL)
break;
}
bit_pos= 0;
@@ -5296,8 +5296,6 @@ my_bool _ma_compare_block_record(MARIA_H
NOTES
This is mostly used to store field numbers and lengths of strings.
- We have to cast the result for the LL() becasue of a bug in Forte CC
- compiler.
Packing used is:
nr < 251 is stored as is (in 1 byte)
=== modified file 'storage/maria/ma_create.c'
--- a/storage/maria/ma_create.c 2009-02-13 16:30:54 +0000
+++ b/storage/maria/ma_create.c 2009-05-14 21:49:53 +0000
@@ -1214,19 +1214,19 @@ uint maria_get_pointer_length(ulonglong
if (file_length) /* If not default */
{
#ifdef NOT_YET_READY_FOR_8_BYTE_POINTERS
- if (file_length >= (ULL(1) << 56))
+ if (file_length >= (1ULL << 56))
def=8;
else
#endif
- if (file_length >= (ULL(1) << 48))
+ if (file_length >= (1ULL << 48))
def=7;
- else if (file_length >= (ULL(1) << 40))
+ else if (file_length >= (1ULL << 40))
def=6;
- else if (file_length >= (ULL(1) << 32))
+ else if (file_length >= (1ULL << 32))
def=5;
- else if (file_length >= (ULL(1) << 24))
+ else if (file_length >= (1ULL << 24))
def=4;
- else if (file_length >= (ULL(1) << 16))
+ else if (file_length >= (1ULL << 16))
def=3;
else
def=2;
=== removed file 'storage/maria/ma_ft_eval.c'
--- a/storage/maria/ma_ft_eval.c 2008-05-29 15:44:11 +0000
+++ b/storage/maria/ma_ft_eval.c 1970-01-01 00:00:00 +0000
@@ -1,254 +0,0 @@
-/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult 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
- the Free Software Foundation; version 2 of the License.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code
- added support for long options (my_getopt) 22.5.2002 by Jani Tolonen */
-
-#include "ma_ftdefs.h"
-#include "maria_ft_eval.h"
-#include <stdarg.h>
-#include <my_getopt.h>
-
-static void print_error(int exit_code, const char *fmt,...);
-static void get_options(int argc, char *argv[]);
-static int create_record(char *pos, FILE *file);
-static void usage();
-
-static struct my_option my_long_options[] =
-{
- {"", 's', "", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'q', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'S', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", '#', "", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'V', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", '?', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'h', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
-};
-
-int main(int argc, char *argv[])
-{
- MARIA_HA *file;
- int i,j;
-
- MY_INIT(argv[0]);
- get_options(argc,argv);
- bzero((char*)recinfo,sizeof(recinfo));
-
- maria_init();
- /* First define 2 columns */
- recinfo[0].type=FIELD_SKIP_ENDSPACE;
- recinfo[0].length=docid_length;
- recinfo[1].type=FIELD_BLOB;
- recinfo[1].length= 4+portable_sizeof_char_ptr;
-
- /* Define a key over the first column */
- keyinfo[0].seg=keyseg;
- keyinfo[0].keysegs=1;
- keyinfo[0].block_length= 0; /* Default block length */
- keyinfo[0].seg[0].type= HA_KEYTYPE_TEXT;
- keyinfo[0].seg[0].flag= HA_BLOB_PART;
- keyinfo[0].seg[0].start=recinfo[0].length;
- keyinfo[0].seg[0].length=key_length;
- keyinfo[0].seg[0].null_bit=0;
- keyinfo[0].seg[0].null_pos=0;
- keyinfo[0].seg[0].bit_start=4;
- keyinfo[0].seg[0].language=MY_CHARSET_CURRENT;
- keyinfo[0].flag = HA_FULLTEXT;
-
- if (!silent)
- printf("- Creating isam-file\n");
- if (maria_create(filename,1,keyinfo,2,recinfo,0,NULL,(MARIA_CREATE_INFO*) 0,0))
- goto err;
- if (!(file=maria_open(filename,2,0)))
- goto err;
- if (!silent)
- printf("Initializing stopwords\n");
- maria_ft_init_stopwords(stopwordlist);
-
- if (!silent)
- printf("- Writing key:s\n");
-
- my_errno=0;
- i=0;
- while (create_record(record,df))
- {
- error=maria_write(file,record);
- if (error)
- printf("I= %2d maria_write: %d errno: %d\n",i,error,my_errno);
- i++;
- }
- fclose(df);
-
- if (maria_close(file)) goto err;
- if (!silent)
- printf("- Reopening file\n");
- if (!(file=maria_open(filename,2,0))) goto err;
- if (!silent)
- printf("- Reading rows with key\n");
- for (i=1;create_record(record,qf);i++)
- {
- FT_DOCLIST *result;
- double w;
- int t, err;
-
- result=maria_ft_nlq_init_search(file,0,blob_record,(uint) strlen(blob_record),1);
- if (!result)
- {
- printf("Query %d failed with errno %3d\n",i,my_errno);
- goto err;
- }
- if (!silent)
- printf("Query %d. Found: %d.\n",i,result->ndocs);
- for (j=0;(err=maria_ft_nlq_read_next(result, read_record))==0;j++)
- {
- t=uint2korr(read_record);
- w=maria_ft_nlq_get_relevance(result);
- printf("%d %.*s %f\n",i,t,read_record+2,w);
- }
- if (err != HA_ERR_END_OF_FILE)
- {
- printf("maria_ft_read_next %d failed with errno %3d\n",j,my_errno);
- goto err;
- }
- maria_ft_nlq_close_search(result);
- }
-
- if (maria_close(file)) goto err;
- maria_end();
- my_end(MY_CHECK_ERROR);
-
- return (0);
-
- err:
- printf("got error: %3d when using maria-database\n",my_errno);
- return 1; /* skip warning */
-
-}
-
-
-static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
-{
- switch (optid) {
- case 's':
- if (stopwordlist && stopwordlist != maria_ft_precompiled_stopwords)
- break;
- {
- FILE *f; char s[HA_FT_MAXLEN]; int i=0,n=SWL_INIT;
-
- if (!(stopwordlist=(const char**) malloc(n*sizeof(char *))))
- print_error(1,"malloc(%d)",n*sizeof(char *));
- if (!(f=fopen(argument,"r")))
- print_error(1,"fopen(%s)",argument);
- while (!feof(f))
- {
- if (!(fgets(s,HA_FT_MAXLEN,f)))
- print_error(1,"fgets(s,%d,%s)",HA_FT_MAXLEN,argument);
- if (!(stopwordlist[i++]=strdup(s)))
- print_error(1,"strdup(%s)",s);
- if (i >= n)
- {
- n+=SWL_PLUS;
- if (!(stopwordlist=(const char**) realloc((char*) stopwordlist,
- n*sizeof(char *))))
- print_error(1,"realloc(%d)",n*sizeof(char *));
- }
- }
- fclose(f);
- stopwordlist[i]=NULL;
- break;
- }
- case 'q': silent=1; break;
- case 'S': if (stopwordlist==maria_ft_precompiled_stopwords) stopwordlist=NULL; break;
- case '#':
- DBUG_PUSH (argument);
- break;
- case 'V':
- case '?':
- case 'h':
- usage();
- exit(1);
- }
- return 0;
-}
-
-
-static void get_options(int argc, char *argv[])
-{
- int ho_error;
-
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
- exit(ho_error);
-
- if (!(d_file=argv[optind])) print_error(1,"No d_file");
- if (!(df=fopen(d_file,"r")))
- print_error(1,"fopen(%s)",d_file);
- if (!(q_file=argv[optind+1])) print_error(1,"No q_file");
- if (!(qf=fopen(q_file,"r")))
- print_error(1,"fopen(%s)",q_file);
- return;
-} /* get options */
-
-
-static int create_record(char *pos, FILE *file)
-{
- uint tmp; char *ptr;
-
- bzero((char *)pos,MAX_REC_LENGTH);
-
- /* column 1 - VARCHAR */
- if (!(fgets(pos+2,MAX_REC_LENGTH-32,file)))
- {
- if (feof(file))
- return 0;
- else
- print_error(1,"fgets(docid) - 1");
- }
- tmp=(uint) strlen(pos+2)-1;
- int2store(pos,tmp);
- pos+=recinfo[0].length;
-
- /* column 2 - BLOB */
-
- if (!(fgets(blob_record,MAX_BLOB_LENGTH,file)))
- print_error(1,"fgets(docid) - 2");
- tmp=(uint) strlen(blob_record);
- int4store(pos,tmp);
- ptr=blob_record;
- memcpy_fixed(pos+4,&ptr,sizeof(char*));
- return 1;
-}
-
-/* VARARGS */
-
-static void print_error(int exit_code, const char *fmt,...)
-{
- va_list args;
-
- va_start(args,fmt);
- fprintf(stderr,"%s: error: ",my_progname);
- (void)(vfprintf(stderr, fmt, args));
- (void)(fputc('\n',stderr));
- fflush(stderr);
- va_end(args);
- exit(exit_code);
-}
-
-
-static void usage()
-{
- printf("%s [options]\n", my_progname);
- my_print_help(my_long_options);
- my_print_variables(my_long_options);
-}
=== removed file 'storage/maria/ma_ft_eval.h'
--- a/storage/maria/ma_ft_eval.h 2007-03-02 10:20:23 +0000
+++ b/storage/maria/ma_ft_eval.h 1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-/* Copyright (C) 2006 MySQL AB & Sergei A. Golubchik
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-const char **stopwordlist=maria_ft_precompiled_stopwords;
-
-#define MAX_REC_LENGTH 128
-#define MAX_BLOB_LENGTH 60000
-char record[MAX_REC_LENGTH], read_record[MAX_REC_LENGTH+MAX_BLOB_LENGTH];
-char blob_record[MAX_BLOB_LENGTH+20*20];
-
-char *filename= (char*) "EVAL";
-
-int silent=0, error=0;
-
-uint key_length=MAX_BLOB_LENGTH,docid_length=32;
-char *d_file, *q_file;
-FILE *df,*qf;
-
-MARIA_COLUMNDEF recinfo[3];
-MARIA_KEYDEF keyinfo[2];
-HA_KEYSEG keyseg[10];
-
-#define SWL_INIT 500
-#define SWL_PLUS 50
-
-#define MAX_LINE_LENGTH 128
-char line[MAX_LINE_LENGTH];
=== removed file 'storage/maria/ma_ft_stem.c'
--- a/storage/maria/ma_ft_stem.c 2007-03-02 10:20:23 +0000
+++ b/storage/maria/ma_ft_stem.c 1970-01-01 00:00:00 +0000
@@ -1,18 +0,0 @@
-/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult 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
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-/* mulitingual stem */
=== removed file 'storage/maria/ma_ft_test1.c'
--- a/storage/maria/ma_ft_test1.c 2007-04-19 10:18:56 +0000
+++ b/storage/maria/ma_ft_test1.c 1970-01-01 00:00:00 +0000
@@ -1,317 +0,0 @@
-/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult 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
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code
- added support for long options (my_getopt) 22.5.2002 by Jani Tolonen */
-
-#include "ma_ftdefs.h"
-#include "maria_ft_test1.h"
-#include <my_getopt.h>
-
-static int key_field=FIELD_VARCHAR,extra_field=FIELD_SKIP_ENDSPACE;
-static uint key_length=200,extra_length=50;
-static int key_type=HA_KEYTYPE_TEXT;
-static int verbose=0,silent=0,skip_update=0,
- no_keys=0,no_stopwords=0,no_search=0,no_fulltext=0;
-static int create_flag=0,error=0;
-
-#define MAX_REC_LENGTH 300
-static char record[MAX_REC_LENGTH],read_record[MAX_REC_LENGTH];
-
-static int run_test(const char *filename);
-static void get_options(int argc, char *argv[]);
-static void create_record(char *, int);
-static void usage();
-
-static struct my_option my_long_options[] =
-{
- {"", 'v', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", '?', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'h', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'V', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'v', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 's', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'N', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'S', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'K', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'F', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'U', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", '#', "", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
-};
-
-int main(int argc, char *argv[])
-{
- MY_INIT(argv[0]);
-
- get_options(argc,argv);
- maria_init();
-
- exit(run_test("FT1"));
-}
-
-static MARIA_COLUMNDEF recinfo[3];
-static MARIA_KEYDEF keyinfo[2];
-static HA_KEYSEG keyseg[10];
-
-static int run_test(const char *filename)
-{
- MARIA_HA *file;
- int i,j;
- my_off_t pos;
-
- bzero((char*) recinfo,sizeof(recinfo));
-
- /* First define 2 columns */
- recinfo[0].type=extra_field;
- recinfo[0].length= (extra_field == FIELD_BLOB ? 4 + portable_sizeof_char_ptr :
- extra_length);
- if (extra_field == FIELD_VARCHAR)
- recinfo[0].length+= HA_VARCHAR_PACKLENGTH(extra_length);
- recinfo[1].type=key_field;
- recinfo[1].length= (key_field == FIELD_BLOB ? 4+portable_sizeof_char_ptr :
- key_length);
- if (key_field == FIELD_VARCHAR)
- recinfo[1].length+= HA_VARCHAR_PACKLENGTH(key_length);
-
- /* Define a key over the first column */
- keyinfo[0].seg=keyseg;
- keyinfo[0].keysegs=1;
- keyinfo[0].block_length= 0; /* Default block length */
- keyinfo[0].seg[0].type= key_type;
- keyinfo[0].seg[0].flag= (key_field == FIELD_BLOB) ? HA_BLOB_PART:
- (key_field == FIELD_VARCHAR) ? HA_VAR_LENGTH_PART:0;
- keyinfo[0].seg[0].start=recinfo[0].length;
- keyinfo[0].seg[0].length=key_length;
- keyinfo[0].seg[0].null_bit= 0;
- keyinfo[0].seg[0].null_pos=0;
- keyinfo[0].seg[0].language= default_charset_info->number;
- keyinfo[0].flag = (no_fulltext?HA_PACK_KEY:HA_FULLTEXT);
-
- if (!silent)
- printf("- Creating isam-file\n");
- if (maria_create(filename,(no_keys?0:1),keyinfo,2,recinfo,0,NULL,
- (MARIA_CREATE_INFO*) 0, create_flag))
- goto err;
- if (!(file=maria_open(filename,2,0)))
- goto err;
-
- if (!silent)
- printf("- %s stopwords\n",no_stopwords?"Skipping":"Initializing");
- maria_ft_init_stopwords(no_stopwords?NULL:maria_ft_precompiled_stopwords);
-
- if (!silent)
- printf("- Writing key:s\n");
-
- my_errno=0;
- for (i=NUPD ; i<NDATAS; i++ )
- {
- create_record(record,i);
- error=maria_write(file,record);
- if (verbose || error)
- printf("I= %2d maria_write: %d errno: %d, record: %s\n",
- i,error,my_errno,data[i].f0);
- }
-
- if (!skip_update)
- {
- if (!silent)
- printf("- Updating rows\n");
-
- /* Read through all rows and update them */
- pos=(ha_rows) 0;
- i=0;
- while ((error=maria_rrnd(file,read_record,pos)) == 0)
- {
- create_record(record,NUPD-i-1);
- if (maria_update(file,read_record,record))
- {
- printf("Can't update row: %.*s, error: %d\n",
- keyinfo[0].seg[0].length,record,my_errno);
- }
- if(++i == NUPD) break;
- pos=HA_OFFSET_ERROR;
- }
- if (i != NUPD)
- printf("Found %d of %d rows\n", i,NUPD);
- }
-
- if (maria_close(file)) goto err;
- if(no_search) return 0;
- if (!silent)
- printf("- Reopening file\n");
- if (!(file=maria_open(filename,2,0))) goto err;
- if (!silent)
- printf("- Reading rows with key\n");
- for (i=0 ; i < NQUERIES ; i++)
- {
- FT_DOCLIST *result;
- result=maria_ft_nlq_init_search(file,0,(char*) query[i],strlen(query[i]),1);
- if(!result)
- {
- printf("Query %d: `%s' failed with errno %3d\n",i,query[i],my_errno);
- continue;
- }
- printf("Query %d: `%s'. Found: %d. Top five documents:\n",
- i,query[i],result->ndocs);
- for (j=0;j<5;j++)
- {
- double w; int err;
- err= maria_ft_nlq_read_next(result, read_record);
- if (err==HA_ERR_END_OF_FILE)
- {
- printf("No more matches!\n");
- break;
- }
- else if (err)
- {
- printf("maria_ft_read_next %d failed with errno %3d\n",j,my_errno);
- break;
- }
- w=maria_ft_nlq_get_relevance(result);
- if (key_field == FIELD_VARCHAR)
- {
- uint l;
- char *p;
- p=recinfo[0].length+read_record;
- l=uint2korr(p);
- printf("%10.7f: %.*s\n",w,(int) l,p+2);
- }
- else
- printf("%10.7f: %.*s\n",w,recinfo[1].length,
- recinfo[0].length+read_record);
- }
- maria_ft_nlq_close_search(result);
- }
-
- if (maria_close(file)) goto err;
- maria_end();
- my_end(MY_CHECK_ERROR);
-
- return (0);
-err:
- printf("got error: %3d when using maria-database\n",my_errno);
- return 1; /* skip warning */
-}
-
-static char blob_key[MAX_REC_LENGTH];
-/* static char blob_record[MAX_REC_LENGTH+20*20]; */
-
-void create_record(char *pos, int n)
-{
- bzero((char*) pos,MAX_REC_LENGTH);
- if (recinfo[0].type == FIELD_BLOB)
- {
- uint tmp;
- char *ptr;
- strnmov(blob_key,data[n].f0,keyinfo[0].seg[0].length);
- tmp=strlen(blob_key);
- int4store(pos,tmp);
- ptr=blob_key;
- memcpy_fixed(pos+4,&ptr,sizeof(char*));
- pos+=recinfo[0].length;
- }
- else if (recinfo[0].type == FIELD_VARCHAR)
- {
- uint tmp;
- /* -1 is here because pack_length is stored in seg->length */
- uint pack_length= HA_VARCHAR_PACKLENGTH(keyinfo[0].seg[0].length-1);
- strnmov(pos+pack_length,data[n].f0,keyinfo[0].seg[0].length);
- tmp=strlen(pos+pack_length);
- if (pack_length == 1)
- *pos= (char) tmp;
- else
- int2store(pos,tmp);
- pos+=recinfo[0].length;
- }
- else
- {
- strnmov(pos,data[n].f0,keyinfo[0].seg[0].length);
- pos+=recinfo[0].length;
- }
- if (recinfo[1].type == FIELD_BLOB)
- {
- uint tmp;
- char *ptr;
- strnmov(blob_key,data[n].f2,keyinfo[0].seg[0].length);
- tmp=strlen(blob_key);
- int4store(pos,tmp);
- ptr=blob_key;
- memcpy_fixed(pos+4,&ptr,sizeof(char*));
- pos+=recinfo[1].length;
- }
- else if (recinfo[1].type == FIELD_VARCHAR)
- {
- uint tmp;
- /* -1 is here because pack_length is stored in seg->length */
- uint pack_length= HA_VARCHAR_PACKLENGTH(keyinfo[0].seg[0].length-1);
- strnmov(pos+pack_length,data[n].f2,keyinfo[0].seg[0].length);
- tmp=strlen(pos+1);
- if (pack_length == 1)
- *pos= (char) tmp;
- else
- int2store(pos,tmp);
- pos+=recinfo[1].length;
- }
- else
- {
- strnmov(pos,data[n].f2,keyinfo[0].seg[0].length);
- pos+=recinfo[1].length;
- }
-}
-
-
-static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
-{
- switch(optid) {
- case 'v': verbose=1; break;
- case 's': silent=1; break;
- case 'F': no_fulltext=1; no_search=1;
- case 'U': skip_update=1; break;
- case 'K': no_keys=no_search=1; break;
- case 'N': no_search=1; break;
- case 'S': no_stopwords=1; break;
- case '#':
- DBUG_PUSH (argument);
- break;
- case 'V':
- case '?':
- case 'h':
- usage();
- exit(1);
- }
- return 0;
-}
-
-/* Read options */
-
-static void get_options(int argc,char *argv[])
-{
- int ho_error;
-
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
- exit(ho_error);
- return;
-} /* get options */
-
-
-static void usage()
-{
- printf("%s [options]\n", my_progname);
- my_print_help(my_long_options);
- my_print_variables(my_long_options);
-}
=== removed file 'storage/maria/ma_ft_test1.h'
--- a/storage/maria/ma_ft_test1.h 2007-03-02 10:20:23 +0000
+++ b/storage/maria/ma_ft_test1.h 1970-01-01 00:00:00 +0000
@@ -1,420 +0,0 @@
-/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult 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
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-#define NUPD 20
-#define NDATAS 389
-struct { const char *f0, *f2; } data[NDATAS] = {
- {"1", "General Information about MySQL"},
- {"1.1", "What is MySQL?"},
- {"1.2", "About this manual"},
- {"1.3", "History of MySQL"},
- {"1.4", "The main features of MySQL"},
- {"1.5", "General SQL information and tutorials"},
- {"1.6", "Useful MySQL-related links"},
- {"1.7", "What are stored procedures and triggers and so on?"},
- {"2", "MySQL mailing lists and how to ask questions/give error (bug) reports"},
- {"2.1", "Subscribing to/un-subscribing from the MySQL mailing list"},
- {"2.2", "Asking questions or reporting bugs"},
- {"2.3", "I think I have found a bug. What information do you need to help me?"},
- {"2.3.1", "MySQL keeps crashing"},
- {"2.4", "Guidelines for answering questions on the mailing list"},
- {"3", "Licensing or When do I have/want to pay for MySQL?"},
- {"3.1", "How much does MySQL cost?"},
- {"3.2", "How do I get commercial support?"},
- {"3.2.1", "Types of commercial support"},
- {"3.2.1.1", "Basic email support"},
- {"3.2.1.2", "Extended email support"},
-/*------------------------------- NUPD=20 -------------------------------*/
- {"3.2.1.3", "Asking: Login support"},
- {"3.2.1.4", "Extended login support"},
- {"3.3", "How do I pay for licenses/support?"},
- {"3.4", "Who do I contact when I want more information about licensing/support?"},
- {"3.5", "What Copyright does MySQL use?"},
- {"3.6", "When may I distribute MySQL commercially without a fee?"},
- {"3.7", "I want to sell a product that can be configured to use MySQL"},
- {"3.8", "I am running a commercial web server using MySQL"},
- {"3.9", "Do I need a license to sell commercial Perl/tcl/PHP/Web+ etc applications?"},
- {"3.10", "Possible future changes in the licensing"},
- {"4", "Compiling and installing MySQL"},
- {"4.1", "How do I get MySQL?"},
- {"4.2", "Which MySQL version should I use?"},
- {"4.3", "How/when will you release updates?"},
- {"4.4", "What operating systems does MySQL support?"},
- {"4.5", "Compiling MySQL from source code"},
- {"4.5.1", "Quick installation overview"},
- {"4.5.2", "Usual configure switches"},
- {"4.5.3", "Applying a patch"},
- {"4.6", "Problems compiling?"},
- {"4.7", "General compilation notes"},
- {"4.8", "MIT-pthreads notes (FreeBSD)"},
- {"4.9", "Perl installation comments"},
- {"4.10", "Special things to consider for some machine/OS combinations"},
- {"4.10.1", "Solaris notes"},
- {"4.10.2", "SunOS 4 notes"},
- {"4.10.3", "Linux notes for all versions"},
- {"4.10.3.1", "Linux-x86 notes"},
- {"4.10.3.2", "RedHat 5.0"},
- {"4.10.3.3", "RedHat 5.1"},
- {"4.10.3.4", "Linux-Sparc notes"},
- {"4.10.3.5", "Linux-Alpha notes"},
- {"4.10.3.6", "MkLinux notes"},
- {"4.10.4", "Alpha-DEC-Unix notes"},
- {"4.10.5", "Alpha-DEC-OSF1 notes"},
- {"4.10.6", "SGI-IRIX notes"},
- {"4.10.7", "FreeBSD notes"},
- {"4.10.7.1", "FreeBSD-3.0 notes"},
- {"4.10.8", "BSD/OS 2.# notes"},
- {"4.10.8.1", "BSD/OS 3.# notes"},
- {"4.10.9", "SCO notes"},
- {"4.10.10", "SCO Unixware 7.0 notes"},
- {"4.10.11", "IBM-AIX notes"},
- {"4.10.12", "HP-UX notes"},
- {"4.11", "TcX binaries"},
- {"4.12", "Win32 notes"},
- {"4.13", "Installation instructions for MySQL binary releases"},
- {"4.13.1", "How to get MySQL Perl support working"},
- {"4.13.2", "Linux notes"},
- {"4.13.3", "HP-UX notes"},
- {"4.13.4", "Linking client libraries"},
- {"4.14", "Problems running mysql_install_db"},
- {"4.15", "Problems starting MySQL"},
- {"4.16", "Automatic start/stop of MySQL"},
- {"4.17", "Option files"},
- {"5", "How standards-compatible is MySQL?"},
- {"5.1", "What extensions has MySQL to ANSI SQL92?"},
- {"5.2", "What functionality is missing in MySQL?"},
- {"5.2.1", "Sub-selects"},
- {"5.2.2", "SELECT INTO TABLE"},
- {"5.2.3", "Transactions"},
- {"5.2.4", "Triggers"},
- {"5.2.5", "Foreign Keys"},
- {"5.2.5.1", "Some reasons NOT to use FOREIGN KEYS"},
- {"5.2.6", "Views"},
- {"5.2.7", "-- as start of a comment"},
- {"5.3", "What standards does MySQL follow?"},
- {"5.4", "What functions exist only for compatibility?"},
- {"5.5", "Limitations of BLOB and TEXT types"},
- {"5.6", "How to cope without COMMIT-ROLLBACK"},
- {"6", "The MySQL access privilege system"},
- {"6.1", "What the privilege system does"},
- {"6.2", "Connecting to the MySQL server"},
- {"6.2.1", "Keeping your password secure"},
- {"6.3", "Privileges provided by MySQL"},
- {"6.4", "How the privilege system works"},
- {"6.5", "The privilege tables"},
- {"6.6", "Setting up the initial MySQL privileges"},
- {"6.7", "Adding new user privileges to MySQL"},
- {"6.8", "An example permission setup"},
- {"6.9", "Causes of Access denied errors"},
- {"6.10", "How to make MySQL secure against crackers"},
- {"7", "MySQL language reference"},
- {"7.1", "Literals: how to write strings and numbers"},
- {"7.1.1", "Strings"},
- {"7.1.2", "Numbers"},
- {"7.1.3", "NULL values"},
- {"7.1.4", "Database, table, index, column and alias names"},
- {"7.1.4.1", "Case sensitivity in names"},
- {"7.2", "Column types"},
- {"7.2.1", "Column type storage requirements"},
- {"7.2.5", "Numeric types"},
- {"7.2.6", "Date and time types"},
- {"7.2.6.1", "The DATE type"},
- {"7.2.6.2", "The TIME type"},
- {"7.2.6.3", "The DATETIME type"},
- {"7.2.6.4", "The TIMESTAMP type"},
- {"7.2.6.5", "The YEAR type"},
- {"7.2.6.6", "Miscellaneous date and time properties"},
- {"7.2.7", "String types"},
- {"7.2.7.1", "The CHAR and VARCHAR types"},
- {"7.2.7.2", "The BLOB and TEXT types"},
- {"7.2.7.3", "The ENUM type"},
- {"7.2.7.4", "The SET type"},
- {"7.2.8", "Choosing the right type for a column"},
- {"7.2.9", "Column indexes"},
- {"7.2.10", "Multiple-column indexes"},
- {"7.2.11", "Using column types from other database engines"},
- {"7.3", "Functions for use in SELECT and WHERE clauses"},
- {"7.3.1", "Grouping functions"},
- {"7.3.2", "Normal arithmetic operations"},
- {"7.3.3", "Bit functions"},
- {"7.3.4", "Logical operations"},
- {"7.3.5", "Comparison operators"},
- {"7.3.6", "String comparison functions"},
- {"7.3.7", "Control flow functions"},
- {"7.3.8", "Mathematical functions"},
- {"7.3.9", "String functions"},
- {"7.3.10", "Date and time functions"},
- {"7.3.11", "Miscellaneous functions"},
- {"7.3.12", "Functions for use with GROUP BY clauses"},
- {"7.4", "CREATE DATABASE syntax"},
- {"7.5", "DROP DATABASE syntax"},
- {"7.6", "CREATE TABLE syntax"},
- {"7.7", "ALTER TABLE syntax"},
- {"7.8", "OPTIMIZE TABLE syntax"},
- {"7.9", "DROP TABLE syntax"},
- {"7.10", "DELETE syntax"},
- {"7.11", "SELECT syntax"},
- {"7.12", "JOIN syntax"},
- {"7.13", "INSERT syntax"},
- {"7.14", "REPLACE syntax"},
- {"7.15", "LOAD DATA INFILE syntax"},
- {"7.16", "UPDATE syntax"},
- {"7.17", "USE syntax"},
- {"7.18", "SHOW syntax (Get information about tables, columns...)"},
- {"7.19", "EXPLAIN syntax (Get information about a SELECT)"},
- {"7.20", "DESCRIBE syntax (Get information about columns)"},
- {"7.21", "LOCK TABLES/UNLOCK TABLES syntax"},
- {"7.22", "SET OPTION syntax"},
- {"7.23", "GRANT syntax (Compatibility function)"},
- {"7.24", "CREATE INDEX syntax (Compatibility function)"},
- {"7.25", "DROP INDEX syntax (Compatibility function)"},
- {"7.26", "Comment syntax"},
- {"7.27", "CREATE FUNCTION/DROP FUNCTION syntax"},
- {"7.28", "Is MySQL picky about reserved words?"},
- {"8", "Example SQL queries"},
- {"8.1", "Queries from twin project"},
- {"8.1.1", "Find all non-distributed twins"},
- {"8.1.2", "Show a table on twin pair status"},
- {"9", "How safe/stable is MySQL?"},
- {"9.1", "How stable is MySQL?"},
- {"9.2", "Why are there is so many releases of MySQL?"},
- {"9.3", "Checking a table for errors"},
- {"9.4", "How to repair tables"},
- {"9.5", "Is there anything special to do when upgrading/downgrading MySQL?"},
- {"9.5.1", "Upgrading from a 3.21 version to 3.22"},
- {"9.5.2", "Upgrading from a 3.20 version to 3.21"},
- {"9.5.3", "Upgrading to another architecture"},
- {"9.6", "Year 2000 compliance"},
- {"10", "MySQL Server functions"},
- {"10.1", "What languages are supported by MySQL?"},
- {"10.1.1", "Character set used for data & sorting"},
- {"10.2", "The update log"},
- {"10.3", "How big can MySQL tables be?"},
- {"11", "Getting maximum performance from MySQL"},
- {"11.1", "How does one change the size of MySQL buffers?"},
- {"11.2", "How compiling and linking affects the speed of MySQL"},
- {"11.3", "How does MySQL use memory?"},
- {"11.4", "How does MySQL use indexes?"},
- {"11.5", "What optimizations are done on WHERE clauses?"},
- {"11.6", "How does MySQL open & close tables?"},
- {"11.6.0.1", "What are the drawbacks of creating possibly thousands of tables in a database?"},
- {"11.7", "How does MySQL lock tables?"},
- {"11.8", "How should I arrange my table to be as fast/small as possible?"},
- {"11.9", "What affects the speed of INSERT statements?"},
- {"11.10", "What affects the speed DELETE statements?"},
- {"11.11", "How do I get MySQL to run at full speed?"},
- {"11.12", "What are the different row formats? Or, when should VARCHAR/CHAR be used?"},
- {"11.13", "Why so many open tables?"},
- {"12", "MySQL benchmark suite"},
- {"13", "MySQL Utilites"},
- {"13.1", "Overview of the different MySQL programs"},
- {"13.2", "The MySQL table check, optimize and repair program"},
- {"13.2.1", "isamchk memory use"},
- {"13.2.2", "Getting low-level table information"},
- {"13.3", "The MySQL compressed read-only table generator"},
- {"14", "Adding new functions to MySQL"},
- {"15", "MySQL ODBC Support"},
- {"15.1", "Operating systems supported by MyODBC"},
- {"15.2", "How to report problems with MyODBC"},
- {"15.3", "Programs known to work with MyODBC"},
- {"15.4", "How to fill in the various fields in the ODBC administrator program"},
- {"15.5", "How to get the value of an AUTO_INCREMENT column in ODBC"},
- {"16", "Problems and common errors"},
- {"16.1", "Some common errors when using MySQL"},
- {"16.1.1", "MySQL server has gone away error"},
- {"16.1.2", "Can't connect to local MySQL server error"},
- {"16.1.3", "Out of memory error"},
- {"16.1.4", "Packet too large error"},
- {"16.1.5", "The table is full error"},
- {"16.1.6", "Commands out of sync error in client"},
- {"16.1.7", "Removing user error"},
- {"16.2", "How MySQL handles a full disk"},
- {"16.3", "How to run SQL commands from a text file"},
- {"16.4", "Where MySQL stores temporary files"},
- {"16.5", "Access denied error"},
- {"16.6", "How to run MySQL as a normal user"},
- {"16.7", "Problems with file permissions"},
- {"16.8", "File not found"},
- {"16.9", "Problems using DATE columns"},
- {"16.10", "Case sensitivity in searches"},
- {"16.11", "Problems with NULL values"},
- {"17", "Solving some common problems with MySQL"},
- {"17.1", "Database replication"},
- {"17.2", "Database backups"},
- {"18", "MySQL client tools and API's"},
- {"18.1", "MySQL C API"},
- {"18.2", "C API datatypes"},
- {"18.3", "C API function overview"},
- {"18.4", "C API function descriptions"},
- {"18.4.1", "mysql_affected_rows()"},
- {"18.4.2", "mysql_close()"},
- {"18.4.3", "mysql_connect()"},
- {"18.4.4", "mysql_create_db()"},
- {"18.4.5", "mysql_data_seek()"},
- {"18.4.6", "mysql_debug()"},
- {"18.4.7", "mysql_drop_db()"},
- {"18.4.8", "mysql_dump_debug_info()"},
- {"18.4.9", "mysql_eof()"},
- {"18.4.10", "mysql_errno()"},
- {"18.4.11", "mysql_error()"},
- {"18.4.12", "mysql_escape_string()"},
- {"18.4.13", "mysql_fetch_field()"},
- {"18.4.14", "mysql_fetch_fields()"},
- {"18.4.15", "mysql_fetch_field_direct()"},
- {"18.4.16", "mysql_fetch_lengths()"},
- {"18.4.17", "mysql_fetch_row()"},
- {"18.4.18", "mysql_field_seek()"},
- {"18.4.19", "mysql_field_tell()"},
- {"18.4.20", "mysql_free_result()"},
- {"18.4.21", "mysql_get_client_info()"},
- {"18.4.22", "mysql_get_host_info()"},
- {"18.4.23", "mysql_get_proto_info()"},
- {"18.4.24", "mysql_get_server_info()"},
- {"18.4.25", "mysql_info()"},
- {"18.4.26", "mysql_init()"},
- {"18.4.27", "mysql_insert_id()"},
- {"18.4.28", "mysql_kill()"},
- {"18.4.29", "mysql_list_dbs()"},
- {"18.4.30", "mysql_list_fields()"},
- {"18.4.31", "mysql_list_processes()"},
- {"18.4.32", "mysql_list_tables()"},
- {"18.4.33", "mysql_num_fields()"},
- {"18.4.34", "mysql_num_rows()"},
- {"18.4.35", "mysql_query()"},
- {"18.4.36", "mysql_real_connect()"},
- {"18.4.37", "mysql_real_query()"},
- {"18.4.38", "mysql_reload()"},
- {"18.4.39", "mysql_row_tell()"},
- {"18.4.40", "mysql_select_db()"},
- {"18.4.41", "mysql_shutdown()"},
- {"18.4.42", "mysql_stat()"},
- {"18.4.43", "mysql_store_result()"},
- {"18.4.44", "mysql_thread_id()"},
- {"18.4.45", "mysql_use_result()"},
- {"18.4.46", "Why is it that after mysql_query() returns success, mysql_store_result() sometimes returns NULL?"},
- {"18.4.47", "What results can I get from a query?"},
- {"18.4.48", "How can I get the unique ID for the last inserted row?"},
- {"18.4.49", "Problems linking with the C API"},
- {"18.4.50", "How to make a thread-safe client"},
- {"18.5", "MySQL Perl API's"},
- {"18.5.1", "DBI with DBD::mysql"},
- {"18.5.1.1", "The DBI interface"},
- {"18.5.1.2", "More DBI/DBD information"},
- {"18.6", "MySQL Java connectivity (JDBC)"},
- {"18.7", "MySQL PHP API's"},
- {"18.8", "MySQL C++ API's"},
- {"18.9", "MySQL Python API's"},
- {"18.10", "MySQL TCL API's"},
- {"19", "How MySQL compares to other databases"},
- {"19.1", "How MySQL compares to mSQL"},
- {"19.1.1", "How to convert mSQL tools for MySQL"},
- {"19.1.2", "How mSQL and MySQL client/server communications protocols differ"},
- {"19.1.3", "How mSQL 2.0 SQL syntax differs from MySQL"},
- {"19.2", "How MySQL compares to PostgreSQL"},
- {"A", "Some users of MySQL"},
- {"B", "Contributed programs"},
- {"C", "Contributors to MySQL"},
- {"D", "MySQL change history"},
- {"19.3", "Changes in release 3.22.x (Alpha version)"},
- {"19.3.1", "Changes in release 3.22.7"},
- {"19.3.2", "Changes in release 3.22.6"},
- {"19.3.3", "Changes in release 3.22.5"},
- {"19.3.4", "Changes in release 3.22.4"},
- {"19.3.5", "Changes in release 3.22.3"},
- {"19.3.6", "Changes in release 3.22.2"},
- {"19.3.7", "Changes in release 3.22.1"},
- {"19.3.8", "Changes in release 3.22.0"},
- {"19.4", "Changes in release 3.21.x"},
- {"19.4.1", "Changes in release 3.21.33"},
- {"19.4.2", "Changes in release 3.21.32"},
- {"19.4.3", "Changes in release 3.21.31"},
- {"19.4.4", "Changes in release 3.21.30"},
- {"19.4.5", "Changes in release 3.21.29"},
- {"19.4.6", "Changes in release 3.21.28"},
- {"19.4.7", "Changes in release 3.21.27"},
- {"19.4.8", "Changes in release 3.21.26"},
- {"19.4.9", "Changes in release 3.21.25"},
- {"19.4.10", "Changes in release 3.21.24"},
- {"19.4.11", "Changes in release 3.21.23"},
- {"19.4.12", "Changes in release 3.21.22"},
- {"19.4.13", "Changes in release 3.21.21a"},
- {"19.4.14", "Changes in release 3.21.21"},
- {"19.4.15", "Changes in release 3.21.20"},
- {"19.4.16", "Changes in release 3.21.19"},
- {"19.4.17", "Changes in release 3.21.18"},
- {"19.4.18", "Changes in release 3.21.17"},
- {"19.4.19", "Changes in release 3.21.16"},
- {"19.4.20", "Changes in release 3.21.15"},
- {"19.4.21", "Changes in release 3.21.14b"},
- {"19.4.22", "Changes in release 3.21.14a"},
- {"19.4.23", "Changes in release 3.21.13"},
- {"19.4.24", "Changes in release 3.21.12"},
- {"19.4.25", "Changes in release 3.21.11"},
- {"19.4.26", "Changes in release 3.21.10"},
- {"19.4.27", "Changes in release 3.21.9"},
- {"19.4.28", "Changes in release 3.21.8"},
- {"19.4.29", "Changes in release 3.21.7"},
- {"19.4.30", "Changes in release 3.21.6"},
- {"19.4.31", "Changes in release 3.21.5"},
- {"19.4.32", "Changes in release 3.21.4"},
- {"19.4.33", "Changes in release 3.21.3"},
- {"19.4.34", "Changes in release 3.21.2"},
- {"19.4.35", "Changes in release 3.21.0"},
- {"19.5", "Changes in release 3.20.x"},
- {"19.5.1", "Changes in release 3.20.18"},
- {"19.5.2", "Changes in release 3.20.17"},
- {"19.5.3", "Changes in release 3.20.16"},
- {"19.5.4", "Changes in release 3.20.15"},
- {"19.5.5", "Changes in release 3.20.14"},
- {"19.5.6", "Changes in release 3.20.13"},
- {"19.5.7", "Changes in release 3.20.11"},
- {"19.5.8", "Changes in release 3.20.10"},
- {"19.5.9", "Changes in release 3.20.9"},
- {"19.5.10", "Changes in release 3.20.8"},
- {"19.5.11", "Changes in release 3.20.7"},
- {"19.5.12", "Changes in release 3.20.6"},
- {"19.5.13", "Changes in release 3.20.3"},
- {"19.5.14", "Changes in release 3.20.0"},
- {"19.6", "Changes in release 3.19.x"},
- {"19.6.1", "Changes in release 3.19.5"},
- {"19.6.2", "Changes in release 3.19.4"},
- {"19.6.3", "Changes in release 3.19.3"},
- {"E", "Known errors and design deficiencies in MySQL"},
- {"F", "List of things we want to add to MySQL in the future (The TODO)"},
- {"19.7", "Things that must done in the real near future"},
- {"19.8", "Things that have to be done sometime"},
- {"19.9", "Some things we don't have any plans to do"},
- {"G", "Comments on porting to other systems"},
- {"19.10", "Debugging MySQL"},
- {"19.11", "Comments about RTS threads"},
- {"19.12", "What is the difference between different thread packages?"},
- {"H", "Description of MySQL regular expression syntax"},
- {"I", "What is Unireg?"},
- {"J", "The MySQL server license"},
- {"K", "The MySQL license for Microsoft operating systems"},
- {"*", "SQL command, type and function index"},
- {"*", "Concept Index"}
-};
-
-#define NQUERIES 5
-const char *query[NQUERIES]={
- "mysql information and manual",
- "upgrading from previous version",
- "column indexes",
- "against about after more right the with/without", /* stopwords test */
- "mysql license and copyright"
-};
=== modified file 'storage/maria/ma_key.c'
--- a/storage/maria/ma_key.c 2009-03-13 14:10:43 +0000
+++ b/storage/maria/ma_key.c 2009-05-14 21:49:53 +0000
@@ -99,7 +99,7 @@ uint transid_store_packed(MARIA_HA *info
uchar *start;
uint length;
uchar buff[8];
- DBUG_ASSERT(trid < (LL(1) << (MARIA_MAX_PACK_TRANSID_SIZE*8)));
+ DBUG_ASSERT(trid < (1LL << (MARIA_MAX_PACK_TRANSID_SIZE*8)));
DBUG_ASSERT(trid >= info->s->state.create_trid);
trid= (trid - info->s->state.create_trid) << 1;
=== modified file 'storage/maria/ma_loghandler.c'
--- a/storage/maria/ma_loghandler.c 2009-03-05 21:42:16 +0000
+++ b/storage/maria/ma_loghandler.c 2009-05-14 21:49:53 +0000
@@ -3175,7 +3175,7 @@ static my_bool translog_get_last_page_ad
DBUG_PRINT("info", ("File size: %s", llstr(file_size, buff)));
if (file_size == MY_FILEPOS_ERROR)
DBUG_RETURN(1);
- DBUG_ASSERT(file_size < ULL(0xffffffff));
+ DBUG_ASSERT(file_size < 0xffffffffULL);
if (((uint32)file_size) > TRANSLOG_PAGE_SIZE)
{
rec_offset= (((((uint32)file_size) / TRANSLOG_PAGE_SIZE) - 1) *
@@ -3670,12 +3670,12 @@ my_bool translog_init_with_table(const c
TRANSLOG_FILE *file= (TRANSLOG_FILE *)my_malloc(sizeof(TRANSLOG_FILE),
MYF(0));
- compile_time_assert(MY_FILEPOS_ERROR > ULL(0xffffffff));
+ compile_time_assert(MY_FILEPOS_ERROR > 0xffffffffULL);
if (file == NULL ||
(file->handler.file=
open_logfile_by_number_no_cache(i)) < 0 ||
my_seek(file->handler.file, 0, SEEK_END, MYF(0)) >=
- ULL(0xffffffff))
+ 0xffffffffULL)
{
int j;
for (j= i - log_descriptor.min_file - 1; j > 0; j--)
@@ -5124,7 +5124,7 @@ static uchar *translog_put_LSN_diff(LSN
dst[0]= (uchar)(0x80 | (diff >> 24));
int3store(dst + 1, diff & 0xFFFFFFL);
}
- else if (diff <= LL(0x3FFFFFFFFF))
+ else if (diff <= 0x3FFFFFFFFFLL)
{
dst-= 5;
@@ -5221,7 +5221,7 @@ static uchar *translog_get_LSN_from_diff
{
/* take 1 from file offset */
first_byte++;
- base_offset+= LL(0x100000000);
+ base_offset+= 0x100000000LL;
}
file_no= LSN_FILE_NO(base_lsn) - first_byte;
DBUG_ASSERT(base_offset - diff <= UINT_MAX);
=== modified file 'storage/maria/ma_loghandler_lsn.h'
--- a/storage/maria/ma_loghandler_lsn.h 2008-07-09 09:02:27 +0000
+++ b/storage/maria/ma_loghandler_lsn.h 2009-05-14 21:49:53 +0000
@@ -83,8 +83,8 @@ typedef TRANSLOG_ADDRESS LSN;
other bytes are a LSN.
*/
typedef LSN LSN_WITH_FLAGS;
-#define LSN_WITH_FLAGS_TO_LSN(x) (x & ULL(0x00FFFFFFFFFFFFFF))
-#define LSN_WITH_FLAGS_TO_FLAGS(x) (x & ULL(0xFF00000000000000))
+#define LSN_WITH_FLAGS_TO_LSN(x) (x & 0x00FFFFFFFFFFFFFFULL)
+#define LSN_WITH_FLAGS_TO_FLAGS(x) (x & 0xFF00000000000000ULL)
#define FILENO_IMPOSSIBLE 0 /**< log file's numbering starts at 1 */
#define LOG_OFFSET_IMPOSSIBLE 0 /**< log always has a header */
@@ -106,6 +106,6 @@ typedef LSN LSN_WITH_FLAGS;
Unlike ULONGLONG_MAX, it can be safely used in comparison with valid LSNs
(ULONGLONG_MAX is too big for correctness of cmp_translog_addr()).
*/
-#define LSN_MAX (LSN)ULL(0x00FFFFFFFFFFFFFF)
+#define LSN_MAX (LSN)0x00FFFFFFFFFFFFFFULL
#endif
=== modified file 'storage/maria/ma_pagecache.c'
--- a/storage/maria/ma_pagecache.c 2009-02-13 16:30:54 +0000
+++ b/storage/maria/ma_pagecache.c 2009-05-14 21:49:53 +0000
@@ -1567,7 +1567,7 @@ static void unlink_hash(PAGECACHE *pagec
struct st_my_thread_var *thread;
hash_link->file= first_page->file;
- DBUG_ASSERT(first_page->pageno < ((ULL(1)) << 40));
+ DBUG_ASSERT(first_page->pageno < ((1ULL) << 40));
hash_link->pageno= first_page->pageno;
do
{
@@ -1729,7 +1729,7 @@ restart:
goto restart;
}
hash_link->file= *file;
- DBUG_ASSERT(pageno < ((ULL(1)) << 40));
+ DBUG_ASSERT(pageno < ((1ULL) << 40));
hash_link->pageno= pageno;
link_hash(start, hash_link);
/* Register the request for the page */
@@ -3281,7 +3281,7 @@ uchar *pagecache_read(PAGECACHE *pagecac
page_cache_page_pin_str[unlock_pin]));
DBUG_ASSERT(buff != 0 || (buff == 0 && (unlock_pin == PAGECACHE_PIN ||
unlock_pin == PAGECACHE_PIN_LEFT_PINNED)));
- DBUG_ASSERT(pageno < ((ULL(1)) << 40));
+ DBUG_ASSERT(pageno < ((1ULL) << 40));
#endif
if (!page_link)
@@ -3654,7 +3654,7 @@ my_bool pagecache_delete(PAGECACHE *page
pin == PAGECACHE_PIN_LEFT_PINNED);
restart:
- DBUG_ASSERT(pageno < ((ULL(1)) << 40));
+ DBUG_ASSERT(pageno < ((1ULL) << 40));
if (pagecache->can_be_used)
{
/* Key cache is used */
@@ -3833,7 +3833,7 @@ my_bool pagecache_write_part(PAGECACHE *
DBUG_ASSERT(lock != PAGECACHE_LOCK_LEFT_READLOCKED);
DBUG_ASSERT(lock != PAGECACHE_LOCK_READ_UNLOCK);
DBUG_ASSERT(offset + size <= pagecache->block_size);
- DBUG_ASSERT(pageno < ((ULL(1)) << 40));
+ DBUG_ASSERT(pageno < ((1ULL) << 40));
#endif
if (!page_link)
@@ -4824,7 +4824,7 @@ my_bool pagecache_collect_changed_blocks
ptr+= 2;
ptr[0]= (share->kfile.file == block->hash_link->file.file);
ptr++;
- DBUG_ASSERT(block->hash_link->pageno < ((ULL(1)) << 40));
+ DBUG_ASSERT(block->hash_link->pageno < ((1ULL) << 40));
page_store(ptr, block->hash_link->pageno);
ptr+= PAGE_STORE_SIZE;
lsn_store(ptr, block->rec_lsn);
=== modified file 'storage/maria/ma_recovery.c'
--- a/storage/maria/ma_recovery.c 2009-03-05 21:42:16 +0000
+++ b/storage/maria/ma_recovery.c 2009-05-14 21:49:53 +0000
@@ -3437,7 +3437,7 @@ static void print_redo_phase_progress(TR
end_offset);
if (initial_remainder == (ulonglong)(-1))
initial_remainder= local_remainder;
- percentage_done= (uint) ((initial_remainder - local_remainder) * ULL(100) /
+ percentage_done= (uint) ((initial_remainder - local_remainder) * 100ULL /
initial_remainder);
if ((percentage_done - percentage_printed) >= 10)
{
=== modified file 'storage/maria/maria_backup_engine.cc'
--- a/storage/maria/maria_backup_engine.cc 2009-02-13 18:16:54 +0000
+++ b/storage/maria/maria_backup_engine.cc 2009-05-14 21:49:53 +0000
@@ -985,7 +985,7 @@ Log_backup::Log_backup(const char *log_n
except that it allows us to verify that what restore sends us is really a
log.
*/
- log_file_backup.init(fd, ~(ULL(0)), LOG_FILE_CODE);
+ log_file_backup.init(fd, ~(0ULL), LOG_FILE_CODE);
state= OK;
DBUG_VOID_RETURN;
}
@@ -1977,7 +1977,7 @@ result_t Table_restore::post_restore()
old and empty.
*/
pthread_mutex_lock(&share->bitmap.bitmap_lock);
- share->bitmap.page= ~(ULL(0)); /* to force a read below */
+ share->bitmap.page= ~0ULL; /* to force a read below */
(void)_ma_bitmap_get_page_bits(mi_info, &share->bitmap, 1);
pthread_mutex_unlock(&share->bitmap.bitmap_lock);
}
=== modified file 'storage/maria/maria_def.h'
--- a/storage/maria/maria_def.h 2009-02-23 11:55:35 +0000
+++ b/storage/maria/maria_def.h 2009-05-14 21:49:53 +0000
@@ -790,7 +790,7 @@ struct st_maria_handler
#define MARIA_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */
/* Marker for impossible delete link */
-#define IMPOSSIBLE_PAGE_NO LL(0xFFFFFFFFFF)
+#define IMPOSSIBLE_PAGE_NO 0xFFFFFFFFFFLL
/* The UNIQUE check is done with a hashed long key */
=== modified file 'storage/maria/maria_pack.c'
--- a/storage/maria/maria_pack.c 2009-02-13 16:30:54 +0000
+++ b/storage/maria/maria_pack.c 2009-05-14 21:49:53 +0000
@@ -1920,7 +1920,7 @@ static int make_huff_decode_table(HUFF_T
return 1;
huff_tree->code_len=(uchar*) (huff_tree->code+elements);
make_traverse_code_tree(huff_tree, huff_tree->root,
- 8 * sizeof(ulonglong), LL(0));
+ 8 * sizeof(ulonglong), 0LL);
}
}
return 0;
=== modified file 'storage/maria/trnman.h'
--- a/storage/maria/trnman.h 2009-01-16 16:18:17 +0000
+++ b/storage/maria/trnman.h 2009-05-14 21:49:53 +0000
@@ -56,7 +56,7 @@ struct st_ma_transaction
uint16 flags; /**< Various flags */
};
-#define TRANSACTION_LOGGED_LONG_ID ULL(0x8000000000000000)
+#define TRANSACTION_LOGGED_LONG_ID 0x8000000000000000ULL
#define MAX_TRID (~(TrID)0)
extern WT_RESOURCE_TYPE ma_rc_dup_unique;
=== modified file 'storage/maria/unittest/lockman2-t.c'
--- a/storage/maria/unittest/lockman2-t.c 2008-03-04 11:58:21 +0000
+++ b/storage/maria/unittest/lockman2-t.c 2009-05-14 21:49:53 +0000
@@ -219,7 +219,7 @@ pthread_handler_t test_lockman(void *arg
for (x= ((int)(intptr)(&m)); m > 0; m--)
{
/* three prime numbers */
- x= (uint) ((x*LL(3628273133) + LL(1500450271)) % LL(9576890767));
+ x= (uint) ((x*3628273133LL + 1500450271LL) % 9576890767LL);
row= x % Nrows + Ntables;
table= row % Ntables;
locklevel= (x/Nrows) & 3;
=== modified file 'storage/maria/unittest/ma_control_file-t.c'
--- a/storage/maria/unittest/ma_control_file-t.c 2008-06-05 16:11:22 +0000
+++ b/storage/maria/unittest/ma_control_file-t.c 2009-05-14 21:49:53 +0000
@@ -248,7 +248,7 @@ static int test_five_logs_and_max_trid(v
RET_ERR_UNLESS(open_file() == CONTROL_FILE_OK);
expect_logno= 100;
- expect_max_trid= ULL(14111978111);
+ expect_max_trid= 14111978111ULL;
for (i= 0; i<5; i++)
{
expect_logno*= 3;
=== modified file 'storage/maria/unittest/trnman-t.c'
--- a/storage/maria/unittest/trnman-t.c 2009-02-13 16:30:54 +0000
+++ b/storage/maria/unittest/trnman-t.c 2009-05-14 21:49:53 +0000
@@ -45,7 +45,7 @@ pthread_handler_t test_trnman(void *arg)
for (x= ((int)(intptr)(&m)); m > 0; )
{
- y= x= (x*LL(3628273133) + LL(1500450271)) % LL(9576890767); /* three prime numbers */
+ y= x= (x*3628273133LL + 1500450271LL) % 9576890767LL; /* three prime numbers */
m-= n= x % MAX_ITER;
for (i= 0; i < n; i++)
{
=== modified file 'storage/myisam/CMakeLists.txt' (properties changed: +x to -x)
--- a/storage/myisam/CMakeLists.txt 2009-05-07 20:48:24 +0000
+++ b/storage/myisam/CMakeLists.txt 2009-05-11 17:58:07 +0000
@@ -15,9 +15,8 @@
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
- ha_myisam.cc
- ft_myisam.c
+SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c
+ ha_myisam.cc ft_myisam.c
ft_stopwords.c ft_update.c mi_cache.c mi_changed.c mi_check.c
mi_checksum.c mi_close.c mi_create.c mi_dbug.c mi_delete.c
mi_delete_all.c mi_delete_table.c mi_dynrec.c mi_extra.c mi_info.c
@@ -26,7 +25,7 @@ SET(MYISAM_SOURCES ft_boolean_search.c
mi_rfirst.c mi_rlast.c mi_rnext.c mi_rnext_same.c mi_rprev.c mi_rrnd.c
mi_rsame.c mi_rsamepos.c mi_scan.c mi_search.c mi_static.c mi_statrec.c
mi_unique.c mi_update.c mi_write.c rt_index.c rt_key.c rt_mbr.c
- rt_split.c sort.c sp_key.c ft_eval.h mi_extrafunc.h myisamdef.h
+ rt_split.c sort.c sp_key.c mi_extrafunc.h myisamdef.h
rt_index.h mi_rkey.c mi_examine_log.c myisam_backup_engine.cc)
MYSQL_STORAGE_ENGINE(MYISAM)
=== modified file 'storage/myisam/Makefile.am'
--- a/storage/myisam/Makefile.am 2009-01-07 10:58:33 +0000
+++ b/storage/myisam/Makefile.am 2009-04-06 18:36:46 +0000
@@ -26,7 +26,7 @@ LDADD =
DEFS = @DEFS@
-EXTRA_DIST = mi_test_all.sh mi_test_all.res ft_stem.c CMakeLists.txt plug.in
+EXTRA_DIST = mi_test_all.sh mi_test_all.res CMakeLists.txt plug.in
pkgdata_DATA = mi_test_all mi_test_all.res
pkglib_LIBRARIES = libmyisam.a
@@ -46,10 +46,9 @@ myisampack_LDADD= @CLIENT_EXTRA_LDFLAGS
$(top_builddir)/mysys/libmysyslt.la \
$(top_builddir)/dbug/libdbuglt.la \
$(top_builddir)/strings/libmystringslt.la @ZLIB_LIBS@
-noinst_PROGRAMS = mi_test1 mi_test2 mi_test3 rt_test sp_test #ft_test1 ft_eval
+noinst_PROGRAMS = mi_test1 mi_test2 mi_test3 rt_test sp_test
noinst_HEADERS = myisamdef.h rt_index.h rt_key.h rt_mbr.h sp_defs.h \
- fulltext.h ftdefs.h ft_test1.h ft_eval.h \
- ha_myisam.h mi_extrafunc.h
+ fulltext.h ftdefs.h ha_myisam.h mi_extrafunc.h
mi_test1_DEPENDENCIES= $(LIBRARIES)
mi_test1_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
$(top_builddir)/mysys/libmysyslt.la \
@@ -65,8 +64,6 @@ mi_test3_LDADD= @CLIENT_EXTRA_LDFLAGS@
$(top_builddir)/mysys/libmysyslt.la \
$(top_builddir)/dbug/libdbuglt.la \
$(top_builddir)/strings/libmystringslt.la @ZLIB_LIBS@
-#ft_test1_DEPENDENCIES= $(LIBRARIES)
-#ft_eval_DEPENDENCIES= $(LIBRARIES)
myisam_ftdump_DEPENDENCIES= $(LIBRARIES)
myisam_ftdump_LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
$(top_builddir)/mysys/libmysyslt.la \
=== removed file 'storage/myisam/ft_eval.c'
--- a/storage/myisam/ft_eval.c 2008-05-29 15:44:11 +0000
+++ b/storage/myisam/ft_eval.c 1970-01-01 00:00:00 +0000
@@ -1,252 +0,0 @@
-/* Copyright (C) 2000-2002 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
- the Free Software Foundation; version 2 of the License.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code
- added support for long options (my_getopt) 22.5.2002 by Jani Tolonen */
-
-#include "ftdefs.h"
-#include "ft_eval.h"
-#include <stdarg.h>
-#include <my_getopt.h>
-
-static void print_error(int exit_code, const char *fmt,...);
-static void get_options(int argc, char *argv[]);
-static int create_record(char *pos, FILE *file);
-static void usage();
-
-static struct my_option my_long_options[] =
-{
- {"", 's', "", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'q', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'S', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", '#', "", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'V', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", '?', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'h', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
-};
-
-int main(int argc, char *argv[])
-{
- MI_INFO *file;
- int i,j;
-
- MY_INIT(argv[0]);
- get_options(argc,argv);
- bzero((char*)recinfo,sizeof(recinfo));
-
- /* First define 2 columns */
- recinfo[0].type=FIELD_SKIP_ENDSPACE;
- recinfo[0].length=docid_length;
- recinfo[1].type=FIELD_BLOB;
- recinfo[1].length= 4+portable_sizeof_char_ptr;
-
- /* Define a key over the first column */
- keyinfo[0].seg=keyseg;
- keyinfo[0].keysegs=1;
- keyinfo[0].block_length= 0; /* Default block length */
- keyinfo[0].seg[0].type= HA_KEYTYPE_TEXT;
- keyinfo[0].seg[0].flag= HA_BLOB_PART;
- keyinfo[0].seg[0].start=recinfo[0].length;
- keyinfo[0].seg[0].length=key_length;
- keyinfo[0].seg[0].null_bit=0;
- keyinfo[0].seg[0].null_pos=0;
- keyinfo[0].seg[0].bit_start=4;
- keyinfo[0].seg[0].language=MY_CHARSET_CURRENT;
- keyinfo[0].flag = HA_FULLTEXT;
-
- if (!silent)
- printf("- Creating isam-file\n");
- if (mi_create(filename,1,keyinfo,2,recinfo,0,NULL,(MI_CREATE_INFO*) 0,0))
- goto err;
- if (!(file=mi_open(filename,2,0)))
- goto err;
- if (!silent)
- printf("Initializing stopwords\n");
- ft_init_stopwords(stopwordlist);
-
- if (!silent)
- printf("- Writing key:s\n");
-
- my_errno=0;
- i=0;
- while (create_record(record,df))
- {
- error=mi_write(file,record);
- if (error)
- printf("I= %2d mi_write: %d errno: %d\n",i,error,my_errno);
- i++;
- }
- fclose(df);
-
- if (mi_close(file)) goto err;
- if (!silent)
- printf("- Reopening file\n");
- if (!(file=mi_open(filename,2,0))) goto err;
- if (!silent)
- printf("- Reading rows with key\n");
- for (i=1;create_record(record,qf);i++)
- {
- FT_DOCLIST *result;
- double w;
- int t, err;
-
- result=ft_nlq_init_search(file,0,blob_record,(uint) strlen(blob_record),1);
- if (!result)
- {
- printf("Query %d failed with errno %3d\n",i,my_errno);
- goto err;
- }
- if (!silent)
- printf("Query %d. Found: %d.\n",i,result->ndocs);
- for (j=0;(err=ft_nlq_read_next(result, read_record))==0;j++)
- {
- t=uint2korr(read_record);
- w=ft_nlq_get_relevance(result);
- printf("%d %.*s %f\n",i,t,read_record+2,w);
- }
- if (err != HA_ERR_END_OF_FILE)
- {
- printf("ft_read_next %d failed with errno %3d\n",j,my_errno);
- goto err;
- }
- ft_nlq_close_search(result);
- }
-
- if (mi_close(file)) goto err;
- my_end(MY_CHECK_ERROR);
-
- return (0);
-
- err:
- printf("got error: %3d when using myisam-database\n",my_errno);
- return 1; /* skip warning */
-
-}
-
-
-static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
-{
- switch (optid) {
- case 's':
- if (stopwordlist && stopwordlist != ft_precompiled_stopwords)
- break;
- {
- FILE *f; char s[HA_FT_MAXLEN]; int i=0,n=SWL_INIT;
-
- if (!(stopwordlist=(const char**) malloc(n*sizeof(char *))))
- print_error(1,"malloc(%d)",n*sizeof(char *));
- if (!(f=fopen(argument,"r")))
- print_error(1,"fopen(%s)",argument);
- while (!feof(f))
- {
- if (!(fgets(s,HA_FT_MAXLEN,f)))
- print_error(1,"fgets(s,%d,%s)",HA_FT_MAXLEN,argument);
- if (!(stopwordlist[i++]=strdup(s)))
- print_error(1,"strdup(%s)",s);
- if (i >= n)
- {
- n+=SWL_PLUS;
- if (!(stopwordlist=(const char**) realloc((char*) stopwordlist,
- n*sizeof(char *))))
- print_error(1,"realloc(%d)",n*sizeof(char *));
- }
- }
- fclose(f);
- stopwordlist[i]=NULL;
- break;
- }
- case 'q': silent=1; break;
- case 'S': if (stopwordlist==ft_precompiled_stopwords) stopwordlist=NULL; break;
- case '#':
- DBUG_PUSH (argument);
- break;
- case 'V':
- case '?':
- case 'h':
- usage();
- exit(1);
- }
- return 0;
-}
-
-
-static void get_options(int argc, char *argv[])
-{
- int ho_error;
-
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
- exit(ho_error);
-
- if (!(d_file=argv[optind])) print_error(1,"No d_file");
- if (!(df=fopen(d_file,"r")))
- print_error(1,"fopen(%s)",d_file);
- if (!(q_file=argv[optind+1])) print_error(1,"No q_file");
- if (!(qf=fopen(q_file,"r")))
- print_error(1,"fopen(%s)",q_file);
- return;
-} /* get options */
-
-
-static int create_record(char *pos, FILE *file)
-{
- uint tmp; char *ptr;
-
- bzero((char *)pos,MAX_REC_LENGTH);
-
- /* column 1 - VARCHAR */
- if (!(fgets(pos+2,MAX_REC_LENGTH-32,file)))
- {
- if (feof(file))
- return 0;
- else
- print_error(1,"fgets(docid) - 1");
- }
- tmp=(uint) strlen(pos+2)-1;
- int2store(pos,tmp);
- pos+=recinfo[0].length;
-
- /* column 2 - BLOB */
-
- if (!(fgets(blob_record,MAX_BLOB_LENGTH,file)))
- print_error(1,"fgets(docid) - 2");
- tmp=(uint) strlen(blob_record);
- int4store(pos,tmp);
- ptr=blob_record;
- memcpy_fixed(pos+4,&ptr,sizeof(char*));
- return 1;
-}
-
-/* VARARGS */
-
-static void print_error(int exit_code, const char *fmt,...)
-{
- va_list args;
-
- va_start(args,fmt);
- fprintf(stderr,"%s: error: ",my_progname);
- (void) vfprintf(stderr, fmt, args);
- (void) fputc('\n',stderr);
- fflush(stderr);
- va_end(args);
- exit(exit_code);
-}
-
-
-static void usage()
-{
- printf("%s [options]\n", my_progname);
- my_print_help(my_long_options);
- my_print_variables(my_long_options);
-}
=== removed file 'storage/myisam/ft_eval.h'
--- a/storage/myisam/ft_eval.h 2006-12-23 19:20:40 +0000
+++ b/storage/myisam/ft_eval.h 1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & Sergei A. Golubchik
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-const char **stopwordlist=ft_precompiled_stopwords;
-
-#define MAX_REC_LENGTH 128
-#define MAX_BLOB_LENGTH 60000
-char record[MAX_REC_LENGTH], read_record[MAX_REC_LENGTH+MAX_BLOB_LENGTH];
-char blob_record[MAX_BLOB_LENGTH+20*20];
-
-char *filename= (char*) "EVAL";
-
-int silent=0, error=0;
-
-uint key_length=MAX_BLOB_LENGTH,docid_length=32;
-char *d_file, *q_file;
-FILE *df,*qf;
-
-MI_COLUMNDEF recinfo[3];
-MI_KEYDEF keyinfo[2];
-HA_KEYSEG keyseg[10];
-
-#define SWL_INIT 500
-#define SWL_PLUS 50
-
-#define MAX_LINE_LENGTH 128
-char line[MAX_LINE_LENGTH];
=== removed file 'storage/myisam/ft_stem.c'
--- a/storage/myisam/ft_stem.c 2006-12-31 00:32:21 +0000
+++ b/storage/myisam/ft_stem.c 1970-01-01 00:00:00 +0000
@@ -1,18 +0,0 @@
-/* Copyright (C) 2000 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
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-/* mulitingual stem */
=== removed file 'storage/myisam/ft_test1.c'
--- a/storage/myisam/ft_test1.c 2008-04-28 16:24:05 +0000
+++ b/storage/myisam/ft_test1.c 1970-01-01 00:00:00 +0000
@@ -1,315 +0,0 @@
-/* Copyright (C) 2000-2002, 2004 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
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code
- added support for long options (my_getopt) 22.5.2002 by Jani Tolonen */
-
-#include "ftdefs.h"
-#include "ft_test1.h"
-#include <my_getopt.h>
-
-static int key_field=FIELD_VARCHAR,extra_field=FIELD_SKIP_ENDSPACE;
-static uint key_length=200,extra_length=50;
-static int key_type=HA_KEYTYPE_TEXT;
-static int verbose=0,silent=0,skip_update=0,
- no_keys=0,no_stopwords=0,no_search=0,no_fulltext=0;
-static int create_flag=0,error=0;
-
-#define MAX_REC_LENGTH 300
-static char record[MAX_REC_LENGTH],read_record[MAX_REC_LENGTH];
-
-static int run_test(const char *filename);
-static void get_options(int argc, char *argv[]);
-static void create_record(char *, int);
-static void usage();
-
-static struct my_option my_long_options[] =
-{
- {"", 'v', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", '?', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'h', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'V', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'v', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 's', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'N', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'S', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'K', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'F', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", 'U', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"", '#', "", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
-};
-
-int main(int argc, char *argv[])
-{
- MY_INIT(argv[0]);
-
- get_options(argc,argv);
-
- exit(run_test("FT1"));
-}
-
-static MI_COLUMNDEF recinfo[3];
-static MI_KEYDEF keyinfo[2];
-static HA_KEYSEG keyseg[10];
-
-static int run_test(const char *filename)
-{
- MI_INFO *file;
- int i,j;
- my_off_t pos;
-
- bzero((char*) recinfo,sizeof(recinfo));
-
- /* First define 2 columns */
- recinfo[0].type=extra_field;
- recinfo[0].length= (extra_field == FIELD_BLOB ? 4 + portable_sizeof_char_ptr :
- extra_length);
- if (extra_field == FIELD_VARCHAR)
- recinfo[0].length+= HA_VARCHAR_PACKLENGTH(extra_length);
- recinfo[1].type=key_field;
- recinfo[1].length= (key_field == FIELD_BLOB ? 4+portable_sizeof_char_ptr :
- key_length);
- if (key_field == FIELD_VARCHAR)
- recinfo[1].length+= HA_VARCHAR_PACKLENGTH(key_length);
-
- /* Define a key over the first column */
- keyinfo[0].seg=keyseg;
- keyinfo[0].keysegs=1;
- keyinfo[0].block_length= 0; /* Default block length */
- keyinfo[0].seg[0].type= key_type;
- keyinfo[0].seg[0].flag= (key_field == FIELD_BLOB) ? HA_BLOB_PART:
- (key_field == FIELD_VARCHAR) ? HA_VAR_LENGTH_PART:0;
- keyinfo[0].seg[0].start=recinfo[0].length;
- keyinfo[0].seg[0].length=key_length;
- keyinfo[0].seg[0].null_bit= 0;
- keyinfo[0].seg[0].null_pos=0;
- keyinfo[0].seg[0].language= default_charset_info->number;
- keyinfo[0].flag = (no_fulltext?HA_PACK_KEY:HA_FULLTEXT);
-
- if (!silent)
- printf("- Creating isam-file\n");
- if (mi_create(filename,(no_keys?0:1),keyinfo,2,recinfo,0,NULL,
- (MI_CREATE_INFO*) 0, create_flag))
- goto err;
- if (!(file=mi_open(filename,2,0)))
- goto err;
-
- if (!silent)
- printf("- %s stopwords\n",no_stopwords?"Skipping":"Initializing");
- ft_init_stopwords(no_stopwords?NULL:ft_precompiled_stopwords);
-
- if (!silent)
- printf("- Writing key:s\n");
-
- my_errno=0;
- for (i=NUPD ; i<NDATAS; i++ )
- {
- create_record(record,i);
- error=mi_write(file,record);
- if (verbose || error)
- printf("I= %2d mi_write: %d errno: %d, record: %s\n",
- i,error,my_errno,data[i].f0);
- }
-
- if (!skip_update)
- {
- if (!silent)
- printf("- Updating rows\n");
-
- /* Read through all rows and update them */
- pos=(ha_rows) 0;
- i=0;
- while ((error=mi_rrnd(file,read_record,pos)) == 0)
- {
- create_record(record,NUPD-i-1);
- if (mi_update(file,read_record,record))
- {
- printf("Can't update row: %.*s, error: %d\n",
- keyinfo[0].seg[0].length,record,my_errno);
- }
- if(++i == NUPD) break;
- pos=HA_OFFSET_ERROR;
- }
- if (i != NUPD)
- printf("Found %d of %d rows\n", i,NUPD);
- }
-
- if (mi_close(file)) goto err;
- if(no_search) return 0;
- if (!silent)
- printf("- Reopening file\n");
- if (!(file=mi_open(filename,2,0))) goto err;
- if (!silent)
- printf("- Reading rows with key\n");
- for (i=0 ; i < NQUERIES ; i++)
- {
- FT_DOCLIST *result;
- result=ft_nlq_init_search(file,0,(char*) query[i],strlen(query[i]),1);
- if(!result)
- {
- printf("Query %d: `%s' failed with errno %3d\n",i,query[i],my_errno);
- continue;
- }
- printf("Query %d: `%s'. Found: %d. Top five documents:\n",
- i,query[i],result->ndocs);
- for (j=0;j<5;j++)
- {
- double w; int err;
- err= ft_nlq_read_next(result, read_record);
- if (err==HA_ERR_END_OF_FILE)
- {
- printf("No more matches!\n");
- break;
- }
- else if (err)
- {
- printf("ft_read_next %d failed with errno %3d\n",j,my_errno);
- break;
- }
- w=ft_nlq_get_relevance(result);
- if (key_field == FIELD_VARCHAR)
- {
- uint l;
- char *p;
- p=recinfo[0].length+read_record;
- l=uint2korr(p);
- printf("%10.7f: %.*s\n",w,(int) l,p+2);
- }
- else
- printf("%10.7f: %.*s\n",w,recinfo[1].length,
- recinfo[0].length+read_record);
- }
- ft_nlq_close_search(result);
- }
-
- if (mi_close(file)) goto err;
- my_end(MY_CHECK_ERROR);
-
- return (0);
-err:
- printf("got error: %3d when using myisam-database\n",my_errno);
- return 1; /* skip warning */
-}
-
-static char blob_key[MAX_REC_LENGTH];
-/* static char blob_record[MAX_REC_LENGTH+20*20]; */
-
-void create_record(char *pos, int n)
-{
- bzero((char*) pos,MAX_REC_LENGTH);
- if (recinfo[0].type == FIELD_BLOB)
- {
- uint tmp;
- char *ptr;
- strnmov(blob_key,data[n].f0,keyinfo[0].seg[0].length);
- tmp=strlen(blob_key);
- int4store(pos,tmp);
- ptr=blob_key;
- memcpy_fixed(pos+4,&ptr,sizeof(char*));
- pos+=recinfo[0].length;
- }
- else if (recinfo[0].type == FIELD_VARCHAR)
- {
- uint tmp;
- /* -1 is here because pack_length is stored in seg->length */
- uint pack_length= HA_VARCHAR_PACKLENGTH(keyinfo[0].seg[0].length-1);
- strnmov(pos+pack_length,data[n].f0,keyinfo[0].seg[0].length);
- tmp=strlen(pos+pack_length);
- if (pack_length == 1)
- *pos= (char) tmp;
- else
- int2store(pos,tmp);
- pos+=recinfo[0].length;
- }
- else
- {
- strnmov(pos,data[n].f0,keyinfo[0].seg[0].length);
- pos+=recinfo[0].length;
- }
- if (recinfo[1].type == FIELD_BLOB)
- {
- uint tmp;
- char *ptr;
- strnmov(blob_key,data[n].f2,keyinfo[0].seg[0].length);
- tmp=strlen(blob_key);
- int4store(pos,tmp);
- ptr=blob_key;
- memcpy_fixed(pos+4,&ptr,sizeof(char*));
- pos+=recinfo[1].length;
- }
- else if (recinfo[1].type == FIELD_VARCHAR)
- {
- uint tmp;
- /* -1 is here because pack_length is stored in seg->length */
- uint pack_length= HA_VARCHAR_PACKLENGTH(keyinfo[0].seg[0].length-1);
- strnmov(pos+pack_length,data[n].f2,keyinfo[0].seg[0].length);
- tmp=strlen(pos+1);
- if (pack_length == 1)
- *pos= (char) tmp;
- else
- int2store(pos,tmp);
- pos+=recinfo[1].length;
- }
- else
- {
- strnmov(pos,data[n].f2,keyinfo[0].seg[0].length);
- pos+=recinfo[1].length;
- }
-}
-
-
-static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
-{
- switch(optid) {
- case 'v': verbose=1; break;
- case 's': silent=1; break;
- case 'F': no_fulltext=1; no_search=1;
- case 'U': skip_update=1; break;
- case 'K': no_keys=no_search=1; break;
- case 'N': no_search=1; break;
- case 'S': no_stopwords=1; break;
- case '#':
- DBUG_PUSH (argument);
- break;
- case 'V':
- case '?':
- case 'h':
- usage();
- exit(1);
- }
- return 0;
-}
-
-/* Read options */
-
-static void get_options(int argc,char *argv[])
-{
- int ho_error;
-
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
- exit(ho_error);
- return;
-} /* get options */
-
-
-static void usage()
-{
- printf("%s [options]\n", my_progname);
- my_print_help(my_long_options);
- my_print_variables(my_long_options);
-}
=== removed file 'storage/myisam/ft_test1.h'
--- a/storage/myisam/ft_test1.h 2006-12-31 00:32:21 +0000
+++ b/storage/myisam/ft_test1.h 1970-01-01 00:00:00 +0000
@@ -1,420 +0,0 @@
-/* Copyright (C) 2000-2001 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
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-#define NUPD 20
-#define NDATAS 389
-struct { const char *f0, *f2; } data[NDATAS] = {
- {"1", "General Information about MySQL"},
- {"1.1", "What is MySQL?"},
- {"1.2", "About this manual"},
- {"1.3", "History of MySQL"},
- {"1.4", "The main features of MySQL"},
- {"1.5", "General SQL information and tutorials"},
- {"1.6", "Useful MySQL-related links"},
- {"1.7", "What are stored procedures and triggers and so on?"},
- {"2", "MySQL mailing lists and how to ask questions/give error (bug) reports"},
- {"2.1", "Subscribing to/un-subscribing from the MySQL mailing list"},
- {"2.2", "Asking questions or reporting bugs"},
- {"2.3", "I think I have found a bug. What information do you need to help me?"},
- {"2.3.1", "MySQL keeps crashing"},
- {"2.4", "Guidelines for answering questions on the mailing list"},
- {"3", "Licensing or When do I have/want to pay for MySQL?"},
- {"3.1", "How much does MySQL cost?"},
- {"3.2", "How do I get commercial support?"},
- {"3.2.1", "Types of commercial support"},
- {"3.2.1.1", "Basic email support"},
- {"3.2.1.2", "Extended email support"},
-/*------------------------------- NUPD=20 -------------------------------*/
- {"3.2.1.3", "Asking: Login support"},
- {"3.2.1.4", "Extended login support"},
- {"3.3", "How do I pay for licenses/support?"},
- {"3.4", "Who do I contact when I want more information about licensing/support?"},
- {"3.5", "What Copyright does MySQL use?"},
- {"3.6", "When may I distribute MySQL commercially without a fee?"},
- {"3.7", "I want to sell a product that can be configured to use MySQL"},
- {"3.8", "I am running a commercial web server using MySQL"},
- {"3.9", "Do I need a license to sell commercial Perl/tcl/PHP/Web+ etc applications?"},
- {"3.10", "Possible future changes in the licensing"},
- {"4", "Compiling and installing MySQL"},
- {"4.1", "How do I get MySQL?"},
- {"4.2", "Which MySQL version should I use?"},
- {"4.3", "How/when will you release updates?"},
- {"4.4", "What operating systems does MySQL support?"},
- {"4.5", "Compiling MySQL from source code"},
- {"4.5.1", "Quick installation overview"},
- {"4.5.2", "Usual configure switches"},
- {"4.5.3", "Applying a patch"},
- {"4.6", "Problems compiling?"},
- {"4.7", "General compilation notes"},
- {"4.8", "MIT-pthreads notes (FreeBSD)"},
- {"4.9", "Perl installation comments"},
- {"4.10", "Special things to consider for some machine/OS combinations"},
- {"4.10.1", "Solaris notes"},
- {"4.10.2", "SunOS 4 notes"},
- {"4.10.3", "Linux notes for all versions"},
- {"4.10.3.1", "Linux-x86 notes"},
- {"4.10.3.2", "RedHat 5.0"},
- {"4.10.3.3", "RedHat 5.1"},
- {"4.10.3.4", "Linux-Sparc notes"},
- {"4.10.3.5", "Linux-Alpha notes"},
- {"4.10.3.6", "MkLinux notes"},
- {"4.10.4", "Alpha-DEC-Unix notes"},
- {"4.10.5", "Alpha-DEC-OSF1 notes"},
- {"4.10.6", "SGI-IRIX notes"},
- {"4.10.7", "FreeBSD notes"},
- {"4.10.7.1", "FreeBSD-3.0 notes"},
- {"4.10.8", "BSD/OS 2.# notes"},
- {"4.10.8.1", "BSD/OS 3.# notes"},
- {"4.10.9", "SCO notes"},
- {"4.10.10", "SCO Unixware 7.0 notes"},
- {"4.10.11", "IBM-AIX notes"},
- {"4.10.12", "HP-UX notes"},
- {"4.11", "TcX binaries"},
- {"4.12", "Win32 notes"},
- {"4.13", "Installation instructions for MySQL binary releases"},
- {"4.13.1", "How to get MySQL Perl support working"},
- {"4.13.2", "Linux notes"},
- {"4.13.3", "HP-UX notes"},
- {"4.13.4", "Linking client libraries"},
- {"4.14", "Problems running mysql_install_db"},
- {"4.15", "Problems starting MySQL"},
- {"4.16", "Automatic start/stop of MySQL"},
- {"4.17", "Option files"},
- {"5", "How standards-compatible is MySQL?"},
- {"5.1", "What extensions has MySQL to ANSI SQL92?"},
- {"5.2", "What functionality is missing in MySQL?"},
- {"5.2.1", "Sub-selects"},
- {"5.2.2", "SELECT INTO TABLE"},
- {"5.2.3", "Transactions"},
- {"5.2.4", "Triggers"},
- {"5.2.5", "Foreign Keys"},
- {"5.2.5.1", "Some reasons NOT to use FOREIGN KEYS"},
- {"5.2.6", "Views"},
- {"5.2.7", "-- as start of a comment"},
- {"5.3", "What standards does MySQL follow?"},
- {"5.4", "What functions exist only for compatibility?"},
- {"5.5", "Limitations of BLOB and TEXT types"},
- {"5.6", "How to cope without COMMIT-ROLLBACK"},
- {"6", "The MySQL access privilege system"},
- {"6.1", "What the privilege system does"},
- {"6.2", "Connecting to the MySQL server"},
- {"6.2.1", "Keeping your password secure"},
- {"6.3", "Privileges provided by MySQL"},
- {"6.4", "How the privilege system works"},
- {"6.5", "The privilege tables"},
- {"6.6", "Setting up the initial MySQL privileges"},
- {"6.7", "Adding new user privileges to MySQL"},
- {"6.8", "An example permission setup"},
- {"6.9", "Causes of Access denied errors"},
- {"6.10", "How to make MySQL secure against crackers"},
- {"7", "MySQL language reference"},
- {"7.1", "Literals: how to write strings and numbers"},
- {"7.1.1", "Strings"},
- {"7.1.2", "Numbers"},
- {"7.1.3", "NULL values"},
- {"7.1.4", "Database, table, index, column and alias names"},
- {"7.1.4.1", "Case sensitivity in names"},
- {"7.2", "Column types"},
- {"7.2.1", "Column type storage requirements"},
- {"7.2.5", "Numeric types"},
- {"7.2.6", "Date and time types"},
- {"7.2.6.1", "The DATE type"},
- {"7.2.6.2", "The TIME type"},
- {"7.2.6.3", "The DATETIME type"},
- {"7.2.6.4", "The TIMESTAMP type"},
- {"7.2.6.5", "The YEAR type"},
- {"7.2.6.6", "Miscellaneous date and time properties"},
- {"7.2.7", "String types"},
- {"7.2.7.1", "The CHAR and VARCHAR types"},
- {"7.2.7.2", "The BLOB and TEXT types"},
- {"7.2.7.3", "The ENUM type"},
- {"7.2.7.4", "The SET type"},
- {"7.2.8", "Choosing the right type for a column"},
- {"7.2.9", "Column indexes"},
- {"7.2.10", "Multiple-column indexes"},
- {"7.2.11", "Using column types from other database engines"},
- {"7.3", "Functions for use in SELECT and WHERE clauses"},
- {"7.3.1", "Grouping functions"},
- {"7.3.2", "Normal arithmetic operations"},
- {"7.3.3", "Bit functions"},
- {"7.3.4", "Logical operations"},
- {"7.3.5", "Comparison operators"},
- {"7.3.6", "String comparison functions"},
- {"7.3.7", "Control flow functions"},
- {"7.3.8", "Mathematical functions"},
- {"7.3.9", "String functions"},
- {"7.3.10", "Date and time functions"},
- {"7.3.11", "Miscellaneous functions"},
- {"7.3.12", "Functions for use with GROUP BY clauses"},
- {"7.4", "CREATE DATABASE syntax"},
- {"7.5", "DROP DATABASE syntax"},
- {"7.6", "CREATE TABLE syntax"},
- {"7.7", "ALTER TABLE syntax"},
- {"7.8", "OPTIMIZE TABLE syntax"},
- {"7.9", "DROP TABLE syntax"},
- {"7.10", "DELETE syntax"},
- {"7.11", "SELECT syntax"},
- {"7.12", "JOIN syntax"},
- {"7.13", "INSERT syntax"},
- {"7.14", "REPLACE syntax"},
- {"7.15", "LOAD DATA INFILE syntax"},
- {"7.16", "UPDATE syntax"},
- {"7.17", "USE syntax"},
- {"7.18", "SHOW syntax (Get information about tables, columns...)"},
- {"7.19", "EXPLAIN syntax (Get information about a SELECT)"},
- {"7.20", "DESCRIBE syntax (Get information about columns)"},
- {"7.21", "LOCK TABLES/UNLOCK TABLES syntax"},
- {"7.22", "SET OPTION syntax"},
- {"7.23", "GRANT syntax (Compatibility function)"},
- {"7.24", "CREATE INDEX syntax (Compatibility function)"},
- {"7.25", "DROP INDEX syntax (Compatibility function)"},
- {"7.26", "Comment syntax"},
- {"7.27", "CREATE FUNCTION/DROP FUNCTION syntax"},
- {"7.28", "Is MySQL picky about reserved words?"},
- {"8", "Example SQL queries"},
- {"8.1", "Queries from twin project"},
- {"8.1.1", "Find all non-distributed twins"},
- {"8.1.2", "Show a table on twin pair status"},
- {"9", "How safe/stable is MySQL?"},
- {"9.1", "How stable is MySQL?"},
- {"9.2", "Why are there is so many releases of MySQL?"},
- {"9.3", "Checking a table for errors"},
- {"9.4", "How to repair tables"},
- {"9.5", "Is there anything special to do when upgrading/downgrading MySQL?"},
- {"9.5.1", "Upgrading from a 3.21 version to 3.22"},
- {"9.5.2", "Upgrading from a 3.20 version to 3.21"},
- {"9.5.3", "Upgrading to another architecture"},
- {"9.6", "Year 2000 compliance"},
- {"10", "MySQL Server functions"},
- {"10.1", "What languages are supported by MySQL?"},
- {"10.1.1", "Character set used for data & sorting"},
- {"10.2", "The update log"},
- {"10.3", "How big can MySQL tables be?"},
- {"11", "Getting maximum performance from MySQL"},
- {"11.1", "How does one change the size of MySQL buffers?"},
- {"11.2", "How compiling and linking affects the speed of MySQL"},
- {"11.3", "How does MySQL use memory?"},
- {"11.4", "How does MySQL use indexes?"},
- {"11.5", "What optimizations are done on WHERE clauses?"},
- {"11.6", "How does MySQL open & close tables?"},
- {"11.6.0.1", "What are the drawbacks of creating possibly thousands of tables in a database?"},
- {"11.7", "How does MySQL lock tables?"},
- {"11.8", "How should I arrange my table to be as fast/small as possible?"},
- {"11.9", "What affects the speed of INSERT statements?"},
- {"11.10", "What affects the speed DELETE statements?"},
- {"11.11", "How do I get MySQL to run at full speed?"},
- {"11.12", "What are the different row formats? Or, when should VARCHAR/CHAR be used?"},
- {"11.13", "Why so many open tables?"},
- {"12", "MySQL benchmark suite"},
- {"13", "MySQL Utilites"},
- {"13.1", "Overview of the different MySQL programs"},
- {"13.2", "The MySQL table check, optimize and repair program"},
- {"13.2.1", "isamchk memory use"},
- {"13.2.2", "Getting low-level table information"},
- {"13.3", "The MySQL compressed read-only table generator"},
- {"14", "Adding new functions to MySQL"},
- {"15", "MySQL ODBC Support"},
- {"15.1", "Operating systems supported by MyODBC"},
- {"15.2", "How to report problems with MyODBC"},
- {"15.3", "Programs known to work with MyODBC"},
- {"15.4", "How to fill in the various fields in the ODBC administrator program"},
- {"15.5", "How to get the value of an AUTO_INCREMENT column in ODBC"},
- {"16", "Problems and common errors"},
- {"16.1", "Some common errors when using MySQL"},
- {"16.1.1", "MySQL server has gone away error"},
- {"16.1.2", "Can't connect to local MySQL server error"},
- {"16.1.3", "Out of memory error"},
- {"16.1.4", "Packet too large error"},
- {"16.1.5", "The table is full error"},
- {"16.1.6", "Commands out of sync error in client"},
- {"16.1.7", "Removing user error"},
- {"16.2", "How MySQL handles a full disk"},
- {"16.3", "How to run SQL commands from a text file"},
- {"16.4", "Where MySQL stores temporary files"},
- {"16.5", "Access denied error"},
- {"16.6", "How to run MySQL as a normal user"},
- {"16.7", "Problems with file permissions"},
- {"16.8", "File not found"},
- {"16.9", "Problems using DATE columns"},
- {"16.10", "Case sensitivity in searches"},
- {"16.11", "Problems with NULL values"},
- {"17", "Solving some common problems with MySQL"},
- {"17.1", "Database replication"},
- {"17.2", "Database backups"},
- {"18", "MySQL client tools and API's"},
- {"18.1", "MySQL C API"},
- {"18.2", "C API datatypes"},
- {"18.3", "C API function overview"},
- {"18.4", "C API function descriptions"},
- {"18.4.1", "mysql_affected_rows()"},
- {"18.4.2", "mysql_close()"},
- {"18.4.3", "mysql_connect()"},
- {"18.4.4", "mysql_create_db()"},
- {"18.4.5", "mysql_data_seek()"},
- {"18.4.6", "mysql_debug()"},
- {"18.4.7", "mysql_drop_db()"},
- {"18.4.8", "mysql_dump_debug_info()"},
- {"18.4.9", "mysql_eof()"},
- {"18.4.10", "mysql_errno()"},
- {"18.4.11", "mysql_error()"},
- {"18.4.12", "mysql_escape_string()"},
- {"18.4.13", "mysql_fetch_field()"},
- {"18.4.14", "mysql_fetch_fields()"},
- {"18.4.15", "mysql_fetch_field_direct()"},
- {"18.4.16", "mysql_fetch_lengths()"},
- {"18.4.17", "mysql_fetch_row()"},
- {"18.4.18", "mysql_field_seek()"},
- {"18.4.19", "mysql_field_tell()"},
- {"18.4.20", "mysql_free_result()"},
- {"18.4.21", "mysql_get_client_info()"},
- {"18.4.22", "mysql_get_host_info()"},
- {"18.4.23", "mysql_get_proto_info()"},
- {"18.4.24", "mysql_get_server_info()"},
- {"18.4.25", "mysql_info()"},
- {"18.4.26", "mysql_init()"},
- {"18.4.27", "mysql_insert_id()"},
- {"18.4.28", "mysql_kill()"},
- {"18.4.29", "mysql_list_dbs()"},
- {"18.4.30", "mysql_list_fields()"},
- {"18.4.31", "mysql_list_processes()"},
- {"18.4.32", "mysql_list_tables()"},
- {"18.4.33", "mysql_num_fields()"},
- {"18.4.34", "mysql_num_rows()"},
- {"18.4.35", "mysql_query()"},
- {"18.4.36", "mysql_real_connect()"},
- {"18.4.37", "mysql_real_query()"},
- {"18.4.38", "mysql_reload()"},
- {"18.4.39", "mysql_row_tell()"},
- {"18.4.40", "mysql_select_db()"},
- {"18.4.41", "mysql_shutdown()"},
- {"18.4.42", "mysql_stat()"},
- {"18.4.43", "mysql_store_result()"},
- {"18.4.44", "mysql_thread_id()"},
- {"18.4.45", "mysql_use_result()"},
- {"18.4.46", "Why is it that after mysql_query() returns success, mysql_store_result() sometimes returns NULL?"},
- {"18.4.47", "What results can I get from a query?"},
- {"18.4.48", "How can I get the unique ID for the last inserted row?"},
- {"18.4.49", "Problems linking with the C API"},
- {"18.4.50", "How to make a thread-safe client"},
- {"18.5", "MySQL Perl API's"},
- {"18.5.1", "DBI with DBD::mysql"},
- {"18.5.1.1", "The DBI interface"},
- {"18.5.1.2", "More DBI/DBD information"},
- {"18.6", "MySQL Java connectivity (JDBC)"},
- {"18.7", "MySQL PHP API's"},
- {"18.8", "MySQL C++ API's"},
- {"18.9", "MySQL Python API's"},
- {"18.10", "MySQL TCL API's"},
- {"19", "How MySQL compares to other databases"},
- {"19.1", "How MySQL compares to mSQL"},
- {"19.1.1", "How to convert mSQL tools for MySQL"},
- {"19.1.2", "How mSQL and MySQL client/server communications protocols differ"},
- {"19.1.3", "How mSQL 2.0 SQL syntax differs from MySQL"},
- {"19.2", "How MySQL compares to PostgreSQL"},
- {"A", "Some users of MySQL"},
- {"B", "Contributed programs"},
- {"C", "Contributors to MySQL"},
- {"D", "MySQL change history"},
- {"19.3", "Changes in release 3.22.x (Alpha version)"},
- {"19.3.1", "Changes in release 3.22.7"},
- {"19.3.2", "Changes in release 3.22.6"},
- {"19.3.3", "Changes in release 3.22.5"},
- {"19.3.4", "Changes in release 3.22.4"},
- {"19.3.5", "Changes in release 3.22.3"},
- {"19.3.6", "Changes in release 3.22.2"},
- {"19.3.7", "Changes in release 3.22.1"},
- {"19.3.8", "Changes in release 3.22.0"},
- {"19.4", "Changes in release 3.21.x"},
- {"19.4.1", "Changes in release 3.21.33"},
- {"19.4.2", "Changes in release 3.21.32"},
- {"19.4.3", "Changes in release 3.21.31"},
- {"19.4.4", "Changes in release 3.21.30"},
- {"19.4.5", "Changes in release 3.21.29"},
- {"19.4.6", "Changes in release 3.21.28"},
- {"19.4.7", "Changes in release 3.21.27"},
- {"19.4.8", "Changes in release 3.21.26"},
- {"19.4.9", "Changes in release 3.21.25"},
- {"19.4.10", "Changes in release 3.21.24"},
- {"19.4.11", "Changes in release 3.21.23"},
- {"19.4.12", "Changes in release 3.21.22"},
- {"19.4.13", "Changes in release 3.21.21a"},
- {"19.4.14", "Changes in release 3.21.21"},
- {"19.4.15", "Changes in release 3.21.20"},
- {"19.4.16", "Changes in release 3.21.19"},
- {"19.4.17", "Changes in release 3.21.18"},
- {"19.4.18", "Changes in release 3.21.17"},
- {"19.4.19", "Changes in release 3.21.16"},
- {"19.4.20", "Changes in release 3.21.15"},
- {"19.4.21", "Changes in release 3.21.14b"},
- {"19.4.22", "Changes in release 3.21.14a"},
- {"19.4.23", "Changes in release 3.21.13"},
- {"19.4.24", "Changes in release 3.21.12"},
- {"19.4.25", "Changes in release 3.21.11"},
- {"19.4.26", "Changes in release 3.21.10"},
- {"19.4.27", "Changes in release 3.21.9"},
- {"19.4.28", "Changes in release 3.21.8"},
- {"19.4.29", "Changes in release 3.21.7"},
- {"19.4.30", "Changes in release 3.21.6"},
- {"19.4.31", "Changes in release 3.21.5"},
- {"19.4.32", "Changes in release 3.21.4"},
- {"19.4.33", "Changes in release 3.21.3"},
- {"19.4.34", "Changes in release 3.21.2"},
- {"19.4.35", "Changes in release 3.21.0"},
- {"19.5", "Changes in release 3.20.x"},
- {"19.5.1", "Changes in release 3.20.18"},
- {"19.5.2", "Changes in release 3.20.17"},
- {"19.5.3", "Changes in release 3.20.16"},
- {"19.5.4", "Changes in release 3.20.15"},
- {"19.5.5", "Changes in release 3.20.14"},
- {"19.5.6", "Changes in release 3.20.13"},
- {"19.5.7", "Changes in release 3.20.11"},
- {"19.5.8", "Changes in release 3.20.10"},
- {"19.5.9", "Changes in release 3.20.9"},
- {"19.5.10", "Changes in release 3.20.8"},
- {"19.5.11", "Changes in release 3.20.7"},
- {"19.5.12", "Changes in release 3.20.6"},
- {"19.5.13", "Changes in release 3.20.3"},
- {"19.5.14", "Changes in release 3.20.0"},
- {"19.6", "Changes in release 3.19.x"},
- {"19.6.1", "Changes in release 3.19.5"},
- {"19.6.2", "Changes in release 3.19.4"},
- {"19.6.3", "Changes in release 3.19.3"},
- {"E", "Known errors and design deficiencies in MySQL"},
- {"F", "List of things we want to add to MySQL in the future (The TODO)"},
- {"19.7", "Things that must done in the real near future"},
- {"19.8", "Things that have to be done sometime"},
- {"19.9", "Some things we don't have any plans to do"},
- {"G", "Comments on porting to other systems"},
- {"19.10", "Debugging MySQL"},
- {"19.11", "Comments about RTS threads"},
- {"19.12", "What is the difference between different thread packages?"},
- {"H", "Description of MySQL regular expression syntax"},
- {"I", "What is Unireg?"},
- {"J", "The MySQL server license"},
- {"K", "The MySQL license for Microsoft operating systems"},
- {"*", "SQL command, type and function index"},
- {"*", "Concept Index"}
-};
-
-#define NQUERIES 5
-const char *query[NQUERIES]={
- "mysql information and manual",
- "upgrading from previous version",
- "column indexes",
- "against about after more right the with/without", /* stopwords test */
- "mysql license and copyright"
-};
=== removed file 'storage/myisam/make-ccc'
--- a/storage/myisam/make-ccc 2005-04-27 01:19:54 +0000
+++ b/storage/myisam/make-ccc 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
-rm -f .deps/*.P
-ccc -DMAP_TO_USE_RAID -I./../include -I../include -DDBUG_OFF -fast -O3 -c mi_cache.c mi_changed.c mi_checksum.c mi_close.c mi_create.c mi_dbug.c mi_delete.c mi_delete_all.c mi_delete_table.c mi_dynrec.c mi_extra.c mi_info.c mi_key.c mi_locking.c mi_log.c mi_open.c mi_packrec.c mi_page.c mi_panic.c mi_range.c mi_rename.c mi_rfirst.c mi_rkey.c mi_rlast.c mi_rnext.c mi_rnext_same.c mi_rprev.c mi_rrnd.c mi_rsame.c mi_rsamepos.c mi_scan.c mi_search.c mi_static.c mi_statrec.c mi_unique.c mi_update.c mi_write.c ft_update.c ft_search.o ft_stem.o ft_stopwords.c ft_parser.c
-make sort.o mi_check.o
-rm libmyisam.a
-ar -cr libmyisam.a mi_cache.o sort.o mi_check.o
=== modified file 'storage/myisam/mi_create.c'
--- a/storage/myisam/mi_create.c 2009-02-13 16:30:54 +0000
+++ b/storage/myisam/mi_create.c 2009-05-14 21:49:53 +0000
@@ -892,19 +892,19 @@ uint mi_get_pointer_length(ulonglong fil
if (file_length) /* If not default */
{
#ifdef NOT_YET_READY_FOR_8_BYTE_POINTERS
- if (file_length >= ULL(1) << 56)
+ if (file_length >= 1ULL << 56)
def=8;
else
#endif
- if (file_length >= ULL(1) << 48)
+ if (file_length >= 1ULL << 48)
def=7;
- else if (file_length >= ULL(1) << 40)
+ else if (file_length >= 1ULL << 40)
def=6;
- else if (file_length >= ULL(1) << 32)
+ else if (file_length >= 1ULL << 32)
def=5;
- else if (file_length >= ULL(1) << 24)
+ else if (file_length >= 1ULL << 24)
def=4;
- else if (file_length >= ULL(1) << 16)
+ else if (file_length >= 1ULL << 16)
def=3;
else
def=2;
=== modified file 'storage/myisam/myisam_backup_engine.cc'
--- a/storage/myisam/myisam_backup_engine.cc 2009-02-13 12:40:13 +0000
+++ b/storage/myisam/myisam_backup_engine.cc 2009-05-14 21:49:53 +0000
@@ -974,7 +974,7 @@ Log_backup::Log_backup(const char *log_n
except that it allows us to verify that what restore sends us is really a
log.
*/
- log_file_backup.init(fd, ~(ULL(0)), LOG_FILE_CODE);
+ log_file_backup.init(fd, ~(0ULL), LOG_FILE_CODE);
state= OK;
DBUG_VOID_RETURN;
}
=== modified file 'storage/myisam/myisampack.c'
--- a/storage/myisam/myisampack.c 2009-02-16 21:18:45 +0000
+++ b/storage/myisam/myisampack.c 2009-05-14 21:49:53 +0000
@@ -1958,7 +1958,7 @@ static int make_huff_decode_table(HUFF_T
return 1;
huff_tree->code_len=(uchar*) (huff_tree->code+elements);
make_traverse_code_tree(huff_tree, huff_tree->root,
- 8 * sizeof(ulonglong), LL(0));
+ 8 * sizeof(ulonglong), 0LL);
}
}
return 0;
=== removed file 'storage/myisammrg/make-ccc'
--- a/storage/myisammrg/make-ccc 2005-04-27 01:19:54 +0000
+++ b/storage/myisammrg/make-ccc 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
-ccc -I./../include -I../include -DDBUG_OFF -fast -O3 -c myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myrg_info.c myrg_locking.c myrg_open.c myrg_panic.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c
-rm libmyisammrg.a
-ar -cr libmyisammrg.a myrg_close.o
=== modified file 'storage/mysql_storage_engine.cmake'
--- a/storage/mysql_storage_engine.cmake 2009-03-28 00:27:25 +0000
+++ b/storage/mysql_storage_engine.cmake 2009-05-05 18:58:20 +0000
@@ -29,7 +29,7 @@ IF(NOT SOURCE_SUBLIBS)
#The dll is linked to the mysqld executable
SET(dyn_libname ha_${libname})
ADD_LIBRARY(${dyn_libname} SHARED ${${engine}_SOURCES})
- TARGET_LINK_LIBRARIES (${dyn_libname} mysqld)
+ TARGET_LINK_LIBRARIES (${dyn_libname} libservices mysqld)
MESSAGE("build ${engine} as DLL")
ENDIF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
ENDIF(NOT SOURCE_SUBLIBS)
=== modified file 'storage/ndb/src/ndbapi/NdbRecAttr.cpp'
--- a/storage/ndb/src/ndbapi/NdbRecAttr.cpp 2008-11-11 11:40:42 +0000
+++ b/storage/ndb/src/ndbapi/NdbRecAttr.cpp 2009-05-14 21:49:53 +0000
@@ -392,8 +392,8 @@ ndbrecattr_print_formatted(NdbOut& out,
{
ulonglong tmp=r.u_64_value();
long part1,part2,part3;
- part1=(long) (tmp/LL(1000000));
- part2=(long) (tmp - (ulonglong) part1*LL(1000000));
+ part1=(long) (tmp/1000000LL);
+ part2=(long) (tmp - (ulonglong) part1*1000000LL);
char buf[40];
char* pos=(char*) buf+19;
*pos--=0;
=== modified file 'storage/ndb/test/run-test/setup.cpp'
--- a/storage/ndb/test/run-test/setup.cpp 2008-12-12 08:04:28 +0000
+++ b/storage/ndb/test/run-test/setup.cpp 2009-04-21 09:27:46 +0000
@@ -112,6 +112,8 @@ setup_config(atrt_config& config, const
*/
for (j = 0; j<(size_t)argc; j++)
{
+ if (tmp[j] == args_separator) /* skip arguments separator */
+ continue;
for (k = 0; proc_args[k].name; k++)
{
if (!strncmp(tmp[j], proc_args[k].name, strlen(proc_args[k].name)))
@@ -400,6 +402,12 @@ load_options(int argc, char** argv, int
{
for (size_t i = 0; i<(size_t)argc; i++)
{
+ /**
+ * Skip the separator for arguments from config file and command
+ * line
+ */
+ if (argv[i] == args_separator)
+ continue;
for (size_t j = 0; f_options[j].name; j++)
{
const char * name = f_options[j].name;
=== modified file 'strings/ctype-ucs2.c'
--- a/strings/ctype-ucs2.c 2009-03-17 20:07:27 +0000
+++ b/strings/ctype-ucs2.c 2009-05-14 21:49:53 +0000
@@ -30,12 +30,12 @@
#endif
#undef ULONGLONG_MAX
-#define ULONGLONG_MAX (~(ulonglong) 0)
-#define MAX_NEGATIVE_NUMBER ((ulonglong) LL(0x8000000000000000))
+#define ULONGLONG_MAX ~0ULL
+#define MAX_NEGATIVE_NUMBER 0x8000000000000000ULL
#define INIT_CNT 9
-#define LFACTOR ULL(1000000000)
-#define LFACTOR1 ULL(10000000000)
-#define LFACTOR2 ULL(100000000000)
+#define LFACTOR 1000000000ULL
+#define LFACTOR1 10000000000ULL
+#define LFACTOR2 100000000000ULL
static unsigned long lfactor[9]=
{
=== modified file 'strings/decimal.c'
--- a/strings/decimal.c 2008-08-15 20:00:40 +0000
+++ b/strings/decimal.c 2009-05-14 21:49:53 +0000
@@ -1033,7 +1033,7 @@ int decimal2ulonglong(decimal_t *from, u
if (from->sign)
{
- *to=ULL(0);
+ *to=0ULL;
return E_DEC_OVERFLOW;
}
@@ -2825,9 +2825,9 @@ int main()
test_f2d(1234500009876.5, 0);
printf("==== ulonglong2decimal ====\n");
- test_ull2d(ULL(12345), "12345", 0);
- test_ull2d(ULL(0), "0", 0);
- test_ull2d(ULL(18446744073709551615), "18446744073709551615", 0);
+ test_ull2d(12345ULL, "12345", 0);
+ test_ull2d(0ULL, "0", 0);
+ test_ull2d(18446744073709551615ULL, "18446744073709551615", 0);
printf("==== decimal2ulonglong ====\n");
test_d2ull("12345", "12345", 0);
@@ -2839,10 +2839,10 @@ int main()
test_d2ull("9999999999999999999999999.000", "9999999999999999", 2);
printf("==== longlong2decimal ====\n");
- test_ll2d(LL(-12345), "-12345", 0);
- test_ll2d(LL(-1), "-1", 0);
- test_ll2d(LL(-9223372036854775807), "-9223372036854775807", 0);
- test_ll2d(ULL(9223372036854775808), "-9223372036854775808", 0);
+ test_ll2d(-12345LL, "-12345", 0);
+ test_ll2d(-1LL, "-1", 0);
+ test_ll2d(-9223372036854775807LL, "-9223372036854775807", 0);
+ test_ll2d(9223372036854775808ULL, "-9223372036854775808", 0);
printf("==== decimal2longlong ====\n");
test_d2ll("18446744073709551615", "18446744073", 2);
=== removed file 'strings/make-ccc'
--- a/strings/make-ccc 2000-07-31 19:29:14 +0000
+++ b/strings/make-ccc 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
-ccc -DHAVE_CONFIG_H -I. -I. -I.. -I./../include -I../include -O -DDBUG_OFF -fast -O3 -fomit-frame-pointer -c atof.c bchange.c bcmp.c bfill.c bmove.c bmove512.c bmove_upp.c ct_init.c ctype-latin1.c int2str.c is_prefix.c llstr.c longlong2str.c r_strinstr.c str2int.c strappend.c strcend.c strcont.c strend.c strfill.c strinstr.c strmake.c strmov.c strnmov.c strstr.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c
-rm libmystrings.a
-ar -cr libmystrings.a atof.o
=== modified file 'strings/my_strtoll10.c'
--- a/strings/my_strtoll10.c 2007-05-10 09:59:39 +0000
+++ b/strings/my_strtoll10.c 2009-05-14 21:49:53 +0000
@@ -28,11 +28,11 @@ static ulonglong ulonglong_max= ~(ulongl
#else
#define ULONGLONG_MAX (~(ulonglong) 0)
#endif /* __NETWARE__ && __MWERKS__ */
-#define MAX_NEGATIVE_NUMBER ((ulonglong) LL(0x8000000000000000))
+#define MAX_NEGATIVE_NUMBER ((ulonglong) 0x8000000000000000LL)
#define INIT_CNT 9
-#define LFACTOR ULL(1000000000)
-#define LFACTOR1 ULL(10000000000)
-#define LFACTOR2 ULL(100000000000)
+#define LFACTOR 1000000000ULL
+#define LFACTOR1 10000000000ULL
+#define LFACTOR2 100000000000ULL
static unsigned long lfactor[9]=
{
=== modified file 'strings/my_vsnprintf.c'
--- a/strings/my_vsnprintf.c 2009-03-17 20:07:27 +0000
+++ b/strings/my_vsnprintf.c 2009-04-25 21:20:45 +0000
@@ -21,28 +21,8 @@
/*
Limited snprintf() implementations
- SYNOPSIS
- my_vsnprintf()
- to Store result here
- n Store up to n-1 characters, followed by an end 0
- fmt printf format
- ap Arguments
-
- IMPLEMENTATION:
- Supports following formats:
- %#[l][l]d
- %#[l][l]u
- %#[l][l]x
- %p
- %zd
- %zx
- %f
- %g
- %#.#b Local format; note first # is ignored and second is REQUIRED
- %#.#s Note first # is ignored
-
- RETURN
- length of result string
+ exported to plugins as a service, see the detailed documentation
+ around my_snprintf_service_st
*/
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c 2009-05-08 12:21:14 +0000
+++ b/tests/mysql_client_test.c 2009-05-14 21:49:53 +0000
@@ -10856,11 +10856,11 @@ static void test_bug3035()
const uint32 uint32_max= 4294967295U;
/* it might not work okay everyplace */
- const longlong int64_max= LL(9223372036854775807);
+ const longlong int64_max= 9223372036854775807LL;
const longlong int64_min= -int64_max - 1;
const ulonglong uint64_min= 0U;
- const ulonglong uint64_max= ULL(18446744073709551615);
+ const ulonglong uint64_max= 18446744073709551615ULL;
const char *stmt_text;
@@ -13520,7 +13520,7 @@ static void test_truncation()
/* double -> longlong, negative fp number to signed integer: no loss */
DIE_UNLESS(my_bind++ < bind_array + bind_count);
- DIE_UNLESS(! *my_bind->error && * (longlong*) my_bind->buffer == LL(-12345678910));
+ DIE_UNLESS(! *my_bind->error && * (longlong*) my_bind->buffer == -12345678910LL);
/* big numeric string -> number */
DIE_UNLESS(my_bind++ < bind_array + bind_count);
@@ -15465,7 +15465,7 @@ static void test_bug12925()
{
myheader("test_bug12925");
if (opt_getopt_ll_test)
- DIE_UNLESS(opt_getopt_ll_test == LL(25600*1024*1024));
+ DIE_UNLESS(opt_getopt_ll_test == 25600LL*1024LL*1024LL);
}
Attachment: [text/bzr-bundle] bzr/vvaintroub@mysql.com-20090520090501-zsr3s59phtqnxa90.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0 branch (vvaintroub:2694) | Vladislav Vaintroub | 20 May |