2011-07-04 01:25:49 +02:00
|
|
|
/*
|
2013-09-06 22:31:30 +02:00
|
|
|
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
|
2022-06-21 15:59:49 +02:00
|
|
|
Copyright (c) 2009, 2022, MariaDB Corporation.
|
2001-12-06 13:10:51 +01:00
|
|
|
|
|
|
|
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
|
2006-12-23 20:17:15 +01:00
|
|
|
the Free Software Foundation; version 2 of the License.
|
2001-12-06 13:10:51 +01:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
2001-09-15 04:12:46 +02:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2001-12-06 13:10:51 +01:00
|
|
|
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
|
2019-05-11 20:29:06 +02:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2002-06-11 10:20:31 +02:00
|
|
|
/* This is the include file that should be included 'first' in every C file. */
|
2001-09-15 04:12:46 +02:00
|
|
|
|
fixes for test failures
and small collateral changes
mysql-test/lib/My/Test.pm:
somehow with "print" we get truncated writes sometimes
mysql-test/suite/perfschema/r/digest_table_full.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/dml_handler.result:
host table is not ported over yet
mysql-test/suite/perfschema/r/information_schema.result:
host table is not ported over yet
mysql-test/suite/perfschema/r/nesting.result:
this differs, because we don't rewrite general log queries, and multi-statement
packets are logged as a one entry. this result file is identical to what mysql-5.6.5
produces with the --log-raw option.
mysql-test/suite/perfschema/r/relaylog.result:
MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB.
mysql-test/suite/perfschema/r/server_init.result:
MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup.
mysql-test/suite/perfschema/r/stage_mdl_global.result:
this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not
do that, and this causes useless mutex locks and waits.
mysql-test/suite/perfschema/r/statement_digest.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_consumers.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_long_query.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result:
will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged
mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result:
will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
2012-09-27 20:09:46 +02:00
|
|
|
#ifndef MY_GLOBAL_INCLUDED
|
2012-08-01 16:27:34 +02:00
|
|
|
#define MY_GLOBAL_INCLUDED
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2021-06-06 13:21:03 +02:00
|
|
|
/*
|
|
|
|
MDEV-25602 Deprecate __WIN__ symbol.
|
|
|
|
*/
|
2021-08-11 11:26:35 +02:00
|
|
|
#if defined (_MSC_VER) && !defined(__clang__)
|
2021-06-06 13:21:03 +02:00
|
|
|
#pragma deprecated("__WIN__")
|
|
|
|
#elif defined (__GNUC__)
|
|
|
|
#pragma GCC poison __WIN__
|
|
|
|
#endif
|
2010-04-16 10:27:18 +02:00
|
|
|
|
2022-02-02 01:35:40 +01:00
|
|
|
#if defined(_MSC_VER) && !defined(__clang__)
|
2021-11-19 14:03:51 +01:00
|
|
|
/*
|
|
|
|
Following functions have bugs, when used with UTF-8 active codepage.
|
|
|
|
#include <winservice.h> will use the non-buggy wrappers
|
|
|
|
*/
|
|
|
|
#pragma deprecated("CreateServiceA", "OpenServiceA", "ChangeServiceConfigA")
|
|
|
|
#endif
|
|
|
|
|
WL#3914: Additonal accessors required to compile InnoDB as a plugin storage engine
Add more accessors to MySQL internals in mysql/plugin.h, for storage
engine plugins.
Add some accessors specific to the InnoDB storage engine, to allow
InnoDB to be compiled as a plugin (without MYSQL_SERVER). InnoDB
has additional requirements, due to its foreign key support, etc.
include/m_string.h:
Add structure tag to LEX_STRING definition, so that it can be referred
to by forward declarations. Allow struct st_mysql_lex_string to be
defined here, or in mysql/plugin.h.
include/my_global.h:
Define INNODB_COMPATIBILITY_HOOKS unconditionally; it brackets
some definitions needed for the InnoDB storage engine plugin
which do not belong in our general plugin interface.
include/mysql/plugin.h:
Additional accessors for MySQL internals:
- Full definition of MYSQL_LEX_STRING (identical to LEX_STRING from
m_string.h)
- Full definition of MYSQL_XID (binary compatible with XID from
handler.h)
- mysql_tmpfile(), creates a temporary file in mysqld's tmpdir
- thd_killed(), to check killed state of connection
- thd_alloc() and similar allocation functions
- thd_get_xid(), to get XID of connection's transaction
- mysql_query_cache_invalidate4, to invalidate a table's query cache entries
sql/handler.h:
Use MYSQL_XIDDATASIZE definition from mysql/plugin.h, to avoid redundant
definitions
sql/log.cc:
Add definitions for two InnoDB compatibility hooks:
- mysql_bin_log_file(), to get log filename
- mysql_bin_log_file_pos, to get position in file
These are defined only if INNODB_COMPATIBILITY_HOOKS is defined;
they are needed by the InnoDB plugin, but aren't part of the general
plugin interface. They are declared in ha_innodb.h for InnoDB's
use.
sql/mysql_priv.h:
Expose some server internals when INNODB_COMPATIBILITY_HOOKS is
defined, so that InnoDB can be built as a plugin when MYSQL_SERVER
is not defined.
Move make_lex_string inside THD class.
sql/sql_cache.cc:
Add definiton of mysql_query_cache_invalidate4(), a part of the
plugin API (mysql/plugin.h).
sql/sql_class.cc:
Add definitions for several accessor functions which form part
of the plugin API (mysql/plugin.h):
- mysql_tmpfile()
- thd_alloc() and friends
- thd_make_lex_string()
- thd_get_xid()
Add definitons for accessor functions which InnoDB requires,
but which are not part of the plugin interface:
- thd_charset()
- thd_query()
- thd_slave_thread()
- thd_non_transactional_update()
- thd_binlog_format()
Move definition of make_lex_string() from sql_show.cc into THD class
sql/sql_class.h:
Remove LEX_STRING_make(), and move make_lex_string() from sql_show.cc inside THD
class.
sql/sql_parse.cc:
Use thd->make_lex_string() instead of thd->LEX_STRING_make()
sql/sql_show.cc:
Move make_lex_string() inside THD class
storage/innobase/handler/ha_innodb.cc:
Call thd_make_lex_string() instead of make_lex_string().
2007-07-05 01:05:47 +02:00
|
|
|
/*
|
|
|
|
InnoDB depends on some MySQL internals which other plugins should not
|
|
|
|
need. This is because of InnoDB's foreign key support, "safe" binlog
|
|
|
|
truncation, and other similar legacy features.
|
|
|
|
|
|
|
|
We define accessors for these internals unconditionally, but do not
|
|
|
|
expose them in mysql/plugin.h. They are declared in ha_innodb.h for
|
|
|
|
InnoDB's use.
|
|
|
|
*/
|
|
|
|
#define INNODB_COMPATIBILITY_HOOKS
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#ifdef __CYGWIN__
|
|
|
|
/* We use a Unix API, so pretend it's not Windows */
|
|
|
|
#undef WIN
|
|
|
|
#undef WIN32
|
|
|
|
#undef _WIN
|
|
|
|
#undef _WIN32
|
|
|
|
#undef _WIN64
|
2021-06-06 13:21:03 +02:00
|
|
|
#undef _WIN32
|
2001-09-15 04:12:46 +02:00
|
|
|
#undef __WIN32__
|
|
|
|
#define HAVE_ERRNO_AS_DEFINE
|
2011-12-01 23:24:58 +01:00
|
|
|
#define _POSIX_MONOTONIC_CLOCK
|
|
|
|
#define _POSIX_THREAD_CPUTIME
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif /* __CYGWIN__ */
|
|
|
|
|
2010-05-25 15:27:52 +02:00
|
|
|
#if defined(__OpenBSD__) && (OpenBSD >= 200411)
|
|
|
|
#define HAVE_ERRNO_AS_DEFINE
|
|
|
|
#endif
|
|
|
|
|
2003-07-03 18:23:06 +02:00
|
|
|
#if defined(i386) && !defined(__i386__)
|
|
|
|
#define __i386__
|
|
|
|
#endif
|
|
|
|
|
2002-11-07 02:54:00 +01:00
|
|
|
/* Macros to make switching between C and C++ mode easier */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define C_MODE_START extern "C" {
|
|
|
|
#define C_MODE_END }
|
|
|
|
#else
|
|
|
|
#define C_MODE_START
|
|
|
|
#define C_MODE_END
|
|
|
|
#endif
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2010-05-31 17:29:54 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#define CPP_UNNAMED_NS_START namespace {
|
|
|
|
#define CPP_UNNAMED_NS_END }
|
|
|
|
#endif
|
|
|
|
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#include <my_config.h>
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2009-12-01 01:49:15 +01:00
|
|
|
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
|
|
|
|
#define HAVE_PSI_INTERFACE
|
|
|
|
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
|
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
/* Make it easier to add conditional code in _expressions_ */
|
2021-06-06 13:21:03 +02:00
|
|
|
#ifdef _WIN32
|
2009-12-22 10:35:56 +01:00
|
|
|
#define IF_WIN(A,B) A
|
2007-04-18 13:21:39 +02:00
|
|
|
#else
|
2009-12-22 10:35:56 +01:00
|
|
|
#define IF_WIN(A,B) B
|
|
|
|
#endif
|
|
|
|
|
2013-04-07 15:37:47 +02:00
|
|
|
#ifdef EMBEDDED_LIBRARY
|
|
|
|
#define IF_EMBEDDED(A,B) A
|
|
|
|
#else
|
|
|
|
#define IF_EMBEDDED(A,B) B
|
2008-06-16 05:04:45 +02:00
|
|
|
#endif
|
|
|
|
|
2013-06-15 19:09:40 +02:00
|
|
|
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
|
|
|
#define IF_PARTITIONING(A,B) A
|
|
|
|
#else
|
|
|
|
#define IF_PARTITIONING(A,B) B
|
|
|
|
#endif
|
|
|
|
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#if defined (_WIN32)
|
|
|
|
/*
|
|
|
|
off_t is 32 bit long. We do not use C runtime functions
|
|
|
|
with off_t but native Win32 file IO APIs, that work with
|
|
|
|
64 bit offsets.
|
|
|
|
*/
|
|
|
|
#undef SIZEOF_OFF_T
|
|
|
|
#define SIZEOF_OFF_T 8
|
|
|
|
|
|
|
|
/*
|
|
|
|
Prevent inclusion of Windows GDI headers - they define symbol
|
|
|
|
ERROR that conflicts with mysql headers.
|
|
|
|
*/
|
|
|
|
#ifndef NOGDI
|
|
|
|
#define NOGDI
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Include common headers.*/
|
|
|
|
#include <winsock2.h>
|
|
|
|
#include <ws2tcpip.h> /* SOCKET */
|
|
|
|
#include <io.h> /* access(), chmod() */
|
|
|
|
#include <process.h> /* getpid() */
|
|
|
|
|
|
|
|
#define sleep(a) Sleep((a)*1000)
|
|
|
|
|
|
|
|
/* Define missing access() modes. */
|
|
|
|
#define F_OK 0
|
|
|
|
#define W_OK 2
|
2013-03-25 23:03:13 +01:00
|
|
|
#define R_OK 4 /* Test for read permission. */
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
|
|
|
|
/* Define missing file locking constants. */
|
|
|
|
#define F_RDLCK 1
|
|
|
|
#define F_WRLCK 2
|
|
|
|
#define F_UNLCK 3
|
|
|
|
#define F_TO_EOF 0x3FFFFFFF
|
|
|
|
|
|
|
|
#endif /* _WIN32*/
|
|
|
|
|
2007-01-04 22:22:25 +01:00
|
|
|
/*
|
|
|
|
The macros below are used to allow build of Universal/fat binaries of
|
|
|
|
MySQL and MySQL applications under darwin.
|
|
|
|
*/
|
2007-11-30 01:36:05 +01:00
|
|
|
#if defined(__APPLE__) && defined(__MACH__)
|
|
|
|
# undef SIZEOF_CHARP
|
|
|
|
# undef SIZEOF_INT
|
|
|
|
# undef SIZEOF_LONG
|
|
|
|
# undef SIZEOF_LONG_LONG
|
|
|
|
# undef SIZEOF_OFF_T
|
|
|
|
# undef WORDS_BIGENDIAN
|
|
|
|
# define SIZEOF_INT 4
|
|
|
|
# define SIZEOF_LONG_LONG 8
|
|
|
|
# define SIZEOF_OFF_T 8
|
|
|
|
# if defined(__i386__) || defined(__ppc__)
|
|
|
|
# define SIZEOF_CHARP 4
|
|
|
|
# define SIZEOF_LONG 4
|
2021-01-30 16:04:27 +01:00
|
|
|
# elif defined(__x86_64__) || defined(__ppc64__) || defined(__aarch64__) || defined(__arm64__)
|
2007-11-30 01:36:05 +01:00
|
|
|
# define SIZEOF_CHARP 8
|
|
|
|
# define SIZEOF_LONG 8
|
|
|
|
# else
|
|
|
|
# error Building FAT binary for an unknown architecture.
|
|
|
|
# endif
|
|
|
|
# if defined(__ppc__) || defined(__ppc64__)
|
|
|
|
# define WORDS_BIGENDIAN
|
|
|
|
# endif
|
|
|
|
#endif /* defined(__APPLE__) && defined(__MACH__) */
|
2007-01-04 22:22:25 +01:00
|
|
|
|
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
/*
|
|
|
|
The macros below are borrowed from include/linux/compiler.h in the
|
2017-11-15 05:37:32 +01:00
|
|
|
Linux kernel. Use them to indicate the likelihood of the truthfulness
|
2002-01-29 17:32:16 +01:00
|
|
|
of a condition. This serves two purposes - newer versions of gcc will be
|
|
|
|
able to optimize for branch predication, which could yield siginficant
|
|
|
|
performance gains in frequently executed sections of the code, and the
|
|
|
|
other reason to use them is for documentation
|
2002-01-27 06:26:24 +01:00
|
|
|
*/
|
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
|
2002-01-27 06:26:24 +01:00
|
|
|
#define __builtin_expect(x, expected_value) (x)
|
|
|
|
#endif
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
/* Fix problem with S_ISLNK() on Linux */
|
2006-07-26 15:43:03 +02:00
|
|
|
#if defined(TARGET_OS_LINUX) || defined(__GLIBC__)
|
2001-09-15 04:12:46 +02:00
|
|
|
#undef _GNU_SOURCE
|
|
|
|
#define _GNU_SOURCE 1
|
|
|
|
#endif
|
|
|
|
|
2005-09-15 19:00:25 +02:00
|
|
|
/*
|
|
|
|
Temporary solution to solve bug#7156. Include "sys/types.h" before
|
|
|
|
the thread headers, else the function madvise() will not be defined
|
|
|
|
*/
|
|
|
|
#if defined(HAVE_SYS_TYPES_H) && ( defined(sun) || defined(__sun) )
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#define __EXTENSIONS__ 1 /* We want some extension */
|
|
|
|
#ifndef __STDC_EXT__
|
|
|
|
#define __STDC_EXT__ 1 /* To get large file support on hpux */
|
|
|
|
#endif
|
|
|
|
|
2005-03-15 18:31:56 +01:00
|
|
|
/*
|
2005-03-18 14:59:07 +01:00
|
|
|
Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
|
2005-03-15 18:31:56 +01:00
|
|
|
|
|
|
|
System Interfaces and Headers, Issue 5
|
|
|
|
|
2005-03-18 14:59:07 +01:00
|
|
|
saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
|
2005-03-15 18:31:56 +01:00
|
|
|
but apparently other systems (namely FreeBSD) don't agree.
|
2005-03-18 14:59:07 +01:00
|
|
|
|
|
|
|
On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
|
|
|
|
Furthermore, it tests that if a program requires older standard
|
|
|
|
(_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
|
|
|
|
run on a new compiler (that defines _STDC_C99) and issues an #error.
|
|
|
|
It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
|
|
|
|
or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
|
|
|
|
|
|
|
|
To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
|
|
|
|
C++ compiler does not!
|
|
|
|
|
|
|
|
So, in a desperate attempt to get correct prototypes for both
|
|
|
|
C and C++ code, we define either _XOPEN_SOURCE=600 or _XOPEN_SOURCE=500
|
|
|
|
depending on the compiler's announced C standard support.
|
|
|
|
|
|
|
|
Cleaner solutions are welcome.
|
2005-03-15 18:31:56 +01:00
|
|
|
*/
|
2005-03-15 18:45:29 +01:00
|
|
|
#ifdef __sun
|
2005-03-18 14:59:07 +01:00
|
|
|
#if __STDC_VERSION__ - 0 >= 199901L
|
|
|
|
#define _XOPEN_SOURCE 600
|
|
|
|
#else
|
2005-03-15 18:31:56 +01:00
|
|
|
#define _XOPEN_SOURCE 500
|
|
|
|
#endif
|
2005-03-18 14:59:07 +01:00
|
|
|
#endif
|
2005-03-15 18:31:56 +01:00
|
|
|
|
2014-02-27 16:44:00 +01:00
|
|
|
|
|
|
|
#ifdef _AIX
|
|
|
|
/*
|
|
|
|
AIX includes inttypes.h from sys/types.h
|
|
|
|
Explicitly request format macros before the first inclusion of inttypes.h
|
|
|
|
*/
|
2018-09-14 08:47:22 +02:00
|
|
|
#if !defined(__STDC_FORMAT_MACROS)
|
|
|
|
#define __STDC_FORMAT_MACROS
|
|
|
|
#endif // !defined(__STDC_FORMAT_MACROS)
|
2014-02-27 16:44:00 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2021-06-06 13:21:03 +02:00
|
|
|
#if !defined(_WIN32)
|
2001-09-15 04:12:46 +02:00
|
|
|
#ifndef _POSIX_PTHREAD_SEMANTICS
|
|
|
|
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
|
|
|
|
#endif
|
2002-06-11 10:20:31 +02:00
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#if !defined(SCO)
|
|
|
|
#define _REENTRANT 1 /* Some thread libraries require this */
|
|
|
|
#endif
|
|
|
|
#if !defined(_THREAD_SAFE) && !defined(_AIX)
|
|
|
|
#define _THREAD_SAFE /* Required for OSF1 */
|
|
|
|
#endif
|
2005-02-02 10:50:33 +01:00
|
|
|
#if defined(HPUX10) || defined(HPUX11)
|
|
|
|
C_MODE_START /* HPUX needs this, signal.h bug */
|
|
|
|
#include <pthread.h>
|
|
|
|
C_MODE_END
|
|
|
|
#else
|
2001-09-15 04:12:46 +02:00
|
|
|
#include <pthread.h> /* AIX must have this included first */
|
2005-02-02 10:50:33 +01:00
|
|
|
#endif
|
2001-09-15 04:12:46 +02:00
|
|
|
#if !defined(SCO) && !defined(_REENTRANT)
|
|
|
|
#define _REENTRANT 1 /* Threads requires reentrant code */
|
|
|
|
#endif
|
2021-06-06 13:21:03 +02:00
|
|
|
#endif /* !defined(_WIN32) */
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2003-01-14 10:27:26 +01:00
|
|
|
/* gcc/egcs issues */
|
|
|
|
|
|
|
|
#if defined(__GNUC) && defined(__EXCEPTIONS)
|
|
|
|
#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile"
|
|
|
|
#endif
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#if defined(_lint) && !defined(lint)
|
|
|
|
#define lint
|
|
|
|
#endif
|
2014-02-27 16:44:00 +01:00
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#ifndef stdin
|
|
|
|
#include <stdio.h>
|
|
|
|
#endif
|
2009-10-16 10:47:34 +02:00
|
|
|
#include <stdarg.h>
|
2001-09-15 04:12:46 +02:00
|
|
|
#ifdef HAVE_STDLIB_H
|
|
|
|
#include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_STDDEF_H
|
|
|
|
#include <stddef.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <math.h>
|
|
|
|
#ifdef HAVE_LIMITS_H
|
|
|
|
#include <limits.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_FLOAT_H
|
|
|
|
#include <float.h>
|
|
|
|
#endif
|
2009-02-25 09:36:11 +01:00
|
|
|
#ifdef HAVE_FENV_H
|
|
|
|
#include <fenv.h> /* For fesetround() */
|
|
|
|
#endif
|
2001-09-15 04:12:46 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
2014-02-27 16:44:00 +01:00
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#ifdef HAVE_FCNTL_H
|
|
|
|
#include <fcntl.h>
|
|
|
|
#endif
|
2007-12-15 13:07:40 +01:00
|
|
|
#ifdef HAVE_SYS_STAT_H
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#endif
|
2001-09-15 04:12:46 +02:00
|
|
|
#if TIME_WITH_SYS_TIME
|
|
|
|
# include <sys/time.h>
|
|
|
|
# include <time.h>
|
|
|
|
#else
|
|
|
|
# if HAVE_SYS_TIME_H
|
|
|
|
# include <sys/time.h>
|
|
|
|
# else
|
|
|
|
# include <time.h>
|
|
|
|
# endif
|
|
|
|
#endif /* TIME_WITH_SYS_TIME */
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
2007-05-22 21:41:40 +02:00
|
|
|
|
2003-02-28 21:24:00 +01:00
|
|
|
#include <errno.h> /* Recommended by debian */
|
2003-04-28 09:32:56 +02:00
|
|
|
/* We need the following to go around a problem with openssl on solaris */
|
2003-04-28 18:05:57 +02:00
|
|
|
#if defined(HAVE_CRYPT_H)
|
2003-04-28 09:32:56 +02:00
|
|
|
#include <crypt.h>
|
|
|
|
#endif
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2018-04-11 01:08:02 +02:00
|
|
|
/* Add checking if we are using likely/unlikely wrong */
|
|
|
|
#ifdef CHECK_UNLIKELY
|
|
|
|
C_MODE_START
|
|
|
|
extern void init_my_likely(), end_my_likely(FILE *);
|
|
|
|
extern int my_likely_ok(const char *file_name, uint line);
|
|
|
|
extern int my_likely_fail(const char *file_name, uint line);
|
|
|
|
C_MODE_END
|
|
|
|
|
|
|
|
#define likely(A) ((A) ? (my_likely_ok(__FILE__, __LINE__),1) : (my_likely_fail(__FILE__, __LINE__), 0))
|
|
|
|
#define unlikely(A) ((A) ? (my_likely_fail(__FILE__, __LINE__),1) : (my_likely_ok(__FILE__, __LINE__), 0))
|
|
|
|
/*
|
|
|
|
These macros should be used when the check fails often when running benchmarks but
|
|
|
|
we know for sure that the check is correct in a production environment
|
|
|
|
*/
|
|
|
|
#define checked_likely(A) (A)
|
|
|
|
#define checked_unlikely(A) (A)
|
|
|
|
#else
|
|
|
|
/**
|
|
|
|
The semantics of builtin_expect() are that
|
|
|
|
1) its two arguments are long
|
|
|
|
2) it's likely that they are ==
|
|
|
|
Those of our likely(x) are that x can be bool/int/longlong/pointer.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define likely(x) __builtin_expect(((x) != 0),1)
|
|
|
|
#define unlikely(x) __builtin_expect(((x) != 0),0)
|
|
|
|
#define checked_likely(x) likely(x)
|
|
|
|
#define checked_unlikely(x) unlikely(x)
|
|
|
|
#endif /* CHECK_UNLIKELY */
|
|
|
|
|
2004-06-27 23:42:02 +02:00
|
|
|
/*
|
|
|
|
A lot of our programs uses asserts, so better to always include it
|
|
|
|
This also fixes a problem when people uses DBUG_ASSERT without including
|
|
|
|
assert.h
|
|
|
|
*/
|
|
|
|
#include <assert.h>
|
|
|
|
|
2007-03-23 18:14:46 +01:00
|
|
|
/* an assert that works at compile-time. only for constant expression */
|
2008-10-21 20:10:49 +02:00
|
|
|
#ifdef _some_old_compiler_that_does_not_understand_the_construct_below_
|
2007-04-29 18:00:08 +02:00
|
|
|
#define compile_time_assert(X) do { } while(0)
|
|
|
|
#else
|
2007-03-23 18:14:46 +01:00
|
|
|
#define compile_time_assert(X) \
|
|
|
|
do \
|
|
|
|
{ \
|
2013-06-14 10:52:23 +02:00
|
|
|
typedef char compile_time_assert[(X) ? 1 : -1] __attribute__((unused)); \
|
2007-03-23 18:14:46 +01:00
|
|
|
} while(0)
|
2007-04-29 18:00:08 +02:00
|
|
|
#endif
|
2007-03-23 18:14:46 +01:00
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
/* Go around some bugs in different OS and compilers */
|
2005-12-19 17:00:53 +01:00
|
|
|
#if defined (HPUX11) && defined(_LARGEFILE_SOURCE)
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#ifndef _LARGEFILE64_SOURCE
|
2005-12-19 17:00:53 +01:00
|
|
|
#define _LARGEFILE64_SOURCE
|
|
|
|
#endif
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#endif
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H)
|
|
|
|
#include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */
|
|
|
|
#define HAVE_ULONG
|
|
|
|
#endif
|
2011-01-11 10:07:37 +01:00
|
|
|
#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE)
|
2002-01-02 20:29:41 +01:00
|
|
|
/* Fix bug in setrlimit */
|
|
|
|
#undef setrlimit
|
|
|
|
#define setrlimit cma_setrlimit64
|
|
|
|
#endif
|
2005-08-31 19:08:55 +02:00
|
|
|
/* Declare madvise where it is not declared for C++, like Solaris */
|
|
|
|
#if HAVE_MADVISE && !HAVE_DECL_MADVISE && defined(__cplusplus)
|
|
|
|
extern "C" int madvise(void *addr, size_t len, int behav);
|
|
|
|
#endif
|
2019-09-23 10:28:55 +02:00
|
|
|
#ifdef HAVE_SYS_MMAN_H
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#endif
|
|
|
|
/** FreeBSD equivalent */
|
|
|
|
#if defined(MADV_CORE) && !defined(MADV_DODUMP)
|
|
|
|
#define MADV_DODUMP MADV_CORE
|
|
|
|
#define MADV_DONTDUMP MADV_NOCORE
|
|
|
|
#define DODUMP_STR "MADV_CORE"
|
|
|
|
#define DONTDUMP_STR "MADV_NOCORE"
|
|
|
|
#else
|
|
|
|
#define DODUMP_STR "MADV_DODUMP"
|
|
|
|
#define DONTDUMP_STR "MADV_DONTDUMP"
|
|
|
|
#endif
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2004-05-25 01:28:44 +02:00
|
|
|
#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */
|
|
|
|
#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
/* Paranoid settings. Define I_AM_PARANOID if you are paranoid */
|
|
|
|
#ifdef I_AM_PARANOID
|
|
|
|
#define DONT_ALLOW_USER_CHANGE 1
|
|
|
|
#define DONT_USE_MYSQL_PWD 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Does the system remember a signal handler after a signal ? */
|
2010-07-01 10:02:00 +02:00
|
|
|
#if !defined(HAVE_BSD_SIGNALS) && !defined(HAVE_SIGACTION)
|
|
|
|
#define SIGNAL_HANDLER_RESET_ON_DELIVERY
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif
|
|
|
|
|
2017-07-14 15:30:27 +02:00
|
|
|
/* don't assume that STDERR_FILENO is 2, mysqld can freopen */
|
|
|
|
#undef STDERR_FILENO
|
2012-03-14 21:16:24 +01:00
|
|
|
|
2010-08-09 10:32:50 +02:00
|
|
|
#ifndef SO_EXT
|
2010-03-29 17:13:53 +02:00
|
|
|
#ifdef _WIN32
|
|
|
|
#define SO_EXT ".dll"
|
|
|
|
#else
|
|
|
|
#define SO_EXT ".so"
|
|
|
|
#endif
|
2010-08-09 10:32:50 +02:00
|
|
|
#endif
|
2010-03-29 17:13:53 +02:00
|
|
|
|
Bug#53445: Build with -Wall and fix warnings that it generates
Apart strict-aliasing warnings, fix the remaining warnings
generated by GCC 4.4.4 -Wall and -Wextra flags.
One major source of warnings was the in-house function my_bcmp
which (unconventionally) took pointers to unsigned characters
as the byte sequences to be compared. Since my_bcmp and bcmp
are deprecated functions whose only difference with memcmp is
the return value, every use of the function is replaced with
memcmp as the special return value wasn't actually being used
by any caller.
There were also various other warnings, mostly due to type
mismatches, missing return values, missing prototypes, dead
code (unreachable) and ignored return values.
BUILD/SETUP.sh:
Remove flags that are implied by -Wall and -Wextra.
Do not warn about unused parameters in C++.
BUILD/check-cpu:
Print only the compiler version instead of verbose banner.
Although the option is gcc specific, the check was only
being used for GCC specific checks anyway.
client/mysql.cc:
bcmp is no longer defined.
client/mysqltest.cc:
Pass a string to function expecting a format string.
Replace use of bcmp with memcmp.
cmd-line-utils/readline/Makefile.am:
Always define _GNU_SOURCE when compiling GNU readline.
Required to make certain prototypes visible.
cmd-line-utils/readline/input.c:
Condition for the code to be meaningful.
configure.in:
Remove check for bcmp.
extra/comp_err.c:
Use appropriate type.
extra/replace.c:
Replace use of bcmp with memcmp.
extra/yassl/src/crypto_wrapper.cpp:
Do not ignore the return value of fgets. Retrieve the file
position if fgets succeed -- if it fails, the function will
bail out and return a error.
extra/yassl/taocrypt/include/blowfish.hpp:
Use a single array instead of accessing positions of the sbox_
through a subscript to pbox_.
extra/yassl/taocrypt/include/runtime.hpp:
One definition of such functions is enough.
extra/yassl/taocrypt/src/aes.cpp:
Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/algebra.cpp:
Rename arguments to avoid shadowing related warnings.
extra/yassl/taocrypt/src/blowfish.cpp:
Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/integer.cpp:
Do not define type within a anonymous union.
Use a variable to return a value instead of
leaving the result in a register -- compiler
does not know the logic inside the asm.
extra/yassl/taocrypt/src/misc.cpp:
Define handler for pure virtual functions.
Remove unused code.
extra/yassl/taocrypt/src/twofish.cpp:
Avoid potentially ambiguous conditions.
extra/yassl/testsuite/test.hpp:
Function must have C language linkage.
include/m_string.h:
Remove check which relied on bcmp being defined -- they weren't
being used as bcmp is only visible when _BSD_SOURCE is defined.
include/my_bitmap.h:
Remove bogus helpers which were used only in a few files and
were causing warnings about dead code.
include/my_global.h:
Due to G++ bug, always silence false-positive uninitialized
variables warnings when compiling C++ code with G++.
Remove bogus helper.
libmysql/Makefile.shared:
Remove built-in implementation of bcmp.
mysql-test/lib/My/SafeProcess/safe_process.cc:
Cast pid to largest possible type for a process identifier.
mysys/mf_loadpath.c:
Leave space of the ending nul.
mysys/mf_pack.c:
Replace bcmp with memcmp.
mysys/my_bitmap.c:
Dead code removal.
mysys/my_gethwaddr.c:
Remove unused variable.
mysys/my_getopt.c:
Silence bogus uninitialized variable warning.
Do not cast away the constant qualifier.
mysys/safemalloc.c:
Cast to expected type.
mysys/thr_lock.c:
Silence bogus uninitialized variable warning.
sql/field.cc:
Replace bogus helper with a more appropriate logic which is
used throughout the code.
sql/item.cc:
Remove bogus logical condition which always evaluates to TRUE.
sql/item_create.cc:
Simplify code to avoid signedness related warnings.
sql/log_event.cc:
Replace use of bcmp with memcmp.
No need to use helpers for simple bit operations.
sql/log_event_old.cc:
Replace bmove_align with memcpy.
sql/mysqld.cc:
Move use declaration of variable to the ifdef block where it
is used. Remove now-unnecessary casts and arguments.
sql/set_var.cc:
Replace bogus helpers with simple and classic bit operations.
sql/slave.cc:
Cast to expected type and silence bogus warning.
sql/sql_class.h:
Don't use enum values as bit flags, the supposed type safety is
bogus as the combined bit flags are not a value in the enumeration.
sql/udf_example.c:
Only declare variable when necessary.
sql/unireg.h:
Replace use of bmove_align with memcpy.
storage/innobase/os/os0file.c:
Silence bogus warning.
storage/myisam/mi_open.c:
Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
char.
storage/myisam/mi_page.c:
Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
char.
strings/bcmp.c:
Remove built-in bcmp.
strings/ctype-ucs2.c:
Silence bogus warning.
tests/mysql_client_test.c:
Use a appropriate type as expected by simple_command().
2010-07-02 20:30:47 +02:00
|
|
|
/*
|
2009-08-28 17:51:31 +02:00
|
|
|
Suppress uninitialized variable warning without generating code.
|
|
|
|
*/
|
2015-08-25 09:46:31 +02:00
|
|
|
#if defined(__GNUC__)
|
Bug#53445: Build with -Wall and fix warnings that it generates
Apart strict-aliasing warnings, fix the remaining warnings
generated by GCC 4.4.4 -Wall and -Wextra flags.
One major source of warnings was the in-house function my_bcmp
which (unconventionally) took pointers to unsigned characters
as the byte sequences to be compared. Since my_bcmp and bcmp
are deprecated functions whose only difference with memcmp is
the return value, every use of the function is replaced with
memcmp as the special return value wasn't actually being used
by any caller.
There were also various other warnings, mostly due to type
mismatches, missing return values, missing prototypes, dead
code (unreachable) and ignored return values.
BUILD/SETUP.sh:
Remove flags that are implied by -Wall and -Wextra.
Do not warn about unused parameters in C++.
BUILD/check-cpu:
Print only the compiler version instead of verbose banner.
Although the option is gcc specific, the check was only
being used for GCC specific checks anyway.
client/mysql.cc:
bcmp is no longer defined.
client/mysqltest.cc:
Pass a string to function expecting a format string.
Replace use of bcmp with memcmp.
cmd-line-utils/readline/Makefile.am:
Always define _GNU_SOURCE when compiling GNU readline.
Required to make certain prototypes visible.
cmd-line-utils/readline/input.c:
Condition for the code to be meaningful.
configure.in:
Remove check for bcmp.
extra/comp_err.c:
Use appropriate type.
extra/replace.c:
Replace use of bcmp with memcmp.
extra/yassl/src/crypto_wrapper.cpp:
Do not ignore the return value of fgets. Retrieve the file
position if fgets succeed -- if it fails, the function will
bail out and return a error.
extra/yassl/taocrypt/include/blowfish.hpp:
Use a single array instead of accessing positions of the sbox_
through a subscript to pbox_.
extra/yassl/taocrypt/include/runtime.hpp:
One definition of such functions is enough.
extra/yassl/taocrypt/src/aes.cpp:
Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/algebra.cpp:
Rename arguments to avoid shadowing related warnings.
extra/yassl/taocrypt/src/blowfish.cpp:
Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/integer.cpp:
Do not define type within a anonymous union.
Use a variable to return a value instead of
leaving the result in a register -- compiler
does not know the logic inside the asm.
extra/yassl/taocrypt/src/misc.cpp:
Define handler for pure virtual functions.
Remove unused code.
extra/yassl/taocrypt/src/twofish.cpp:
Avoid potentially ambiguous conditions.
extra/yassl/testsuite/test.hpp:
Function must have C language linkage.
include/m_string.h:
Remove check which relied on bcmp being defined -- they weren't
being used as bcmp is only visible when _BSD_SOURCE is defined.
include/my_bitmap.h:
Remove bogus helpers which were used only in a few files and
were causing warnings about dead code.
include/my_global.h:
Due to G++ bug, always silence false-positive uninitialized
variables warnings when compiling C++ code with G++.
Remove bogus helper.
libmysql/Makefile.shared:
Remove built-in implementation of bcmp.
mysql-test/lib/My/SafeProcess/safe_process.cc:
Cast pid to largest possible type for a process identifier.
mysys/mf_loadpath.c:
Leave space of the ending nul.
mysys/mf_pack.c:
Replace bcmp with memcmp.
mysys/my_bitmap.c:
Dead code removal.
mysys/my_gethwaddr.c:
Remove unused variable.
mysys/my_getopt.c:
Silence bogus uninitialized variable warning.
Do not cast away the constant qualifier.
mysys/safemalloc.c:
Cast to expected type.
mysys/thr_lock.c:
Silence bogus uninitialized variable warning.
sql/field.cc:
Replace bogus helper with a more appropriate logic which is
used throughout the code.
sql/item.cc:
Remove bogus logical condition which always evaluates to TRUE.
sql/item_create.cc:
Simplify code to avoid signedness related warnings.
sql/log_event.cc:
Replace use of bcmp with memcmp.
No need to use helpers for simple bit operations.
sql/log_event_old.cc:
Replace bmove_align with memcpy.
sql/mysqld.cc:
Move use declaration of variable to the ifdef block where it
is used. Remove now-unnecessary casts and arguments.
sql/set_var.cc:
Replace bogus helpers with simple and classic bit operations.
sql/slave.cc:
Cast to expected type and silence bogus warning.
sql/sql_class.h:
Don't use enum values as bit flags, the supposed type safety is
bogus as the combined bit flags are not a value in the enumeration.
sql/udf_example.c:
Only declare variable when necessary.
sql/unireg.h:
Replace use of bmove_align with memcpy.
storage/innobase/os/os0file.c:
Silence bogus warning.
storage/myisam/mi_open.c:
Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
char.
storage/myisam/mi_page.c:
Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
char.
strings/bcmp.c:
Remove built-in bcmp.
strings/ctype-ucs2.c:
Silence bogus warning.
tests/mysql_client_test.c:
Use a appropriate type as expected by simple_command().
2010-07-02 20:30:47 +02:00
|
|
|
/* GCC specific self-initialization which inhibits the warning. */
|
2009-08-28 17:51:31 +02:00
|
|
|
#define UNINIT_VAR(x) x= x
|
2014-08-26 12:57:09 +02:00
|
|
|
#elif defined(_lint) || defined(FORCE_INIT_OF_VARS)
|
|
|
|
#define UNINIT_VAR(x) x= 0
|
|
|
|
#else
|
|
|
|
#define UNINIT_VAR(x) x
|
2009-08-28 17:51:31 +02:00
|
|
|
#endif
|
|
|
|
|
2018-02-24 18:42:13 +01:00
|
|
|
/* This is only to be used when resetting variables in a class constructor */
|
2015-08-27 09:07:32 +02:00
|
|
|
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
|
|
|
|
#define LINT_INIT(x) x= 0
|
|
|
|
#else
|
|
|
|
#define LINT_INIT(x)
|
|
|
|
#endif
|
|
|
|
|
2006-04-15 17:49:00 +02:00
|
|
|
#if !defined(HAVE_UINT)
|
2005-04-29 16:03:34 +02:00
|
|
|
#undef HAVE_UINT
|
|
|
|
#define HAVE_UINT
|
2001-09-15 04:12:46 +02:00
|
|
|
typedef unsigned int uint;
|
|
|
|
typedef unsigned short ushort;
|
|
|
|
#endif
|
|
|
|
|
2013-04-07 15:20:58 +02:00
|
|
|
#define swap_variables(t, a, b) do { t dummy; dummy= a; a= b; b= dummy; } while(0)
|
2014-02-19 11:05:15 +01:00
|
|
|
#define MY_TEST(a) ((a) ? 1 : 0)
|
2004-02-17 16:57:39 +01:00
|
|
|
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
|
|
|
|
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
|
2002-03-13 00:02:45 +01:00
|
|
|
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
|
2001-09-15 04:12:46 +02:00
|
|
|
#define test_all_bits(a,b) (((a) & (b)) == (b))
|
|
|
|
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
|
|
|
|
|
2002-06-29 17:52:24 +02:00
|
|
|
/* Define some general constants */
|
2001-09-15 04:12:46 +02:00
|
|
|
#ifndef TRUE
|
|
|
|
#define TRUE (1) /* Logical true */
|
|
|
|
#define FALSE (0) /* Logical false */
|
|
|
|
#endif
|
|
|
|
|
2010-07-14 21:39:40 +02:00
|
|
|
#include <my_compiler.h>
|
2023-03-07 11:13:20 +01:00
|
|
|
#include <my_alloca.h>
|
2006-10-03 00:48:26 +02:00
|
|
|
|
2005-12-03 20:52:34 +01:00
|
|
|
/*
|
|
|
|
Wen using the embedded library, users might run into link problems,
|
2006-04-07 12:46:50 +02:00
|
|
|
duplicate declaration of __cxa_pure_virtual, solved by declaring it a
|
2005-12-03 20:52:34 +01:00
|
|
|
weak symbol.
|
|
|
|
*/
|
2007-01-23 15:42:03 +01:00
|
|
|
#if defined(USE_MYSYS_NEW) && ! defined(DONT_DECLARE_CXA_PURE_VIRTUAL)
|
2005-12-03 20:52:34 +01:00
|
|
|
C_MODE_START
|
|
|
|
int __cxa_pure_virtual () __attribute__ ((weak));
|
|
|
|
C_MODE_END
|
|
|
|
#endif
|
|
|
|
|
2006-10-12 19:43:47 +02:00
|
|
|
/* The DBUG_ON flag always takes precedence over default DBUG_OFF */
|
2001-09-15 04:12:46 +02:00
|
|
|
#if defined(DBUG_ON) && defined(DBUG_OFF)
|
|
|
|
#undef DBUG_OFF
|
|
|
|
#endif
|
|
|
|
|
2006-10-12 19:43:47 +02:00
|
|
|
/* We might be forced to turn debug off, if not turned off already */
|
|
|
|
#if (defined(FORCE_DBUG_OFF) || defined(_lint)) && !defined(DBUG_OFF)
|
|
|
|
# define DBUG_OFF
|
|
|
|
# ifdef DBUG_ON
|
|
|
|
# undef DBUG_ON
|
|
|
|
# endif
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif
|
|
|
|
|
2012-03-13 13:27:14 +01:00
|
|
|
#ifdef DBUG_OFF
|
|
|
|
#undef EXTRA_DEBUG
|
|
|
|
#endif
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
/* Some types that is different between systems */
|
|
|
|
|
|
|
|
typedef int File; /* File descriptor */
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#ifdef _WIN32
|
|
|
|
typedef SOCKET my_socket;
|
|
|
|
#else
|
2001-09-15 04:12:46 +02:00
|
|
|
typedef int my_socket; /* File descriptor for sockets */
|
|
|
|
#define INVALID_SOCKET -1
|
|
|
|
#endif
|
2017-11-15 05:37:32 +01:00
|
|
|
/* Type for functions that handles signals */
|
2001-09-15 04:12:46 +02:00
|
|
|
#define sig_handler RETSIGTYPE
|
|
|
|
#if defined(__GNUC__) && !defined(_lint)
|
|
|
|
typedef char pchar; /* Mixed prototypes can take char */
|
|
|
|
typedef char puchar; /* Mixed prototypes can take char */
|
|
|
|
typedef char pbool; /* Mixed prototypes can take char */
|
|
|
|
typedef short pshort; /* Mixed prototypes can take short int */
|
|
|
|
typedef float pfloat; /* Mixed prototypes can take float */
|
|
|
|
#else
|
|
|
|
typedef int pchar; /* Mixed prototypes can't take char */
|
|
|
|
typedef uint puchar; /* Mixed prototypes can't take char */
|
|
|
|
typedef int pbool; /* Mixed prototypes can't take char */
|
|
|
|
typedef int pshort; /* Mixed prototypes can't take short int */
|
|
|
|
typedef double pfloat; /* Mixed prototypes can't take float */
|
|
|
|
#endif
|
2002-11-07 02:54:00 +01:00
|
|
|
C_MODE_START
|
2001-09-15 04:12:46 +02:00
|
|
|
typedef int (*qsort_cmp)(const void *,const void *);
|
|
|
|
typedef int (*qsort_cmp2)(void*, const void *,const void *);
|
2002-11-07 02:54:00 +01:00
|
|
|
C_MODE_END
|
2018-02-24 18:42:13 +01:00
|
|
|
#define qsort_t RETQSORTTYPE /* Broken GCC can't handle typedef !!!! */
|
2001-09-15 04:12:46 +02:00
|
|
|
#ifdef HAVE_SYS_SOCKET_H
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#endif
|
2006-04-17 07:10:56 +02:00
|
|
|
typedef SOCKET_SIZE_TYPE size_socket;
|
2001-09-15 04:12:46 +02:00
|
|
|
|
|
|
|
#ifndef SOCKOPT_OPTLEN_TYPE
|
|
|
|
#define SOCKOPT_OPTLEN_TYPE size_socket
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* file create flags */
|
|
|
|
|
2003-01-28 07:38:28 +01:00
|
|
|
#ifndef O_SHARE /* Probably not windows */
|
2001-09-15 04:12:46 +02:00
|
|
|
#define O_SHARE 0 /* Flag to my_open for shared files */
|
|
|
|
#ifndef O_BINARY
|
|
|
|
#define O_BINARY 0 /* Flag to my_open for binary files */
|
|
|
|
#endif
|
2003-01-28 07:38:28 +01:00
|
|
|
#ifndef FILE_BINARY
|
|
|
|
#define FILE_BINARY O_BINARY /* Flag to my_fopen for binary streams */
|
|
|
|
#endif
|
2001-09-15 04:12:46 +02:00
|
|
|
#ifdef HAVE_FCNTL
|
|
|
|
#define HAVE_FCNTL_LOCK
|
|
|
|
#define F_TO_EOF 0L /* Param to lockf() to lock rest of file */
|
|
|
|
#endif
|
|
|
|
#endif /* O_SHARE */
|
2003-01-28 07:38:28 +01:00
|
|
|
|
2018-05-17 22:53:57 +02:00
|
|
|
#ifndef O_SEQUENTIAL
|
|
|
|
#define O_SEQUENTIAL 0
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif
|
|
|
|
#ifndef O_SHORT_LIVED
|
|
|
|
#define O_SHORT_LIVED 0
|
|
|
|
#endif
|
2005-03-03 19:51:29 +01:00
|
|
|
#ifndef O_NOFOLLOW
|
|
|
|
#define O_NOFOLLOW 0
|
|
|
|
#endif
|
2015-07-14 22:05:29 +02:00
|
|
|
#ifndef O_CLOEXEC
|
|
|
|
#define O_CLOEXEC 0
|
|
|
|
#endif
|
2018-03-02 00:16:46 +01:00
|
|
|
#ifdef __GLIBC__
|
|
|
|
#define STR_O_CLOEXEC "e"
|
|
|
|
#else
|
|
|
|
#define STR_O_CLOEXEC ""
|
|
|
|
#endif
|
2015-07-14 22:05:29 +02:00
|
|
|
#ifndef SOCK_CLOEXEC
|
|
|
|
#define SOCK_CLOEXEC 0
|
MDEV-8743: mysqld port/socket - FD_CLOEXEC if no SOCK_CLOEXEC
In MDEV-8743, the port/socket of mysqld was changed to set FD_CLOEXEC.
The existing mysql_socket_socket function already set that with
SOCK_CLOEXEC when the socket was created. So here we move the fcntl
functionality to the mysql_socket_socket as port/socket are the only
callers.
Preprocessor checks of SOCK_CLOEXEC cannot be done as its a 0 if not
there and SOCK_CLOEXEC (being the value of the enum in bits/socket_type.h)
Preprocesssor logic for arithmetic and non-arithmetic defines are
hard/nonportable/ugly to read. As such we just check in my_global.h
and define HAVE_SOCK_CLOEXEC if we have it.
There was a disparity in behaviour between defined(WITH_WSREP) and
not depending on the OS, so the WITH_WSREP condition was removed
from setting calling fcntl.
All sockets are now maked SOCK_CLOEXEC/FD_CLOEXEC.
strace of mysqld with SOCK_CLOEXEC:
socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_TCP) = 10
write(2, "180419 14:52:40 [Note] Server socket created on IP: '127.0.0.1'.\n", 65180419 14:52:40 [Note] Server socket created on IP: '127.0.0.1'.
) = 65
setsockopt(10, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(10, {sa_family=AF_INET, sin_port=htons(16020), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
listen(10, 150) = 0
socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_TCP) = 11
write(2, "180419 14:52:40 [Note] Server socket created on IP: '127.0.0.1'.\n", 65180419 14:52:40 [Note] Server socket created on IP: '127.0.0.1'.
) = 65
setsockopt(11, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(11, {sa_family=AF_INET, sin_port=htons(16021), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
listen(11, 150) = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 12
unlink("/home/dan/repos/build-mariadb-server-10.0/mysql-test/var/tmp/mysqld.1.sock") = -1 ENOENT (No such file or directory)
setsockopt(12, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
umask(000) = 006
bind(12, {sa_family=AF_UNIX, sun_path="/home/dan/repos/build-mariadb-server-10.0/mysql-test/var/tmp/mysqld.1.sock"}, 110) = 0
umask(006) = 000
listen(12, 150) = 0
2018-04-18 23:38:57 +02:00
|
|
|
#else
|
|
|
|
#define HAVE_SOCK_CLOEXEC
|
2015-07-14 22:05:29 +02:00
|
|
|
#endif
|
2022-11-04 13:12:35 +01:00
|
|
|
#ifndef O_TEXT
|
|
|
|
#define O_TEXT 0
|
|
|
|
#endif
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2005-11-14 14:01:10 +01:00
|
|
|
/* additional file share flags for win32 */
|
2021-06-06 13:21:03 +02:00
|
|
|
#ifdef _WIN32
|
2005-11-14 14:01:10 +01:00
|
|
|
#define _SH_DENYRWD 0x110 /* deny read/write mode & delete */
|
|
|
|
#define _SH_DENYWRD 0x120 /* deny write mode & delete */
|
|
|
|
#define _SH_DENYRDD 0x130 /* deny read mode & delete */
|
|
|
|
#define _SH_DENYDEL 0x140 /* deny delete only */
|
2021-06-06 13:21:03 +02:00
|
|
|
#endif /* _WIN32 */
|
2005-11-14 14:01:10 +01:00
|
|
|
|
|
|
|
|
2010-07-23 22:16:29 +02:00
|
|
|
/* General constants */
|
2001-09-15 04:12:46 +02:00
|
|
|
#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) */
|
|
|
|
#define FN_REFLEN 512 /* Max length of full path-name */
|
|
|
|
#define FN_EXTCHAR '.'
|
|
|
|
#define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */
|
|
|
|
#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */
|
2004-02-13 15:27:21 +01:00
|
|
|
#define FN_PARENTDIR ".." /* Parent directory; Must be a string */
|
2001-09-15 04:12:46 +02:00
|
|
|
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#ifdef _WIN32
|
|
|
|
#define FN_LIBCHAR '\\'
|
2010-01-24 20:03:10 +01:00
|
|
|
#define FN_LIBCHAR2 '/'
|
2010-12-02 09:18:47 +01:00
|
|
|
#define FN_DIRSEP "/\\" /* Valid directory separators */
|
2011-07-19 16:17:58 +02:00
|
|
|
#define FN_EXEEXT ".exe"
|
|
|
|
#define FN_SOEXT ".dll"
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#define FN_ROOTDIR "\\"
|
|
|
|
#define FN_DEVCHAR ':'
|
|
|
|
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
|
|
|
|
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
|
|
|
|
#else
|
2001-09-15 04:12:46 +02:00
|
|
|
#define FN_LIBCHAR '/'
|
2010-01-24 20:03:10 +01:00
|
|
|
#define FN_LIBCHAR2 '/'
|
2010-12-01 13:54:50 +01:00
|
|
|
#define FN_DIRSEP "/" /* Valid directory separators */
|
2011-07-19 16:17:58 +02:00
|
|
|
#define FN_EXEEXT ""
|
|
|
|
#define FN_SOEXT ".so"
|
2001-09-15 04:12:46 +02:00
|
|
|
#define FN_ROOTDIR "/"
|
|
|
|
#endif
|
This is the downport of
Bug#24509 - 2048 file descriptor limit on windows needs increasing, also
WL#3049 - improved Windows I/O
The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with
the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open
file is stored in the my_file_info struct, along with a flag for append mode
because the Windows API does not support opening files in append mode in all cases)
The default max open files has been increased to 16384 and can be increased further
by setting --max-open-files=<value> during the server start.
Another major change in this patch that almost all Windows specific file IO code
has been moved to a new file my_winfile.c, greatly reducing the amount of code
in #ifdef blocks within mysys, thus improving readability.
Minor enhancements:
- my_(f)stat() is changed to use __stati64 structure with 64 file size
and timestamps. It will return correct file size now (C runtime implementation
used to report outdated information)
- my_lock on Windows is prepared to handle additional timeout parameter
- after review : changed __WIN__ to _WIN32 in the new and changed code.
client/mysqlbinlog.cc:
fileno -> my_fileno
client/readline.cc:
fileno -> my_fileno
include/config-win.h:
Increase OS_FILE_LIMIT for Windows.
Remove O_SHARE - Windows does not support it. Its definition conflicts with
O_SHORT_LIVED, that has different semantics.
include/my_dir.h:
Use stat64 for stat() family of functions on Windows, because of 64 bit file size.
include/my_global.h:
Increased default value for open file limit to 16K
include/my_sys.h:
- my_file_info got new structure members - file handle and open flags
- 2 new Windows-only mysys functions : my_get_osfhandle and my_osmaperr,
modelled after Windows C runtime functions _get_osfhandle and _dosmaperr
libmysql/CMakeLists.txt:
new files my_winfile.c and my_winerr.c
mysql-test/suite/large_tests/r/lock_tables_big.result:
test for more then 2048 open file descriptors on Windows
mysql-test/suite/large_tests/t/lock_tables_big.test:
test for more then 2048 open file descriptors on Windows
mysys/CMakeLists.txt:
new files my_winfile.c and my_winerr.c
mysys/Makefile.am:
new files my_winfile.c and my_winerr.c
mysys/default_modify.c:
fileno -> my_fileno
mysys/my_chsize.c:
implementation of chsize on Windows now moved to my_winfile.c
mysys/my_create.c:
- my_sopen->my_win_open
- close open file before removing (won't generally work on Windows otherwise)
mysys/my_file.c:
On Windows, files returned by my_open will not start with 0, but 2048
(making it simple to detect incompatible mix of CRT and mysys io functions)
mysys/my_fopen.c:
fileno->my_win_fileno , fclose->my_win_fclose, fdopen->my_win_fdopen
Check for legal filename is done by my_win_[f]open functions
mysys/my_fstream.c:
fileno->my_fileno
mysys/my_lib.c:
Windows stat() functions are moved to my_winfile.c
mysys/my_lock.c:
Move Windows code under #ifdef to a separate function win_lock().
Add a parameter for lock wait timeout
mysys/my_mmap.c:
_get_osfhandle->my_get_osfhandle
mysys/my_open.c:
my_sopen->my_win_open (simpler interface)
mysys/my_pread.c:
moved most windows specific code to my_win_file.c
Use my_win_pread
mysys/my_quick.c:
Use my_win_read/my_win_write
mysys/my_read.c:
Moved most of windows specific code to my_win_file.c
Use my_win_read()
mysys/my_seek.c:
On Windows, use my_win_lseek() in my_seek()/my_tell()
Removed dead code (synchronization of lseeks)
Improved DBUG tracing (file position is ulonglong, not ulong)
mysys/my_static.c:
Removed array initialization. my_file_info_default is global variable
thus it is initialized with all zeros anyway
mysys/my_sync.c:
_commit->my_win_fsync
mysys/my_winerr.c:
New file my_winerr.c
Exports my_osmaperr modelled after undocumented C runtime
function _dosmaperr(). The problem with _dosmaperr() used previously is that
1) it is nowhere documented and thus code relying on it is not guaranteed to work
in subsequent releases on the C runtime
2) it is present only in static C runtime (mysqld does not link if compiled with
/MD)
mysys/my_winfile.c:
New file my_winfile.c
Implements ANSI/Posix file IO routines, when possible using native Windows IO, without
C runtime (C runtime dropped because of the 2048 file descriptor limit).
mysys/my_write.c:
write->my_win_write
mysys/mysys_priv.h:
Declaration of Windows Posix functions (private to mysys, shall not be visible
outside)
storage/innobase/handler/ha_innodb.cc:
mysys native Windows IO : correct innodb tmp file handling
mysql_tmpfile does not return valid CRT file descriptor, thus
it is not possible to dup() it. Instead, the native file handle has
to be duplicated and then converted to CRT descriptor.
storage/myisam/mi_locking.c:
_commit->my_sync
2009-09-11 22:26:35 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
MY_FILE_MIN is Windows speciality and is used to quickly detect
|
|
|
|
the mismatch of CRT and mysys file IO usage on Windows at runtime.
|
|
|
|
CRT file descriptors can be in the range 0-2047, whereas descriptors returned
|
|
|
|
by my_open() will start with 2048. If a file descriptor with value less then
|
2022-12-19 22:08:20 +01:00
|
|
|
MY_FILE_MIN is passed to mysys IO function, chances are it stems from
|
This is the downport of
Bug#24509 - 2048 file descriptor limit on windows needs increasing, also
WL#3049 - improved Windows I/O
The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with
the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open
file is stored in the my_file_info struct, along with a flag for append mode
because the Windows API does not support opening files in append mode in all cases)
The default max open files has been increased to 16384 and can be increased further
by setting --max-open-files=<value> during the server start.
Another major change in this patch that almost all Windows specific file IO code
has been moved to a new file my_winfile.c, greatly reducing the amount of code
in #ifdef blocks within mysys, thus improving readability.
Minor enhancements:
- my_(f)stat() is changed to use __stati64 structure with 64 file size
and timestamps. It will return correct file size now (C runtime implementation
used to report outdated information)
- my_lock on Windows is prepared to handle additional timeout parameter
- after review : changed __WIN__ to _WIN32 in the new and changed code.
client/mysqlbinlog.cc:
fileno -> my_fileno
client/readline.cc:
fileno -> my_fileno
include/config-win.h:
Increase OS_FILE_LIMIT for Windows.
Remove O_SHARE - Windows does not support it. Its definition conflicts with
O_SHORT_LIVED, that has different semantics.
include/my_dir.h:
Use stat64 for stat() family of functions on Windows, because of 64 bit file size.
include/my_global.h:
Increased default value for open file limit to 16K
include/my_sys.h:
- my_file_info got new structure members - file handle and open flags
- 2 new Windows-only mysys functions : my_get_osfhandle and my_osmaperr,
modelled after Windows C runtime functions _get_osfhandle and _dosmaperr
libmysql/CMakeLists.txt:
new files my_winfile.c and my_winerr.c
mysql-test/suite/large_tests/r/lock_tables_big.result:
test for more then 2048 open file descriptors on Windows
mysql-test/suite/large_tests/t/lock_tables_big.test:
test for more then 2048 open file descriptors on Windows
mysys/CMakeLists.txt:
new files my_winfile.c and my_winerr.c
mysys/Makefile.am:
new files my_winfile.c and my_winerr.c
mysys/default_modify.c:
fileno -> my_fileno
mysys/my_chsize.c:
implementation of chsize on Windows now moved to my_winfile.c
mysys/my_create.c:
- my_sopen->my_win_open
- close open file before removing (won't generally work on Windows otherwise)
mysys/my_file.c:
On Windows, files returned by my_open will not start with 0, but 2048
(making it simple to detect incompatible mix of CRT and mysys io functions)
mysys/my_fopen.c:
fileno->my_win_fileno , fclose->my_win_fclose, fdopen->my_win_fdopen
Check for legal filename is done by my_win_[f]open functions
mysys/my_fstream.c:
fileno->my_fileno
mysys/my_lib.c:
Windows stat() functions are moved to my_winfile.c
mysys/my_lock.c:
Move Windows code under #ifdef to a separate function win_lock().
Add a parameter for lock wait timeout
mysys/my_mmap.c:
_get_osfhandle->my_get_osfhandle
mysys/my_open.c:
my_sopen->my_win_open (simpler interface)
mysys/my_pread.c:
moved most windows specific code to my_win_file.c
Use my_win_pread
mysys/my_quick.c:
Use my_win_read/my_win_write
mysys/my_read.c:
Moved most of windows specific code to my_win_file.c
Use my_win_read()
mysys/my_seek.c:
On Windows, use my_win_lseek() in my_seek()/my_tell()
Removed dead code (synchronization of lseeks)
Improved DBUG tracing (file position is ulonglong, not ulong)
mysys/my_static.c:
Removed array initialization. my_file_info_default is global variable
thus it is initialized with all zeros anyway
mysys/my_sync.c:
_commit->my_win_fsync
mysys/my_winerr.c:
New file my_winerr.c
Exports my_osmaperr modelled after undocumented C runtime
function _dosmaperr(). The problem with _dosmaperr() used previously is that
1) it is nowhere documented and thus code relying on it is not guaranteed to work
in subsequent releases on the C runtime
2) it is present only in static C runtime (mysqld does not link if compiled with
/MD)
mysys/my_winfile.c:
New file my_winfile.c
Implements ANSI/Posix file IO routines, when possible using native Windows IO, without
C runtime (C runtime dropped because of the 2048 file descriptor limit).
mysys/my_write.c:
write->my_win_write
mysys/mysys_priv.h:
Declaration of Windows Posix functions (private to mysys, shall not be visible
outside)
storage/innobase/handler/ha_innodb.cc:
mysys native Windows IO : correct innodb tmp file handling
mysql_tmpfile does not return valid CRT file descriptor, thus
it is not possible to dup() it. Instead, the native file handle has
to be duplicated and then converted to CRT descriptor.
storage/myisam/mi_locking.c:
_commit->my_sync
2009-09-11 22:26:35 +02:00
|
|
|
open()/fileno() and not my_open()/my_fileno.
|
|
|
|
|
|
|
|
For Posix, mysys functions are light wrappers around libc, and MY_FILE_MIN
|
|
|
|
is logically 0.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
#define MY_FILE_MIN 2048
|
|
|
|
#else
|
|
|
|
#define MY_FILE_MIN 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
MY_NFILE is the default size of my_file_info array.
|
|
|
|
|
|
|
|
It is larger on Windows, because it all file handles are stored in my_file_info
|
|
|
|
Default size is 16384 and this should be enough for most cases.If it is not
|
|
|
|
enough, --max-open-files with larger value can be used.
|
|
|
|
|
|
|
|
For Posix , my_file_info array is only used to store filenames for
|
|
|
|
error reporting and its size is not a limitation for number of open files.
|
|
|
|
*/
|
|
|
|
#ifdef _WIN32
|
|
|
|
#define MY_NFILE (16384 + MY_FILE_MIN)
|
|
|
|
#else
|
|
|
|
#define MY_NFILE 64
|
|
|
|
#endif
|
|
|
|
|
2004-02-19 18:33:09 +01:00
|
|
|
#ifndef OS_FILE_LIMIT
|
2010-04-09 13:47:18 +02:00
|
|
|
#define OS_FILE_LIMIT UINT_MAX
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif
|
|
|
|
|
2002-06-11 10:20:31 +02:00
|
|
|
/*
|
|
|
|
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
|
|
|
|
isam btree library. eg to big to slow.
|
Changing all cost calculation to be given in milliseconds
This makes it easier to compare different costs and also allows
the optimizer to optimizer different storage engines more reliably.
- Added tests/check_costs.pl, a tool to verify optimizer cost calculations.
- Most engine costs has been found with this program. All steps to
calculate the new costs are documented in Docs/optimizer_costs.txt
- User optimizer_cost variables are given in microseconds (as individual
costs can be very small). Internally they are stored in ms.
- Changed DISK_READ_COST (was DISK_SEEK_BASE_COST) from a hard disk cost
(9 ms) to common SSD cost (400MB/sec).
- Removed cost calculations for hard disks (rotation etc).
- Changed the following handler functions to return IO_AND_CPU_COST.
This makes it easy to apply different cost modifiers in ha_..time()
functions for io and cpu costs.
- scan_time()
- rnd_pos_time() & rnd_pos_call_time()
- keyread_time()
- Enhanched keyread_time() to calculate the full cost of reading of a set
of keys with a given number of ranges and optional number of blocks that
need to be accessed.
- Removed read_time() as keyread_time() + rnd_pos_time() can do the same
thing and more.
- Tuned cost for: heap, myisam, Aria, InnoDB, archive and MyRocks.
Used heap table costs for json_table. The rest are using default engine
costs.
- Added the following new optimizer variables:
- optimizer_disk_read_ratio
- optimizer_disk_read_cost
- optimizer_key_lookup_cost
- optimizer_row_lookup_cost
- optimizer_row_next_find_cost
- optimizer_scan_cost
- Moved all engine specific cost to OPTIMIZER_COSTS structure.
- Changed costs to use 'records_out' instead of 'records_read' when
recalculating costs.
- Split optimizer_costs.h to optimizer_costs.h and optimizer_defaults.h.
This allows one to change costs without having to compile a lot of
files.
- Updated costs for filter lookup.
- Use a better cost estimate in best_extension_by_limited_search()
for the sorting cost.
- Fixed previous issues with 'filtered' explain column as we are now
using 'records_out' (min rows seen for table) to calculate filtering.
This greatly simplifies the filtering code in
JOIN_TAB::save_explain_data().
This change caused a lot of queries to be optimized differently than
before, which exposed different issues in the optimizer that needs to
be fixed. These fixes are in the following commits. To not have to
change the same test case over and over again, the changes in the test
cases are done in a single commit after all the critical change sets
are done.
InnoDB changes:
- Updated InnoDB to not divide big range cost with 2.
- Added cost for InnoDB (innobase_update_optimizer_costs()).
- Don't mark clustered primary key with HA_KEYREAD_ONLY. This will
prevent that the optimizer is trying to use index-only scans on
the clustered key.
- Disabled ha_innobase::scan_time() and ha_innobase::read_time() and
ha_innobase::rnd_pos_time() as the default engine cost functions now
works good for InnoDB.
Other things:
- Added --show-query-costs (\Q) option to mysql.cc to show the query
cost after each query (good when working with query costs).
- Extended my_getopt with GET_ADJUSTED_VALUE which allows one to adjust
the value that user is given. This is used to change cost from
microseconds (user input) to milliseconds (what the server is
internally using).
- Added include/my_tracker.h ; Useful include file to quickly test
costs of a function.
- Use handler::set_table() in all places instead of 'table= arg'.
- Added SHOW_OPTIMIZER_COSTS to sys variables. These are input and
shown in microseconds for the user but stored as milliseconds.
This is to make the numbers easier to read for the user (less
pre-zeros). Implemented in 'Sys_var_optimizer_cost' class.
- In test_quick_select() do not use index scans if 'no_keyread' is set
for the table. This is what we do in other places of the server.
- Added THD parameter to Unique::get_use_cost() and
check_index_intersect_extension() and similar functions to be able
to provide costs to called functions.
- Changed 'records' to 'rows' in optimizer_trace.
- Write more information to optimizer_trace.
- Added INDEX_BLOCK_FILL_FACTOR_MUL (4) and INDEX_BLOCK_FILL_FACTOR_DIV (3)
to calculate usage space of keys in b-trees. (Before we used numeric
constants).
- Removed code that assumed that b-trees has similar costs as binary
trees. Replaced with engine calls that returns the cost.
- Added Bitmap::find_first_bit()
- Added timings to join_cache for ANALYZE table (patch by Sergei Petrunia).
- Added records_init and records_after_filter to POSITION to remember
more of what best_access_patch() calculates.
- table_after_join_selectivity() changed to recalculate 'records_out'
based on the new fields from best_access_patch()
Bug fixes:
- Some queries did not update last_query_cost (was 0). Fixed by moving
setting thd->...last_query_cost in JOIN::optimize().
- Write '0' as number of rows for const tables with a matching row.
Some internals:
- Engine cost are stored in OPTIMIZER_COSTS structure. When a
handlerton is created, we also created a new cost variable for the
handlerton. We also create a new variable if the user changes a
optimizer cost for a not yet loaded handlerton either with command
line arguments or with SET
@@global.engine.optimizer_cost_variable=xx.
- There are 3 global OPTIMIZER_COSTS variables:
default_optimizer_costs The default costs + changes from the
command line without an engine specifier.
heap_optimizer_costs Heap table costs, used for temporary tables
tmp_table_optimizer_costs The cost for the default on disk internal
temporary table (MyISAM or Aria)
- The engine cost for a table is stored in table_share. To speed up
accesses the handler has a pointer to this. The cost is copied
to the table on first access. If one wants to change the cost one
must first update the global engine cost and then do a FLUSH TABLES.
This was done to be able to access the costs for an open table
without any locks.
- When a handlerton is created, the cost are updated the following way:
See sql/keycaches.cc for details:
- Use 'default_optimizer_costs' as a base
- Call hton->update_optimizer_costs() to override with the engines
default costs.
- Override the costs that the user has specified for the engine.
- One handler open, copy the engine cost from handlerton to TABLE_SHARE.
- Call handler::update_optimizer_costs() to allow the engine to update
cost for this particular table.
- There are two costs stored in THD. These are copied to the handler
when the table is used in a query:
- optimizer_where_cost
- optimizer_scan_setup_cost
- Simply code in best_access_path() by storing all cost result in a
structure. (Idea/Suggestion by Igor)
2022-08-11 12:05:23 +02:00
|
|
|
4096 is a common block size on SSDs.
|
2002-06-11 10:20:31 +02:00
|
|
|
*/
|
2017-03-01 07:27:39 +01:00
|
|
|
#define IO_SIZE 4096U
|
2002-06-11 10:20:31 +02:00
|
|
|
/*
|
|
|
|
How much overhead does malloc have. The code often allocates
|
|
|
|
something like 1024-MALLOC_OVERHEAD bytes
|
|
|
|
*/
|
2001-09-15 04:12:46 +02:00
|
|
|
#define MALLOC_OVERHEAD 8
|
Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.
Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.
Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost.
The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.
Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.
client/mysqldump.c:
Pass my_free directly as its signature is compatible with the
callback type -- which wasn't the case for free_table_ent.
2010-07-08 23:20:08 +02:00
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
/* get memory in huncs */
|
2010-11-25 18:17:28 +01:00
|
|
|
#define ONCE_ALLOC_INIT (uint) 4096
|
2010-08-24 20:31:06 +02:00
|
|
|
/* Typical record cache */
|
2010-11-25 18:17:28 +01:00
|
|
|
#define RECORD_CACHE_SIZE (uint) (128*1024)
|
2010-08-24 20:31:06 +02:00
|
|
|
/* Typical key cache */
|
2010-11-25 18:17:28 +01:00
|
|
|
#define KEY_CACHE_SIZE (uint) (128L*1024L*1024L)
|
2003-08-02 11:43:18 +02:00
|
|
|
/* Default size of a key cache block */
|
|
|
|
#define KEY_CACHE_BLOCK_SIZE (uint) 1024
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
/* Some things that this system doesn't have */
|
|
|
|
|
This is the downport of
Bug#24509 - 2048 file descriptor limit on windows needs increasing, also
WL#3049 - improved Windows I/O
The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with
the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open
file is stored in the my_file_info struct, along with a flag for append mode
because the Windows API does not support opening files in append mode in all cases)
The default max open files has been increased to 16384 and can be increased further
by setting --max-open-files=<value> during the server start.
Another major change in this patch that almost all Windows specific file IO code
has been moved to a new file my_winfile.c, greatly reducing the amount of code
in #ifdef blocks within mysys, thus improving readability.
Minor enhancements:
- my_(f)stat() is changed to use __stati64 structure with 64 file size
and timestamps. It will return correct file size now (C runtime implementation
used to report outdated information)
- my_lock on Windows is prepared to handle additional timeout parameter
- after review : changed __WIN__ to _WIN32 in the new and changed code.
client/mysqlbinlog.cc:
fileno -> my_fileno
client/readline.cc:
fileno -> my_fileno
include/config-win.h:
Increase OS_FILE_LIMIT for Windows.
Remove O_SHARE - Windows does not support it. Its definition conflicts with
O_SHORT_LIVED, that has different semantics.
include/my_dir.h:
Use stat64 for stat() family of functions on Windows, because of 64 bit file size.
include/my_global.h:
Increased default value for open file limit to 16K
include/my_sys.h:
- my_file_info got new structure members - file handle and open flags
- 2 new Windows-only mysys functions : my_get_osfhandle and my_osmaperr,
modelled after Windows C runtime functions _get_osfhandle and _dosmaperr
libmysql/CMakeLists.txt:
new files my_winfile.c and my_winerr.c
mysql-test/suite/large_tests/r/lock_tables_big.result:
test for more then 2048 open file descriptors on Windows
mysql-test/suite/large_tests/t/lock_tables_big.test:
test for more then 2048 open file descriptors on Windows
mysys/CMakeLists.txt:
new files my_winfile.c and my_winerr.c
mysys/Makefile.am:
new files my_winfile.c and my_winerr.c
mysys/default_modify.c:
fileno -> my_fileno
mysys/my_chsize.c:
implementation of chsize on Windows now moved to my_winfile.c
mysys/my_create.c:
- my_sopen->my_win_open
- close open file before removing (won't generally work on Windows otherwise)
mysys/my_file.c:
On Windows, files returned by my_open will not start with 0, but 2048
(making it simple to detect incompatible mix of CRT and mysys io functions)
mysys/my_fopen.c:
fileno->my_win_fileno , fclose->my_win_fclose, fdopen->my_win_fdopen
Check for legal filename is done by my_win_[f]open functions
mysys/my_fstream.c:
fileno->my_fileno
mysys/my_lib.c:
Windows stat() functions are moved to my_winfile.c
mysys/my_lock.c:
Move Windows code under #ifdef to a separate function win_lock().
Add a parameter for lock wait timeout
mysys/my_mmap.c:
_get_osfhandle->my_get_osfhandle
mysys/my_open.c:
my_sopen->my_win_open (simpler interface)
mysys/my_pread.c:
moved most windows specific code to my_win_file.c
Use my_win_pread
mysys/my_quick.c:
Use my_win_read/my_win_write
mysys/my_read.c:
Moved most of windows specific code to my_win_file.c
Use my_win_read()
mysys/my_seek.c:
On Windows, use my_win_lseek() in my_seek()/my_tell()
Removed dead code (synchronization of lseeks)
Improved DBUG tracing (file position is ulonglong, not ulong)
mysys/my_static.c:
Removed array initialization. my_file_info_default is global variable
thus it is initialized with all zeros anyway
mysys/my_sync.c:
_commit->my_win_fsync
mysys/my_winerr.c:
New file my_winerr.c
Exports my_osmaperr modelled after undocumented C runtime
function _dosmaperr(). The problem with _dosmaperr() used previously is that
1) it is nowhere documented and thus code relying on it is not guaranteed to work
in subsequent releases on the C runtime
2) it is present only in static C runtime (mysqld does not link if compiled with
/MD)
mysys/my_winfile.c:
New file my_winfile.c
Implements ANSI/Posix file IO routines, when possible using native Windows IO, without
C runtime (C runtime dropped because of the 2048 file descriptor limit).
mysys/my_write.c:
write->my_win_write
mysys/mysys_priv.h:
Declaration of Windows Posix functions (private to mysys, shall not be visible
outside)
storage/innobase/handler/ha_innodb.cc:
mysys native Windows IO : correct innodb tmp file handling
mysql_tmpfile does not return valid CRT file descriptor, thus
it is not possible to dup() it. Instead, the native file handle has
to be duplicated and then converted to CRT descriptor.
storage/myisam/mi_locking.c:
_commit->my_sync
2009-09-11 22:26:35 +02:00
|
|
|
#ifdef _WIN32
|
|
|
|
#define NO_DIR_LIBRARY /* Not standard dir-library */
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Some defines of functions for portability */
|
|
|
|
|
|
|
|
#undef remove /* Crashes MySQL on SCO 5.0.0 */
|
2021-06-06 13:21:03 +02:00
|
|
|
#ifndef _WIN32
|
2001-09-15 04:12:46 +02:00
|
|
|
#define closesocket(A) close(A)
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#endif
|
|
|
|
|
2018-04-26 15:33:05 +02:00
|
|
|
#if defined(_MSC_VER)
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#if !defined(_WIN64)
|
|
|
|
inline double my_ulonglong2double(unsigned long long value)
|
|
|
|
{
|
|
|
|
long long nr=(long long) value;
|
|
|
|
if (nr >= 0)
|
|
|
|
return (double) nr;
|
|
|
|
return (18446744073709551616.0 + (double) nr);
|
|
|
|
}
|
|
|
|
#define ulonglong2double my_ulonglong2double
|
|
|
|
#define my_off_t2double my_ulonglong2double
|
|
|
|
#endif /* _WIN64 */
|
|
|
|
inline unsigned long long my_double2ulonglong(double d)
|
|
|
|
{
|
|
|
|
double t= d - (double) 0x8000000000000000ULL;
|
|
|
|
|
|
|
|
if (t >= 0)
|
|
|
|
return ((unsigned long long) t) + 0x8000000000000000ULL;
|
|
|
|
return (unsigned long long) d;
|
|
|
|
}
|
|
|
|
#define double2ulonglong my_double2ulonglong
|
|
|
|
#endif
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#ifndef ulonglong2double
|
2003-10-27 11:18:44 +01:00
|
|
|
#define ulonglong2double(A) ((double) (ulonglong) (A))
|
|
|
|
#define my_off_t2double(A) ((double) (my_off_t) (A))
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif
|
2008-12-03 17:15:39 +01:00
|
|
|
#ifndef double2ulonglong
|
|
|
|
#define double2ulonglong(A) ((ulonglong) (double) (A))
|
|
|
|
#endif
|
2001-09-15 04:12:46 +02:00
|
|
|
|
|
|
|
#ifndef offsetof
|
|
|
|
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
|
|
|
#endif
|
|
|
|
#define ulong_to_double(X) ((double) (ulong) (X))
|
|
|
|
|
2007-07-23 23:54:55 +02:00
|
|
|
#ifndef STACK_DIRECTION
|
|
|
|
#error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS"
|
|
|
|
#endif
|
|
|
|
|
2006-04-16 10:50:25 +02:00
|
|
|
#if !defined(HAVE_STRTOK_R)
|
2001-09-15 04:12:46 +02:00
|
|
|
#define strtok_r(A,B,C) strtok((A),(B))
|
|
|
|
#endif
|
|
|
|
|
2011-02-23 18:43:29 +01:00
|
|
|
#if SIZEOF_LONG_LONG >= 8
|
2001-09-15 04:12:46 +02:00
|
|
|
#define HAVE_LONG_LONG 1
|
2011-02-23 18:43:29 +01:00
|
|
|
#else
|
|
|
|
#error WHAT? sizeof(long long) < 8 ???
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif
|
|
|
|
|
2003-12-02 17:39:51 +01:00
|
|
|
/*
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN)
|
|
|
|
#define LONGLONG_MIN ((long long) 0x8000000000000000LL)
|
|
|
|
#define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL)
|
|
|
|
#endif
|
2020-07-16 11:23:37 +02:00
|
|
|
/* Max length needed for a buffer to hold a longlong or ulonglong + end \0 */
|
|
|
|
#define LONGLONG_BUFFER_SIZE 21
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2003-12-05 17:20:06 +01:00
|
|
|
#if defined(HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)
|
2003-12-02 17:39:51 +01:00
|
|
|
/* First check for ANSI C99 definition: */
|
|
|
|
#ifdef ULLONG_MAX
|
|
|
|
#define ULONGLONG_MAX ULLONG_MAX
|
|
|
|
#else
|
|
|
|
#define ULONGLONG_MAX ((unsigned long long)(~0ULL))
|
|
|
|
#endif
|
2003-12-05 17:20:06 +01:00
|
|
|
#endif /* defined (HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)*/
|
2003-12-02 17:39:51 +01:00
|
|
|
|
2009-10-12 11:00:39 +02:00
|
|
|
#define INT_MIN64 (~0x7FFFFFFFFFFFFFFFLL)
|
|
|
|
#define INT_MAX64 0x7FFFFFFFFFFFFFFFLL
|
2004-08-19 21:41:10 +02:00
|
|
|
#define INT_MIN32 (~0x7FFFFFFFL)
|
|
|
|
#define INT_MAX32 0x7FFFFFFFL
|
2023-09-11 16:58:22 +02:00
|
|
|
#define UINT_MAX32 0xFFFFFFFFUL
|
2004-08-19 21:41:10 +02:00
|
|
|
#define INT_MIN24 (~0x007FFFFF)
|
|
|
|
#define INT_MAX24 0x007FFFFF
|
|
|
|
#define UINT_MAX24 0x00FFFFFF
|
|
|
|
#define INT_MIN16 (~0x7FFF)
|
2004-08-11 23:43:41 +02:00
|
|
|
#define INT_MAX16 0x7FFF
|
|
|
|
#define UINT_MAX16 0xFFFF
|
2004-08-19 21:41:10 +02:00
|
|
|
#define INT_MIN8 (~0x7F)
|
|
|
|
#define INT_MAX8 0x7F
|
2004-12-16 10:43:02 +01:00
|
|
|
#define UINT_MAX8 0xFF
|
2001-09-15 04:12:46 +02:00
|
|
|
|
|
|
|
/* From limits.h instead */
|
|
|
|
#ifndef DBL_MIN
|
|
|
|
#define DBL_MIN 4.94065645841246544e-324
|
|
|
|
#define FLT_MIN ((float)1.40129846432481707e-45)
|
|
|
|
#endif
|
|
|
|
#ifndef DBL_MAX
|
|
|
|
#define DBL_MAX 1.79769313486231470e+308
|
|
|
|
#define FLT_MAX ((float)3.40282346638528860e+38)
|
|
|
|
#endif
|
2007-09-03 10:57:47 +02:00
|
|
|
#ifndef SIZE_T_MAX
|
2009-12-17 12:25:50 +01:00
|
|
|
#define SIZE_T_MAX (~((size_t) 0))
|
2006-06-07 16:44:43 +02:00
|
|
|
#endif
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2003-12-19 22:53:14 +01:00
|
|
|
/* Define missing math constants. */
|
|
|
|
#ifndef M_PI
|
|
|
|
#define M_PI 3.14159265358979323846
|
|
|
|
#endif
|
|
|
|
#ifndef M_E
|
|
|
|
#define M_E 2.7182818284590452354
|
|
|
|
#endif
|
|
|
|
#ifndef M_LN2
|
|
|
|
#define M_LN2 0.69314718055994530942
|
|
|
|
#endif
|
|
|
|
|
2002-06-11 10:20:31 +02:00
|
|
|
/*
|
|
|
|
Max size that must be added to a so that we know Size to make
|
2017-11-15 05:37:32 +01:00
|
|
|
addressable obj.
|
2002-06-11 10:20:31 +02:00
|
|
|
*/
|
2003-05-26 18:11:22 +02:00
|
|
|
#if SIZEOF_CHARP == 4
|
2001-09-15 04:12:46 +02:00
|
|
|
typedef long my_ptrdiff_t;
|
2003-05-26 18:11:22 +02:00
|
|
|
#else
|
|
|
|
typedef long long my_ptrdiff_t;
|
|
|
|
#endif
|
|
|
|
|
2013-05-10 11:32:34 +02:00
|
|
|
#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
|
|
|
|
#define MY_ALIGN_DOWN(A,L) ((A) & ~((L) - 1))
|
2001-09-15 04:12:46 +02:00
|
|
|
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
|
2009-09-16 21:05:03 +02:00
|
|
|
#define ALIGN_MAX_UNIT (sizeof(double))
|
2017-11-15 05:37:32 +01:00
|
|
|
/* Size to make addressable obj. */
|
2009-08-31 22:02:09 +02:00
|
|
|
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A), sizeof(double)))
|
WL#3817: Simplify string / memory area types and make things more consistent (first part)
The following type conversions was done:
- Changed byte to uchar
- Changed gptr to uchar*
- Change my_string to char *
- Change my_size_t to size_t
- Change size_s to size_t
Removed declaration of byte, gptr, my_string, my_size_t and size_s.
Following function parameter changes was done:
- All string functions in mysys/strings was changed to use size_t
instead of uint for string lengths.
- All read()/write() functions changed to use size_t (including vio).
- All protocoll functions changed to use size_t instead of uint
- Functions that used a pointer to a string length was changed to use size_t*
- Changed malloc(), free() and related functions from using gptr to use void *
as this requires fewer casts in the code and is more in line with how the
standard functions work.
- Added extra length argument to dirname_part() to return the length of the
created string.
- Changed (at least) following functions to take uchar* as argument:
- db_dump()
- my_net_write()
- net_write_command()
- net_store_data()
- DBUG_DUMP()
- decimal2bin() & bin2decimal()
- Changed my_compress() and my_uncompress() to use size_t. Changed one
argument to my_uncompress() from a pointer to a value as we only return
one value (makes function easier to use).
- Changed type of 'pack_data' argument to packfrm() to avoid casts.
- Changed in readfrm() and writefrom(), ha_discover and handler::discover()
the type for argument 'frmdata' to uchar** to avoid casts.
- Changed most Field functions to use uchar* instead of char* (reduced a lot of
casts).
- Changed field->val_xxx(xxx, new_ptr) to take const pointers.
Other changes:
- Removed a lot of not needed casts
- Added a few new cast required by other changes
- Added some cast to my_multi_malloc() arguments for safety (as string lengths
needs to be uint, not size_t).
- Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
explicitely as this conflict was often hided by casting the function to
hash_get_key).
- Changed some buffers to memory regions to uchar* to avoid casts.
- Changed some string lengths from uint to size_t.
- Changed field->ptr to be uchar* instead of char*. This allowed us to
get rid of a lot of casts.
- Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
- Include zlib.h in some files as we needed declaration of crc32()
- Changed MY_FILE_ERROR to be (size_t) -1.
- Changed many variables to hold the result of my_read() / my_write() to be
size_t. This was needed to properly detect errors (which are
returned as (size_t) -1).
- Removed some very old VMS code
- Changed packfrm()/unpackfrm() to not be depending on uint size
(portability fix)
- Removed windows specific code to restore cursor position as this
causes slowdown on windows and we should not mix read() and pread()
calls anyway as this is not thread safe. Updated function comment to
reflect this. Changed function that depended on original behavior of
my_pwrite() to itself restore the cursor position (one such case).
- Added some missing checking of return value of malloc().
- Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
- Changed type of table_def::m_size from my_size_t to ulong to reflect that
m_size is the number of elements in the array, not a string/memory
length.
- Moved THD::max_row_length() to table.cc (as it's not depending on THD).
Inlined max_row_length_blob() into this function.
- More function comments
- Fixed some compiler warnings when compiled without partitions.
- Removed setting of LEX_STRING() arguments in declaration (portability fix).
- Some trivial indentation/variable name changes.
- Some trivial code simplifications:
- Replaced some calls to alloc_root + memcpy to use
strmake_root()/strdup_root().
- Changed some calls from memdup() to strmake() (Safety fix)
- Simpler loops in client-simple.c
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
Removed windows specific code to restore cursor position as this causes slowdown on windows and we should not mix read() and pread() calls anyway as this is not thread safe.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of m_size from my_size_t to ulong to reflect that m_size is the number of elements in the array, not a string/memory length
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size)
|
|
|
|
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B))
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2006-11-27 17:16:08 +01:00
|
|
|
/*
|
|
|
|
Custom version of standard offsetof() macro which can be used to get
|
|
|
|
offsets of members in class for non-POD types (according to the current
|
|
|
|
version of C++ standard offsetof() macro can't be used in such cases and
|
|
|
|
attempt to do so causes warnings to be emitted, OTOH in many cases it is
|
|
|
|
still OK to assume that all instances of the class has the same offsets
|
|
|
|
for the same members).
|
|
|
|
|
|
|
|
This is temporary solution which should be removed once File_parser class
|
|
|
|
and related routines are refactored.
|
|
|
|
*/
|
|
|
|
|
2016-09-24 01:17:35 +02:00
|
|
|
#define my_offsetof(TYPE, MEMBER) PTR_BYTE_DIFF(&((TYPE *)0x10)->MEMBER, 0x10)
|
2006-11-27 17:16:08 +01:00
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#define NullS (char *) 0
|
2010-04-16 10:27:18 +02:00
|
|
|
|
|
|
|
#ifdef STDCALL
|
|
|
|
#undef STDCALL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
#define STDCALL __stdcall
|
|
|
|
#else
|
2001-09-15 04:12:46 +02:00
|
|
|
#define STDCALL
|
|
|
|
#endif
|
|
|
|
|
2022-12-19 22:08:20 +01:00
|
|
|
/* Typdefs for easier portability */
|
2001-09-15 04:12:46 +02:00
|
|
|
|
|
|
|
#ifndef HAVE_UCHAR
|
|
|
|
typedef unsigned char uchar; /* Short for unsigned char */
|
|
|
|
#endif
|
|
|
|
|
unittest:
rename *.t* to *-t* to be automake-friendly
simplify Makefiles
test_atomic.c:
move to unittest, add GPL comment, fix warnings, convert to tap framework.
configure:
remove custom tests for available types, use AC_CHECK_TYPE instead
x86-gcc.h:
fix gcc -ansi errors while maintaining readability
ignore:
added *-t
unittest/mysys/base64-t.c:
Rename: unittest/mysys/base64.t.c -> unittest/mysys/base64-t.c
unittest/mysys/bitmap-t.c:
Rename: unittest/mysys/bitmap.t.c -> unittest/mysys/bitmap-t.c
unittest/mytap/t/basic-t.c:
Rename: unittest/mytap/t/basic.t.c -> unittest/mytap/t/basic-t.c
unittest/examples/no_plan-t.c:
Rename: unittest/examples/no_plan.t.c -> unittest/examples/no_plan-t.c
unittest/examples/simple-t.c:
Rename: unittest/examples/simple.t.c -> unittest/examples/simple-t.c
unittest/examples/skip-t.c:
Rename: unittest/examples/skip.t.c -> unittest/examples/skip-t.c
unittest/examples/skip_all-t.c:
Rename: unittest/examples/skip_all.t.c -> unittest/examples/skip_all-t.c
unittest/examples/todo-t.c:
Rename: unittest/examples/todo.t.c -> unittest/examples/todo-t.c
BitKeeper/etc/ignore:
added *-t
config/ac-macros/misc.m4:
remove custom AC_TRY_RUN tests for available types, use AC_CHECK_TYPE instead
configure.in:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/atomic/x86-gcc.h:
fix gcc -ansi errors while maintaining readability
include/my_global.h:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/my_sys.h:
add missing declaration
mysys/Makefile.am:
move test_atomic to unittest
unittest/Makefile.am:
simplifications, correct permissions in chmod
unittest/README.txt:
rename *.t* to *-t* to be automake-friendly
unittest/examples/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/my_atomic-t.c:
move mysys/test_atomic.c to unittest, add GPL comment, fix warnings,
convert to tap framework.
unittest/mytap/t/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/unit.pl:
rename *.t* to *-t* to be automake-friendly
2006-06-01 12:25:47 +02:00
|
|
|
#ifndef HAVE_INT8
|
|
|
|
typedef signed char int8; /* Signed integer >= 8 bits */
|
|
|
|
#endif
|
|
|
|
#ifndef HAVE_UINT8
|
|
|
|
typedef unsigned char uint8; /* Unsigned integer >= 8 bits */
|
|
|
|
#endif
|
|
|
|
#ifndef HAVE_INT16
|
|
|
|
typedef short int16;
|
|
|
|
#endif
|
|
|
|
#ifndef HAVE_UINT16
|
|
|
|
typedef unsigned short uint16;
|
|
|
|
#endif
|
2001-09-15 04:12:46 +02:00
|
|
|
#if SIZEOF_INT == 4
|
unittest:
rename *.t* to *-t* to be automake-friendly
simplify Makefiles
test_atomic.c:
move to unittest, add GPL comment, fix warnings, convert to tap framework.
configure:
remove custom tests for available types, use AC_CHECK_TYPE instead
x86-gcc.h:
fix gcc -ansi errors while maintaining readability
ignore:
added *-t
unittest/mysys/base64-t.c:
Rename: unittest/mysys/base64.t.c -> unittest/mysys/base64-t.c
unittest/mysys/bitmap-t.c:
Rename: unittest/mysys/bitmap.t.c -> unittest/mysys/bitmap-t.c
unittest/mytap/t/basic-t.c:
Rename: unittest/mytap/t/basic.t.c -> unittest/mytap/t/basic-t.c
unittest/examples/no_plan-t.c:
Rename: unittest/examples/no_plan.t.c -> unittest/examples/no_plan-t.c
unittest/examples/simple-t.c:
Rename: unittest/examples/simple.t.c -> unittest/examples/simple-t.c
unittest/examples/skip-t.c:
Rename: unittest/examples/skip.t.c -> unittest/examples/skip-t.c
unittest/examples/skip_all-t.c:
Rename: unittest/examples/skip_all.t.c -> unittest/examples/skip_all-t.c
unittest/examples/todo-t.c:
Rename: unittest/examples/todo.t.c -> unittest/examples/todo-t.c
BitKeeper/etc/ignore:
added *-t
config/ac-macros/misc.m4:
remove custom AC_TRY_RUN tests for available types, use AC_CHECK_TYPE instead
configure.in:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/atomic/x86-gcc.h:
fix gcc -ansi errors while maintaining readability
include/my_global.h:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/my_sys.h:
add missing declaration
mysys/Makefile.am:
move test_atomic to unittest
unittest/Makefile.am:
simplifications, correct permissions in chmod
unittest/README.txt:
rename *.t* to *-t* to be automake-friendly
unittest/examples/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/my_atomic-t.c:
move mysys/test_atomic.c to unittest, add GPL comment, fix warnings,
convert to tap framework.
unittest/mytap/t/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/unit.pl:
rename *.t* to *-t* to be automake-friendly
2006-06-01 12:25:47 +02:00
|
|
|
#ifndef HAVE_INT32
|
|
|
|
typedef int int32;
|
|
|
|
#endif
|
|
|
|
#ifndef HAVE_UINT32
|
|
|
|
typedef unsigned int uint32;
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif
|
|
|
|
#elif SIZEOF_LONG == 4
|
unittest:
rename *.t* to *-t* to be automake-friendly
simplify Makefiles
test_atomic.c:
move to unittest, add GPL comment, fix warnings, convert to tap framework.
configure:
remove custom tests for available types, use AC_CHECK_TYPE instead
x86-gcc.h:
fix gcc -ansi errors while maintaining readability
ignore:
added *-t
unittest/mysys/base64-t.c:
Rename: unittest/mysys/base64.t.c -> unittest/mysys/base64-t.c
unittest/mysys/bitmap-t.c:
Rename: unittest/mysys/bitmap.t.c -> unittest/mysys/bitmap-t.c
unittest/mytap/t/basic-t.c:
Rename: unittest/mytap/t/basic.t.c -> unittest/mytap/t/basic-t.c
unittest/examples/no_plan-t.c:
Rename: unittest/examples/no_plan.t.c -> unittest/examples/no_plan-t.c
unittest/examples/simple-t.c:
Rename: unittest/examples/simple.t.c -> unittest/examples/simple-t.c
unittest/examples/skip-t.c:
Rename: unittest/examples/skip.t.c -> unittest/examples/skip-t.c
unittest/examples/skip_all-t.c:
Rename: unittest/examples/skip_all.t.c -> unittest/examples/skip_all-t.c
unittest/examples/todo-t.c:
Rename: unittest/examples/todo.t.c -> unittest/examples/todo-t.c
BitKeeper/etc/ignore:
added *-t
config/ac-macros/misc.m4:
remove custom AC_TRY_RUN tests for available types, use AC_CHECK_TYPE instead
configure.in:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/atomic/x86-gcc.h:
fix gcc -ansi errors while maintaining readability
include/my_global.h:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/my_sys.h:
add missing declaration
mysys/Makefile.am:
move test_atomic to unittest
unittest/Makefile.am:
simplifications, correct permissions in chmod
unittest/README.txt:
rename *.t* to *-t* to be automake-friendly
unittest/examples/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/my_atomic-t.c:
move mysys/test_atomic.c to unittest, add GPL comment, fix warnings,
convert to tap framework.
unittest/mytap/t/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/unit.pl:
rename *.t* to *-t* to be automake-friendly
2006-06-01 12:25:47 +02:00
|
|
|
#ifndef HAVE_INT32
|
|
|
|
typedef long int32;
|
|
|
|
#endif
|
|
|
|
#ifndef HAVE_UINT32
|
|
|
|
typedef unsigned long uint32;
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif
|
|
|
|
#else
|
2007-01-28 21:12:58 +01:00
|
|
|
#error Neither int or long is of 4 bytes width
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif
|
|
|
|
|
2006-04-07 00:25:59 +02:00
|
|
|
#if !defined(HAVE_ULONG) && !defined(__USE_MISC)
|
2002-06-11 10:20:31 +02:00
|
|
|
typedef unsigned long ulong; /* Short for unsigned long */
|
2001-09-15 04:12:46 +02:00
|
|
|
#endif
|
|
|
|
#ifndef longlong_defined
|
2007-06-22 14:12:40 +02:00
|
|
|
/*
|
|
|
|
Using [unsigned] long long is preferable as [u]longlong because we use
|
|
|
|
[unsigned] long long unconditionally in many places,
|
|
|
|
for example in constants with [U]LL suffix.
|
|
|
|
*/
|
|
|
|
#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8
|
2002-01-02 20:29:41 +01:00
|
|
|
typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
|
|
|
|
typedef long long int longlong;
|
2001-09-15 04:12:46 +02:00
|
|
|
#else
|
2002-06-11 10:20:31 +02:00
|
|
|
typedef unsigned long ulonglong; /* ulong or unsigned long long */
|
2001-09-15 04:12:46 +02:00
|
|
|
typedef long longlong;
|
|
|
|
#endif
|
|
|
|
#endif
|
unittest:
rename *.t* to *-t* to be automake-friendly
simplify Makefiles
test_atomic.c:
move to unittest, add GPL comment, fix warnings, convert to tap framework.
configure:
remove custom tests for available types, use AC_CHECK_TYPE instead
x86-gcc.h:
fix gcc -ansi errors while maintaining readability
ignore:
added *-t
unittest/mysys/base64-t.c:
Rename: unittest/mysys/base64.t.c -> unittest/mysys/base64-t.c
unittest/mysys/bitmap-t.c:
Rename: unittest/mysys/bitmap.t.c -> unittest/mysys/bitmap-t.c
unittest/mytap/t/basic-t.c:
Rename: unittest/mytap/t/basic.t.c -> unittest/mytap/t/basic-t.c
unittest/examples/no_plan-t.c:
Rename: unittest/examples/no_plan.t.c -> unittest/examples/no_plan-t.c
unittest/examples/simple-t.c:
Rename: unittest/examples/simple.t.c -> unittest/examples/simple-t.c
unittest/examples/skip-t.c:
Rename: unittest/examples/skip.t.c -> unittest/examples/skip-t.c
unittest/examples/skip_all-t.c:
Rename: unittest/examples/skip_all.t.c -> unittest/examples/skip_all-t.c
unittest/examples/todo-t.c:
Rename: unittest/examples/todo.t.c -> unittest/examples/todo-t.c
BitKeeper/etc/ignore:
added *-t
config/ac-macros/misc.m4:
remove custom AC_TRY_RUN tests for available types, use AC_CHECK_TYPE instead
configure.in:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/atomic/x86-gcc.h:
fix gcc -ansi errors while maintaining readability
include/my_global.h:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/my_sys.h:
add missing declaration
mysys/Makefile.am:
move test_atomic to unittest
unittest/Makefile.am:
simplifications, correct permissions in chmod
unittest/README.txt:
rename *.t* to *-t* to be automake-friendly
unittest/examples/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/my_atomic-t.c:
move mysys/test_atomic.c to unittest, add GPL comment, fix warnings,
convert to tap framework.
unittest/mytap/t/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/unit.pl:
rename *.t* to *-t* to be automake-friendly
2006-06-01 12:25:47 +02:00
|
|
|
#ifndef HAVE_INT64
|
2006-05-31 18:44:09 +02:00
|
|
|
typedef longlong int64;
|
unittest:
rename *.t* to *-t* to be automake-friendly
simplify Makefiles
test_atomic.c:
move to unittest, add GPL comment, fix warnings, convert to tap framework.
configure:
remove custom tests for available types, use AC_CHECK_TYPE instead
x86-gcc.h:
fix gcc -ansi errors while maintaining readability
ignore:
added *-t
unittest/mysys/base64-t.c:
Rename: unittest/mysys/base64.t.c -> unittest/mysys/base64-t.c
unittest/mysys/bitmap-t.c:
Rename: unittest/mysys/bitmap.t.c -> unittest/mysys/bitmap-t.c
unittest/mytap/t/basic-t.c:
Rename: unittest/mytap/t/basic.t.c -> unittest/mytap/t/basic-t.c
unittest/examples/no_plan-t.c:
Rename: unittest/examples/no_plan.t.c -> unittest/examples/no_plan-t.c
unittest/examples/simple-t.c:
Rename: unittest/examples/simple.t.c -> unittest/examples/simple-t.c
unittest/examples/skip-t.c:
Rename: unittest/examples/skip.t.c -> unittest/examples/skip-t.c
unittest/examples/skip_all-t.c:
Rename: unittest/examples/skip_all.t.c -> unittest/examples/skip_all-t.c
unittest/examples/todo-t.c:
Rename: unittest/examples/todo.t.c -> unittest/examples/todo-t.c
BitKeeper/etc/ignore:
added *-t
config/ac-macros/misc.m4:
remove custom AC_TRY_RUN tests for available types, use AC_CHECK_TYPE instead
configure.in:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/atomic/x86-gcc.h:
fix gcc -ansi errors while maintaining readability
include/my_global.h:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/my_sys.h:
add missing declaration
mysys/Makefile.am:
move test_atomic to unittest
unittest/Makefile.am:
simplifications, correct permissions in chmod
unittest/README.txt:
rename *.t* to *-t* to be automake-friendly
unittest/examples/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/my_atomic-t.c:
move mysys/test_atomic.c to unittest, add GPL comment, fix warnings,
convert to tap framework.
unittest/mytap/t/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/unit.pl:
rename *.t* to *-t* to be automake-friendly
2006-06-01 12:25:47 +02:00
|
|
|
#endif
|
|
|
|
#ifndef HAVE_UINT64
|
2006-05-31 18:44:09 +02:00
|
|
|
typedef ulonglong uint64;
|
unittest:
rename *.t* to *-t* to be automake-friendly
simplify Makefiles
test_atomic.c:
move to unittest, add GPL comment, fix warnings, convert to tap framework.
configure:
remove custom tests for available types, use AC_CHECK_TYPE instead
x86-gcc.h:
fix gcc -ansi errors while maintaining readability
ignore:
added *-t
unittest/mysys/base64-t.c:
Rename: unittest/mysys/base64.t.c -> unittest/mysys/base64-t.c
unittest/mysys/bitmap-t.c:
Rename: unittest/mysys/bitmap.t.c -> unittest/mysys/bitmap-t.c
unittest/mytap/t/basic-t.c:
Rename: unittest/mytap/t/basic.t.c -> unittest/mytap/t/basic-t.c
unittest/examples/no_plan-t.c:
Rename: unittest/examples/no_plan.t.c -> unittest/examples/no_plan-t.c
unittest/examples/simple-t.c:
Rename: unittest/examples/simple.t.c -> unittest/examples/simple-t.c
unittest/examples/skip-t.c:
Rename: unittest/examples/skip.t.c -> unittest/examples/skip-t.c
unittest/examples/skip_all-t.c:
Rename: unittest/examples/skip_all.t.c -> unittest/examples/skip_all-t.c
unittest/examples/todo-t.c:
Rename: unittest/examples/todo.t.c -> unittest/examples/todo-t.c
BitKeeper/etc/ignore:
added *-t
config/ac-macros/misc.m4:
remove custom AC_TRY_RUN tests for available types, use AC_CHECK_TYPE instead
configure.in:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/atomic/x86-gcc.h:
fix gcc -ansi errors while maintaining readability
include/my_global.h:
remove custom tests for available types, use AC_CHECK_TYPE instead
include/my_sys.h:
add missing declaration
mysys/Makefile.am:
move test_atomic to unittest
unittest/Makefile.am:
simplifications, correct permissions in chmod
unittest/README.txt:
rename *.t* to *-t* to be automake-friendly
unittest/examples/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/mysys/my_atomic-t.c:
move mysys/test_atomic.c to unittest, add GPL comment, fix warnings,
convert to tap framework.
unittest/mytap/t/Makefile.am:
rename *.t* to *-t* to be automake-friendly
simplify Makefile
unittest/unit.pl:
rename *.t* to *-t* to be automake-friendly
2006-06-01 12:25:47 +02:00
|
|
|
#endif
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2003-04-28 11:25:29 +02:00
|
|
|
#if defined(NO_CLIENT_LONG_LONG)
|
|
|
|
typedef unsigned long my_ulonglong;
|
2021-06-06 13:21:03 +02:00
|
|
|
#elif defined (_WIN32)
|
2003-04-28 11:25:29 +02:00
|
|
|
typedef unsigned __int64 my_ulonglong;
|
|
|
|
#else
|
|
|
|
typedef unsigned long long my_ulonglong;
|
|
|
|
#endif
|
|
|
|
|
2007-01-28 21:12:58 +01:00
|
|
|
#if SIZEOF_CHARP == SIZEOF_INT
|
2011-10-19 22:48:48 +02:00
|
|
|
typedef unsigned int intptr;
|
2007-01-28 21:12:58 +01:00
|
|
|
#elif SIZEOF_CHARP == SIZEOF_LONG
|
2011-10-19 22:48:48 +02:00
|
|
|
typedef unsigned long intptr;
|
2007-03-17 11:19:21 +01:00
|
|
|
#elif SIZEOF_CHARP == SIZEOF_LONG_LONG
|
2011-10-19 22:48:48 +02:00
|
|
|
typedef unsigned long long intptr;
|
2007-01-28 21:12:58 +01:00
|
|
|
#else
|
2007-03-17 11:19:21 +01:00
|
|
|
#error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long)
|
2007-01-28 21:12:58 +01:00
|
|
|
#endif
|
|
|
|
|
2007-10-11 17:07:40 +02:00
|
|
|
#define MY_ERRPTR ((void*)(intptr)1)
|
|
|
|
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#if defined(_WIN32)
|
|
|
|
typedef unsigned long long my_off_t;
|
|
|
|
typedef unsigned long long os_off_t;
|
|
|
|
#else
|
|
|
|
typedef off_t os_off_t;
|
2001-09-15 04:12:46 +02:00
|
|
|
#if SIZEOF_OFF_T > 4
|
|
|
|
typedef ulonglong my_off_t;
|
|
|
|
#else
|
|
|
|
typedef unsigned long my_off_t;
|
|
|
|
#endif
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#endif /*_WIN32*/
|
2001-09-15 04:12:46 +02:00
|
|
|
#define MY_FILEPOS_ERROR (~(my_off_t) 0)
|
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
/*
|
|
|
|
TODO Convert these to use Bitmap class.
|
|
|
|
*/
|
|
|
|
typedef ulonglong table_map; /* Used for table bits in join */
|
|
|
|
|
2011-04-25 17:22:25 +02:00
|
|
|
/* often used type names - opaque declarations */
|
|
|
|
typedef const struct charset_info_st CHARSET_INFO;
|
|
|
|
typedef struct st_mysql_lex_string LEX_STRING;
|
|
|
|
|
2021-06-06 13:21:03 +02:00
|
|
|
#if defined(_WIN32)
|
2001-09-15 04:12:46 +02:00
|
|
|
#define socket_errno WSAGetLastError()
|
2001-12-06 13:10:51 +01:00
|
|
|
#define SOCKET_EINTR WSAEINTR
|
2005-08-30 17:19:28 +02:00
|
|
|
#define SOCKET_ETIMEDOUT WSAETIMEDOUT
|
2005-07-12 18:31:09 +02:00
|
|
|
#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
|
2006-01-04 16:38:54 +01:00
|
|
|
#define SOCKET_EADDRINUSE WSAEADDRINUSE
|
2012-08-14 16:23:34 +02:00
|
|
|
#define SOCKET_ECONNRESET WSAECONNRESET
|
2001-09-15 04:12:46 +02:00
|
|
|
#define SOCKET_ENFILE ENFILE
|
|
|
|
#define SOCKET_EMFILE EMFILE
|
2024-03-01 17:16:33 +01:00
|
|
|
#define SOCKET_CLOSED EIO
|
2001-09-15 04:12:46 +02:00
|
|
|
#else /* Unix */
|
|
|
|
#define socket_errno errno
|
|
|
|
#define closesocket(A) close(A)
|
|
|
|
#define SOCKET_EINTR EINTR
|
|
|
|
#define SOCKET_EAGAIN EAGAIN
|
|
|
|
#define SOCKET_EWOULDBLOCK EWOULDBLOCK
|
2006-01-04 16:38:54 +01:00
|
|
|
#define SOCKET_EADDRINUSE EADDRINUSE
|
2012-08-17 15:46:34 +02:00
|
|
|
#define SOCKET_ETIMEDOUT ETIMEDOUT
|
2012-08-14 16:23:34 +02:00
|
|
|
#define SOCKET_ECONNRESET ECONNRESET
|
2024-03-01 17:16:33 +01:00
|
|
|
#define SOCKET_CLOSED EIO
|
2001-09-15 04:12:46 +02:00
|
|
|
#define SOCKET_ENFILE ENFILE
|
|
|
|
#define SOCKET_EMFILE EMFILE
|
|
|
|
#endif
|
|
|
|
|
2013-06-03 09:57:34 +02:00
|
|
|
#include <mysql/plugin.h> /* my_bool */
|
|
|
|
|
MDEV-4011 Added per thread memory counting and usage
Base code and idea from a patch from by plinux at Taobao.
The idea is that we mark all memory that are thread specific with MY_THREAD_SPECIFIC.
Memory counting is done per thread in the my_malloc_size_cb_func callback function from my_malloc().
There are plenty of new asserts to ensure that for a debug server the counting is correct.
Information_schema.processlist gets two new columns: MEMORY_USED and EXAMINED_ROWS.
- The later is there mainly to show how query is progressing.
The following changes in interfaces was needed to get this to work:
- init_alloc_root() amd init_sql_alloc() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
- One now have to use alloc_root_set_min_malloc() to set min memory to be allocated by alloc_root()
- my_init_dynamic_array() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
- my_net_init() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
- Added flag for hash_init() so that one can mark hash table to be thread specific.
- Added flags to init_tree() so that one can mark tree to be thread specific.
- Removed with_delete option to init_tree(). Now one should instead use MY_TREE_WITH_DELETE_FLAG.
- Added flag to Warning_info::Warning_info() if the structure should be fully initialized.
- String elements can now be marked as thread specific.
- Internal HEAP tables are now marking it's memory as MY_THREAD_SPECIFIC.
- Changed type of myf from int to ulong, as this is always a set of bit flags.
Other things:
- Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
- We now also show EXAMINED_ROWS in SHOW PROCESSLIST
- Added new variable 'memory_used'
- Fixed bug where kill_threads_for_user() was using the wrong mem_root to allocate memory.
- Removed calls to the obsoleted function init_dynamic_array()
- Use set_current_thd() instead of my_pthread_setspecific_ptr(THR_THD,...)
client/completion_hash.cc:
Updated call to init_alloc_root()
client/mysql.cc:
Updated call to init_alloc_root()
client/mysqlbinlog.cc:
init_dynamic_array() -> my_init_dynamic_array()
Updated call to init_alloc_root()
client/mysqlcheck.c:
Updated call to my_init_dynamic_array()
client/mysqldump.c:
Updated call to init_alloc_root()
client/mysqltest.cc:
Updated call to init_alloc_root()
Updated call to my_init_dynamic_array()
Fixed compiler warnings
extra/comp_err.c:
Updated call to my_init_dynamic_array()
extra/resolve_stack_dump.c:
Updated call to my_init_dynamic_array()
include/hash.h:
Added HASH_THREAD_SPECIFIC
include/heap.h:
Added flag is internal temporary table.
include/my_dir.h:
Safety fix: Ensure that MY_DONT_SORT and MY_WANT_STAT don't interfer with other mysys flags
include/my_global.h:
Changed type of myf from int to ulong, as this is always a set of bit flags.
include/my_sys.h:
Added MY_THREAD_SPECIFIC and MY_THREAD_MOVE
Added malloc_flags to DYNAMIC_ARRAY
Added extra mysys flag argument to my_init_dynamic_array()
Removed deprecated functions init_dynamic_array() and my_init_dynamic_array.._ci
Updated paramaters for init_alloc_root()
include/my_tree.h:
Added my_flags to allow one to use MY_THREAD_SPECIFIC with hash tables.
Removed with_delete. One should now instead use MY_TREE_WITH_DELETE_FLAG
Updated parameters to init_tree()
include/myisamchk.h:
Added malloc_flags to allow one to use MY_THREAD_SPECIFIC for checks.
include/mysql.h:
Added MYSQL_THREAD_SPECIFIC_MALLOC
Used 'unused1' to mark memory as thread specific.
include/mysql.h.pp:
Updated file
include/mysql_com.h:
Used 'unused1' to mark memory as thread specific.
Updated parameters for my_net_init()
libmysql/libmysql.c:
Updated call to init_alloc_root() to mark memory thread specific.
libmysqld/emb_qcache.cc:
Updated call to init_alloc_root()
libmysqld/lib_sql.cc:
Updated call to init_alloc_root()
mysql-test/r/create.result:
Updated results
mysql-test/r/user_var.result:
Updated results
mysql-test/suite/funcs_1/datadict/processlist_priv.inc:
Update to handle new format of SHOW PROCESSLIST
mysql-test/suite/funcs_1/datadict/processlist_val.inc:
Update to handle new format of SHOW PROCESSLIST
mysql-test/suite/funcs_1/r/is_columns_is.result:
Update to handle new format of SHOW PROCESSLIST
mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result:
Updated results
mysql-test/suite/funcs_1/r/processlist_val_no_prot.result:
Updated results
mysql-test/t/show_explain.test:
Fixed usage of debug variable so that one can run test with --debug
mysql-test/t/user_var.test:
Added test of memory_usage variable.
mysys/array.c:
Added extra my_flags option to init_dynamic_array() and init_dynamic_array2() so that one can mark memory with MY_THREAD_SPECIFIC
All allocated memory is marked with the given my_flags.
Removed obsolete function init_dynamic_array()
mysys/default.c:
Updated call to init_alloc_root()
Updated call to my_init_dynamic_array()
mysys/hash.c:
Updated call to my_init_dynamic_array_ci().
Allocated memory is marked with MY_THREAD_SPECIFIC if HASH_THREAD_SPECIFIC is used.
mysys/ma_dyncol.c:
init_dynamic_array() -> my_init_dynamic_array()
Added #if to get rid of compiler warnings
mysys/mf_tempdir.c:
Updated call to my_init_dynamic_array()
mysys/my_alloc.c:
Added extra parameter to init_alloc_root() so that one can mark memory with MY_THREAD_SPECIFIC
Extend MEM_ROOT with a flag if memory is thread specific.
This is stored in block_size, to keep the size of the MEM_ROOT object identical as before.
Allocated memory is marked with MY_THREAD_SPECIFIC if used with init_alloc_root()
mysys/my_chmod.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_chsize.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_copy.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_create.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_delete.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_error.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_fopen.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_fstream.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_getwd.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_lib.c:
Updated call to init_alloc_root()
Updated call to my_init_dynamic_array()
Updated DBUG_PRINT because of change of myf type
mysys/my_lock.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_malloc.c:
Store at start of each allocated memory block the size of the block and if the block is thread specific.
Call malloc_size_cb_func, if set, with the memory allocated/freed.
Updated DBUG_PRINT because of change of myf type
mysys/my_open.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_pread.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_read.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_redel.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_rename.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_seek.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_sync.c:
Updated DBUG_PRINT because of change of myf type
mysys/my_thr_init.c:
Ensure that one can call my_thread_dbug_id() even if thread is not properly initialized.
mysys/my_write.c:
Updated DBUG_PRINT because of change of myf type
mysys/mysys_priv.h:
Updated parameters to sf_malloc and sf_realloc()
mysys/safemalloc.c:
Added checking that for memory marked with MY_THREAD_SPECIFIC that it's the same thread that is allocation and freeing the memory.
Added sf_malloc_dbug_id() to allow MariaDB to specify which THD is handling the memory.
Added my_flags arguments to sf_malloc() and sf_realloc() to be able to mark memory with MY_THREAD_SPECIFIC.
Added sf_report_leaked_memory() to get list of memory not freed by a thread.
mysys/tree.c:
Added flags to init_tree() so that one can mark tree to be thread specific.
Removed with_delete option to init_tree(). Now one should instead use MY_TREE_WITH_DELETE_FLAG.
Updated call to init_alloc_root()
All allocated memory is marked with the given malloc flags
mysys/waiting_threads.c:
Updated call to my_init_dynamic_array()
sql-common/client.c:
Updated call to init_alloc_root() and my_net_init() to mark memory thread specific.
Updated call to my_init_dynamic_array().
Added MYSQL_THREAD_SPECIFIC_MALLOC so that client can mark memory as MY_THREAD_SPECIFIC.
sql-common/client_plugin.c:
Updated call to init_alloc_root()
sql/debug_sync.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/event_scheduler.cc:
Removed calls to net_end() as this is now done in ~THD()
Call set_current_thd() to ensure that memory is assigned to right thread.
sql/events.cc:
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/filesort.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/filesort_utils.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/ha_ndbcluster.cc:
Updated call to init_alloc_root()
Updated call to my_net_init()
Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
sql/ha_ndbcluster_binlog.cc:
Updated call to my_net_init()
Updated call to init_sql_alloc()
Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
sql/ha_partition.cc:
Updated call to init_alloc_root()
sql/handler.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
Added missing call to my_dir_end()
sql/item_func.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/item_subselect.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/item_sum.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/log.cc:
More DBUG
Updated call to init_alloc_root()
sql/mdl.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/mysqld.cc:
Added total_memory_used
Updated call to init_alloc_root()
Move mysql_cond_broadcast() before my_thread_end()
Added mariadb_dbug_id() to count memory per THD instead of per thread.
Added my_malloc_size_cb_func() callback function for my_malloc() to count memory.
Move initialization of mysqld_server_started and mysqld_server_initialized earlier.
Updated call to my_init_dynamic_array().
Updated call to my_net_init().
Call my_pthread_setspecific_ptr(THR_THD,...) to ensure that memory is assigned to right thread.
Added status variable 'memory_used'.
Updated call to init_alloc_root()
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/mysqld.h:
Added set_current_thd()
sql/net_serv.cc:
Added new parameter to my_net_init() so that one can mark memory with MY_THREAD_SPECIFIC.
Store in net->thread_specific_malloc if memory is thread specific.
Mark memory to be thread specific if requested.
sql/opt_range.cc:
Updated call to my_init_dynamic_array()
Updated call to init_sql_alloc()
Added MY_THREAD_SPECIFIC to allocated memory.
sql/opt_subselect.cc:
Updated call to init_sql_alloc() to mark memory thread specific.
sql/protocol.cc:
Fixed compiler warning
sql/records.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/rpl_filter.cc:
Updated call to my_init_dynamic_array()
sql/rpl_handler.cc:
Updated call to my_init_dynamic_array2()
sql/rpl_handler.h:
Updated call to init_sql_alloc()
sql/rpl_mi.cc:
Updated call to my_init_dynamic_array()
sql/rpl_tblmap.cc:
Updated call to init_alloc_root()
sql/rpl_utility.cc:
Updated call to my_init_dynamic_array()
sql/slave.cc:
Initialize things properly before calling functions that allocate memory.
Removed calls to net_end() as this is now done in ~THD()
sql/sp_head.cc:
Updated call to init_sql_alloc()
Updated call to my_init_dynamic_array()
Added parameter to warning_info() that it should be fully initialized.
sql/sp_pcontext.cc:
Updated call to my_init_dynamic_array()
sql/sql_acl.cc:
Updated call to init_sql_alloc()
Updated call to my_init_dynamic_array()
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_admin.cc:
Added parameter to warning_info() that it should be fully initialized.
sql/sql_analyse.h:
Updated call to init_tree() to mark memory thread specific.
sql/sql_array.h:
Updated call to my_init_dynamic_array() to mark memory thread specific.
sql/sql_audit.cc:
Updated call to my_init_dynamic_array()
sql/sql_base.cc:
Updated call to init_sql_alloc()
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_cache.cc:
Updated comment
sql/sql_class.cc:
Added parameter to warning_info() that not initialize it until THD is fully created.
Updated call to init_sql_alloc()
Mark THD::user_vars has to be thread specific.
Updated call to my_init_dynamic_array()
Ensure that memory allocated by THD is assigned to the THD.
More DBUG
Always acll net_end() in ~THD()
Assert that all memory signed to this THD is really deleted at ~THD.
Fixed set_status_var_init() to not reset memory_used.
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_class.h:
Added MY_THREAD_SPECIFIC to allocated memory.
Added malloc_size to THD to record allocated memory per THD.
sql/sql_delete.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/sql_error.cc:
Added 'initialize' parameter to Warning_info() to say if should allocate memory for it's structures.
This is used by THD::THD() to not allocate memory until THD is ready.
Added Warning_info::free_memory()
sql/sql_error.h:
Updated Warning_info() class.
sql/sql_handler.cc:
Updated call to init_alloc_root() to mark memory thread specific.
sql/sql_insert.cc:
More DBUG
sql/sql_join_cache.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/sql_lex.cc:
Updated call to my_init_dynamic_array()
sql/sql_lex.h:
Updated call to my_init_dynamic_array()
sql/sql_load.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/sql_parse.cc:
Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
Ensure that examined_row_count() is reset before query.
Fixed bug where kill_threads_for_user() was using the wrong mem_root to allocate memory.
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
Don't restore thd->status_var.memory_used when restoring thd->status_var
sql/sql_plugin.cc:
Updated call to init_alloc_root()
Updated call to my_init_dynamic_array()
Don't allocate THD on the stack, as this causes problems with valgrind when doing thd memory counting.
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_prepare.cc:
Added parameter to warning_info() that it should be fully initialized.
Updated call to init_sql_alloc() to mark memory thread specific.
sql/sql_reload.cc:
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_select.cc:
Updated call to my_init_dynamic_array() and init_sql_alloc() to mark memory thread specific.
Added MY_THREAD_SPECIFIC to allocated memory.
More DBUG
sql/sql_servers.cc:
Updated call to init_sql_alloc() to mark memory some memory thread specific.
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_show.cc:
Updated call to my_init_dynamic_array()
Mark my_dir() memory thread specific.
Use my_pthread_setspecific_ptr(THR_THD,...) to mark that allocated memory should be allocated to calling thread.
More DBUG.
Added malloc_size and examined_row_count to SHOW PROCESSLIST.
Added MY_THREAD_SPECIFIC to allocated memory.
Updated call to init_sql_alloc()
Added parameter to warning_info() that it should be fully initialized.
sql/sql_statistics.cc:
Fixed compiler warning
sql/sql_string.cc:
String elements can now be marked as thread specific.
sql/sql_string.h:
String elements can now be marked as thread specific.
sql/sql_table.cc:
Updated call to init_sql_alloc() and my_malloc() to mark memory thread specific
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
Fixed compiler warning
sql/sql_test.cc:
Updated call to my_init_dynamic_array() to mark memory thread specific.
sql/sql_trigger.cc:
Updated call to init_sql_alloc()
sql/sql_udf.cc:
Updated call to init_sql_alloc()
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_update.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
sql/table.cc:
Updated call to init_sql_alloc().
Mark memory used by temporary tables, that are not for slave threads, as MY_THREAD_SPECIFIC
Updated call to init_sql_alloc()
sql/thr_malloc.cc:
Added my_flags argument to init_sql_alloc() to be able to mark memory as MY_THREAD_SPECIFIC.
sql/thr_malloc.h:
Updated prototype for init_sql_alloc()
sql/tztime.cc:
Updated call to init_sql_alloc()
Updated call to init_alloc_root() to mark memory thread specific.
my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/uniques.cc:
Updated calls to init_tree(), my_init_dynamic_array() and my_malloc() to mark memory thread specific.
sql/unireg.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
storage/csv/ha_tina.cc:
Updated call to init_alloc_root()
storage/federated/ha_federated.cc:
Updated call to init_alloc_root()
Updated call to my_init_dynamic_array()
Ensure that memory allocated by fedarated is registered for the system, not for the thread.
storage/federatedx/federatedx_io_mysql.cc:
Updated call to my_init_dynamic_array()
storage/federatedx/ha_federatedx.cc:
Updated call to init_alloc_root()
Updated call to my_init_dynamic_array()
storage/heap/ha_heap.cc:
Added MY_THREAD_SPECIFIC to allocated memory.
storage/heap/heapdef.h:
Added parameter to hp_get_new_block() to be able to do thread specific memory tagging.
storage/heap/hp_block.c:
Added parameter to hp_get_new_block() to be able to do thread specific memory tagging.
storage/heap/hp_create.c:
- Internal HEAP tables are now marking it's memory as MY_THREAD_SPECIFIC.
- Use MY_TREE_WITH_DELETE instead of removed option 'with_delete'.
storage/heap/hp_open.c:
Internal HEAP tables are now marking it's memory as MY_THREAD_SPECIFIC.
storage/heap/hp_write.c:
Added new parameter to hp_get_new_block()
storage/maria/ma_bitmap.c:
Updated call to my_init_dynamic_array()
storage/maria/ma_blockrec.c:
Updated call to my_init_dynamic_array()
storage/maria/ma_check.c:
Updated call to init_alloc_root()
storage/maria/ma_ft_boolean_search.c:
Updated calls to init_tree() and init_alloc_root()
storage/maria/ma_ft_nlq_search.c:
Updated call to init_tree()
storage/maria/ma_ft_parser.c:
Updated call to init_tree()
Updated call to init_alloc_root()
storage/maria/ma_loghandler.c:
Updated call to my_init_dynamic_array()
storage/maria/ma_open.c:
Updated call to my_init_dynamic_array()
storage/maria/ma_sort.c:
Updated call to my_init_dynamic_array()
storage/maria/ma_write.c:
Updated calls to my_init_dynamic_array() and init_tree()
storage/maria/maria_pack.c:
Updated call to init_tree()
storage/maria/unittest/sequence_storage.c:
Updated call to my_init_dynamic_array()
storage/myisam/ft_boolean_search.c:
Updated call to init_tree()
Updated call to init_alloc_root()
storage/myisam/ft_nlq_search.c:
Updated call to init_tree()
storage/myisam/ft_parser.c:
Updated call to init_tree()
Updated call to init_alloc_root()
storage/myisam/ft_stopwords.c:
Updated call to init_tree()
storage/myisam/mi_check.c:
Updated call to init_alloc_root()
storage/myisam/mi_write.c:
Updated call to my_init_dynamic_array()
Updated call to init_tree()
storage/myisam/myisamlog.c:
Updated call to init_tree()
storage/myisam/myisampack.c:
Updated call to init_tree()
storage/myisam/sort.c:
Updated call to my_init_dynamic_array()
storage/myisammrg/ha_myisammrg.cc:
Updated call to init_sql_alloc()
storage/perfschema/pfs_check.cc:
Rest current_thd
storage/perfschema/pfs_instr.cc:
Removed DBUG_ENTER/DBUG_VOID_RETURN as at this point my_thread_var is not allocated anymore, which can cause problems.
support-files/compiler_warnings.supp:
Disable compiler warning from offsetof macro.
2013-01-23 16:16:14 +01:00
|
|
|
typedef ulong myf; /* Type of MyFlags in my_funcs */
|
2010-07-23 22:16:29 +02:00
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#define MYF(v) (myf) (v)
|
|
|
|
|
2002-06-11 10:20:31 +02:00
|
|
|
/*
|
|
|
|
Defines to make it possible to prioritize register assignments. No
|
|
|
|
longer that important with modern compilers.
|
|
|
|
*/
|
2001-09-15 04:12:46 +02:00
|
|
|
#ifndef USING_X
|
|
|
|
#define reg1 register
|
|
|
|
#define reg2 register
|
|
|
|
#define reg3 register
|
|
|
|
#define reg4 register
|
|
|
|
#define reg5 register
|
|
|
|
#define reg6 register
|
|
|
|
#define reg7 register
|
|
|
|
#define reg8 register
|
|
|
|
#define reg9 register
|
|
|
|
#define reg10 register
|
|
|
|
#define reg11 register
|
|
|
|
#define reg12 register
|
|
|
|
#define reg13 register
|
|
|
|
#define reg14 register
|
|
|
|
#define reg15 register
|
|
|
|
#define reg16 register
|
|
|
|
#endif
|
|
|
|
|
2019-08-29 12:10:40 +02:00
|
|
|
/*
|
|
|
|
MYSQL_PLUGIN_IMPORT macro is used to export mysqld data
|
|
|
|
(i.e variables) for usage in storage engine loadable plugins.
|
|
|
|
Outside of Windows, it is dummy.
|
|
|
|
*/
|
|
|
|
#ifndef MYSQL_PLUGIN_IMPORT
|
|
|
|
#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
|
|
|
|
#define MYSQL_PLUGIN_IMPORT __declspec(dllimport)
|
|
|
|
#else
|
|
|
|
#define MYSQL_PLUGIN_IMPORT
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2009-10-30 19:13:58 +01:00
|
|
|
#include <my_dbug.h>
|
|
|
|
|
2008-08-22 12:40:21 +02:00
|
|
|
/* Some helper macros */
|
|
|
|
#define YESNO(X) ((X) ? "yes" : "no")
|
|
|
|
|
2001-09-15 04:12:46 +02:00
|
|
|
#define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */
|
UNDO of rows now puts back all part of the row on their original pages and positions
Added variable _dbug_on_ to speed up execution when DBUG is not going to be used
Added --debug-on option to mysqld (to be able to turn of DBUG with --debug-on=0)
Fixed some bugs with 'non_flushable' marking of bitmap pages
Don't use 'non_flushable' marking of bitmap pages for not transactional tables
SHOW CREATE TABLE now shows if table was created with page checksums
Fixed a lot of bugs with BLOB handling in case of update/REDO and UNDO
More tests (especially for blobs) and DBUG_ASSERTS()
More readable output from maria_read_log and maria_chk
Fixed wrong shift that caused Maria to crash on files > 4G
Mark tables as crashed of REDO fails
dbug/dbug.c:
Changed to use my_bool (allowed me to remove some windows specific code)
Added variable _dbug_on_ to speed up execution when DBUG is not going to be used
Removed initialization of variables if not needed
include/my_dbug.h:
Use my_bool for some functions that was defined as BOOLEAN in dbug.c code
Added DBUGGER_ON/DEBUGGER_OFF to speed up execution when DBUG is not used
include/my_global.h:
Define my_bool early
Increase MY_HOW_OFTEN_TO_WRITE as computers are now faster than 10 years ago
mysql-test/mysql-test-run.pl:
Added debug-on=0 to speed up tests
mysql-test/r/maria-recovery.result:
Added new test by Guilhem to test if UNDO_ROW_DELETE preserves rowid
mysql-test/r/maria.result:
Added testing of page checksums
mysql-test/t/crash_commit_before-master.opt:
Added --debug-on as test require DBUG to work
mysql-test/t/maria-recovery-bitmap-master.opt:
Added --debug-on as test require DBUG to work
mysql-test/t/maria-recovery-master.opt:
Added --debug-on as test require DBUG to work
mysql-test/t/maria-recovery.test:
Added new test by Guilhem to test if UNDO_ROW_DELETE preserves rowid
mysql-test/t/maria.test:
Added testing of page checksums
sql/mysqld.cc:
Added --debug-on option (to be able to turn of DBUG with --debug-on=0)
Indentation fixes
Removed end spaces
sql/sql_show.cc:
Allow update_create_info() to inform MySQL if PACK_KEYS, NO_PACK_KEYS, CHECKSUM, PAGE_CHECKSUM or DELAY_KEY_WRITE is used
storage/maria/Makefile.am:
Added ma_test_big.sh
storage/maria/ha_maria.cc:
Store in create_info if page checksums are used (For SHOW CREATE TABLE)
storage/maria/ma_bitmap.c:
Added _ma_bitmap_wait_or_flush() to cause reader of bitmap pages to wait with reading until bitmap is flushed.
Use TAIL_PAGE_COUNT_MARKER for tail pages
Set 'sub_blocks' for and only for the head page or for the first extent of a blob. This is needed for store_extent_info() to be able to set START_EXTENT_BIT's
Don't allocate more than 0x3ffff pages in one extent (We need bit 0x4000 as a START_EXTENT_BIT)
Increase the calculated 'head_length' with the number of bytes used for extents.
Update row->space_on_head_page also in _ma_bitmap_find_new_place()
Make _ma_bitmap_get_page_bits() global. (Needed for UNDO handling)
Changed _ma_bitmap_flushable() to take MARIA_HA instead of MARIA_SHARE.
This was needed to be able to mark the handler if we had a 'non_flushable' call pending or not.
Don't use 'non_flushable' marking of bitmap pages for not transactional tables.
Added BLOCKUSED_USE_ORG_BITMAP handling also for tail pages.
Added more DBUG_ASSERT() to find possible errors in other code
Some code simplications by adding new local variables
storage/maria/ma_blockrec.c:
UNDO of rows now puts back all part of the row on their original pages and positions.
Changed UNDO of DELETE and UNDO of UPDATE to contain information about the original length of data on head block and also extent information
This changes a lot of logic as now an insert of a row on a page may happen to any position (and not just to the first or next free)
Use PAGE_COUNT to mark if an extent is the start of of a blob. (Needed for extent_to_bitmap_blocks())
Added check_directory() for checking that directroy entries are correct.
Added checking of row checksums when reading rows (with EXTRA_DEBUG)
Added make_space_for_directory() and extend_directory() for doing expansion of directory
Added get_rowpos_in_head_or_tail_page() to be able to store head/tail on original position in UNDO
Added extent_to_bitmap_blocks() to be able to generate original bitmap blocks from UNDO entry
Added _ma_update_at_original_place() for UNDO of DELETES
Added row->min_length to hold minmum required space needed on head page
Changed find_free_position() to use make_space_for_directory()
Changed make_empty_page() to allow optional creation of directory entry
Changed delete_head_or_tail() and _ma_apply_undo_row_isnert() to not copy pagecache block (speed optimization)
Changed _ma_apply_redo_insert_row_head_or_tail() to be able to insert new row at any position on 'new' page
Changed _ma_apply_undo_row_delete() and _ma_apply_undo_row_update() to put row in it's original position
Ensure allocation of tail blocks are of at least MIN_TAIL_SIZE.
Ensure we store pages in pinned pages even if read failed. (If not we will have pages pinned forever in page cache)
Write original extent information in UNDO entry, not compacted ones (we need position to tails!)
When setting BLOCKUSED_USED, don't clear other bits (we have to preserve BLOCKUSED_USE_ORG_BITMAP)
Fixed som bugs in directory handling
Fixed bug where we wrote wrong lsn to blob pages
Added separate blob_buffer for fixing bug when updating row that had char/varchar that spanned several pages and also had blobs
Ensure we call _ma_bitmap_flushable() also in case of errors
When doing an update, first delete old entries, then search in bitmap for where to put new information
Info->s -> share
Rowid -> rowid
More DBUG_ASSERT()
storage/maria/ma_blockrec.h:
Added START_EXTENT_BIT and TAIL_PAGE_COUNT_MARKER
Added _ma_bitmap_wait_or_flush() and _ma_bitmap_get_page_bits()
storage/maria/ma_check.c:
Don't write extra empty line if there is no deleted blocks
Ignore START_EXTENT_BIT's in page count
Call _ma_fast_unlock_key_del() to free key_del link
storage/maria/ma_close.c:
Ensure that used_key_del is 0. (If not, someone forgot to call _ma_unlock_key_del())
storage/maria/ma_create.c:
Changed constant to macro
storage/maria/ma_delete.c:
For deleted keys, log also position to row
storage/maria/ma_extra.c:
Release blob buffer at maria_reset() if bigger than MARIA_SMALL_BLOB_BUFFER
storage/maria/ma_key_recover.c:
Added bzero() of LSN that confused paged cache in case of uninitialized block
Mark file crashed if applying of index changes fails
Added calls to _ma_fast_unlock_key_del() for protection of shared key_del link.
storage/maria/ma_locking.c:
Added usage of MARIA_FILE_OPEN_COUNT_OFFSET
Added _ma_mark_file_crashed()
storage/maria/ma_loghandler.c:
Fixed bug where we logged uninitialized memory
storage/maria/ma_open.c:
Moved state->changed to be at start of state info on disk to allow one to easly mark files as crashed
storage/maria/ma_page.c:
Disable 'dummy' checksumming of pages as this gave false warnings.
(Need to investigate if this is ever needed)
storage/maria/ma_pagecache.c:
Fixed wrong shift that caused Maria to crash on files > 4G
storage/maria/ma_recovery.c:
In case of errors, start writing on new line if we where in %## %## printing mode (Made errors more readable)
Changed global variable name from warnings -> recovery_warnings
Use MARIA_FILE_CREATE_RENAME_LSN_OFFSET instead of constant
Removed special handling of row position for deleted keys. Keys now always includes row positions
_ma_apply_undo_row_delete() now gets page and row position
Added check that we don't loop forever when handling undo's (in case of bug in undo chain)
Print name of failed REDO/UNDO
storage/maria/ma_recovery.h:
Removed old comment
storage/maria/ma_static.c:
Chaned version number of Maria files to not accidently use old ones (becasue of change of ordering of status variables)
storage/maria/ma_test2.c:
Added option -u to specify number of rows to update
Changed old option -u to be -A, as for ma_test1
Fixed bug in update of rows with blobs (before blobs was always reset to empty on update)
First created blob is now of max blob length to ensure we have at least one big blob in the table
storage/maria/ma_test_all.sh:
More tests
storage/maria/ma_test_recovery.expected:
Updated results
storage/maria/ma_test_recovery:
Changed tests to use bigger blobs (not just 1K)
Added new tests that tests recovery of update with blobs
Removed comparision of .MAD file as it's not guranteed that recovery from scratch gives identical data file as original update
(compact_page() may be called at different times during normal execution and during REDO)
storage/maria/ma_update.c:
Simplify code (changed * to if)
storage/maria/maria_chk.c:
Make output more readable
storage/maria/maria_def.h:
Changed 'changed' to int to prepare for more bits
Added 2 more bytes to status information
Added 'st_mara_row->min_length' for storing min length needed on head page
Added 'st_mara_handler->blob_buff & blob_buff_size' for storing blobs
Moved all tunning parameters into one block
Added MARIA_SMALL_BLOB_BUFFER
Added _ma_mark_file_crashed()
storage/myisam/mi_test2.c:
Fixed bug in update of rows with blobs (before blobs was always reset to empty on update)
storage/maria/ma_test_big.sh:
Testing of insert, update, delete, recovery and undo of rows with blobs
Thanks to the random-ness of ma_test2 this is likely to find most bugs in the row handling
2007-12-30 21:40:03 +01:00
|
|
|
#define MY_HOW_OFTEN_TO_WRITE 10000 /* How often we want info on screen */
|
2002-01-02 20:29:41 +01:00
|
|
|
|
2013-03-25 23:03:13 +01:00
|
|
|
#include <my_byteorder.h>
|
2001-09-15 04:12:46 +02:00
|
|
|
|
2018-01-14 05:00:36 +01:00
|
|
|
#ifdef HAVE_CHARSET_utf8mb4
|
|
|
|
#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8mb4"
|
2019-06-28 07:05:12 +02:00
|
|
|
#elif defined(HAVE_CHARSET_utf8mb3)
|
|
|
|
#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8mb3"
|
2003-12-19 11:12:29 +01:00
|
|
|
#else
|
|
|
|
#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME
|
|
|
|
#endif
|
|
|
|
|
2004-03-15 13:51:05 +01:00
|
|
|
#if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL)
|
|
|
|
#define NO_EMBEDDED_ACCESS_CHECKS
|
|
|
|
#endif
|
|
|
|
|
2012-01-13 15:50:02 +01:00
|
|
|
#ifdef _WIN32
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
|
2005-11-05 13:10:48 +01:00
|
|
|
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
|
2017-03-22 14:34:34 +01:00
|
|
|
#define RTLD_DEFAULT GetModuleHandle(NULL)
|
2005-11-05 13:10:48 +01:00
|
|
|
#define dlclose(lib) FreeLibrary((HMODULE)lib)
|
2011-07-02 22:08:51 +02:00
|
|
|
static inline char *dlerror(void)
|
|
|
|
{
|
|
|
|
static char win_errormsg[2048];
|
2022-09-20 15:53:20 +02:00
|
|
|
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
|
|
|
|
FORMAT_MESSAGE_IGNORE_INSERTS |
|
|
|
|
FORMAT_MESSAGE_MAX_WIDTH_MASK,
|
|
|
|
0, GetLastError(),
|
|
|
|
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
|
|
|
|
win_errormsg, 2048, NULL);
|
2017-02-28 13:57:33 +01:00
|
|
|
return win_errormsg;
|
2011-07-02 22:08:51 +02:00
|
|
|
}
|
2012-01-13 15:50:02 +01:00
|
|
|
#define HAVE_DLOPEN 1
|
|
|
|
#define HAVE_DLERROR 1
|
2011-12-02 16:26:43 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_DLFCN_H
|
2005-11-05 13:10:48 +01:00
|
|
|
#include <dlfcn.h>
|
|
|
|
#endif
|
2011-12-02 16:26:43 +01:00
|
|
|
|
2012-01-13 15:50:02 +01:00
|
|
|
#ifdef HAVE_DLOPEN
|
2010-04-02 11:20:09 +02:00
|
|
|
#ifndef HAVE_DLERROR
|
|
|
|
#define dlerror() ""
|
|
|
|
#endif
|
2018-01-16 21:57:52 +01:00
|
|
|
#ifndef HAVE_DLADDR
|
|
|
|
#define dladdr(A, B) 0
|
2018-01-19 17:04:51 +01:00
|
|
|
/* Dummy definition in case we're missing dladdr() */
|
2018-01-20 11:45:23 +01:00
|
|
|
typedef struct { const char *dli_fname, dli_fbase; } Dl_info;
|
2018-01-16 21:57:52 +01:00
|
|
|
#endif
|
2010-11-25 18:17:28 +01:00
|
|
|
#else
|
2010-08-09 10:32:50 +02:00
|
|
|
#define dlerror() "No support for dynamic loading (static build?)"
|
2010-03-29 17:13:53 +02:00
|
|
|
#define dlopen(A,B) 0
|
|
|
|
#define dlsym(A,B) 0
|
|
|
|
#define dlclose(A) 0
|
2018-01-16 21:57:52 +01:00
|
|
|
#define dladdr(A, B) 0
|
2018-01-19 17:04:51 +01:00
|
|
|
/* Dummy definition in case we're missing dladdr() */
|
2018-01-20 11:45:23 +01:00
|
|
|
typedef struct { const char *dli_fname, dli_fbase; } Dl_info;
|
2005-11-05 13:10:48 +01:00
|
|
|
#endif
|
|
|
|
|
2007-02-23 18:54:26 +01:00
|
|
|
/*
|
2007-03-20 13:32:49 +01:00
|
|
|
* Include standard definitions of operator new and delete.
|
2007-02-23 18:54:26 +01:00
|
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
2007-02-24 17:33:58 +01:00
|
|
|
#include <new>
|
2007-02-23 18:54:26 +01:00
|
|
|
#endif
|
|
|
|
|
2007-03-15 00:38:06 +01:00
|
|
|
/* Length of decimal number represented by INT32. */
|
|
|
|
#define MY_INT32_NUM_DECIMAL_DIGITS 11
|
|
|
|
|
|
|
|
/* Length of decimal number represented by INT64. */
|
|
|
|
#define MY_INT64_NUM_DECIMAL_DIGITS 21
|
|
|
|
|
2012-05-11 09:18:00 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#include <limits> /* should be included before min/max macros */
|
|
|
|
#endif
|
|
|
|
|
2007-09-03 13:12:28 +02:00
|
|
|
/* Define some useful general macros (should be done after all headers). */
|
2012-08-01 16:27:34 +02:00
|
|
|
#define MY_MAX(a, b) ((a) > (b) ? (a) : (b))
|
|
|
|
#define MY_MIN(a, b) ((a) < (b) ? (a) : (b))
|
2010-03-31 16:05:33 +02:00
|
|
|
|
2011-04-25 17:22:25 +02:00
|
|
|
#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
|
|
|
|
|
2007-10-11 17:07:40 +02:00
|
|
|
/*
|
|
|
|
Only Linux is known to need an explicit sync of the directory to make sure a
|
|
|
|
file creation/deletion/renaming in(from,to) this directory durable.
|
|
|
|
*/
|
|
|
|
#ifdef TARGET_OS_LINUX
|
|
|
|
#define NEED_EXPLICIT_SYNC_DIR 1
|
2008-10-24 12:34:08 +02:00
|
|
|
#else
|
|
|
|
/*
|
|
|
|
On linux default rwlock scheduling policy is good enough for
|
|
|
|
waiting_threads.c, on other systems use our special implementation
|
|
|
|
(which is slower).
|
|
|
|
|
|
|
|
QQ perhaps this should be tested in configure ? how ?
|
|
|
|
*/
|
|
|
|
#define WT_RWLOCKS_USE_MUTEXES 1
|
2007-09-03 13:12:28 +02:00
|
|
|
#endif
|
|
|
|
|
2008-02-18 23:29:39 +01:00
|
|
|
#if !defined(__cplusplus) && !defined(bool)
|
|
|
|
#define bool In_C_you_should_use_my_bool_instead()
|
|
|
|
#endif
|
|
|
|
|
2009-12-02 22:24:10 +01:00
|
|
|
/* Provide __func__ macro definition for platforms that miss it. */
|
2013-05-27 16:35:42 +02:00
|
|
|
#if !defined (__func__)
|
2018-04-26 15:33:05 +02:00
|
|
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L
|
2009-12-02 22:24:10 +01:00
|
|
|
# if __GNUC__ >= 2
|
|
|
|
# define __func__ __FUNCTION__
|
|
|
|
# else
|
|
|
|
# define __func__ "<unknown>"
|
|
|
|
# endif
|
|
|
|
#elif defined(_MSC_VER)
|
|
|
|
# if _MSC_VER < 1300
|
|
|
|
# define __func__ "<unknown>"
|
|
|
|
# else
|
|
|
|
# define __func__ __FUNCTION__
|
|
|
|
# endif
|
|
|
|
#elif defined(__BORLANDC__)
|
|
|
|
# define __func__ __FUNC__
|
|
|
|
#else
|
|
|
|
# define __func__ "<unknown>"
|
|
|
|
#endif
|
2013-05-27 16:35:42 +02:00
|
|
|
#endif /* !defined(__func__) */
|
2009-12-02 22:24:10 +01:00
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
/* Defines that are unique to the embedded version of MySQL */
|
|
|
|
|
|
|
|
#ifdef EMBEDDED_LIBRARY
|
|
|
|
|
|
|
|
/* Things we don't need in the embedded version of MySQL */
|
|
|
|
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
|
|
|
|
|
2012-08-14 16:23:34 +02:00
|
|
|
#else
|
|
|
|
#define HAVE_REPLICATION
|
|
|
|
#define HAVE_EXTERNAL_CLIENT
|
2010-03-31 16:05:33 +02:00
|
|
|
#endif /* EMBEDDED_LIBRARY */
|
|
|
|
|
2016-04-01 02:31:53 +02:00
|
|
|
/*
|
|
|
|
Provide defaults for the CPU cache line size, if it has not been detected by
|
|
|
|
CMake using getconf
|
|
|
|
*/
|
|
|
|
#if !defined(CPU_LEVEL1_DCACHE_LINESIZE) || CPU_LEVEL1_DCACHE_LINESIZE == 0
|
2018-04-26 15:33:05 +02:00
|
|
|
#if defined(CPU_LEVEL1_DCACHE_LINESIZE) && CPU_LEVEL1_DCACHE_LINESIZE == 0
|
2016-04-01 02:31:53 +02:00
|
|
|
#undef CPU_LEVEL1_DCACHE_LINESIZE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__s390__)
|
|
|
|
#define CPU_LEVEL1_DCACHE_LINESIZE 256
|
|
|
|
#elif defined(__powerpc__) || defined(__aarch64__)
|
|
|
|
#define CPU_LEVEL1_DCACHE_LINESIZE 128
|
|
|
|
#else
|
|
|
|
#define CPU_LEVEL1_DCACHE_LINESIZE 64
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2016-08-19 22:03:05 +02:00
|
|
|
#define FLOATING_POINT_DECIMALS 31
|
|
|
|
|
|
|
|
/* Keep client compatible with earlier versions */
|
|
|
|
#ifdef MYSQL_SERVER
|
|
|
|
#define NOT_FIXED_DEC DECIMAL_NOT_SPECIFIED
|
|
|
|
#else
|
|
|
|
#define NOT_FIXED_DEC FLOATING_POINT_DECIMALS
|
|
|
|
#endif
|
2002-11-07 02:54:00 +01:00
|
|
|
#endif /* my_global_h */
|