summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-07-27 18:32:42 +0400
committerKonstantin Osipov <kostja@sun.com>2010-07-27 18:32:42 +0400
commit2abe7b9d4ee96919cc0504be3805c8712a46a532 (patch)
treef5b4dd56c20ccff8f87fcf2ff244d4be368ac972
parent6d059673f7dc1dbff5e154b0ca6d1ef2f0fa3cc3 (diff)
parentc6a34a99616c749c1d4874c9e7f7424fd2765de6 (diff)
downloadmariadb-git-2abe7b9d4ee96919cc0504be3805c8712a46a532.tar.gz
Merge trunk-bugfixing -> trunk-runtime.
-rwxr-xr-xBUILD/SETUP.sh30
-rw-r--r--CMakeLists.txt4
-rw-r--r--Makefile.am2
-rw-r--r--client/Makefile.am1
-rw-r--r--client/mysql.cc4
-rw-r--r--client/mysqltest.cc13
-rw-r--r--cmake/build_configurations/mysql_release.cmake141
-rw-r--r--cmake/os/AIX.cmake4
-rw-r--r--cmake/os/WindowsCache.cmake13
-rw-r--r--cmake/ssl.cmake4
-rw-r--r--config.h.cmake22
-rw-r--r--config/ac-macros/character_sets.m43
-rw-r--r--configure.cmake31
-rw-r--r--configure.in9
-rw-r--r--extra/replace.c7
-rw-r--r--extra/resolve_stack_dump.c1
-rw-r--r--extra/yassl/CMakeLists.txt5
-rw-r--r--extra/yassl/taocrypt/CMakeLists.txt5
-rw-r--r--include/Makefile.am6
-rw-r--r--include/atomic/gcc_builtins.h5
-rw-r--r--include/atomic/nolock.h17
-rw-r--r--include/atomic/solaris.h8
-rw-r--r--include/atomic/x86-gcc.h41
-rw-r--r--include/config-win.h441
-rw-r--r--include/lf.h5
-rw-r--r--include/m_string.h38
-rw-r--r--include/my_atomic.h35
-rw-r--r--include/my_attribute.h6
-rw-r--r--include/my_bit.h21
-rw-r--r--include/my_bitmap.h22
-rw-r--r--include/my_global.h257
-rw-r--r--include/my_net.h7
-rw-r--r--include/my_nosys.h2
-rw-r--r--include/my_sys.h23
-rw-r--r--include/my_trie.h141
-rw-r--r--include/my_vle.h38
-rw-r--r--include/myisam.h5
-rw-r--r--include/mysql_embed.h2
-rw-r--r--libmysql/Makefile.am8
-rw-r--r--libmysql/Makefile.shared7
-rw-r--r--libmysql/dll.c107
-rw-r--r--libmysql/errmsg.c134
-rw-r--r--libmysql/libmysql.c7
-rw-r--r--libmysql_r/Makefile.am3
-rw-r--r--libmysqld/CMakeLists.txt2
-rw-r--r--libmysqld/Makefile.am2
-rw-r--r--mysql-test/collections/default.experimental2
-rw-r--r--mysql-test/r/group_by.result29
-rw-r--r--mysql-test/r/raid.result208
-rw-r--r--mysql-test/r/update.result14
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug54044.result3
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql.result8
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug54044.test11
-rw-r--r--mysql-test/suite/innodb/t/innodb_mysql.test14
-rw-r--r--mysql-test/suite/perfschema/include/upgrade_check.inc29
-rw-r--r--mysql-test/suite/perfschema/r/query_cache.result1
-rw-r--r--mysql-test/suite/perfschema/r/selects.result15
-rw-r--r--mysql-test/suite/perfschema/r/server_init.result4
-rw-r--r--mysql-test/suite/perfschema/t/bad_option_1.test12
-rw-r--r--mysql-test/suite/perfschema/t/bad_option_2.test12
-rw-r--r--mysql-test/suite/perfschema/t/global_read_lock.test1
-rw-r--r--mysql-test/suite/perfschema/t/pfs_upgrade.test53
-rw-r--r--mysql-test/suite/perfschema/t/privilege.test4
-rw-r--r--mysql-test/suite/perfschema/t/query_cache.test8
-rw-r--r--mysql-test/suite/perfschema/t/read_only.test1
-rw-r--r--mysql-test/suite/perfschema/t/selects-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/selects.test43
-rw-r--r--mysql-test/suite/perfschema/t/server_init.test3
-rw-r--r--mysql-test/t/group_by.test23
-rw-r--r--mysql-test/t/show_check.test2
-rw-r--r--mysql-test/t/update.test20
-rw-r--r--mysys/CMakeLists.txt25
-rw-r--r--mysys/Makefile.am18
-rw-r--r--mysys/checksum.c7
-rw-r--r--mysys/default.c2
-rw-r--r--mysys/default_modify.c252
-rw-r--r--mysys/lf_alloc-pin.c6
-rw-r--r--mysys/lf_hash.c2
-rw-r--r--mysys/make-conf.c71
-rw-r--r--mysys/mf_iocache.c1
-rw-r--r--mysys/mf_iocache2.c11
-rw-r--r--mysys/mf_keycache.c15
-rw-r--r--mysys/mf_wfile.c123
-rw-r--r--mysys/my_append.c64
-rw-r--r--mysys/my_atomic.c7
-rw-r--r--mysys/my_bit.c7
-rw-r--r--mysys/my_bitmap.c186
-rw-r--r--mysys/my_clock.c32
-rw-r--r--mysys/my_dup.c41
-rw-r--r--mysys/my_handler.c2
-rw-r--r--mysys/my_init.c6
-rw-r--r--mysys/my_net.c42
-rw-r--r--mysys/my_pthread.c6
-rw-r--r--mysys/my_static.c3
-rw-r--r--mysys/my_static.h6
-rw-r--r--mysys/my_vle.c109
-rw-r--r--mysys/rijndael.c16
-rw-r--r--mysys/test_charset.c10
-rw-r--r--mysys/test_fn.c69
-rw-r--r--mysys/thr_alarm.c5
-rw-r--r--mysys/trie.c236
-rw-r--r--packaging/Makefile.am14
-rw-r--r--packaging/WiX/CMakeLists.txt42
-rw-r--r--packaging/WiX/CPackWixConfig.cmake9
-rw-r--r--packaging/WiX/create_msi.cmake.in25
-rw-r--r--packaging/WiX/custom_ui.wxs81
-rw-r--r--packaging/WiX/extra.wxs.in6
-rw-r--r--packaging/WiX/mysql_server.wxs.in59
-rw-r--r--regex/regcomp.c72
-rw-r--r--regex/regcomp.ih5
-rw-r--r--scripts/CMakeLists.txt48
-rwxr-xr-xscripts/make_win_bin_dist1
-rw-r--r--scripts/mysql_config.sh2
-rw-r--r--scripts/mysqld_safe.sh25
-rw-r--r--sql/CMakeLists.txt17
-rw-r--r--sql/Makefile.am7
-rw-r--r--sql/field.cc93
-rw-r--r--sql/field.h11
-rw-r--r--sql/field_conv.cc2
-rw-r--r--sql/filesort.cc6
-rw-r--r--sql/gen_lex_hash.cc85
-rw-r--r--sql/ha_partition.cc18
-rw-r--r--sql/ha_partition.h3
-rw-r--r--sql/handler.cc13
-rw-r--r--sql/handler.h4
-rw-r--r--sql/hostname.cc4
-rw-r--r--sql/item.cc74
-rw-r--r--sql/item.h37
-rw-r--r--sql/item_cmpfunc.cc21
-rw-r--r--sql/item_cmpfunc.h35
-rw-r--r--sql/item_geofunc.cc2
-rw-r--r--sql/item_subselect.h2
-rw-r--r--sql/item_sum.cc5
-rw-r--r--sql/item_sum.h5
-rw-r--r--sql/log.h1
-rw-r--r--sql/mysqld.cc30
-rw-r--r--sql/mysqld.h13
-rw-r--r--sql/nt_servc.cc23
-rw-r--r--sql/opt_range.h6
-rw-r--r--sql/protocol.cc33
-rw-r--r--sql/repl_failsafe.cc99
-rw-r--r--sql/repl_failsafe.h2
-rw-r--r--sql/rpl_record.cc3
-rw-r--r--sql/set_var.h1
-rw-r--r--sql/slave.cc12
-rw-r--r--sql/sql_class.cc65
-rw-r--r--sql/sql_delete.cc3
-rw-r--r--sql/sql_error.cc13
-rw-r--r--sql/sql_lex.cc1
-rw-r--r--sql/sql_lex.h6
-rw-r--r--sql/sql_map.cc144
-rw-r--r--sql/sql_map.h70
-rw-r--r--sql/sql_olap.cc188
-rw-r--r--sql/sql_parse.cc24
-rw-r--r--sql/sql_plugin.cc58
-rw-r--r--sql/sql_priv.h2
-rw-r--r--sql/sql_select.cc91
-rw-r--r--sql/sql_show.cc46
-rw-r--r--sql/sql_table.cc20
-rw-r--r--sql/sql_update.cc12
-rw-r--r--sql/sys_vars.cc8
-rw-r--r--sql/table.cc6
-rw-r--r--sql/udf_example.c3
-rw-r--r--storage/csv/ha_tina.cc6
-rw-r--r--storage/federated/ha_federated.cc10
-rw-r--r--storage/heap/ha_heap.cc4
-rw-r--r--storage/heap/hp_test2.c5
-rw-r--r--storage/innobase/dict/dict0crea.c18
-rw-r--r--storage/innobase/handler/ha_innodb.cc24
-rw-r--r--storage/innobase/os/os0file.c12
-rw-r--r--storage/myisam/ft_boolean_search.c2
-rw-r--r--storage/myisam/ft_nlq_search.c3
-rw-r--r--storage/myisam/ft_parser.c2
-rw-r--r--storage/myisam/ft_update.c3
-rw-r--r--storage/myisam/mi_check.c92
-rw-r--r--storage/myisam/mi_create.c20
-rw-r--r--storage/myisam/mi_delete_table.c33
-rw-r--r--storage/myisam/mi_dynrec.c20
-rw-r--r--storage/myisam/mi_key.c2
-rw-r--r--storage/myisam/mi_log.c2
-rw-r--r--storage/myisam/mi_open.c57
-rw-r--r--storage/myisam/mi_packrec.c3
-rw-r--r--storage/myisam/mi_rename.c21
-rw-r--r--storage/myisam/mi_static.c1
-rw-r--r--storage/myisam/mi_test1.c12
-rw-r--r--storage/myisam/mi_test2.c2
-rw-r--r--storage/myisam/mi_test3.c2
-rw-r--r--storage/myisam/mi_unique.c6
-rw-r--r--storage/myisam/mi_write.c5
-rw-r--r--storage/myisam/myisam_ftdump.c2
-rw-r--r--storage/myisam/myisamchk.c41
-rw-r--r--storage/myisam/myisamdef.h12
-rw-r--r--storage/myisam/myisamlog.c4
-rw-r--r--storage/myisam/myisampack.c9
-rw-r--r--storage/myisam/rt_test.c43
-rw-r--r--storage/myisam/sp_key.c2
-rw-r--r--storage/myisam/sp_test.c85
-rw-r--r--storage/myisammrg/ha_myisammrg.cc2
-rw-r--r--storage/ndb/include/kernel/signaldata/FsOpenReq.hpp8
-rw-r--r--storage/ndb/include/util/ndb_opts.h22
-rw-r--r--storage/ndb/src/cw/cpcd/main.cpp12
-rw-r--r--storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp4
-rw-r--r--storage/ndb/src/kernel/vm/Configuration.cpp16
-rw-r--r--storage/ndb/src/mgmclient/main.cpp4
-rw-r--r--storage/ndb/src/mgmsrv/main.cpp14
-rw-r--r--storage/ndb/src/ndbapi/TransporterFacade.hpp4
-rw-r--r--storage/ndb/test/ndbapi/testIndexStat.cpp26
-rw-r--r--storage/ndb/test/ndbapi/test_event_merge.cpp34
-rw-r--r--storage/ndb/test/ndbapi/test_event_multi_table.cpp2
-rw-r--r--storage/ndb/test/run-test/main.cpp36
-rw-r--r--storage/ndb/test/src/NDBT_Test.cpp20
-rw-r--r--storage/ndb/test/tools/connect.cpp6
-rw-r--r--storage/ndb/tools/delete_all.cpp8
-rw-r--r--storage/ndb/tools/desc.cpp8
-rw-r--r--storage/ndb/tools/drop_index.cpp2
-rw-r--r--storage/ndb/tools/drop_tab.cpp2
-rw-r--r--storage/ndb/tools/listTables.cpp12
-rw-r--r--storage/ndb/tools/ndb_config.cpp22
-rw-r--r--storage/ndb/tools/restore/restore_main.cpp56
-rw-r--r--storage/ndb/tools/select_all.cpp26
-rw-r--r--storage/ndb/tools/select_count.cpp6
-rw-r--r--storage/ndb/tools/waiter.cpp8
-rw-r--r--storage/perfschema/pfs_events_waits.cc6
-rw-r--r--strings/CMakeLists.txt12
-rw-r--r--strings/Makefile.am16
-rw-r--r--strings/bfill.c57
-rw-r--r--strings/bmove.c34
-rw-r--r--strings/bmove512.c125
-rw-r--r--strings/bmove_upp-sparc.s40
-rw-r--r--strings/bmove_upp.c18
-rw-r--r--strings/ctype-simple.c108
-rw-r--r--strings/ctype-ucs2.c20
-rw-r--r--strings/do_ctype.c4
-rw-r--r--strings/r_strinstr.c50
-rw-r--r--strings/str_test.c2
-rw-r--r--strings/strappend-sparc.s49
-rw-r--r--strings/strcend.c18
-rw-r--r--strings/strend-sparc.s35
-rw-r--r--strings/strend.c13
-rw-r--r--strings/string.doc5
-rw-r--r--strings/strings-not-used.h41
-rw-r--r--strings/strings-x86.s23
-rw-r--r--strings/strinstr-sparc.s43
-rw-r--r--strings/strinstr.c48
-rw-r--r--strings/strmake-sparc.s43
-rw-r--r--strings/strmov-sparc.s36
-rw-r--r--strings/strmov.c16
-rw-r--r--strings/strnmov-sparc.s43
-rw-r--r--strings/strstr-sparc.s72
-rw-r--r--strings/strxmov-sparc.s54
-rw-r--r--tests/mysql_client_test.c209
-rw-r--r--tests/thread_test.c28
-rw-r--r--unittest/mysys/my_atomic-t.c19
-rw-r--r--unittest/mytap/tap.c6
254 files changed, 1472 insertions, 6152 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index b5f1c7b200e..afb8eca08f2 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -15,7 +15,7 @@ Usage: $0 [-h|-n] [configure-options]
-n, --just-print Don't actually run any commands; just print them.
-c, --just-configure Stop after running configure.
--with-debug=full Build with full debug.
- --warning-mode=[old|pedantic]
+ --warning-mode=[old|pedantic|maintainer]
Influences the debug flags. Old is default.
--prefix=path Build with prefix 'path'.
@@ -62,6 +62,7 @@ just_print=
just_configure=
full_debug=
warning_mode=
+maintainer_mode=
parse_options "$@"
@@ -88,7 +89,21 @@ AM_MAKEFLAGS="-j 6"
# Ex --with-ssl=/usr
SSL_LIBRARY=--with-ssl
-if [ "x$warning_mode" != "xpedantic" ]; then
+if [ "x$warning_mode" = "xpedantic" ]; then
+ warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
+ c_warnings="$warnings"
+ cxx_warnings="$warnings -std=c++98"
+# NOTE: warning mode should not influence optimize/debug mode.
+# Please feel free to add a separate option if you don't feel it's an overkill.
+ debug_extra_cflags="-O0"
+# Reset CPU flags (-mtune), they don't work in -pedantic mode
+ check_cpu_cflags=""
+elif [ "x$warning_mode" = "xmaintainer" ]; then
+ c_warnings="-Wall -Wextra"
+ cxx_warnings="$c_warnings -Wno-unused-parameter"
+ maintainer_mode="--enable-mysql-maintainer-mode"
+ debug_extra_cflags="-g3"
+else
# Both C and C++ warnings
warnings="-Wall -Wextra -Wunused -Wwrite-strings"
@@ -103,15 +118,6 @@ if [ "x$warning_mode" != "xpedantic" ]; then
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
# Added unless --with-debug=full
debug_extra_cflags="-O0 -g3 -gdwarf-2"
-else
- warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
- c_warnings="$warnings"
- cxx_warnings="$warnings -std=c++98"
-# NOTE: warning mode should not influence optimize/debug mode.
-# Please feel free to add a separate option if you don't feel it's an overkill.
- debug_extra_cflags="-O0"
-# Reset CPU flags (-mtune), they don't work in -pedantic mode
- check_cpu_cflags=""
fi
# Set flags for various build configurations.
@@ -147,7 +153,7 @@ fi
base_configs="--prefix=$prefix --enable-assembler "
base_configs="$base_configs --with-extra-charsets=complex "
base_configs="$base_configs --enable-thread-safe-client "
-base_configs="$base_configs --with-big-tables"
+base_configs="$base_configs --with-big-tables $maintainer_mode"
if test -d "$path/../cmd-line-utils/readline"
then
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ff2507dcc3..e50e24d0fa5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -165,9 +165,9 @@ IF(WITH_ERROR_INJECT)
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DERROR_INJECT_SUPPORT")
ENDIF()
-OPTION(ENABLE_LOCAL_INFILE
+OPTION(ENABLED_LOCAL_INFILE
"If we should should enable LOAD DATA LOCAL by default" ${IF_WIN})
-MARK_AS_ADVANCED(ENABLE_LOCAL_INFILE)
+MARK_AS_ADVANCED(ENABLED_LOCAL_INFILE)
OPTION(WITH_FAST_MUTEXES "Compile with fast mutexes" OFF)
MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
diff --git a/Makefile.am b/Makefile.am
index 297e923905e..a559972969b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,6 +30,7 @@ SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@libmysqld_dirs@ \
mysql-test support-files sql-bench \
win \
+ packaging \
cmake
DIST_SUBDIRS = . include Docs zlib \
cmd-line-utils sql-common scripts \
@@ -40,6 +41,7 @@ DIST_SUBDIRS = . include Docs zlib \
mysql-test support-files sql-bench \
win \
cmake \
+ packaging \
BUILD
DISTCLEANFILES = ac_available_languages_fragment
diff --git a/client/Makefile.am b/client/Makefile.am
index 04f0ac39b0e..393573a061e 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -62,7 +62,6 @@ mysqlbinlog_SOURCES = mysqlbinlog.cc \
$(top_srcdir)/mysys/my_new.cc \
$(top_srcdir)/mysys/my_bit.c \
$(top_srcdir)/mysys/my_bitmap.c \
- $(top_srcdir)/mysys/my_vle.c \
$(top_srcdir)/mysys/base64.c
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
diff --git a/client/mysql.cc b/client/mysql.cc
index abf01d8127d..d768a01eb5d 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -627,10 +627,6 @@ static COMMANDS commands[] = {
{ "QUARTER", 0, 0, 0, ""},
{ "QUERY", 0, 0, 0, ""},
{ "QUICK", 0, 0, 0, ""},
- { "RAID0", 0, 0, 0, ""},
- { "RAID_CHUNKS", 0, 0, 0, ""},
- { "RAID_CHUNKSIZE", 0, 0, 0, ""},
- { "RAID_TYPE", 0, 0, 0, ""},
{ "READ", 0, 0, 0, ""},
{ "READS", 0, 0, 0, ""},
{ "REAL", 0, 0, 0, ""},
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index c8ec6c981ef..20f0f6d3164 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -5954,8 +5954,8 @@ static struct my_option my_long_options[] =
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"result-format-version", OPT_RESULT_FORMAT_VERSION,
"Version of the result file format to use",
- (uchar**) &opt_result_format_version,
- (uchar**) &opt_result_format_version, 0,
+ &opt_result_format_version,
+ &opt_result_format_version, 0,
GET_INT, REQUIRED_ARG, 1, 1, 2, 0, 0, 0},
{"server-arg", 'A', "Send option value to embedded server as a parameter.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -5998,8 +5998,7 @@ static struct my_option my_long_options[] =
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT,
"Number of seconds before connection timeout.",
- (uchar**) &opt_connect_timeout,
- (uchar**) &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
+ &opt_connect_timeout, &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
120, 0, 3600 * 12, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -8513,7 +8512,7 @@ void free_replace_column()
typedef struct st_pointer_array { /* when using array-strings */
TYPELIB typelib; /* Pointer to strings */
uchar *str; /* Strings is here */
- int7 *flag; /* Flag about each var. */
+ uint8 *flag; /* Flag about each var. */
uint array_allocs,max_count,length,max_length;
} POINTER_ARRAY;
@@ -9644,7 +9643,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
}
pa->max_count=(PC_MALLOC-MALLOC_OVERHEAD)/(sizeof(uchar*)+
sizeof(*pa->flag));
- pa->flag= (int7*) (pa->typelib.type_names+pa->max_count);
+ pa->flag= (uint8*) (pa->typelib.type_names+pa->max_count);
pa->length=0;
pa->max_length=PS_MALLOC-MALLOC_OVERHEAD;
pa->array_allocs=1;
@@ -9680,7 +9679,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
pa->typelib.type_names=new_array;
old_count=pa->max_count;
pa->max_count=len/(sizeof(uchar*) + sizeof(*pa->flag));
- pa->flag= (int7*) (pa->typelib.type_names+pa->max_count);
+ pa->flag= (uint8*) (pa->typelib.type_names+pa->max_count);
memcpy((uchar*) pa->flag,(char *) (pa->typelib.type_names+old_count),
old_count*sizeof(*pa->flag));
}
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake
index 97de0965f6b..9d010ef7f2a 100644
--- a/cmake/build_configurations/mysql_release.cmake
+++ b/cmake/build_configurations/mysql_release.cmake
@@ -15,6 +15,18 @@
# This file includes build settings used for MySQL release
+INCLUDE(CheckIncludeFiles)
+INCLUDE(CheckLibraryExists)
+INCLUDE(CheckTypeSize)
+
+# XXX package_name.cmake uses this too, move it somewhere global
+CHECK_TYPE_SIZE("void *" SIZEOF_VOIDP)
+IF(SIZEOF_VOIDP EQUAL 4)
+ SET(32BIT 1)
+ENDIF()
+IF(SIZEOF_VOIDP EQUAL 8)
+ SET(64BIT 1)
+ENDIF()
SET(FEATURE_SET "community" CACHE STRING
" Selection of features. Options are
@@ -76,15 +88,14 @@ IF(FEATURE_SET)
SET(WITH_${eng}_STORAGE_ENGINE OFF CACHE BOOL "")
ELSE()
SET(WITH_${eng}_STORAGE_ENGINE ON CACHE BOOL "")
- ENDIF()
+ ENDIF()
ENDFOREACH()
ENDIF()
-OPTION(ENABLE_LOCAL_INFILE "" ON)
+OPTION(ENABLED_LOCAL_INFILE "" ON)
SET(WITH_SSL bundled CACHE STRING "")
SET(WITH_ZLIB bundled CACHE STRING "")
-
IF(NOT COMPILATION_COMMENT)
SET(COMPILATION_COMMENT "MySQL Community Server (GPL)")
ENDIF()
@@ -103,46 +114,75 @@ IF(UNIX)
ENDIF()
OPTION(WITH_PIC "" ON) # Why?
-ENDIF()
+ # Ensure aio is available on Linux (required by InnoDB)
+ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ CHECK_INCLUDE_FILES(libaio.h HAVE_LIBAIO_H)
+ CHECK_LIBRARY_EXISTS(aio io_queue_init "" HAVE_LIBAIO)
+ IF(NOT HAVE_LIBAIO_H OR NOT HAVE_LIBAIO)
+ MESSAGE(FATAL_ERROR "aio is required on Linux")
+ ENDIF()
+ ENDIF()
+
+ENDIF()
# Compiler options
IF(UNIX)
+
# Default GCC flags
+ IF(CMAKE_COMPILER_IS_GNUCC)
+ SET(COMMON_C_FLAGS "-g -static-libgcc -fno-omit-frame-pointer")
+ SET(CMAKE_C_FLAGS_DEBUG "-O ${COMMON_C_FLAGS}")
+ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}")
+ ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX)
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O3 -static-libgcc -fno-omit-frame-pointer")
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3 -static-libgcc -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti")
+ SET(COMMON_CXX_FLAGS "-g -static-libgcc -fno-omit-frame-pointer")
+ SET(CMAKE_CXX_FLAGS_DEBUG "-O ${COMMON_CXX_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}")
ENDIF()
-
# HPUX flags
IF(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
IF(CMAKE_C_COMPILER_ID MATCHES "HP")
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
- SET(CMAKE_C_FLAGS
- "${CMAKE_C_FLAGS} +DD64 +DSitanium2 -mt -AC99")
- SET(CMAKE_CXX_FLAGS
- "${CMAKE_CXX_FLAGS} +DD64 +DSitanium2 -mt -Aa")
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} +O2")
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} +O2")
+ SET(COMMON_C_FLAGS "+DSitanium2 -mt -AC99")
+ SET(COMMON_CXX_FLAGS "+DSitanium2 -mt -Aa")
+ SET(CMAKE_C_FLAGS_DEBUG "+O0 -g ${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_DEBUG "+O0 -g ${COMMON_CXX_FLAGS}")
+ # We have seen compiler bugs with optimisation and -g, so disabled for now
+ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "+O2 ${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "+O2 ${COMMON_CXX_FLAGS}")
ENDIF()
ENDIF()
- SET(WITH_SSL)
+ SET(WITH_SSL no)
ENDIF()
# Linux flags
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-static-intel -static-libgcc -g -O3 -unroll2 -ip -mp -restrict -no-ftz -no-prefetch")
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-static-intel -static-libgcc -g -O3 -unroll2 -ip -mp -restrict -no-ftz -no-prefetch")
+ SET(COMMON_C_FLAGS "-static-intel -static-libgcc -g -mp -restrict")
+ SET(COMMON_CXX_FLAGS "-static-intel -static-libgcc -g -mp -restrict -fno-exceptions -fno-rtti")
+ IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
+ SET(COMMON_C_FLAGS "${COMMON_C_FLAGS} -no-ftz -no-prefetch")
+ SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -no-ftz -no-prefetch")
+ ENDIF()
+ SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}")
+ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -unroll2 -ip ${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -unroll2 -ip ${COMMON_CXX_FLAGS}")
SET(WITH_SSL no)
ENDIF()
ENDIF()
# OSX flags
IF(APPLE)
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -Os -fno-common")
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -Os -felide-constructors -fno-common")
+ SET(COMMON_C_FLAGS "-g -fno-common")
+ # XXX: why are we using -felide-constructors on OSX?
+ SET(COMMON_CXX_FLAGS "-g -fno-common -felide-constructors")
+ SET(CMAKE_C_FLAGS_DEBUG "-O ${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_DEBUG "-O ${COMMON_CXX_FLAGS}")
+ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os ${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Os ${COMMON_CXX_FLAGS}")
ENDIF()
# Solaris flags
@@ -153,37 +193,48 @@ IF(UNIX)
ENDIF()
IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
- IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
- # Solaris x86
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO
- "-g -xO2 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
- "-g0 -xO2 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
- ELSE()
- # Solaris x64
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO
- "-g -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
- "-g0 -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
- ENDIF()
- ELSE()
- IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
- # Solaris sparc 32 bit
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -xO3 -Xa -xstrconst -mt -xarch=sparc")
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g0 -xO3 -noex -mt -xarch=sparc")
- ELSE()
- # Solaris sparc 64 bit
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -xO3 -Xa -xstrconst -mt")
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g0 -xO3 -noex -mt")
- ENDIF()
- ENDIF()
+ SET(COMMON_C_FLAGS "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
+ SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
+ SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}")
+ IF(32BIT)
+ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO2 ${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO2 ${COMMON_CXX_FLAGS}")
+ ELSEIF(64BIT)
+ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_CXX_FLAGS}")
+ ENDIF()
+ ELSE()
+ # Assume !x86 is SPARC
+ SET(COMMON_C_FLAGS "-g -Xa -xstrconst -mt")
+ SET(COMMON_CXX_FLAGS "-g0 -noex -mt")
+ IF(32BIT)
+ SET(COMMON_C_FLAGS "${COMMON_C_FLAGS} -xarch=sparc")
+ SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -xarch=sparc")
+ ENDIF()
+ SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}")
+ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_CXX_FLAGS}")
+ ENDIF()
ENDIF()
ENDIF()
+ IF(CMAKE_C_FLAGS_DEBUG)
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}"
+ CACHE STRING "Debug C compile flags")
+ ENDIF()
+ IF(CMAKE_CXX_FLAGS_DEBUG)
+ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}"
+ CACHE STRING "Debug C++ compile flags")
+ ENDIF()
+ IF(CMAKE_C_FLAGS_RELWITHDEBINFO)
+ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}"
+ CACHE STRING "RelWithDebInfo C compile flags")
+ ENDIF()
IF(CMAKE_CXX_FLAGS_RELWITHDEBINFO)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}"
- CACHE STRING "Compile flags")
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}"
- CACHE STRING "Compile flags")
+ CACHE STRING "RelWithDebInfo C++ compile flags")
ENDIF()
+
ENDIF()
diff --git a/cmake/os/AIX.cmake b/cmake/os/AIX.cmake
index b1b2cebdd14..c08cbbdc0cf 100644
--- a/cmake/os/AIX.cmake
+++ b/cmake/os/AIX.cmake
@@ -28,6 +28,6 @@ INCLUDE(CheckCXXCompilerFlag)
# The following is required to export all symbols
# (also with leading underscore)
STRING(REPLACE "-bexpall" "-bexpfull" CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS
- ${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}")
+ "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}")
STRING(REPLACE "-bexpall" "-bexpfull" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS
- "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}") \ No newline at end of file
+ "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake
index e07e3f54aa8..732f5d74181 100644
--- a/cmake/os/WindowsCache.cmake
+++ b/cmake/os/WindowsCache.cmake
@@ -262,7 +262,6 @@ SET(HAVE_SYS_DIR_H CACHE INTERNAL "")
SET(HAVE_SYS_ERRLIST CACHE INTERNAL "")
SET(HAVE_SYS_FILE_H CACHE INTERNAL "")
SET(HAVE_SYS_FPU_H CACHE INTERNAL "")
-SET(HAVE_SYS_IOCTL CACHE INTERNAL "")
SET(HAVE_SYS_IOCTL_H CACHE INTERNAL "")
SET(HAVE_SYS_IPC_H CACHE INTERNAL "")
SET(HAVE_SYS_MALLOC_H CACHE INTERNAL "")
@@ -340,4 +339,16 @@ SET(C_HAS_inline CACHE INTERNAL "")
SET(C_HAS___inline 1 CACHE INTERNAL "")
SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "")
SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "")
+SET(HAVE_CXXABI_H CACHE INTERNAL "")
+SET(HAVE_NDIR_H CACHE INTERNAL "")
+SET(HAVE_SYS_NDIR_H CACHE INTERNAL "")
+SET(HAVE_SYS_NDIR_H CACHE INTERNAL "")
+SET(HAVE_ASM_TERMBITS_H CACHE INTERNAL "")
+SET(HAVE_TERMBITS_H CACHE INTERNAL "")
+SET(HAVE_VIS_H CACHE INTERNAL "")
+SET(HAVE_WCHAR_H 1 CACHE INTERNAL "")
+SET(HAVE_WCTYPE_H 1 CACHE INTERNAL "")
+SET(HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP CACHE INTERNAL "")
+SET(HAVE_SOCKADDR_IN_SIN_LEN CACHE INTERNAL "")
+SET(HAVE_SOCKADDR_IN6_SIN6_LEN CACHE INTERNAL "")
ENDIF()
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index d1f48888092..c5aa2de2721 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -29,14 +29,14 @@ MACRO (MYSQL_USE_BUNDLED_SSL)
CHANGE_SSL_SETTINGS("bundled")
#Remove -fno-implicit-templates
#(yassl sources cannot be compiled with it)
- SET(SAVE_CXX_FLAGS ${CXX_FLAGS})
+ SET(SAVE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
IF(CMAKE_CXX_FLAGS)
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS
${CMAKE_CXX_FLAGS})
ENDIF()
ADD_SUBDIRECTORY(extra/yassl)
ADD_SUBDIRECTORY(extra/yassl/taocrypt)
- SET(CXX_FLAGS ${SAVE_CXX_FLAGS})
+ SET(CMAKE_CXX_FLAGS ${SAVE_CXX_FLAGS})
GET_TARGET_PROPERTY(src yassl SOURCES)
FOREACH(file ${src})
SET(SSL_SOURCES ${SSL_SOURCES} ${CMAKE_SOURCE_DIR}/extra/yassl/${file})
diff --git a/config.h.cmake b/config.h.cmake
index 2d877ed853f..1b59c580503 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -22,11 +22,14 @@
#cmakedefine HAVE_ALLOCA_H 1
#cmakedefine HAVE_AIO_H 1
#cmakedefine HAVE_ARPA_INET_H 1
+#cmakedefine HAVE_ASM_MSR_H 1
+#cmakedefine HAVE_ASM_TERMBITS_H 1
#cmakedefine HAVE_BSEARCH 1
#cmakedefine HAVE_CRYPT_H 1
#cmakedefine HAVE_CURSES_H 1
#cmakedefine HAVE_CXXABI_H 1
#cmakedefine HAVE_NCURSES_H 1
+#cmakedefine HAVE_NDIR_H 1
#cmakedefine HAVE_DIRENT_H 1
#cmakedefine HAVE_DLFCN_H 1
#cmakedefine HAVE_EXECINFO_H 1
@@ -70,6 +73,7 @@
#cmakedefine HAVE_SYS_IPC_H 1
#cmakedefine HAVE_SYS_MALLOC_H 1
#cmakedefine HAVE_SYS_MMAN_H 1
+#cmakedefine HAVE_SYS_NDIR_H 1
#cmakedefine HAVE_SYS_PTE_H 1
#cmakedefine HAVE_SYS_PTEM_H 1
#cmakedefine HAVE_SYS_PRCTL_H 1
@@ -87,6 +91,7 @@
#cmakedefine HAVE_SYS_UN_H 1
#cmakedefine HAVE_SYS_VADVISE_H 1
#cmakedefine HAVE_TERM_H 1
+#cmakedefine HAVE_TERMBITS_H 1
#cmakedefine HAVE_TERMIOS_H 1
#cmakedefine HAVE_TERMIO_H 1
#cmakedefine HAVE_TERMCAP_H 1
@@ -129,9 +134,11 @@
#cmakedefine HAVE_BMOVE 1
#cmakedefine HAVE_BZERO 1
#cmakedefine HAVE_INDEX 1
+#cmakedefine HAVE_CHOWN 1
#cmakedefine HAVE_CLOCK_GETTIME 1
#cmakedefine HAVE_CRYPT 1
#cmakedefine HAVE_CUSERID 1
+#cmakedefine HAVE_CXX_NEW 1
#cmakedefine HAVE_DIRECTIO 1
#cmakedefine HAVE_DLERROR 1
#cmakedefine HAVE_DLOPEN 1
@@ -146,6 +153,7 @@
#cmakedefine HAVE_FPSETMASK 1
#cmakedefine HAVE_FSEEKO 1
#cmakedefine HAVE_FSYNC 1
+#cmakedefine HAVE_FTIME 1
#cmakedefine HAVE_GETADDRINFO 1
#cmakedefine HAVE_GETCWD 1
#cmakedefine HAVE_GETHOSTBYADDR_R 1
@@ -175,6 +183,8 @@
#cmakedefine HAVE_LOG2 1
#cmakedefine HAVE_LONGJMP 1
#cmakedefine HAVE_LSTAT 1
+#cmakedefine HAVE_MEMALIGN 1
+/* #cmakedefine HAVE_MLOCK 1 see Bug#54662 */
#cmakedefine HAVE_NPTL 1
#cmakedefine HAVE_NL_LANGINFO 1
#cmakedefine HAVE_MADVISE 1
@@ -195,6 +205,8 @@
#cmakedefine HAVE_PREAD 1
#cmakedefine HAVE_PAUSE_INSTRUCTION 1
#cmakedefine HAVE_FAKE_PAUSE_INSTRUCTION 1
+#cmakedefine HAVE_RDTSCLL 1
+#cmakedefine HAVE_READ_REAL_TIME 1
#cmakedefine HAVE_PTHREAD_ATTR_CREATE 1
#cmakedefine HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
#cmakedefine HAVE_PTHREAD_ATTR_SETPRIO 1
@@ -321,13 +333,13 @@
#endif
#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@
-#cmakedefine HAVE_CHAR 1
-#cmakedefine HAVE_LONG 1
-#cmakedefine HAVE_CHARP 1
+#define HAVE_CHAR 1
+#define HAVE_LONG 1
+#define HAVE_CHARP 1
#cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@
-#cmakedefine HAVE_SHORT 1
+#define HAVE_SHORT 1
#cmakedefine SIZEOF_INT @SIZEOF_INT@
-#cmakedefine HAVE_INT 1
+#define HAVE_INT 1
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
#cmakedefine HAVE_LONG_LONG 1
#cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@
diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4
index 81967d383ec..c49e4f89316 100644
--- a/config/ac-macros/character_sets.m4
+++ b/config/ac-macros/character_sets.m4
@@ -5,9 +5,6 @@ dnl you must also create strings/ctype-$charset_name.c
AC_DIVERT_PUSH(0)
-# Any changes to the available character sets must also go into
-# include/config-win.h
-
define(CHARSETS_AVAILABLE0,binary)
define(CHARSETS_AVAILABLE1,armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257)
define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8)
diff --git a/configure.cmake b/configure.cmake
index ab3d706ee01..d032d7ed448 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -202,6 +202,7 @@ CHECK_INCLUDE_FILES (limits.h HAVE_LIMITS_H)
CHECK_INCLUDE_FILES (locale.h HAVE_LOCALE_H)
CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
CHECK_INCLUDE_FILES (memory.h HAVE_MEMORY_H)
+CHECK_INCLUDE_FILES (ndir.h HAVE_NDIR_H)
CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILES (paths.h HAVE_PATHS_H)
CHECK_INCLUDE_FILES (port.h HAVE_PORT_H)
@@ -210,7 +211,8 @@ CHECK_INCLUDE_FILES (pwd.h HAVE_PWD_H)
CHECK_INCLUDE_FILES (sched.h HAVE_SCHED_H)
CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H)
CHECK_INCLUDE_FILES (semaphore.h HAVE_SEMAPHORE_H)
-CHECK_INCLUDE_FILES (sys/dir.h HAVE_SYS_DIR_H)
+CHECK_INCLUDE_FILES ("sys/types.h;sys/dir.h" HAVE_SYS_DIR_H)
+CHECK_INCLUDE_FILES (sys/ndir.h HAVE_SYS_NDIR_H)
CHECK_INCLUDE_FILES (sys/pte.h HAVE_SYS_PTE_H)
CHECK_INCLUDE_FILES (stddef.h HAVE_STDDEF_H)
CHECK_INCLUDE_FILES (stdint.h HAVE_STDINT_H)
@@ -236,6 +238,8 @@ CHECK_INCLUDE_FILES (sys/stream.h HAVE_SYS_STREAM_H)
CHECK_INCLUDE_FILES (sys/termcap.h HAVE_SYS_TERMCAP_H)
CHECK_INCLUDE_FILES ("time.h;sys/timeb.h" HAVE_SYS_TIMEB_H)
CHECK_INCLUDE_FILES ("curses.h;term.h" HAVE_TERM_H)
+CHECK_INCLUDE_FILES (asm/termbits.h HAVE_ASM_TERMBITS_H)
+CHECK_INCLUDE_FILES (termbits.h HAVE_TERMBITS_H)
CHECK_INCLUDE_FILES (termios.h HAVE_TERMIOS_H)
CHECK_INCLUDE_FILES (termio.h HAVE_TERMIO_H)
CHECK_INCLUDE_FILES (termcap.h HAVE_TERMCAP_H)
@@ -249,11 +253,14 @@ CHECK_INCLUDE_FILES (sys/param.h HAVE_SYS_PARAM_H)
CHECK_INCLUDE_FILES (sys/vadvise.h HAVE_SYS_VADVISE_H)
CHECK_INCLUDE_FILES (fnmatch.h HAVE_FNMATCH_H)
CHECK_INCLUDE_FILES (stdarg.h HAVE_STDARG_H)
-CHECK_INCLUDE_FILES("stdlib.h;sys/un.h" HAVE_SYS_UN_H)
+CHECK_INCLUDE_FILES ("stdlib.h;sys/un.h" HAVE_SYS_UN_H)
+CHECK_INCLUDE_FILES (vis.h HAVE_VIS_H)
+CHECK_INCLUDE_FILES (wchar.h HAVE_WCHAR_H)
+CHECK_INCLUDE_FILES (wctype.h HAVE_WCTYPE_H)
IF(HAVE_SYS_STREAM_H)
# Needs sys/stream.h on Solaris
- CHECK_INCLUDE_FILES (sys/stream.h sys/ptem.h HAVE_SYS_PTEM_H)
+ CHECK_INCLUDE_FILES ("sys/stream.h;sys/ptem.h" HAVE_SYS_PTEM_H)
ELSE()
CHECK_INCLUDE_FILES (sys/ptem.h HAVE_SYS_PTEM_H)
ENDIF()
@@ -494,14 +501,18 @@ IF(HAVE_STDINT_H)
SET(CMAKE_EXTRA_INCLUDE_FILES stdint.h)
ENDIF(HAVE_STDINT_H)
+SET(HAVE_VOIDP 1)
+SET(HAVE_CHARP 1)
+SET(HAVE_LONG 1)
+SET(HAVE_SIZE_T 1)
+
IF(NOT APPLE)
- # Prevent some checks on OSX, they return ambigious results
- # on universal 32/64 bit binariess
- MY_CHECK_TYPE_SIZE("void *" VOIDP)
- MY_CHECK_TYPE_SIZE("char *" CHARP)
- MY_CHECK_TYPE_SIZE(long LONG)
- MY_CHECK_TYPE_SIZE(size_t SIZE_T)
+MY_CHECK_TYPE_SIZE("void *" VOIDP)
+MY_CHECK_TYPE_SIZE("char *" CHARP)
+MY_CHECK_TYPE_SIZE(long LONG)
+MY_CHECK_TYPE_SIZE(size_t SIZE_T)
ENDIF()
+
MY_CHECK_TYPE_SIZE(char CHAR)
MY_CHECK_TYPE_SIZE(short SHORT)
MY_CHECK_TYPE_SIZE(int INT)
@@ -749,7 +760,6 @@ IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC)
ENDIF()
CHECK_SYMBOL_EXISTS(tcgetattr "termios.h" HAVE_TCGETATTR 1)
-CHECK_INCLUDE_FILES(sys/ioctl.h HAVE_SYS_IOCTL 1)
#
# Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
@@ -1038,4 +1048,3 @@ SET(CMAKE_EXTRA_INCLUDE_FILES)
CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_INO)
CHECK_STRUCT_HAS_MEMBER("struct dirent" d_namlen "dirent.h" STRUCT_DIRENT_HAS_D_NAMLEN)
SET(SPRINTF_RETURNS_INT 1)
-
diff --git a/configure.in b/configure.in
index a2f0c432681..f4db1d2b39e 100644
--- a/configure.in
+++ b/configure.in
@@ -681,9 +681,8 @@ AC_ARG_ENABLE(assembler,
AC_MSG_CHECKING(if we should use assembler functions)
# For now we only support assembler on i386 and sparc systems
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
-AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
-AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
+AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "")
if test "$ASSEMBLER_TRUE" = ""
then
@@ -1210,7 +1209,6 @@ case $SYSTEM_TYPE in
# Fixes for HPUX 11.0 compiler
if test "$ac_cv_prog_gcc" = "no"
then
- CFLAGS="$CFLAGS -DHAVE_BROKEN_INLINE"
# set working flags first in line, letting override it (i. e. for debug):
CXXFLAGS="+O2 $CXXFLAGS"
MAX_C_OPTIMIZE=""
@@ -1997,6 +1995,9 @@ fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
+AS_IF([test "x$ac_cv_c_inline" = "xno"],
+ [AC_MSG_WARN([The C compiler does not support inline. Beware that unused
+ functions might not be eliminated the object files.])])
AC_TYPE_OFF_T
AC_STRUCT_ST_RDEV
AC_HEADER_TIME
@@ -3057,7 +3058,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
libmysqld/Makefile libmysqld/examples/Makefile dnl
mysql-test/Makefile mysql-test/lib/My/SafeProcess/Makefile dnl
sql-bench/Makefile include/mysql_version.h plugin/Makefile win/Makefile dnl
- cmake/Makefile
+ cmake/Makefile packaging/Makefile
)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
diff --git a/extra/replace.c b/extra/replace.c
index bbe70ba586e..2ce374726eb 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -39,7 +39,6 @@
fill_buffer_retaining() is taken from gnu-grep and modified.
*/
-#define DONT_USE_RAID
#include <my_global.h>
#include <m_ctype.h>
#include <my_sys.h>
@@ -52,7 +51,7 @@
typedef struct st_pointer_array { /* when using array-strings */
TYPELIB typelib; /* Pointer to strings */
uchar *str; /* Strings is here */
- int7 *flag; /* Flag about each var. */
+ uint8 *flag; /* Flag about each var. */
uint array_allocs,max_count,length,max_length;
} POINTER_ARRAY;
@@ -267,7 +266,7 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
}
pa->max_count=(PC_MALLOC-MALLOC_OVERHEAD)/(sizeof(uchar*)+
sizeof(*pa->flag));
- pa->flag= (int7*) (pa->typelib.type_names+pa->max_count);
+ pa->flag= (uint8*) (pa->typelib.type_names+pa->max_count);
pa->length=0;
pa->max_length=PS_MALLOC-MALLOC_OVERHEAD;
pa->array_allocs=1;
@@ -304,7 +303,7 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
pa->typelib.type_names=new_array;
old_count=pa->max_count;
pa->max_count=len/(sizeof(uchar*) + sizeof(*pa->flag));
- pa->flag= (int7*) (pa->typelib.type_names+pa->max_count);
+ pa->flag= (uint8*) (pa->typelib.type_names+pa->max_count);
memcpy((uchar*) pa->flag,(char *) (pa->typelib.type_names+old_count),
old_count*sizeof(*pa->flag));
}
diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c
index 432a207f424..6ea818c601b 100644
--- a/extra/resolve_stack_dump.c
+++ b/extra/resolve_stack_dump.c
@@ -17,7 +17,6 @@
versions into symbolic names. By Sasha Pachev <sasha@mysql.com>
*/
-#define DONT_USE_RAID
#include <my_global.h>
#include <m_ctype.h>
#include <my_sys.h>
diff --git a/extra/yassl/CMakeLists.txt b/extra/yassl/CMakeLists.txt
index 82d7e5b7581..ea991fee8dc 100644
--- a/extra/yassl/CMakeLists.txt
+++ b/extra/yassl/CMakeLists.txt
@@ -29,6 +29,11 @@ ENDIF()
SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp
src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp
src/yassl_imp.cpp src/yassl_int.cpp)
+
+IF(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION)
+ SET(YASSL_SOURCES ${YASSL_SOURCES} src/template_instnt.cpp)
+ENDIF()
+
ADD_CONVENIENCE_LIBRARY(yassl ${YASSL_SOURCES})
RESTRICT_SYMBOL_EXPORTS(yassl)
diff --git a/extra/yassl/taocrypt/CMakeLists.txt b/extra/yassl/taocrypt/CMakeLists.txt
index 2c43756b6f4..1781ea6f2fa 100644
--- a/extra/yassl/taocrypt/CMakeLists.txt
+++ b/extra/yassl/taocrypt/CMakeLists.txt
@@ -26,6 +26,11 @@ SET(TAOCRYPT_SOURCES src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp
include/error.hpp include/file.hpp include/hash.hpp include/hmac.hpp include/integer.hpp
include/md2.hpp include/md5.hpp include/misc.hpp include/modarith.hpp include/modes.hpp
include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp)
+
+IF(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION)
+ SET(TAOCRYPT_SOURCES ${TAOCRYPT_SOURCES} src/template_instnt.cpp)
+ENDIF()
+
ADD_CONVENIENCE_LIBRARY(taocrypt ${TAOCRYPT_SOURCES})
RESTRICT_SYMBOL_EXPORTS(taocrypt)
diff --git a/include/Makefile.am b/include/Makefile.am
index ad023083829..e30588de065 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -33,16 +33,16 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \
$(HEADERS_GEN_MAKE) probes_mysql.h probes_mysql_nodtrace.h
-noinst_HEADERS = config-win.h lf.h my_bit.h \
+noinst_HEADERS = lf.h my_bit.h \
heap.h my_bitmap.h my_uctype.h password.h \
myisam.h myisampack.h myisammrg.h ft_global.h\
mysys_err.h my_base.h \
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 \
+ my_aes.h my_tree.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 service_versions.h \
my_rdtsc.h mysql/psi/psi_abi_v1.h mysql/psi/psi_abi_v2.h \
- my_vle.h my_user.h my_atomic.h atomic/nolock.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 \
atomic/solaris.h mysql/innodb_priv.h my_compiler.h
diff --git a/include/atomic/gcc_builtins.h b/include/atomic/gcc_builtins.h
index 100ff80cacd..d03d28f572e 100644
--- a/include/atomic/gcc_builtins.h
+++ b/include/atomic/gcc_builtins.h
@@ -22,8 +22,9 @@
v= __sync_lock_test_and_set(a, v);
#define make_atomic_cas_body(S) \
int ## S sav; \
- sav= __sync_val_compare_and_swap(a, *cmp, set); \
- if (!(ret= (sav == *cmp))) *cmp= sav;
+ int ## S cmp_val= *cmp; \
+ sav= __sync_val_compare_and_swap(a, cmp_val, set);\
+ if (!(ret= (sav == cmp_val))) *cmp= sav
#ifdef MY_ATOMIC_MODE_DUMMY
#define make_atomic_load_body(S) ret= *a
diff --git a/include/atomic/nolock.h b/include/atomic/nolock.h
index 5a0c41d9078..4c871473b60 100644
--- a/include/atomic/nolock.h
+++ b/include/atomic/nolock.h
@@ -29,21 +29,22 @@
We choose implementation as follows:
------------------------------------
On Windows using Visual C++ the native implementation should be
- preferrable. When using gcc we prefer the native x86 implementation,
- we prefer the Solaris implementation before the gcc because of
- stability preference, we choose gcc implementation if nothing else
- works on gcc. If neither Visual C++ or gcc we still choose the
- Solaris implementation on Solaris (mainly for SunStudio compiles.
+ preferrable. When using gcc we prefer the Solaris implementation
+ before the gcc because of stability preference, we choose gcc
+ builtins if available, otherwise we choose the somewhat broken
+ native x86 implementation. If neither Visual C++ or gcc we still
+ choose the Solaris implementation on Solaris (mainly for SunStudio
+ compilers).
*/
# if defined(_MSV_VER)
# include "generic-msvc.h"
# elif __GNUC__
-# if defined(__i386__) || defined(__x86_64__)
-# include "x86-gcc.h"
-# elif defined(HAVE_SOLARIS_ATOMIC)
+# if defined(HAVE_SOLARIS_ATOMIC)
# include "solaris.h"
# elif defined(HAVE_GCC_ATOMIC_BUILTINS)
# include "gcc_builtins.h"
+# elif defined(__i386__) || defined(__x86_64__)
+# include "x86-gcc.h"
# endif
# elif defined(HAVE_SOLARIS_ATOMIC)
# include "solaris.h"
diff --git a/include/atomic/solaris.h b/include/atomic/solaris.h
index fc9f369c707..5643f878cd2 100644
--- a/include/atomic/solaris.h
+++ b/include/atomic/solaris.h
@@ -20,11 +20,17 @@
#define MY_ATOMIC_MODE "solaris-atomic"
+#if defined(__GNUC__)
+#define atomic_typeof(T,V) __typeof__(V)
+#else
+#define atomic_typeof(T,V) T
+#endif
+
#define uintptr_t void *
#define atomic_or_ptr_nv(X,Y) (void *)atomic_or_ulong_nv((volatile ulong_t *)X, Y)
#define make_atomic_cas_body(S) \
- uint ## S ## _t sav; \
+ atomic_typeof(uint ## S ## _t, *cmp) sav; \
sav = atomic_cas_ ## S( \
(volatile uint ## S ## _t *)a, \
(uint ## S ## _t)*cmp, \
diff --git a/include/atomic/x86-gcc.h b/include/atomic/x86-gcc.h
index 61b94a48568..8baa84e110e 100644
--- a/include/atomic/x86-gcc.h
+++ b/include/atomic/x86-gcc.h
@@ -53,18 +53,29 @@
#endif
#define make_atomic_add_body32 \
- asm volatile (LOCK_prefix "; xadd %0, %1;" : "+r" (v) , "+m" (*a))
+ asm volatile (LOCK_prefix "; xadd %0, %1;" \
+ : "+r" (v), "=m" (*a) \
+ : "m" (*a) \
+ : "memory")
#define make_atomic_cas_body32 \
+ __typeof__(*cmp) sav; \
asm volatile (LOCK_prefix "; cmpxchg %3, %0; setz %2;" \
- : "+m" (*a), "+a" (*cmp), "=q" (ret): "r" (set))
+ : "=m" (*a), "=a" (sav), "=q" (ret) \
+ : "r" (set), "m" (*a), "a" (*cmp) \
+ : "memory"); \
+ if (!ret) \
+ *cmp= sav
#ifdef __x86_64__
#define make_atomic_add_body64 make_atomic_add_body32
#define make_atomic_cas_body64 make_atomic_cas_body32
-#define make_atomic_fas_body(S) \
- asm volatile ("xchg %0, %1;" : "+r" (v) , "+m" (*a))
+#define make_atomic_fas_body(S) \
+ asm volatile ("xchg %0, %1;" \
+ : "+r" (v), "=m" (*a) \
+ : "m" (*a) \
+ : "memory")
/*
Actually 32-bit reads/writes are always atomic on x86
@@ -73,9 +84,14 @@
#define make_atomic_load_body(S) \
ret=0; \
asm volatile (LOCK_prefix "; cmpxchg %2, %0" \
- : "+m" (*a), "+a" (ret): "r" (ret))
+ : "=m" (*a), "=a" (ret) \
+ : "r" (ret), "m" (*a) \
+ : "memory")
#define make_atomic_store_body(S) \
- asm volatile ("; xchg %0, %1;" : "+m" (*a), "+r" (v))
+ asm volatile ("; xchg %0, %1;" \
+ : "=m" (*a), "+r" (v) \
+ : "m" (*a) \
+ : "memory")
#else
/*
@@ -104,12 +120,13 @@
platforms the much simpler make_atomic_cas_body32 will work
fine.
*/
-#define make_atomic_cas_body64 \
- int32 ebx=(set & 0xFFFFFFFF), ecx=(set >> 32); \
- asm volatile ("push %%ebx; movl %3, %%ebx;" \
- LOCK_prefix "; cmpxchg8b %0; setz %2; pop %%ebx"\
- : "+m" (*a), "+A" (*cmp), "=c" (ret) \
- :"m" (ebx), "c" (ecx))
+#define make_atomic_cas_body64 \
+ int32 ebx=(set & 0xFFFFFFFF), ecx=(set >> 32); \
+ asm volatile ("push %%ebx; movl %3, %%ebx;" \
+ LOCK_prefix "; cmpxchg8b %0; setz %2; pop %%ebx" \
+ : "=m" (*a), "+A" (*cmp), "=c" (ret) \
+ : "m" (ebx), "c" (ecx), "m" (*a) \
+ : "memory", "esp")
#endif
/*
diff --git a/include/config-win.h b/include/config-win.h
deleted file mode 100644
index 9e8bb19c12d..00000000000
--- a/include/config-win.h
+++ /dev/null
@@ -1,441 +0,0 @@
-#ifndef CONFIG_WIN_INCLUDED
-#define CONFIG_WIN_INCLUDED
-
-/* Copyright 2000-2008 MySQL AB, 2008 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 */
-
-/* Defines for Win32 to make it compatible for MySQL */
-
-#define BIG_TABLES
-
-/*
- Minimal version of Windows we should be able to run on.
- Currently Windows XP.
-*/
-#define _WIN32_WINNT 0x0501
-
-
-#if defined(_MSC_VER) && _MSC_VER >= 1400
-/* Avoid endless warnings about sprintf() etc. being unsafe. */
-#define _CRT_SECURE_NO_DEPRECATE 1
-#endif
-
-#include <sys/locking.h>
-#include <winsock2.h>
-#include <Ws2tcpip.h>
-#include <fcntl.h>
-#include <io.h>
-#include <malloc.h>
-#include <sys/stat.h>
-#include <process.h> /* getpid()*/
-
-
-#define HAVE_SMEM 1
-
-#if defined(_WIN64) || defined(WIN64)
-#define SYSTEM_TYPE "Win64"
-#elif defined(_WIN32) || defined(WIN32)
-#define SYSTEM_TYPE "Win32"
-#else
-#define SYSTEM_TYPE "Windows"
-#endif
-
-#if defined(_M_IA64)
-#define MACHINE_TYPE "ia64"
-#elif defined(_M_IX86)
-#define MACHINE_TYPE "ia32"
-#elif defined(_M_ALPHA)
-#define MACHINE_TYPE "axp"
-#else
-#define MACHINE_TYPE "unknown" /* Define to machine type name */
-#endif
-
-#if !(defined(_WIN64) || defined(WIN64))
-#ifndef _WIN32
-#define _WIN32 /* Compatible with old source */
-#endif
-#ifndef __WIN32__
-#define __WIN32__
-#endif
-#endif /* _WIN64 */
-#ifndef __WIN__
-#define __WIN__ /* To make it easier in VC++ */
-#endif
-
-#ifndef MAX_INDEXES
-#define MAX_INDEXES 64
-#endif
-
-/* File and lock constants */
-#ifdef __BORLANDC__
-#define F_RDLCK LK_NBLCK /* read lock */
-#define F_WRLCK LK_NBRLCK /* write lock */
-#define F_UNLCK LK_UNLCK /* remove lock(s) */
-#else
-#define F_RDLCK _LK_NBLCK /* read lock */
-#define F_WRLCK _LK_NBRLCK /* write lock */
-#define F_UNLCK _LK_UNLCK /* remove lock(s) */
-#endif
-
-#define F_EXCLUSIVE 1 /* We have only exclusive locking */
-#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */
-#define F_OK 0 /* parameter to access() */
-#define W_OK 2
-
-#define S_IROTH S_IREAD /* for my_lib */
-
-/* Winsock2 constant (Vista SDK and later)*/
-#define IPPROTO_IPV6 41
-#ifndef IPV6_V6ONLY
-#define IPV6_V6ONLY 27
-#endif
-
-#ifdef __BORLANDC__
-#define FILE_BINARY O_BINARY /* my_fopen in binary mode */
-#define O_TEMPORARY 0
-#define O_SHORT_LIVED 0
-#define SH_DENYNO _SH_DENYNO
-#else
-#define O_BINARY _O_BINARY /* compability with older style names */
-#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */
-#define O_TEMPORARY _O_TEMPORARY
-#define O_SHORT_LIVED _O_SHORT_LIVED
-#define SH_DENYNO _SH_DENYNO
-#endif
-#define NO_OPEN_3 /* For my_create() */
-
-#define SIGQUIT SIGTERM /* No SIGQUIT */
-
-#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)
-
-/* Type information */
-
-#if !defined(HAVE_UINT)
-#undef HAVE_UINT
-#define HAVE_UINT
-typedef unsigned short ushort;
-typedef unsigned int uint;
-#endif /* !defined(HAVE_UINT) */
-
-typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */
-typedef __int64 longlong;
-#ifndef HAVE_SIGSET_T
-typedef int sigset_t;
-#endif
-#define longlong_defined
-/*
- off_t should not be __int64 because of conflicts in header files;
- Use my_off_t or os_off_t instead
-*/
-#ifndef HAVE_OFF_T
-typedef long off_t;
-#endif
-typedef __int64 os_off_t;
-#ifdef _WIN64
-typedef UINT_PTR rf_SetTimer;
-#else
-typedef uint rf_SetTimer;
-#endif
-
-#ifndef HAVE_SIZE_T
-#ifndef _SIZE_T_DEFINED
-typedef SIZE_T size_t;
-#define _SIZE_T_DEFINED
-#endif
-#endif
-
-#ifndef HAVE_SSIZE_T
-#ifndef _SSIZE_T_DEFINED
-typedef SSIZE_T ssize_t;
-#define _SSIZE_T_DEFINED
-#endif
-#endif
-
-#define Socket_defined
-#define my_socket SOCKET
-#define SIGPIPE SIGINT
-#define RETQSORTTYPE void
-#define QSORT_TYPE_IS_VOID
-#define RETSIGTYPE void
-#define SOCKET_SIZE_TYPE int
-#define my_socket_defined
-#define byte_defined
-#define STDCALL __stdcall /* Used by libmysql.dll */
-#define isnan(X) _isnan(X)
-#define finite(X) _finite(X)
-
-#ifndef MYSQL_CLIENT_NO_THREADS
-#define THREAD
-#endif
-#define VOID_SIGHANDLER
-#define SIZEOF_CHAR 1
-#define SIZEOF_INT 4
-#define SIZEOF_LONG 4
-#define SIZEOF_LONG_LONG 8
-#define SIZEOF_OFF_T 8
-#ifdef _WIN64
-#define SIZEOF_CHARP 8
-#else
-#define SIZEOF_CHARP 4
-#endif
-#define HAVE_BROKEN_NETINET_INCLUDES
-#ifdef _WIN32
-#define HAVE_NAMED_PIPE /* We can only create pipes on NT */
-#endif
-
-/* ERROR is defined in wingdi.h */
-#undef ERROR
-
-/* We need to close files to break connections on shutdown */
-#ifndef SIGNAL_WITH_VIO_CLOSE
-#define SIGNAL_WITH_VIO_CLOSE
-#endif
-
-/* All windows servers should support .sym files */
-#undef USE_SYMDIR
-#define USE_SYMDIR
-
-/* If LOAD DATA LOCAL INFILE should be enabled by default */
-#define ENABLED_LOCAL_INFILE 1
-
-/* If query profiling should be enabled by default */
-#define ENABLED_PROFILING 1
-
-/* Convert some simple functions to Posix */
-
-#define my_sigset(A,B) signal((A),(B))
-#define finite(A) _finite(A)
-#define sleep(A) Sleep((A)*1000)
-#define popen(A,B) _popen((A),(B))
-#define pclose(A) _pclose(A)
-
-#ifndef __BORLANDC__
-#define access(A,B) _access(A,B)
-#endif
-
-#if !defined(__cplusplus)
-#define inline __inline
-#endif /* __cplusplus */
-
-#ifdef _WIN64
-#define ulonglong2double(A) ((double) (ulonglong) (A))
-#define my_off_t2double(A) ((double) (my_off_t) (A))
-
-#else
-inline double ulonglong2double(ulonglong value)
-{
- longlong nr=(longlong) value;
- if (nr >= 0)
- return (double) nr;
- return (18446744073709551616.0 + (double) nr);
-}
-#define my_off_t2double(A) ulonglong2double(A)
-#endif /* _WIN64 */
-
-inline ulonglong double2ulonglong(double d)
-{
- double t= d - (double) 0x8000000000000000ULL;
-
- if (t >= 0)
- return ((ulonglong) t) + 0x8000000000000000ULL;
- return (ulonglong) d;
-}
-
-#if SIZEOF_OFF_T > 4
-#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
-#define tell(A) _telli64(A)
-#endif
-
-#define STACK_DIRECTION -1
-
-/* Difference between GetSystemTimeAsFileTime() and now() */
-#define OFFSET_TO_EPOCH ULL(116444736000000000)
-
-#define HAVE_PERROR
-#define HAVE_VFPRINT
-#define HAVE_RENAME /* Have rename() as function */
-#define HAVE_BINARY_STREAMS /* Have "b" flag in streams */
-#define HAVE_LONG_JMP /* Have long jump function */
-#define HAVE_LOCKING /* have locking() call */
-#define HAVE_ERRNO_AS_DEFINE /* errno is a define */
-#define HAVE_STDLIB /* everything is include in this file */
-#define HAVE_MEMCPY
-#define HAVE_MEMMOVE
-#define HAVE_GETCWD
-#define HAVE_TELL
-#define HAVE_TZNAME
-#define HAVE_PUTENV
-#define HAVE_SELECT
-#define HAVE_SETLOCALE
-#define HAVE_SOCKET /* Giangi */
-#define HAVE_FLOAT_H
-#define HAVE_LIMITS_H
-#define HAVE_STDDEF_H
-#define NO_FCNTL_NONBLOCK /* No FCNTL */
-#define HAVE_ALLOCA
-#define HAVE_STRPBRK
-#define HAVE_STRSTR
-#define HAVE_COMPRESS
-#define HAVE_CREATESEMAPHORE
-#define HAVE_ISNAN
-#define HAVE_FINITE
-#define HAVE_QUERY_CACHE
-#define SPRINTF_RETURNS_INT
-#define HAVE_SETFILEPOINTER
-#define HAVE_VIO_READ_BUFF
-#if defined(_MSC_VER) && _MSC_VER >= 1400
-/* strnlen() appeared in Studio 2005 */
-#define HAVE_STRNLEN
-#endif
-#define HAVE_WINSOCK2
-
-#define strcasecmp stricmp
-#define strncasecmp strnicmp
-
-#define HAVE_SNPRINTF 1
-#define snprintf _snprintf
-
-#define HAVE_SETENV 1
-#define setenv(VAR,VAL,X) _putenv_s(VAR,VAL)
-
-#ifdef _MSC_VER
-#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */
-#define HAVE_ANSI_INCLUDE
-#define HAVE_SYS_UTIME_H
-#define HAVE_STRTOUL
-#endif
-#define my_reinterpret_cast(A) reinterpret_cast <A>
-#define my_const_cast(A) const_cast<A>
-
-
-/* MYSQL OPTIONS */
-
-#ifdef _CUSTOMCONFIG_
-#include <custom_conf.h>
-#else
-#ifndef CMAKE_CONFIGD
-#define DEFAULT_MYSQL_HOME "c:\\mysql"
-#define MYSQL_DATADIR "c:\\mysql\\data"
-#define PACKAGE "mysql"
-#define DEFAULT_BASEDIR "C:\\"
-#define SHAREDIR "share"
-#define DEFAULT_CHARSET_HOME "C:/mysql/"
-#endif
-#endif
-#ifndef DEFAULT_HOME_ENV
-#define DEFAULT_HOME_ENV MYSQL_HOME
-#endif
-#ifndef DEFAULT_GROUP_SUFFIX_ENV
-#define DEFAULT_GROUP_SUFFIX_ENV MYSQL_GROUP_SUFFIX
-#endif
-
-/* File name handling */
-
-#define FN_LIBCHAR '\\'
-#define FN_ROOTDIR "\\"
-#define FN_DEVCHAR ':'
-#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
-#define FN_NO_CASE_SENSE /* Files are not case-sensitive */
-#define OS_FILE_LIMIT UINT_MAX /* No limit*/
-
-#define DO_NOT_REMOVE_THREAD_WRAPPERS
-#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
-#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
-/* The following is only used for statistics, so it should be good enough */
-#ifdef _WIN32
-#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
-#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
-#endif
-
-#define shared_memory_buffer_length 16000
-#define default_shared_memory_base_name "MYSQL"
-
-#define HAVE_SPATIAL 1
-#define HAVE_RTREE_KEYS 1
-
-#define HAVE_OPENSSL 1
-#define HAVE_YASSL 1
-
-#define ENABLED_PROFILING 1
-
-/*
- Our Windows binaries include all character sets which MySQL supports.
- Any changes to the available character sets must also go into
- config/ac-macros/character_sets.m4
-*/
-
-#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
-#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
-
-#define USE_MB 1
-#define USE_MB_IDENT 1
-#define USE_STRCOLL 1
-
-#define HAVE_CHARSET_armscii8
-#define HAVE_CHARSET_ascii
-#define HAVE_CHARSET_big5 1
-#define HAVE_CHARSET_cp1250 1
-#define HAVE_CHARSET_cp1251
-#define HAVE_CHARSET_cp1256
-#define HAVE_CHARSET_cp1257
-#define HAVE_CHARSET_cp850
-#define HAVE_CHARSET_cp852
-#define HAVE_CHARSET_cp866
-#define HAVE_CHARSET_cp932 1
-#define HAVE_CHARSET_dec8
-#define HAVE_CHARSET_eucjpms 1
-#define HAVE_CHARSET_euckr 1
-#define HAVE_CHARSET_gb2312 1
-#define HAVE_CHARSET_gbk 1
-#define HAVE_CHARSET_geostd8
-#define HAVE_CHARSET_greek
-#define HAVE_CHARSET_hebrew
-#define HAVE_CHARSET_hp8
-#define HAVE_CHARSET_keybcs2
-#define HAVE_CHARSET_koi8r
-#define HAVE_CHARSET_koi8u
-#define HAVE_CHARSET_latin1 1
-#define HAVE_CHARSET_latin2 1
-#define HAVE_CHARSET_latin5
-#define HAVE_CHARSET_latin7
-#define HAVE_CHARSET_macce
-#define HAVE_CHARSET_macroman
-#define HAVE_CHARSET_sjis 1
-#define HAVE_CHARSET_swe7
-#define HAVE_CHARSET_tis620 1
-#define HAVE_CHARSET_ucs2 1
-#define HAVE_CHARSET_ujis 1
-#define HAVE_CHARSET_utf8 1
-#define HAVE_CHARSET_utf8mb4 1
-#define HAVE_CHARSET_utf16 1
-#define HAVE_CHARSET_utf32 1
-
-#define HAVE_UCA_COLLATIONS 1
-#define HAVE_BOOL 1
-
-#endif /* CONFIG_WIN_INCLUDED */
diff --git a/include/lf.h b/include/lf.h
index d1f592d1047..e9fb094493f 100644
--- a/include/lf.h
+++ b/include/lf.h
@@ -187,8 +187,6 @@ typedef struct st_lf_allocator {
uchar * volatile top;
uint element_size;
uint32 volatile mallocs;
- void (*constructor)(uchar *); /* called, when an object is malloc()'ed */
- void (*destructor)(uchar *); /* called, when an object is free()'d */
} LF_ALLOCATOR;
void lf_alloc_init(LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset);
@@ -222,8 +220,7 @@ C_MODE_START
#define LF_HASH_UNIQUE 1
-/* lf_hash overhead per element (that is, sizeof(LF_SLIST) */
-extern const int LF_HASH_OVERHEAD;
+/* lf_hash overhead per element is sizeof(LF_SLIST). */
typedef struct {
LF_DYNARRAY array; /* hash itself */
diff --git a/include/m_string.h b/include/m_string.h
index c2779c63941..2ec4eb64c8e 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -92,26 +92,12 @@ extern char _dig_vec_lower[];
#define strmake_overlapp(A,B,C) strmake(A,B,C)
#endif
-#ifdef BAD_MEMCPY /* Problem with gcc on Alpha */
-#define memcpy_fixed(A,B,C) bmove((A),(B),(C))
-#else
-#define memcpy_fixed(A,B,C) memcpy((A),(B),(C))
-#endif
-
-#if (!defined(USE_BMOVE512) || defined(HAVE_purify)) && !defined(bmove512)
-#define bmove512(A,B,C) memcpy(A,B,C)
-#endif
-
/* Prototypes for string functions */
#if !defined(bfill) && !defined(HAVE_BFILL)
extern void bfill(uchar *dst,size_t len,pchar fill);
#endif
-#ifndef bmove512
-extern void bmove512(uchar *dst,const uchar *src,size_t len);
-#endif
-
#if !defined(HAVE_BMOVE) && !defined(bmove)
extern void bmove(uuchar *dst, const uchar *src,size_t len);
#endif
@@ -122,12 +108,7 @@ extern void bchange(uchar *dst,size_t old_len,const uchar *src,
extern void strappend(char *s,size_t len,pchar fill);
extern char *strend(const char *s);
extern char *strcend(const char *, pchar);
-extern char *strfield(char *src,int fields,int chars,int blanks,
- int tabch);
extern char *strfill(char * s,size_t len,pchar fill);
-extern size_t strinstr(const char *str,const char *search);
-extern size_t r_strinstr(const char *str, size_t from, const char *search);
-extern char *strkey(char *dst,char *head,char *tail,char *flags);
extern char *strmake(char *dst,const char *src,size_t length);
#ifndef strmov
@@ -136,35 +117,16 @@ extern char *strmov(char *dst,const char *src);
extern char *strmov_overlapp(char *dst,const char *src);
#endif
extern char *strnmov(char *dst, const char *src, size_t n);
-extern char *strsuff(const char *src, const char *suffix);
extern char *strcont(const char *src, const char *set);
-extern char *strxcat(char *dst, const char *src, ...);
extern char *strxmov(char *dst, const char *src, ...);
-extern char *strxcpy(char *dst, const char *src, ...);
-extern char *strxncat(char *dst, size_t len, const char *src, ...);
extern char *strxnmov(char *dst, size_t len, const char *src, ...);
-extern char *strxncpy(char *dst, size_t len, const char *src, ...);
/* Prototypes of normal stringfunctions (with may ours) */
-
-#ifdef WANT_STRING_PROTOTYPES
-extern char *strcat(char *, const char *);
-extern char *strchr(const char *, pchar);
-extern char *strrchr(const char *, pchar);
-extern char *strcpy(char *, const char *);
-extern int strcmp(const char *, const char *);
-#ifndef __GNUC__
-extern size_t strlen(const char *);
-#endif
-#endif
#ifndef HAVE_STRNLEN
extern size_t strnlen(const char *s, size_t n);
#endif
#if !defined(__cplusplus)
-#ifndef HAVE_STRPBRK
-extern char *strpbrk(const char *, const char *);
-#endif
#ifndef HAVE_STRSTR
extern char *strstr(const char *, const char *);
#endif
diff --git a/include/my_atomic.h b/include/my_atomic.h
index 8ba3e201730..c2d514012d9 100644
--- a/include/my_atomic.h
+++ b/include/my_atomic.h
@@ -20,6 +20,7 @@
This header defines five atomic operations:
my_atomic_add#(&var, what)
+ 'Fetch and Add'
add 'what' to *var, and return the old value of *var
my_atomic_fas#(&var, what)
@@ -27,9 +28,10 @@
store 'what' in *var, and return the old value of *var
my_atomic_cas#(&var, &old, new)
- 'Compare And Swap'
+ An odd variation of 'Compare And Set/Swap'
if *var is equal to *old, then store 'new' in *var, and return TRUE
otherwise store *var in *old, and return FALSE
+ Usually, &old should not be accessed if the operation is successful.
my_atomic_load#(&var)
return *var
@@ -153,10 +155,8 @@ make_transparent_unions(ptr)
#define U_set set
#endif /* __GCC__ transparent_union magic */
-#ifdef HAVE_INLINE
-
#define make_atomic_cas(S) \
-STATIC_INLINE int my_atomic_cas ## S(Uv_ ## S U_a, \
+static inline int my_atomic_cas ## S(Uv_ ## S U_a, \
Uv_ ## S U_cmp, U_ ## S U_set) \
{ \
int8 ret; \
@@ -165,7 +165,7 @@ STATIC_INLINE int my_atomic_cas ## S(Uv_ ## S U_a, \
}
#define make_atomic_add(S) \
-STATIC_INLINE int ## S my_atomic_add ## S( \
+static inline int ## S my_atomic_add ## S( \
Uv_ ## S U_a, U_ ## S U_v) \
{ \
make_atomic_add_body(S); \
@@ -173,7 +173,7 @@ STATIC_INLINE int ## S my_atomic_add ## S( \
}
#define make_atomic_fas(S) \
-STATIC_INLINE int ## S my_atomic_fas ## S( \
+static inline int ## S my_atomic_fas ## S( \
Uv_ ## S U_a, U_ ## S U_v) \
{ \
make_atomic_fas_body(S); \
@@ -181,7 +181,7 @@ STATIC_INLINE int ## S my_atomic_fas ## S( \
}
#define make_atomic_load(S) \
-STATIC_INLINE int ## S my_atomic_load ## S(Uv_ ## S U_a) \
+static inline int ## S my_atomic_load ## S(Uv_ ## S U_a) \
{ \
int ## S ret; \
make_atomic_load_body(S); \
@@ -189,31 +189,12 @@ STATIC_INLINE int ## S my_atomic_load ## S(Uv_ ## S U_a) \
}
#define make_atomic_store(S) \
-STATIC_INLINE void my_atomic_store ## S( \
+static inline void my_atomic_store ## S( \
Uv_ ## S U_a, U_ ## S U_v) \
{ \
make_atomic_store_body(S); \
}
-#else /* no inline functions */
-
-#define make_atomic_add(S) \
-extern int ## S my_atomic_add ## S(Uv_ ## S U_a, U_ ## S U_v);
-
-#define make_atomic_fas(S) \
-extern int ## S my_atomic_fas ## S(Uv_ ## S U_a, U_ ## S U_v);
-
-#define make_atomic_cas(S) \
-extern int my_atomic_cas ## S(Uv_ ## S U_a, Uv_ ## S U_cmp, U_ ## S U_set);
-
-#define make_atomic_load(S) \
-extern int ## S my_atomic_load ## S(Uv_ ## S U_a);
-
-#define make_atomic_store(S) \
-extern void my_atomic_store ## S(Uv_ ## S U_a, U_ ## S U_v);
-
-#endif /* HAVE_INLINE */
-
#ifdef MY_ATOMIC_HAS_8_16
make_atomic_cas(8)
make_atomic_cas(16)
diff --git a/include/my_attribute.h b/include/my_attribute.h
index 8309d85f20a..d35b3013bdd 100644
--- a/include/my_attribute.h
+++ b/include/my_attribute.h
@@ -21,6 +21,12 @@
#ifndef _my_attribute_h
#define _my_attribute_h
+#if defined(__GNUC__)
+# ifndef GCC_VERSION
+# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+# endif
+#endif
+
/*
Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
Some forms of __attribute__ are actually supported in earlier versions of
diff --git a/include/my_bit.h b/include/my_bit.h
index 5cbf4f8b83e..b396b84b0d8 100644
--- a/include/my_bit.h
+++ b/include/my_bit.h
@@ -6,7 +6,6 @@
*/
C_MODE_START
-#ifdef HAVE_INLINE
extern const char _my_bits_nbits[256];
extern const uchar _my_bits_reverse_table[256];
@@ -16,14 +15,14 @@ extern const uchar _my_bits_reverse_table[256];
This can be used to divide a number with value by doing a shift instead
*/
-STATIC_INLINE uint my_bit_log2(ulong value)
+static inline uint my_bit_log2(ulong value)
{
uint bit;
for (bit=0 ; value > 1 ; value>>=1, bit++) ;
return bit;
}
-STATIC_INLINE uint my_count_bits(ulonglong v)
+static inline uint my_count_bits(ulonglong v)
{
#if SIZEOF_LONG_LONG > 4
/* The following code is a bit faster on 16 bit machines than if we would
@@ -45,7 +44,7 @@ STATIC_INLINE uint my_count_bits(ulonglong v)
#endif
}
-STATIC_INLINE uint my_count_bits_ushort(ushort v)
+static inline uint my_count_bits_ushort(ushort v)
{
return _my_bits_nbits[v];
}
@@ -70,7 +69,7 @@ STATIC_INLINE uint my_count_bits_ushort(ushort v)
Comments shows how this works with 01100000000000000000000000001011
*/
-STATIC_INLINE uint32 my_round_up_to_next_power(uint32 v)
+static inline uint32 my_round_up_to_next_power(uint32 v)
{
v--; /* 01100000000000000000000000001010 */
v|= v >> 1; /* 01110000000000000000000000001111 */
@@ -81,7 +80,7 @@ STATIC_INLINE uint32 my_round_up_to_next_power(uint32 v)
return v+1; /* 10000000000000000000000000000000 */
}
-STATIC_INLINE uint32 my_clear_highest_bit(uint32 v)
+static inline uint32 my_clear_highest_bit(uint32 v)
{
uint32 w=v >> 1;
w|= w >> 1;
@@ -92,7 +91,7 @@ STATIC_INLINE uint32 my_clear_highest_bit(uint32 v)
return v & w;
}
-STATIC_INLINE uint32 my_reverse_bits(uint32 key)
+static inline uint32 my_reverse_bits(uint32 key)
{
return
(_my_bits_reverse_table[ key & 255] << 24) |
@@ -101,14 +100,6 @@ STATIC_INLINE uint32 my_reverse_bits(uint32 key)
_my_bits_reverse_table[(key>>24) ];
}
-#else /* HAVE_INLINE */
-extern uint my_bit_log2(ulong value);
-extern uint32 my_round_up_to_next_power(uint32 v);
-uint32 my_clear_highest_bit(uint32 v);
-uint32 my_reverse_bits(uint32 key);
-extern uint my_count_bits(ulonglong v);
-extern uint my_count_bits_ushort(ushort v);
-#endif /* HAVE_INLINE */
C_MODE_END
#endif /* MY_BIT_INCLUDED */
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index 0caf2da12d0..548eec14d6e 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -69,28 +69,6 @@ extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2);
extern uint bitmap_lock_set_next(MY_BITMAP *map);
extern void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit);
-#ifdef NOT_USED
-extern uint bitmap_lock_bits_set(const MY_BITMAP *map);
-extern my_bool bitmap_lock_is_set_all(const MY_BITMAP *map);
-extern uint bitmap_lock_get_first(const MY_BITMAP *map);
-extern uint bitmap_lock_get_first_set(const MY_BITMAP *map);
-extern my_bool bitmap_lock_is_subset(const MY_BITMAP *map1,
- const MY_BITMAP *map2);
-extern my_bool bitmap_lock_is_prefix(const MY_BITMAP *map, uint prefix_size);
-extern my_bool bitmap_lock_is_set(const MY_BITMAP *map, uint bitmap_bit);
-extern my_bool bitmap_lock_is_clear_all(const MY_BITMAP *map);
-extern my_bool bitmap_lock_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2);
-extern void bitmap_lock_set_all(MY_BITMAP *map);
-extern void bitmap_lock_clear_all(MY_BITMAP *map);
-extern void bitmap_lock_set_bit(MY_BITMAP *map, uint bitmap_bit);
-extern void bitmap_lock_flip_bit(MY_BITMAP *map, uint bitmap_bit);
-extern void bitmap_lock_set_prefix(MY_BITMAP *map, uint prefix_size);
-extern void bitmap_lock_intersect(MY_BITMAP *map, const MY_BITMAP *map2);
-extern void bitmap_lock_subtract(MY_BITMAP *map, const MY_BITMAP *map2);
-extern void bitmap_lock_union(MY_BITMAP *map, const MY_BITMAP *map2);
-extern void bitmap_lock_xor(MY_BITMAP *map, const MY_BITMAP *map2);
-extern void bitmap_lock_invert(MY_BITMAP *map);
-#endif
/* Fast, not thread safe, bitmap functions */
#define bitmap_buffer_size(bits) (((bits)+31)/32)*4
#define no_bytes_in_map(map) (((map)->n_bits + 7)/8)
diff --git a/include/my_global.h b/include/my_global.h
index b0db017c565..1c615cc5ca2 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -86,24 +86,12 @@
#define IF_WIN(A,B) B
#endif
-#ifndef DBUG_OFF
-#define IF_DBUG(A,B) A
-#else
-#define IF_DBUG(A,B) B
-#endif
-
#ifdef HAVE_purify
#define IF_PURIFY(A,B) A
#else
#define IF_PURIFY(A,B) B
#endif
-#ifdef DISABLE_GRANT_OPTIONS
-#define IF_DISABLE_GRANT_OPTIONS(A,B) A
-#else
-#define IF_DISABLE_GRANT_OPTIONS(A,B) B
-#endif
-
#ifndef EMBEDDED_LIBRARY
#ifdef WITH_NDB_BINLOG
#define HAVE_NDB_BINLOG 1
@@ -210,110 +198,6 @@
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
-
-/*
- The macros below are useful in optimising places where it has been
- discovered that cache misses stall the process and where a prefetch
- of the cache line can improve matters. This is available in GCC 3.1.1
- and later versions.
- PREFETCH_READ says that addr is going to be used for reading and that
- it is to be kept in caches if possible for a while
- PREFETCH_WRITE also says that the item to be cached is likely to be
- updated.
- The *LOCALITY scripts are also available for experimentation purposes
- mostly and should only be used if they are verified to improve matters.
- For more input see GCC manual (available in GCC 3.1.1 and later)
-*/
-
-#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR > 10)
-#define PREFETCH_READ(addr) __builtin_prefetch(addr, 0, 3)
-#define PREFETCH_WRITE(addr) \
- __builtin_prefetch(addr, 1, 3)
-#define PREFETCH_READ_LOCALITY(addr, locality) \
- __builtin_prefetch(addr, 0, locality)
-#define PREFETCH_WRITE_LOCALITY(addr, locality) \
- __builtin_prefetch(addr, 1, locality)
-#else
-#define PREFETCH_READ(addr)
-#define PREFETCH_READ_LOCALITY(addr, locality)
-#define PREFETCH_WRITE(addr)
-#define PREFETCH_WRITE_LOCALITY(addr, locality)
-#endif
-
-/*
- The following macro is used to ensure that code often used in most
- SQL statements and definitely for parts of the SQL processing are
- kept in a code segment by itself. This has the advantage that the
- risk of common code being overlapping in caches of the CPU is less.
- This can be a cause of big performance problems.
- Routines should be put in this category with care and when they are
- put there one should also strive to make as much of the error handling
- as possible (or uncommon code of the routine) to execute in a
- separate method to avoid moving to much code to this code segment.
-
- It is very easy to use, simply add HOT_METHOD at the end of the
- function declaration.
- For more input see GCC manual (available in GCC 2.95 and later)
-*/
-
-#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR > 94)
-#define HOT_METHOD \
- __attribute__ ((section ("hot_code_section")))
-#else
-#define HOT_METHOD
-#endif
-
-/*
- The following macro is used to ensure that popular global variables
- are located next to each other to avoid that they contend for the
- same cache lines.
-
- It is very easy to use, simply add HOT_DATA at the end of the declaration
- of the variable, the variable must be initialised because of the way
- that linker works so a declaration using HOT_DATA should look like:
- uint global_hot_data HOT_DATA = 0;
- For more input see GCC manual (available in GCC 2.95 and later)
-*/
-
-#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR > 94)
-#define HOT_DATA \
- __attribute__ ((section ("hot_data_section")))
-#else
-#define HOT_DATA
-#endif
-
-/*
- now let's figure out if inline functions are supported
- autoconf defines 'inline' to be empty, if not
-*/
-#define inline_test_1(X) X ## 1
-#define inline_test_2(X) inline_test_1(X)
-#if inline_test_2(inline) != 1
-#define HAVE_INLINE
-#else
-#warning No "inline" support in C, all "static inline" functions will be instantiated in every .o file!!!
-#endif
-#undef inline_test_2
-#undef inline_test_1
-/* helper macro for "instantiating" inline functions */
-#define STATIC_INLINE static inline
-
-/*
- The following macros are used to control inlining a bit more than
- usual. These macros are used to ensure that inlining always or
- never occurs (independent of compilation mode).
- For more input see GCC manual (available in GCC 3.1.1 and later)
-*/
-
-#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR > 10)
-#define ALWAYS_INLINE __attribute__ ((always_inline))
-#define NEVER_INLINE __attribute__ ((noinline))
-#else
-#define ALWAYS_INLINE
-#define NEVER_INLINE
-#endif
-
-
/* Fix problem with S_ISLNK() on Linux */
#if defined(TARGET_OS_LINUX) || defined(__GLIBC__)
#undef _GNU_SOURCE
@@ -423,10 +307,6 @@ C_MODE_END
#undef HAVE_PREAD
#undef HAVE_PWRITE
#endif
-#if defined(HAVE_BROKEN_INLINE) && !defined(__cplusplus)
-#undef inline
-#define inline
-#endif
#ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */
#undef HAVE_GETHOSTBYNAME_R
@@ -441,18 +321,6 @@ C_MODE_END
#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile"
#endif
-
-/* Fix a bug in gcc 2.8.0 on IRIX 6.2 */
-#if SIZEOF_LONG == 4 && defined(__LONG_MAX__) && (__GNUC__ == 2 && __GNUC_MINOR__ == 8)
-#undef __LONG_MAX__ /* Is a longlong value in gcc 2.8.0 ??? */
-#define __LONG_MAX__ 2147483647
-#endif
-
-/* egcs 1.1.2 has a problem with memcpy on Alpha */
-#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
-#define BAD_MEMCPY
-#endif
-
#if defined(_lint) && !defined(lint)
#define lint
#endif
@@ -557,16 +425,6 @@ C_MODE_END
extern "C" int madvise(void *addr, size_t len, int behav);
#endif
-/* We can not live without the following defines */
-
-#define USE_MYFUNC 1 /* Must use syscall indirection */
-#define MASTER 1 /* Compile without unireg */
-#define ENGLISH 1 /* Messages in English */
-#define POSIX_MISTAKE 1 /* regexp: Fix stupid spec error */
-#define USE_REGEX 1 /* We want the use the regex library */
-/* Do not define for ultra sparcs */
-#define USE_BMOVE512 1 /* Use this unless system bmove is faster */
-
#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */
#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */
@@ -608,12 +466,6 @@ extern "C" int madvise(void *addr, size_t len, int behav);
#define UNINIT_VAR(x) x= x
#endif
-/* Define some useful general macros */
-#if !defined(max)
-#define max(a, b) ((a) > (b) ? (a) : (b))
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
#if !defined(HAVE_UINT)
#undef HAVE_UINT
#define HAVE_UINT
@@ -621,8 +473,6 @@ typedef unsigned int uint;
typedef unsigned short ushort;
#endif
-#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
-#define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
#define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; }
#define test(a) ((a) ? 1 : 0)
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
@@ -636,18 +486,6 @@ typedef unsigned short ushort;
#define FALSE (0) /* Logical false */
#endif
-#if defined(__GNUC__)
-#define function_volatile volatile
-#define my_reinterpret_cast(A) reinterpret_cast<A>
-#define my_const_cast(A) const_cast<A>
-# ifndef GCC_VERSION
-# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
-# endif
-#elif !defined(my_reinterpret_cast)
-#define my_reinterpret_cast(A) (A)
-#define my_const_cast(A) (A)
-#endif
-
#include <my_compiler.h>
/*
@@ -674,9 +512,6 @@ C_MODE_END
# endif
#endif
-#define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/
-#define ASCII_BITS_USED 8 /* Bit char used */
-
/* Some types that is different between systems */
typedef int File; /* File descriptor */
@@ -753,14 +588,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif /* __WIN__ */
-/* #define USE_RECORD_LOCK */
-
- /* Unsigned types supported by the compiler */
-#define UNSINT8 /* unsigned int8 (char) */
-#define UNSINT16 /* unsigned int16 */
-#define UNSINT32 /* unsigned int32 */
-
- /* General constants */
+/* General constants */
#define FN_LEN 256 /* Max file name len */
#define FN_HEADLEN 253 /* Max length of filepart of file name */
#define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */
@@ -821,10 +649,6 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define OS_FILE_LIMIT UINT_MAX
#endif
-/* #define EXT_IN_LIBNAME */
-/* #define FN_NO_CASE_SENSE */
-/* #define FN_UPPER_CASE TRUE */
-
/*
Io buffer size; Must be a power of 2 and a multiple of 512. May be
smaller what the disk page size. This influences the speed of the
@@ -849,7 +673,6 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* Some things that this system doesn't have */
-#define NO_HASH /* Not needed anymore */
#ifdef _WIN32
#define NO_DIR_LIBRARY /* Not standard dir-library */
#endif
@@ -896,7 +719,6 @@ inline unsigned long long my_double2ulonglong(double d)
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
#define ulong_to_double(X) ((double) (ulong) (X))
-#define SET_STACK_SIZE(X) /* Not needed on real machines */
#ifndef STACK_DIRECTION
#error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS"
@@ -915,7 +737,6 @@ inline unsigned long long my_double2ulonglong(double d)
/*
Some pre-ANSI-C99 systems like AIX 5.1 and Linux/GCC 2.95 define
ULONGLONG_MAX, LONGLONG_MIN, LONGLONG_MAX; we use them if they're defined.
- Also on Windows we define these constants by hand in config-win.h.
*/
#if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN)
@@ -1013,9 +834,6 @@ typedef long long my_ptrdiff_t;
#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
/* Size to make adressable obj. */
-#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t)))
- /* Offset of field f in structure t */
-#define OFFSET(t, f) ((size_t)(char *)&((t *)0)->f)
#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size)
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B))
@@ -1126,22 +944,6 @@ typedef long long intptr;
#define MY_ERRPTR ((void*)(intptr)1)
-#ifdef USE_RAID
-/*
- The following is done with a if to not get problems with pre-processors
- with late define evaluation
-*/
-#if SIZEOF_OFF_T == 4
-#define SYSTEM_SIZEOF_OFF_T 4
-#else
-#define SYSTEM_SIZEOF_OFF_T 8
-#endif
-#undef SIZEOF_OFF_T
-#define SIZEOF_OFF_T 8
-#else
-#define SYSTEM_SIZEOF_OFF_T SIZEOF_OFF_T
-#endif /* USE_RAID */
-
#if defined(_WIN32)
typedef unsigned long long my_off_t;
typedef unsigned long long os_off_t;
@@ -1182,14 +984,10 @@ typedef ulong nesting_map; /* Used for flags of nesting constructs */
#define SOCKET_EMFILE EMFILE
#endif
-typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */
-typedef short int15; /* Most effective integer 0 <= x <= 32767 */
typedef int myf; /* Type of MyFlags in my_funcs */
typedef char my_bool; /* Small bool */
- /* Macros for converting *constants* to the right type */
-#define INT8(v) (int8) (v)
-#define INT16(v) (int16) (v)
-#define INT32(v) (int32) (v)
+
+/* Macros for converting *constants* to the right type */
#define MYF(v) (myf) (v)
#ifndef LL
@@ -1233,23 +1031,9 @@ typedef char my_bool; /* Small bool */
#include <my_dbug.h>
-/*
- Sometimes we want to make sure that the variable is not put into
- a register in debugging mode so we can see its value in the core
-*/
-
-#ifndef DBUG_OFF
-#define dbug_volatile volatile
-#else
-#define dbug_volatile
-#endif
-
/* Some helper macros */
#define YESNO(X) ((X) ? "yes" : "no")
-/* Defines for time function */
-#define SCALE_SEC 100
-#define SCALE_USEC 10000
#define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */
#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */
@@ -1447,8 +1231,8 @@ do { doubleget_union _tmp; \
((uchar*) &def_temp)[7]=(M)[0];\
(V) = def_temp; } while(0)
#else
-#define float4get(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float))
-#define float4store(V,M) memcpy_fixed((uchar*) V,(uchar*) (&M),sizeof(float))
+#define float4get(V,M) memcpy(&V, (M), sizeof(float))
+#define float4store(V,M) memcpy(V, (&M), sizeof(float))
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\
@@ -1518,12 +1302,12 @@ do { doubleget_union _tmp; \
*(((char*)T)+1)=(((A) >> 16));\
*(((char*)T)+0)=(((A) >> 24)); } while(0)
-#define floatget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float))
-#define floatstore(T,V) memcpy_fixed((uchar*) (T),(uchar*)(&V),sizeof(float))
-#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
-#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
-#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong))
-#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong))
+#define floatget(V,M) memcpy(&V, (M), sizeof(float))
+#define floatstore(T,V) memcpy((T), (void*) (&V), sizeof(float))
+#define doubleget(V,M) memcpy(&V, (M), sizeof(double))
+#define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double))
+#define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong))
+#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong))
#else
@@ -1534,15 +1318,15 @@ do { doubleget_union _tmp; \
#define shortstore(T,V) int2store(T,V)
#define longstore(T,V) int4store(T,V)
#ifndef floatstore
-#define floatstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) (&V),sizeof(float))
-#define floatget(V,M) memcpy_fixed((uchar*) &V, (uchar*) (M), sizeof(float))
+#define floatstore(T,V) memcpy((T), (void *) (&V), sizeof(float))
+#define floatget(V,M) memcpy(&V, (M), sizeof(float))
#endif
#ifndef doubleget
-#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
-#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
+#define doubleget(V,M) memcpy(&V, (M), sizeof(double))
+#define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double))
#endif /* doubleget */
-#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong))
-#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong))
+#define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong))
+#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong))
#endif /* WORDS_BIGENDIAN */
@@ -1580,11 +1364,6 @@ do { doubleget_union _tmp; \
#endif
#endif
-/* FreeBSD 2.2.2 does not define RTLD_NOW) */
-#ifndef RTLD_NOW
-#define RTLD_NOW 1
-#endif
-
#ifndef HAVE_DLERROR
#define dlerror() ""
#endif
@@ -1700,8 +1479,6 @@ static inline double rint(double x)
#undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
-#define DONT_USE_RAID
-
#endif /* EMBEDDED_LIBRARY */
#endif /* my_global_h */
diff --git a/include/my_net.h b/include/my_net.h
index 1b8425984ae..5762f5da06e 100644
--- a/include/my_net.h
+++ b/include/my_net.h
@@ -14,9 +14,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
- thread safe version of some common functions:
- my_inet_ntoa
-
This file is also used to make handling of sockets and ioctl()
portable accross systems.
@@ -76,10 +73,6 @@ C_MODE_START
#define in_addr_t uint32
#endif
-/* Thread safe or portable version of some functions */
-
-void my_inet_ntoa(struct in_addr in, char *buf);
-
/*
Handling of gethostbyname_r()
*/
diff --git a/include/my_nosys.h b/include/my_nosys.h
index ecb60333830..96ba6d4c464 100644
--- a/include/my_nosys.h
+++ b/include/my_nosys.h
@@ -30,7 +30,7 @@ extern "C" {
#include <malloc.h>
#endif
-#undef my_read /* Can be predefined in raid.h */
+#undef my_read
#undef my_write
#undef my_seek
#define my_read(a,b,c,d) my_quick_read(a,b,c,d)
diff --git a/include/my_sys.h b/include/my_sys.h
index c5702ec7395..95689535be5 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -78,7 +78,7 @@ extern int my_errno; /* Last error in mysys */
#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
#define MY_SYNC_DIR 8192 /* my_create/delete/rename: sync directory */
-#define MY_RAID 64 /* Support for RAID */
+#define MY_UNUSED 64 /* Unused (was support for RAID) */
#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */
#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
@@ -101,10 +101,6 @@ extern int my_errno; /* Last error in mysys */
#define MY_GIVE_INFO 2 /* Give time info about process*/
#define MY_DONT_FREE_DBUG 4 /* Do not call DBUG_END() in my_end() */
-#define MY_REMOVE_NONE 0 /* Params for modify_defaults_file */
-#define MY_REMOVE_OPTION 1
-#define MY_REMOVE_SECTION 2
-
#define ME_HIGHBYTE 8 /* Shift for colours */
#define ME_NOCUR 1 /* Don't use curses message */
#define ME_OLDWIN 2 /* Use old window */
@@ -266,13 +262,6 @@ extern const char *my_defaults_file;
extern my_bool timed_mutexes;
-typedef struct wild_file_pack /* Struct to hold info when selecting files */
-{
- uint wilds; /* How many wildcards */
- uint not_pos; /* Start of not-theese-files */
- char * *wild; /* Pointer to wildcards */
-} WF_PACK;
-
enum loglevel {
ERROR_LEVEL,
WARNING_LEVEL,
@@ -568,7 +557,6 @@ typedef int (*Process_option_func)(void *ctx, const char *group_name,
/* Prototypes for mysys and my_func functions */
extern int my_copy(const char *from,const char *to,myf MyFlags);
-extern int my_append(const char *from,const char *to,myf MyFlags);
extern int my_delete(const char *name,myf MyFlags);
extern int my_getwd(char * buf,size_t size,myf MyFlags);
extern int my_setwd(const char *dir,myf MyFlags);
@@ -584,7 +572,6 @@ extern File my_register_filename(File fd, const char *FileName,
extern File my_create(const char *FileName,int CreateFlags,
int AccessFlags, myf MyFlags);
extern int my_close(File Filedes,myf MyFlags);
-extern File my_dup(File file, myf MyFlags);
extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
extern int my_readlink(char *to, const char *filename, myf MyFlags);
extern int my_is_symlink(const char *filename);
@@ -713,9 +700,6 @@ extern char * my_load_path(char * to, const char *path,
const char *own_path_prefix);
extern int wild_compare(const char *str,const char *wildstr,
pbool str_is_pattern);
-extern WF_PACK *wf_comp(char * str);
-extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
-extern void wf_end(struct wild_file_pack *buffer);
extern my_bool array_append_string_unique(const char *str,
const char **array, size_t size);
extern void get_date(char * to,int timeflag,time_t use_time);
@@ -729,8 +713,6 @@ extern int end_record_cache(RECORD_CACHE *info);
extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos,
const uchar *record,size_t length);
extern int flush_write_cache(RECORD_CACHE *info);
-extern long my_clock(void);
-extern sig_handler sigtstp_handler(int signal_number);
extern void handle_recived_signals(void);
extern sig_handler my_set_alarm_variable(int signo);
@@ -852,9 +834,6 @@ 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,
int *argc, char ***argv);
-extern int modify_defaults_file(const char *file_location, const char *option,
- const char *option_value,
- const char *section_name, int remove_option);
extern int my_search_option_files(const char *conf_file, int *argc,
char ***argv, uint *args_used,
Process_option_func func, void *func_ctx,
diff --git a/include/my_trie.h b/include/my_trie.h
deleted file mode 100644
index 72dd485af04..00000000000
--- a/include/my_trie.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/* Copyright (C) 2005 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 */
-
-#ifndef _trie_h
-#define _trie_h
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct st_trie_node
-{
- uint16 leaf; /* Depth from root node if match, 0 else */
- uchar c; /* Label on this edge */
- struct st_trie_node *next; /* Next label */
- struct st_trie_node *links; /* Array of edges leaving this node */
- struct st_trie_node *fail; /* AC failure function */
-} TRIE_NODE;
-
-typedef struct st_trie
-{
- TRIE_NODE root;
- MEM_ROOT mem_root;
- CHARSET_INFO *charset;
- uint32 nnodes;
- uint32 nwords;
-} TRIE;
-
-typedef struct st_ac_trie_state
-{
- TRIE *trie;
- TRIE_NODE *node;
-} AC_TRIE_STATE;
-
-extern TRIE *trie_init (TRIE *trie, CHARSET_INFO *charset);
-extern void trie_free (TRIE *trie);
-extern my_bool trie_insert (TRIE *trie, const uchar *key, uint keylen);
-extern my_bool ac_trie_prepare (TRIE *trie);
-extern void ac_trie_init (TRIE *trie, AC_TRIE_STATE *state);
-
-
-/* `trie_goto' is internal function and shouldn't be used. */
-
-static inline TRIE_NODE *trie_goto (TRIE_NODE *root, TRIE_NODE *node, uchar c)
-{
- TRIE_NODE *next;
- DBUG_ENTER("trie_goto");
- for (next= node->links; next; next= next->next)
- if (next->c == c)
- DBUG_RETURN(next);
- if (root == node)
- DBUG_RETURN(root);
- DBUG_RETURN(NULL);
-}
-
-
-/*
- SYNOPSIS
- int ac_trie_next (AC_TRIE_STATE *state, uchar *c);
- state - valid pointer to `AC_TRIE_STATE'
- c - character to lookup
-
- DESCRIPTION
- Implementation of search using Aho-Corasick automaton.
- Performs char-by-char search.
-
- RETURN VALUE
- `ac_trie_next' returns length of matched word or 0.
-*/
-
-static inline int ac_trie_next (AC_TRIE_STATE *state, uchar *c)
-{
- TRIE_NODE *root, *node;
- DBUG_ENTER("ac_trie_next");
- DBUG_ASSERT(state && c);
- root= &state->trie->root;
- node= state->node;
- while (! (state->node= trie_goto(root, node, *c)))
- node= node->fail;
- DBUG_RETURN(state->node->leaf);
-}
-
-
-/*
- SYNOPSIS
- my_bool trie_search (TRIE *trie, const uchar *key, uint keylen);
- trie - valid pointer to `TRIE'
- key - valid pointer to key to insert
- keylen - non-0 key length
-
- DESCRIPTION
- Performs key lookup in trie.
-
- RETURN VALUE
- `trie_search' returns `true' if key is in `trie'. Otherwise,
- `false' is returned.
-
- NOTES
- Consecutive search here is "best by test". arrays are very short, so
- binary search or hashing would add too much complexity that would
- overweight speed gain. Especially because compiler can optimize simple
- consecutive loop better (tested)
-*/
-
-static inline my_bool trie_search (TRIE *trie, const uchar *key, uint keylen)
-{
- TRIE_NODE *node;
- uint k;
- DBUG_ENTER("trie_search");
- DBUG_ASSERT(trie && key && keylen);
- node= &trie->root;
-
- for (k= 0; k < keylen; k++)
- {
- uchar p;
- if (! (node= node->links))
- DBUG_RETURN(FALSE);
- p= key[k];
- while (p != node->c)
- if (! (node= node->next))
- DBUG_RETURN(FALSE);
- }
-
- DBUG_RETURN(node->leaf > 0);
-}
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/include/my_vle.h b/include/my_vle.h
deleted file mode 100644
index c09f82229c4..00000000000
--- a/include/my_vle.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2005 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 */
-
-#ifndef VLE_H
-#define VLE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "my_global.h"
-
-/*
- The size (in bytes) required to store the object ITEM, which can be
- either an expression or a type (since sizeof() is used on the item).
-*/
-#define my_vle_sizeof(ITEM) (((sizeof(ITEM) * CHAR_BIT) + 6) / 7)
-
-uchar *my_vle_encode(uchar *vle, size_t max, ulong value);
-uchar const *my_vle_decode(ulong *value_ptr, uchar const *vle);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/include/myisam.h b/include/myisam.h
index 7547f6b475e..3efc65a900a 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -252,7 +252,7 @@ extern ulong myisam_block_size;
extern uint myisam_concurrent_insert;
extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user;
extern my_off_t myisam_max_temp_length;
-extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size;
+extern ulong myisam_data_pointer_size;
/* usually used to check if a symlink points into the mysql data home */
/* which is normally forbidden */
@@ -481,8 +481,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
const char * name, int rep_quick);
int change_to_newfile(const char * filename, const char * old_ext,
- const char * new_ext, uint raid_chunks,
- myf myflags);
+ const char * new_ext, myf myflags);
int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type,
const char *filetype, const char *filename);
void lock_memory(MI_CHECK *param);
diff --git a/include/mysql_embed.h b/include/mysql_embed.h
index b26b723381d..ae70b9723f8 100644
--- a/include/mysql_embed.h
+++ b/include/mysql_embed.h
@@ -28,7 +28,5 @@
#undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
-#define DONT_USE_RAID
-
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_EMBED_INCLUDED */
diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am
index 8aa1648c834..07f66c28ddb 100644
--- a/libmysql/Makefile.am
+++ b/libmysql/Makefile.am
@@ -21,8 +21,8 @@
# This file is public domain and comes with NO WARRANTY of any kind
target = libmysqlclient.la
-target_defs = -DMYSQL_CLIENT_NO_THREADS -DDONT_USE_RAID \
- -DDISABLE_MYSQL_THREAD_H @LIB_EXTRA_CCFLAGS@
+target_defs = -DMYSQL_CLIENT_NO_THREADS -DDISABLE_MYSQL_THREAD_H \
+ @LIB_EXTRA_CCFLAGS@
LIBS = @CLIENT_LIBS@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
@@ -33,7 +33,7 @@ include $(srcdir)/Makefile.shared
libmysqlclient_la_SOURCES = $(target_sources)
libmysqlclient_la_LIBADD = $(target_libadd) $(yassl_las)
libmysqlclient_la_LDFLAGS = $(target_ldflags)
-EXTRA_DIST = Makefile.shared libmysql.def dll.c CMakeLists.txt
+EXTRA_DIST = Makefile.shared libmysql.def CMakeLists.txt
noinst_HEADERS = client_settings.h
link_sources:
@@ -82,7 +82,7 @@ link_sources:
# keep only the stubs for debug.c
#
# A list of needed headers collected from the deps information 000213
-nh = my_global.h config-win32.h dbug.h errmsg.h \
+nh = my_global.h dbug.h errmsg.h \
m_ctype.h m_string.h password.h \
my_alarm.h my_config.h my_dir.h my_list.h my_net.h my_sys.h \
mysql.h mysql_com.h mysql_version.h mysqld_error.h \
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index 53264f2e559..887af62229a 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -37,7 +37,7 @@ target_sources = libmysql.c password.c \
mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
strmake.lo strend.lo \
strnlen.lo strfill.lo is_prefix.lo \
- int2str.lo str2int.lo strinstr.lo strcont.lo \
+ int2str.lo str2int.lo strcont.lo \
strcend.lo ctype-latin1.lo \
bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \
strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo \
@@ -61,9 +61,8 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo \
mf_format.lo mf_path.lo mf_unixpath.lo my_fopen.lo \
my_symlink.lo my_fstream.lo mf_arr_appstr.lo \
mf_loadpath.lo my_pthread.lo my_thr_init.lo \
- thr_mutex.lo mulalloc.lo string.lo \
- default.lo default_modify.lo \
- my_compress.lo array.lo my_once.lo list.lo my_net.lo \
+ thr_mutex.lo mulalloc.lo string.lo default.lo \
+ my_compress.lo array.lo my_once.lo list.lo \
charset.lo charset-def.lo hash.lo mf_iocache.lo \
mf_iocache2.lo my_seek.lo my_sleep.lo \
my_pread.lo mf_cache.lo md5.lo sha1.lo \
diff --git a/libmysql/dll.c b/libmysql/dll.c
deleted file mode 100644
index b5fcba13f91..00000000000
--- a/libmysql/dll.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Copyright (C) 2000-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.
-
- There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software. View the full text of the exception in file
- EXCEPTIONS-CLIENT in the directory of this software distribution.
-
- 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 */
-
-/*
-** Handling initialization of the dll library
-*/
-
-#include <my_global.h>
-#include <my_sys.h>
-#include <my_pthread.h>
-
-static my_bool libmysql_inited=0;
-
-void libmysql_init(void)
-{
- if (libmysql_inited)
- return;
- libmysql_inited=1;
- my_init();
- {
- DBUG_ENTER("libmysql_init");
-#ifdef LOG_ALL
- DBUG_PUSH("d:t:S:O,c::\\tmp\\libmysql.log");
-#else
- if (getenv("LIBMYSQL_LOG") != NULL)
- DBUG_PUSH(getenv("LIBMYSQL_LOG"));
-#endif
- DBUG_VOID_RETURN;
- }
-}
-
-#ifdef __WIN__
-
-static int inited=0,threads=0;
-HINSTANCE s_hModule; /* Saved module handle */
-DWORD main_thread;
-
-BOOL APIENTRY LibMain(HANDLE hInst,DWORD ul_reason_being_called,
- LPVOID lpReserved)
-{
- switch (ul_reason_being_called) {
- case DLL_PROCESS_ATTACH: /* case of libentry call in win 3.x */
- if (!inited++)
- {
- s_hModule=hInst;
- libmysql_init();
- main_thread=GetCurrentThreadId();
- }
- break;
- case DLL_THREAD_ATTACH:
- threads++;
- my_thread_init();
- break;
- case DLL_PROCESS_DETACH: /* case of wep call in win 3.x */
- if (!--inited) /* Safety */
- {
- /* my_thread_init() */ /* This may give extra safety */
- my_end(0);
- }
- break;
- case DLL_THREAD_DETACH:
- /* Main thread will free by my_end() */
- threads--;
- if (main_thread != GetCurrentThreadId())
- my_thread_end();
- break;
- default:
- break;
- } /* switch */
-
- return TRUE;
-
- UNREFERENCED_PARAMETER(lpReserved);
-} /* LibMain */
-
-
-static BOOL do_libmain;
-int __stdcall DllMain(HANDLE hInst,DWORD ul_reason_being_called,LPVOID lpReserved)
-{
- /*
- Unless environment variable LIBMYSQL_DLLINIT is set, do nothing.
- The environment variable is checked once, during the first call to DllMain()
- (in DLL_PROCESS_ATTACH hook).
- */
- if (ul_reason_being_called == DLL_PROCESS_ATTACH)
- do_libmain = (getenv("LIBMYSQL_DLLINIT") != NULL);
- if (do_libmain)
- return LibMain(hInst,ul_reason_being_called,lpReserved);
- return TRUE;
-}
-
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index d0ed44bd7aa..febbded6af2 100644
--- a/libmysql/errmsg.c
+++ b/libmysql/errmsg.c
@@ -24,139 +24,6 @@
#include <my_sys.h>
#include "errmsg.h"
-#ifdef GERMAN
-const char *client_errors[]=
-{
- "Unbekannter MySQL Fehler",
- "Kann UNIX-Socket nicht anlegen (%d)",
- "Keine Verbindung zu lokalem MySQL Server, socket: '%-.100s' (%d)",
- "Keine Verbindung zu MySQL Server auf %-.100s (%d)",
- "Kann TCP/IP-Socket nicht anlegen (%d)",
- "Unbekannter MySQL Server Host (%-.100s) (%d)",
- "MySQL Server nicht vorhanden",
- "Protokolle ungleich; Server Version = %d, Client Version = %d",
- "MySQL client ran out of memory",
- "Wrong host info",
- "Localhost via UNIX socket",
- "%-.100s via TCP/IP",
- "Error in server handshake",
- "Lost connection to MySQL server during query",
- "Commands out of sync; you can't run this command now",
- "Verbindung ueber Named Pipe: %-.32s",
- "Kann nicht auf Named Pipe warten. Host: %-.64s pipe: %-.32s (%lu)",
- "Kann Named Pipe nicht oeffnen. Host: %-.64s pipe: %-.32s (%lu)",
- "Kann den Status der Named Pipe nicht setzen. Host: %-.64s pipe: %-.32s (%lu)",
- "Can't initialize character set %-.32s (path: %-.100s)",
- "Got packet bigger than 'max_allowed_packet' bytes",
- "Embedded server",
- "Error on SHOW SLAVE STATUS:",
- "Error on SHOW SLAVE HOSTS:",
- "Error connecting to slave:",
- "Error connecting to master:",
- "SSL connection error",
- "Malformed packet",
- "This client library is licensed only for use with MySQL servers having '%s' license",
- "Invalid use of null pointer",
- "Statement not prepared",
- "No data supplied for parameters in prepared statement",
- "Data truncated",
- "No parameters exist in the statement",
- "Invalid parameter number",
- "Can't send long data for non-string/non-binary data types (parameter: %d)",
- "Using unsupported buffer type: %d (parameter: %d)",
- "Shared memory: %-.100s",
- "Can't open shared memory; client could not create request event (%lu)",
- "Can't open shared memory; no answer event received from server (%lu)",
- "Can't open shared memory; server could not allocate file mapping (%lu)",
- "Can't open shared memory; server could not get pointer to file mapping (%lu)",
- "Can't open shared memory; client could not allocate file mapping (%lu)",
- "Can't open shared memory; client could not get pointer to file mapping (%lu)",
- "Can't open shared memory; client could not create %s event (%lu)",
- "Can't open shared memory; no answer from server (%lu)",
- "Can't open shared memory; cannot send request event to server (%lu)",
- "Wrong or unknown protocol",
- "Invalid connection handle",
- "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
- "Row retrieval was canceled by mysql_stmt_close() call",
- "Attempt to read column without prior row fetch",
- "Prepared statement contains no metadata",
- "Attempt to read a row while there is no result set associated with the statement",
- "This feature is not implemented yet",
- "Lost connection to MySQL server at '%s', system error: %d",
- "Statement closed indirectly because of a preceeding %s() call",
- "The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
- "This handle is already connected. Use a separate handle for each connection."
- ""
-};
-
-/* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */
-
-#elif defined PORTUGUESE
-const char *client_errors[]=
-{
- "Erro desconhecido do MySQL",
- "Não pode criar 'UNIX socket' (%d)",
- "Não pode se conectar ao servidor MySQL local através do 'socket' '%-.100s' (%d)",
- "Não pode se conectar ao servidor MySQL em '%-.100s' (%d)",
- "Não pode criar 'socket TCP/IP' (%d)",
- "'Host' servidor MySQL '%-.100s' (%d) desconhecido",
- "Servidor MySQL desapareceu",
- "Incompatibilidade de protocolos; versão do servidor = %d, versão do cliente = %d",
- "Cliente do MySQL com falta de memória",
- "Informação inválida de 'host'",
- "Localhost via 'UNIX socket'",
- "%-.100s via 'TCP/IP'",
- "Erro na negociação de acesso ao servidor",
- "Conexão perdida com servidor MySQL durante 'query'",
- "Comandos fora de sincronismo; você não pode executar este comando agora",
- "Named pipe: %-.32s",
- "Não pode esperar pelo 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
- "Não pode abrir 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
- "Não pode estabelecer o estado do 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
- "Não pode inicializar conjunto de caracteres %-.32s (caminho %-.100s)",
- "Obteve pacote maior do que 'max_allowed_packet' bytes",
- "Embedded server"
- "Error on SHOW SLAVE STATUS:",
- "Error on SHOW SLAVE HOSTS:",
- "Error connecting to slave:",
- "Error connecting to master:",
- "SSL connection error",
- "Malformed packet",
- "This client library is licensed only for use with MySQL servers having '%s' license",
- "Invalid use of null pointer",
- "Statement not prepared",
- "No data supplied for parameters in prepared statement",
- "Data truncated",
- "No parameters exist in the statement",
- "Invalid parameter number",
- "Can't send long data for non-string/non-binary data types (parameter: %d)",
- "Using unsupported buffer type: %d (parameter: %d)",
- "Shared memory: %-.100s",
- "Can't open shared memory; client could not create request event (%lu)",
- "Can't open shared memory; no answer event received from server (%lu)",
- "Can't open shared memory; server could not allocate file mapping (%lu)",
- "Can't open shared memory; server could not get pointer to file mapping (%lu)",
- "Can't open shared memory; client could not allocate file mapping (%lu)",
- "Can't open shared memory; client could not get pointer to file mapping (%lu)",
- "Can't open shared memory; client could not create %s event (%lu)",
- "Can't open shared memory; no answer from server (%lu)",
- "Can't open shared memory; cannot send request event to server (%lu)",
- "Wrong or unknown protocol",
- "Invalid connection handle",
- "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
- "Row retrieval was canceled by mysql_stmt_close() call",
- "Attempt to read column without prior row fetch",
- "Prepared statement contains no metadata",
- "Attempt to read a row while there is no result set associated with the statement",
- "This feature is not implemented yet",
- "Lost connection to MySQL server at '%s', system error: %d",
- "Statement closed indirectly because of a preceeding %s() call",
- "The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
- "This handle is already connected. Use a separate handle for each connection."
- ""
-};
-
-#else /* ENGLISH */
const char *client_errors[]=
{
"Unknown MySQL error",
@@ -220,7 +87,6 @@ const char *client_errors[]=
"This handle is already connected. Use a separate handle for each connection."
""
};
-#endif
const char** get_client_errmsgs()
{
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 02ed93fa501..550b1b7b107 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -214,13 +214,6 @@ void STDCALL mysql_server_end()
}
mysql_client_init= org_my_init_done= 0;
-#ifdef EMBEDDED_SERVER
- if (stderror_file)
- {
- fclose(stderror_file);
- stderror_file= 0;
- }
-#endif
}
static MYSQL_PARAMETERS mysql_internal_parameters=
diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am
index dab45d93673..30aa2467dab 100644
--- a/libmysql_r/Makefile.am
+++ b/libmysql_r/Makefile.am
@@ -21,8 +21,7 @@
# This file is public domain and comes with NO WARRANTY of any kind
target = libmysqlclient_r.la
-target_defs = -DDISABLE_MYSQL_PRLOCK_H -DDONT_USE_RAID \
- -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
+target_defs = -DDISABLE_MYSQL_PRLOCK_H -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index 6f553ef9c11..a7efcb024ec 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -67,7 +67,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/sql_truncate.cc
../sql/sql_lex.cc ../sql/keycaches.cc
../sql/sql_list.cc ../sql/sql_load.cc ../sql/sql_locale.cc
- ../sql/sql_binlog.cc ../sql/sql_manager.cc ../sql/sql_map.cc
+ ../sql/sql_binlog.cc ../sql/sql_manager.cc
../sql/sql_parse.cc ../sql/sql_partition.cc ../sql/sql_plugin.cc
../sql/debug_sync.cc
../sql/sql_prepare.cc ../sql/sql_rename.cc ../sql/sql_repl.cc
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 9d8c5edaa12..1ffa349bcfe 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -66,7 +66,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
sql_profile.cc sql_truncate.cc datadict.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_lex.cc sql_list.cc sql_manager.cc sql_map.cc \
+ sql_lex.cc sql_list.cc sql_manager.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 sys_vars.cc \
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental
index 47167f0bf96..800044242ac 100644
--- a/mysql-test/collections/default.experimental
+++ b/mysql-test/collections/default.experimental
@@ -14,6 +14,7 @@ main.information_schema # Bug#47449 2009-09-19 alik main.inform
main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_multi_bug38691 times out sporadically on Solaris 10
main.log_tables # Bug#47924 2009-10-08 alik main.log_tables times out sporadically
+main.lowercase_table2 @darwin # Bug#55509 2010-07-26 alik main.lowercase_table2 fails on Mac OSX (again)
main.mysqlbinlog_row @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
main.mysqlbinlog_row_innodb @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
main.mysqlbinlog_row_myisam @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
@@ -25,7 +26,6 @@ main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases
main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris
parts.partition_alter4_innodb # Bug#45299 2010-06-28 alik Test "partition_alter4_innodb" is taking too long, timeout
-perfschema.pfs_upgrade # Bug#53102 2010-06-15 alik perfschema.pfs_upgrade fails on sol10 sparc64 max in parallel mode
rpl.rpl_heartbeat_basic # BUG#54820 2010-06-26 alik rpl.rpl_heartbeat_basic fails sporadically again
rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index cdf48376fb0..3416e368dff 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1812,3 +1812,32 @@ MAX(t2.a)
DROP TABLE t1, t2;
#
# End of 5.1 tests
+#
+# Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00
+#
+CREATE TABLE t1 (f1 int, f2 DATE);
+INSERT INTO t1 VALUES (1,'2004-04-19'), (1,'0000-00-00'), (1,'2004-04-18'),
+(2,'2004-05-19'), (2,'0001-01-01'), (3,'2004-04-10');
+SELECT MIN(f2),MAX(f2) FROM t1;
+MIN(f2) MAX(f2)
+0000-00-00 2004-05-19
+SELECT f1,MIN(f2),MAX(f2) FROM t1 GROUP BY 1;
+f1 MIN(f2) MAX(f2)
+1 0000-00-00 2004-04-19
+2 0001-01-01 2004-05-19
+3 2004-04-10 2004-04-10
+DROP TABLE t1;
+CREATE TABLE t1 ( f1 int, f2 time);
+INSERT INTO t1 VALUES (1,'01:27:35'), (1,'06:11:01'), (2,'19:53:05'),
+(2,'21:44:25'), (3,'10:55:12'), (3,'05:45:11'), (4,'00:25:00');
+SELECT MIN(f2),MAX(f2) FROM t1;
+MIN(f2) MAX(f2)
+00:25:00 21:44:25
+SELECT f1,MIN(f2),MAX(f2) FROM t1 GROUP BY 1;
+f1 MIN(f2) MAX(f2)
+1 01:27:35 06:11:01
+2 19:53:05 21:44:25
+3 05:45:11 10:55:12
+4 00:25:00 00:25:00
+DROP TABLE t1;
+#End of test#49771
diff --git a/mysql-test/r/raid.result b/mysql-test/r/raid.result
deleted file mode 100644
index 459da1cdf49..00000000000
--- a/mysql-test/r/raid.result
+++ /dev/null
@@ -1,208 +0,0 @@
-DROP TABLE IF EXISTS t1,t2;
-DROP DATABASE IF EXISTS test_$1;
-create database test_$1;
-create table test_$1.r1 (i int) raid_type=1;
-create table test_$1.r2 (i int) raid_type=1 raid_chunks=32;
-drop database test_$1;
-create database test_$1;
-create table test_$1.r2 (i int) raid_type=1 raid_chunks=257;
-show create table test_$1.r2;
-Table Create Table
-r2 CREATE TABLE `r2` (
- `i` int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 RAID_TYPE=striped RAID_CHUNKS=255 RAID_CHUNKSIZE=256
-drop database test_$1;
-CREATE TABLE t1 (
-id int unsigned not null auto_increment primary key,
-c char(255) not null
-) RAID_TYPE=STRIPED RAID_CHUNKS=2 RAID_CHUNKSIZE=123;
-INSERT INTO t1 VALUES
-(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
-(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
-(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
-(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
-(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
-(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
-(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
-(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
-(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
-(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
-(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
-(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
-(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
-(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
-(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
-INSERT INTO t1 VALUES
-(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
-(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
-(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
-(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
-(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
-(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
-(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
-(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
-(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
-(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
-(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
-(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
-(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
-(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
-(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
-INSERT INTO t1 VALUES
-(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
-(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
-(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
-(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
-(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
-(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
-(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
-(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
-(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
-(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
-(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
-(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
-(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
-(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
-(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
-INSERT INTO t1 VALUES
-(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
-(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
-(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
-(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
-(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
-(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
-(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
-(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
-(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
-(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
-(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
-(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
-(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
-(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
-(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
-INSERT INTO t1 VALUES
-(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
-(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
-(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
-(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
-(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
-(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
-(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
-(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
-(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
-(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
-(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
-(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
-(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
-(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
-(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
-select count(*) from t1;
-count(*)
-450
-ALTER TABLE t1 ADD COLUMN x INT UNSIGNED NOT NULL;
-ALTER TABLE t1 ADD KEY c (c);
-ALTER TABLE t1 DROP KEY c;
-ALTER TABLE t1 DROP COLUMN x;
-ALTER TABLE t1 RENAME t2;
-select count(*) from t2;
-count(*)
-450
-DROP TABLE t2;
-/* variable rows */
-CREATE TABLE t1 (
-id int unsigned not null auto_increment primary key,
-c varchar(255) not null
-) RAID_TYPE=STRIPED RAID_CHUNKS=5 RAID_CHUNKSIZE=121;
-INSERT INTO t1 VALUES
-(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
-(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
-(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
-(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
-(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
-(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
-(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
-(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
-(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
-(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
-(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
-(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
-(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
-(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
-(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
-INSERT INTO t1 VALUES
-(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
-(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
-(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
-(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
-(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
-(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
-(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
-(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
-(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
-(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
-(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
-(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
-(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
-(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
-(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
-INSERT INTO t1 VALUES
-(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
-(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
-(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
-(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
-(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
-(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
-(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
-(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
-(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
-(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
-(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
-(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
-(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
-(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
-(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
-INSERT INTO t1 VALUES
-(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
-(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
-(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
-(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
-(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
-(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
-(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
-(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
-(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
-(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
-(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
-(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
-(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
-(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
-(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
-INSERT INTO t1 VALUES
-(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
-(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
-(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
-(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
-(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
-(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
-(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
-(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
-(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
-(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
-(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
-(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
-(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
-(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
-(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
-select count(*) from t1;
-count(*)
-450
-ALTER TABLE t1 ADD COLUMN x INT UNSIGNED NOT NULL;
-ALTER TABLE t1 ADD KEY c (c);
-ALTER TABLE t1 DROP KEY c;
-ALTER TABLE t1 DROP COLUMN x;
-ALTER TABLE t1 RENAME t2;
-ALTER TABLE t2 CHANGE COLUMN c c VARCHAR(251) NOT NULL;
-select count(*) from t2;
-count(*)
-450
-DROP TABLE t2;
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index 6c3f54fca38..05ab1b71018 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -527,3 +527,17 @@ ERROR HY000: You are using safe update mode and you tried to update a table with
SET SESSION sql_safe_updates = DEFAULT;
DROP TABLE t1;
DROP VIEW v1;
+#
+# Bug#54734 assert in Diagnostics_area::set_ok_status
+#
+DROP TABLE IF EXISTS t1, not_exists;
+DROP FUNCTION IF EXISTS f1;
+DROP VIEW IF EXISTS v1;
+CREATE TABLE t1 (PRIMARY KEY(pk)) AS SELECT 1 AS pk;
+CREATE FUNCTION f1() RETURNS INTEGER RETURN (SELECT 1 FROM not_exists);
+CREATE VIEW v1 AS SELECT pk FROM t1 WHERE f1() = 13;
+UPDATE v1 SET pk = 7 WHERE pk > 0;
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+DROP VIEW v1;
+DROP FUNCTION f1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug54044.result b/mysql-test/suite/innodb/r/innodb_bug54044.result
new file mode 100644
index 00000000000..90ab812f2ae
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug54044.result
@@ -0,0 +1,3 @@
+CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB
+AS SELECT IF(NULL IS NOT NULL, NULL, NULL);
+ERROR HY000: Can't create table 'test.table_54044' (errno: -1)
diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result
index b418b62ec90..9a677f83080 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result
@@ -2538,6 +2538,14 @@ ORDER BY f1 DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range f2,f4 f4 1 NULL 11 Using where
DROP TABLE t1;
+#
+# Bug#54117 crash in thr_multi_unlock, temporary table
+#
+CREATE TEMPORARY TABLE t1(a INT) ENGINE = InnoDB;
+LOCK TABLES t1 READ;
+ALTER TABLE t1 COMMENT 'test';
+UNLOCK TABLES;
+DROP TABLE t1;
End of 5.1 tests
#
# Test for bug #39932 "create table fails if column for FK is in different
diff --git a/mysql-test/suite/innodb/t/innodb_bug54044.test b/mysql-test/suite/innodb/t/innodb_bug54044.test
new file mode 100644
index 00000000000..a6722ed6399
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug54044.test
@@ -0,0 +1,11 @@
+# This is the test for bug #54044. Special handle MYSQL_TYPE_NULL type
+# during create table, so it will not trigger assertion failure.
+
+--source include/have_innodb.inc
+
+# This 'create table' operation should fail because of
+# using NULL datatype
+--error ER_CANT_CREATE_TABLE
+CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB
+ AS SELECT IF(NULL IS NOT NULL, NULL, NULL);
+
diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test
index fcd54075ecc..495d5c014ce 100644
--- a/mysql-test/suite/innodb/t/innodb_mysql.test
+++ b/mysql-test/suite/innodb/t/innodb_mysql.test
@@ -737,6 +737,20 @@ ORDER BY f1 DESC LIMIT 5;
DROP TABLE t1;
+
+--echo #
+--echo # Bug#54117 crash in thr_multi_unlock, temporary table
+--echo #
+
+CREATE TEMPORARY TABLE t1(a INT) ENGINE = InnoDB;
+
+LOCK TABLES t1 READ;
+ALTER TABLE t1 COMMENT 'test';
+UNLOCK TABLES;
+
+DROP TABLE t1;
+
+
--echo End of 5.1 tests
diff --git a/mysql-test/suite/perfschema/include/upgrade_check.inc b/mysql-test/suite/perfschema/include/upgrade_check.inc
new file mode 100644
index 00000000000..935a71ab065
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/upgrade_check.inc
@@ -0,0 +1,29 @@
+# Copyright (C) 2010 Oracle and/or its affiliates. All rights reserved.
+#
+# 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
+
+# Routine to be called by pfs_upgrade.test
+# $out_file and $err_file must be set within pfs_upgrade.test.
+#
+
+--error 1
+--exec $MYSQL_UPGRADE --skip-verbose > $out_file 2> $err_file
+
+# Verify that mysql_upgrade complained about the performance_schema
+--cat_file $err_file
+--error 0,1
+--remove_file $out_file
+--error 0,1
+--remove_file $err_file
+
diff --git a/mysql-test/suite/perfschema/r/query_cache.result b/mysql-test/suite/perfschema/r/query_cache.result
index f2fe8c727b2..a0aeac5a916 100644
--- a/mysql-test/suite/perfschema/r/query_cache.result
+++ b/mysql-test/suite/perfschema/r/query_cache.result
@@ -65,3 +65,4 @@ Variable_name Value
Qcache_hits 1
SET GLOBAL query_cache_size= default;
drop table t1;
+flush status;
diff --git a/mysql-test/suite/perfschema/r/selects.result b/mysql-test/suite/perfschema/r/selects.result
index b5bef207303..9b91c6f0fc8 100644
--- a/mysql-test/suite/perfschema/r/selects.result
+++ b/mysql-test/suite/perfschema/r/selects.result
@@ -55,14 +55,21 @@ THREAD_ID EVENT_ID
[THREAD_ID] [EVENT_ID]
[THREAD_ID] [EVENT_ID]
[THREAD_ID] [EVENT_ID]
+DROP TABLE IF EXISTS t_event;
+DROP EVENT IF EXISTS t_ps_event;
+CREATE TABLE t_event AS
+SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+WHERE 1 = 2;
CREATE EVENT t_ps_event
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
-DO SELECT DISTINCT EVENT_ID
+DO INSERT INTO t_event
+SELECT DISTINCT EVENT_ID
FROM performance_schema.EVENTS_WAITS_CURRENT
JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
ORDER BY EVENT_ID
LIMIT 1;
ALTER TABLE t1 ADD COLUMN c INT;
+DROP TRIGGER IF EXISTS t_ps_trigger;
CREATE TRIGGER t_ps_trigger BEFORE INSERT ON t1
FOR EACH ROW BEGIN
SET NEW.c = (SELECT MAX(EVENT_ID)
@@ -76,6 +83,7 @@ id c
12 [EVENT_ID]
13 [EVENT_ID]
DROP TRIGGER t_ps_trigger;
+DROP PROCEDURE IF EXISTS t_ps_proc;
CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
BEGIN
SELECT id FROM performance_schema.PROCESSLIST
@@ -83,6 +91,7 @@ WHERE THREAD_ID = tid INTO pid;
END;
|
CALL t_ps_proc(0, @p_id);
+DROP FUNCTION IF EXISTS t_ps_proc;
CREATE FUNCTION t_ps_func(tid INT) RETURNS int
BEGIN
return (SELECT id FROM performance_schema.PROCESSLIST
@@ -92,6 +101,10 @@ END;
SELECT t_ps_func(0) = @p_id;
t_ps_func(0) = @p_id
1
+SELECT * FROM t_event;
+EVENT_ID
+[EVENT_ID]
DROP PROCEDURE t_ps_proc;
DROP FUNCTION t_ps_func;
DROP TABLE t1;
+DROP TABLE t_event;
diff --git a/mysql-test/suite/perfschema/r/server_init.result b/mysql-test/suite/perfschema/r/server_init.result
index a37a5805dd7..8c35425029e 100644
--- a/mysql-test/suite/perfschema/r/server_init.result
+++ b/mysql-test/suite/perfschema/r/server_init.result
@@ -48,10 +48,6 @@ where name like "wait/synch/mutex/sql/LOCK_thread_count";
count(name)
1
select count(name) from MUTEX_INSTANCES
-where name like "wait/synch/mutex/sql/LOCK_mapped_file";
-count(name)
-1
-select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_status";
count(name)
1
diff --git a/mysql-test/suite/perfschema/t/bad_option_1.test b/mysql-test/suite/perfschema/t/bad_option_1.test
index 9962f327093..ee4f0d0d160 100644
--- a/mysql-test/suite/perfschema/t/bad_option_1.test
+++ b/mysql-test/suite/perfschema/t/bad_option_1.test
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -10,8 +10,8 @@
# 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
# Tests for PERFORMANCE_SCHEMA
# Check error handling for invalid server start options
@@ -19,8 +19,11 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
+let $outfile= $MYSQLTEST_VARDIR/tmp/bad_option_1.txt;
+--error 0,1
+--remove_file $outfile
--error 7
---exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-enabled=maybe > $MYSQLTEST_VARDIR/tmp/bad_option_1.txt 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-enabled=maybe > $outfile 2>&1
perl;
use strict;
@@ -42,4 +45,5 @@ perl;
}
close FILE;
EOF
+--remove_file $outfile
diff --git a/mysql-test/suite/perfschema/t/bad_option_2.test b/mysql-test/suite/perfschema/t/bad_option_2.test
index a8d15764864..b8f45be3cdf 100644
--- a/mysql-test/suite/perfschema/t/bad_option_2.test
+++ b/mysql-test/suite/perfschema/t/bad_option_2.test
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -10,8 +10,8 @@
# 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
# Tests for PERFORMANCE_SCHEMA
# Check error handling for ambiguous server start options
@@ -19,8 +19,11 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
+let $outfile= $MYSQLTEST_VARDIR/tmp/bad_option_2.txt;
+--error 0,1
+--remove_file $outfile
--error 3
---exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-max_=12 > $MYSQLTEST_VARDIR/tmp/bad_option_2.txt 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-max_=12 > $outfile 2>&1
perl;
use strict;
@@ -41,4 +44,5 @@ perl;
}
close FILE;
EOF
+--remove_file $outfile
diff --git a/mysql-test/suite/perfschema/t/global_read_lock.test b/mysql-test/suite/perfschema/t/global_read_lock.test
index 16971023cbb..b953ea32ce0 100644
--- a/mysql-test/suite/perfschema/t/global_read_lock.test
+++ b/mysql-test/suite/perfschema/t/global_read_lock.test
@@ -81,6 +81,7 @@ update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
unlock tables;
disconnect con1;
+--source include/wait_until_disconnected.inc
--echo connection default;
connection default;
diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade.test b/mysql-test/suite/perfschema/t/pfs_upgrade.test
index 4902dc73e8a..b8d25d4a66e 100644
--- a/mysql-test/suite/perfschema/t/pfs_upgrade.test
+++ b/mysql-test/suite/perfschema/t/pfs_upgrade.test
@@ -22,6 +22,15 @@
--source include/have_perfschema.inc
--source include/have_lowercase0.inc
+# Some initial settings + Preemptive cleanup
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err;
+let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out;
+--error 0,1
+--remove_file $out_file
+--error 0,1
+--remove_file $err_file
+
--disable_warnings
drop table if exists test.user_table;
drop procedure if exists test.user_proc;
@@ -29,22 +38,20 @@ drop function if exists test.user_func;
drop event if exists test.user_event;
--enable_warnings
+
--echo "Testing mysql_upgrade with TABLE performance_schema.user_table"
create table test.user_table(a int);
-let $MYSQLD_DATADIR= `SELECT @@datadir`;
+--error 0,1
+--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
--copy_file $MYSQLD_DATADIR/test/user_table.frm $MYSQLD_DATADIR/performance_schema/user_table.frm
# Make sure the table is visible
use performance_schema;
show tables like "user_table";
---error 1
---exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
-
-# Verify that mysql_upgrade complained about the performance_schema
---cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
+--source suite/perfschema/include/upgrade_check.inc
# Make sure the table is still visible
show tables like "user_table";
@@ -54,22 +61,20 @@ use test;
--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
drop table test.user_table;
+
--echo "Testing mysql_upgrade with VIEW performance_schema.user_view"
create view test.user_view as select "Not supposed to be here";
-let $MYSQLD_DATADIR= `SELECT @@datadir`;
+--error 0,1
+--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
--copy_file $MYSQLD_DATADIR/test/user_view.frm $MYSQLD_DATADIR/performance_schema/user_view.frm
# Make sure the view is visible
use performance_schema;
show tables like "user_view";
---error 1
---exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
-
-# Verify that mysql_upgrade complained about the performance_schema
---cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
+--source suite/perfschema/include/upgrade_check.inc
# Make sure the view is still visible
show tables like "user_view";
@@ -79,6 +84,7 @@ use test;
--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
drop view test.user_view;
+
--echo "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
create procedure test.user_proc()
@@ -86,17 +92,14 @@ create procedure test.user_proc()
update mysql.proc set db='performance_schema' where name='user_proc';
---error 1
---exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
-
-# Verify that mysql_upgrade complained about the performance_schema
---cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
+--source suite/perfschema/include/upgrade_check.inc
select name from mysql.proc where db='performance_schema';
update mysql.proc set db='test' where name='user_proc';
drop procedure test.user_proc;
+
--echo "Testing mysql_upgrade with FUNCTION performance_schema.user_func"
create function test.user_func() returns integer
@@ -104,17 +107,14 @@ create function test.user_func() returns integer
update mysql.proc set db='performance_schema' where name='user_func';
---error 1
---exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
-
-# Verify that mysql_upgrade complained about the performance_schema
---cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
+--source suite/perfschema/include/upgrade_check.inc
select name from mysql.proc where db='performance_schema';
update mysql.proc set db='test' where name='user_func';
drop function test.user_func;
+
--echo "Testing mysql_upgrade with EVENT performance_schema.user_event"
create event test.user_event on schedule every 1 day do
@@ -122,17 +122,10 @@ create event test.user_event on schedule every 1 day do
update mysql.event set db='performance_schema' where name='user_event';
---error 1
---exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
-
-# Verify that mysql_upgrade complained about the performance_schema
---cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
+--source suite/perfschema/include/upgrade_check.inc
select name from mysql.event where db='performance_schema';
update mysql.event set db='test' where name='user_event';
drop event test.user_event;
---remove_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out
---remove_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
-
diff --git a/mysql-test/suite/perfschema/t/privilege.test b/mysql-test/suite/perfschema/t/privilege.test
index d2f3c2a9e6b..2d682de2870 100644
--- a/mysql-test/suite/perfschema/t/privilege.test
+++ b/mysql-test/suite/perfschema/t/privilege.test
@@ -350,9 +350,9 @@ TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
--echo # Clean up
-
---connection default
--disconnect pfs_user_4
+--source include/wait_until_disconnected.inc
+--connection default
REVOKE ALL PRIVILEGES, GRANT OPTION FROM pfs_user_4;
DROP USER pfs_user_4;
flush privileges;
diff --git a/mysql-test/suite/perfschema/t/query_cache.test b/mysql-test/suite/perfschema/t/query_cache.test
index 95f78d290ee..a48704dc9d6 100644
--- a/mysql-test/suite/perfschema/t/query_cache.test
+++ b/mysql-test/suite/perfschema/t/query_cache.test
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -10,8 +10,8 @@
# 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,
-# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for PERFORMANCE_SCHEMA
@@ -33,7 +33,6 @@ SET GLOBAL query_cache_size=1355776;
flush query cache;
reset query cache;
-# Reset Qcache_* to a known state
flush status;
select * from t1;
@@ -67,4 +66,5 @@ show status like "Qcache_hits";
SET GLOBAL query_cache_size= default;
drop table t1;
+flush status;
diff --git a/mysql-test/suite/perfschema/t/read_only.test b/mysql-test/suite/perfschema/t/read_only.test
index 62631fa048f..73150207f66 100644
--- a/mysql-test/suite/perfschema/t/read_only.test
+++ b/mysql-test/suite/perfschema/t/read_only.test
@@ -85,6 +85,7 @@ update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
--enable_result_log
disconnect con1;
+--source include/wait_until_disconnected.inc
--echo connection default;
connection default;
diff --git a/mysql-test/suite/perfschema/t/selects-master.opt b/mysql-test/suite/perfschema/t/selects-master.opt
new file mode 100644
index 00000000000..f93413a61e5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/selects-master.opt
@@ -0,0 +1 @@
+--event-scheduler
diff --git a/mysql-test/suite/perfschema/t/selects.test b/mysql-test/suite/perfschema/t/selects.test
index d5268e8465c..a0c000b80c1 100644
--- a/mysql-test/suite/perfschema/t/selects.test
+++ b/mysql-test/suite/perfschema/t/selects.test
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2009 Sun Microsystems, Inc
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -10,8 +10,8 @@
# 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
--source include/not_embedded.inc
--source include/have_perfschema.inc
@@ -85,20 +85,32 @@ LIMIT 5;
# EVENT
+# Check that the event_scheduler is really running
+--source include/running_event_scheduler.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t_event;
+DROP EVENT IF EXISTS t_ps_event;
+--enable_warnings
+CREATE TABLE t_event AS
+SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+WHERE 1 = 2;
CREATE EVENT t_ps_event
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
-DO SELECT DISTINCT EVENT_ID
+DO INSERT INTO t_event
+ SELECT DISTINCT EVENT_ID
FROM performance_schema.EVENTS_WAITS_CURRENT
JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
ORDER BY EVENT_ID
LIMIT 1;
---sleep 2
-
# TRIGGER
ALTER TABLE t1 ADD COLUMN c INT;
+--disable_warnings
+DROP TRIGGER IF EXISTS t_ps_trigger;
+--enable_warnings
delimiter |;
CREATE TRIGGER t_ps_trigger BEFORE INSERT ON t1
@@ -119,6 +131,9 @@ DROP TRIGGER t_ps_trigger;
# PROCEDURE
+--disable_warnings
+DROP PROCEDURE IF EXISTS t_ps_proc;
+--enable_warnings
delimiter |;
CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
@@ -135,6 +150,9 @@ CALL t_ps_proc(0, @p_id);
# FUNCTION
+--disable_warnings
+DROP FUNCTION IF EXISTS t_ps_proc;
+--enable_warnings
delimiter |;
CREATE FUNCTION t_ps_func(tid INT) RETURNS int
@@ -149,8 +167,17 @@ delimiter ;|
SELECT t_ps_func(0) = @p_id;
-DROP PROCEDURE t_ps_proc;
-DROP FUNCTION t_ps_func;
+# We might reach this point too early which means the event scheduler has not
+# execute our "t_ps_event". Therefore we poll till the record was inserted
+# and run our test statement afterwards.
+let $wait_timeout= 20;
+let $wait_condition= SELECT COUNT(*) = 1 FROM t_event;
+--source include/wait_condition.inc
+--replace_column 1 [EVENT_ID]
+SELECT * FROM t_event;
# Clean up
+DROP PROCEDURE t_ps_proc;
+DROP FUNCTION t_ps_func;
DROP TABLE t1;
+DROP TABLE t_event;
diff --git a/mysql-test/suite/perfschema/t/server_init.test b/mysql-test/suite/perfschema/t/server_init.test
index 0bb3dd84ac4..2e19d2c843a 100644
--- a/mysql-test/suite/perfschema/t/server_init.test
+++ b/mysql-test/suite/perfschema/t/server_init.test
@@ -75,9 +75,6 @@ select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_thread_count";
select count(name) from MUTEX_INSTANCES
- where name like "wait/synch/mutex/sql/LOCK_mapped_file";
-
-select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_status";
select count(name) from MUTEX_INSTANCES
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index f90c1dc3c58..f46a20b2db4 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1224,3 +1224,26 @@ DROP TABLE t1, t2;
--echo #
--echo # End of 5.1 tests
+
+--echo #
+--echo # Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00
+--echo #
+CREATE TABLE t1 (f1 int, f2 DATE);
+
+INSERT INTO t1 VALUES (1,'2004-04-19'), (1,'0000-00-00'), (1,'2004-04-18'),
+(2,'2004-05-19'), (2,'0001-01-01'), (3,'2004-04-10');
+
+SELECT MIN(f2),MAX(f2) FROM t1;
+SELECT f1,MIN(f2),MAX(f2) FROM t1 GROUP BY 1;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 ( f1 int, f2 time);
+INSERT INTO t1 VALUES (1,'01:27:35'), (1,'06:11:01'), (2,'19:53:05'),
+(2,'21:44:25'), (3,'10:55:12'), (3,'05:45:11'), (4,'00:25:00');
+
+SELECT MIN(f2),MAX(f2) FROM t1;
+SELECT f1,MIN(f2),MAX(f2) FROM t1 GROUP BY 1;
+
+DROP TABLE t1;
+--echo #End of test#49771
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 0323f015e88..fa9dc7472fe 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -173,7 +173,7 @@ type_long_blob longblob,
index(type_short)
) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1;
-# Not tested above: RAID_# UNION INSERT_METHOD DATA DIRECTORY INDEX DIRECTORY
+# Not tested above: UNION INSERT_METHOD DATA DIRECTORY INDEX DIRECTORY
show create table t1;
insert into t1 (type_timestamp) values ("2003-02-07 10:00:01");
select * from t1;
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index f6708828a6b..c515f8873d8 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -483,3 +483,23 @@ UPDATE IGNORE v1 SET a = 1;
SET SESSION sql_safe_updates = DEFAULT;
DROP TABLE t1;
DROP VIEW v1;
+
+--echo #
+--echo # Bug#54734 assert in Diagnostics_area::set_ok_status
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, not_exists;
+DROP FUNCTION IF EXISTS f1;
+DROP VIEW IF EXISTS v1;
+--enable_warnings
+
+CREATE TABLE t1 (PRIMARY KEY(pk)) AS SELECT 1 AS pk;
+CREATE FUNCTION f1() RETURNS INTEGER RETURN (SELECT 1 FROM not_exists);
+CREATE VIEW v1 AS SELECT pk FROM t1 WHERE f1() = 13;
+--error ER_VIEW_INVALID
+UPDATE v1 SET pk = 7 WHERE pk > 0;
+
+DROP VIEW v1;
+DROP FUNCTION f1;
+DROP TABLE t1;
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index 83615c82e2a..ae41151a981 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -17,23 +17,23 @@
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys)
-SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_modify.c
- errors.c hash.c list.c md5.c mf_brkhant.c mf_cache.c mf_dirname.c mf_fn_ext.c
+SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c
+ errors.c hash.c list.c md5.c mf_cache.c mf_dirname.c mf_fn_ext.c
mf_format.c mf_getdate.c mf_iocache.c mf_iocache2.c mf_keycache.c
mf_keycaches.c mf_loadpath.c mf_pack.c mf_path.c mf_qsort.c mf_qsort2.c
mf_radix.c mf_same.c mf_sort.c mf_soundex.c mf_arr_appstr.c mf_tempdir.c
- mf_tempfile.c mf_unixpath.c mf_wcomp.c mf_wfile.c mulalloc.c my_access.c
- my_aes.c my_alarm.c my_alloc.c my_append.c my_bit.c my_bitmap.c my_chsize.c
- my_clock.c my_compress.c my_copy.c my_crc32.c my_create.c my_delete.c
+ mf_tempfile.c mf_unixpath.c mf_wcomp.c mulalloc.c my_access.c
+ my_aes.c my_alloc.c my_bit.c my_bitmap.c my_chsize.c
+ my_compress.c my_copy.c my_create.c my_delete.c
my_div.c my_error.c my_file.c my_fopen.c my_fstream.c my_gethostbyname.c
my_gethwaddr.c my_getopt.c my_getsystime.c my_getwd.c my_handler.c my_init.c
- my_lib.c my_lock.c my_lockmem.c my_malloc.c my_mess.c
- my_mkdir.c my_mmap.c my_net.c my_once.c my_open.c my_pread.c my_pthread.c
+ my_lib.c my_lock.c my_malloc.c my_mess.c
+ my_mkdir.c my_mmap.c my_once.c my_open.c my_pread.c my_pthread.c
my_quick.c my_read.c my_redel.c my_rename.c my_seek.c my_sleep.c
my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c
my_write.c ptr_cmp.c queues.c stacktrace.c
rijndael.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c
- thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c
+ thr_rwlock.c tree.c typelib.c base64.c my_memmem.c my_getpagesize.c
lf_alloc-pin.c lf_dynarray.c lf_hash.c
my_atomic.c my_getncpus.c
my_rdtsc.c)
@@ -42,6 +42,10 @@ IF (WIN32)
SET (MYSYS_SOURCES ${MYSYS_SOURCES} my_winthread.c my_wincond.c my_winerr.c my_winfile.c my_windac.c my_conio.c)
ENDIF()
+IF(HAVE_ALARM)
+ SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_alarm.c)
+ENDIF()
+
IF(NOT HAVE_CXX_NEW)
# gcc as C++ compiler does not have new/delete
SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_new.cc)
@@ -58,10 +62,15 @@ IF(HAVE_LARGE_PAGES)
SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_largepage.c)
ENDIF()
+IF(HAVE_MLOCK)
+ SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_lockmem.c)
+ENDIF()
+
IF(UNIX)
# some workarounds
SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_port.c)
ENDIF()
+
ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES})
TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY}
${LIBNSL} ${LIBM} ${LIBRT})
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index a9e3f16c548..357fa321da6 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -24,31 +24,29 @@ LDADD = libmysys.a $(top_builddir)/strings/libmystrings.a $(top_builddir)/dbug
noinst_HEADERS = mysys_priv.h my_static.h my_handler_errors.h
libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
mf_path.c mf_loadpath.c my_file.c \
- my_open.c my_create.c my_dup.c my_seek.c my_read.c \
+ my_open.c my_create.c my_seek.c my_read.c \
my_pread.c my_write.c my_getpagesize.c \
mf_keycaches.c my_crc32.c \
mf_iocache.c mf_iocache2.c mf_cache.c mf_tempfile.c \
mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \
my_malloc.c my_once.c mulalloc.c \
- my_alloc.c my_new.cc my_vle.c my_atomic.c lf_hash.c \
+ my_alloc.c my_new.cc my_atomic.c lf_hash.c \
lf_dynarray.c lf_alloc-pin.c \
my_fopen.c my_fstream.c my_getsystime.c \
my_error.c errors.c my_div.c my_mess.c \
mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c \
my_symlink.c my_symlink2.c \
mf_pack.c mf_unixpath.c mf_arr_appstr.c \
- mf_wcomp.c mf_wfile.c my_gethwaddr.c \
+ mf_wcomp.c my_gethwaddr.c \
mf_qsort.c mf_qsort2.c mf_sort.c \
ptr_cmp.c mf_radix.c queues.c my_getncpus.c \
- tree.c trie.c list.c hash.c array.c string.c typelib.c \
- my_copy.c my_append.c my_lib.c \
+ tree.c list.c hash.c array.c string.c typelib.c \
+ my_copy.c my_lib.c \
my_delete.c my_rename.c my_redel.c \
- my_chsize.c my_clock.c \
- my_quick.c my_lockmem.c my_static.c \
+ my_chsize.c my_quick.c my_lockmem.c my_static.c \
my_sync.c my_getopt.c my_mkdir.c \
- default_modify.c default.c \
- my_compress.c checksum.c \
- my_net.c my_port.c my_sleep.c \
+ default.c my_compress.c checksum.c \
+ my_port.c my_sleep.c \
charset.c charset-def.c my_bitmap.c my_bit.c md5.c \
my_gethostbyname.c rijndael.c my_aes.c sha1.c \
my_handler.c my_largepage.c \
diff --git a/mysys/checksum.c b/mysys/checksum.c
index 1c7c9358d53..a96ea31ea0e 100644
--- a/mysys/checksum.c
+++ b/mysys/checksum.c
@@ -30,13 +30,6 @@
ha_checksum my_checksum(ha_checksum crc, const uchar *pos, size_t length)
{
-#ifdef NOT_USED
- const uchar *end=pos+length;
- for ( ; pos != end ; pos++)
- crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8));
- return crc;
-#else
return (ha_checksum)crc32((uint)crc, pos, (uint)length);
-#endif
}
diff --git a/mysys/default.c b/mysys/default.c
index 8002a1a0307..0e0883e1fcf 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -575,7 +575,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
void free_defaults(char **argv)
{
MEM_ROOT ptr;
- memcpy_fixed((char*) &ptr,(char *) argv - sizeof(ptr), sizeof(ptr));
+ memcpy(&ptr, ((char *) argv) - sizeof(ptr), sizeof(ptr));
free_root(&ptr,MYF(0));
}
diff --git a/mysys/default_modify.c b/mysys/default_modify.c
deleted file mode 100644
index edf4907cd4b..00000000000
--- a/mysys/default_modify.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/* Copyright (C) 2005 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 */
-
-#include "my_global.h"
-#include "mysys_priv.h"
-#include "m_string.h"
-#include <my_dir.h>
-
-#define BUFF_SIZE 1024
-#define RESERVE 1024 /* Extend buffer with this extent */
-
-#ifdef _WIN32
-#define NEWLINE "\r\n"
-#define NEWLINE_LEN 2
-#else
-#define NEWLINE "\n"
-#define NEWLINE_LEN 1
-#endif
-
-static char *add_option(char *dst, const char *option_value,
- const char *option, int remove_option);
-
-
-/*
- Add/remove option to the option file section.
-
- SYNOPSYS
- modify_defaults_file()
- file_location The location of configuration file to edit
- option The name of the option to look for (can be NULL)
- option value The value of the option we would like to set (can be NULL)
- section_name The name of the section (must be NOT NULL)
- remove_option This defines what we want to remove:
- - MY_REMOVE_NONE -- nothing to remove;
- - MY_REMOVE_OPTION -- remove the specified option;
- - MY_REMOVE_SECTION -- remove the specified section;
- IMPLEMENTATION
- We open the option file first, then read the file line-by-line,
- looking for the section we need. At the same time we put these lines
- into a buffer. Then we look for the option within this section and
- change/remove it. In the end we get a buffer with modified version of the
- file. Then we write it to the file, truncate it if needed and close it.
- Note that there is a small time gap, when the file is incomplete,
- and this theoretically might introduce a problem.
-
- RETURN
- 0 - ok
- 1 - some error has occured. Probably due to the lack of resourses
- 2 - cannot open the file
-*/
-
-int modify_defaults_file(const char *file_location, const char *option,
- const char *option_value,
- const char *section_name, int remove_option)
-{
- FILE *cnf_file;
- MY_STAT file_stat;
- char linebuff[BUFF_SIZE], *src_ptr, *dst_ptr, *file_buffer;
- size_t opt_len= 0, optval_len= 0, sect_len, new_opt_len, reserve_extended;
- uint nr_newlines= 0, buffer_size;
- my_bool in_section= FALSE, opt_applied= 0;
- int reserve_occupied= 0;
- DBUG_ENTER("modify_defaults_file");
-
- if (!(cnf_file= my_fopen(file_location, O_RDWR | O_BINARY, MYF(0))))
- DBUG_RETURN(2);
-
- /* my_fstat doesn't use the flag parameter */
- if (my_fstat(my_fileno(cnf_file), &file_stat, MYF(0)))
- goto malloc_err;
-
- if (option && option_value)
- {
- opt_len= strlen(option);
- optval_len= strlen(option_value);
- }
-
- new_opt_len= opt_len + 1 + optval_len + NEWLINE_LEN;
-
- /* calculate the size of the buffer we need */
- reserve_extended= (opt_len +
- 1 + /* For '=' char */
- optval_len + /* Option value len */
- NEWLINE_LEN + /* Space for newline */
- RESERVE); /* Some additional space */
-
- buffer_size= (file_stat.st_size +
- 1); /* The ending zero */
-
- /*
- Reserve space to read the contents of the file and some more
- for the option we want to add.
- */
- if (!(file_buffer= (char*) my_malloc(buffer_size + reserve_extended,
- MYF(MY_WME))))
- goto malloc_err;
-
- sect_len= strlen(section_name);
-
- for (dst_ptr= file_buffer; fgets(linebuff, BUFF_SIZE, cnf_file); )
- {
- /* Skip over whitespaces */
- for (src_ptr= linebuff; my_isspace(&my_charset_latin1, *src_ptr);
- src_ptr++)
- {}
-
- if (!*src_ptr) /* Empty line */
- {
- nr_newlines++;
- continue;
- }
-
- /* correct the option (if requested) */
- if (option && in_section && !strncmp(src_ptr, option, opt_len) &&
- (*(src_ptr + opt_len) == '=' ||
- my_isspace(&my_charset_latin1, *(src_ptr + opt_len)) ||
- *(src_ptr + opt_len) == '\0'))
- {
- char *old_src_ptr= src_ptr;
- src_ptr= strend(src_ptr+ opt_len); /* Find the end of the line */
-
- /* could be negative */
- reserve_occupied+= (int) new_opt_len - (int) (src_ptr - old_src_ptr);
- if (reserve_occupied >= (int) reserve_extended)
- {
- reserve_extended= (uint) reserve_occupied + RESERVE;
- if (!(file_buffer= (char*) my_realloc(file_buffer, buffer_size +
- reserve_extended,
- MYF(MY_WME|MY_FREE_ON_ERROR))))
- goto malloc_err;
- }
- opt_applied= 1;
- dst_ptr= add_option(dst_ptr, option_value, option, remove_option);
- }
- else
- {
- /*
- If we are going to the new group and have an option to apply, do
- it now. If we are removing a single option or the whole section
- this will only trigger opt_applied flag.
- */
-
- if (in_section && !opt_applied && *src_ptr == '[')
- {
- dst_ptr= add_option(dst_ptr, option_value, option, remove_option);
- opt_applied= 1; /* set the flag to do write() later */
- reserve_occupied= new_opt_len+ opt_len + 1 + NEWLINE_LEN;
- }
-
- for (; nr_newlines; nr_newlines--)
- dst_ptr= strmov(dst_ptr, NEWLINE);
-
- /* Skip the section if MY_REMOVE_SECTION was given */
- if (!in_section || remove_option != MY_REMOVE_SECTION)
- dst_ptr= strmov(dst_ptr, linebuff);
- }
- /* Look for a section */
- if (*src_ptr == '[')
- {
- /* Copy the line to the buffer */
- if (!strncmp(++src_ptr, section_name, sect_len))
- {
- src_ptr+= sect_len;
- /* Skip over whitespaces. They are allowed after section name */
- for (; my_isspace(&my_charset_latin1, *src_ptr); src_ptr++)
- {}
-
- if (*src_ptr != ']')
- {
- in_section= FALSE;
- continue; /* Missing closing parenthesis. Assume this was no group */
- }
-
- if (remove_option == MY_REMOVE_SECTION)
- dst_ptr= dst_ptr - strlen(linebuff);
-
- in_section= TRUE;
- }
- else
- in_section= FALSE; /* mark that this section is of no interest to us */
- }
- }
-
- /*
- File ended. Apply an option or set opt_applied flag (in case of
- MY_REMOVE_SECTION) so that the changes are saved. Do not do anything
- if we are removing non-existent option.
- */
-
- if (!opt_applied && in_section && (remove_option != MY_REMOVE_OPTION))
- {
- /* New option still remains to apply at the end */
- if (!remove_option && *(dst_ptr - 1) != '\n')
- dst_ptr= strmov(dst_ptr, NEWLINE);
- dst_ptr= add_option(dst_ptr, option_value, option, remove_option);
- opt_applied= 1;
- }
- for (; nr_newlines; nr_newlines--)
- dst_ptr= strmov(dst_ptr, NEWLINE);
-
- if (opt_applied)
- {
- /* Don't write the file if there are no changes to be made */
- if (my_chsize(my_fileno(cnf_file), (my_off_t) (dst_ptr - file_buffer), 0,
- MYF(MY_WME)) ||
- my_fseek(cnf_file, 0, MY_SEEK_SET, MYF(0)) ||
- my_fwrite(cnf_file, (uchar*) file_buffer, (size_t) (dst_ptr - file_buffer),
- MYF(MY_NABP)))
- goto err;
- }
- if (my_fclose(cnf_file, MYF(MY_WME)))
- DBUG_RETURN(1);
-
- my_free(file_buffer);
- DBUG_RETURN(0);
-
-err:
- my_free(file_buffer);
-malloc_err:
- my_fclose(cnf_file, MYF(0));
- DBUG_RETURN(1); /* out of resources */
-}
-
-
-static char *add_option(char *dst, const char *option_value,
- const char *option, int remove_option)
-{
- if (!remove_option)
- {
- dst= strmov(dst, option);
- if (*option_value)
- {
- *dst++= '=';
- dst= strmov(dst, option_value);
- }
- /* add a newline */
- dst= strmov(dst, NEWLINE);
- }
- return dst;
-}
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index c264d3ac4c5..4ed01ac8083 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -448,8 +448,6 @@ void lf_alloc_init(LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset)
allocator->top= 0;
allocator->mallocs= 0;
allocator->element_size= size;
- allocator->constructor= 0;
- allocator->destructor= 0;
DBUG_ASSERT(size >= sizeof(void*) + free_ptr_offset);
}
@@ -470,8 +468,6 @@ void lf_alloc_destroy(LF_ALLOCATOR *allocator)
while (node)
{
uchar *tmp= anext_node(node);
- if (allocator->destructor)
- allocator->destructor(node);
my_free(node);
node= tmp;
}
@@ -500,8 +496,6 @@ void *_lf_alloc_new(LF_PINS *pins)
if (!node)
{
node= (void *)my_malloc(allocator->element_size, MYF(MY_WME));
- if (allocator->constructor)
- allocator->constructor(node);
#ifdef MY_LF_EXTRA_DEBUG
if (likely(node != 0))
my_atomic_add32(&allocator->mallocs, 1);
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c
index 9c51ff1766e..e7bf82fc6ca 100644
--- a/mysys/lf_hash.c
+++ b/mysys/lf_hash.c
@@ -41,8 +41,6 @@ typedef struct {
*/
} LF_SLIST;
-const int LF_HASH_OVERHEAD= sizeof(LF_SLIST);
-
/*
a structure to pass the context (pointers two the three successive elements
in a list) from lfind to linsert/ldelete
diff --git a/mysys/make-conf.c b/mysys/make-conf.c
deleted file mode 100644
index 0dacde4dee0..00000000000
--- a/mysys/make-conf.c
+++ /dev/null
@@ -1,71 +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 */
-
-/* make-conf.c
- * make a charset .conf file out of a ctype-charset.c file.
- */
-
-#ifndef CHARSET
-#error You must define the charset, e.g.: -DCHARSET=latin1
-#endif
-
-/* some pre-processor tricks to get us going */
-#define _STRINGIZE_HELPER(x) #x
-#define STRINGIZE(x) _STRINGIZE_HELPER(x)
-
-#define _JOIN_WORDS_HELPER(a, b) a ## b
-#define JOIN_WORDS(a, b) _JOIN_WORDS_HELPER(a, b)
-
-#define CH_SRC ctype- ## CHARSET ## .c
-#define CH_INCLUDE STRINGIZE(CH_SRC)
-
-/* aaaah, that's better */
-#include <my_my_global.h>
-#include CH_INCLUDE
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#define ROW_LEN 16
-
-void print_array(const char *name, const uchar *array, uint size);
-
-int main(void)
-{
- printf("# Configuration file for the "
- STRINGIZE(CHARSET)
- " character set.\n");
-
- print_array("ctype", JOIN_WORDS(ctype_, CHARSET), 257);
- print_array("to_lower", JOIN_WORDS(to_lower_, CHARSET), 256);
- print_array("to_upper", JOIN_WORDS(to_upper_, CHARSET), 256);
- print_array("sort_order", JOIN_WORDS(sort_order_, CHARSET), 256);
-
- exit(EXIT_SUCCESS);
-}
-
-void print_array(const char *name, const uchar *array, uint size)
-{
- uint i;
-
- printf("\n# The %s array must have %d elements.\n", name, size);
-
- for (i = 0; i < size; ++i) {
- printf(" %02X", array[i]);
-
- if ((i+1) % ROW_LEN == size % ROW_LEN)
- printf("\n");
- }
-}
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index 4902a5a8bce..490d70492a1 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -47,7 +47,6 @@ TODO:
write buffer to the read buffer before we start to reuse it.
*/
-#define MAP_TO_USE_RAID
#include "mysys_priv.h"
#include <m_string.h>
#ifdef HAVE_AIOWAIT
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 5e34bff2b51..7a40ea8a86f 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -17,7 +17,6 @@
More functions to be used with IO_CACHE files
*/
-#define MAP_TO_USE_RAID
#include "mysys_priv.h"
#include <m_string.h>
#include <stdarg.h>
@@ -71,6 +70,16 @@ my_b_copy_to_file(IO_CACHE *cache, FILE *file)
my_off_t my_b_append_tell(IO_CACHE* info)
{
/*
+ Sometimes we want to make sure that the variable is not put into
+ a register in debugging mode so we can see its value in the core
+ */
+#ifndef DBUG_OFF
+# define dbug_volatile volatile
+#else
+# define dbug_volatile
+#endif
+
+ /*
Prevent optimizer from putting res in a register when debugging
we need this to be able to see the value of res when the assert fails
*/
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index c42c3d469e6..fc62d3d8a8e 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -2683,10 +2683,7 @@ uchar *key_cache_read(KEY_CACHE *keycache,
#endif
/* Copy data from the cache buffer */
- if (!(read_length & 511))
- bmove512(buff, block->buffer+offset, read_length);
- else
- memcpy(buff, block->buffer+offset, (size_t) read_length);
+ memcpy(buff, block->buffer+offset, (size_t) read_length);
#if !defined(SERIALIZED_READ_FROM_CACHE)
keycache_pthread_mutex_lock(&keycache->cache_lock);
@@ -2920,10 +2917,7 @@ int key_cache_insert(KEY_CACHE *keycache,
#endif
/* Copy data from buff */
- if (!(read_length & 511))
- bmove512(block->buffer+offset, buff, read_length);
- else
- memcpy(block->buffer+offset, buff, (size_t) read_length);
+ memcpy(block->buffer+offset, buff, (size_t) read_length);
#if !defined(SERIALIZED_READ_FROM_CACHE)
keycache_pthread_mutex_lock(&keycache->cache_lock);
@@ -3246,10 +3240,7 @@ int key_cache_write(KEY_CACHE *keycache,
#if !defined(SERIALIZED_READ_FROM_CACHE)
keycache_pthread_mutex_unlock(&keycache->cache_lock);
#endif
- if (!(read_length & 511))
- bmove512(block->buffer+offset, buff, read_length);
- else
- memcpy(block->buffer+offset, buff, (size_t) read_length);
+ memcpy(block->buffer+offset, buff, (size_t) read_length);
#if !defined(SERIALIZED_READ_FROM_CACHE)
keycache_pthread_mutex_lock(&keycache->cache_lock);
diff --git a/mysys/mf_wfile.c b/mysys/mf_wfile.c
deleted file mode 100644
index 95c4c006b2c..00000000000
--- a/mysys/mf_wfile.c
+++ /dev/null
@@ -1,123 +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 */
-
-/* Functions for finding files with wildcards */
-
-/*
- The following file-name-test is supported:
- - "name [[,] name...] ; Matches any of used filenames.
- Each name can have "*" and/or "?"
- wild-cards.
- - [wildspec [,]] !wildspec2 ; File that matches wildspec and not
- wildspec2.
-*/
-
-#include "mysys_priv.h"
-#include <m_string.h>
-
- /* Store wildcard-string in a easyer format */
-
-WF_PACK *wf_comp(char * str)
-{
- uint ant;
- int not_pos;
- register char * pos;
- char * buffer;
- WF_PACK *ret;
- DBUG_ENTER("wf_comp");
-
- not_pos= -1; /* Skip space and '!' in front */
- while (*str == ' ')
- str++;
- if (*str == '!')
- {
- not_pos=0;
- while (*++str == ' ') {};
- }
- if (*str == 0) /* Empty == everything */
- DBUG_RETURN((WF_PACK *) NULL);
-
- ant=1; /* Count filespecs */
- for (pos=str ; *pos ; pos++)
- ant+= test(*pos == ' ' || *pos == ',');
-
- if ((ret= (WF_PACK*) my_malloc((uint) ant*(sizeof(char **)+2)+
- sizeof(WF_PACK)+ (uint) strlen(str)+1,
- MYF(MY_WME)))
- == 0)
- DBUG_RETURN((WF_PACK *) NULL);
- ret->wild= (char **) (ret+1);
- buffer= (char *) (ret->wild+ant);
-
- ant=0;
- for (pos=str ; *pos ; str= pos)
- {
- ret->wild[ant++]=buffer;
- while (*pos != ' ' && *pos != ',' && *pos != '!' && *pos)
- *buffer++ = *pos++;
-
- *buffer++ = '\0';
- while (*pos == ' ' || *pos == ',' || *pos == '!' )
- if (*pos++ == '!' && not_pos <0)
- not_pos=(int) ant;
- }
-
- ret->wilds=ant;
- if (not_pos <0)
- ret->not_pos=ant;
- else
- ret->not_pos=(uint) not_pos;
-
- DBUG_PRINT("exit",("antal: %d not_pos: %d",ret->wilds,ret->not_pos));
- DBUG_RETURN(ret);
-} /* wf_comp */
-
-
- /* Test if a given filename is matched */
-
-int wf_test(register WF_PACK *wf_pack, register const char *name)
-{
- reg2 uint i;
- reg3 uint not_pos;
- DBUG_ENTER("wf_test");
-
- if (! wf_pack || wf_pack->wilds == 0)
- DBUG_RETURN(0); /* Everything goes */
-
- not_pos=wf_pack->not_pos;
- for (i=0 ; i < not_pos; i++)
- if (wild_compare(name,wf_pack->wild[i],0) == 0)
- goto found;
- if (i)
- DBUG_RETURN(1); /* No-match */
-
-found:
-/* Test that it isn't in not-list */
-
- for (i=not_pos ; i < wf_pack->wilds; i++)
- if (wild_compare(name,wf_pack->wild[i],0) == 0)
- DBUG_RETURN(1);
- DBUG_RETURN(0);
-} /* wf_test */
-
-
- /* We need this because program don't know with malloc we used */
-
-void wf_end(WF_PACK *buffer)
-{
- DBUG_ENTER("wf_end");
- my_free(buffer);
- DBUG_VOID_RETURN;
-} /* wf_end */
diff --git a/mysys/my_append.c b/mysys/my_append.c
deleted file mode 100644
index 1ef3905b6f5..00000000000
--- a/mysys/my_append.c
+++ /dev/null
@@ -1,64 +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 */
-
-#include "mysys_priv.h"
-#include <sys/stat.h>
-#include <m_string.h>
-#if defined(HAVE_UTIME_H)
-#include <utime.h>
-#elif defined(HAVE_SYS_UTIME_H)
-#include <sys/utime.h>
-#elif !defined(HPUX10)
-struct utimbuf {
- time_t actime;
- time_t modtime;
-};
-#endif
-
-/*
- Append a file to another
-
- NOTES
- Don't set MY_FNABP or MY_NABP bits on when calling this function
-*/
-
-int my_append(const char *from, const char *to, myf MyFlags)
-{
- size_t Count;
- File from_file,to_file;
- uchar buff[IO_SIZE];
- DBUG_ENTER("my_append");
- DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
-
- from_file= to_file= -1;
-
- if ((from_file=my_open(from,O_RDONLY,MyFlags)) >= 0)
- {
- if ((to_file=my_open(to,O_APPEND | O_WRONLY,MyFlags)) >= 0)
- {
- while ((Count=my_read(from_file,buff,IO_SIZE,MyFlags)) != 0)
- if (Count == (uint) -1 ||
- my_write(to_file,buff,Count,MYF(MyFlags | MY_NABP)))
- goto err;
- if (my_close(from_file,MyFlags) | my_close(to_file,MyFlags))
- DBUG_RETURN(-1); /* Error on close */
- DBUG_RETURN(0);
- }
- }
-err:
- if (from_file >= 0) (void) my_close(from_file,MyFlags);
- if (to_file >= 0) (void) my_close(to_file,MyFlags);
- DBUG_RETURN(-1);
-}
diff --git a/mysys/my_atomic.c b/mysys/my_atomic.c
index 6bc76f0de3c..7cbe15cfb74 100644
--- a/mysys/my_atomic.c
+++ b/mysys/my_atomic.c
@@ -16,13 +16,6 @@
#include <my_global.h>
#include <my_sys.h>
-#ifndef HAVE_INLINE
-/* the following will cause all inline functions to be instantiated */
-#define HAVE_INLINE
-#undef STATIC_INLINE
-#define STATIC_INLINE extern
-#endif
-
#include <my_atomic.h>
/*
diff --git a/mysys/my_bit.c b/mysys/my_bit.c
index 2881eb1ebd2..f072f243765 100644
--- a/mysys/my_bit.c
+++ b/mysys/my_bit.c
@@ -15,13 +15,6 @@
#include <my_global.h>
-#ifndef HAVE_INLINE
-/* the following will cause all inline functions to be instantiated */
-#define HAVE_INLINE
-#undef STATIC_INLINE
-#define STATIC_INLINE extern
-#endif
-
#include <my_bit.h>
const char _my_bits_nbits[256] = {
diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c
index 3de05fa8664..3401c7301e9 100644
--- a/mysys/my_bitmap.c
+++ b/mysys/my_bitmap.c
@@ -566,192 +566,6 @@ void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit)
bitmap_unlock(map);
}
-
-#ifdef NOT_USED
-my_bool bitmap_lock_is_prefix(const MY_BITMAP *map, uint prefix_size)
-{
- my_bool res;
- bitmap_lock((MY_BITMAP *)map);
- res= bitmap_is_prefix(map, prefix_size);
- bitmap_unlock((MY_BITMAP *)map);
- return res;
-}
-
-
-void bitmap_lock_set_all(MY_BITMAP *map)
-{
- bitmap_lock(map);
- bitmap_set_all(map);
- bitmap_unlock(map);
-}
-
-
-void bitmap_lock_clear_all(MY_BITMAP *map)
-{
- bitmap_lock(map);
- bitmap_clear_all(map);
- bitmap_unlock(map);
-}
-
-
-void bitmap_lock_set_prefix(MY_BITMAP *map, uint prefix_size)
-{
- bitmap_lock(map);
- bitmap_set_prefix(map, prefix_size);
- bitmap_unlock(map);
-}
-
-
-my_bool bitmap_lock_is_clear_all(const MY_BITMAP *map)
-{
- uint res;
- bitmap_lock((MY_BITMAP *)map);
- res= bitmap_is_clear_all(map);
- bitmap_unlock((MY_BITMAP *)map);
- return res;
-}
-
-
-my_bool bitmap_lock_is_set_all(const MY_BITMAP *map)
-{
- uint res;
- bitmap_lock((MY_BITMAP *)map);
- res= bitmap_is_set_all(map);
- bitmap_unlock((MY_BITMAP *)map);
- return res;
-}
-
-
-my_bool bitmap_lock_is_set(const MY_BITMAP *map, uint bitmap_bit)
-{
- my_bool res;
- DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
- bitmap_lock((MY_BITMAP *)map);
- res= bitmap_is_set(map, bitmap_bit);
- bitmap_unlock((MY_BITMAP *)map);
- return res;
-}
-
-
-my_bool bitmap_lock_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2)
-{
- uint res;
- bitmap_lock((MY_BITMAP *)map1);
- bitmap_lock((MY_BITMAP *)map2);
- res= bitmap_is_subset(map1, map2);
- bitmap_unlock((MY_BITMAP *)map2);
- bitmap_unlock((MY_BITMAP *)map1);
- return res;
-}
-
-
-my_bool bitmap_lock_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
-{
- uint res;
-
- DBUG_ASSERT(map1->bitmap && map2->bitmap &&
- map1->n_bits==map2->n_bits);
- bitmap_lock((MY_BITMAP *)map1);
- bitmap_lock((MY_BITMAP *)map2);
- res= bitmap_cmp(map1, map2);
- bitmap_unlock((MY_BITMAP *)map2);
- bitmap_unlock((MY_BITMAP *)map1);
- return res;
-}
-
-
-void bitmap_lock_intersect(MY_BITMAP *map, const MY_BITMAP *map2)
-{
- bitmap_lock(map);
- bitmap_lock((MY_BITMAP *)map2);
- bitmap_intersect(map, map2);
- bitmap_unlock((MY_BITMAP *)map2);
- bitmap_unlock(map);
-}
-
-
-void bitmap_lock_subtract(MY_BITMAP *map, const MY_BITMAP *map2)
-{
- bitmap_lock(map);
- bitmap_lock((MY_BITMAP *)map2);
- bitmap_subtract(map, map2);
- bitmap_unlock((MY_BITMAP *)map2);
- bitmap_unlock(map);
-}
-
-
-void bitmap_lock_union(MY_BITMAP *map, const MY_BITMAP *map2)
-{
- bitmap_lock(map);
- bitmap_lock((MY_BITMAP *)map2);
- bitmap_union(map, map2);
- bitmap_unlock((MY_BITMAP *)map2);
- bitmap_unlock(map);
-}
-
-
-/*
- SYNOPSIS
- bitmap_bits_set()
- map
- RETURN
- Number of set bits in the bitmap.
-*/
-uint bitmap_lock_bits_set(const MY_BITMAP *map)
-{
- uint res;
- bitmap_lock((MY_BITMAP *)map);
- DBUG_ASSERT(map->bitmap);
- res= bitmap_bits_set(map);
- bitmap_unlock((MY_BITMAP *)map);
- return res;
-}
-
-
-/*
- SYNOPSIS
- bitmap_get_first()
- map
- RETURN
- Number of first unset bit in the bitmap or MY_BIT_NONE if all bits are set.
-*/
-uint bitmap_lock_get_first(const MY_BITMAP *map)
-{
- uint res;
- bitmap_lock((MY_BITMAP*)map);
- res= bitmap_get_first(map);
- bitmap_unlock((MY_BITMAP*)map);
- return res;
-}
-
-
-uint bitmap_lock_get_first_set(const MY_BITMAP *map)
-{
- uint res;
- bitmap_lock((MY_BITMAP*)map);
- res= bitmap_get_first_set(map);
- bitmap_unlock((MY_BITMAP*)map);
- return res;
-}
-
-
-void bitmap_lock_set_bit(MY_BITMAP *map, uint bitmap_bit)
-{
- DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
- bitmap_lock(map);
- bitmap_set_bit(map, bitmap_bit);
- bitmap_unlock(map);
-}
-
-
-void bitmap_lock_flip_bit(MY_BITMAP *map, uint bitmap_bit)
-{
- DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
- bitmap_lock(map);
- bitmap_flip_bit(map, bitmap_bit);
- bitmap_unlock(map);
-}
-#endif
#ifdef MAIN
uint get_rand_bit(uint bitsize)
diff --git a/mysys/my_clock.c b/mysys/my_clock.c
deleted file mode 100644
index da04feb462f..00000000000
--- a/mysys/my_clock.c
+++ /dev/null
@@ -1,32 +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 */
-
-#include "my_global.h"
-
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
-#include "mysys_priv.h"
-#include <sys/times.h>
-#endif
-
-long my_clock(void)
-{
-#if !defined(__WIN__)
- struct tms tmsbuf;
- (void) times(&tmsbuf);
- return (tmsbuf.tms_utime + tmsbuf.tms_stime);
-#else
- return clock();
-#endif
-}
diff --git a/mysys/my_dup.c b/mysys/my_dup.c
deleted file mode 100644
index 5fdd6e9f364..00000000000
--- a/mysys/my_dup.c
+++ /dev/null
@@ -1,41 +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 */
-
-#include "mysys_priv.h"
-#include "mysys_err.h"
-#include <my_dir.h>
-#include <errno.h>
-#if defined(__WIN__)
-#include <share.h>
-#endif
-
- /* Open a file */
-
-File my_dup(File file, myf MyFlags)
-{
- File fd;
- const char *filename;
- DBUG_ENTER("my_dup");
- DBUG_PRINT("my",("file: %d MyFlags: %d", file, MyFlags));
-#ifdef _WIN32
- fd= my_win_dup(file);
-#else
- fd= dup(file);
-#endif
- filename= (((uint) file < my_file_limit) ?
- my_file_info[(int) file].name : "Unknown");
- DBUG_RETURN(my_register_filename(fd, filename, FILE_BY_DUP,
- EE_FILENOTFOUND, MyFlags));
-} /* my_open */
diff --git a/mysys/my_handler.c b/mysys/my_handler.c
index 48d100f2d3f..bd1e313d066 100644
--- a/mysys/my_handler.c
+++ b/mysys/my_handler.c
@@ -23,6 +23,8 @@
#include "my_handler_errors.h"
+#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
+
int ha_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length,
uchar *b, uint b_length, my_bool part_key,
my_bool skip_end_space)
diff --git a/mysys/my_init.c b/mysys/my_init.c
index dbf1bfe761c..d2371278b0c 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -33,6 +33,9 @@ static my_bool win32_init_tcp_ip();
#define my_win_init()
#endif
+#define SCALE_SEC 100
+#define SCALE_USEC 10000
+
my_bool my_init_done= 0;
/** True if @c my_basic_init() has been called. */
my_bool my_basic_init_done= 0;
@@ -138,9 +141,6 @@ my_bool my_init(void)
#ifdef THREAD
if (my_thread_global_init())
return 1;
-#if !defined(__WIN__)
- sigfillset(&my_signals); /* signals blocked by mf_brkhant */
-#endif
#endif /* THREAD */
{
DBUG_ENTER("my_init");
diff --git a/mysys/my_net.c b/mysys/my_net.c
deleted file mode 100644
index e584e541175..00000000000
--- a/mysys/my_net.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (C) 2000 MySQL AB, 2008-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 */
-
-/* thread safe version of some common functions */
-
-#include "mysys_priv.h"
-#include <m_string.h>
-
-/* for thread safe my_inet_ntoa */
-#if !defined(__WIN__)
-#include <netdb.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#endif /* !defined(__WIN__) */
-
-void my_inet_ntoa(struct in_addr in, char *buf)
-{
- char *ptr;
- mysql_mutex_lock(&THR_LOCK_net);
- ptr=inet_ntoa(in);
- strmov(buf,ptr);
- mysql_mutex_unlock(&THR_LOCK_net);
-}
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index 270d13928e3..dee34d10b38 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -138,7 +138,7 @@ void sigwait_setup(sigset_t *set)
sact.sa_flags = 0;
sact.sa_handler = px_handle_sig;
- memcpy_fixed(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
+ memcpy(&sact.sa_mask, set, sizeof(*set)); /* handler isn't thread_safe */
sigemptyset(&unblock_mask);
pthread_sigmask(SIG_UNBLOCK,(sigset_t*) 0,&rev_sigwait_set);
@@ -164,7 +164,7 @@ void sigwait_setup(sigset_t *set)
}
}
}
- memcpy_fixed(&sigwait_set,set,sizeof(*set));
+ memcpy(&sigwait_set, set, sizeof(*set));
pthread_sigmask(SIG_BLOCK,(sigset_t*) set,(sigset_t*) 0);
pthread_sigmask(SIG_UNBLOCK,&unblock_mask,(sigset_t*) 0);
}
@@ -252,7 +252,7 @@ void *sigwait_thread(void *set_arg)
struct sigaction sact;
sact.sa_flags = 0;
sact.sa_handler = sigwait_handle_sig;
- memcpy_fixed(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
+ memcpy(&sact.sa_mask, set, sizeof(*set)); /* handler isn't thread_safe */
sigemptyset(&pending_set);
for (i = 1; i <= sizeof(pending_set)*8; i++)
diff --git a/mysys/my_static.c b/mysys/my_static.c
index 2869b43543a..d7354555f3d 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -43,9 +43,6 @@ struct st_my_file_info *my_file_info= my_file_info_default;
int my_dont_interrupt=0;
volatile int _my_signals=0;
struct st_remember _my_sig_remember[MAX_SIGNALS]={{0,0}};
-#ifdef THREAD
-sigset_t my_signals; /* signals blocked by mf_brkhant */
-#endif
/* from mf_reccache.c */
ulong my_default_record_cache_size=RECORD_CACHE_SIZE;
diff --git a/mysys/my_static.h b/mysys/my_static.h
index 2c9cef0f101..7fde15ff133 100644
--- a/mysys/my_static.h
+++ b/mysys/my_static.h
@@ -25,9 +25,6 @@ C_MODE_START
#include <signal.h>
#define MAX_SIGNALS 10 /* Max signals under a dont-allow */
-#define MIN_KEYBLOCK (min(IO_SIZE,1024))
-#define MAX_KEYBLOCK 8192 /* Max keyblocklength == 8*IO_SIZE */
-#define MAX_BLOCK_TYPES MAX_KEYBLOCK/MIN_KEYBLOCK
struct st_remember {
int number;
@@ -48,9 +45,6 @@ extern struct st_my_file_info my_file_info_default[MY_NFILE];
extern ulonglong query_performance_frequency, query_performance_offset;
-#if defined(THREAD) && !defined(__WIN__)
-extern sigset_t my_signals; /* signals blocked by mf_brkhant */
-#endif
C_MODE_END
#endif /* MYSYS_MY_STATIC_INCLUDED */
diff --git a/mysys/my_vle.c b/mysys/my_vle.c
deleted file mode 100644
index 09f297eb553..00000000000
--- a/mysys/my_vle.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Copyright (C) 2005 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 */
-
-/*
- Variable length encoding.
-
- A method to store an arbitrary-size non-negative integer. We let the
- most significant bit of the number indicate that the next byte
- should be contatenated to form the real number.
-*/
-
-#include "my_vle.h"
-
-/*
- Function to encode an unsigned long as VLE. The bytes for the VLE
- will be written to the location pointed to by 'out'. The maximum
- number of bytes written will be 'max'.
-
- PARAMETERS
-
- out Pointer to beginning of where to store VLE bytes.
- max Maximum number of bytes to write.
- n Number to encode.
-
- RETURN VALUE
- On success, one past the end of the array containing the VLE
- bytes. On failure, the 'out' pointer is returned.
-*/
-
-uchar*
-my_vle_encode(uchar* out, size_t max, ulong n)
-{
- uchar buf[my_vle_sizeof(n)];
- uchar *ptr= buf;
- size_t len;
-
- do
- {
- *ptr++= (uchar) (n & 0x7F);
- n>>= 7;
- }
- while (n > 0);
-
- len= ptr - buf;
-
- if (len <= max)
- {
- /*
- The bytes are stored in reverse order in 'buf'. Let's write them
- in correct order to the output buffer and set the MSB at the
- same time.
- */
- while (ptr-- > buf)
- {
- uchar v= *ptr;
- if (ptr > buf)
- v|= 0x80;
- *out++= v;
- }
- }
-
- return out;
-}
-
-/*
- Function to decode a VLE representation of an integral value.
-
-
- PARAMETERS
-
- result_ptr Pointer to an unsigned long where the value will be written.
- vle Pointer to the VLE bytes.
-
- RETURN VALUE
-
- One-past the end of the VLE bytes. The routine will never read
- more than sizeof(*result_ptr) + 1 bytes.
-*/
-
-uchar const*
-my_vle_decode(ulong *result_ptr, uchar const *vle)
-{
- ulong result= 0;
- size_t cnt= 1;
-
- do
- {
- result<<= 7;
- result|= (*vle & 0x7F);
- }
- while ((*vle++ & 0x80) && ++cnt <= sizeof(*result_ptr) + 1);
-
- if (cnt <= sizeof(*result_ptr) + 1)
- *result_ptr= result;
-
- return vle;
-}
diff --git a/mysys/rijndael.c b/mysys/rijndael.c
index 2b12753c4e5..2d622efad82 100644
--- a/mysys/rijndael.c
+++ b/mysys/rijndael.c
@@ -32,22 +32,6 @@
#define FULL_UNROLL
*/
-
-#ifdef NOT_USED
-Te0[x] = S [x].[02, 01, 01, 03];
-Te1[x] = S [x].[03, 02, 01, 01];
-Te2[x] = S [x].[01, 03, 02, 01];
-Te3[x] = S [x].[01, 01, 03, 02];
-Te4[x] = S [x].[01, 01, 01, 01];
-
-Td0[x] = Si[x].[0e, 09, 0d, 0b];
-Td1[x] = Si[x].[0b, 0e, 09, 0d];
-Td2[x] = Si[x].[0d, 0b, 0e, 09];
-Td3[x] = Si[x].[09, 0d, 0b, 0e];
-Td4[x] = Si[x].[01, 01, 01, 01];
-#endif
-
-
static const uint32 Te0[256]=
{
0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
diff --git a/mysys/test_charset.c b/mysys/test_charset.c
index 5b399071d11..39df1b02d7b 100644
--- a/mysys/test_charset.c
+++ b/mysys/test_charset.c
@@ -77,15 +77,5 @@ int main(int argc, char **argv) {
_print_csinfo(cs);
fflush(stdout);
-#ifdef NOT_USED_ANYMORE
- cs_list = list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG));
- printf("LIST OF CHARSETS (compiled + *.conf):\n%s\n", cs_list);
- my_free(cs_list);
-
- cs_list = list_charsets(MYF(MY_CS_INDEX | MY_CS_LOADED));
- printf("LIST OF CHARSETS (index + loaded):\n%s\n", cs_list);
- my_free(cs_list);
-#endif
-
return 0;
}
diff --git a/mysys/test_fn.c b/mysys/test_fn.c
deleted file mode 100644
index 249cc878390..00000000000
--- a/mysys/test_fn.c
+++ /dev/null
@@ -1,69 +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 */
-
-#include "mysys_priv.h"
-
-const char *test_names[]=
-{
- "/usr/my/include/srclib/myfunc/dbug/test",
- "test",
- "dbug/test",
- "/usr/my/srclib/myfunc/dbug/test",
- "/usr/monty/oldcopy/jazz/setupp.frm",
- "~/monty.tst",
- "~/dbug/monty.tst",
- "./hejsan",
- "./dbug/test",
- "../dbug/test",
- "../myfunc/test",
- "../../monty/rutedit",
- "/usr/monty//usr/monty/rutedit",
- "/usr/./monty/rutedit",
- "/usr/my/../monty/rutedit",
- "/usr/my/~/rutedit",
- "~/../my",
- "~/../my/srclib/myfunc/test",
- "~/../my/srclib/myfunc/./dbug/test",
- "/../usr/my/srclib/dbug",
- "c/../my",
- "/c/../my",
- NullS,
-};
-
-int main(int argc __attribute__((unused)), char **argv)
-{
- const char **pos;
- char buff[FN_REFLEN],buff2[FN_REFLEN];
- DBUG_ENTER ("main");
- DBUG_PROCESS (argv[0]);
- MY_INIT(argv[0]);
-
- if (argv[1] && argv[1][1] == '#')
- DBUG_PUSH(argv[1]+2);
-
- for (pos=test_names; *pos ; pos++)
- {
- printf("org : '%s'\n",*pos);
- printf("pack: '%s'\n",fn_format(buff,*pos,"","",8));
- printf("unpack: '%s'\n",fn_format(buff2,*pos,"","",4));
- unpack_filename(buff,buff);
- if (strcmp(buff,buff2) != 0)
- {
- printf("error on cmp: '%s' != '%s'\n",buff,buff2);
- }
- puts("");
- }
- DBUG_RETURN(0);
-}
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 9ca18eeaf1b..54eef693558 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -903,11 +903,6 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
sigaddset(&set,THR_SERVER_ALARM);
sigdelset(&set, thr_client_alarm);
(void) pthread_sigmask(SIG_SETMASK,&set,NULL);
-#ifdef NOT_USED
- sigemptyset(&set);
- sigaddset(&set, thr_client_alarm);
- pthread_sigmask(SIG_UNBLOCK, &set, (sigset_t*) 0);
-#endif
pthread_attr_init(&thr_attr);
pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS);
diff --git a/mysys/trie.c b/mysys/trie.c
deleted file mode 100644
index b2e93fcceac..00000000000
--- a/mysys/trie.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Copyright (C) 2005 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 */
-
-/*
- Implementation of trie and Aho-Corasick automaton.
- Supports only charsets that can be compared byte-wise.
-
- TODO:
- Add character frequencies. Can increase lookup speed
- up to 30%.
- Implement character-wise comparision.
-*/
-
-
-#include "mysys_priv.h"
-#include <m_string.h>
-#include <my_trie.h>
-#include <my_base.h>
-
-
-/*
- SYNOPSIS
- TRIE *trie_init (TRIE *trie, CHARSET_INFO *charset);
-
- DESCRIPTION
- Allocates or initializes a `TRIE' object. If `trie' is a `NULL'
- pointer, the function allocates, initializes, and returns a new
- object. Otherwise, the object is initialized and the address of
- the object is returned. If `trie_init()' allocates a new object,
- it will be freed when `trie_free()' is called.
-
- RETURN VALUE
- An initialized `TRIE*' object. `NULL' if there was insufficient
- memory to allocate a new object.
-*/
-
-TRIE *trie_init (TRIE *trie, CHARSET_INFO *charset)
-{
- MEM_ROOT mem_root;
- DBUG_ENTER("trie_init");
- DBUG_ASSERT(charset);
- init_alloc_root(&mem_root,
- (sizeof(TRIE_NODE) * 128) + ALLOC_ROOT_MIN_BLOCK_SIZE,
- sizeof(TRIE_NODE) * 128);
- if (! trie)
- {
- if (! (trie= (TRIE *)alloc_root(&mem_root, sizeof(TRIE))))
- {
- free_root(&mem_root, MYF(0));
- DBUG_RETURN(NULL);
- }
- }
-
- memcpy(&trie->mem_root, &mem_root, sizeof(MEM_ROOT));
- trie->root.leaf= 0;
- trie->root.c= 0;
- trie->root.next= NULL;
- trie->root.links= NULL;
- trie->root.fail= NULL;
- trie->charset= charset;
- trie->nnodes= 0;
- trie->nwords= 0;
- DBUG_RETURN(trie);
-}
-
-
-/*
- SYNOPSIS
- void trie_free (TRIE *trie);
- trie - valid pointer to `TRIE'
-
- DESCRIPTION
- Frees the memory allocated for a `trie'.
-
- RETURN VALUE
- None.
-*/
-
-void trie_free (TRIE *trie)
-{
- MEM_ROOT mem_root;
- DBUG_ENTER("trie_free");
- DBUG_ASSERT(trie);
- memcpy(&mem_root, &trie->mem_root, sizeof(MEM_ROOT));
- free_root(&mem_root, MYF(0));
- DBUG_VOID_RETURN;
-}
-
-
-/*
- SYNOPSIS
- my_bool trie_insert (TRIE *trie, const uchar *key, uint keylen);
- trie - valid pointer to `TRIE'
- key - valid pointer to key to insert
- keylen - non-0 key length
-
- DESCRIPTION
- Inserts new key into trie.
-
- RETURN VALUE
- Upon successful completion, `trie_insert' returns `FALSE'. Otherwise
- `TRUE' is returned.
-
- NOTES
- If this function fails you must assume `trie' is broken.
- However it can be freed with trie_free().
-*/
-
-my_bool trie_insert (TRIE *trie, const uchar *key, uint keylen)
-{
- TRIE_NODE *node;
- TRIE_NODE *next;
- uchar p;
- uint k;
- DBUG_ENTER("trie_insert");
- DBUG_ASSERT(trie && key && keylen);
- node= &trie->root;
- trie->root.fail= NULL;
- for (k= 0; k < keylen; k++)
- {
- p= key[k];
- for (next= node->links; next; next= next->next)
- if (next->c == p)
- break;
-
- if (! next)
- {
- TRIE_NODE *tmp= (TRIE_NODE *)alloc_root(&trie->mem_root,
- sizeof(TRIE_NODE));
- if (! tmp)
- DBUG_RETURN(TRUE);
- tmp->leaf= 0;
- tmp->c= p;
- tmp->links= tmp->fail= tmp->next= NULL;
- trie->nnodes++;
- if (! node->links)
- {
- node->links= tmp;
- }
- else
- {
- for (next= node->links; next->next; next= next->next) /* no-op */;
- next->next= tmp;
- }
- node= tmp;
- }
- else
- {
- node= next;
- }
- }
- node->leaf= keylen;
- trie->nwords++;
- DBUG_RETURN(FALSE);
-}
-
-
-/*
- SYNOPSIS
- my_bool trie_prepare (TRIE *trie);
- trie - valid pointer to `TRIE'
-
- DESCRIPTION
- Constructs Aho-Corasick automaton.
-
- RETURN VALUE
- Upon successful completion, `trie_prepare' returns `FALSE'. Otherwise
- `TRUE' is returned.
-*/
-
-my_bool ac_trie_prepare (TRIE *trie)
-{
- TRIE_NODE **tmp_nodes;
- TRIE_NODE *node;
- uint32 fnode= 0;
- uint32 lnode= 0;
- DBUG_ENTER("trie_prepare");
- DBUG_ASSERT(trie);
-
- tmp_nodes= (TRIE_NODE **)my_malloc(trie->nnodes * sizeof(TRIE_NODE *), MYF(0));
- if (! tmp_nodes)
- DBUG_RETURN(TRUE);
-
- trie->root.fail= &trie->root;
- for (node= trie->root.links; node; node= node->next)
- {
- node->fail= &trie->root;
- tmp_nodes[lnode++]= node;
- }
-
- while (fnode < lnode)
- {
- TRIE_NODE *current= (TRIE_NODE *)tmp_nodes[fnode++];
- for (node= current->links; node; node= node->next)
- {
- TRIE_NODE *fail= current->fail;
- tmp_nodes[lnode++]= node;
- while (! (node->fail= trie_goto(&trie->root, fail, node->c)))
- fail= fail->fail;
- }
- }
- my_free(tmp_nodes);
- DBUG_RETURN(FALSE);
-}
-
-
-/*
- SYNOPSIS
- void ac_trie_init (TRIE *trie, AC_TRIE_STATE *state);
- trie - valid pointer to `TRIE'
- state - value pointer to `AC_TRIE_STATE'
-
- DESCRIPTION
- Initializes `AC_TRIE_STATE' object.
-*/
-
-void ac_trie_init (TRIE *trie, AC_TRIE_STATE *state)
-{
- DBUG_ENTER("ac_trie_init");
- DBUG_ASSERT(trie && state);
- state->trie= trie;
- state->node= &trie->root;
- DBUG_VOID_RETURN;
-}
diff --git a/packaging/Makefile.am b/packaging/Makefile.am
new file mode 100644
index 00000000000..3e6a79367b6
--- /dev/null
+++ b/packaging/Makefile.am
@@ -0,0 +1,14 @@
+EXTRA_DIST = \
+ WiX/AdminBackground.jpg \
+ WiX/AdminHeader.jpg \
+ WiX/CMakeLists.txt \
+ WiX/extra.wxs.in \
+ WiX/CPackWixConfig.cmake \
+ WiX/create_msi.cmake.in \
+ WiX/custom_ui.wxs \
+ WiX/MySQLServer.ico \
+ WiX/mysql_server.wxs.in \
+ WiX/ca/CMakeLists.txt \
+ WiX/ca/CustomAction.cpp \
+ WiX/ca/CustomAction.def \
+ WiX/ca/CustomAction.rc
diff --git a/packaging/WiX/CMakeLists.txt b/packaging/WiX/CMakeLists.txt
index 8a6a4ae4c41..052887f10a1 100644
--- a/packaging/WiX/CMakeLists.txt
+++ b/packaging/WiX/CMakeLists.txt
@@ -41,11 +41,13 @@ FOREACH(dir mysql performance_schema)
FILE(GLOB files ${CMAKE_BINARY_DIR}/sql/data/${dir}/*)
SET(filelist)
FOREACH(f ${files})
+ IF(NOT f MATCHES ".rule")
FILE(TO_NATIVE_PATH "${f}" file_native_path)
GET_FILENAME_COMPONENT(file_name "${f}" NAME)
SET(filelist
"${filelist}
<File Id='${file_name}' Source='${file_native_path}'/>")
+ ENDIF()
ENDFOREACH()
STRING(TOUPPER ${dir} DIR_UPPER)
SET(DATADIR_${DIR_UPPER}_FILES "${filelist}")
@@ -56,15 +58,34 @@ FIND_PROGRAM(HEAT_EXECUTABLE heat ${WIX_DIR})
FIND_PROGRAM(CANDLE_EXECUTABLE candle ${WIX_DIR})
FIND_PROGRAM(LIGHT_EXECUTABLE light ${WIX_DIR})
+# WiX wants the license text as rtf; if there is no rtf license,
+# we create a fake one from the plain text COPYING file.
+IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.rtf")
+ SET(COPYING_RTF "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.rtf")
+ELSE()
+ FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../COPYING" CONTENTS)
+ STRING(REGEX REPLACE "\n" "\\\\par\n" CONTENTS "${CONTENTS}")
+ STRING(REGEX REPLACE "\t" "\\\\tab" CONTENTS "${CONTENTS}")
+ FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\\viewkind4\\uc1\\pard\\lang1031\\f0\\fs15")
+ FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "${CONTENTS}")
+ FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "\n}\n")
+ SET(COPYING_RTF "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf")
+ENDIF()
+GET_TARGET_PROPERTY(WIXCA_LOCATION wixca LOCATION)
+SET(CPACK_WIX_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake)
+SET(CPACK_WIX_INCLUDE "${CMAKE_CURRENT_BINARY_DIR}/extra.wxs;${CMAKE_CURRENT_SOURCE_DIR}/custom_ui.wxs")
+
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
@ONLY)
+
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(WixWin64 " Win64='yes'")
ELSE()
SET(WixWin64)
ENDIF()
+
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/extra.wxs.in
${CMAKE_CURRENT_BINARY_DIR}/extra.wxs)
@@ -72,28 +93,11 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio")
SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_CFG_INTDIR}")
ENDIF()
-# WiX wants the license text as rtf; if there is no rtf license,
-# we create a fake one from the plain text COPYING file.
-IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.rtf")
- MESSAGE("copying COPYING.rtf")
- FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.rtf" CONTENTS)
- FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "${CONTENTS}")
-ELSE()
- MESSAGE("creating COPYING.rtf")
- FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../COPYING" CONTENTS)
- STRING(REGEX REPLACE "\n" "\\\\par\n" CONTENTS "${CONTENTS}")
- STRING(REGEX REPLACE "\t" "\\\\tab" CONTENTS "${CONTENTS}")
- FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\\viewkind4\\uc1\\pard\\lang1031\\f0\\fs15")
- FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "${CONTENTS}")
- FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "\n}\n")
-ENDIF()
ADD_CUSTOM_TARGET(
MSI
COMMAND set VS_UNICODE_OUTPUT=
COMMAND ${CMAKE_COMMAND}
- -DCPACK_WIX_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake
- -DCPACK_WIX_INCLUDE=${CMAKE_CURRENT_BINARY_DIR}/extra.wxs
${CONFIG_PARAM}
-P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
)
@@ -103,10 +107,8 @@ ADD_CUSTOM_TARGET(
MSI_ESSENTIALS
COMMAND set VS_UNICODE_OUTPUT=
COMMAND ${CMAKE_COMMAND} -DESSENTIALS=1
- -DCPACK_WIX_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake
- -DCPACK_WIX_INCLUDE=${CMAKE_CURRENT_BINARY_DIR}/extra.wxs
${CONFIG_PARAM}
-P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
)
-ADD_DEPENDENCIES(MSI wixca)
+ADD_DEPENDENCIES(MSI_ESSENTIALS wixca)
diff --git a/packaging/WiX/CPackWixConfig.cmake b/packaging/WiX/CPackWixConfig.cmake
index 6fdc5b46f9a..f49406b5787 100644
--- a/packaging/WiX/CPackWixConfig.cmake
+++ b/packaging/WiX/CPackWixConfig.cmake
@@ -1,10 +1,12 @@
IF(ESSENTIALS)
- MESSAGE("Essentials!")
SET(CPACK_COMPONENTS_USED "Server;Client;DataFiles")
SET(CPACK_WIX_UI "WixUI_InstallDir")
- MATH(EXPR bits ${CMAKE_SIZEOF_VOID_P}*8)
- SET(CPACK_PACKAGE_FILE_NAME "mysql-essentials-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH}-win${bits}")
+ IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
+ SET(CPACK_PACKAGE_FILE_NAME "mysql-essential-${VERSION}-winx64")
+ ELSE()
+ SET(CPACK_PACKAGE_FILE_NAME "mysql-essential-${VERSION}-win32")
+ ENDIF()
ELSE()
SET(CPACK_COMPONENTS_USED
"Server;Client;DataFiles;Development;SharedLibraries;Embedded;Debuginfo;Documentation;IniFiles;Readme;Server_Scripts;DebugBinaries")
@@ -57,6 +59,7 @@ SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install MySQL Server")
SET(CPACK_COMPONENT_DATAFILES_GROUP "MySQLServer")
SET(CPACK_COMPONENT_DATAFILES_DISPLAY_NAME "Server data files")
SET(CPACK_COMPONENT_DATAFILES_DESCRIPTION "Server data files" )
+ SET(CPACK_COMPONENT_DATAFILES_HIDDEN 1)
#Feature "Devel"
diff --git a/packaging/WiX/create_msi.cmake.in b/packaging/WiX/create_msi.cmake.in
index ff18009fd0c..adc3cf4c4dd 100644
--- a/packaging/WiX/create_msi.cmake.in
+++ b/packaging/WiX/create_msi.cmake.in
@@ -4,11 +4,16 @@ SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@")
SET(LIGHT_EXECUTABLE "@LIGHT_EXECUTABLE@")
SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@")
+SET(VERSION "@VERSION@")
SET(MAJOR_VERSION "@MAJOR_VERSION@")
SET(MINOR_VERSION "@MINOR_VERSION@")
SET(PATCH "@PATCH@")
SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)
SET(MANUFACTURER "@MANUFACTURER@")
+SET(WIXCA_LOCATION "@WIXCA_LOCATION@")
+SET(COPYING_RTF "@COPYING_RTF@")
+SET(CPACK_WIX_CONFIG "@CPACK_WIX_CONFIG@")
+SET(CPACK_WIX_INCLUDE "@CPACK_WIX_INCLUDE@")
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(Win64 " Win64='yes'")
@@ -29,7 +34,7 @@ IF(CPACK_WIX_CONFIG)
ENDIF()
IF(NOT CPACK_WIX_UI)
- SET(CPACK_WIX_UI "WixUI_Mondo")
+ SET(CPACK_WIX_UI "WixUI_Mondo_Custom")
ENDIF()
SET(WIX_FEATURES)
@@ -143,15 +148,16 @@ FOREACH(f ${WIX_FEATURES})
ENDFOREACH()
+IF(CMAKE_INSTALL_CONFIG_NAME)
+ STRING(REPLACE "${CMAKE_CFG_INTDIR}" "${CMAKE_INSTALL_CONFIG_NAME}"
+ WIXCA_LOCATION "${WIXCA_LOCATION}")
+ SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_INSTALL_CONFIG_NAME}")
+ENDIF()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in
${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)
-IF(CMAKE_INSTALL_CONFIG_NAME)
- SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_INSTALL_CONFIG_NAME}")
-ENDIF()
-
FOREACH(comp ${CPACK_COMPONENTS_ALL})
SET(ENV{DESTDIR} testinstall/${comp})
SET(DIRS ${DIRS} testinstall/${comp})
@@ -261,9 +267,12 @@ FOREACH(d ${DIRS})
SET(COMP_NAME ${d_name})
TRAVERSE_FILES(${d} ${d} ${abs}/${d_name}.wxs ${abs}/${d_name}_component_group.wxs "${abs}/dirs")
FILE(APPEND ${abs}/${d_name}_component_group.wxs "</ComponentGroup>")
- FILE(READ ${d_name}.wxs WIX_TMP)
- SET(CPACK_WIX_COMPONENTS "${CPACK_WIX_COMPONENTS}\n${WIX_TMP}")
- FILE(REMOVE ${d_name}.wxs)
+ IF(EXISTS ${d_name}.wxs)
+ FILE(READ ${d_name}.wxs WIX_TMP)
+ SET(CPACK_WIX_COMPONENTS "${CPACK_WIX_COMPONENTS}\n${WIX_TMP}")
+ FILE(REMOVE ${d_name}.wxs)
+ ENDIF()
+
FILE(READ ${d_name}_component_group.wxs WIX_TMP)
SET(CPACK_WIX_COMPONENT_GROUPS "${CPACK_WIX_COMPONENT_GROUPS}\n${WIX_TMP}")
diff --git a/packaging/WiX/custom_ui.wxs b/packaging/WiX/custom_ui.wxs
new file mode 100644
index 00000000000..90db5c416fe
--- /dev/null
+++ b/packaging/WiX/custom_ui.wxs
@@ -0,0 +1,81 @@
+<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
+ xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
+ <WixVariable Id="WixUICostingPopupOptOut" Value="1" Overridable="yes" />
+ <UI Id="WixUI_Mondo_Custom">
+ <Dialog Id="UpgradeDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
+ <Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Upgrade">
+ <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
+ <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
+ <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
+ <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
+ <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
+ </Control>
+ <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
+ <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
+ </Control>
+ <Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)">
+ <Condition Action="default">WixUI_InstallMode = "Remove"</Condition>
+ </Control>
+ <Control Id="InstallTitle" Type="Text" X="15" Y="15" Width="300" Height="15" Transparent="yes" NoPrefix="yes" Hidden="yes" Text="!(loc.VerifyReadyDlgInstallTitle)">
+ <Condition Action="show">NOT Installed</Condition>
+ </Control>
+ <Control Id="InstallText" Type="Text" X="25" Y="70" Width="320" Height="80" Hidden="yes" Text="!(loc.VerifyReadyDlgInstallText)">
+ <Condition Action="show">NOT Installed</Condition>
+ </Control>
+ <Control Id="UpgradeText" Type="Text" X="25" Y="70" Width="320" Height="80" Hidden="no" NoPrefix="yes"
+ Text="Click Upgrade to upgrade your installation from version [OLDERVERSION] to version [ProductVersion]. Click Cancel to exit the upgrade."/>
+ <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.VerifyReadyDlgBannerBitmap)" />
+ <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
+ <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
+ </Dialog>
+
+ <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
+ <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
+ <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
+
+ <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
+ <Property Id="WixUI_Mode" Value="Mondo" />
+
+ <DialogRef Id="ErrorDlg" />
+ <DialogRef Id="FatalError" />
+ <DialogRef Id="FilesInUse" />
+ <DialogRef Id="MsiRMFilesInUse" />
+ <DialogRef Id="PrepareDlg" />
+ <DialogRef Id="ProgressDlg" />
+ <DialogRef Id="ResumeDlg" />
+ <DialogRef Id="UserExit" />
+
+ <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
+
+ <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg" Order="1">NOT OLDERVERSIONBEINGUPGRADED</Publish>
+ <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="UpgradeDlg" Order="2">OLDERVERSIONBEINGUPGRADED</Publish>
+
+ <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
+ <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="SetupTypeDlg" Order="2">LicenseAccepted = "1"</Publish>
+
+ <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
+ <Publish Dialog="SetupTypeDlg" Control="TypicalButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
+ <Publish Dialog="SetupTypeDlg" Control="CustomButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
+ <Publish Dialog="SetupTypeDlg" Control="CompleteButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
+
+ <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">WixUI_InstallMode = "Change"</Publish>
+ <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallCustom"</Publish>
+ <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
+
+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">WixUI_InstallMode = "InstallCustom"</Publish>
+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete"</Publish>
+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="3">WixUI_InstallMode = "Change"</Publish>
+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="4">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish>
+
+ <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
+
+ <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
+ <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
+ <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
+ <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
+
+ <Publish Dialog="UpgradeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
+ </UI>
+
+ <UIRef Id="WixUI_Common" />
+</Include>
diff --git a/packaging/WiX/extra.wxs.in b/packaging/WiX/extra.wxs.in
index b6c42136129..fe2e73c3340 100644
--- a/packaging/WiX/extra.wxs.in
+++ b/packaging/WiX/extra.wxs.in
@@ -48,7 +48,11 @@
</Directory>
</DirectoryRef>
- <Feature Id="UserEditableDatafiles" Level='1' Display='hidden' ConfigurableDirectory="DATADIR">
+ <Feature Id='UserEditableDataFiles'
+ Title='Server data files'
+ Description='Server data files'
+ ConfigurableDirectory='DATADIR'
+ Level='1'>
<ComponentRef Id="component.datadir"/>
<ComponentRef Id="component.datadir.mysql"/>
<ComponentRef Id="component.datadir.performance_schema"/>
diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in
index 8b20644e58d..59cc817a302 100644
--- a/packaging/WiX/mysql_server.wxs.in
+++ b/packaging/WiX/mysql_server.wxs.in
@@ -26,7 +26,9 @@
Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.0"
IncludeMinimum="yes"
Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
- Property="OLDERVERSIONBEINGUPGRADED" />
+ Property="OLDERVERSIONBEINGUPGRADED"
+ MigrateFeatures="yes"
+ />
<UpgradeVersion
Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
OnlyDetect="yes"
@@ -39,6 +41,53 @@
<RemoveExistingProducts After="InstallInitialize"/>
</InstallExecuteSequence>
+ <!-- Save/restore install location -->
+ <CustomAction Id="SaveTargetDir" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
+ <InstallExecuteSequence>
+ <Custom Action="SaveTargetDir" After="InstallValidate">
+ NOT
+ Installed
+ </Custom>
+ </InstallExecuteSequence>
+ <InstallUISequence>
+ <!-- App search is what does FindInstallLocation, and it is dependent on FindRelatedProducts -->
+ <AppSearch After="FindRelatedProducts"/>
+ </InstallUISequence>
+
+ <!-- Find previous installation -->
+ <Property Id="INSTALLDIR">
+ <RegistrySearch Id="FindInstallLocation"
+ Root="HKLM"
+ Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"
+ Name="InstallLocation"
+ Type="raw" />
+ </Property>
+ <Property Id="OLDERVERSION">
+ <RegistrySearch Id="FindOlderVersion"
+ Root="HKLM"
+ Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"
+ Name="DisplayVersion"
+ Type="raw" />
+ </Property>
+ <Property Id="DATADIR">
+ <RegistrySearch Id="FindDataDir"
+ Root="HKLM"
+ Key="SOFTWARE\MySQL AB\[ProductName]"
+ Name="DataLocation"
+ Type="raw" />
+ </Property>
+ <Property Id="INSTALLDIR2">
+ <RegistrySearch Id="FindInstallLocation2"
+ Root="HKLM"
+ Key="SOFTWARE\MySQL AB\[ProductName]"
+ Name="Location"
+ Type="raw" />
+ </Property>
+ <CustomAction Id="SetInstallDir2" Property="INSTALLDIR" Value="[INSTALLDIR2]" />
+ <InstallUISequence>
+ <Custom Action="SetInstallDir2" After="AppSearch">INSTALLDIR2</Custom>
+ </InstallUISequence>
+
<!-- UI -->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>
@@ -60,10 +109,10 @@
<!-- License -->
<WixVariable
Id="WixUILicenseRtf"
- Value="@CMAKE_CURRENT_BINARY_DIR@/COPYING.rtf"/>
+ Value="@COPYING_RTF@"/>
<!-- How to remove the service on uninstall -->
- <Binary Id='wixca.dll' SourceFile='@CMAKE_CURRENT_BINARY_DIR@/ca/RelWithDebInfo/wixca.dll' />
+ <Binary Id='wixca.dll' SourceFile='@WIXCA_LOCATION@' />
<CustomAction Id="UnregisterProperty" Property="UnregisterService" Value="[INSTALLDIR]" Return="check" />
<CustomAction Id="UnregisterPropertySilent" Property="UnregisterServiceSilently" Value="[INSTALLDIR]" Return="check" />
<CustomAction Id="UnregisterService"
@@ -81,8 +130,8 @@
<InstallExecuteSequence>
<Custom Action="UnregisterProperty" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE</Custom>
<Custom Action="UnregisterPropertySilent" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE</Custom>
- <Custom Action="UnregisterService" After="UnregisterProperty">Installed And Not UPGRADINGPRODUCTCODE And UILevel&gt;2</Custom>
- <Custom Action="UnregisterServiceSilently" After="UnregisterPropertySilent">Installed And Not UPGRADINGPRODUCTCODE And UILevel&lt;=2</Custom>
+ <Custom Action="UnregisterService" After="UnregisterProperty">Installed And Not UPGRADINGPRODUCTCODE And UILevel&gt;4</Custom>
+ <Custom Action="UnregisterServiceSilently" After="UnregisterPropertySilent">Installed And Not UPGRADINGPRODUCTCODE And UILevel&lt;=4</Custom>
</InstallExecuteSequence>
<!-- Installation root-->
diff --git a/regex/regcomp.c b/regex/regcomp.c
index 81c435ed552..b41a1ae6da9 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -285,18 +285,6 @@ register struct parse *p;
EMIT(ORPAREN, subno);
if(MUSTEAT(')', REG_EPAREN)) {}
break;
-#ifndef POSIX_MISTAKE
- case ')': /* happens only if no current unmatched ( */
- /*
- * You may ask, why the ifndef? Because I didn't notice
- * this until slightly too late for 1003.2, and none of the
- * other 1003.2 regular-expression reviewers noticed it at
- * all. So an unmatched ) is legal POSIX, at least until
- * we can get it fixed.
- */
- SETERROR(REG_EPAREN);
- break;
-#endif
case '^':
EMIT(OBOL, 0);
p->g->iflags |= USEBOL;
@@ -1228,66 +1216,6 @@ register char *cp;
}
#endif
-#ifdef NOT_USED
-/*
- - mcsub - subtract a collating element from a cset
- == static void mcsub(register cset *cs, register char *cp);
- */
-static void
-mcsub(cs, cp)
-register cset *cs;
-register char *cp;
-{
- register char *fp = mcfind(cs, cp);
- register size_t len = strlen(fp);
-
- assert(fp != NULL);
- (void) memmove(fp, fp + len + 1,
- cs->smultis - (fp + len + 1 - cs->multis));
- cs->smultis -= len;
-
- if (cs->smultis == 0) {
- free(cs->multis);
- cs->multis = NULL;
- return;
- }
-
- cs->multis = realloc(cs->multis, cs->smultis);
- assert(cs->multis != NULL);
-}
-
-/*
- - mcin - is a collating element in a cset?
- == static int mcin(register cset *cs, register char *cp);
- */
-static int
-mcin(cs, cp)
-register cset *cs;
-register char *cp;
-{
- return(mcfind(cs, cp) != NULL);
-}
-
-/*
- - mcfind - find a collating element in a cset
- == static char *mcfind(register cset *cs, register char *cp);
- */
-static char *
-mcfind(cs, cp)
-register cset *cs;
-register char *cp;
-{
- register char *p;
-
- if (cs->multis == NULL)
- return(NULL);
- for (p = cs->multis; *p != '\0'; p += strlen(p) + 1)
- if (strcmp(cp, p) == 0)
- return(p);
- return(NULL);
-}
-#endif
-
/*
- mcinvert - invert the list of collating elements in a cset
== static void mcinvert(register struct parse *p, register cset *cs);
diff --git a/regex/regcomp.ih b/regex/regcomp.ih
index 5deba89217a..cb93286e32f 100644
--- a/regex/regcomp.ih
+++ b/regex/regcomp.ih
@@ -30,11 +30,6 @@ static int nch(register struct parse *p, register cset *cs);
#ifdef USE_ORIG_REGEX_CODE
static void mcadd(register struct parse *p, register cset *cs, register char *cp);
#endif
-#ifdef NOT_USED
-static void mcsub(register cset *cs, register char *cp);
-static int mcin(register cset *cs, register char *cp);
-static char *mcfind(register cset *cs, register char *cp);
-#endif
static void mcinvert(register struct parse *p, register cset *cs);
static void mccase(register struct parse *p, register cset *cs);
static int isinsets(register struct re_guts *g, int c);
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index be25386c68f..ced207da98b 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -90,16 +90,14 @@ IF(MALLOC_LIB)
ENDIF()
IF(CMAKE_GENERATOR MATCHES "Makefiles")
- # No multiconfig build - use CMAKE_C_FLAGS
# Strip maintainer mode options if necessary
- STRING(REPLACE "${MY_MAINTAINER_C_WARNINGS}" "" CFLAGS "${CMAKE_C_FLAGS}")
- STRING(REPLACE "${MY_MAINTAINER_CXX_WARNINGS}" "" CXXFLAGS "${CMAKE_CXX_FLAGS}")
+ STRING(REPLACE "${MY_MAINTAINER_C_WARNINGS}" "" CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
+ STRING(REPLACE "${MY_MAINTAINER_CXX_WARNINGS}" "" CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES})
SET(CFLAGS "${CFLAGS} -arch ${ARCH}")
SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}")
ENDFOREACH()
ELSE()
- # Multiconfig build - use CMAKE_C_FLAGS_RELWITHDEBINFO
# Strip maintainer mode options if necessary
STRING(REPLACE "${MY_MAINTAINER_C_WARNINGS}" "" CFLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
STRING(REPLACE "${MY_MAINTAINER_CXX_WARNINGS}" "" CXXFLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
@@ -142,6 +140,43 @@ ENDIF()
SET(HOSTNAME "hostname")
+# Required for mysqlbug until autotools are deprecated, once done remove these
+# and expand default cmake variables
+SET(CC ${CMAKE_C_COMPILER})
+SET(CXX ${CMAKE_CXX_COMPILER})
+SET(SAVE_CC ${CMAKE_C_COMPILER})
+SET(SAVE_CXX ${CMAKE_CXX_COMPILER})
+SET(SAVE_CFLAGS ${CFLAGS})
+SET(SAVE_CXXFLAGS ${CXXFLAGS})
+# XXX no cmake equivalent for this, just make one up
+SET(CONFIGURE_LINE "Built using CMake")
+
+# Also required for mysqlbug, autoconf only supports --version so for now we
+# just explicitly require GNU
+IF(CMAKE_COMPILER_IS_GNUCC)
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version
+ COMMAND sed 1q
+ OUTPUT_VARIABLE CC_VERSION)
+ELSE()
+ SET(CC_VERSION "")
+ENDIF()
+IF(CMAKE_COMPILER_IS_GNUCXX)
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version
+ COMMAND sed 1q
+ OUTPUT_VARIABLE CXX_VERSION)
+ELSE()
+ SET(CXX_VERSION "")
+ENDIF()
+
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh
+ ${CMAKE_CURRENT_BINARY_DIR}/mysqlbug ESCAPE_QUOTES @ONLY)
+INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/mysqlbug
+ DESTINATION ${INSTALL_BINDIR}
+ COMPONENT Server
+ )
+
ENDIF(UNIX)
# Really ugly, one script, "mysql_install_db", needs prefix set to ".",
@@ -198,9 +233,9 @@ SET(localstatedir ${MYSQL_DATADIR})
# some scripts use @TARGET_LINUX@
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
- SET(TARGET_LINUX 1)
+ SET(TARGET_LINUX "true")
ELSE()
- SET(TARGET_LINUX 0)
+ SET(TARGET_LINUX "false")
ENDIF()
# Use cmake variables to inspect dependencies for
@@ -294,7 +329,6 @@ ELSE()
mysql_zap
mysqlaccess
mysqlaccess.conf
- mysqlbug
mysql_convert_table_format
mysql_find_rows
mysqlhotcopy
diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist
index 9af722f7afc..4fb57b06d71 100755
--- a/scripts/make_win_bin_dist
+++ b/scripts/make_win_bin_dist
@@ -264,7 +264,6 @@ cp include/mysql.h \
include/sql_state.h \
include/mysqld_ername.h \
include/mysql_version.h \
- include/config-win.h \
libmysql/libmysql.def \
$DESTDIR/include/
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index 0840a99e6e2..10755fc698b 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -88,6 +88,8 @@ pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"`
fix_path pkglibdir $pkglibdir_rel lib/mysql lib
plugindir='@pkgplugindir@'
+plugindir_rel=`echo $plugindir | sed -e "s;^$basedir/;;"`
+fix_path plugindir $plugindir_rel lib/mysql/plugin lib/plugin
pkgincludedir='@pkgincludedir@'
fix_path pkgincludedir include/mysql include
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 562732e7387..a537bf27aad 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -413,6 +413,29 @@ else
DATADIR=@localstatedir@
fi
+#
+# Try to find the plugin directory
+#
+
+# Use user-supplied argument
+if [ -n "${PLUGIN_DIR}" ]; then
+ plugin_dir="${PLUGIN_DIR}"
+else
+ # Try to find plugin dir relative to basedir
+ for dir in lib/mysql/plugin lib/plugin
+ do
+ if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then
+ plugin_dir="${MY_BASEDIR_VERSION}/${dir}"
+ break
+ fi
+ done
+ # Give up and use compiled-in default
+ if [ -z "${plugin_dir}" ]; then
+ plugin_dir='@pkgplugindir@'
+ fi
+fi
+plugin_dir="${plugin_dir}${PLUGIN_VARIANT}"
+
if test -z "$MYSQL_HOME"
then
if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf"
@@ -704,8 +727,6 @@ fi
cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS"
-plugin_dir="${PLUGIN_DIR:-$MY_BASEDIR_VERSION/lib/mysql/plugin}${PLUGIN_VARIANT}"
-
for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \
"--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION"
do
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 7107a68ee84..e8a594c4d8b 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -43,7 +43,7 @@ SET (SQL_SOURCE
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 sql_plugin_services.h
+ handler.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
@@ -60,7 +60,7 @@ SET (SQL_SOURCE
sql_cache.cc sql_class.cc sql_client.cc sql_crypt.cc sql_crypt.h
sql_cursor.cc sql_db.cc sql_delete.cc sql_derived.cc sql_do.cc
sql_error.cc sql_handler.cc sql_help.cc sql_insert.cc sql_lex.cc
- sql_list.cc sql_load.cc sql_manager.cc sql_map.cc sql_parse.cc
+ sql_list.cc sql_load.cc sql_manager.cc sql_parse.cc
sql_partition.cc sql_plugin.cc sql_prepare.cc sql_rename.cc
debug_sync.cc debug_sync.h
sql_repl.cc sql_select.cc sql_show.cc sql_state.c sql_string.cc
@@ -185,22 +185,15 @@ RUN_BISON(
# Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
-TARGET_LINK_LIBRARIES(gen_lex_hash mysys)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
- COMMAND gen_lex_hash ARGS > lex_hash.h.tmp &&
- ${CMAKE_COMMAND} -E copy_if_different lex_hash.h.tmp lex_hash.h
- COMMAND ${CMAKE_COMMAND} -E remove -f lex_hash.h.tmp
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen_lex_hash.cc)
+ COMMAND gen_lex_hash > lex_hash.h
+)
MYSQL_ADD_EXECUTABLE(mysql_tzinfo_to_sql tztime.cc)
SET_TARGET_PROPERTIES(mysql_tzinfo_to_sql PROPERTIES COMPILE_FLAGS "-DTZINFO2SQL")
-TARGET_LINK_LIBRARIES(mysql_tzinfo_to_sql ${MYSQLD_STATIC_PLUGIN_LIBS}
- mysys dbug strings vio regex
- ${LIBWRAP} ${LIBCRYPT} ${LIBDL}
- ${SSL_LIBRARIES})
+TARGET_LINK_LIBRARIES(mysql_tzinfo_to_sql mysys)
ADD_CUSTOM_TARGET(
GenServerSource
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 4b1ecbbc8da..7fed55f3cd6 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -90,7 +90,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
item_create.h item_subselect.h item_row.h \
sql_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_string.h unireg.h \
sql_error.h field.h handler.h mysqld_suffix.h \
sql_profile.h mysqld.h sql_help.h frm_crypt.h \
ha_ndbcluster.h ha_ndbcluster_cond.h \
@@ -135,7 +135,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.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 sql_string.cc sql_manager.cc sql_map.cc \
+ lock.cc sql_string.cc sql_manager.cc \
main.cc mysqld.cc password.c hash_filo.cc hostname.cc \
sql_connect.cc scheduler.cc sql_parse.cc \
keycaches.cc set_var.cc sql_yacc.yy sys_vars.cc \
@@ -160,8 +160,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.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 \
+ repl_failsafe.h repl_failsafe.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 \
diff --git a/sql/field.cc b/sql/field.cc
index 56d60ff5b28..75576c59876 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1277,61 +1277,6 @@ int Field::warn_if_overflow(int op_result)
}
-#ifdef NOT_USED
-static bool test_if_real(const char *str,int length, CHARSET_INFO *cs)
-{
- cs= system_charset_info; // QQ move test_if_real into CHARSET_INFO struct
-
- while (length && my_isspace(cs,*str))
- { // Allow start space
- length--; str++;
- }
- if (!length)
- return 0;
- if (*str == '+' || *str == '-')
- {
- length--; str++;
- if (!length || !(my_isdigit(cs,*str) || *str == '.'))
- return 0;
- }
- while (length && my_isdigit(cs,*str))
- {
- length--; str++;
- }
- if (!length)
- return 1;
- if (*str == '.')
- {
- length--; str++;
- while (length && my_isdigit(cs,*str))
- {
- length--; str++;
- }
- }
- if (!length)
- return 1;
- if (*str == 'E' || *str == 'e')
- {
- if (length < 3 || (str[1] != '+' && str[1] != '-') ||
- !my_isdigit(cs,str[2]))
- return 0;
- length-=3;
- str+=3;
- while (length && my_isdigit(cs,*str))
- {
- length--; str++;
- }
- }
- for (; length ; length--, str++)
- { // Allow end space
- if (!my_isspace(cs,*str))
- return 0;
- }
- return 1;
-}
-#endif
-
-
/**
Interpret field value as an integer but return the result as a string.
@@ -4198,7 +4143,7 @@ int Field_float::store(double nr)
}
else
#endif
- memcpy_fixed(ptr,(uchar*) &j,sizeof(j));
+ memcpy(ptr, &j, sizeof(j));
return error;
}
@@ -4221,7 +4166,7 @@ double Field_float::val_real(void)
}
else
#endif
- memcpy_fixed((uchar*) &j,ptr,sizeof(j));
+ memcpy(&j, ptr, sizeof(j));
return ((double) j);
}
@@ -4235,7 +4180,7 @@ longlong Field_float::val_int(void)
}
else
#endif
- memcpy_fixed((uchar*) &j,ptr,sizeof(j));
+ memcpy(&j, ptr, sizeof(j));
return (longlong) rint(j);
}
@@ -4252,7 +4197,7 @@ String *Field_float::val_str(String *val_buffer,
}
else
#endif
- memcpy_fixed((uchar*) &nr,ptr,sizeof(nr));
+ memcpy(&nr, ptr, sizeof(nr));
uint to_length=max(field_length,70);
val_buffer->alloc(to_length);
@@ -4290,8 +4235,8 @@ int Field_float::cmp(const uchar *a_ptr, const uchar *b_ptr)
else
#endif
{
- memcpy_fixed(&a,a_ptr,sizeof(float));
- memcpy_fixed(&b,b_ptr,sizeof(float));
+ memcpy(&a, a_ptr, sizeof(float));
+ memcpy(&b, b_ptr, sizeof(float));
}
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
@@ -4308,7 +4253,7 @@ void Field_float::sort_string(uchar *to,uint length __attribute__((unused)))
}
else
#endif
- memcpy_fixed(&nr,ptr,sizeof(float));
+ memcpy(&nr, ptr, sizeof(float));
uchar *tmp= to;
if (nr == (float) 0.0)
@@ -4319,7 +4264,7 @@ void Field_float::sort_string(uchar *to,uint length __attribute__((unused)))
else
{
#ifdef WORDS_BIGENDIAN
- memcpy_fixed(tmp,&nr,sizeof(nr));
+ memcpy(tmp, &nr, sizeof(nr));
#else
tmp[0]= ptr[3]; tmp[1]=ptr[2]; tmp[2]= ptr[1]; tmp[3]=ptr[0];
#endif
@@ -7497,7 +7442,7 @@ double Field_blob::val_real(void)
uint32 length;
CHARSET_INFO *cs;
- memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
+ memcpy(&blob, ptr+packlength, sizeof(char*));
if (!blob)
return 0.0;
length= get_length(ptr);
@@ -7511,7 +7456,7 @@ longlong Field_blob::val_int(void)
ASSERT_COLUMN_MARKED_FOR_READ;
int not_used;
char *blob;
- memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
+ memcpy(&blob, ptr+packlength, sizeof(char*));
if (!blob)
return 0;
uint32 length=get_length(ptr);
@@ -7523,7 +7468,7 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
{
ASSERT_COLUMN_MARKED_FOR_READ;
char *blob;
- memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
+ memcpy(&blob, ptr+packlength, sizeof(char*));
if (!blob)
val_ptr->set("",0,charset()); // A bit safer than ->length(0)
else
@@ -7537,7 +7482,7 @@ my_decimal *Field_blob::val_decimal(my_decimal *decimal_value)
ASSERT_COLUMN_MARKED_FOR_READ;
const char *blob;
size_t length;
- memcpy_fixed(&blob, ptr+packlength, sizeof(const uchar*));
+ memcpy(&blob, ptr+packlength, sizeof(const uchar*));
if (!blob)
{
blob= "";
@@ -7565,8 +7510,8 @@ int Field_blob::cmp_max(const uchar *a_ptr, const uchar *b_ptr,
uint max_length)
{
uchar *blob1,*blob2;
- memcpy_fixed(&blob1,a_ptr+packlength,sizeof(char*));
- memcpy_fixed(&blob2,b_ptr+packlength,sizeof(char*));
+ memcpy(&blob1, a_ptr+packlength, sizeof(char*));
+ memcpy(&blob2, b_ptr+packlength, sizeof(char*));
uint a_len= get_length(a_ptr), b_len= get_length(b_ptr);
set_if_smaller(a_len, max_length);
set_if_smaller(b_len, max_length);
@@ -7580,8 +7525,8 @@ int Field_blob::cmp_binary(const uchar *a_ptr, const uchar *b_ptr,
char *a,*b;
uint diff;
uint32 a_length,b_length;
- memcpy_fixed(&a,a_ptr+packlength,sizeof(char*));
- memcpy_fixed(&b,b_ptr+packlength,sizeof(char*));
+ memcpy(&a, a_ptr+packlength, sizeof(char*));
+ memcpy(&b, b_ptr+packlength, sizeof(char*));
a_length=get_length(a_ptr);
if (a_length > max_length)
a_length=max_length;
@@ -7662,7 +7607,7 @@ int Field_blob::key_cmp(const uchar *key_ptr, uint max_key_length)
{
uchar *blob1;
uint blob_length=get_length(ptr);
- memcpy_fixed(&blob1,ptr+packlength,sizeof(char*));
+ memcpy(&blob1, ptr+packlength, sizeof(char*));
CHARSET_INFO *cs= charset();
uint local_char_length= max_key_length / cs->mbmaxlen;
local_char_length= my_charpos(cs, blob1, blob1+blob_length,
@@ -7740,7 +7685,7 @@ void Field_blob::sort_string(uchar *to,uint length)
break;
}
}
- memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
+ memcpy(&blob, ptr+packlength, sizeof(char*));
blob_length=my_strnxfrm(field_charset,
to, length, blob, blob_length);
@@ -8709,7 +8654,7 @@ String *Field_bit::val_str(String *val_buffer,
mi_int8store(buff,bits);
val_buffer->alloc(length);
- memcpy_fixed((char*) val_buffer->ptr(), buff+8-length, length);
+ memcpy((char *) val_buffer->ptr(), buff+8-length, length);
val_buffer->length(length);
val_buffer->set_charset(&my_charset_bin);
return val_buffer;
diff --git a/sql/field.h b/sql/field.h
index 46d8a2aa6d9..7b250c34fe4 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -32,7 +32,6 @@
#include "sql_error.h" /* MYSQL_ERROR */
#define DATETIME_DEC 6
-const uint32 max_field_size= (uint32) 4294967295U;
class Send_field;
class Protocol;
@@ -1763,22 +1762,22 @@ public:
void put_length(uchar *pos, uint32 length);
inline void get_ptr(uchar **str)
{
- memcpy_fixed((uchar*) str,ptr+packlength,sizeof(uchar*));
+ memcpy(str, ptr+packlength, sizeof(uchar*));
}
inline void get_ptr(uchar **str, uint row_offset)
{
- memcpy_fixed((uchar*) str,ptr+packlength+row_offset,sizeof(char*));
+ memcpy(str, ptr+packlength+row_offset, sizeof(char*));
}
inline void set_ptr(uchar *length, uchar *data)
{
memcpy(ptr,length,packlength);
- memcpy_fixed(ptr+packlength,&data,sizeof(char*));
+ memcpy(ptr+packlength, &data,sizeof(char*));
}
void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length, uchar *data)
{
uchar *ptr_ofs= ADD_TO_PTR(ptr,ptr_diff,uchar*);
store_length(ptr_ofs, packlength, length);
- memcpy_fixed(ptr_ofs+packlength,&data,sizeof(char*));
+ memcpy(ptr_ofs+packlength, &data, sizeof(char*));
}
inline void set_ptr(uint32 length, uchar *data)
{
@@ -1797,7 +1796,7 @@ public:
return 1;
}
tmp=(uchar*) value.ptr();
- memcpy_fixed(ptr+packlength,&tmp,sizeof(char*));
+ memcpy(ptr+packlength, &tmp, sizeof(char*));
return 0;
}
virtual uchar *pack(uchar *to, const uchar *from,
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 299865e6114..ea6ff82e0aa 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -286,7 +286,7 @@ static void do_copy_blob(Copy_field *copy)
{
ulong length=((Field_blob*) copy->from_field)->get_length();
((Field_blob*) copy->to_field)->store_length(length);
- memcpy_fixed(copy->to_ptr,copy->from_ptr,sizeof(char*));
+ memcpy(copy->to_ptr, copy->from_ptr, sizeof(char*));
}
static void do_conv_blob(Copy_field *copy)
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 2398785a038..419f18263cc 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -511,6 +511,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
volatile THD::killed_state *killed= &thd->killed;
handler *file;
MY_BITMAP *save_read_set, *save_write_set;
+ bool skip_record;
DBUG_ENTER("find_all_keys");
DBUG_PRINT("info",("using: %s",
(select ? select->quick ? "ranges" : "where":
@@ -603,7 +604,8 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
}
if (error == 0)
param->examined_rows++;
- if (error == 0 && (!select || select->skip_record() == 0))
+ if (!error && (!select ||
+ (!select->skip_record(thd, &skip_record) && !skip_record)))
{
if (idx == param->keys)
{
@@ -1663,7 +1665,7 @@ void change_double_for_sort(double nr,uchar *to)
else
{
#ifdef WORDS_BIGENDIAN
- memcpy_fixed(tmp,&nr,sizeof(nr));
+ memcpy(tmp, &nr, sizeof(nr));
#else
{
uchar *ptr= (uchar*) &nr;
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index 5a0904f87b9..a9c03f7e2a7 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -77,33 +77,12 @@ So, we can read full search-structure as 32-bit word
*/
#define NO_YACC_SYMBOLS
-#include "my_global.h"
-#include "my_sys.h"
-#include "m_string.h"
-#ifndef __GNU_LIBRARY__
-#define __GNU_LIBRARY__ // Skip warnings in getopt.h
-#endif
-#include <my_getopt.h>
+#include <my_global.h>
#include "mysql_version.h"
#include "lex.h"
-
-const char *default_dbug_option="d:t:o,/tmp/gen_lex_hash.trace";
-
-struct my_option my_long_options[] =
-{
-#ifdef DBUG_OFF
- {"debug", '#', "This is a non-debug version. Catch this and exit",
- 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
-#else
- {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
- (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
-#endif
- {"help", '?', "Display help and exit",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"version", 'V', "Output version information and exit",
- 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}
-};
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
struct hash_lex_struct
{
@@ -340,57 +319,6 @@ void print_find_structs()
}
-static void usage(int version)
-{
- printf("%s Ver 3.6 Distrib %s, for %s (%s)\n",
- my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
- if (version)
- return;
- puts("Copyright (C) 2001 MySQL AB, by VVA and Monty");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
-and you are welcome to modify and redistribute it under the GPL license\n");
- puts("This program generates a perfect hashing function for the sql_lex.cc");
- printf("Usage: %s [OPTIONS]\n\n", my_progname);
- my_print_help(my_long_options);
-}
-
-
-extern "C" my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
-{
- switch(optid) {
- case 'V':
- usage(1);
- exit(0);
- case 'I':
- case '?':
- usage(0);
- exit(0);
- case '#':
- DBUG_PUSH(argument ? argument : default_dbug_option);
- break;
- }
- return 0;
-}
-
-
-static int 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 (argc >= 1)
- {
- usage(0);
- exit(1);
- }
- return(0);
-}
-
-
int check_dup_symbols(SYMBOL *s1, SYMBOL *s2)
{
if (s1->length!=s2->length || strncmp(s1->name,s2->name,s1->length))
@@ -441,11 +369,7 @@ int check_duplicates()
int main(int argc,char **argv)
{
- MY_INIT(argv[0]);
- DBUG_PROCESS(argv[0]);
- if (get_options(argc,(char **) argv))
- exit(1);
/* Broken up to indicate that it's not advice to you, gentle reader. */
printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n");
@@ -562,7 +486,6 @@ static SYMBOL *get_hash_symbol(const char *s,\n\
}\n\
}\n"
);
- my_end(0);
exit(0);
}
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index bd3cd780bc5..7891f658f45 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -64,10 +64,6 @@
#include "debug_sync.h"
static const char *ha_par_ext= ".par";
-#ifdef NOT_USED
-static int free_share(PARTITION_SHARE * share);
-static PARTITION_SHARE *get_share(const char *table_name, TABLE * table);
-#endif
/****************************************************************************
MODULE create/delete handler object
@@ -1129,13 +1125,6 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
part= i * num_subparts + j;
DBUG_PRINT("info", ("Optimize subpartition %u (%s)",
part, sub_elem->partition_name));
-#ifdef NOT_USED
- if (print_admin_msg(thd, "note", table_share->db.str, table->alias,
- opt_op_name[flag],
- "Start to operate on subpartition %s",
- sub_elem->partition_name))
- DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR);
-#endif
if ((error= handle_opt_part(thd, check_opt, m_file[part], flag)))
{
/* print a line which partition the error belongs to */
@@ -1162,13 +1151,6 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
{
DBUG_PRINT("info", ("Optimize partition %u (%s)", i,
part_elem->partition_name));
-#ifdef NOT_USED
- if (print_admin_msg(thd, "note", table_share->db.str, table->alias,
- opt_op_name[flag],
- "Start to operate on partition %s",
- part_elem->partition_name))
- DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR);
-#endif
if ((error= handle_opt_part(thd, check_opt, m_file[i], flag)))
{
/* print a line which partition the error belongs to */
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index cdbfb2163c7..cfab2dde394 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -143,9 +143,6 @@ private:
Variables for lock structures.
*/
THR_LOCK_DATA lock; /* MySQL lock */
-#ifdef NOT_USED
- PARTITION_SHARE *share; /* Shared lock info */
-#endif
/*
TRUE <=> this object was created with ha_partition::clone and doesn't
diff --git a/sql/handler.cc b/sql/handler.cc
index e67f5d6862c..9893b3cac16 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -190,15 +190,6 @@ plugin_ref ha_lock_engine(THD *thd, const handlerton *hton)
}
-#ifdef NOT_USED
-static handler *create_default(TABLE_SHARE *table, MEM_ROOT *mem_root)
-{
- handlerton *hton= ha_default_handlerton(current_thd);
- return (hton && hton->create) ? hton->create(hton, table, mem_root) : NULL;
-}
-#endif
-
-
handlerton *ha_resolve_by_legacy_type(THD *thd, enum legacy_db_type db_type)
{
plugin_ref plugin;
@@ -239,10 +230,6 @@ handlerton *ha_checktype(THD *thd, enum legacy_db_type database_type,
RUN_HOOK(transaction, after_rollback, (thd, FALSE));
switch (database_type) {
-#ifndef NO_HASH
- case DB_TYPE_HASH:
- return ha_resolve_by_legacy_type(thd, DB_TYPE_HASH);
-#endif
case DB_TYPE_MRG_ISAM:
return ha_resolve_by_legacy_type(thd, DB_TYPE_MRG_MYISAM);
default:
diff --git a/sql/handler.h b/sql/handler.h
index 9f262542a4f..cad97c1f751 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -33,10 +33,6 @@
#include <ft_global.h>
#include <keycache.h>
-#ifndef NO_HASH
-#define NO_HASH /* Not yet implemented */
-#endif
-
// the following is for checking tables
#define HA_ADMIN_ALREADY_DONE 1
diff --git a/sql/hostname.cc b/sql/hostname.cc
index d309efc4196..5311d9ada73 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -126,7 +126,7 @@ static void prepare_hostname_cache_key(const char *ip_string,
DBUG_ASSERT(ip_string_length < HOST_ENTRY_KEY_SIZE);
memset(ip_key, 0, HOST_ENTRY_KEY_SIZE);
- memcpy_fixed(ip_key, ip_string, ip_string_length);
+ memcpy(ip_key, ip_string, ip_string_length);
}
static inline Host_entry *hostname_cache_search(const char *ip_key)
@@ -148,7 +148,7 @@ static bool add_hostname_impl(const char *ip_key, const char *hostname)
char *hostname_copy;
- memcpy_fixed(&entry->ip_key, ip_key, HOST_ENTRY_KEY_SIZE);
+ memcpy(&entry->ip_key, ip_key, HOST_ENTRY_KEY_SIZE);
if (hostname_size)
{
diff --git a/sql/item.cc b/sql/item.cc
index 13b4aa96c76..92cf2df8a4c 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -4914,11 +4914,8 @@ Item *Item_field::equal_fields_propagator(uchar *arg)
e.g. <bin_col> = <int_col> AND <bin_col> = <hex_string>) since
Items don't know the context they are in and there are functions like
IF (<hex_string>, 'yes', 'no').
- The same problem occurs when comparing a DATE/TIME field with a
- DATE/TIME represented as an int and as a string.
*/
- if (!item ||
- (cmp_context != (Item_result)-1 && item->cmp_context != cmp_context))
+ if (!item || !has_compatible_context(item))
item= this;
else if (field && (field->flags & ZEROFILL_FLAG) && IS_NUM(field->type()))
{
@@ -4982,8 +4979,7 @@ Item *Item_field::replace_equal_field(uchar *arg)
Item *const_item= item_equal->get_const();
if (const_item)
{
- if (cmp_context != (Item_result)-1 &&
- const_item->cmp_context != cmp_context)
+ if (!has_compatible_context(const_item))
return this;
return const_item;
}
@@ -5053,21 +5049,6 @@ enum_field_types Item::field_type() const
}
-bool Item::is_datetime()
-{
- switch (field_type())
- {
- case MYSQL_TYPE_DATE:
- case MYSQL_TYPE_DATETIME:
- case MYSQL_TYPE_TIMESTAMP:
- return TRUE;
- default:
- break;
- }
- return FALSE;
-}
-
-
String *Item::check_well_formed_result(String *str, bool send_error)
{
/* Check whether we got a well-formed string */
@@ -7468,6 +7449,8 @@ bool Item_cache_datetime::cache_value_int()
return FALSE;
value_cached= TRUE;
+ // Mark cached string value obsolete
+ str_value_cached= FALSE;
/* Assume here that the underlying item will do correct conversion.*/
int_value= example->val_int_result();
null_value= example->null_value;
@@ -7480,7 +7463,13 @@ bool Item_cache_datetime::cache_value()
{
if (!example)
return FALSE;
+
+ if (cmp_context == INT_RESULT)
+ return cache_value_int();
+
str_value_cached= TRUE;
+ // Mark cached int value obsolete
+ value_cached= FALSE;
/* Assume here that the underlying item will do correct conversion.*/
String *res= example->str_result(&str_value);
if (res && res != &str_value)
@@ -7504,8 +7493,47 @@ void Item_cache_datetime::store(Item *item, longlong val_arg)
String *Item_cache_datetime::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- if (!str_value_cached && !cache_value())
- return NULL;
+ if (!str_value_cached)
+ {
+ /*
+ When it's possible the Item_cache_datetime uses INT datetime
+ representation due to speed reasons. But still, it always has the STRING
+ result type and thus it can be asked to return a string value.
+ It is possible that at this time cached item doesn't contain correct
+ string value, thus we have to convert cached int value to string and
+ return it.
+ */
+ if (value_cached)
+ {
+ MYSQL_TIME ltime;
+ if (str_value.alloc(MAX_DATE_STRING_REP_LENGTH))
+ return NULL;
+ if (cached_field_type == MYSQL_TYPE_TIME)
+ {
+ ulonglong time= int_value;
+ DBUG_ASSERT(time < TIME_MAX_VALUE);
+ set_zero_time(&ltime, MYSQL_TIMESTAMP_TIME);
+ ltime.second= time % 100;
+ time/= 100;
+ ltime.minute= time % 100;
+ time/= 100;
+ ltime.hour= time % 100;
+ }
+ else
+ {
+ int was_cut;
+ longlong res;
+ res= number_to_datetime(val_int(), &ltime, TIME_FUZZY_DATE, &was_cut);
+ if (res == -1)
+ return NULL;
+ }
+ str_value.length(my_TIME_to_str(&ltime,
+ const_cast<char*>(str_value.ptr())));
+ str_value_cached= TRUE;
+ }
+ else if (!cache_value())
+ return NULL;
+ }
return &str_value;
}
diff --git a/sql/item.h b/sql/item.h
index 35a0e8373f2..c7a97ca716a 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1171,7 +1171,40 @@ public:
representation is more precise than the string one).
*/
virtual bool result_as_longlong() { return FALSE; }
- bool is_datetime();
+ inline bool is_datetime() const
+ {
+ switch (field_type())
+ {
+ case MYSQL_TYPE_DATE:
+ case MYSQL_TYPE_DATETIME:
+ case MYSQL_TYPE_TIMESTAMP:
+ return TRUE;
+ default:
+ break;
+ }
+ return FALSE;
+ }
+ /**
+ Check whether this and the given item has compatible comparison context.
+ Used by the equality propagation. See Item_field::equal_fields_propagator.
+
+ @return
+ TRUE if the context is the same or if fields could be
+ compared as DATETIME values by the Arg_comparator.
+ FALSE otherwise.
+ */
+ inline bool has_compatible_context(Item *item) const
+ {
+ /* Same context. */
+ if (cmp_context == (Item_result)-1 || item->cmp_context == cmp_context)
+ return TRUE;
+ /* DATETIME comparison context. */
+ if (is_datetime())
+ return item->is_datetime() || item->cmp_context == STRING_RESULT;
+ if (item->is_datetime())
+ return is_datetime() || cmp_context == STRING_RESULT;
+ return FALSE;
+ }
virtual Field::geometry_type get_geometry_type() const
{ return Field::GEOM_GEOMETRY; };
String *check_well_formed_result(String *str, bool send_error= 0);
@@ -3232,6 +3265,7 @@ public:
virtual bool cache_value()= 0;
bool basic_const_item() const
{ return test(example && example->basic_const_item());}
+ virtual void clear() { null_value= TRUE; value_cached= FALSE; }
};
@@ -3412,6 +3446,7 @@ public:
*/
bool cache_value_int();
bool cache_value();
+ void clear() { Item_cache::clear(); str_value_cached= FALSE; }
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index d31799d7e60..85565b735d4 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -876,8 +876,10 @@ get_time_value(THD *thd, Item ***item_arg, Item **cache_arg,
Do not cache GET_USER_VAR() function as its const_item() may return TRUE
for the current thread but it still may change during the execution.
*/
- if (item->const_item() && cache_arg && (item->type() != Item::FUNC_ITEM ||
- ((Item_func*)item)->functype() != Item_func::GUSERVAR_FUNC))
+ if (item->const_item() && cache_arg &&
+ item->type() != Item::CACHE_ITEM &&
+ (item->type() != Item::FUNC_ITEM ||
+ ((Item_func*)item)->functype() != Item_func::GUSERVAR_FUNC))
{
Item_cache_int *cache= new Item_cache_int();
/* Mark the cache as non-const to prevent re-caching. */
@@ -937,6 +939,7 @@ int Arg_comparator::set_cmp_func(Item_result_field *owner_arg,
get_value_a_func= &get_datetime_value;
get_value_b_func= &get_datetime_value;
cmp_collation.set(&my_charset_numeric);
+ set_cmp_context_for_datetime();
return 0;
}
else if (type == STRING_RESULT && (*a)->field_type() == MYSQL_TYPE_TIME &&
@@ -949,6 +952,7 @@ int Arg_comparator::set_cmp_func(Item_result_field *owner_arg,
func= &Arg_comparator::compare_datetime;
get_value_a_func= &get_time_value;
get_value_b_func= &get_time_value;
+ set_cmp_context_for_datetime();
return 0;
}
else if (type == STRING_RESULT &&
@@ -1005,6 +1009,7 @@ bool Arg_comparator::try_year_cmp_func(Item_result type)
is_nulls_eq= is_owner_equal_func();
func= &Arg_comparator::compare_datetime;
+ set_cmp_context_for_datetime();
return TRUE;
}
@@ -1058,6 +1063,7 @@ void Arg_comparator::set_datetime_cmp_func(Item_result_field *owner_arg,
func= &Arg_comparator::compare_datetime;
get_value_a_func= &get_datetime_value;
get_value_b_func= &get_datetime_value;
+ set_cmp_context_for_datetime();
}
@@ -1144,8 +1150,10 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
Do not cache GET_USER_VAR() function as its const_item() may return TRUE
for the current thread but it still may change during the execution.
*/
- if (item->const_item() && cache_arg && (item->type() != Item::FUNC_ITEM ||
- ((Item_func*)item)->functype() != Item_func::GUSERVAR_FUNC))
+ if (item->const_item() && cache_arg &&
+ item->type() != Item::CACHE_ITEM &&
+ (item->type() != Item::FUNC_ITEM ||
+ ((Item_func*)item)->functype() != Item_func::GUSERVAR_FUNC))
{
Item_cache_int *cache= new Item_cache_int(MYSQL_TYPE_DATETIME);
/* Mark the cache as non-const to prevent re-caching. */
@@ -4712,8 +4720,6 @@ void Item_func_like::cleanup()
Item_bool_func2::cleanup();
}
-#ifdef USE_REGEX
-
/**
@brief Compile regular expression.
@@ -4865,9 +4871,6 @@ void Item_func_regex::cleanup()
}
-#endif /* USE_REGEX */
-
-
#ifdef LIKE_CMP_TOUPPER
#define likeconv(cs,A) (uchar) (cs)->toupper(A)
#else
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 8813324262c..f9851011563 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -25,6 +25,7 @@
#include "thr_malloc.h" /* sql_calloc */
#include "item_func.h" /* Item_int_func, Item_bool_func */
+#include "my_regex.h"
extern Item_result item_cmp_type(Item_result a,Item_result b);
class Item_bool_func2;
@@ -123,7 +124,17 @@ public:
delete [] comparators;
comparators= 0;
}
-
+ /*
+ Set correct cmp_context if items would be compared as INTs.
+ */
+ inline void set_cmp_context_for_datetime()
+ {
+ DBUG_ASSERT(func == &Arg_comparator::compare_datetime);
+ if ((*a)->result_as_longlong())
+ (*a)->cmp_context= INT_RESULT;
+ if ((*b)->result_as_longlong())
+ (*b)->cmp_context= INT_RESULT;
+ }
friend class Item_func;
};
@@ -258,7 +269,7 @@ protected:
my_bool result_for_null_param;
public:
Item_in_optimizer(Item *a, Item_in_subselect *b):
- Item_bool_func(a, my_reinterpret_cast(Item *)(b)), cache(0),
+ Item_bool_func(a, reinterpret_cast<Item *>(b)), cache(0),
save_cache(0), result_for_null_param(UNKNOWN)
{}
bool fix_fields(THD *, Item **);
@@ -1424,9 +1435,6 @@ public:
void cleanup();
};
-#ifdef USE_REGEX
-
-#include "my_regex.h"
class Item_func_regex :public Item_bool_func
{
@@ -1455,23 +1463,6 @@ public:
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
};
-#else
-
-class Item_func_regex :public Item_bool_func
-{
-public:
- Item_func_regex(Item *a,Item *b) :Item_bool_func(a,b) {}
- longlong val_int() { return 0;}
- const char *func_name() const { return "regex"; }
-
- virtual inline void print(String *str, enum_query_type query_type)
- {
- print_op(str, query_type);
- }
-};
-
-#endif /* USE_REGEX */
-
typedef class Item COND;
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index e046087b16a..d734b55a970 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -49,7 +49,7 @@ void Item_geometry_func::fix_length_and_dec()
{
collation.set(&my_charset_bin);
decimals=0;
- max_length= max_field_size;
+ max_length= (uint32) 4294967295U;
maybe_null= 1;
}
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 34b09ca6fdc..d8d18fd8ef6 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -184,7 +184,7 @@ public:
void fix_length_and_dec();
uint cols();
- Item* element_index(uint i) { return my_reinterpret_cast(Item*)(row[i]); }
+ Item* element_index(uint i) { return reinterpret_cast<Item*>(row[i]); }
Item** addr(uint i) { return (Item**)row + i; }
bool check_cols(uint c);
bool null_inside();
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 77c45ea85f7..b05d845dead 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1214,8 +1214,7 @@ void Item_sum_hybrid::setup_hybrid(Item *item, Item *value_arg)
{
value= Item_cache::get_cache(item);
value->setup(item);
- if (value_arg)
- value->store(value_arg);
+ value->store(value_arg);
cmp= new Arg_comparator();
cmp->set_cmp_func(this, args, (Item**)&value, FALSE);
collation.set(item->collation);
@@ -1903,7 +1902,7 @@ void Item_sum_variance::update_field()
void Item_sum_hybrid::clear()
{
- value->null_value= 1;
+ value->clear();
null_value= 1;
}
diff --git a/sql/item_sum.h b/sql/item_sum.h
index b4539995632..2a722b93165 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -1010,6 +1010,11 @@ protected:
void no_rows_in_result();
Field *create_tmp_field(bool group, TABLE *table,
uint convert_blob_length);
+ /*
+ MIN/MAX uses Item_cache_datetime for storing DATETIME values, thus
+ in this case a correct INT value can be provided.
+ */
+ bool result_as_longlong() { return args[0]->result_as_longlong(); }
};
diff --git a/sql/log.h b/sql/log.h
index 4a58c3081d8..6e87b6cbade 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -637,7 +637,6 @@ enum enum_binlog_format {
BINLOG_FORMAT_ROW= 2, ///< row-based
BINLOG_FORMAT_UNSPEC=3 ///< thd_binlog_format() returns it when binlog is closed
};
-extern TYPELIB binlog_format_typelib;
int query_error_code(THD *thd, bool not_killed);
uint purge_log_get_error_code(int res);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 375c96bdec4..26026ba8ae0 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -294,12 +294,6 @@ arg_cmp_func Arg_comparator::comparator_matrix[5][2] =
{&Arg_comparator::compare_row, &Arg_comparator::compare_e_row},
{&Arg_comparator::compare_decimal, &Arg_comparator::compare_e_decimal}};
-const char *log_output_names[] = { "NONE", "FILE", "TABLE", NullS};
-static const unsigned int log_output_names_len[]= { 4, 4, 5, 0 };
-TYPELIB log_output_typelib= {array_elements(log_output_names)-1,"",
- log_output_names,
- (unsigned int *) log_output_names_len};
-
/* static variables */
#ifdef HAVE_PSI_INTERFACE
@@ -395,8 +389,8 @@ my_bool opt_skip_slave_start = 0; ///< If set, slave is not autostarted
my_bool opt_reckless_slave = 0;
my_bool opt_enable_named_pipe= 0;
my_bool opt_local_infile, opt_slave_compressed_protocol;
-my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
-my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
+my_bool opt_safe_user_create = 0;
+my_bool opt_show_slave_auth_info;
my_bool opt_log_slave_updates= 0;
char *opt_slave_skip_errors;
@@ -440,9 +434,6 @@ my_bool sp_automatic_privileges= 1;
ulong opt_binlog_rows_event_max_size;
const char *binlog_format_names[]= {"MIXED", "STATEMENT", "ROW", NullS};
-TYPELIB binlog_format_typelib=
- { array_elements(binlog_format_names) - 1, "",
- binlog_format_names, NULL };
#ifdef HAVE_INITGROUPS
static bool calling_initgroups= FALSE; /**< Used in SIGSEGV handler. */
#endif
@@ -458,7 +449,7 @@ ulong thread_created;
ulong back_log, connect_timeout, concurrency, server_id;
ulong table_cache_size, table_def_size;
ulong what_to_log;
-ulong query_buff_size, slow_launch_time, slave_open_temp_tables;
+ulong slow_launch_time, slave_open_temp_tables;
ulong open_files_limit, max_binlog_size, max_relay_log_size;
ulong slave_trans_retries;
uint slave_net_timeout;
@@ -547,7 +538,6 @@ char mysql_real_data_home[FN_REFLEN],
mysql_charsets_dir[FN_REFLEN],
*opt_init_file, *opt_tc_log_file;
char *lc_messages_dir_ptr, *log_error_file_ptr;
-char err_shared_dir[FN_REFLEN];
char mysql_unpacked_real_data_home[FN_REFLEN];
int mysql_unpacked_real_data_home_len;
uint mysql_real_data_home_len, mysql_data_home_len= 1;
@@ -581,7 +571,6 @@ Le_creator le_creator;
MYSQL_FILE *bootstrap_file;
int bootstrap_error;
-FILE *stderror_file=0;
I_List<THD> threads;
Rpl_filter* rpl_filter;
@@ -613,7 +602,7 @@ pthread_key(MEM_ROOT**,THR_MALLOC);
pthread_key(THD*, THR_THD);
mysql_mutex_t LOCK_thread_count;
mysql_mutex_t LOCK_open,
- LOCK_mapped_file, LOCK_status, LOCK_global_read_lock,
+ LOCK_status, LOCK_global_read_lock,
LOCK_error_log, LOCK_uuid_generator,
LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create,
LOCK_crypt,
@@ -1476,9 +1465,7 @@ void clean_up(bool print_message)
delete rpl_filter;
end_ssl();
vio_end();
-#ifdef USE_REGEX
my_regex_end();
-#endif
#if defined(ENABLED_DEBUG_SYNC)
/* End the debug sync facility. See debug_sync.cc. */
debug_sync_end();
@@ -1541,7 +1528,6 @@ static void clean_up_mutexes()
mysql_rwlock_destroy(&LOCK_grant);
mysql_mutex_destroy(&LOCK_open);
mysql_mutex_destroy(&LOCK_thread_count);
- mysql_mutex_destroy(&LOCK_mapped_file);
mysql_mutex_destroy(&LOCK_status);
mysql_mutex_destroy(&LOCK_delayed_insert);
mysql_mutex_destroy(&LOCK_delayed_status);
@@ -1942,7 +1928,7 @@ static void network_init(void)
(void) setsockopt(unix_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,
sizeof(arg));
umask(0);
- if (bind(unix_sock, my_reinterpret_cast(struct sockaddr *) (&UNIXaddr),
+ if (bind(unix_sock, reinterpret_cast<struct sockaddr *>(&UNIXaddr),
sizeof(UNIXaddr)) < 0)
{
sql_perror("Can't start server : Bind on unix socket"); /* purecov: tested */
@@ -3353,9 +3339,7 @@ static int init_common_variables()
if (item_create_init())
return 1;
item_init();
-#ifdef USE_REGEX
my_regex_init(&my_charset_latin1);
-#endif
/*
Process a comma-separated character set list and choose
the first available character set. This is mostly for
@@ -3518,7 +3502,6 @@ static int init_thread_environment()
{
mysql_mutex_init(key_LOCK_open, &LOCK_open, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_LOCK_thread_count, &LOCK_thread_count, MY_MUTEX_INIT_FAST);
- mysql_mutex_init(key_LOCK_mapped_file, &LOCK_mapped_file, MY_MUTEX_INIT_SLOW);
mysql_mutex_init(key_LOCK_status, &LOCK_status, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_LOCK_delayed_insert,
&LOCK_delayed_insert, MY_MUTEX_INIT_FAST);
@@ -7697,7 +7680,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_LOCK_connection_count, key_LOCK_crypt, key_LOCK_delayed_create,
key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log,
key_LOCK_gdl, key_LOCK_global_read_lock, key_LOCK_global_system_variables,
- key_LOCK_manager, key_LOCK_mapped_file,
+ key_LOCK_manager,
key_LOCK_open, key_LOCK_prepared_stmt_count,
key_LOCK_rpl_status, key_LOCK_server_started, key_LOCK_status,
key_LOCK_system_variables_hash, key_LOCK_table_share, key_LOCK_thd_data,
@@ -7737,7 +7720,6 @@ static PSI_mutex_info all_server_mutexes[]=
{ &key_LOCK_global_read_lock, "LOCK_global_read_lock", PSI_FLAG_GLOBAL},
{ &key_LOCK_global_system_variables, "LOCK_global_system_variables", PSI_FLAG_GLOBAL},
{ &key_LOCK_manager, "LOCK_manager", PSI_FLAG_GLOBAL},
- { &key_LOCK_mapped_file, "LOCK_mapped_file", PSI_FLAG_GLOBAL},
{ &key_LOCK_open, "LOCK_open", PSI_FLAG_GLOBAL},
{ &key_LOCK_prepared_stmt_count, "LOCK_prepared_stmt_count", PSI_FLAG_GLOBAL},
{ &key_LOCK_rpl_status, "LOCK_rpl_status", PSI_FLAG_GLOBAL},
diff --git a/sql/mysqld.h b/sql/mysqld.h
index b07d148f507..22e757e6e8a 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -78,9 +78,6 @@ extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *files_charset_info ;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *national_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *table_alias_charset;
-extern TYPELIB log_output_typelib;
-extern const char *log_output_names[];
-
/**
Character set of the buildin error messages loaded from errmsg.sys.
*/
@@ -105,7 +102,7 @@ extern bool volatile abort_loop;
extern bool in_bootstrap;
extern uint volatile thread_count, global_read_lock;
extern uint connection_count;
-extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
+extern my_bool opt_safe_user_create;
extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern uint slave_exec_mode_options;
@@ -173,7 +170,6 @@ extern ulong slave_trans_retries;
extern uint slave_net_timeout;
extern uint max_user_connections;
extern ulong what_to_log,flush_time;
-extern ulong query_buff_size;
extern ulong max_prepared_stmt_count, prepared_stmt_count;
extern ulong binlog_cache_size, open_files_limit;
extern ulonglong max_binlog_cache_size;
@@ -210,9 +206,7 @@ extern MYSQL_FILE *bootstrap_file;
extern my_bool old_mode;
extern LEX_STRING opt_init_connect, opt_init_slave;
extern int bootstrap_error;
-extern FILE *stderror_file;
extern I_List<THD> threads;
-extern char err_shared_dir[];
extern scheduler_functions thread_scheduler;
extern TYPELIB thread_handling_typelib;
extern my_decimal decimal_zero;
@@ -234,7 +228,7 @@ extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_LOCK_connection_count, key_LOCK_crypt, key_LOCK_delayed_create,
key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log,
key_LOCK_gdl, key_LOCK_global_read_lock, key_LOCK_global_system_variables,
- key_LOCK_logger, key_LOCK_manager, key_LOCK_mapped_file,
+ key_LOCK_logger, key_LOCK_manager,
key_LOCK_open, key_LOCK_prepared_stmt_count,
key_LOCK_rpl_status, key_LOCK_server_started, key_LOCK_status,
key_LOCK_table_share, key_LOCK_thd_data,
@@ -313,7 +307,6 @@ extern MYSQL_PLUGIN_IMPORT char mysql_real_data_home[];
extern char mysql_unpacked_real_data_home[];
extern MYSQL_PLUGIN_IMPORT struct system_variables global_system_variables;
extern char default_logfile_name[FN_REFLEN];
-extern char err_shared_dir[];
#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
@@ -324,7 +317,7 @@ extern MYSQL_PLUGIN_IMPORT key_map key_map_full; /* Should be threaded
Server mutex locks and condition variables.
*/
extern mysql_mutex_t LOCK_open,
- LOCK_mapped_file, LOCK_user_locks, LOCK_status,
+ LOCK_user_locks, LOCK_status,
LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator,
LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock,
diff --git a/sql/nt_servc.cc b/sql/nt_servc.cc
index 76dc2846ed0..1f1b7f0c20f 100644
--- a/sql/nt_servc.cc
+++ b/sql/nt_servc.cc
@@ -375,29 +375,6 @@ void NTService::ServiceCtrlHandler(DWORD ctrlCode)
dwState=pService->dwState; // get current state
switch(ctrlCode) {
-
-#ifdef NOT_USED /* do we need this ? */
- case SERVICE_CONTROL_PAUSE:
- if (pService->bRunning && ! pService->bPause)
- {
- dwState = SERVICE_PAUSED;
- pService->SetStatus(SERVICE_PAUSE_PENDING,NO_ERROR, 0, 1,
- pService->nPauseTimeOut);
- pService->PauseService();
- }
- break;
-
- case SERVICE_CONTROL_CONTINUE:
- if (pService->bRunning && pService->bPause)
- {
- dwState = SERVICE_RUNNING;
- pService->SetStatus(SERVICE_CONTINUE_PENDING,NO_ERROR, 0, 1,
- pService->nResumeTimeOut);
- pService->ResumeService();
- }
- break;
-#endif
-
case SERVICE_CONTROL_SHUTDOWN:
case SERVICE_CONTROL_STOP:
dwState = SERVICE_STOP_PENDING;
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 0d4000002b0..33b3d561ad8 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -825,7 +825,11 @@ class SQL_SELECT :public Sql_alloc {
tmp.set_all();
return test_quick_select(thd, tmp, 0, limit, force_quick_range) < 0;
}
- inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; }
+ inline bool skip_record(THD *thd, bool *skip_record)
+ {
+ *skip_record= cond ? cond->val_int() == FALSE : FALSE;
+ return thd->is_error();
+ }
int test_quick_select(THD *thd, key_map keys, table_map prev_tables,
ha_rows limit, bool force_quick_range);
};
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 3f957dcc2de..87a54eaf10d 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -790,31 +790,14 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
local_packet->realloc(local_packet->length()+10))
goto err;
pos= (char*) local_packet->ptr()+local_packet->length();
-
-#ifdef TO_BE_DELETED_IN_6
- if (!(thd->client_capabilities & CLIENT_LONG_FLAG))
- {
- pos[0]=3;
- int3store(pos+1,field.length);
- pos[4]=1;
- pos[5]=field.type;
- pos[6]=2;
- pos[7]= (char) field.flags;
- pos[8]= (char) field.decimals;
- pos+= 9;
- }
- else
-#endif
- {
- pos[0]=3;
- int3store(pos+1,field.length);
- pos[4]=1;
- pos[5]=field.type;
- pos[6]=3;
- int2store(pos+7,field.flags);
- pos[9]= (char) field.decimals;
- pos+= 10;
- }
+ pos[0]=3;
+ int3store(pos+1,field.length);
+ pos[4]=1;
+ pos[5]=field.type;
+ pos[6]=3;
+ int2store(pos+7,field.flags);
+ pos[9]= (char) field.decimals;
+ pos+= 10;
}
local_packet->length((uint) (pos - local_packet->ptr()));
if (flags & SEND_DEFAULTS)
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 9a1f7fb826b..47eb2f7031d 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -55,9 +55,6 @@ const char* rpl_status_type[]=
"AUTH_MASTER","IDLE_SLAVE","ACTIVE_SLAVE","LOST_SOLDIER","TROOP_SOLDIER",
"RECOVERY_CAPTAIN","NULL",NullS
};
-TYPELIB rpl_status_typelib= {array_elements(rpl_status_type)-1,"",
- rpl_status_type, NULL};
-
static Slave_log_event* find_slave_event(IO_CACHE* log,
const char* log_file_name,
@@ -71,42 +68,6 @@ static Slave_log_event* find_slave_event(IO_CACHE* log,
functions like register_slave()) are working.
*/
-#if NOT_USED
-static int init_failsafe_rpl_thread(THD* thd)
-{
- DBUG_ENTER("init_failsafe_rpl_thread");
- thd->system_thread = SYSTEM_THREAD_DELAYED_INSERT;
- /*
- thd->bootstrap is to report errors barely to stderr; if this code is
- enable again one day, one should check if bootstrap is still needed (maybe
- this thread has no other error reporting method).
- */
- thd->bootstrap = 1;
- thd->security_ctx->skip_grants();
- my_net_init(&thd->net, 0);
- thd->net.read_timeout = slave_net_timeout;
- thd->max_client_packet_length=thd->net.max_packet;
- mysql_mutex_lock(&LOCK_thread_count);
- thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
- mysql_mutex_unlock(&LOCK_thread_count);
-
- if (init_thr_lock() || thd->store_globals())
- {
- /* purecov: begin inspected */
- close_connection(thd, ER_OUT_OF_RESOURCES, 1); // is this needed?
- statistic_increment(aborted_connects,&LOCK_status);
- one_thread_per_connection_end(thd,0);
- DBUG_RETURN(-1);
- /* purecov: end */
- }
-
- thd->mem_root->free= thd->mem_root->used= 0;
- thd_proc_info(thd, "Thread initialized");
- thd->set_time();
- DBUG_RETURN(0);
-}
-#endif
-
void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
{
mysql_mutex_lock(&LOCK_rpl_status);
@@ -623,66 +584,6 @@ err:
}
-#if NOT_USED
-int find_recovery_captain(THD* thd, MYSQL* mysql)
-{
- return 0;
-}
-#endif
-
-#if NOT_USED
-pthread_handler_t handle_failsafe_rpl(void *arg)
-{
- DBUG_ENTER("handle_failsafe_rpl");
- THD *thd = new THD;
- thd->thread_stack = (char*)&thd;
- MYSQL* recovery_captain = 0;
- const char* msg;
-
- pthread_detach_this_thread();
- if (init_failsafe_rpl_thread(thd) || !(recovery_captain=mysql_init(0)))
- {
- sql_print_error("Could not initialize failsafe replication thread");
- goto err;
- }
- mysql_mutex_lock(&LOCK_rpl_status);
- msg= thd->enter_cond(&COND_rpl_status,
- &LOCK_rpl_status, "Waiting for request");
- while (!thd->killed && !abort_loop)
- {
- bool break_req_chain = 0;
- mysql_cond_wait(&COND_rpl_status, &LOCK_rpl_status);
- thd_proc_info(thd, "Processing request");
- while (!break_req_chain)
- {
- switch (rpl_status) {
- case RPL_LOST_SOLDIER:
- if (find_recovery_captain(thd, recovery_captain))
- rpl_status=RPL_TROOP_SOLDIER;
- else
- rpl_status=RPL_RECOVERY_CAPTAIN;
- break_req_chain=1; /* for now until other states are implemented */
- break;
- default:
- break_req_chain=1;
- break;
- }
- }
- }
- thd->exit_cond(msg);
-err:
- if (recovery_captain)
- mysql_close(recovery_captain);
- delete thd;
-
- DBUG_LEAVE; // Must match DBUG_ENTER()
- my_thread_end();
- pthread_exit(0);
- return 0; // Avoid compiler warnings
-}
-#endif
-
-
/**
Execute a SHOW SLAVE HOSTS statement.
diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h
index 94b151aaee7..c6d00de47cb 100644
--- a/sql/repl_failsafe.h
+++ b/sql/repl_failsafe.h
@@ -30,7 +30,7 @@ extern RPL_STATUS rpl_status;
extern mysql_mutex_t LOCK_rpl_status;
extern mysql_cond_t COND_rpl_status;
-extern TYPELIB rpl_role_typelib, rpl_status_typelib;
+extern TYPELIB rpl_role_typelib;
extern const char* rpl_role_type[], *rpl_status_type[];
pthread_handler_t handle_failsafe_rpl(void *arg);
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index ced5c0943dd..8219f70727e 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.cc
@@ -238,7 +238,8 @@ unpack_row(Relay_log_info const *rli,
conv_field ? conv_field : *field_ptr;
DBUG_PRINT("debug", ("Conversion %srequired for field '%s' (#%ld)",
conv_field ? "" : "not ",
- (*field_ptr)->field_name, field_ptr - begin_ptr));
+ (*field_ptr)->field_name,
+ (long) (field_ptr - begin_ptr)));
DBUG_ASSERT(f != NULL);
/*
diff --git a/sql/set_var.h b/sql/set_var.h
index 1b415567659..5f1f889c4ce 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -169,7 +169,6 @@ protected:
{ return ((uchar*)&global_system_variables) + offset; }
};
-#include "log.h" /* binlog_format_typelib */
#include "sql_plugin.h" /* SHOW_HA_ROWS, SHOW_MY_BOOL */
/****************************************************************************
diff --git a/sql/slave.cc b/sql/slave.cc
index a6199854e48..7cf5ea9ab9f 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -83,7 +83,6 @@ ulonglong relay_log_space_limit = 0;
*/
int disconnect_slave_event_count = 0, abort_slave_event_count = 0;
-int events_till_abort = -1;
static pthread_key(Master_info*, RPL_MASTER_INFO);
@@ -798,17 +797,6 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
}
-#ifdef NOT_USED_YET
-static int end_slave_on_walk(Master_info* mi, uchar* /*unused*/)
-{
- DBUG_ENTER("end_slave_on_walk");
-
- end_master_info(mi);
- DBUG_RETURN(0);
-}
-#endif
-
-
/*
Release slave threads at time of executing shutdown.
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 9d48c1282d5..1ff2ba59093 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -4159,71 +4159,6 @@ THD::binlog_prepare_pending_rows_event(TABLE*, uint32, MY_BITMAP const*,
Update_rows_log_event *);
#endif
-#ifdef NOT_USED
-static char const*
-field_type_name(enum_field_types type)
-{
- switch (type) {
- case MYSQL_TYPE_DECIMAL:
- return "MYSQL_TYPE_DECIMAL";
- case MYSQL_TYPE_TINY:
- return "MYSQL_TYPE_TINY";
- case MYSQL_TYPE_SHORT:
- return "MYSQL_TYPE_SHORT";
- case MYSQL_TYPE_LONG:
- return "MYSQL_TYPE_LONG";
- case MYSQL_TYPE_FLOAT:
- return "MYSQL_TYPE_FLOAT";
- case MYSQL_TYPE_DOUBLE:
- return "MYSQL_TYPE_DOUBLE";
- case MYSQL_TYPE_NULL:
- return "MYSQL_TYPE_NULL";
- case MYSQL_TYPE_TIMESTAMP:
- return "MYSQL_TYPE_TIMESTAMP";
- case MYSQL_TYPE_LONGLONG:
- return "MYSQL_TYPE_LONGLONG";
- case MYSQL_TYPE_INT24:
- return "MYSQL_TYPE_INT24";
- case MYSQL_TYPE_DATE:
- return "MYSQL_TYPE_DATE";
- case MYSQL_TYPE_TIME:
- return "MYSQL_TYPE_TIME";
- case MYSQL_TYPE_DATETIME:
- return "MYSQL_TYPE_DATETIME";
- case MYSQL_TYPE_YEAR:
- return "MYSQL_TYPE_YEAR";
- case MYSQL_TYPE_NEWDATE:
- return "MYSQL_TYPE_NEWDATE";
- case MYSQL_TYPE_VARCHAR:
- return "MYSQL_TYPE_VARCHAR";
- case MYSQL_TYPE_BIT:
- return "MYSQL_TYPE_BIT";
- case MYSQL_TYPE_NEWDECIMAL:
- return "MYSQL_TYPE_NEWDECIMAL";
- case MYSQL_TYPE_ENUM:
- return "MYSQL_TYPE_ENUM";
- case MYSQL_TYPE_SET:
- return "MYSQL_TYPE_SET";
- case MYSQL_TYPE_TINY_BLOB:
- return "MYSQL_TYPE_TINY_BLOB";
- case MYSQL_TYPE_MEDIUM_BLOB:
- return "MYSQL_TYPE_MEDIUM_BLOB";
- case MYSQL_TYPE_LONG_BLOB:
- return "MYSQL_TYPE_LONG_BLOB";
- case MYSQL_TYPE_BLOB:
- return "MYSQL_TYPE_BLOB";
- case MYSQL_TYPE_VAR_STRING:
- return "MYSQL_TYPE_VAR_STRING";
- case MYSQL_TYPE_STRING:
- return "MYSQL_TYPE_STRING";
- case MYSQL_TYPE_GEOMETRY:
- return "MYSQL_TYPE_GEOMETRY";
- }
- return "Unknown";
-}
-#endif
-
-
/* Declare in unnamed namespace. */
CPP_UNNAMED_NS_START
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index c94ea1302c8..00666bc85b4 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -59,6 +59,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
bool const_cond_result;
ha_rows deleted= 0;
bool reverse= FALSE;
+ bool skip_record;
ORDER *order= (ORDER *) ((order_list && order_list->elements) ?
order_list->first : NULL);
uint usable_index= MAX_KEY;
@@ -298,7 +299,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
{
thd->examined_row_count++;
// thd->is_error() is tested to disallow delete row on error
- if (!(select && select->skip_record())&& ! thd->is_error() )
+ if (!select || (!select->skip_record(thd, &skip_record) && !skip_record))
{
if (table->triggers &&
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index cc6529f7b10..e5d0f79b2d7 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -588,16 +588,11 @@ void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
DBUG_PRINT("enter", ("code: %d, msg: %s", code, msg));
/*
- Calling push_warning/push_warning_printf with a
- level of WARN_LEVEL_ERROR *is* a bug.
- Either use my_error(), or WARN_LEVEL_WARN.
- Please fix the calling code, and do *NOT*
- add more work around code in the assert below.
+ Calling push_warning/push_warning_printf with a level of
+ WARN_LEVEL_ERROR *is* a bug. Either use my_printf_error(),
+ my_error(), or WARN_LEVEL_WARN.
*/
- DBUG_ASSERT( (level != MYSQL_ERROR::WARN_LEVEL_ERROR)
- || (code == ER_CANT_CREATE_TABLE) /* See Bug#47233 */
- || (code == ER_ILLEGAL_HA_CREATE_OPTION) /* See Bug#47233 */
- );
+ DBUG_ASSERT(level != MYSQL_ERROR::WARN_LEVEL_ERROR);
if (level == MYSQL_ERROR::WARN_LEVEL_ERROR)
level= MYSQL_ERROR::WARN_LEVEL_WARN;
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index eef139d5698..4ddc108770b 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -41,7 +41,6 @@ sys_var *trg_new_row_fake_var= (sys_var*) 0x01;
LEX_STRING constant for null-string to be used in parser and other places.
*/
const LEX_STRING null_lex_str= {NULL, 0};
-const LEX_STRING empty_lex_str= { (char*) "", 0 };
/**
@note The order of the elements of this array must correspond to
the order of elements in enum_binlog_stmt_unsafe.
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index b8bf3b220c9..784a69cf9c1 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -589,11 +589,11 @@ public:
st_select_lex* outer_select();
st_select_lex* first_select()
{
- return my_reinterpret_cast(st_select_lex*)(slave);
+ return reinterpret_cast<st_select_lex*>(slave);
}
st_select_lex_unit* next_unit()
{
- return my_reinterpret_cast(st_select_lex_unit*)(next);
+ return reinterpret_cast<st_select_lex_unit*>(next);
}
st_select_lex* return_after_parsing() { return return_to; }
void exclude_level();
@@ -995,8 +995,6 @@ enum xa_option_words {XA_NONE, XA_JOIN, XA_RESUME, XA_ONE_PHASE,
XA_SUSPEND, XA_FOR_MIGRATE};
extern const LEX_STRING null_lex_str;
-extern const LEX_STRING empty_lex_str;
-
class Sroutine_hash_entry;
diff --git a/sql/sql_map.cc b/sql/sql_map.cc
deleted file mode 100644
index ca8a88bcbf8..00000000000
--- a/sql/sql_map.cc
+++ /dev/null
@@ -1,144 +0,0 @@
-/* Copyright (C) 2000-2001, 2004-2005 MySQL AB, 2008-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 USE_PRAGMA_IMPLEMENTATION
-#pragma implementation // gcc: Class implementation
-#endif
-
-#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
-#include "sql_map.h" // mapped_files
-#include "sql_class.h" // THD
-
-#include <sys/stat.h>
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
-mapped_files::mapped_files(const char * filename,uchar *magic,uint magic_length)
-{
-#ifdef HAVE_MMAP
- name=my_strdup(filename,MYF(0));
- use_count=1;
- error=0;
- map=0;
- size=0;
- if ((file= mysql_file_open(key_file_map, name, O_RDONLY, MYF(MY_WME))) >= 0)
- {
- struct stat stat_buf;
- if (!fstat(file, &stat_buf))
- {
- if (!(map=(uchar*) my_mmap(0,(size_t)(size= stat_buf.st_size),PROT_READ,
- MAP_SHARED | MAP_NORESERVE,file,
- 0L)))
- {
- error=errno;
- my_error(ER_NO_FILE_MAPPING, MYF(0), (char *) name, error);
- }
- }
- if (map && memcmp(map,magic,magic_length))
- {
- my_error(ER_WRONG_MAGIC, MYF(0), name);
- (void) my_munmap((char*) map,(size_t)size);
- map=0;
- }
- if (!map)
- {
- (void) mysql_file_close(file, MYF(0));
- file= -1;
- }
- }
-#endif
-}
-
-
-mapped_files::~mapped_files()
-{
-#ifdef HAVE_MMAP
- if (file >= 0)
- {
- (void) my_munmap((char*) map,(size_t)size);
- (void) mysql_file_close(file, MYF(0));
- file= -1; map=0;
- }
- my_free(name);
-#endif
-}
-
-
-static I_List<mapped_files> maps_in_use;
-
-/*
-** Check if a file is mapped. If it is, then return pointer to old map,
-** else alloc new object
-*/
-
-mapped_files *map_file(const char * name,uchar *magic,uint magic_length)
-{
-#ifdef HAVE_MMAP
- mysql_mutex_lock(&LOCK_mapped_file);
- I_List_iterator<mapped_files> list(maps_in_use);
- mapped_files *map;
- char path[FN_REFLEN];
- sprintf(path,"%s/%s/%s.uniq",mysql_data_home,current_thd->db,name);
- (void) unpack_filename(path,path);
-
- while ((map=list++))
- {
- if (!strcmp(path,map->name))
- break;
- }
- if (!map)
- {
- map=new mapped_files(path,magic,magic_length);
- maps_in_use.append(map);
- }
- else
- {
- map->use_count++;
- if (!map->map)
- my_error(ER_NO_FILE_MAPPING, MYF(0), path, map->error);
- }
- mysql_mutex_unlock(&LOCK_mapped_file);
- return map;
-#else
- return NULL;
-#endif
-}
-
-/*
-** free the map if there are no more users for it
-*/
-
-void unmap_file(mapped_files *map)
-{
-#ifdef HAVE_MMAP
- mysql_mutex_lock(&LOCK_mapped_file);
- if (!map->use_count--)
- delete map;
- mysql_mutex_unlock(&LOCK_mapped_file);
-#endif
-}
-
-/*****************************************************************************
-** Instansiate templates
-*****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-/* Used templates */
-template class I_List<mapped_files>;
-template class I_List_iterator<mapped_files>;
-#endif
diff --git a/sql/sql_map.h b/sql/sql_map.h
deleted file mode 100644
index be1c145df3f..00000000000
--- a/sql/sql_map.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef SQL_MAP_INCLUDED
-#define SQL_MAP_INCLUDED
-
-/* Copyright (C) 2000-2001, 2005 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 */
-
-
-/* interface for memory mapped files */
-
-#ifdef USE_PRAGMA_INTERFACE
-#pragma interface /* gcc class implementation */
-#endif
-
-#include "my_base.h" /* ha_rows */
-#include "sql_list.h" /* ilink */
-
-class mapped_files;
-mapped_files *map_file(const char * name,uchar *magic,uint magic_length);
-void unmap_file(mapped_files *map);
-
-class mapped_files :public ilink {
- uchar *map;
- ha_rows size;
- char *name; // name of mapped file
- File file; // >= 0 if open
- int error; // If not mapped
- uint use_count;
-
-public:
- mapped_files(const char * name,uchar *magic,uint magic_length);
- ~mapped_files();
-
- friend class mapped_file;
- friend mapped_files *map_file(const char * name,uchar *magic,
- uint magic_length);
- friend void unmap_file(mapped_files *map);
-};
-
-
-class mapped_file
-{
- mapped_files *file;
-public:
- mapped_file(const char * name,uchar *magic,uint magic_length)
- {
- file=map_file(name,magic,magic_length); /* old or new map */
- }
- ~mapped_file()
- {
- unmap_file(file); /* free map */
- }
- uchar *map()
- {
- return file->map;
- }
-};
-
-#endif /* SQL_MAP_INCLUDED */
diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc
deleted file mode 100644
index b957d1e9be4..00000000000
--- a/sql/sql_olap.cc
+++ /dev/null
@@ -1,188 +0,0 @@
-/* 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 */
-
-
-/*
- OLAP implementation by Sinisa Milivojevic <sinisa@mysql.com>
- Inspired by code submitted by Srilakshmi <lakshmi@gdit.iiit.net>
-
- The ROLLUP code in this file has to be complitely rewritten as it's
- not good enough to satisfy the goals of MySQL.
-
- In 4.1 we will replace this with a working, superior implementation
- of ROLLUP.
-*/
-
-#ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1
-
-#ifdef USE_PRAGMA_IMPLEMENTATION
-#pragma implementation // gcc: Class implementation
-#endif
-
-#include "sql_priv.h"
-#include "unireg.h"
-#include "sql_select.h"
-
-
-/****************************************************************************
- Functions that recursively actually creates new SELECT's
- Returns 0 if OK, 1 if error, -1 if error already printed to client
-****************************************************************************/
-
-
-static int make_new_olap_select(LEX *lex, SELECT_LEX *select_lex, List<Item> new_fields)
-{
- THD *thd=current_thd;
- Item *item, *new_item;
- Item_null *constant= new Item_null("ALL");
-
- SELECT_LEX *new_select = (SELECT_LEX *) thd->memdup((char*) select_lex, sizeof(*select_lex));
- if (!new_select)
- return 1;
- lex->last_selects->next=new_select;
- new_select->linkage=OLAP_TYPE;
- new_select->olap=NON_EXISTING_ONE;
- new_select->group_list.elements=0;
- new_select->group_list.first=(uchar *)0;
- new_select->group_list.next=(uchar **)&new_select->group_list.first;
- List<Item> privlist;
-
- List_iterator<Item> list_it(select_lex->item_list);
- List_iterator<Item> new_it(new_fields);
-
- while ((item=list_it++))
- {
- bool not_found= TRUE;
- if (item->type()==Item::FIELD_ITEM)
- {
- Item_field *iif = (Item_field *)item;
- new_it.rewind();
- while ((new_item=new_it++))
- {
- if (new_item->type()==Item::FIELD_ITEM &&
- !strcmp(((Item_field*)new_item)->table_name,iif->table_name) &&
- !strcmp(((Item_field*)new_item)->field_name,iif->field_name))
- {
- not_found= 0;
- ((Item_field*)new_item)->db_name=iif->db_name;
- Item_field *new_one=new Item_field(&select_lex->context,
- iif->db_name, iif->table_name, iif->field_name);
- privlist.push_back(new_one);
- if (add_to_list(new_select->group_list,new_one,1))
- return 1;
- break;
- }
- }
- }
- if (not_found)
- {
- if (item->type() == Item::FIELD_ITEM)
- privlist.push_back(constant);
- else
- privlist.push_back((Item*)thd->memdup((char *)item,item->size_of()));
- }
- }
- new_select->item_list=privlist;
-
- lex->last_selects = new_select;
- return 0;
-}
-
-/****************************************************************************
- Functions that recursively creates combinations of queries for OLAP
- Returns 0 if OK, 1 if error, -1 if error already printed to client
-****************************************************************************/
-
-static int olap_combos(List<Item> old_fields, List<Item> new_fields, Item *item, LEX *lex,
- SELECT_LEX *select_lex, int position, int selection, int num_fields,
- int num_new_fields)
-{
- int sl_return = 0;
- if (position == num_new_fields)
- {
- if (item)
- new_fields.push_front(item);
- sl_return = make_new_olap_select(lex, select_lex, new_fields);
- }
- else
- {
- if (item)
- new_fields.push_front(item);
- while ((num_fields - num_new_fields >= selection - position) && !sl_return)
- {
- item = old_fields.pop();
- sl_return = olap_combos(old_fields, new_fields, item, lex, select_lex, position+1, ++selection, num_fields, num_new_fields);
- }
- }
- return sl_return;
-}
-
-
-/****************************************************************************
- Top level function for converting OLAP clauses to multiple selects
- This is also a place where clauses treatment depends on OLAP type
- Returns 0 if OK, 1 if error, -1 if error already printed to client
-****************************************************************************/
-
-int handle_olaps(LEX *lex, SELECT_LEX *select_lex)
-{
- List<Item> item_list_copy, new_item_list;
- item_list_copy.empty();
- new_item_list.empty();
- int count=select_lex->group_list.elements;
- int sl_return=0;
-
-
- lex->last_selects=select_lex;
-
- for (ORDER *order= select_lex->group_list.first ; order ; order=order->next)
- item_list_copy.push_back(*(order->item));
-
- List<Item> all_fields(select_lex->item_list);
-
-
- if (setup_tables(lex->thd, &select_lex->context, &select_lex->top_join_list,
- select_lex->table_list.first
- &select_lex->leaf_tables, FALSE) ||
- setup_fields(lex->thd, 0, select_lex->item_list, MARK_COLUMNS_READ,
- &all_fields,1) ||
- setup_fields(lex->thd, 0, item_list_copy, MARK_COLUMNS_READ,
- &all_fields, 1))
- return -1;
-
- if (select_lex->olap == CUBE_TYPE)
- {
- for ( int i=count-1; i>=0 && !sl_return; i--)
- sl_return=olap_combos(item_list_copy, new_item_list, (Item *)0, lex, select_lex, 0, 0, count, i);
- }
- else if (select_lex->olap == ROLLUP_TYPE)
- {
- for ( int i=count-1; i>=0 && !sl_return; i--)
- {
- Item *item;
- item_list_copy.pop();
- List_iterator<Item> it(item_list_copy);
- new_item_list.empty();
- while ((item = it++))
- new_item_list.push_front(item);
- sl_return=make_new_olap_select(lex, select_lex, new_item_list);
- }
- }
- else
- sl_return=1; // impossible
- return sl_return;
-}
-
-#endif /* DISABLED_UNTIL_REWRITTEN_IN_4_1 */
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 53c2ca6fa39..4a4b0bdd66b 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -6061,7 +6061,7 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
void store_position_for_column(const char *name)
{
- current_thd->lex->last_field->after=my_const_cast(char*) (name);
+ current_thd->lex->last_field->after=(char*) (name);
}
bool
@@ -7537,28 +7537,6 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
if (select_lex->item_list.elements)
{
/* Check permissions for used tables in CREATE TABLE ... SELECT */
-
-#ifdef NOT_NECESSARY_TO_CHECK_CREATE_TABLE_EXIST_WHEN_PREPARING_STATEMENT
- /* This code throws an ill error for CREATE TABLE t1 SELECT * FROM t1 */
- /*
- Only do the check for PS, because we on execute we have to check that
- against the opened tables to ensure we don't use a table that is part
- of the view (which can only be done after the table has been opened).
- */
- if (thd->stmt_arena->is_stmt_prepare_or_first_sp_execute())
- {
- /*
- For temporary tables we don't have to check if the created table exists
- */
- if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) &&
- find_table_in_global_list(tables, create_table->db,
- create_table->table_name))
- {
- error= FALSE;
- goto err;
- }
- }
-#endif
if (tables && check_table_access(thd, SELECT_ACL, tables, FALSE,
UINT_MAX, FALSE))
goto err;
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 27cd03d8edd..7e8c1fed999 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -901,19 +901,6 @@ static void plugin_del(struct st_plugin_int *plugin)
DBUG_VOID_RETURN;
}
-#ifdef NOT_USED
-
-static void plugin_del(const LEX_STRING *name)
-{
- struct st_plugin_int *plugin;
- DBUG_ENTER("plugin_del(name)");
- if ((plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))
- plugin_del(plugin);
- DBUG_VOID_RETURN;
-}
-
-#endif
-
static void reap_plugins(void)
{
uint count, idx;
@@ -1394,51 +1381,6 @@ static bool register_builtin(struct st_mysql_plugin *plugin,
DBUG_RETURN(0);
}
-#ifdef NOT_USED_YET
-/*
- Register a plugin at run time. (note, this doesn't initialize a plugin)
- Will be useful for embedded applications.
-
- SYNOPSIS
- plugin_register_builtin()
- thd current thread (used to store scratch data in mem_root)
- plugin static plugin to install
-
- RETURN
- false - plugin registered successfully
-*/
-bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin)
-{
- struct st_plugin_int tmp, *ptr;
- bool result= true;
- int dummy_argc= 0;
- DBUG_ENTER("plugin_register_builtin");
-
- bzero(&tmp, sizeof(tmp));
- tmp.plugin= plugin;
- tmp.name.str= (char *)plugin->name;
- tmp.name.length= strlen(plugin->name);
-
- mysql_mutex_lock(&LOCK_plugin);
- mysql_rwlock_wrlock(&LOCK_system_variables_hash);
-
- if (test_plugin_options(thd->mem_root, &tmp, &dummy_argc, NULL))
- goto end;
- tmp.state= PLUGIN_IS_UNINITIALIZED;
- if ((result= register_builtin(plugin, &tmp, &ptr)))
- {
- mysql_del_sys_var_chain(tmp.system_vars);
- restore_pluginvar_names(tmp.system_vars);
- }
-
-end:
- mysql_rwlock_unlock(&LOCK_system_variables_hash);
- mysql_mutex_unlock(&LOCK_plugin);
-
- DBUG_RETURN(result);;
-}
-#endif /* NOT_USED_YET */
-
/*
called only by plugin_init()
diff --git a/sql/sql_priv.h b/sql/sql_priv.h
index 708608fc2f1..f0f6a1969f5 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -59,8 +59,6 @@
(Old), (New)); \
} while(0)
-extern char err_shared_dir[];
-
/*************************************************************************/
#endif
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 1d61c37ba13..60354d15091 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -11894,38 +11894,30 @@ flush_cached_records(JOIN *join,JOIN_TAB *join_tab,bool skip_last)
SQL_SELECT *select=join_tab->select;
if (rc == NESTED_LOOP_OK)
{
- bool consider_record= !join_tab->cache.select ||
- !join_tab->cache.select->skip_record();
-
- /*
- Check for error: skip_record() can execute code by calling
- Item_subselect::val_*. We need to check for errors (if any)
- after such call.
- */
- if (join->thd->is_error())
+ bool skip_record= FALSE;
+ if (join_tab->cache.select &&
+ join_tab->cache.select->skip_record(join->thd, &skip_record))
{
reset_cache_write(&join_tab->cache);
return NESTED_LOOP_ERROR;
}
- if (consider_record)
+ if (!skip_record)
{
uint i;
reset_cache_read(&join_tab->cache);
for (i=(join_tab->cache.records- (skip_last ? 1 : 0)) ; i-- > 0 ;)
{
read_cached_record(join_tab);
- if (!select || !select->skip_record())
+ skip_record= FALSE;
+ if (select && select->skip_record(join->thd, &skip_record))
{
- /*
- Check for error: skip_record() can execute code by calling
- Item_subselect::val_*. We need to check for errors (if any)
- after such call.
- */
- if (join->thd->is_error())
- rc= NESTED_LOOP_ERROR;
- else
- rc= (join_tab->next_select)(join,join_tab+1,0);
+ reset_cache_write(&join_tab->cache);
+ return NESTED_LOOP_ERROR;
+ }
+ if (!skip_record)
+ {
+ rc= (join_tab->next_select)(join,join_tab+1,0);
if (rc != NESTED_LOOP_OK && rc != NESTED_LOOP_NO_MORE_ROWS)
{
reset_cache_write(&join_tab->cache);
@@ -12441,11 +12433,6 @@ join_ft_read_first(JOIN_TAB *tab)
if (!table->file->inited)
table->file->ha_index_init(tab->ref.key, 1);
-#if NOT_USED_YET
- /* as ft-key doesn't use store_key's, see also FT_SELECT::init() */
- if (cp_buffer_from_ref(tab->join->thd, table, &tab->ref))
- return -1;
-#endif
table->file->ft_init();
if ((error= table->file->ft_read(table->record[0])))
@@ -12735,22 +12722,6 @@ end_write(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
{
copy_fields(&join->tmp_table_param);
copy_funcs(join->tmp_table_param.items_to_copy);
-#ifdef TO_BE_DELETED
- if (!table->uniques) // If not unique handling
- {
- /* Copy null values from group to row */
- ORDER *group;
- for (group=table->group ; group ; group=group->next)
- {
- Item *item= *group->item;
- if (item->maybe_null)
- {
- Field *field=item->get_tmp_table_field();
- field->ptr[-1]= (uchar) (field->is_null() ? 1 : 0);
- }
- }
- }
-#endif
if (!join->having || join->having->val_int())
{
int error;
@@ -13958,44 +13929,6 @@ err:
DBUG_RETURN(-1);
}
-#ifdef NOT_YET
-/**
- Add the HAVING criteria to table->select.
-*/
-
-static bool fix_having(JOIN *join, Item **having)
-{
- (*having)->update_used_tables(); // Some tables may have been const
- JOIN_TAB *table=&join->join_tab[join->const_tables];
- table_map used_tables= join->const_table_map | table->table->map;
-
- DBUG_EXECUTE("where",print_where(*having,"having", QT_ORDINARY););
- Item* sort_table_cond=make_cond_for_table(*having,used_tables,used_tables);
- if (sort_table_cond)
- {
- if (!table->select)
- if (!(table->select=new SQL_SELECT))
- return 1;
- if (!table->select->cond)
- table->select->cond=sort_table_cond;
- else // This should never happen
- if (!(table->select->cond= new Item_cond_and(table->select->cond,
- sort_table_cond)) ||
- table->select->cond->fix_fields(join->thd, &table->select->cond))
- return 1;
- table->select_cond=table->select->cond;
- table->select_cond->top_level_item();
- DBUG_EXECUTE("where",print_where(table->select_cond,
- "select and having",
- QT_ORDINARY););
- *having=make_cond_for_table(*having,~ (table_map) 0,~used_tables);
- DBUG_EXECUTE("where",
- print_where(*having,"having after make_cond", QT_ORDINARY););
- }
- return 0;
-}
-#endif
-
/*****************************************************************************
Remove duplicates from tmp table
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index dc3784eb538..b1f6104b73c 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -5714,52 +5714,6 @@ static int get_schema_partitions_record(THD *thd, TABLE_LIST *tables,
}
-#ifdef NOT_USED
-static interval_type get_real_interval_type(interval_type i_type)
-{
- switch (i_type) {
- case INTERVAL_YEAR:
- return INTERVAL_YEAR;
-
- case INTERVAL_QUARTER:
- case INTERVAL_YEAR_MONTH:
- case INTERVAL_MONTH:
- return INTERVAL_MONTH;
-
- case INTERVAL_WEEK:
- case INTERVAL_DAY:
- return INTERVAL_DAY;
-
- case INTERVAL_DAY_HOUR:
- case INTERVAL_HOUR:
- return INTERVAL_HOUR;
-
- case INTERVAL_DAY_MINUTE:
- case INTERVAL_HOUR_MINUTE:
- case INTERVAL_MINUTE:
- return INTERVAL_MINUTE;
-
- case INTERVAL_DAY_SECOND:
- case INTERVAL_HOUR_SECOND:
- case INTERVAL_MINUTE_SECOND:
- case INTERVAL_SECOND:
- return INTERVAL_SECOND;
-
- case INTERVAL_DAY_MICROSECOND:
- case INTERVAL_HOUR_MICROSECOND:
- case INTERVAL_MINUTE_MICROSECOND:
- case INTERVAL_SECOND_MICROSECOND:
- case INTERVAL_MICROSECOND:
- return INTERVAL_MICROSECOND;
- case INTERVAL_LAST:
- DBUG_ASSERT(0);
- }
- DBUG_ASSERT(0);
- return INTERVAL_SECOND;
-}
-
-#endif
-
#ifdef HAVE_EVENT_SCHEDULER
/*
Loads an event from mysql.event and copies it's data to a row of
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 42b3dfaad83..c4b4a37b35a 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -7312,12 +7312,22 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
if (table->s->tmp_table != NO_TMP_TABLE)
{
/* Close lock if this is a transactional table */
- if (thd->lock &&
- ! (thd->locked_tables_mode == LTM_LOCK_TABLES ||
- thd->locked_tables_mode == LTM_PRELOCKED_UNDER_LOCK_TABLES))
+ if (thd->lock)
{
- mysql_unlock_tables(thd, thd->lock);
- thd->lock=0;
+ if (thd->locked_tables_mode != LTM_LOCK_TABLES &&
+ thd->locked_tables_mode != LTM_PRELOCKED_UNDER_LOCK_TABLES)
+ {
+ mysql_unlock_tables(thd, thd->lock);
+ thd->lock=0;
+ }
+ else
+ {
+ /*
+ If LOCK TABLES list is not empty and contains this table,
+ unlock the table and remove the table from this list.
+ */
+ mysql_lock_remove(thd, thd->lock, table);
+ }
}
/* Remove link to old table and rename the new one */
close_temporary_table(thd, table, 1, 1);
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 25c1fd6fa1e..c52467531a9 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -477,7 +477,14 @@ int mysql_update(THD *thd,
while (!(error=info.read_record(&info)) && !thd->killed)
{
thd->examined_row_count++;
- if (!(select && select->skip_record()))
+ bool skip_record= FALSE;
+ if (select && select->skip_record(thd, &skip_record))
+ {
+ error= 1;
+ table->file->unlock_row();
+ break;
+ }
+ if (!skip_record)
{
if (table->file->was_semi_consistent_read())
continue; /* repeat the read of the same row if it still exists */
@@ -584,7 +591,8 @@ int mysql_update(THD *thd,
while (!(error=info.read_record(&info)) && !thd->killed)
{
thd->examined_row_count++;
- if (!(select && select->skip_record()))
+ bool skip_record;
+ if (!select || (!select->skip_record(thd, &skip_record) && !skip_record))
{
if (table->file->was_semi_consistent_read())
continue; /* repeat the read of the same row if it still exists */
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 9e212fb95e9..320e6d9253e 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -796,7 +796,11 @@ static Sys_var_lexstring Sys_init_connect(
static Sys_var_charptr Sys_init_file(
"init_file", "Read SQL commands from this file at startup",
READ_ONLY GLOBAL_VAR(opt_init_file),
- IF_DISABLE_GRANT_OPTIONS(NO_CMD_LINE, CMD_LINE(REQUIRED_ARG)),
+#ifdef DISABLE_GRANT_OPTIONS
+ NO_CMD_LINE,
+#else
+ CMD_LINE(REQUIRED_ARG),
+#endif
IN_FS_CHARSET, DEFAULT(0));
static PolyLock_rwlock PLock_sys_init_slave(&LOCK_sys_init_slave);
@@ -2873,6 +2877,8 @@ static bool fix_log_output(sys_var *self, THD *thd, enum_var_type type)
return false;
}
+static const char *log_output_names[] = { "NONE", "FILE", "TABLE", NULL};
+
static Sys_var_set Sys_log_output(
"log_output", "Syntax: log-output=value[,value...], "
"where \"value\" could be TABLE, FILE or NONE",
diff --git a/sql/table.cc b/sql/table.cc
index a58623f0036..c89ce90e719 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -797,7 +797,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
goto err; /* purecov: inspected */
bzero((char*) keyinfo,n_length);
share->key_info= keyinfo;
- key_part= my_reinterpret_cast(KEY_PART_INFO*) (keyinfo+keys);
+ key_part= reinterpret_cast<KEY_PART_INFO*>(keyinfo+keys);
strpos=disk_buff+6;
if (!(rec_per_key= (ulong*) alloc_root(&share->mem_root,
@@ -1822,8 +1822,8 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
if (!(key_info= (KEY*) alloc_root(&outparam->mem_root, n_length)))
goto err;
outparam->key_info= key_info;
- key_part= (my_reinterpret_cast(KEY_PART_INFO*) (key_info+share->keys));
-
+ key_part= (reinterpret_cast<KEY_PART_INFO*>(key_info+share->keys));
+
memcpy(key_info, share->key_info, sizeof(*key_info)*share->keys);
memcpy(key_part, share->key_info[0].key_part, (sizeof(*key_part) *
share->key_parts));
diff --git a/sql/udf_example.c b/sql/udf_example.c
index 284689d329f..5f8e71d25fa 100644
--- a/sql/udf_example.c
+++ b/sql/udf_example.c
@@ -133,7 +133,6 @@ typedef long long longlong;
#include <string.h>
#define strmov(a,b) stpcpy(a,b)
#define bzero(a,b) memset(a,0,b)
-#define memcpy_fixed(a,b,c) memcpy(a,b,c)
#endif
#endif
#include <mysql.h>
@@ -778,7 +777,7 @@ char *lookup(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
}
pthread_mutex_unlock(&LOCK_hostname);
#endif
- memcpy_fixed((char*) &in,(char*) *hostent->h_addr_list, sizeof(in.s_addr));
+ memcpy(&in, *hostent->h_addr_list, sizeof(in.s_addr));
*res_length= (ulong) (strmov(result, inet_ntoa(in)) - result);
return result;
}
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 30c4c4d58ca..216097f0fdc 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -807,15 +807,15 @@ int ha_tina::find_current_row(uchar *buf)
Field_blob *blob= *(Field_blob**) field;
uchar *src, *tgt;
uint length, packlength;
-
+
packlength= blob->pack_length_no_ptr();
length= blob->get_length(blob->ptr);
- memcpy_fixed(&src, blob->ptr + packlength, sizeof(char*));
+ memcpy(&src, blob->ptr + packlength, sizeof(char*));
if (src)
{
tgt= (uchar*) alloc_root(&blobroot, length);
bmove(tgt, src, length);
- memcpy_fixed(blob->ptr + packlength, &tgt, sizeof(char*));
+ memcpy(blob->ptr + packlength, &tgt, sizeof(char*));
}
}
}
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index d17b56bd4b1..b1ae276dce8 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -2752,9 +2752,9 @@ void ha_federated::position(const uchar *record __attribute__ ((unused)))
position_called= TRUE;
/* Store result set address. */
- memcpy_fixed(ref, &stored_result, sizeof(MYSQL_RES *));
+ memcpy(ref, &stored_result, sizeof(MYSQL_RES *));
/* Store data cursor position. */
- memcpy_fixed(ref + sizeof(MYSQL_RES *), &current_position,
+ memcpy(ref + sizeof(MYSQL_RES *), &current_position,
sizeof(MYSQL_ROW_OFFSET));
DBUG_VOID_RETURN;
}
@@ -2780,11 +2780,11 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos)
ha_statistic_increment(&SSV::ha_read_rnd_count);
/* Get stored result set. */
- memcpy_fixed(&result, pos, sizeof(MYSQL_RES *));
+ memcpy(&result, pos, sizeof(MYSQL_RES *));
DBUG_ASSERT(result);
/* Set data cursor position. */
- memcpy_fixed(&result->data_cursor, pos + sizeof(MYSQL_RES *),
- sizeof(MYSQL_ROW_OFFSET));
+ memcpy(&result->data_cursor, pos + sizeof(MYSQL_RES *),
+ sizeof(MYSQL_ROW_OFFSET));
/* Read a row. */
ret_val= read_next(buf, result);
MYSQL_READ_ROW_DONE(ret_val);
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 350958f8230..481257def1d 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -390,7 +390,7 @@ int ha_heap::rnd_pos(uchar * buf, uchar *pos)
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
FALSE);
ha_statistic_increment(&SSV::ha_read_rnd_count);
- memcpy_fixed((char*) &heap_position, pos, sizeof(HEAP_PTR));
+ memcpy(&heap_position, pos, sizeof(HEAP_PTR));
error=heap_rrnd(file, buf, heap_position);
table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_READ_ROW_DONE(error);
@@ -654,7 +654,7 @@ heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
parts * sizeof(HA_KEYSEG),
MYF(MY_WME))))
return my_errno;
- seg= my_reinterpret_cast(HA_KEYSEG*) (keydef + keys);
+ seg= reinterpret_cast<HA_KEYSEG*>(keydef + keys);
for (key= 0; key < keys; key++)
{
KEY *pos= table_arg->key_info+key;
diff --git a/storage/heap/hp_test2.c b/storage/heap/hp_test2.c
index 1571fc98402..3ee903be7ed 100644
--- a/storage/heap/hp_test2.c
+++ b/storage/heap/hp_test2.c
@@ -179,11 +179,6 @@ int main(int argc, char *argv[])
printf("can't find key1: \"%s\"\n",(char*) key);
goto err;
}
-#ifdef NOT_USED
- if (file->current_ptr == hp_find_block(&file->s->block,0) ||
- file->current_ptr == hp_find_block(&file->s->block,1))
- continue; /* Don't remove 2 first records */
-#endif
if (heap_delete(file,record))
{
printf("error: %d; can't delete record: \"%s\"\n", my_errno,(char*) record);
diff --git a/storage/innobase/dict/dict0crea.c b/storage/innobase/dict/dict0crea.c
index f185371bfca..09353c45c8c 100644
--- a/storage/innobase/dict/dict0crea.c
+++ b/storage/innobase/dict/dict0crea.c
@@ -240,17 +240,29 @@ dict_build_table_def_step(
ibool is_path;
mtr_t mtr;
ulint space = 0;
+ ibool file_per_table;
ut_ad(mutex_own(&(dict_sys->mutex)));
table = node->table;
- dict_hdr_get_new_id(&table->id, NULL,
- srv_file_per_table ? &space : NULL);
+ /* Cache the global variable "srv_file_per_table" to
+ a local variable before using it. Please note
+ "srv_file_per_table" is not under dict_sys mutex
+ protection, and could be changed while executing
+ this function. So better to cache the current value
+ to a local variable, and all future reference to
+ "srv_file_per_table" should use this local variable. */
+ file_per_table = srv_file_per_table;
+
+ dict_hdr_get_new_id(&table->id, NULL, NULL);
thr_get_trx(thr)->table_id = table->id;
- if (srv_file_per_table) {
+ if (file_per_table) {
+ /* Get a new space id if srv_file_per_table is set */
+ dict_hdr_get_new_id(NULL, NULL, &space);
+
if (UNIV_UNLIKELY(space == ULINT_UNDEFINED)) {
return(DB_ERROR);
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index f5227add6f1..716b7bbbd56 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -4128,6 +4128,11 @@ get_innobase_type_from_mysql_type(
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_LONG_BLOB:
return(DATA_BLOB);
+ case MYSQL_TYPE_NULL:
+ /* MySQL currently accepts "NULL" datatype, but will
+ reject such datatype in the next release. We will cope
+ with it and not trigger assertion failure in 5.1 */
+ break;
default:
ut_error;
}
@@ -6175,7 +6180,22 @@ create_table_def(
field = form->field[i];
col_type = get_innobase_type_from_mysql_type(&unsigned_type,
- field);
+ field);
+
+ if (!col_type) {
+ push_warning_printf(
+ (THD*) trx->mysql_thd,
+ MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_CANT_CREATE_TABLE,
+ "Error creating table '%s' with "
+ "column '%s'. Please check its "
+ "column type and try to re-create "
+ "the table with an appropriate "
+ "column type.",
+ table->name, (char*) field->field_name);
+ goto err_col;
+ }
+
if (field->null_ptr) {
nulls_allowed = 0;
} else {
@@ -6233,7 +6253,7 @@ create_table_def(
if (dict_col_name_is_reserved(field->field_name)){
my_error(ER_WRONG_COLUMN_NAME, MYF(0),
field->field_name);
-
+err_col:
dict_mem_table_free(table);
trx_commit_for_mysql(trx);
diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
index 7c502d616d3..a7117386608 100644
--- a/storage/innobase/os/os0file.c
+++ b/storage/innobase/os/os0file.c
@@ -1445,7 +1445,11 @@ try_again:
/* When srv_file_per_table is on, file creation failure may not
be critical to the whole instance. Do not crash the server in
- case of unknown errors. */
+ case of unknown errors.
+ Please note "srv_file_per_table" is a global variable with
+ no explicit synchronization protection. It could be
+ changed during this execution path. It might not have the
+ same value as the one when building the table definition */
if (srv_file_per_table) {
retry = os_file_handle_error_no_exit(name,
create_mode == OS_FILE_CREATE ?
@@ -1532,7 +1536,11 @@ try_again:
/* When srv_file_per_table is on, file creation failure may not
be critical to the whole instance. Do not crash the server in
- case of unknown errors. */
+ case of unknown errors.
+ Please note "srv_file_per_table" is a global variable with
+ no explicit synchronization protection. It could be
+ changed during this execution path. It might not have the
+ same value as the one when building the table definition */
if (srv_file_per_table) {
retry = os_file_handle_error_no_exit(name,
create_mode == OS_FILE_CREATE ?
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c
index 33c1e092a00..b54b4c6ce49 100644
--- a/storage/myisam/ft_boolean_search.c
+++ b/storage/myisam/ft_boolean_search.c
@@ -92,6 +92,8 @@ static double *nwghts=_nwghts+5; /* nwghts[i] = -0.5*1.5**i */
#define FTB_FLAG_NO 4
#define FTB_FLAG_WONLY 8
+#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
+
typedef struct st_ftb_expr FTB_EXPR;
struct st_ftb_expr
{
diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c
index 7d9b13b7714..937bb6ffe19 100644
--- a/storage/myisam/ft_nlq_search.c
+++ b/storage/myisam/ft_nlq_search.c
@@ -197,7 +197,8 @@ static int walk_and_push(FT_SUPERDOC *from,
static int FT_DOC_cmp(void *unused __attribute__((unused)),
FT_DOC *a, FT_DOC *b)
{
- return sgn(b->weight - a->weight);
+ double c= b->weight - a->weight;
+ return ((c < 0) ? -1 : (c > 0) ? 1 : 0);
}
diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c
index 8f5779b04ee..663d7869f71 100644
--- a/storage/myisam/ft_parser.c
+++ b/storage/myisam/ft_parser.c
@@ -39,7 +39,7 @@ static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat)
{
word->weight=LWS_IN_USE;
docstat->sum+=word->weight;
- memcpy_fixed((docstat->list)++,word,sizeof(FT_WORD));
+ memcpy((docstat->list)++, word, sizeof(FT_WORD));
return 0;
}
diff --git a/storage/myisam/ft_update.c b/storage/myisam/ft_update.c
index d1548e32870..a2ddb49ecf0 100644
--- a/storage/myisam/ft_update.c
+++ b/storage/myisam/ft_update.c
@@ -83,8 +83,7 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
if (ftsi->seg->flag & HA_BLOB_PART)
{
ftsi->len=_mi_calc_blob_length(ftsi->seg->bit_start,ftsi->pos);
- memcpy_fixed((char*) &ftsi->pos, ftsi->pos+ftsi->seg->bit_start,
- sizeof(char*));
+ memcpy(&ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*));
DBUG_RETURN(1);
}
ftsi->len=ftsi->seg->length;
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index 13427130069..6bf01cd63c7 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -52,11 +52,6 @@
#endif
#include "rt_index.h"
-#ifndef USE_RAID
-#define my_raid_create(K, A, B, C, D, E, F, G) mysql_file_create(K, A, B, C, G)
-#define my_raid_delete(K, A, B, C) mysql_file_delete(K, A, B)
-#endif
-
/* Functions defined in this file */
static int check_k_link(MI_CHECK *param, MI_INFO *info,uint nr);
@@ -1577,15 +1572,12 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick)
{
/* Get real path for data file */
- if ((new_file= my_raid_create(mi_key_file_datatmp,
- fn_format(param->temp_filename,
- share->data_file_name, "",
- DATA_TMP_EXT, 2+4),
- 0, param->tmpfile_createflag,
- share->base.raid_type,
- share->base.raid_chunks,
- share->base.raid_chunksize,
- MYF(0))) < 0)
+ if ((new_file= mysql_file_create(mi_key_file_datatmp,
+ fn_format(param->temp_filename,
+ share->data_file_name, "",
+ DATA_TMP_EXT, 2+4),
+ 0, param->tmpfile_createflag,
+ MYF(0))) < 0)
{
mi_check_print_error(param,"Can't create new tempfile: '%s'",
param->temp_filename);
@@ -1751,8 +1743,7 @@ err:
(size_t) info->s->mmaped_length);
info->s->file_map= NULL;
}
- if (change_to_newfile(share->data_file_name,MI_NAME_DEXT,
- DATA_TMP_EXT, share->base.raid_chunks,
+ if (change_to_newfile(share->data_file_name, MI_NAME_DEXT, DATA_TMP_EXT,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1))
@@ -1767,9 +1758,8 @@ err:
if (new_file >= 0)
{
(void) mysql_file_close(new_file, MYF(0));
- (void) my_raid_delete(mi_key_file_datatmp,
- param->temp_filename, info->s->base.raid_chunks,
- MYF(MY_WME));
+ (void) mysql_file_delete(mi_key_file_datatmp,
+ param->temp_filename, MYF(MY_WME));
info->rec_cache.file=-1; /* don't flush data to new_file, it's closed */
}
mi_mark_crashed_on_repair(info);
@@ -2011,7 +2001,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name)
(void) mysql_file_close(share->kfile, MYF(MY_WME));
share->kfile = -1;
(void) mysql_file_close(new_file, MYF(MY_WME));
- if (change_to_newfile(share->index_file_name,MI_NAME_IEXT,INDEX_TMP_EXT,0,
+ if (change_to_newfile(share->index_file_name, MI_NAME_IEXT, INDEX_TMP_EXT,
MYF(0)) ||
mi_open_keyfile(share))
goto err2;
@@ -2141,18 +2131,9 @@ err:
*/
int change_to_newfile(const char * filename, const char * old_ext,
- const char * new_ext,
- uint raid_chunks __attribute__((unused)),
- myf MyFlags)
+ const char * new_ext, myf MyFlags)
{
char old_filename[FN_REFLEN],new_filename[FN_REFLEN];
-#ifdef USE_RAID
- if (raid_chunks)
- return my_raid_redel(fn_format(old_filename,filename,"",old_ext,2+4),
- fn_format(new_filename,filename,"",new_ext,2+4),
- raid_chunks,
- MYF(MY_WME | MY_LINK_WARNING | MyFlags));
-#endif
/* Get real path to filename */
(void) fn_format(old_filename,filename,"",old_ext,2+4+32);
return my_redel(old_filename,
@@ -2293,15 +2274,12 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick)
{
/* Get real path for data file */
- if ((new_file= my_raid_create(mi_key_file_datatmp,
- fn_format(param->temp_filename,
- share->data_file_name, "",
- DATA_TMP_EXT, 2+4),
- 0, param->tmpfile_createflag,
- share->base.raid_type,
- share->base.raid_chunks,
- share->base.raid_chunksize,
- MYF(0))) < 0)
+ if ((new_file= mysql_file_create(mi_key_file_datatmp,
+ fn_format(param->temp_filename,
+ share->data_file_name, "",
+ DATA_TMP_EXT, 2+4),
+ 0, param->tmpfile_createflag,
+ MYF(0))) < 0)
{
mi_check_print_error(param,"Can't create new tempfile: '%s'",
param->temp_filename);
@@ -2527,7 +2505,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
skr < share->base.reloc*share->base.min_pack_length)
skr=share->base.reloc*share->base.min_pack_length;
#endif
- if (skr != sort_info.filelength && !info->s->base.raid_type)
+ if (skr != sort_info.filelength)
if (mysql_file_chsize(info->dfile, skr, 0, MYF(0)))
mi_check_print_warning(param,
"Can't change size of datafile, error: %d",
@@ -2565,8 +2543,7 @@ err:
{
mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1;
- if (change_to_newfile(share->data_file_name,MI_NAME_DEXT,
- DATA_TMP_EXT, share->base.raid_chunks,
+ if (change_to_newfile(share->data_file_name,MI_NAME_DEXT, DATA_TMP_EXT,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1))
@@ -2580,9 +2557,8 @@ err:
if (new_file >= 0)
{
(void) mysql_file_close(new_file, MYF(0));
- (void) my_raid_delete(mi_key_file_datatmp,
- param->temp_filename, share->base.raid_chunks,
- MYF(MY_WME));
+ (void) mysql_file_delete(mi_key_file_datatmp,
+ param->temp_filename, MYF(MY_WME));
if (info->dfile == new_file) /* Retry with key cache */
if (unlikely(mi_open_datafile(info, share, name, -1)))
param->retry_repair= 0; /* Safety */
@@ -2751,16 +2727,12 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick)
{
/* Get real path for data file */
- if ((new_file= my_raid_create(mi_key_file_datatmp,
- fn_format(param->temp_filename,
- share->data_file_name, "",
- DATA_TMP_EXT,
- 2+4),
- 0, param->tmpfile_createflag,
- share->base.raid_type,
- share->base.raid_chunks,
- share->base.raid_chunksize,
- MYF(0))) < 0)
+ if ((new_file= mysql_file_create(mi_key_file_datatmp,
+ fn_format(param->temp_filename,
+ share->data_file_name, "",
+ DATA_TMP_EXT, 2+4),
+ 0, param->tmpfile_createflag,
+ MYF(0))) < 0)
{
mi_check_print_error(param,"Can't create new tempfile: '%s'",
param->temp_filename);
@@ -3055,7 +3027,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
skr < share->base.reloc*share->base.min_pack_length)
skr=share->base.reloc*share->base.min_pack_length;
#endif
- if (skr != sort_info.filelength && !info->s->base.raid_type)
+ if (skr != sort_info.filelength)
if (mysql_file_chsize(info->dfile, skr, 0, MYF(0)))
mi_check_print_warning(param,
"Can't change size of datafile, error: %d",
@@ -3105,8 +3077,7 @@ err:
{
mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1;
- if (change_to_newfile(share->data_file_name,MI_NAME_DEXT,
- DATA_TMP_EXT, share->base.raid_chunks,
+ if (change_to_newfile(share->data_file_name, MI_NAME_DEXT, DATA_TMP_EXT,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1))
@@ -3120,9 +3091,8 @@ err:
if (new_file >= 0)
{
(void) mysql_file_close(new_file, MYF(0));
- (void) my_raid_delete(mi_key_file_datatmp,
- param->temp_filename, share->base.raid_chunks,
- MYF(MY_WME));
+ (void) mysql_file_delete(mi_key_file_datatmp,
+ param->temp_filename, MYF(MY_WME));
if (info->dfile == new_file) /* Retry with key cache */
if (unlikely(mi_open_datafile(info, share, name, -1)))
param->retry_repair= 0; /* Safety */
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index 4a91c2d939b..46c61eb4709 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -549,11 +549,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
share.base.pack_bits=packed;
share.base.fields=fields;
share.base.pack_fields=packed;
-#ifdef USE_RAID
- share.base.raid_type=ci->raid_type;
- share.base.raid_chunks=ci->raid_chunks;
- share.base.raid_chunksize=ci->raid_chunksize;
-#endif
/* max_data_file_length and max_key_file_length are recalculated on open */
if (options & HA_OPTION_TMP_TABLE)
@@ -642,20 +637,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
if (!(flags & HA_DONT_TOUCH_DATA))
{
-#ifdef USE_RAID
- if (share.base.raid_type)
- {
- (void) fn_format(filename, name, "", MI_NAME_DEXT,
- MY_UNPACK_FILENAME | MY_APPEND_EXT);
- if ((dfile=my_raid_create(filename, 0, create_mode,
- share.base.raid_type,
- share.base.raid_chunks,
- share.base.raid_chunksize,
- MYF(MY_WME | MY_RAID))) < 0)
- goto err;
- }
- else
-#endif
{
if (ci->data_file_name)
{
@@ -841,7 +822,6 @@ err:
(void) mysql_file_close(dfile, MYF(0));
/* fall through */
case 2:
- /* QQ: Tõnu should add a call to my_raid_delete() here */
if (! (flags & HA_DONT_TOUCH_DATA))
mysql_file_delete_with_symlink(mi_key_file_dfile,
fn_format(filename, name, "", MI_NAME_DEXT,
diff --git a/storage/myisam/mi_delete_table.c b/storage/myisam/mi_delete_table.c
index 58a60a760aa..a05a2ad6237 100644
--- a/storage/myisam/mi_delete_table.c
+++ b/storage/myisam/mi_delete_table.c
@@ -22,40 +22,11 @@
int mi_delete_table(const char *name)
{
char from[FN_REFLEN];
-#ifdef USE_RAID
- uint raid_type=0,raid_chunks=0;
-#endif
DBUG_ENTER("mi_delete_table");
#ifdef EXTRA_DEBUG
check_table_is_closed(name,"delete");
#endif
-#ifdef USE_RAID
- {
- MI_INFO *info;
- /*
- When built with RAID support, we need to determine if this table
- makes use of the raid feature. If yes, we need to remove all raid
- chunks. This is done with my_raid_delete(). Unfortunately it is
- necessary to open the table just to check this. We use
- 'open_for_repair' to be able to open even a crashed table. If even
- this open fails, we assume no raid configuration for this table
- and try to remove the normal data file only. This may however
- leave the raid chunks behind.
- */
- if (!(info= mi_open(name, O_RDONLY, HA_OPEN_FOR_REPAIR)))
- raid_type= 0;
- else
- {
- raid_type= info->s->base.raid_type;
- raid_chunks= info->s->base.raid_chunks;
- mi_close(info);
- }
- }
-#ifdef EXTRA_DEBUG
- check_table_is_closed(name,"delete");
-#endif
-#endif /* USE_RAID */
fn_format(from,name,"",MI_NAME_IEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
if (my_is_symlink(from) && (*myisam_test_invalid_symlink)(from))
@@ -73,10 +44,6 @@ int mi_delete_table(const char *name)
DBUG_RETURN(my_errno);
}
fn_format(from,name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
-#ifdef USE_RAID
- if (raid_type)
- DBUG_RETURN(my_raid_delete(from, raid_chunks, MYF(MY_WME)) ? my_errno : 0);
-#endif
if (my_is_symlink(from) && (*myisam_test_invalid_symlink)(from))
{
/*
diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c
index 59b895b5e64..f429edd2759 100644
--- a/storage/myisam/mi_dynrec.c
+++ b/storage/myisam/mi_dynrec.c
@@ -283,13 +283,6 @@ int _mi_write_blob_record(MI_INFO *info, const uchar *record)
MI_DYN_DELETE_BLOCK_HEADER+1);
reclength= (info->s->base.pack_reclength +
_my_calc_total_blob_length(info,record)+ extra);
-#ifdef NOT_USED /* We now support big rows */
- if (reclength > MI_DYN_MAX_ROW_LENGTH)
- {
- my_errno=HA_ERR_TO_BIG_ROW;
- return -1;
- }
-#endif
if (!(rec_buff=(uchar*) my_alloca(reclength)))
{
my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
@@ -317,13 +310,6 @@ int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const uchar *record)
MI_DYN_DELETE_BLOCK_HEADER);
reclength= (info->s->base.pack_reclength+
_my_calc_total_blob_length(info,record)+ extra);
-#ifdef NOT_USED /* We now support big rows */
- if (reclength > MI_DYN_MAX_ROW_LENGTH)
- {
- my_errno=HA_ERR_TO_BIG_ROW;
- return -1;
- }
-#endif
if (!(rec_buff=(uchar*) my_alloca(reclength)))
{
my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
@@ -1009,7 +995,7 @@ uint _mi_rec_pack(MI_INFO *info, register uchar *to,
char *temp_pos;
size_t tmp_length=length-portable_sizeof_char_ptr;
memcpy((uchar*) to,from,tmp_length);
- memcpy_fixed(&temp_pos,from+tmp_length,sizeof(char*));
+ memcpy(&temp_pos,from+tmp_length,sizeof(char*));
memcpy(to+tmp_length,temp_pos,(size_t) blob->length);
to+=tmp_length+blob->length;
}
@@ -1324,9 +1310,9 @@ ulong _mi_rec_unpack(register MI_INFO *info, register uchar *to, uchar *from,
from_left - size_length < blob_length ||
from_left - size_length - blob_length < min_pack_length)
goto err;
- memcpy((uchar*) to,(uchar*) from,(size_t) size_length);
+ memcpy(to, from, (size_t) size_length);
from+=size_length;
- memcpy_fixed((uchar*) to+size_length,(uchar*) &from,sizeof(char*));
+ memcpy(to+size_length, &from, sizeof(char*));
from+=blob_length;
}
else
diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c
index 3f445ebf44d..bce42b64e99 100644
--- a/storage/myisam/mi_key.c
+++ b/storage/myisam/mi_key.c
@@ -139,7 +139,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
else if (keyseg->flag & HA_BLOB_PART)
{
uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos);
- memcpy_fixed((uchar*) &pos,pos+keyseg->bit_start,sizeof(char*));
+ memcpy(&pos,pos+keyseg->bit_start,sizeof(char*));
set_if_smaller(length,tmp_length);
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
diff --git a/storage/myisam/mi_log.c b/storage/myisam/mi_log.c
index f6bbaab1f87..5af4a057a95 100644
--- a/storage/myisam/mi_log.c
+++ b/storage/myisam/mi_log.c
@@ -149,7 +149,7 @@ void _myisam_log_record(enum myisam_log_commands command, MI_INFO *info,
blob != end ;
blob++)
{
- memcpy_fixed((uchar*) &pos, record+blob->offset+blob->pack_length,
+ memcpy(&pos, record+blob->offset+blob->pack_length,
sizeof(char*));
(void) mysql_file_write(myisam_log_file, pos, blob->length, MYF(0));
}
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index 5b3da9841b8..e3c29909067 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -260,25 +260,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
set_if_smaller(max_data_file_length, INT_MAX32);
set_if_smaller(max_key_file_length, INT_MAX32);
#endif
-#if USE_RAID && SYSTEM_SIZEOF_OFF_T == 4
- set_if_smaller(max_key_file_length, INT_MAX32);
- if (!share->base.raid_type)
- {
- set_if_smaller(max_data_file_length, INT_MAX32);
- }
- else
- {
- set_if_smaller(max_data_file_length,
- (ulonglong) share->base.raid_chunks << 31);
- }
-#elif !defined(USE_RAID)
- if (share->base.raid_type)
- {
- DBUG_PRINT("error",("Table uses RAID but we don't have RAID support"));
- my_errno=HA_ERR_UNSUPPORTED;
- goto err;
- }
-#endif
share->base.max_data_file_length=(my_off_t) max_data_file_length;
share->base.max_key_file_length=(my_off_t) max_key_file_length;
@@ -877,7 +858,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
key_blocks=state->header.max_block_size_index;
DBUG_ENTER("mi_state_info_write");
- memcpy_fixed(ptr,&state->header,sizeof(state->header));
+ memcpy(ptr, &state->header, sizeof(state->header));
ptr+=sizeof(state->header);
/* open_count must be first because of _mi_mark_file_changed ! */
@@ -936,7 +917,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state)
{
uint i,keys,key_parts,key_blocks;
- memcpy_fixed(&state->header,ptr, sizeof(state->header));
+ memcpy(&state->header, ptr, sizeof(state->header));
ptr +=sizeof(state->header);
keys=(uint) state->header.keys;
key_parts=mi_uint2korr(state->header.key_parts);
@@ -1036,10 +1017,7 @@ uint mi_base_info_write(File file, MI_BASE_INFO *base)
mi_int2store(ptr,base->max_key_length); ptr +=2;
mi_int2store(ptr,base->extra_alloc_bytes); ptr +=2;
*ptr++= base->extra_alloc_procent;
- *ptr++= base->raid_type;
- mi_int2store(ptr,base->raid_chunks); ptr +=2;
- mi_int4store(ptr,base->raid_chunksize); ptr +=4;
- bzero(ptr,6); ptr +=6; /* extra */
+ bzero(ptr,13); ptr +=13; /* extra */
return mysql_file_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0;
}
@@ -1070,17 +1048,8 @@ uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base)
base->max_key_length = mi_uint2korr(ptr); ptr +=2;
base->extra_alloc_bytes = mi_uint2korr(ptr); ptr +=2;
base->extra_alloc_procent = *ptr++;
- base->raid_type= *ptr++;
- base->raid_chunks= mi_uint2korr(ptr); ptr +=2;
- base->raid_chunksize= mi_uint4korr(ptr); ptr +=4;
- /* TO BE REMOVED: Fix for old RAID files */
- if (base->raid_type == 0)
- {
- base->raid_chunks=0;
- base->raid_chunksize=0;
- }
- ptr+=6;
+ ptr+=13;
return ptr;
}
@@ -1223,7 +1192,7 @@ uchar *mi_recinfo_read(uchar *ptr, MI_COLUMNDEF *recinfo)
}
/**************************************************************************
-Open data file with or without RAID
+Open data file.
We can't use dup() here as the data file descriptors need to have different
active seek-positions.
@@ -1251,20 +1220,8 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *org_name,
data_name= real_data_name;
}
}
-#ifdef USE_RAID
- if (share->base.raid_type)
- {
- info->dfile=my_raid_open(data_name,
- share->mode | O_SHARE,
- share->base.raid_type,
- share->base.raid_chunks,
- share->base.raid_chunksize,
- MYF(MY_WME | MY_RAID));
- }
- else
-#endif
- info->dfile= mysql_file_open(mi_key_file_dfile,
- data_name, share->mode | O_SHARE, MYF(MY_WME));
+ info->dfile= mysql_file_open(mi_key_file_dfile,
+ data_name, share->mode | O_SHARE, MYF(MY_WME));
return info->dfile >= 0 ? 0 : 1;
}
diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c
index 0ba495fdd68..d8d892a5bc9 100644
--- a/storage/myisam/mi_packrec.c
+++ b/storage/myisam/mi_packrec.c
@@ -1051,8 +1051,7 @@ static void uf_blob(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
}
decode_bytes(rec,bit_buff,bit_buff->blob_pos,bit_buff->blob_pos+length);
_my_store_blob_length((uchar*) to,pack_length,length);
- memcpy_fixed((char*) to+pack_length,(char*) &bit_buff->blob_pos,
- sizeof(char*));
+ memcpy((char*) to+pack_length, &bit_buff->blob_pos, sizeof(char*));
bit_buff->blob_pos+=length;
}
}
diff --git a/storage/myisam/mi_rename.c b/storage/myisam/mi_rename.c
index 56ccb333d03..455d45cecfe 100644
--- a/storage/myisam/mi_rename.c
+++ b/storage/myisam/mi_rename.c
@@ -22,28 +22,12 @@
int mi_rename(const char *old_name, const char *new_name)
{
char from[FN_REFLEN],to[FN_REFLEN];
-#ifdef USE_RAID
- uint raid_type=0,raid_chunks=0;
-#endif
DBUG_ENTER("mi_rename");
#ifdef EXTRA_DEBUG
check_table_is_closed(old_name,"rename old_table");
check_table_is_closed(new_name,"rename new table2");
#endif
-#ifdef USE_RAID
- {
- MI_INFO *info;
- if (!(info=mi_open(old_name, O_RDONLY, 0)))
- DBUG_RETURN(my_errno);
- raid_type = info->s->base.raid_type;
- raid_chunks = info->s->base.raid_chunks;
- mi_close(info);
- }
-#ifdef EXTRA_DEBUG
- check_table_is_closed(old_name,"rename raidcheck");
-#endif
-#endif /* USE_RAID */
fn_format(from,old_name,"",MI_NAME_IEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
fn_format(to,new_name,"",MI_NAME_IEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
@@ -51,11 +35,6 @@ int mi_rename(const char *old_name, const char *new_name)
DBUG_RETURN(my_errno);
fn_format(from,old_name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
fn_format(to,new_name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
-#ifdef USE_RAID
- if (raid_type)
- DBUG_RETURN(my_raid_rename(from, to, raid_chunks, MYF(MY_WME)) ? my_errno :
- 0);
-#endif
DBUG_RETURN(mysql_file_rename_with_symlink(mi_key_file_dfile,
from, to,
MYF(MY_WME)) ? my_errno : 0);
diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c
index baa01a507eb..073b127f1a3 100644
--- a/storage/myisam/mi_static.c
+++ b/storage/myisam/mi_static.c
@@ -38,7 +38,6 @@ uint myisam_concurrent_insert= 2;
uint myisam_concurrent_insert= 0;
#endif
ulonglong myisam_max_temp_length= MAX_FILE_SIZE;
-ulong myisam_bulk_insert_tree_size=8192*1024;
ulong myisam_data_pointer_size=4;
ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0;
diff --git a/storage/myisam/mi_test1.c b/storage/myisam/mi_test1.c
index 742864fe241..f89f2a8d21d 100644
--- a/storage/myisam/mi_test1.c
+++ b/storage/myisam/mi_test1.c
@@ -411,7 +411,7 @@ static void create_record(uchar *record,uint rownr)
tmp=strlen((char*) blob_key);
int4store(pos,tmp);
ptr=blob_key;
- memcpy_fixed(pos+4,&ptr,sizeof(char*));
+ memcpy(pos+4, &ptr, sizeof(char*));
pos+=recinfo[1].length;
}
else if (recinfo[1].type == FIELD_VARCHAR)
@@ -439,7 +439,7 @@ static void create_record(uchar *record,uint rownr)
tmp=strlen((char*) blob_record);
int4store(pos,tmp);
ptr=blob_record;
- memcpy_fixed(pos+4,&ptr,sizeof(char*));
+ memcpy(pos+4, &ptr, sizeof(char*));
}
else if (recinfo[2].type == FIELD_VARCHAR)
{
@@ -468,10 +468,10 @@ static void update_record(uchar *record)
uchar *column,*ptr;
int length;
length=uint4korr(pos); /* Long blob */
- memcpy_fixed(&column,pos+4,sizeof(char*));
+ memcpy(&column, pos+4, sizeof(char*));
memcpy(blob_key,column,length); /* Move old key */
ptr=blob_key;
- memcpy_fixed(pos+4,&ptr,sizeof(char*)); /* Store pointer to new key */
+ memcpy(pos+4, &ptr, sizeof(char*)); /* Store pointer to new key */
if (keyinfo[0].seg[0].type != HA_KEYTYPE_NUM)
default_charset_info->cset->casedn(default_charset_info,
(char*) blob_key, length,
@@ -501,13 +501,13 @@ static void update_record(uchar *record)
uchar *column;
int length;
length=uint4korr(pos);
- memcpy_fixed(&column,pos+4,sizeof(char*));
+ memcpy(&column, pos+4, sizeof(char*));
memcpy(blob_record,column,length);
bfill(blob_record+length,20,'.'); /* Make it larger */
length+=20;
int4store(pos,length);
column= blob_record;
- memcpy_fixed(pos+4,&column,sizeof(char*));
+ memcpy(pos+4, &column, sizeof(char*));
}
else if (recinfo[2].type == FIELD_VARCHAR)
{
diff --git a/storage/myisam/mi_test2.c b/storage/myisam/mi_test2.c
index 513b390ee68..127d93b5433 100644
--- a/storage/myisam/mi_test2.c
+++ b/storage/myisam/mi_test2.c
@@ -1030,7 +1030,7 @@ static void put_blob_in_record(uchar *blob_pos, char **blob_buffer)
for (i=0 ; i < length ; i++)
(*blob_buffer)[i]=(char) (length+i);
int4store(blob_pos,length);
- memcpy_fixed(blob_pos+4,(char*) blob_buffer,sizeof(char*));
+ memcpy(blob_pos+4, blob_buffer, sizeof(char*));
}
else
{
diff --git a/storage/myisam/mi_test3.c b/storage/myisam/mi_test3.c
index bf36d8df7f4..c03a34df227 100644
--- a/storage/myisam/mi_test3.c
+++ b/storage/myisam/mi_test3.c
@@ -458,7 +458,7 @@ int test_update(MI_INFO *file,int id,int lock_type)
}
}
}
- memcpy_fixed(new_record.id,record.id,sizeof(record.id));
+ memcpy(new_record.id, record.id, sizeof(record.id));
tmp=rnd(20000)+40000;
int4store(new_record.nr,tmp);
if (!mi_update(file,record.id,new_record.id))
diff --git a/storage/myisam/mi_unique.c b/storage/myisam/mi_unique.c
index fdba84a2e67..cee159951de 100644
--- a/storage/myisam/mi_unique.c
+++ b/storage/myisam/mi_unique.c
@@ -111,7 +111,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *record)
else if (keyseg->flag & HA_BLOB_PART)
{
uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos);
- memcpy_fixed((uchar*) &pos,pos+keyseg->bit_start,sizeof(char*));
+ memcpy(&pos, pos+keyseg->bit_start, sizeof(char*));
if (!length || length > tmp_length)
length=tmp_length; /* The whole blob */
}
@@ -206,8 +206,8 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b,
set_if_smaller(a_length, keyseg->length);
set_if_smaller(b_length, keyseg->length);
}
- memcpy_fixed((uchar*) &pos_a,pos_a+keyseg->bit_start,sizeof(char*));
- memcpy_fixed((uchar*) &pos_b,pos_b+keyseg->bit_start,sizeof(char*));
+ memcpy(&pos_a, pos_a+keyseg->bit_start, sizeof(char*));
+ memcpy(&pos_b, pos_b+keyseg->bit_start, sizeof(char*));
}
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT1 ||
type == HA_KEYTYPE_VARTEXT2)
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index f2d43585eef..bd56bb04f65 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -61,11 +61,6 @@ int mi_write(MI_INFO *info, uchar *record)
if (_mi_readinfo(info,F_WRLCK,1))
DBUG_RETURN(my_errno);
dont_break(); /* Dont allow SIGHUP or SIGINT */
-#if !defined(NO_LOCKING) && defined(USE_RECORD_LOCK)
- if (!info->locked && my_lock(info->dfile,F_WRLCK,0L,F_TO_EOF,
- MYF(MY_SEEK_NOT_DONE) | info->lock_wait))
- goto err;
-#endif
filepos= ((share->state.dellink != HA_OFFSET_ERROR &&
!info->append_insert_at_end) ?
share->state.dellink :
diff --git a/storage/myisam/myisam_ftdump.c b/storage/myisam/myisam_ftdump.c
index 4718abc3481..1c534fe8d02 100644
--- a/storage/myisam/myisam_ftdump.c
+++ b/storage/myisam/myisam_ftdump.c
@@ -46,7 +46,7 @@ static struct my_option my_long_options[] =
{"stats", 's', "Report global stats.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Be verbose.",
- (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ &verbose, &verbose, 0, GET_BOOL, 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}
};
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c
index e1cedf6bc31..4df76e31872 100644
--- a/storage/myisam/myisamchk.c
+++ b/storage/myisam/myisamchk.c
@@ -27,12 +27,6 @@
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
-SET_STACK_SIZE(9000) /* Minimum stack size for program */
-
-#ifndef USE_RAID
-#define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G)
-#define my_raid_delete(A,B,C) my_delete(A,B)
-#endif
static uint decode_bits;
static char **default_argv;
@@ -782,7 +776,6 @@ static int myisamchk(MI_CHECK *param, char * filename)
{
int error,lock_type,recreate;
int rep_quick= param->testflag & (T_QUICK | T_FORCE_UNIQUENESS);
- uint raid_chunks;
MI_INFO *info;
File datafile;
char llbuff[22],llbuff2[22];
@@ -844,7 +837,6 @@ static int myisamchk(MI_CHECK *param, char * filename)
share->options&= ~HA_OPTION_READ_ONLY_DATA; /* We are modifing it */
share->tot_locks-= share->r_locks;
share->r_locks=0;
- raid_chunks=share->base.raid_chunks;
/*
Skip the checking of the file if:
@@ -1013,9 +1005,7 @@ static int myisamchk(MI_CHECK *param, char * filename)
if (param->out_flag & O_NEW_DATA)
{ /* Change temp file to org file */
(void) my_close(info->dfile,MYF(MY_WME)); /* Close new file */
- error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT,
- raid_chunks,
- MYF(0));
+ error|=change_to_newfile(filename, MI_NAME_DEXT, DATA_TMP_EXT, MYF(0));
if (mi_open_datafile(info,info->s, NULL, -1))
error=1;
param->out_flag&= ~O_NEW_DATA; /* We are using new datafile */
@@ -1146,12 +1136,10 @@ end2:
{
if (param->out_flag & O_NEW_DATA)
error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT,
- raid_chunks,
((param->testflag & T_BACKUP_DATA) ?
MYF(MY_REDEL_MAKE_BACKUP) : MYF(0)));
if (param->out_flag & O_NEW_INDEX)
- error|=change_to_newfile(filename,MI_NAME_IEXT,INDEX_TMP_EXT,0,
- MYF(0));
+ error|=change_to_newfile(filename, MI_NAME_IEXT, INDEX_TMP_EXT, MYF(0));
}
(void) fflush(stdout); (void) fflush(stderr);
if (param->error_printed)
@@ -1247,16 +1235,9 @@ static void descript(MI_CHECK *param, register MI_INFO *info, char * name)
share->base.auto_key,
llstr(share->state.auto_increment,llbuff));
}
- if (share->base.raid_type)
- {
- printf("RAID: Type: %u Chunks: %u Chunksize: %lu\n",
- share->base.raid_type,
- share->base.raid_chunks,
- share->base.raid_chunksize);
- }
if (share->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
printf("Checksum: %23s\n",llstr(info->state->checksum,llbuff));
-;
+
if (share->options & HA_OPTION_DELAY_KEY_WRITE)
printf("Keys are only flushed at close\n");
@@ -1527,14 +1508,11 @@ static int mi_sort_records(MI_CHECK *param,
goto err;
}
fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
- new_file=my_raid_create(fn_format(param->temp_filename,
- param->temp_filename,"",
- DATA_TMP_EXT,2+4),
- 0,param->tmpfile_createflag,
- share->base.raid_type,
- share->base.raid_chunks,
- share->base.raid_chunksize,
- MYF(0));
+ new_file= my_create(fn_format(param->temp_filename,
+ param->temp_filename, "",
+ DATA_TMP_EXT, 2+4),
+ 0, param->tmpfile_createflag,
+ MYF(0));
if (new_file < 0)
{
mi_check_print_error(param,"Can't create new tempfile: '%s'",
@@ -1609,8 +1587,7 @@ err:
{
(void) end_io_cache(&info->rec_cache);
(void) my_close(new_file,MYF(MY_WME));
- (void) my_raid_delete(param->temp_filename, share->base.raid_chunks,
- MYF(MY_WME));
+ (void) my_delete(param->temp_filename, MYF(MY_WME));
}
if (temp_buff)
{
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 130a96bc9e0..c7f0cb27a40 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -26,8 +26,9 @@
#endif
#include <mysql/psi/mysql_file.h>
-#if defined(my_write) && !defined(MAP_TO_USE_RAID)
-#undef my_write /* undef map from my_nosys; We need test-if-disk full */
+/* undef map from my_nosys; We need test-if-disk full */
+#if defined(my_write)
+#undef my_write
#endif
typedef struct st_mi_status_info
@@ -130,9 +131,6 @@ typedef struct st_mi_base_info
/* Extra allocation when using dynamic record format */
uint extra_alloc_bytes;
uint extra_alloc_procent;
- /* Info about raid */
- uint raid_type,raid_chunks;
- ulong raid_chunksize;
/* The following are from the header */
uint key_parts,all_key_parts;
} MI_BASE_INFO;
@@ -544,10 +542,6 @@ void _mi_store_static_key(MI_KEYDEF *keyinfo, uchar *key_pos,
MI_KEY_PARAM *s_temp);
void _mi_store_var_pack_key(MI_KEYDEF *keyinfo, uchar *key_pos,
MI_KEY_PARAM *s_temp);
-#ifdef NOT_USED
-void _mi_store_pack_key(MI_KEYDEF *keyinfo, uchar *key_pos,
- MI_KEY_PARAM *s_temp);
-#endif
void _mi_store_bin_pack_key(MI_KEYDEF *keyinfo, uchar *key_pos,
MI_KEY_PARAM *s_temp);
diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c
index d3da0eab22c..84743b8da51 100644
--- a/storage/myisam/myisamlog.c
+++ b/storage/myisam/myisamlog.c
@@ -619,7 +619,7 @@ static int examine_log(char * file_name, char **table_names)
case MI_LOG_LOCK:
if (my_b_read(&cache,(uchar*) head,sizeof(lock_command)))
goto err;
- memcpy_fixed(&lock_command,head,sizeof(lock_command));
+ memcpy(&lock_command, head, sizeof(lock_command));
if (verbose && !record_pos_file &&
(!table_names[0] || (curr_file_info && curr_file_info->used)))
printf_log("%s: %s(%d) -> %d\n",FILENAME(curr_file_info),
@@ -728,7 +728,7 @@ static void fix_blob_pointers(MI_INFO *info, uchar *record)
blob != end ;
blob++)
{
- memcpy_fixed(record+blob->offset+blob->pack_length,&pos,sizeof(char*));
+ memcpy(record+blob->offset+blob->pack_length, &pos, sizeof(char*));
pos+=_mi_calc_blob_length(blob->pack_length,record+blob->offset);
}
}
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index 4cd305fdc69..84a7f2a1ba9 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -1040,7 +1040,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
{
uint field_length=count->field_length -portable_sizeof_char_ptr;
ulong blob_length= _mi_calc_blob_length(field_length, start_pos);
- memcpy_fixed((char*) &pos, start_pos+field_length,sizeof(char*));
+ memcpy(&pos, start_pos+field_length, sizeof(char*));
end_pos=pos+blob_length;
tot_blob_length+=blob_length;
set_if_bigger(count->max_length,blob_length);
@@ -1889,7 +1889,7 @@ static uint join_same_trees(HUFF_COUNTS *huff_counts, uint trees)
i->tree->tree_pack_length+j->tree->tree_pack_length+
ALLOWED_JOIN_DIFF)
{
- memcpy_fixed((uchar*) i->counts,(uchar*) count.counts,
+ memcpy(i->counts, count.counts,
sizeof(count.counts[0])*256);
my_free(j->tree->element_buffer);
j->tree->element_buffer=0;
@@ -2040,7 +2040,7 @@ static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
uchar *buff= (uchar*) file_buffer.pos;
bzero(buff,HEAD_LENGTH);
- memcpy_fixed(buff,myisam_pack_file_magic,4);
+ memcpy(buff,myisam_pack_file_magic,4);
int4store(buff+4,head_length);
int4store(buff+8, mrg->min_pack_length);
int4store(buff+12,mrg->max_pack_length);
@@ -2697,8 +2697,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
DBUG_PRINT("fields", ("FIELD_BLOB %lu bytes, bits: %2u",
blob_length, count->length_bits));
write_bits(blob_length,count->length_bits);
- memcpy_fixed(&blob,end_pos-portable_sizeof_char_ptr,
- sizeof(char*));
+ memcpy(&blob, end_pos-portable_sizeof_char_ptr, sizeof(char*));
blob_end=blob+blob_length;
/* Encode the blob bytes. */
for ( ; blob < blob_end ; blob++)
diff --git a/storage/myisam/rt_test.c b/storage/myisam/rt_test.c
index 4a9b61605d9..7233300c539 100644
--- a/storage/myisam/rt_test.c
+++ b/storage/myisam/rt_test.c
@@ -366,25 +366,6 @@ static int read_with_pos (MI_INFO * file,int silent)
}
-#ifdef NOT_USED
-static void bprint_record(char * record,
- my_off_t offs __attribute__((unused)),
- const char * tail)
-{
- int i;
- char * pos;
- i=(unsigned char)record[0];
- printf("%02X ",i);
-
- for( pos=record+1, i=0; i<32; i++,pos++){
- int b=(unsigned char)*pos;
- printf("%02X",b);
- }
- printf("%s",tail);
-}
-#endif
-
-
static void print_record(uchar * record,
my_off_t offs __attribute__((unused)),
const char * tail)
@@ -424,30 +405,6 @@ static void create_record1(uchar *record,uint rownr)
}
}
-#ifdef NOT_USED
-
-static void create_record0(uchar *record,uint rownr)
-{
- int i;
- char * pos;
- double c=rownr+10;
- double c0=0;
-
- bzero((char*) record,MAX_REC_LENGTH);
- record[0]=0x01; /* DEL marker */
-
- for ( pos=record+1, i=0; i<ndims; i++)
- {
- memcpy(pos,&c0,sizeof(c0));
- float8store(pos,c0);
- pos+=sizeof(c0);
- memcpy(pos,&c,sizeof(c));
- float8store(pos,c);
- pos+=sizeof(c);
- }
-}
-
-#endif
static void create_record(uchar *record,uint rownr)
{
diff --git a/storage/myisam/sp_key.c b/storage/myisam/sp_key.c
index 3748a38ff81..bde0e1cb388 100644
--- a/storage/myisam/sp_key.c
+++ b/storage/myisam/sp_key.c
@@ -47,7 +47,7 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
pos = (uchar*)record + keyseg->start;
dlen = _mi_calc_blob_length(keyseg->bit_start, pos);
- memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*));
+ memcpy(&dptr, pos + keyseg->bit_start, sizeof(char*));
if (!dptr)
{
my_errno= HA_ERR_NULL_IN_SPATIAL;
diff --git a/storage/myisam/sp_test.c b/storage/myisam/sp_test.c
index 069f43c320d..d86fdc03908 100644
--- a/storage/myisam/sp_test.c
+++ b/storage/myisam/sp_test.c
@@ -299,26 +299,6 @@ static int read_with_pos (MI_INFO * file,int silent)
}
-#ifdef NOT_USED
-static void bprint_record(uchar * record,
- my_off_t offs __attribute__((unused)),
- const char * tail)
-{
- int i;
- char * pos;
- i=(unsigned char)record[0];
- printf("%02X ",i);
-
- for( pos=record+1, i=0; i<32; i++,pos++)
- {
- int b=(unsigned char)*pos;
- printf("%02X",b);
- }
- printf("%s",tail);
-}
-#endif
-
-
static void print_record(uchar * record, my_off_t offs,const char * tail)
{
uchar *pos;
@@ -330,7 +310,7 @@ static void print_record(uchar * record, my_off_t offs,const char * tail)
len=sint4korr(pos);
pos+=4;
printf(" len=%d ",len);
- memcpy_fixed(&ptr,pos,sizeof(char*));
+ memcpy(&ptr, pos, sizeof(char*));
if (ptr)
rtree_PrintWKB((uchar*) ptr,SPDIMS);
else
@@ -340,34 +320,6 @@ static void print_record(uchar * record, my_off_t offs,const char * tail)
}
-#ifdef NOT_USED
-static void create_point(uchar *record,uint rownr)
-{
- uint tmp;
- char *ptr;
- char *pos=record;
- double x[200];
- int i;
-
- for(i=0;i<SPDIMS;i++)
- x[i]=rownr;
-
- bzero((char*) record,MAX_REC_LENGTH);
- *pos=0x01; /* DEL marker */
- pos++;
-
- memset(blob_key,0,sizeof(blob_key));
- tmp=rtree_CreatePointWKB(x,SPDIMS,blob_key);
-
- int4store(pos,tmp);
- pos+=4;
-
- ptr=blob_key;
- memcpy_fixed(pos,&ptr,sizeof(char*));
-}
-#endif
-
-
static void create_linestring(uchar *record,uint rownr)
{
uint tmp;
@@ -376,23 +328,23 @@ static void create_linestring(uchar *record,uint rownr)
double x[200];
int i,j;
int npoints=2;
-
+
for(j=0;j<npoints;j++)
for(i=0;i<SPDIMS;i++)
x[i+j*SPDIMS]=rownr*j;
-
+
bzero((char*) record,MAX_REC_LENGTH);
*pos=0x01; /* DEL marker */
pos++;
-
+
memset(blob_key,0,sizeof(blob_key));
tmp=rtree_CreateLineStringWKB(x,SPDIMS,npoints, (uchar*) blob_key);
-
+
int4store(pos,tmp);
pos+=4;
-
+
ptr=blob_key;
- memcpy_fixed(pos,&ptr,sizeof(char*));
+ memcpy(pos, &ptr, sizeof(char*));
}
@@ -401,7 +353,7 @@ static void create_key(uchar *key,uint rownr)
double c=rownr;
uchar *pos;
uint i;
-
+
bzero(key,MAX_REC_LENGTH);
for (pos=key, i=0; i<2*SPDIMS; i++)
{
@@ -426,27 +378,6 @@ static void print_key(const uchar *key,const char * tail)
}
-#ifdef NOT_USED
-
-static int rtree_CreatePointWKB(double *ords, uint n_dims, uchar *wkb)
-{
- uint i;
-
- *wkb = wkbXDR;
- ++wkb;
- int4store(wkb, wkbPoint);
- wkb += 4;
-
- for (i=0; i < n_dims; ++i)
- {
- float8store(wkb, ords[i]);
- wkb += 8;
- }
- return 5 + n_dims * 8;
-}
-#endif
-
-
static int rtree_CreateLineStringWKB(double *ords, uint n_dims, uint n_points,
uchar *wkb)
{
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index f41629ff882..f62aff4e383 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -642,7 +642,7 @@ extern "C" MI_INFO *myisammrg_attach_children_callback(void *callback_param)
my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
}
DBUG_PRINT("myrg", ("MyISAM handle: 0x%lx my_errno: %d",
- my_errno ? NULL : (long) myisam, my_errno));
+ my_errno ? 0L : (long) myisam, my_errno));
end:
DBUG_RETURN(myisam);
diff --git a/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp b/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp
index 8126267f946..95dbf5204f1 100644
--- a/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp
+++ b/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp
@@ -203,7 +203,7 @@ Uint32 FsOpenReq::getVersion(const Uint32 fileNumber[]){
inline
void FsOpenReq::setVersion(Uint32 fileNumber[], Uint8 val){
const Uint32 t = fileNumber[3];
- fileNumber[3] = t & 0x00FFFFFF | (((Uint32)val) << 24);
+ fileNumber[3] = (t & 0x00FFFFFF) | (((Uint32)val) << 24);
}
inline
@@ -214,7 +214,7 @@ Uint32 FsOpenReq::getSuffix(const Uint32 fileNumber[]){
inline
void FsOpenReq::setSuffix(Uint32 fileNumber[], Uint8 val){
const Uint32 t = fileNumber[3];
- fileNumber[3] = t & 0xFF00FFFF | (((Uint32)val) << 16);
+ fileNumber[3] = (t & 0xFF00FFFF) | (((Uint32)val) << 16);
}
inline
@@ -225,7 +225,7 @@ Uint32 FsOpenReq::v1_getDisk(const Uint32 fileNumber[]){
inline
void FsOpenReq::v1_setDisk(Uint32 fileNumber[], Uint8 val){
const Uint32 t = fileNumber[3];
- fileNumber[3] = t & 0xFFFF00FF | (((Uint32)val) << 8);
+ fileNumber[3] = (t & 0xFFFF00FF) | (((Uint32)val) << 8);
}
inline
@@ -266,7 +266,7 @@ Uint32 FsOpenReq::v1_getP(const Uint32 fileNumber[]){
inline
void FsOpenReq::v1_setP(Uint32 fileNumber[], Uint8 val){
const Uint32 t = fileNumber[3];
- fileNumber[3] = t & 0xFFFFFF00 | val;
+ fileNumber[3] = (t & 0xFFFFFF00) | val;
}
/****************/
diff --git a/storage/ndb/include/util/ndb_opts.h b/storage/ndb/include/util/ndb_opts.h
index f18bb9646cc..59d9eaf4d33 100644
--- a/storage/ndb/include/util/ndb_opts.h
+++ b/storage/ndb/include/util/ndb_opts.h
@@ -58,40 +58,40 @@ const char *opt_debug= 0;
"Set connect string for connecting to ndb_mgmd. " \
"Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \
"Overrides specifying entries in NDB_CONNECTSTRING and my.cnf", \
- (uchar**) &opt_ndb_connectstring, (uchar**) &opt_ndb_connectstring, \
+ &opt_ndb_connectstring, &opt_ndb_connectstring, \
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
{ "ndb-mgmd-host", OPT_NDB_MGMD, \
"Set host and port for connecting to ndb_mgmd. " \
"Syntax: <hostname>[:<port>].", \
- (uchar**) &opt_ndb_mgmd, (uchar**) &opt_ndb_mgmd, 0, \
+ &opt_ndb_mgmd, &opt_ndb_mgmd, 0, \
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
{ "ndb-nodeid", OPT_NDB_NODEID, \
"Set node id for this node.", \
- (uchar**) &opt_ndb_nodeid, (uchar**) &opt_ndb_nodeid, 0, \
+ &opt_ndb_nodeid, &opt_ndb_nodeid, 0, \
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
{ "ndb-shm", OPT_NDB_SHM,\
"Allow optimizing using shared memory connections when available",\
- (uchar**) &opt_ndb_shm, (uchar**) &opt_ndb_shm, 0,\
+ &opt_ndb_shm, &opt_ndb_shm, 0,\
GET_BOOL, NO_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0 },\
{"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,\
"Select nodes for transactions in a more optimal way",\
- (uchar**) &opt_ndb_optimized_node_selection,\
- (uchar**) &opt_ndb_optimized_node_selection, 0,\
+ &opt_ndb_optimized_node_selection,\
+ &opt_ndb_optimized_node_selection, 0,\
GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},\
{ "connect-string", OPT_NDB_CONNECTSTRING, "same as --ndb-connectstring",\
- (uchar**) &opt_ndb_connectstring, (uchar**) &opt_ndb_connectstring, \
+ &opt_ndb_connectstring, &opt_ndb_connectstring, \
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
{ "core-file", OPT_WANT_CORE, "Write core on errors.",\
- (uchar**) &opt_core, (uchar**) &opt_core, 0,\
+ &opt_core, &opt_core, 0,\
GET_BOOL, NO_ARG, OPT_WANT_CORE_DEFAULT, 0, 0, 0, 0, 0},\
{"character-sets-dir", OPT_CHARSETS_DIR,\
- "Directory where character sets are.", (uchar**) &charsets_dir,\
- (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}\
+ "Directory where character sets are.", &charsets_dir,\
+ &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}\
#ifndef DBUG_OFF
#define NDB_STD_OPTS(prog_name) \
{ "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \
- (uchar**) &opt_debug, (uchar**) &opt_debug, \
+ &opt_debug, &opt_debug, \
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
NDB_STD_OPTS_COMMON
#else
diff --git a/storage/ndb/src/cw/cpcd/main.cpp b/storage/ndb/src/cw/cpcd/main.cpp
index d5c31d610cb..b750c00bc2a 100644
--- a/storage/ndb/src/cw/cpcd/main.cpp
+++ b/storage/ndb/src/cw/cpcd/main.cpp
@@ -39,22 +39,22 @@ static const char *user = 0;
static struct my_option my_long_options[] =
{
{ "work-dir", 'w', "Work directory",
- (uchar**) &work_dir, (uchar**) &work_dir, 0,
+ &work_dir, &work_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "port", 'p', "TCP port to listen on",
- (uchar**) &port, (uchar**) &port, 0,
+ &port, &port, 0,
GET_INT, REQUIRED_ARG, CPCD_DEFAULT_TCP_PORT, 0, 0, 0, 0, 0 },
{ "syslog", 'S', "Log events to syslog",
- (uchar**) &use_syslog, (uchar**) &use_syslog, 0,
+ &use_syslog, &use_syslog, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "logfile", 'L', "File to log events to",
- (uchar**) &logfile, (uchar**) &logfile, 0,
+ &logfile, &logfile, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "debug", 'D', "Enable debug mode",
- (uchar**) &debug, (uchar**) &debug, 0,
+ &debug, &debug, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "user", 'u', "Run as user",
- (uchar**) &user, (uchar**) &user, 0,
+ &user, &user, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
index 67ce7a1760a..3917d415575 100644
--- a/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
+++ b/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
@@ -840,13 +840,13 @@ Dbtux::TreeEnt::cmp(const TreeEnt ent) const
*/
const unsigned version_wrap_limit = (1 << (ZTUP_VERSION_BITS - 1));
if (m_tupVersion < ent.m_tupVersion) {
- if (ent.m_tupVersion - m_tupVersion < version_wrap_limit)
+ if (unsigned(ent.m_tupVersion - m_tupVersion) < version_wrap_limit)
return -1;
else
return +1;
}
if (m_tupVersion > ent.m_tupVersion) {
- if (m_tupVersion - ent.m_tupVersion < version_wrap_limit)
+ if (unsigned(m_tupVersion - ent.m_tupVersion) < version_wrap_limit)
return +1;
else
return -1;
diff --git a/storage/ndb/src/kernel/vm/Configuration.cpp b/storage/ndb/src/kernel/vm/Configuration.cpp
index 72770d35cde..f1e608738e3 100644
--- a/storage/ndb/src/kernel/vm/Configuration.cpp
+++ b/storage/ndb/src/kernel/vm/Configuration.cpp
@@ -74,35 +74,35 @@ static struct my_option my_long_options[] =
{ "initial", OPT_INITIAL,
"Perform initial start of ndbd, including cleaning the file system. "
"Consult documentation before using this",
- (uchar**) &_initial, (uchar**) &_initial, 0,
+ &_initial, &_initial, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "nostart", 'n',
"Don't start ndbd immediately. Ndbd will await command from ndb_mgmd",
- (uchar**) &_no_start, (uchar**) &_no_start, 0,
+ &_no_start, &_no_start, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "daemon", 'd', "Start ndbd as daemon (default)",
- (uchar**) &_daemon, (uchar**) &_daemon, 0,
+ &_daemon, &_daemon, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 },
{ "nodaemon", OPT_NODAEMON,
"Do not start ndbd as daemon, provided for testing purposes",
- (uchar**) &_no_daemon, (uchar**) &_no_daemon, 0,
+ &_no_daemon, &_no_daemon, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "foreground", OPT_FOREGROUND,
"Run real ndbd in foreground, provided for debugging purposes"
" (implies --nodaemon)",
- (uchar**) &_foreground, (uchar**) &_foreground, 0,
+ &_foreground, &_foreground, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "nowait-nodes", OPT_NOWAIT_NODES,
"Nodes that will not be waited for during start",
- (uchar**) &_nowait_nodes, (uchar**) &_nowait_nodes, 0,
+ &_nowait_nodes, &_nowait_nodes, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "initial-start", OPT_INITIAL_START,
"Perform initial start",
- (uchar**) &_initialstart, (uchar**) &_initialstart, 0,
+ &_initialstart, &_initialstart, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "bind-address", OPT_NOWAIT_NODES,
"Local bind address",
- (uchar**) &_bind_address, (uchar**) &_bind_address, 0,
+ &_bind_address, &_bind_address, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/src/mgmclient/main.cpp b/storage/ndb/src/mgmclient/main.cpp
index 980530953ad..7049bdd12e0 100644
--- a/storage/ndb/src/mgmclient/main.cpp
+++ b/storage/ndb/src/mgmclient/main.cpp
@@ -73,11 +73,11 @@ static struct my_option my_long_options[] =
NDB_STD_OPTS("ndb_mgm"),
{ "execute", 'e',
"execute command and exit",
- (uchar**) &opt_execute_str, (uchar**) &opt_execute_str, 0,
+ &opt_execute_str, &opt_execute_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "try-reconnect", 't',
"Specify number of tries for connecting to ndb_mgmd (0 = infinite)",
- (uchar**) &_try_reconnect, (uchar**) &_try_reconnect, 0,
+ &_try_reconnect, &_try_reconnect, 0,
GET_UINT, REQUIRED_ARG, 3, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/src/mgmsrv/main.cpp b/storage/ndb/src/mgmsrv/main.cpp
index 26198a44a23..e0d9a550cd2 100644
--- a/storage/ndb/src/mgmsrv/main.cpp
+++ b/storage/ndb/src/mgmsrv/main.cpp
@@ -142,29 +142,29 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_mgmd"),
{ "config-file", 'f', "Specify cluster configuration file",
- (uchar**) &opt_config_filename, (uchar**) &opt_config_filename, 0,
+ &opt_config_filename, &opt_config_filename, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "print-full-config", 'P', "Print full config and exit",
- (uchar**) &g_print_full_config, (uchar**) &g_print_full_config, 0,
+ &g_print_full_config, &g_print_full_config, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "daemon", 'd', "Run ndb_mgmd in daemon mode (default)",
- (uchar**) &opt_daemon, (uchar**) &opt_daemon, 0,
+ &opt_daemon, &opt_daemon, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 },
{ "interactive", OPT_INTERACTIVE,
"Run interactive. Not supported but provided for testing purposes",
- (uchar**) &opt_interactive, (uchar**) &opt_interactive, 0,
+ &opt_interactive, &opt_interactive, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-nodeid-checks", OPT_NO_NODEID_CHECKS,
"Do not provide any node id checks",
- (uchar**) &g_no_nodeid_checks, (uchar**) &g_no_nodeid_checks, 0,
+ &g_no_nodeid_checks, &g_no_nodeid_checks, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "nodaemon", OPT_NO_DAEMON,
"Don't run as daemon, but don't read from stdin",
- (uchar**) &opt_non_interactive, (uchar**) &opt_non_interactive, 0,
+ &opt_non_interactive, &opt_non_interactive, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "mycnf", 256,
"Read cluster config from my.cnf",
- (uchar**) &opt_mycnf, (uchar**) &opt_mycnf, 0,
+ &opt_mycnf, &opt_mycnf, 0,
GET_BOOL, 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}
};
diff --git a/storage/ndb/src/ndbapi/TransporterFacade.hpp b/storage/ndb/src/ndbapi/TransporterFacade.hpp
index 23fea8792f7..cbda9de6df1 100644
--- a/storage/ndb/src/ndbapi/TransporterFacade.hpp
+++ b/storage/ndb/src/ndbapi/TransporterFacade.hpp
@@ -366,8 +366,8 @@ bool
TransporterFacade::get_node_stopping(NodeId n) const {
const ClusterMgr::Node & node = theClusterMgr->getNodeInfo(n);
return (!node.m_state.getSingleUserMode() &&
- (node.m_state.startLevel == NodeState::SL_STOPPING_1) ||
- (node.m_state.startLevel == NodeState::SL_STOPPING_2));
+ ((node.m_state.startLevel == NodeState::SL_STOPPING_1) ||
+ (node.m_state.startLevel == NodeState::SL_STOPPING_2)));
}
inline
diff --git a/storage/ndb/test/ndbapi/testIndexStat.cpp b/storage/ndb/test/ndbapi/testIndexStat.cpp
index 559fade3132..3b3e593081b 100644
--- a/storage/ndb/test/ndbapi/testIndexStat.cpp
+++ b/storage/ndb/test/ndbapi/testIndexStat.cpp
@@ -1297,43 +1297,43 @@ my_long_options[] =
{
NDB_STD_OPTS("testIndexStat"),
{ "loglevel", 1001, "Logging level in this program 0-3 (default 0)",
- (uchar **)&g_opts.loglevel, (uchar **)&g_opts.loglevel, 0,
+ &g_opts.loglevel, &g_opts.loglevel, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "seed", 1002, "Random seed (0=loop number, default -1=random)",
- (uchar **)&g_opts.seed, (uchar **)&g_opts.seed, 0,
+ &g_opts.seed, &g_opts.seed, 0,
GET_INT, REQUIRED_ARG, -1, 0, 0, 0, 0, 0 },
{ "loop", 1003, "Number of test loops (default 1, 0=forever)",
- (uchar **)&g_opts.loop, (uchar **)&g_opts.loop, 0,
+ &g_opts.loop, &g_opts.loop, 0,
GET_INT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0 },
{ "rows", 1004, "Number of rows (default 100000)",
- (uchar **)&g_opts.rows, (uchar **)&g_opts.rows, 0,
+ &g_opts.rows, &g_opts.rows, 0,
GET_UINT, REQUIRED_ARG, 100000, 0, 0, 0, 0, 0 },
{ "ops", 1005, "Number of index scans per loop (default 1000)",
- (uchar **)&g_opts.ops, (uchar **)&g_opts.ops, 0,
+ &g_opts.ops, &g_opts.ops, 0,
GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0 },
{ "dupkeys", 1006, "Pct records per key (min 100, default 1000)",
- (uchar **)&g_opts.dupkeys, (uchar **)&g_opts.dupkeys, 0,
+ &g_opts.dupkeys, &g_opts.dupkeys, 0,
GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0 },
{ "scanpct", 1007, "Preferred max pct of total rows per scan (default 5)",
- (uchar **)&g_opts.scanpct, (uchar **)&g_opts.scanpct, 0,
+ &g_opts.scanpct, &g_opts.scanpct, 0,
GET_UINT, REQUIRED_ARG, 5, 0, 0, 0, 0, 0 },
{ "nullkeys", 1008, "Pct nulls in each key attribute (default 10)",
- (uchar **)&g_opts.nullkeys, (uchar **)&g_opts.nullkeys, 0,
+ &g_opts.nullkeys, &g_opts.nullkeys, 0,
GET_UINT, REQUIRED_ARG, 10, 0, 0, 0, 0, 0 },
{ "eqscans", 1009, "Pct scans for partial/full equality (default 50)",
- (uchar **)&g_opts.eqscans, (uchar **)&g_opts.eqscans, 0,
+ &g_opts.eqscans, &g_opts.eqscans, 0,
GET_UINT, REQUIRED_ARG, 50, 0, 0, 0, 0, 0 },
{ "dupscans", 1010, "Pct scans using same bounds (default 10)",
- (uchar **)&g_opts.dupscans, (uchar **)&g_opts.dupscans, 0,
+ &g_opts.dupscans, &g_opts.dupscans, 0,
GET_UINT, REQUIRED_ARG, 10, 0, 0, 0, 0, 0 },
{ "keeptable", 1011, "Use existing table and data if any and do not drop",
- (uchar **)&g_opts.keeptable, (uchar **)&g_opts.keeptable, 0,
+ &g_opts.keeptable, &g_opts.keeptable, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-extra-checks", 1012, "Omit expensive consistency checks",
- (uchar **)&g_opts.nochecks, (uchar **)&g_opts.nochecks, 0,
+ &g_opts.nochecks, &g_opts.nochecks, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "abort-on-error", 1013, "Dump core on any error",
- (uchar **)&g_opts.abort, (uchar **)&g_opts.abort, 0,
+ &g_opts.abort, &g_opts.abort, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0,
0, 0, 0,
diff --git a/storage/ndb/test/ndbapi/test_event_merge.cpp b/storage/ndb/test/ndbapi/test_event_merge.cpp
index d40b985adc2..c4109a23119 100644
--- a/storage/ndb/test/ndbapi/test_event_merge.cpp
+++ b/storage/ndb/test/ndbapi/test_event_merge.cpp
@@ -2184,57 +2184,57 @@ my_long_options[] =
{
NDB_STD_OPTS("test_event_merge"),
{ "abort-on-error", 1001, "Do abort() on any error",
- (uchar **)&g_opts.abort_on_error, (uchar **)&g_opts.abort_on_error, 0,
+ &g_opts.abort_on_error, &g_opts.abort_on_error, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "loglevel", 1002, "Logging level in this program 0-3 (default 0)",
- (uchar **)&g_opts.loglevel, (uchar **)&g_opts.loglevel, 0,
+ &g_opts.loglevel, &g_opts.loglevel, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "loop", 1003, "Number of test loops (default 5, 0=forever)",
- (uchar **)&g_opts.loop, (uchar **)&g_opts.loop, 0,
+ &g_opts.loop, &g_opts.loop, 0,
GET_INT, REQUIRED_ARG, 5, 0, 0, 0, 0, 0 },
{ "maxops", 1004, "Approx number of PK operations per table (default 1000)",
- (uchar **)&g_opts.maxops, (uchar **)&g_opts.maxops, 0,
+ &g_opts.maxops, &g_opts.maxops, 0,
GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0 },
{ "maxpk", 1005, "Number of different PK values (default 10, max 1000)",
- (uchar **)&g_opts.maxpk, (uchar **)&g_opts.maxpk, 0,
+ &g_opts.maxpk, &g_opts.maxpk, 0,
GET_UINT, REQUIRED_ARG, 10, 0, 0, 0, 0, 0 },
{ "maxtab", 1006, "Number of tables (default 10, max 100)",
- (uchar **)&g_opts.maxtab, (uchar **)&g_opts.maxtab, 0,
+ &g_opts.maxtab, &g_opts.maxtab, 0,
GET_INT, REQUIRED_ARG, 10, 0, 0, 0, 0, 0 },
{ "no-blobs", 1007, "Omit blob attributes (5.0: true)",
- (uchar **)&g_opts.no_blobs, (uchar **)&g_opts.no_blobs, 0,
+ &g_opts.no_blobs, &g_opts.no_blobs, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-implicit-nulls", 1008, "Insert must include all attrs"
" i.e. no implicit NULLs",
- (uchar **)&g_opts.no_implicit_nulls, (uchar **)&g_opts.no_implicit_nulls, 0,
+ &g_opts.no_implicit_nulls, &g_opts.no_implicit_nulls, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-missing-update", 1009, "Update must include all non-PK attrs",
- (uchar **)&g_opts.no_missing_update, (uchar **)&g_opts.no_missing_update, 0,
+ &g_opts.no_missing_update, &g_opts.no_missing_update, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-multiops", 1010, "Allow only 1 operation per commit",
- (uchar **)&g_opts.no_multiops, (uchar **)&g_opts.no_multiops, 0,
+ &g_opts.no_multiops, &g_opts.no_multiops, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-nulls", 1011, "Create no NULL values",
- (uchar **)&g_opts.no_nulls, (uchar **)&g_opts.no_nulls, 0,
+ &g_opts.no_nulls, &g_opts.no_nulls, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "one-blob", 1012, "Only one blob attribute (default 2)",
- (uchar **)&g_opts.one_blob, (uchar **)&g_opts.one_blob, 0,
+ &g_opts.one_blob, &g_opts.one_blob, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "opstring", 1013, "Operations to run e.g. idiucdc (c is commit) or"
" iuuc:uudc (the : separates loops)",
- (uchar **)&g_opts.opstring, (uchar **)&g_opts.opstring, 0,
+ &g_opts.opstring, &g_opts.opstring, 0,
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "seed", 1014, "Random seed (0=loop number, default -1=random)",
- (uchar **)&g_opts.seed, (uchar **)&g_opts.seed, 0,
+ &g_opts.seed, &g_opts.seed, 0,
GET_INT, REQUIRED_ARG, -1, 0, 0, 0, 0, 0 },
{ "separate-events", 1015, "Do not combine events per GCI (5.0: true)",
- (uchar **)&g_opts.separate_events, (uchar **)&g_opts.separate_events, 0,
+ &g_opts.separate_events, &g_opts.separate_events, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "tweak", 1016, "Whatever the source says",
- (uchar **)&g_opts.tweak, (uchar **)&g_opts.tweak, 0,
+ &g_opts.tweak, &g_opts.tweak, 0,
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "use-table", 1017, "Use existing tables",
- (uchar **)&g_opts.use_table, (uchar **)&g_opts.use_table, 0,
+ &g_opts.use_table, &g_opts.use_table, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0,
0, 0, 0,
diff --git a/storage/ndb/test/ndbapi/test_event_multi_table.cpp b/storage/ndb/test/ndbapi/test_event_multi_table.cpp
index 36fb6f511ae..7fbd43ef5eb 100644
--- a/storage/ndb/test/ndbapi/test_event_multi_table.cpp
+++ b/storage/ndb/test/ndbapi/test_event_multi_table.cpp
@@ -258,7 +258,7 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS(""),
{ "database", 'd', "Name of database table is in",
- (gptr*) &_dbname, (gptr*) &_dbname, 0,
+ &_dbname, &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/test/run-test/main.cpp b/storage/ndb/test/run-test/main.cpp
index b5c4385f5d3..397eaf8b77e 100644
--- a/storage/ndb/test/run-test/main.cpp
+++ b/storage/ndb/test/run-test/main.cpp
@@ -77,60 +77,60 @@ my_bool opt_core;
static struct my_option g_options[] =
{
{ "help", '?', "Display this help and exit.",
- (uchar **) &g_help, (uchar **) &g_help,
+ &g_help, &g_help,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "version", 'V', "Output version information and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "clusters", 256, "Cluster",
- (uchar **) &g_clusters, (uchar **) &g_clusters,
+ &g_clusters, &g_clusters,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "replicate", 1024, "replicate",
- (uchar **) &g_dummy, (uchar **) &g_dummy,
+ &g_dummy, &g_dummy,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "log-file", 256, "log-file",
- (uchar **) &g_log_filename, (uchar **) &g_log_filename,
+ &g_log_filename, &g_log_filename,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "testcase-file", 'f', "testcase-file",
- (uchar **) &g_test_case_filename, (uchar **) &g_test_case_filename,
+ &g_test_case_filename, &g_test_case_filename,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "report-file", 'r', "report-file",
- (uchar **) &g_report_filename, (uchar **) &g_report_filename,
+ &g_report_filename, &g_report_filename,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "basedir", 256, "Base path",
- (uchar **) &g_basedir, (uchar **) &g_basedir,
+ &g_basedir, &g_basedir,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "baseport", 256, "Base port",
- (uchar **) &g_baseport, (uchar **) &g_baseport,
+ &g_baseport, &g_baseport,
0, GET_INT, REQUIRED_ARG, g_baseport, 0, 0, 0, 0, 0},
{ "prefix", 256, "mysql install dir",
- (uchar **) &g_prefix, (uchar **) &g_prefix,
+ &g_prefix, &g_prefix,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "verbose", 'v', "Verbosity",
- (uchar **) &g_verbosity, (uchar **) &g_verbosity,
+ &g_verbosity, &g_verbosity,
0, GET_INT, REQUIRED_ARG, g_verbosity, 0, 0, 0, 0, 0},
{ "configure", 256, "configure",
- (uchar **) &g_do_setup, (uchar **) &g_do_setup,
+ &g_do_setup, &g_do_setup,
0, GET_INT, REQUIRED_ARG, g_do_setup, 0, 0, 0, 0, 0 },
{ "deploy", 256, "deploy",
- (uchar **) &g_do_deploy, (uchar **) &g_do_deploy,
+ &g_do_deploy, &g_do_deploy,
0, GET_INT, REQUIRED_ARG, g_do_deploy, 0, 0, 0, 0, 0 },
{ "sshx", 256, "sshx",
- (uchar **) &g_do_sshx, (uchar **) &g_do_sshx,
+ &g_do_sshx, &g_do_sshx,
0, GET_INT, REQUIRED_ARG, g_do_sshx, 0, 0, 0, 0, 0 },
{ "start", 256, "start",
- (uchar **) &g_do_start, (uchar **) &g_do_start,
+ &g_do_start, &g_do_start,
0, GET_INT, REQUIRED_ARG, g_do_start, 0, 0, 0, 0, 0 },
{ "fqpn", 256, "Fully qualified path-names ",
- (uchar **) &g_fqpn, (uchar **) &g_fqpn,
+ &g_fqpn, &g_fqpn,
0, GET_INT, REQUIRED_ARG, g_fqpn, 0, 0, 0, 0, 0 },
{ "default-ports", 256, "Use default ports when possible",
- (uchar **) &g_default_ports, (uchar **) &g_default_ports,
+ &g_default_ports, &g_default_ports,
0, GET_INT, REQUIRED_ARG, g_default_ports, 0, 0, 0, 0, 0 },
{ "mode", 256, "Mode 0=interactive 1=regression 2=bench",
- (uchar **) &g_mode, (uchar **) &g_mode,
+ &g_mode, &g_mode,
0, GET_INT, REQUIRED_ARG, g_mode, 0, 0, 0, 0, 0 },
{ "quit", 256, "Quit before starting tests",
- (uchar **) &g_mode, (uchar **) &g_do_quit,
+ &g_mode, &g_do_quit,
0, GET_BOOL, NO_ARG, g_do_quit, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/test/src/NDBT_Test.cpp b/storage/ndb/test/src/NDBT_Test.cpp
index 69f3723ca75..b7b830af23d 100644
--- a/storage/ndb/test/src/NDBT_Test.cpp
+++ b/storage/ndb/test/src/NDBT_Test.cpp
@@ -1195,35 +1195,35 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS(""),
{ "print", OPT_PRINT, "Print execution tree",
- (uchar **) &opt_print, (uchar **) &opt_print, 0,
+ &opt_print, &opt_print, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "print_html", OPT_PRINT_HTML, "Print execution tree in html table format",
- (uchar **) &opt_print_html, (uchar **) &opt_print_html, 0,
+ &opt_print_html, &opt_print_html, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "print_cases", OPT_PRINT_CASES, "Print list of test cases",
- (uchar **) &opt_print_cases, (uchar **) &opt_print_cases, 0,
+ &opt_print_cases, &opt_print_cases, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "records", 'r', "Number of records",
- (uchar **) &opt_records, (uchar **) &opt_records, 0,
+ &opt_records, &opt_records, 0,
GET_INT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0 },
{ "loops", 'l', "Number of loops",
- (uchar **) &opt_loops, (uchar **) &opt_loops, 0,
+ &opt_loops, &opt_loops, 0,
GET_INT, REQUIRED_ARG, 5, 0, 0, 0, 0, 0 },
{ "seed", 1024, "Random seed",
- (uchar **) &opt_seed, (uchar **) &opt_seed, 0,
+ &opt_seed, &opt_seed, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "testname", 'n', "Name of test to run",
- (uchar **) &opt_testname, (uchar **) &opt_testname, 0,
+ &opt_testname, &opt_testname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "remote_mgm", 'm',
"host:port to mgmsrv of remote cluster",
- (uchar **) &opt_remote_mgm, (uchar **) &opt_remote_mgm, 0,
+ &opt_remote_mgm, &opt_remote_mgm, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "timer", 't', "Print execution time",
- (uchar **) &opt_timer, (uchar **) &opt_timer, 0,
+ &opt_timer, &opt_timer, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "verbose", 'v', "Print verbose status",
- (uchar **) &opt_verbose, (uchar **) &opt_verbose, 0,
+ &opt_verbose, &opt_verbose, 0,
GET_BOOL, 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}
};
diff --git a/storage/ndb/test/tools/connect.cpp b/storage/ndb/test/tools/connect.cpp
index 278dbe833ea..d12d1b7a608 100644
--- a/storage/ndb/test/tools/connect.cpp
+++ b/storage/ndb/test/tools/connect.cpp
@@ -31,14 +31,14 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "loop", 'l', "loops",
- (gptr*) &_loop, (gptr*) &_loop, 0,
+ &_loop, &_loop, 0,
GET_INT, REQUIRED_ARG, _loop, 0, 0, 0, 0, 0 },
{ "sleep", 's', "Sleep (ms) between connection attempt",
- (gptr*) &_sleep, (gptr*) &_sleep, 0,
+ &_sleep, &_sleep, 0,
GET_INT, REQUIRED_ARG, _sleep, 0, 0, 0, 0, 0 },
{ "drop", 'd',
"Drop event operations before disconnect (0 = no, 1 = yes, else rand",
- (gptr*) &_drop, (gptr*) &_drop, 0,
+ &_drop, &_drop, 0,
GET_INT, REQUIRED_ARG, _drop, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/delete_all.cpp b/storage/ndb/tools/delete_all.cpp
index 1bf89f5a32f..23d1ef387d2 100644
--- a/storage/ndb/tools/delete_all.cpp
+++ b/storage/ndb/tools/delete_all.cpp
@@ -36,16 +36,16 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (uchar**) &_dbname, (uchar**) &_dbname, 0,
+ &_dbname, &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "transactional", 't', "Single transaction (may run out of operations)",
- (uchar**) &_transactional, (uchar**) &_transactional, 0,
+ &_transactional, &_transactional, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "tupscan", 999, "Run tupscan",
- (uchar**) &_tupscan, (uchar**) &_tupscan, 0,
+ &_tupscan, &_tupscan, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "diskscan", 999, "Run diskcan",
- (uchar**) &_diskscan, (uchar**) &_diskscan, 0,
+ &_diskscan, &_diskscan, 0,
GET_BOOL, 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}
};
diff --git a/storage/ndb/tools/desc.cpp b/storage/ndb/tools/desc.cpp
index 831005139de..f31b4f6ae1b 100644
--- a/storage/ndb/tools/desc.cpp
+++ b/storage/ndb/tools/desc.cpp
@@ -39,16 +39,16 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (uchar**) &_dbname, (uchar**) &_dbname, 0,
+ &_dbname, &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "unqualified", 'u', "Use unqualified table names",
- (uchar**) &_unqualified, (uchar**) &_unqualified, 0,
+ &_unqualified, &_unqualified, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "extra-partition-info", 'p', "Print more info per partition",
- (uchar**) &_partinfo, (uchar**) &_partinfo, 0,
+ &_partinfo, &_partinfo, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "retries", 'r', "Retry every second for # retries",
- (uchar**) &_retries, (uchar**) &_retries, 0,
+ &_retries, &_retries, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/drop_index.cpp b/storage/ndb/tools/drop_index.cpp
index ec88f331a80..82dd595f7df 100644
--- a/storage/ndb/tools/drop_index.cpp
+++ b/storage/ndb/tools/drop_index.cpp
@@ -30,7 +30,7 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (uchar**) &_dbname, (uchar**) &_dbname, 0,
+ &_dbname, &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/drop_tab.cpp b/storage/ndb/tools/drop_tab.cpp
index 8d07afbbf50..1fba31b5c8a 100644
--- a/storage/ndb/tools/drop_tab.cpp
+++ b/storage/ndb/tools/drop_tab.cpp
@@ -30,7 +30,7 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (uchar**) &_dbname, (uchar**) &_dbname, 0,
+ &_dbname, &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/listTables.cpp b/storage/ndb/tools/listTables.cpp
index 45129cb34af..bd70587f77e 100644
--- a/storage/ndb/tools/listTables.cpp
+++ b/storage/ndb/tools/listTables.cpp
@@ -256,22 +256,22 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_show_tables"),
{ "database", 'd', "Name of database table is in",
- (uchar**) &_dbname, (uchar**) &_dbname, 0,
+ &_dbname, &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "loops", 'l', "loops",
- (uchar**) &_loops, (uchar**) &_loops, 0,
+ &_loops, &_loops, 0,
GET_INT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0 },
{ "type", 't', "type",
- (uchar**) &_type, (uchar**) &_type, 0,
+ &_type, &_type, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "unqualified", 'u', "Use unqualified table names",
- (uchar**) &_unqualified, (uchar**) &_unqualified, 0,
+ &_unqualified, &_unqualified, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "parsable", 'p', "Return output suitable for mysql LOAD DATA INFILE",
- (uchar**) &_parsable, (uchar**) &_parsable, 0,
+ &_parsable, &_parsable, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "show-temp-status", OPT_SHOW_TMP_STATUS, "Show table temporary flag",
- (uchar**) &show_temp_status, (uchar**) &show_temp_status, 0,
+ &show_temp_status, &show_temp_status, 0,
GET_BOOL, 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}
};
diff --git a/storage/ndb/tools/ndb_config.cpp b/storage/ndb/tools/ndb_config.cpp
index af36103f947..0df88dc0167 100644
--- a/storage/ndb/tools/ndb_config.cpp
+++ b/storage/ndb/tools/ndb_config.cpp
@@ -58,37 +58,37 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_config"),
{ "nodes", 256, "Print nodes",
- (uchar**) &g_nodes, (uchar**) &g_nodes,
+ &g_nodes, &g_nodes,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "connections", 256, "Print connections",
- (uchar**) &g_connections, (uchar**) &g_connections,
+ &g_connections, &g_connections,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "query", 'q', "Query option(s)",
- (uchar**) &g_query, (uchar**) &g_query,
+ &g_query, &g_query,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "host", 256, "Host",
- (uchar**) &g_host, (uchar**) &g_host,
+ &g_host, &g_host,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "type", 258, "Type of node/connection",
- (uchar**) &g_type, (uchar**) &g_type,
+ &g_type, &g_type,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "id", 258, "Nodeid",
- (uchar**) &g_nodeid, (uchar**) &g_nodeid,
+ &g_nodeid, &g_nodeid,
0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "nodeid", 258, "Nodeid",
- (uchar**) &g_nodeid, (uchar**) &g_nodeid,
+ &g_nodeid, &g_nodeid,
0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "fields", 'f', "Field separator",
- (uchar**) &g_field_delimiter, (uchar**) &g_field_delimiter,
+ &g_field_delimiter, &g_field_delimiter,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "rows", 'r', "Row separator",
- (uchar**) &g_row_delimiter, (uchar**) &g_row_delimiter,
+ &g_row_delimiter, &g_row_delimiter,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "config-file", 256, "Path to config.ini",
- (uchar**) &g_config_file, (uchar**) &g_config_file,
+ &g_config_file, &g_config_file,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "mycnf", 256, "Read config from my.cnf",
- (uchar**) &g_mycnf, (uchar**) &g_mycnf,
+ &g_mycnf, &g_mycnf,
0, GET_BOOL, 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}
};
diff --git a/storage/ndb/tools/restore/restore_main.cpp b/storage/ndb/tools/restore/restore_main.cpp
index 7db77524ad8..966c539cee9 100644
--- a/storage/ndb/tools/restore/restore_main.cpp
+++ b/storage/ndb/tools/restore/restore_main.cpp
@@ -100,99 +100,99 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_restore"),
{ "connect", 'c', "same as --connect-string",
- (uchar**) &opt_connect_str, (uchar**) &opt_connect_str, 0,
+ &opt_connect_str, &opt_connect_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "nodeid", 'n', "Backup files from node with id",
- (uchar**) &ga_nodeId, (uchar**) &ga_nodeId, 0,
+ &ga_nodeId, &ga_nodeId, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "backupid", 'b', "Backup id",
- (uchar**) &ga_backupId, (uchar**) &ga_backupId, 0,
+ &ga_backupId, &ga_backupId, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "restore_data", 'r',
"Restore table data/logs into NDB Cluster using NDBAPI",
- (uchar**) &_restore_data, (uchar**) &_restore_data, 0,
+ &_restore_data, &_restore_data, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "restore_meta", 'm',
"Restore meta data into NDB Cluster using NDBAPI",
- (uchar**) &_restore_meta, (uchar**) &_restore_meta, 0,
+ &_restore_meta, &_restore_meta, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-upgrade", 'u',
"Don't upgrade array type for var attributes, which don't resize VAR data and don't change column attributes",
- (uchar**) &ga_no_upgrade, (uchar**) &ga_no_upgrade, 0,
+ &ga_no_upgrade, &ga_no_upgrade, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-restore-disk-objects", 'd',
"Dont restore disk objects (tablespace/logfilegroups etc)",
- (uchar**) &_no_restore_disk, (uchar**) &_no_restore_disk, 0,
+ &_no_restore_disk, &_no_restore_disk, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "restore_epoch", 'e',
"Restore epoch info into the status table. Convenient on a MySQL Cluster "
"replication slave, for starting replication. The row in "
NDB_REP_DB "." NDB_APPLY_TABLE " with id 0 will be updated/inserted.",
- (uchar**) &ga_restore_epoch, (uchar**) &ga_restore_epoch, 0,
+ &ga_restore_epoch, &ga_restore_epoch, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "skip-table-check", 's', "Skip table structure check during restore of data",
- (uchar**) &ga_skip_table_check, (uchar**) &ga_skip_table_check, 0,
+ &ga_skip_table_check, &ga_skip_table_check, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "parallelism", 'p',
"No of parallel transactions during restore of data."
"(parallelism can be 1 to 1024)",
- (uchar**) &ga_nParallelism, (uchar**) &ga_nParallelism, 0,
+ &ga_nParallelism, &ga_nParallelism, 0,
GET_INT, REQUIRED_ARG, 128, 1, 1024, 0, 1, 0 },
{ "print", OPT_PRINT, "Print metadata, data and log to stdout",
- (uchar**) &_print, (uchar**) &_print, 0,
+ &_print, &_print, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "print_data", OPT_PRINT_DATA, "Print data to stdout",
- (uchar**) &_print_data, (uchar**) &_print_data, 0,
+ &_print_data, &_print_data, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "print_meta", OPT_PRINT_META, "Print meta data to stdout",
- (uchar**) &_print_meta, (uchar**) &_print_meta, 0,
+ &_print_meta, &_print_meta, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "print_log", OPT_PRINT_LOG, "Print log to stdout",
- (uchar**) &_print_log, (uchar**) &_print_log, 0,
+ &_print_log, &_print_log, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "backup_path", OPT_BACKUP_PATH, "Path to backup files",
- (uchar**) &ga_backupPath, (uchar**) &ga_backupPath, 0,
+ &ga_backupPath, &ga_backupPath, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "dont_ignore_systab_0", 'f',
"Experimental. Do not ignore system table during restore.",
- (uchar**) &ga_dont_ignore_systab_0, (uchar**) &ga_dont_ignore_systab_0, 0,
+ &ga_dont_ignore_systab_0, &ga_dont_ignore_systab_0, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "ndb-nodegroup-map", OPT_NDB_NODEGROUP_MAP,
"Nodegroup map for ndbcluster. Syntax: list of (source_ng, dest_ng)",
- (uchar**) &opt_nodegroup_map_str,
- (uchar**) &opt_nodegroup_map_str,
+ &opt_nodegroup_map_str,
+ &opt_nodegroup_map_str,
0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "fields-enclosed-by", OPT_FIELDS_ENCLOSED_BY,
"Fields are enclosed by ...",
- (uchar**) &opt_fields_enclosed_by, (uchar**) &opt_fields_enclosed_by, 0,
+ &opt_fields_enclosed_by, &opt_fields_enclosed_by, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "fields-terminated-by", OPT_FIELDS_TERMINATED_BY,
"Fields are terminated by ...",
- (uchar**) &opt_fields_terminated_by,
- (uchar**) &opt_fields_terminated_by, 0,
+ &opt_fields_terminated_by,
+ &opt_fields_terminated_by, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "fields-optionally-enclosed-by", OPT_FIELDS_OPTIONALLY_ENCLOSED_BY,
"Fields are optionally enclosed by ...",
- (uchar**) &opt_fields_optionally_enclosed_by,
- (uchar**) &opt_fields_optionally_enclosed_by, 0,
+ &opt_fields_optionally_enclosed_by,
+ &opt_fields_optionally_enclosed_by, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "hex", OPT_HEX_FORMAT, "print binary types in hex format",
- (uchar**) &opt_hex_format, (uchar**) &opt_hex_format, 0,
+ &opt_hex_format, &opt_hex_format, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "tab", 'T', "Creates tab separated textfile for each table to "
"given path. (creates .txt files)",
- (uchar**) &tab_path, (uchar**) &tab_path, 0,
+ &tab_path, &tab_path, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "append", OPT_APPEND, "for --tab append data to file",
- (uchar**) &opt_append, (uchar**) &opt_append, 0,
+ &opt_append, &opt_append, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "lines-terminated-by", OPT_LINES_TERMINATED_BY, "",
- (uchar**) &opt_lines_terminated_by, (uchar**) &opt_lines_terminated_by, 0,
+ &opt_lines_terminated_by, &opt_lines_terminated_by, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "verbose", OPT_VERBOSE,
"verbosity",
- (uchar**) &opt_verbose, (uchar**) &opt_verbose, 0,
+ &opt_verbose, &opt_verbose, 0,
GET_INT, REQUIRED_ARG, 1, 0, 255, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/select_all.cpp b/storage/ndb/tools/select_all.cpp
index 23d5f95f3f7..95dfeab9eed 100644
--- a/storage/ndb/tools/select_all.cpp
+++ b/storage/ndb/tools/select_all.cpp
@@ -54,43 +54,43 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (uchar**) &_dbname, (uchar**) &_dbname, 0,
+ &_dbname, &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "parallelism", 'p', "parallelism",
- (uchar**) &_parallelism, (uchar**) &_parallelism, 0,
+ &_parallelism, &_parallelism, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "lock", 'l', "Read(0), Read-hold(1), Exclusive(2)",
- (uchar**) &_lock, (uchar**) &_lock, 0,
+ &_lock, &_lock, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "order", 'o', "Sort resultset according to index",
- (uchar**) &_order, (uchar**) &_order, 0,
+ &_order, &_order, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "descending", 'z', "Sort descending (requires order flag)",
- (uchar**) &_descending, (uchar**) &_descending, 0,
+ &_descending, &_descending, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "header", 'h', "Print header",
- (uchar**) &_header, (uchar**) &_header, 0,
+ &_header, &_header, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 },
{ "useHexFormat", 'x', "Output numbers in hexadecimal format",
- (uchar**) &_useHexFormat, (uchar**) &_useHexFormat, 0,
+ &_useHexFormat, &_useHexFormat, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "delimiter", 'D', "Column delimiter",
- (uchar**) &_delimiter, (uchar**) &_delimiter, 0,
+ &_delimiter, &_delimiter, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "disk", 256, "Dump disk ref",
- (uchar**) &_dumpDisk, (uchar**) &_dumpDisk, 0,
+ &_dumpDisk, &_dumpDisk, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "rowid", 256, "Dump rowid",
- (uchar**) &use_rowid, (uchar**) &use_rowid, 0,
+ &use_rowid, &use_rowid, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "gci", 256, "Dump gci",
- (uchar**) &use_gci, (uchar**) &use_gci, 0,
+ &use_gci, &use_gci, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "tupscan", 't', "Scan in tup order",
- (uchar**) &_tup, (uchar**) &_tup, 0,
+ &_tup, &_tup, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "nodata", 256, "Dont print data",
- (uchar**) &nodata, (uchar**) &nodata, 0,
+ &nodata, &nodata, 0,
GET_BOOL, 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}
};
diff --git a/storage/ndb/tools/select_count.cpp b/storage/ndb/tools/select_count.cpp
index 73982e886b5..6bdc682c16a 100644
--- a/storage/ndb/tools/select_count.cpp
+++ b/storage/ndb/tools/select_count.cpp
@@ -43,13 +43,13 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (uchar**) &_dbname, (uchar**) &_dbname, 0,
+ &_dbname, &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "parallelism", 'p', "parallelism",
- (uchar**) &_parallelism, (uchar**) &_parallelism, 0,
+ &_parallelism, &_parallelism, 0,
GET_INT, REQUIRED_ARG, 240, 0, 0, 0, 0, 0 },
{ "lock", 'l', "Read(0), Read-hold(1), Exclusive(2)",
- (uchar**) &_lock, (uchar**) &_lock, 0,
+ &_lock, &_lock, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/waiter.cpp b/storage/ndb/tools/waiter.cpp
index fc2a4b368b1..26c86e6d196 100644
--- a/storage/ndb/tools/waiter.cpp
+++ b/storage/ndb/tools/waiter.cpp
@@ -44,17 +44,17 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "no-contact", 'n', "Wait for cluster no contact",
- (uchar**) &_no_contact, (uchar**) &_no_contact, 0,
+ &_no_contact, &_no_contact, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "not-started", OPT_WAIT_STATUS_NOT_STARTED, "Wait for cluster not started",
- (uchar**) &_not_started, (uchar**) &_not_started, 0,
+ &_not_started, &_not_started, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "single-user", OPT_WAIT_STATUS_SINGLE_USER,
"Wait for cluster to enter single user mode",
- (uchar**) &_single_user, (uchar**) &_single_user, 0,
+ &_single_user, &_single_user, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "timeout", 't', "Timeout to wait in seconds",
- (uchar**) &_timeout, (uchar**) &_timeout, 0,
+ &_timeout, &_timeout, 0,
GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc
index aae8f9dc8c1..e32a77512cc 100644
--- a/storage/perfschema/pfs_events_waits.cc
+++ b/storage/perfschema/pfs_events_waits.cc
@@ -39,7 +39,6 @@ bool flag_events_waits_summary_by_thread_by_event_name= true;
bool flag_events_waits_summary_by_event_name= true;
/** Consumer flag for table EVENTS_WAITS_SUMMARY_BY_INSTANCE. */
bool flag_events_waits_summary_by_instance= true;
-bool flag_events_locks_summary_by_thread_by_event_name= true;
bool flag_events_locks_summary_by_event_name= true;
bool flag_events_locks_summary_by_instance= true;
/** Consumer flag for table FILE_SUMMARY_BY_EVENT_NAME. */
@@ -96,9 +95,8 @@ static void copy_events_waits(PFS_events_waits *dest,
/* Signal readers they are about to read garbage ... */
dest->m_wait_class= NO_WAIT_CLASS;
/* ... that this can generate. */
- memcpy_fixed(dest_body,
- source_body,
- sizeof(PFS_events_waits) - sizeof(events_waits_class));
+ memcpy(dest_body, source_body,
+ sizeof(PFS_events_waits) - sizeof(events_waits_class));
/* Signal readers the record is now clean again. */
dest->m_wait_class= source->m_wait_class;
}
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt
index abc03302b64..e1e14f20218 100644
--- a/strings/CMakeLists.txt
+++ b/strings/CMakeLists.txt
@@ -15,15 +15,19 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-SET(STRINGS_SOURCES bchange.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
+SET(STRINGS_SOURCES bchange.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
ctype-czech.c ctype-euc_kr.c ctype-eucjpms.c ctype-extra.c ctype-gb2312.c ctype-gbk.c
ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c
ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c dtoa.c int2str.c
- is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c r_strinstr.c
+ is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c
str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c
- strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c
- my_strchr.c strcont.c strinstr.c strnlen.c strappend.c)
+ strxmov.c strxnmov.c xml.c
+ my_strchr.c strcont.c strappend.c)
+IF(NOT HAVE_STRNLEN)
+ # OSX does not have strnlen
+ SET(STRINGS_SOURCES ${STRINGS_SOURCES} strnlen.c)
+ENDIF()
# Avoid dependencies on perschema data defined in mysys
ADD_DEFINITIONS(-DDISABLE_MYSQL_THREAD_H)
ADD_CONVENIENCE_LIBRARY(strings ${STRINGS_SOURCES})
diff --git a/strings/Makefile.am b/strings/Makefile.am
index fd884a1296a..3a051e38899 100644
--- a/strings/Makefile.am
+++ b/strings/Makefile.am
@@ -30,20 +30,13 @@ pkglib_LIBRARIES = libmystrings.a
# Exact one of ASSEMBLER_X
if ASSEMBLER_x86
ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s
-CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c my_strchr.c dtoa.c strmov.c
-else
-if ASSEMBLER_sparc32
-# These file MUST all be on the same line!! Otherwise automake
-# generats a very broken makefile
-ASRCS = bmove_upp-sparc.s strappend-sparc.s strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s strnmov-sparc.s strstr-sparc.s
-CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c dtoa.c strmov.c
+CSRCS = bfill.c bmove.c bchange.c strxnmov.c int2str.c str2int.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c my_strchr.c dtoa.c strmov.c
else
#no assembler
ASRCS =
# These file MUST all be on the same line!! Otherwise automake
# generats a very broken makefile
-CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c dtoa.c
-endif
+CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bchange.c strxnmov.c int2str.c str2int.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c dtoa.c
endif
libmystrings_a_SOURCES = $(ASRCS) $(CSRCS)
@@ -57,11 +50,8 @@ EXTRA_DIST = ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc
longlong2str.c longlong2str-x86.s longlong2str_asm.c \
my_strtoll10.c my_strtoll10-x86.s \
strxmov.c bmove_upp.c strappend.c strcont.c strend.c \
- strfill.c strcend.c is_prefix.c strstr.c strinstr.c \
+ strfill.c strcend.c is_prefix.c strstr.c \
strmake.c strnmov.c strmov.c strnlen.c \
- bmove_upp-sparc.s strappend-sparc.s strend-sparc.s \
- strinstr-sparc.s strmake-sparc.s strmov-sparc.s \
- strnmov-sparc.s strstr-sparc.s strxmov-sparc.s \
t_ctype.h my_strchr.c CMakeLists.txt \
CHARSET_INFO.txt
diff --git a/strings/bfill.c b/strings/bfill.c
index 2750553f48a..ccc063f59e3 100644
--- a/strings/bfill.c
+++ b/strings/bfill.c
@@ -23,10 +23,6 @@
bfill(dst, len, fill) moves "len" fill characters to "dst".
Thus to set a buffer to 80 spaces, do bfill(buff, 80, ' ').
-
- Note: the "b" routines are there to exploit certain VAX order codes,
- but the MOVC5 instruction will only move 65535 characters. The asm
- code is presented for your interest and amusement.
*/
#include <my_global.h>
@@ -34,58 +30,6 @@
#if !defined(bfill) && !defined(HAVE_BFILL)
-#if VaxAsm
-
-void bfill(dst, len, fill)
-char *dst;
-uint len;
-int fill; /* actually char */
-{
- asm("movc5 $0,*4(ap),12(ap),8(ap),*4(ap)");
-}
-
-#elif defined(MC68000) && defined(DS90)
-
-void bfill(dst, len,fill) /* Optimized with long-fill */
-char *dst;
-uint len;
-pchar fill;
-{
-asm(" movl 8.(a7),d1 ");
-asm(" jeq .L9 ");
-asm(" movl 4.(a7),a0 ");
-asm(" moveq #0,d0 ");
-asm(" movb 15.(a7),d0 ");
-asm(" movl d2,a1 ");
-asm(" movw d0,d2 ");
-asm(" aslw #8,d0 ");
-asm(" orw d2,d0 ");
-asm(" movl d0,d2 ");
-asm(" swap d0 ");
-asm(" orl d2,d0 ");
-asm(" movl a0,d2 ");
-asm(" btst #0,d2 ");
-asm(" jeq .L1 ");
-asm(" movb d0,(a0)+ ");
-asm(" subql #1,d1 ");
-asm(".L1: movl d1,d2 ");
-asm(" lsrl #2,d2 ");
-asm(" jcc .L2 ");
-asm(" movw d0,(a0)+ ");
-asm(" jra .L2 ");
-asm(".L3: movl d0,(a0)+ ");
-asm(".L2: dbra d2,.L3 ");
-asm(" addqw #1,d2 ");
-asm(" subql #1,d2 ");
-asm(" jcc .L3 ");
-asm(" andl #1,d1 ");
-asm(" jeq .L8 ");
-asm(" movb d0,(a0) ");
-asm(".L8: movl a1,d2 ");
-asm(".L9: rts ");
-}
-#else
-
void bfill(dst, len, fill)
register byte *dst;
register uint len;
@@ -95,4 +39,3 @@ register pchar fill;
}
#endif
-#endif
diff --git a/strings/bmove.c b/strings/bmove.c
index ae9641a5d58..0aa825558ca 100644
--- a/strings/bmove.c
+++ b/strings/bmove.c
@@ -30,10 +30,6 @@
has its first two arguments the other way around you may find this a
bit easier to get right.
No value is returned.
-
- Note: the "b" routines are there to exploit certain VAX order codes,
- but the MOVC3 instruction will only move 65535 characters. The asm
- code is presented for your interest and amusement.
*/
#include <my_global.h>
@@ -41,33 +37,6 @@
#if !defined(HAVE_BMOVE) && !defined(bmove)
-#if VaxAsm
-
-void bmove(dst, src, len)
- char *dst, *src;
- uint len;
- {
- asm("movc3 12(ap),*8(ap),*4(ap)");
- }
-
-#else
-#if defined(MC68000) && defined(DS90)
-
-void bmove(dst, src, len)
-char *dst,*src;
-uint len; /* 0 <= len <= 65535 */
-{
-asm(" movl 12(a7),d0 ");
-asm(" subql #1,d0 ");
-asm(" blt .L5 ");
-asm(" movl 4(a7),a1 ");
-asm(" movl 8(a7),a0 ");
-asm(".L4: movb (a0)+,(a1)+ ");
-asm(" dbf d0,.L4 ");
-asm(".L5: ");
-}
-#else
-
void bmove(dst, src, len)
register char *dst;
register const char *src;
@@ -75,6 +44,5 @@ register uint len;
{
while (len-- != 0) *dst++ = *src++;
}
-#endif
-#endif
+
#endif
diff --git a/strings/bmove512.c b/strings/bmove512.c
deleted file mode 100644
index c3f0446ead6..00000000000
--- a/strings/bmove512.c
+++ /dev/null
@@ -1,125 +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 */
-
-/* File : bmove512.c
- Author : Michael Widenius;
- Defines: bmove512()
-
- bmove512(dst, src, len) moves exactly "len" bytes from the source "src"
- to the destination "dst". "src" and "dst" must be alligned on long
- boundory and len must be a mutliple of 512 byte. If len is not a
- multiple of 512 byte len/512*512+1 bytes is copyed.
- bmove512 is moustly used to copy IO_BLOCKS. bmove512 should be the
- fastest way to move a mutiple of 512 byte.
-*/
-
-#include <my_global.h>
-#include "m_string.h"
-
-#ifndef bmove512
-
-#ifdef HAVE_LONG_LONG
-#define LONG ulonglong
-#else
-#define LONG ulonglong
-#endif
-
-void bmove512(uchar *to, const uchar *from, register size_t length)
-{
- reg1 LONG *f,*t,*end= (LONG*) ((char*) from+length);
-
- f= (LONG*) from;
- t= (LONG*) to;
-
-#if defined(m88k) || defined(sparc) || defined(HAVE_LONG_LONG)
- do {
- t[0]=f[0]; t[1]=f[1]; t[2]=f[2]; t[3]=f[3];
- t[4]=f[4]; t[5]=f[5]; t[6]=f[6]; t[7]=f[7];
- t[8]=f[8]; t[9]=f[9]; t[10]=f[10]; t[11]=f[11];
- t[12]=f[12]; t[13]=f[13]; t[14]=f[14]; t[15]=f[15];
- t[16]=f[16]; t[17]=f[17]; t[18]=f[18]; t[19]=f[19];
- t[20]=f[20]; t[21]=f[21]; t[22]=f[22]; t[23]=f[23];
- t[24]=f[24]; t[25]=f[25]; t[26]=f[26]; t[27]=f[27];
- t[28]=f[28]; t[29]=f[29]; t[30]=f[30]; t[31]=f[31];
- t[32]=f[32]; t[33]=f[33]; t[34]=f[34]; t[35]=f[35];
- t[36]=f[36]; t[37]=f[37]; t[38]=f[38]; t[39]=f[39];
- t[40]=f[40]; t[41]=f[41]; t[42]=f[42]; t[43]=f[43];
- t[44]=f[44]; t[45]=f[45]; t[46]=f[46]; t[47]=f[47];
- t[48]=f[48]; t[49]=f[49]; t[50]=f[50]; t[51]=f[51];
- t[52]=f[52]; t[53]=f[53]; t[54]=f[54]; t[55]=f[55];
- t[56]=f[56]; t[57]=f[57]; t[58]=f[58]; t[59]=f[59];
- t[60]=f[60]; t[61]=f[61]; t[62]=f[62]; t[63]=f[63];
-#ifdef HAVE_LONG_LONG
- t+=64; f+=64;
-#else
- t[64]=f[64]; t[65]=f[65]; t[66]=f[66]; t[67]=f[67];
- t[68]=f[68]; t[69]=f[69]; t[70]=f[70]; t[71]=f[71];
- t[72]=f[72]; t[73]=f[73]; t[74]=f[74]; t[75]=f[75];
- t[76]=f[76]; t[77]=f[77]; t[78]=f[78]; t[79]=f[79];
- t[80]=f[80]; t[81]=f[81]; t[82]=f[82]; t[83]=f[83];
- t[84]=f[84]; t[85]=f[85]; t[86]=f[86]; t[87]=f[87];
- t[88]=f[88]; t[89]=f[89]; t[90]=f[90]; t[91]=f[91];
- t[92]=f[92]; t[93]=f[93]; t[94]=f[94]; t[95]=f[95];
- t[96]=f[96]; t[97]=f[97]; t[98]=f[98]; t[99]=f[99];
- t[100]=f[100]; t[101]=f[101]; t[102]=f[102]; t[103]=f[103];
- t[104]=f[104]; t[105]=f[105]; t[106]=f[106]; t[107]=f[107];
- t[108]=f[108]; t[109]=f[109]; t[110]=f[110]; t[111]=f[111];
- t[112]=f[112]; t[113]=f[113]; t[114]=f[114]; t[115]=f[115];
- t[116]=f[116]; t[117]=f[117]; t[118]=f[118]; t[119]=f[119];
- t[120]=f[120]; t[121]=f[121]; t[122]=f[122]; t[123]=f[123];
- t[124]=f[124]; t[125]=f[125]; t[126]=f[126]; t[127]=f[127];
- t+=128; f+=128;
-#endif
- } while (f < end);
-#else
- do {
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++;
- } while (f < end);
-#endif
- return;
-} /* bmove512 */
-
-#endif /* bmove512 */
diff --git a/strings/bmove_upp-sparc.s b/strings/bmove_upp-sparc.s
deleted file mode 100644
index f745f0fc613..00000000000
--- a/strings/bmove_upp-sparc.s
+++ /dev/null
@@ -1,40 +0,0 @@
-! Copyright (C) 2000, 2002 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
-
- .file "bmove_upp-sparc.s"
-.section ".text"
- .align 4
- .global bmove_upp
- .type bmove_upp,#function
- .proc 020
-bmove_upp:
- subcc %o2, 1, %o2 ! o2= len
- bcs .end
- nop
-.loop:
- sub %o1, 1, %o1
- ldub [%o1], %o3
- sub %o0, 1, %o0
- subcc %o2, 1, %o2
- bcc .loop
- stb %o3, [%o0]
-.end:
- retl
- nop
-.bmove_upp_end:
- .size bmove_upp,.bmove_upp_end-bmove_upp
- .ident "Matt Wagner & Monty"
diff --git a/strings/bmove_upp.c b/strings/bmove_upp.c
index fb47bda2d1d..05e786837f4 100644
--- a/strings/bmove_upp.c
+++ b/strings/bmove_upp.c
@@ -25,26 +25,8 @@
#include <my_global.h>
#include "m_string.h"
-#if defined(MC68000) && defined(DS90)
-
-/* 0 <= len <= 65535 */
-void bmove_upp(byte *dst, const byte *src,uint len)
-{
-asm(" movl 12(a7),d0 ");
-asm(" subql #1,d0 ");
-asm(" blt .L5 ");
-asm(" movl 4(a7),a1 ");
-asm(" movl 8(a7),a0 ");
-asm(".L4: movb -(a0),-(a1) ");
-asm(" dbf d0,.L4 ");
-asm(".L5: ");
-}
-#else
-
void bmove_upp(register uchar *dst, register const uchar *src,
register size_t len)
{
while (len-- != 0) *--dst = *--src;
}
-
-#endif
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 8a3d3d7425c..2e5f78a30bf 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -335,10 +335,6 @@ long my_strntol_8bit(CHARSET_INFO *cs,
int overflow;
*err= 0; /* Initialize error indicator */
-#ifdef NOT_USED
- if (base < 0 || base == 1 || base > 36)
- base = 10;
-#endif
s = nptr;
e = nptr+l;
@@ -364,29 +360,6 @@ long my_strntol_8bit(CHARSET_INFO *cs,
else
negative = 0;
-#ifdef NOT_USED
- if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
- s += 2;
-#endif
-
-#ifdef NOT_USED
- if (base == 0)
- {
- if (*s == '0')
- {
- if (s[1]=='X' || s[1]=='x')
- {
- s += 2;
- base = 16;
- }
- else
- base = 8;
- }
- else
- base = 10;
- }
-#endif
-
save = s;
cutoff = ((uint32)~0L) / (uint32) base;
cutlim = (uint) (((uint32)~0L) % (uint32) base);
@@ -458,10 +431,6 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
int overflow;
*err= 0; /* Initialize error indicator */
-#ifdef NOT_USED
- if (base < 0 || base == 1 || base > 36)
- base = 10;
-#endif
s = nptr;
e = nptr+l;
@@ -486,29 +455,6 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
else
negative = 0;
-#ifdef NOT_USED
- if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
- s += 2;
-#endif
-
-#ifdef NOT_USED
- if (base == 0)
- {
- if (*s == '0')
- {
- if (s[1]=='X' || s[1]=='x')
- {
- s += 2;
- base = 16;
- }
- else
- base = 8;
- }
- else
- base = 10;
- }
-#endif
-
save = s;
cutoff = ((uint32)~0L) / (uint32) base;
cutlim = (uint) (((uint32)~0L) % (uint32) base);
@@ -571,10 +517,6 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
int overflow;
*err= 0; /* Initialize error indicator */
-#ifdef NOT_USED
- if (base < 0 || base == 1 || base > 36)
- base = 10;
-#endif
s = nptr;
e = nptr+l;
@@ -599,29 +541,6 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
else
negative = 0;
-#ifdef NOT_USED
- if (base == 16 && s[0] == '0' && (s[1]=='X'|| s[1]=='x'))
- s += 2;
-#endif
-
-#ifdef NOT_USED
- if (base == 0)
- {
- if (*s == '0')
- {
- if (s[1]=='X' || s[1]=='x')
- {
- s += 2;
- base = 16;
- }
- else
- base = 8;
- }
- else
- base = 10;
- }
-#endif
-
save = s;
cutoff = (~(ulonglong) 0) / (unsigned long int) base;
@@ -694,10 +613,6 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
int overflow;
*err= 0; /* Initialize error indicator */
-#ifdef NOT_USED
- if (base < 0 || base == 1 || base > 36)
- base = 10;
-#endif
s = nptr;
e = nptr+l;
@@ -722,29 +637,6 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
else
negative = 0;
-#ifdef NOT_USED
- if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
- s += 2;
-#endif
-
-#ifdef NOT_USED
- if (base == 0)
- {
- if (*s == '0')
- {
- if (s[1]=='X' || s[1]=='x')
- {
- s += 2;
- base = 16;
- }
- else
- base = 8;
- }
- else
- base = 10;
- }
-#endif
-
save = s;
cutoff = (~(ulonglong) 0) / (unsigned long int) base;
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 3946f6a83b4..d3b0b93a939 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -134,11 +134,6 @@ my_strntol_mb2_or_mb4(CHARSET_INFO *cs,
bs:
-#ifdef NOT_USED
- if (base <= 0 || base == 1 || base > 36)
- base = 10;
-#endif
-
overflow= 0;
res= 0;
save= s;
@@ -250,11 +245,6 @@ my_strntoul_mb2_or_mb4(CHARSET_INFO *cs,
bs:
-#ifdef NOT_USED
- if (base <= 0 || base == 1 || base > 36)
- base = 10;
-#endif
-
overflow= 0;
res= 0;
save= s;
@@ -359,11 +349,6 @@ my_strntoll_mb2_or_mb4(CHARSET_INFO *cs,
bs:
-#ifdef NOT_USED
- if (base <= 0 || base == 1 || base > 36)
- base = 10;
-#endif
-
overflow = 0;
res = 0;
save = s;
@@ -474,11 +459,6 @@ my_strntoull_mb2_or_mb4(CHARSET_INFO *cs,
} while (1);
bs:
-
-#ifdef NOT_USED
- if (base <= 0 || base == 1 || base > 36)
- base = 10;
-#endif
overflow = 0;
res = 0;
diff --git a/strings/do_ctype.c b/strings/do_ctype.c
index d038d313a98..f87d55b6251 100644
--- a/strings/do_ctype.c
+++ b/strings/do_ctype.c
@@ -140,7 +140,7 @@ void init_case_convert()
to_upper[i]= sort_order[i]= to_lower[i]= (char) i;
#endif
-#if defined(HPUX10) && ASCII_BITS_USED == 8
+#if defined(HPUX10)
higher_pos= (uchar *) "\xd0\xd8\xda\xdb\xdc\xd3";
lower_pos= (uchar *) "\xd4\xcc\xce\xdf\xc9\xd7";
#else
@@ -166,7 +166,7 @@ void init_case_convert()
/* sets upp sortorder; higer_pos character (upper and lower) is */
/* changed to lower_pos character */
-#if defined(HPUX10) && ASCII_BITS_USED == 8
+#if defined(HPUX10)
higher_pos= lower_pos= (uchar *) ""; /* Tecknen i r{tt ordning */
#else
#ifdef USE_ISO_8859_1 /* As in USG5 ICL-386 */
diff --git a/strings/r_strinstr.c b/strings/r_strinstr.c
deleted file mode 100644
index fb1e0c5a090..00000000000
--- a/strings/r_strinstr.c
+++ /dev/null
@@ -1,50 +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 */
-
-/*
- Author : David
- strintstr(src, from, pat) looks for an instance of pat in src
- backwards from pos from. pat is not a regex(3) pattern, it is a literal
- string which must be matched exactly.
- The result 0 if the pattern was not found else it is the start char of
- the pattern counted from the begining of the string.
-*/
-
-#include <my_global.h>
-#include "m_string.h"
-
-size_t r_strinstr(reg1 const char * str, size_t from, reg4 const char * search)
-{
- reg2 const char *i, *j;
- size_t len = strlen(search);
- /* pointer to the last char of buff */
- const char * start = str + from - 1;
- /* pointer to the last char of search */
- const char * search_end = search + len - 1;
-
- skip:
- while (start >= str) /* Cant be != because the first char */
- {
- if (*start-- == *search_end)
- {
- i = start; j = search_end - 1;
- while (j >= search && start > str)
- if (*i-- != *j--)
- goto skip;
- return (size_t) ((start - len) - str + 3);
- }
- }
- return (0);
-}
diff --git a/strings/str_test.c b/strings/str_test.c
index 0814647472c..7e304fbd10a 100644
--- a/strings/str_test.c
+++ b/strings/str_test.c
@@ -73,8 +73,6 @@ int main(void)
test_arg("strstr(v1,v5)",(long) strstr(v1,v5),0L);
test_arg("strstr(v6,v8)",(long) strstr(v6,v8),0L);
- test_arg("strinstr(v1,v4)",(long) strinstr(v1,v4),4L);
- test_arg("strinstr(v1,v5)",(long) strinstr(v1,v5),0L);
test_arg("strlen(from)",(long) strlen(from),(long) F_LEN);
test_arg("strlen(\"\")",(long) strlen(""),0L);
#ifdef HAVE_STRNLEN
diff --git a/strings/strappend-sparc.s b/strings/strappend-sparc.s
deleted file mode 100644
index d5add816eb0..00000000000
--- a/strings/strappend-sparc.s
+++ /dev/null
@@ -1,49 +0,0 @@
-! Copyright (C) 2000, 2002 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
-
- .file "strappend-sparc.s"
-.section ".text"
- .align 4
- .global strappend
- .type strappend,#function
- .proc 020
-strappend:
- add %o0, %o1, %o3 ! o3 = endpos
- ldsb [%o0], %o4
-.loop1:
- add %o0, 1, %o0 ! find end of str
- cmp %o4, 0
- bne,a .loop1
- ldsb [%o0], %o4
-
- sub %o0, 1, %o0
- cmp %o0, %o3
- bgeu .end
- nop
-
- stb %o2, [%o0]
-.loop2:
- add %o0, 1, %o0
- cmp %o0, %o3
- blu,a .loop2
- stb %o2, [%o0]
-.end:
- retl
- stb %g0, [%o3]
-.strappend_end:
- .size strappend,.strappend_end-strappend
- .ident "Matt Wagner & Monty"
diff --git a/strings/strcend.c b/strings/strcend.c
index 56e31d5f994..e08ad2b1e75 100644
--- a/strings/strcend.c
+++ b/strings/strcend.c
@@ -25,23 +25,6 @@
#include <my_global.h>
#include "m_string.h"
-#if defined(MC68000) && defined(DS90)
-
-char *strcend(const char *s, pchar c)
-{
-asm(" movl 4(a7),a0 ");
-asm(" movl 8(a7),d1 ");
-asm(".L2: movb (a0)+,d0 ");
-asm(" cmpb d0,d1 ");
-asm(" beq .L1 ");
-asm(" tstb d0 ");
-asm(" bne .L2 ");
-asm(".L1: movl a0,d0 ");
-asm(" subql #1,d0 ");
-}
-
-#else
-
char *strcend(register const char *s, register pchar c)
{
for (;;)
@@ -51,4 +34,3 @@ char *strcend(register const char *s, register pchar c)
}
}
-#endif
diff --git a/strings/strend-sparc.s b/strings/strend-sparc.s
deleted file mode 100644
index f264fcef32f..00000000000
--- a/strings/strend-sparc.s
+++ /dev/null
@@ -1,35 +0,0 @@
-! Copyright (C) 2000, 2002 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
-
- .file "strend-sparc.s"
-.section ".text"
- .align 4
- .global strend
- .type strend,#function
- .proc 0102
-strend:
- ldsb [%o0], %o3 ! Handle first char differently to make
-.loop: ! a faster loop
- add %o0, 1, %o0
- cmp %o3, 0
- bne,a .loop
- ldsb [%o0], %o3
- retl
- sub %o0,1,%o0
-.strend_end:
- .size strend,.strend_end-strend
- .ident "Matt Wagner & Monty"
diff --git a/strings/strend.c b/strings/strend.c
index 4dadf0675dc..d70a5d648d5 100644
--- a/strings/strend.c
+++ b/strings/strend.c
@@ -24,27 +24,14 @@
is, strend(s)-s == strlen(s). This is useful for adding things at
the end of strings. It is redundant, because strchr(s,'\0') could
be used instead, but this is clearer and faster.
- Beware: the asm version works only if strlen(s) < 65535.
*/
#include <my_global.h>
#include "m_string.h"
-#if VaxAsm
-
-char *strend(s)
-const char *s;
-{
- asm("locc $0,$65535,*4(ap)");
- asm("movl r1,r0");
-}
-
-#else /* ~VaxAsm */
-
char *strend(register const char *s)
{
while (*s++);
return (char*) (s-1);
}
-#endif /* VaxAsm */
diff --git a/strings/string.doc b/strings/string.doc
index 954f7226759..fcd020b8c60 100644
--- a/strings/string.doc
+++ b/strings/string.doc
@@ -77,11 +77,6 @@ Speciella användbara nya string-rutiner:
The result is a pointer to the first character of the located instance,
or NullS if pat does not occur in src.
- strinstr(src, pat) looks for an instance of pat in src. pat is not a
- regex(3) pattern, it is a literal string which must be matched exactly.
- The result 0 if the pattern was not found else it is the start char of
- the pattern counted from the begining of the string.
-
strmake(dst,src,length) moves length characters, or until end, of src to
dst and appends a closing NUL to dst.
strmake() returns pointer to closing null;
diff --git a/strings/strings-not-used.h b/strings/strings-not-used.h
deleted file mode 100644
index 8311545f22f..00000000000
--- a/strings/strings-not-used.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef STRINGS_NOT_USED_INCLUDED
-#define STRINGS_NOT_USED_INCLUDED
-
-/* 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 */
-
-/* File : strings.h
- Author : Richard A. O'Keefe.
- Updated: 1 June 1984
- Purpose: Header file for the "string(3C)" package.
-
- All the routines in this package are the original work of
- R.A.O'Keefe. Any resemblance between them and any routines in
- licensed software is due entirely to these routines having been
- written using the "man 3 string" UNIX manual page, or in some cases
- the "man 1 sort" manual page as a specification. See the READ-ME to
- find the conditions under which these routines may be used & copied.
-*/
-
-#ifndef NullS
-
-#include <my_global.h> /* Define standar vars */
-#include "m_string.h"
-
-#define NUL '\0'
-#define _AlphabetSize 256
-
-#endif /* NullS */
-#endif /* STRINGS_NOT_USED_INCLUDED */
diff --git a/strings/strings-x86.s b/strings/strings-x86.s
index db7bb0c1274..4872c566685 100644
--- a/strings/strings-x86.s
+++ b/strings/strings-x86.s
@@ -281,29 +281,6 @@ sf_fo: movl %edx,%eax # Char found here
.strstr_end:
.size strstr,.strstr_end-strstr
-
- # Find a substring in string, return index
- # Arg: str,search
-
-.globl strinstr
- .type strinstr,@function
-
-strinstr:
- pushl %ebp
- movl %esp,%ebp
- pushl 12(%ebp) # search
- pushl 8(%ebp) # str
- call strstr
- add $8,%esp
- or %eax,%eax
- jz si_99 # Not found, return NULL
- sub 8(%ebp),%eax # Pos from start
- inc %eax # And first pos = 1
-si_99: popl %ebp
- ret
-.strinstr_end:
- .size strinstr,.strinstr_end-strinstr
-
# Make a string of len length from another string
# Arg: dst,src,length
# ret: end of dst
diff --git a/strings/strinstr-sparc.s b/strings/strinstr-sparc.s
deleted file mode 100644
index 5278aff6aa7..00000000000
--- a/strings/strinstr-sparc.s
+++ /dev/null
@@ -1,43 +0,0 @@
-! Copyright (C) 2000 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
-
- .file "strinstr-sparc.s"
-.section ".text"
- .align 4
- .global strinstr
- .type strinstr,#function
- .proc 0102
-strinstr:
- save %sp,-96,%sp
- or %g0,%i1,%o1
- call strstr,2 ! Result = %o0
- or %g0,%i0,%o0
- orcc %g0,%o0,%o0
- bne .end
- sub %o0,%i0,%i0
- ret
- restore %g0,%g0,%o0
-.end:
- ret
- restore %i0,1,%o0 ! Offset for return value is from 1
-
-.strinstr_end:
- .size strinstr,.strinstr_end-strinstr
- .ident "Matt Wagner & Monty"
-
-
-
diff --git a/strings/strinstr.c b/strings/strinstr.c
deleted file mode 100644
index dce498d61e8..00000000000
--- a/strings/strinstr.c
+++ /dev/null
@@ -1,48 +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 */
-
-/* File : strinstr.c
- Author : Monty & David
- Updated: 1986.12.08
- Defines: strinstr()
-
- strinstr(src, pat) looks for an instance of pat in src. pat is not a
- regex(3) pattern, it is a literal string which must be matched exactly.
- The result 0 if the pattern was not found else it is the start char of
- the pattern counted from the beginning of the string, where the first
- char is 1.
-*/
-
-#include <my_global.h>
-#include "m_string.h"
-
-size_t strinstr(reg1 const char *str,reg4 const char *search)
-{
- reg2 const char *i, *j;
- const char *start= str;
-
- skip:
- while (*str != '\0')
- {
- if (*str++ == *search)
- {
- i= str; j= search+1;
- while (*j)
- if (*i++ != *j++) goto skip;
- return ((size_t) (str - start));
- }
- }
- return (0);
-}
diff --git a/strings/strmake-sparc.s b/strings/strmake-sparc.s
deleted file mode 100644
index 36db8efd402..00000000000
--- a/strings/strmake-sparc.s
+++ /dev/null
@@ -1,43 +0,0 @@
-! Copyright (C) 2000, 2002 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
-
- .file "strmake-sparc.s"
-.section ".text"
- .align 4
- .global strmake
- .type strmake,#function
- .proc 0102
-strmake:
- orcc %g0,%o2,%g0
- be,a .end
- nop
- ldsb [%o1],%o3
-.loop:
- stb %o3,[%o0]
- cmp %o3,0
- be .end ! Jump to end on end of string
- add %o1,1,%o1
- add %o0,1,%o0
- subcc %o2,1,%o2
- bne,a .loop
- ldsb [%o1],%o3
-.end:
- retl
- stb %g0,[%o0]
-.strmake_end:
- .size strmake,.strmake_end-strmake
- .ident "Matt Wagner & Monty"
diff --git a/strings/strmov-sparc.s b/strings/strmov-sparc.s
deleted file mode 100644
index f124da2dc9f..00000000000
--- a/strings/strmov-sparc.s
+++ /dev/null
@@ -1,36 +0,0 @@
-! Copyright (C) 2000, 2002 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
-
- .file "strmov-sparc.s"
-.section ".text"
- .align 4
- .global strmov
- .type strmov,#function
- .proc 0102
-strmov:
-.loop:
- ldub [%o1], %o3
- stb %o3, [%o0]
- add %o1, 1, %o1
- cmp %o3, 0
- bne,a .loop
- add %o0, 1, %o0
- retl
- nop
-.strmov_end:
- .size strmov,.strmov_end-strmov
- .ident "Matt Wagner"
diff --git a/strings/strmov.c b/strings/strmov.c
index eedf22a4ef1..4d4915d27a0 100644
--- a/strings/strmov.c
+++ b/strings/strmov.c
@@ -29,25 +29,9 @@
#define strmov strmov_overlapp
#endif
-#if !defined(MC68000) && !defined(DS90)
-
char *strmov(register char *dst, register const char *src)
{
while ((*dst++ = *src++)) ;
return dst-1;
}
-#else
-
-char *strmov(dst, src)
- char *dst, *src;
-{
- asm(" movl 4(a7),a1 ");
- asm(" movl 8(a7),a0 ");
- asm(".L4: movb (a0)+,(a1)+ ");
- asm(" jne .L4 ");
- asm(" movl a1,d0 ");
- asm(" subql #1,d0 ");
-}
-
-#endif
diff --git a/strings/strnmov-sparc.s b/strings/strnmov-sparc.s
deleted file mode 100644
index df0c4bebf03..00000000000
--- a/strings/strnmov-sparc.s
+++ /dev/null
@@ -1,43 +0,0 @@
-! Copyright (C) 2000, 2002 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
-
- .file "strnmov-sparc.s"
-.section ".text"
- .align 4
- .global strnmov
- .type strnmov,#function
- .proc 0102
-strnmov:
- orcc %g0,%o2,%g0
- be,a .end
- nop
- ldsb [%o1],%o3
-.loop:
- stb %o3,[%o0]
- cmp %o3,0
- be .end ! Jump to end on end of string
- add %o1,1,%o1
- add %o0,1,%o0
- subcc %o2,1,%o2
- bne,a .loop
- ldsb [%o1],%o3
-.end:
- retl
- nop
-.strnmov_end:
- .size strnmov,.strnmov_end-strnmov
- .ident "Matt Wagner"
diff --git a/strings/strstr-sparc.s b/strings/strstr-sparc.s
deleted file mode 100644
index 2a6590c9c93..00000000000
--- a/strings/strstr-sparc.s
+++ /dev/null
@@ -1,72 +0,0 @@
-! Copyright (C) 2000, 2002 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
-
- .file "strstr-sparc.s"
-.section ".text"
- .align 4
- .global strstr
- .type strstr,#function
- .proc 0102
-strstr:
-
-!char *strstr(register const char *str,const char *search)
-!{
-! register char *i,*j;
-!skipp:
-! while (*str != '\0') {
-! if (*str++ == *search) {
-! i=(char*) str; j=(char*) search+1;
-
- ldsb [%o1],%o2 ! o2= First char of search
-.top:
- ldsb [%o0],%o4 ! o4= First char of rest of str
- cmp %o4,0
- be .abort ! Found end null ;
- cmp %o4,%o2
- bne .top
- add %o0,1,%o0
-
-.outloop1:
-
-! while (*j)
-! if (*i++ != *j++) goto skipp;
-
- or %g0,%o0,%o3
- add %o1,1,%o4 ! o4= search+1
- ldsb [%o0],%o5 ! o5= [current_str+1]
-
-.loop2:
- ldsb [%o4],%g4
- add %o4,1,%o4
- cmp %g4,0
- be .end
- cmp %o5,%g4
- bne .top
- add %o3,1,%o3
- ba .loop2
- ldsb [%o3],%o5
-
-.end:
- retl
- sub %o0,1,%o0
-.abort:
- retl
- or %g0,0,%o0
-
-.strstr_end:
- .size strstr,.strstr_end-strstr
- .ident "Matt Wagner & Monty"
diff --git a/strings/strxmov-sparc.s b/strings/strxmov-sparc.s
deleted file mode 100644
index 11ae49a876b..00000000000
--- a/strings/strxmov-sparc.s
+++ /dev/null
@@ -1,54 +0,0 @@
-! Copyright (C) 2000, 2002 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
-
-!
-! Note that this function only works on 32 bit sparc systems
-! on 64 bits the offsets to %sp are different !
-
- .file "strxmov-sparc.s"
-.section ".text"
- .align 4
- .global strxmov
- .type strxmov,#function
- .proc 0102
-
-strxmov:
- st %o2, [%sp+76] ! store 3rd param before other params
- st %o3, [%sp+80] ! store 4th param " "
- cmp %o1, 0 ! check if no from args
- st %o4, [%sp+84] ! store 5th param
- be .end
- st %o5, [%sp+88] ! store last
- add %sp, 76, %o4 ! put pointer to 3rd arg
-.loop:
- ldub [%o1], %o5 ! set values of src (o1)
- add %o1, 1, %o1 ! inc src
- stb %o5, [%o0] ! and dst (o2) equal
- cmp %o5, 0 ! second while cmp
- bne,a .loop
- add %o0, 1, %o0 ! inc dst
- ld [%o4], %o1 ! get next param
- cmp %o1, 0 ! check if last param
- bne .loop
- add %o4, 4, %o4 ! advance to next param
-.end:
- retl
- stb %g0, [%o0]
-.strxmov_end:
- .size strxmov,.strxmov_end-strxmov
- .ident "Matt Wagner & Monty"
-
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index a3640077889..61f9d4881cb 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -5775,215 +5775,6 @@ static void test_set_variable()
mysql_stmt_close(stmt1);
}
-#if NOT_USED
-
-/* Insert meta info .. */
-
-static void test_insert_meta()
-{
- MYSQL_STMT *stmt;
- int rc;
- MYSQL_RES *result;
- MYSQL_FIELD *field;
-
- myheader("test_insert_meta");
-
- rc= mysql_autocommit(mysql, TRUE);
- myquery(rc);
-
- rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_insert");
- myquery(rc);
-
- rc= mysql_query(mysql, "CREATE TABLE test_prep_insert(col1 tinyint, \
- col2 varchar(50), col3 varchar(30))");
- myquery(rc);
-
- strmov(query, "INSERT INTO test_prep_insert VALUES(10, 'venu1', 'test')");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 0);
-
- result= mysql_param_result(stmt);
- mytest_r(result);
-
- mysql_stmt_close(stmt);
-
- strmov(query, "INSERT INTO test_prep_insert VALUES(?, 'venu', ?)");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 2);
-
- result= mysql_param_result(stmt);
- mytest(result);
-
- my_print_result_metadata(result);
-
- mysql_field_seek(result, 0);
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col1");
- DIE_UNLESS(strcmp(field->name, "col1") == 0);
-
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col3");
- DIE_UNLESS(strcmp(field->name, "col3") == 0);
-
- field= mysql_fetch_field(result);
- mytest_r(field);
-
- mysql_free_result(result);
- mysql_stmt_close(stmt);
-}
-
-
-/* Update meta info .. */
-
-static void test_update_meta()
-{
- MYSQL_STMT *stmt;
- int rc;
- MYSQL_RES *result;
- MYSQL_FIELD *field;
-
- myheader("test_update_meta");
-
- rc= mysql_autocommit(mysql, TRUE);
- myquery(rc);
-
- rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_update");
- myquery(rc);
-
- rc= mysql_query(mysql, "CREATE TABLE test_prep_update(col1 tinyint, \
- col2 varchar(50), col3 varchar(30))");
- myquery(rc);
-
- strmov(query, "UPDATE test_prep_update SET col1=10, col2='venu1' WHERE col3='test'");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 0);
-
- result= mysql_param_result(stmt);
- mytest_r(result);
-
- mysql_stmt_close(stmt);
-
- strmov(query, "UPDATE test_prep_update SET col1=?, col2='venu' WHERE col3=?");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 2);
-
- result= mysql_param_result(stmt);
- mytest(result);
-
- my_print_result_metadata(result);
-
- mysql_field_seek(result, 0);
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- {
- fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1");
- fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update");
- }
- DIE_UNLESS(strcmp(field->name, "col1") == 0);
- DIE_UNLESS(strcmp(field->table, "test_prep_update") == 0);
-
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- {
- fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col3");
- fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update");
- }
- DIE_UNLESS(strcmp(field->name, "col3") == 0);
- DIE_UNLESS(strcmp(field->table, "test_prep_update") == 0);
-
- field= mysql_fetch_field(result);
- mytest_r(field);
-
- mysql_free_result(result);
- mysql_stmt_close(stmt);
-}
-
-
-/* Select meta info .. */
-
-static void test_select_meta()
-{
- MYSQL_STMT *stmt;
- int rc;
- MYSQL_RES *result;
- MYSQL_FIELD *field;
-
- myheader("test_select_meta");
-
- rc= mysql_autocommit(mysql, TRUE);
- myquery(rc);
-
- rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_select");
- myquery(rc);
-
- rc= mysql_query(mysql, "CREATE TABLE test_prep_select(col1 tinyint, \
- col2 varchar(50), col3 varchar(30))");
- myquery(rc);
-
- strmov(query, "SELECT * FROM test_prep_select WHERE col1=10");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 0);
-
- result= mysql_param_result(stmt);
- mytest_r(result);
-
- strmov(query, "SELECT col1, col3 from test_prep_select WHERE col1=? AND col3='test' AND col2= ?");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 2);
-
- result= mysql_param_result(stmt);
- mytest(result);
-
- my_print_result_metadata(result);
-
- mysql_field_seek(result, 0);
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- {
- fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1");
- fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select");
- }
- DIE_UNLESS(strcmp(field->name, "col1") == 0);
- DIE_UNLESS(strcmp(field->table, "test_prep_select") == 0);
-
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- {
- fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col2");
- fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select");
- }
- DIE_UNLESS(strcmp(field->name, "col2") == 0);
- DIE_UNLESS(strcmp(field->table, "test_prep_select") == 0);
-
- field= mysql_fetch_field(result);
- mytest_r(field);
-
- mysql_free_result(result);
- mysql_stmt_close(stmt);
-}
-#endif
-
-
/* Test FUNCTION field info / DATE_FORMAT() table_name . */
static void test_func_fields()
diff --git a/tests/thread_test.c b/tests/thread_test.c
index 1a3dd60c1fd..c243a3a7321 100644
--- a/tests/thread_test.c
+++ b/tests/thread_test.c
@@ -88,36 +88,36 @@ static struct my_option my_long_options[] =
{
{"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
- {"database", 'D', "Database to use", (uchar**) &database, (uchar**) &database,
+ {"database", 'D', "Database to use", &database, &database,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"host", 'h', "Connect to host", (uchar**) &host, (uchar**) &host, 0, GET_STR,
+ {"host", 'h', "Connect to host", &host, &host, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"user", 'u', "User for login if not current user", (uchar**) &user,
- (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"user", 'u', "User for login if not current user", &user,
+ &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"verbose", 'v', "Write some progress indicators", (uchar**) &verbose,
- (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"query", 'Q', "Query to execute in each threads", (uchar**) &query,
- (uchar**) &query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"verbose", 'v', "Write some progress indicators", &verbose,
+ &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"query", 'Q', "Query to execute in each threads", &query,
+ &query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
"/etc/services, "
#endif
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
- (uchar**) &tcp_port,
- (uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0},
- {"socket", 'S', "Socket file to use for connection", (uchar**) &unix_socket,
- (uchar**) &unix_socket, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ &tcp_port,
+ &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0},
+ {"socket", 'S', "Socket file to use for connection", &unix_socket,
+ &unix_socket, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"test-count", 'c', "Run test count times (default %d)",
- (uchar**) &number_of_tests, (uchar**) &number_of_tests, 0, GET_UINT,
+ &number_of_tests, &number_of_tests, 0, GET_UINT,
REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
{"thread-count", 't', "Number of threads to start",
- (uchar**) &number_of_threads, (uchar**) &number_of_threads, 0, GET_UINT,
+ &number_of_threads, &number_of_threads, 0, GET_UINT,
REQUIRED_ARG, 2, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/unittest/mysys/my_atomic-t.c b/unittest/mysys/my_atomic-t.c
index 9853d3cf964..95799be7bb1 100644
--- a/unittest/mysys/my_atomic-t.c
+++ b/unittest/mysys/my_atomic-t.c
@@ -15,13 +15,6 @@
#include "thr_template.c"
-/* at least gcc 3.4.5 and 3.4.6 (but not 3.2.3) on RHEL */
-#if __GNUC__ == 3 && __GNUC_MINOR__ == 4
-#define GCC_BUG_WORKAROUND volatile
-#else
-#define GCC_BUG_WORKAROUND
-#endif
-
volatile uint32 b32;
volatile int32 c32;
my_atomic_rwlock_t rwl;
@@ -29,8 +22,8 @@ my_atomic_rwlock_t rwl;
/* add and sub a random number in a loop. Must get 0 at the end */
pthread_handler_t test_atomic_add(void *arg)
{
- int m= (*(int *)arg)/2;
- GCC_BUG_WORKAROUND int32 x;
+ int m= (*(int *)arg)/2;
+ int32 x;
for (x= ((int)(intptr)(&m)); m ; m--)
{
x= (x*m+0x87654321) & INT_MAX32;
@@ -52,8 +45,8 @@ volatile int64 a64;
/* add and sub a random number in a loop. Must get 0 at the end */
pthread_handler_t test_atomic_add64(void *arg)
{
- int m= (*(int *)arg)/2;
- GCC_BUG_WORKAROUND int64 x;
+ int m= (*(int *)arg)/2;
+ int64 x;
for (x= ((int64)(intptr)(&m)); m ; m--)
{
x= (x*m+0xfdecba987654321LL) & INT_MAX64;
@@ -128,8 +121,8 @@ pthread_handler_t test_atomic_fas(void *arg)
*/
pthread_handler_t test_atomic_cas(void *arg)
{
- int m= (*(int *)arg)/2, ok= 0;
- GCC_BUG_WORKAROUND int32 x, y;
+ int m= (*(int *)arg)/2, ok= 0;
+ int32 x, y;
for (x= ((int)(intptr)(&m)); m ; m--)
{
my_atomic_rwlock_wrlock(&rwl);
diff --git a/unittest/mytap/tap.c b/unittest/mytap/tap.c
index 2f1747d7167..7facb23e7e3 100644
--- a/unittest/mytap/tap.c
+++ b/unittest/mytap/tap.c
@@ -29,9 +29,9 @@
/*
Visual Studio 2003 does not know vsnprintf but knows _vsnprintf.
- We don't put this #define in config-win.h because we prefer
- my_vsnprintf everywhere instead, except when linking with libmysys
- is not desirable - the case here.
+ We don't put this #define elsewhere because we prefer my_vsnprintf
+ everywhere instead, except when linking with libmysys is not
+ desirable - the case here.
*/
#if defined(_MSC_VER) && ( _MSC_VER == 1310 )
#define vsnprintf _vsnprintf