Commit ea57b3d4 authored by unknown's avatar unknown

Merge gbichot3.local:/home/mysql_src/mysql-5.1-for-maria

into  gbichot3.local:/home/mysql_src/mysql-maria


BitKeeper/etc/ignore:
  auto-union
BUILD/SETUP.sh:
  Auto merged
client/mysqldump.c:
  Auto merged
config/ac-macros/plugins.m4:
  Auto merged
configure.in:
  Auto merged
include/Makefile.am:
  Auto merged
include/atomic/nolock.h:
  Auto merged
include/atomic/rwlock.h:
  Auto merged
include/atomic/x86-gcc.h:
  Auto merged
include/atomic/x86-msvc.h:
  Auto merged
include/ft_global.h:
  Auto merged
include/keycache.h:
  Auto merged
include/m_string.h:
  Auto merged
include/my_atomic.h:
  Auto merged
include/my_base.h:
  Auto merged
include/my_dbug.h:
  Auto merged
include/my_global.h:
  Auto merged
include/my_handler.h:
  Auto merged
include/my_sys.h:
  Auto merged
include/myisam.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/events_logs_tests.result:
  Auto merged
mysql-test/t/events_logs_tests.test:
  Auto merged
mysys/Makefile.am:
  Auto merged
mysys/array.c:
  Auto merged
mysys/mf_keycache.c:
  Auto merged
mysys/mf_keycaches.c:
  Auto merged
mysys/my_atomic.c:
  Auto merged
mysys/my_bit.c:
  Auto merged
mysys/my_bitmap.c:
  Auto merged
mysys/my_create.c:
  Auto merged
mysys/my_delete.c:
  Auto merged
mysys/my_getsystime.c:
  Auto merged
mysys/my_handler.c:
  Auto merged
mysys/my_init.c:
  Auto merged
mysys/my_open.c:
  Auto merged
mysys/my_pread.c:
  Auto merged
mysys/my_rename.c:
  Auto merged
mysys/my_symlink.c:
  Auto merged
mysys/my_sync.c:
  Auto merged
plugin/daemon_example/daemon_example.cc:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/gen_lex_hash.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_sort.h:
  Auto merged
sql/sql_test.cc:
  Auto merged
sql/uniques.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
storage/Makefile.am:
  Auto merged
storage/csv/ha_tina.cc:
  Auto merged
storage/myisam/Makefile.am:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/ft_parser.c:
  Auto merged
storage/myisam/ft_static.c:
  Auto merged
storage/myisam/ft_stopwords.c:
  Auto merged
storage/myisam/ft_update.c:
  Auto merged
storage/myisam/fulltext.h:
  Auto merged
storage/myisam/ha_myisam.h:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_create.c:
  Auto merged
storage/myisam/mi_delete.c:
  Auto merged
storage/myisam/mi_delete_all.c:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
storage/myisam/mi_key.c:
  Auto merged
storage/myisam/mi_log.c:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisam/mi_packrec.c:
  Auto merged
storage/myisam/mi_range.c:
  Auto merged
storage/myisam/mi_rsamepos.c:
  Auto merged
storage/myisam/mi_search.c:
  Auto merged
storage/myisam/mi_test1.c:
  Auto merged
storage/myisam/mi_test2.c:
  Auto merged
storage/myisam/mi_unique.c:
  Auto merged
storage/myisam/mi_update.c:
  Auto merged
storage/myisam/mi_write.c:
  Auto merged
storage/myisam/myisamchk.c:
  Auto merged
storage/myisam/myisamlog.c:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
storage/myisam/rt_index.c:
  Auto merged
storage/myisam/sort.c:
  Auto merged
storage/myisammrg/ha_myisammrg.h:
  Auto merged
unittest/mytap/tap.c:
  Auto merged
mysql-test/r/view.result:
  manual merge
mysql-test/t/view.test:
  manual merge
Makefile.am:
  manual merge
mysql-test/t/disabled.def:
  manual merge
sql/mysqld.cc:
  manual merge
sql/set_var.cc:
  manual merge
sql/udf_example.c:
  manual merge
storage/myisam/ha_myisam.cc:
  manual merge
storage/myisam/myisamdef.h:
  manual merge
storage/ndb/src/mgmapi/mgmapi.cpp:
  manual merge
unittest/Makefile.am:
  manual merge
unittest/mysys/Makefile.am:
  manual merge
unittest/mysys/my_atomic-t.c:
  manual merge
parents ae72e394 fdf847fb
*-t *-t
*.Plo *.Plo
*.Po *.Po
*.Tpo
*.a *.a
*.bb *.bb
*.bbg *.bbg
...@@ -1058,6 +1059,7 @@ libmysqld/ha_innobase.cc ...@@ -1058,6 +1059,7 @@ libmysqld/ha_innobase.cc
libmysqld/ha_innodb.cc libmysqld/ha_innodb.cc
libmysqld/ha_isam.cc libmysqld/ha_isam.cc
libmysqld/ha_isammrg.cc libmysqld/ha_isammrg.cc
libmysqld/ha_maria.cc
libmysqld/ha_myisam.cc libmysqld/ha_myisam.cc
libmysqld/ha_myisammrg.cc libmysqld/ha_myisammrg.cc
libmysqld/ha_ndbcluster.cc libmysqld/ha_ndbcluster.cc
...@@ -2385,6 +2387,20 @@ storage/innobase/ut/.deps/ut0rnd.Po ...@@ -2385,6 +2387,20 @@ storage/innobase/ut/.deps/ut0rnd.Po
storage/innobase/ut/.deps/ut0ut.Po storage/innobase/ut/.deps/ut0ut.Po
storage/innobase/ut/.deps/ut0vec.Po storage/innobase/ut/.deps/ut0vec.Po
storage/innobase/ut/.deps/ut0wqueue.Po storage/innobase/ut/.deps/ut0wqueue.Po
storage/maria/*.MAD
storage/maria/*.MAI
storage/maria/ma_rt_test
storage/maria/ma_sp_test
storage/maria/ma_test1
storage/maria/ma_test2
storage/maria/ma_test3
storage/maria/ma_test_all
storage/maria/maria.log
storage/maria/maria_chk
storage/maria/maria_ftdump
storage/maria/maria_log
storage/maria/maria_pack
storage/maria/unittest/maria_control
storage/myisam/.deps/ft_boolean_search.Po storage/myisam/.deps/ft_boolean_search.Po
storage/myisam/.deps/ft_nlq_search.Po storage/myisam/.deps/ft_nlq_search.Po
storage/myisam/.deps/ft_parser.Po storage/myisam/.deps/ft_parser.Po
...@@ -2922,13 +2938,25 @@ unittest/examples/.deps/simple-t.Po ...@@ -2922,13 +2938,25 @@ unittest/examples/.deps/simple-t.Po
unittest/examples/.deps/skip-t.Po unittest/examples/.deps/skip-t.Po
unittest/examples/.deps/skip_all-t.Po unittest/examples/.deps/skip_all-t.Po
unittest/examples/.deps/todo-t.Po unittest/examples/.deps/todo-t.Po
unittest/maria_control
unittest/mysys/*.t unittest/mysys/*.t
unittest/mysys/.deps/base64-t.Po unittest/mysys/.deps/base64-t.Po
unittest/mysys/.deps/bitmap-t.Po unittest/mysys/.deps/bitmap-t.Po
unittest/mysys/.deps/my_atomic-t.Po unittest/mysys/.deps/my_atomic-t.Po
unittest/mysys/mf_pagecache_consist_1k-t-big
unittest/mysys/mf_pagecache_consist_1kHC-t-big
unittest/mysys/mf_pagecache_consist_1kRD-t-big
unittest/mysys/mf_pagecache_consist_1kWR-t-big
unittest/mysys/mf_pagecache_consist_64k-t-big
unittest/mysys/mf_pagecache_consist_64kHC-t-big
unittest/mysys/mf_pagecache_consist_64kRD-t-big
unittest/mysys/mf_pagecache_consist_64kWR-t-big
unittest/mysys/mf_pagecache_single_64k-t-big
unittest/mytap/.deps/tap.Po unittest/mytap/.deps/tap.Po
unittest/mytap/t/*.t unittest/mytap/t/*.t
unittest/mytap/t/.deps/basic-t.Po unittest/mytap/t/.deps/basic-t.Po
unittest/page_cache_test_file_1
unittest/pagecache_debug.log
unittest/unit unittest/unit
vi.h vi.h
vio/*.ds? vio/*.ds?
......
...@@ -121,8 +121,9 @@ valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify " ...@@ -121,8 +121,9 @@ valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify "
valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
# #
# Used in -debug builds # Used in -debug builds
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS " debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS"
debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX" debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX"
debug_cflags="$debug_cflags -DMY_LF_EXTRA_DEBUG"
error_inject="--with-error-inject " error_inject="--with-error-inject "
# #
# Base C++ flags for all builds # Base C++ flags for all builds
...@@ -154,8 +155,6 @@ then ...@@ -154,8 +155,6 @@ then
base_configs="$base_configs --with-libedit" base_configs="$base_configs --with-libedit"
fi fi
static_link="--with-mysqld-ldflags=-all-static "
static_link="$static_link --with-client-ldflags=-all-static"
# we need local-infile in all binaries for rpl000001 # we need local-infile in all binaries for rpl000001
# if you need to disable local-infile in the client, write a build script # if you need to disable local-infile in the client, write a build script
# and unset local_infile_configs # and unset local_infile_configs
......
...@@ -5,7 +5,7 @@ FROM=$USER@mysql.com ...@@ -5,7 +5,7 @@ FROM=$USER@mysql.com
COMMITS=commits@lists.mysql.com COMMITS=commits@lists.mysql.com
DOCS=docs-commit@mysql.com DOCS=docs-commit@mysql.com
LIMIT=10000 LIMIT=10000
VERSION="5.1" VERSION="maria"
BKROOT=`bk root` BKROOT=`bk root`
if [ -x /usr/sbin/sendmail ]; then if [ -x /usr/sbin/sendmail ]; then
...@@ -76,55 +76,6 @@ EOF ...@@ -76,55 +76,6 @@ EOF
) > $BKROOT/BitKeeper/tmp/dev_public.txt ) > $BKROOT/BitKeeper/tmp/dev_public.txt
$SENDMAIL -t < $BKROOT/BitKeeper/tmp/dev_public.txt $SENDMAIL -t < $BKROOT/BitKeeper/tmp/dev_public.txt
#++
# commits@ mail
#--
echo "Notifying commits list at $COMMITS"
(
cat <<EOF
List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $COMMITS
Subject: bk commit into $VERSION tree ($CHANGESET)$BS
X-CSetKey: <$CSETKEY>
$BH
Below is the list of changes that have just been committed into a local
$VERSION repository of $USER. When $USER does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
EOF
bk changes -v -r+
bk cset -r+ -d
) | bk sed -e ${LIMIT}q > $BKROOT/BitKeeper/tmp/commits.txt
$SENDMAIL -t < $BKROOT/BitKeeper/tmp/commits.txt
#++
# docs-commit@ mail
# Picks up anything under the Docs subdirectory (relevant for docs team).
#--
bk changes -v -r+ | grep -q " Docs/"
if [ $? -eq 0 ]
then
echo "Notifying docs list at $DOCS"
(
cat <<EOF
List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $DOCS
Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)$BS
EOF
bk changes -v -r+
bk cset -r+ -d
) > $BKROOT/BitKeeper/tmp/docs.txt
$SENDMAIL -t < $BKROOT/BitKeeper/tmp/docs.txt
fi
else else
echo "commit failed because '$BK_STATUS', you may need to re-clone..." echo "commit failed because '$BK_STATUS', you may need to re-clone..."
fi fi
...@@ -130,7 +130,7 @@ test-binlog-statement: ...@@ -130,7 +130,7 @@ test-binlog-statement:
cd mysql-test ; \ cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=statement @PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=statement
test: test-unit test-ns test-pr test: test-ns test-pr
test-full: test test-nr test-ps test-full: test test-nr test-ps
......
...@@ -2298,9 +2298,9 @@ AC_ARG_WITH(man, ...@@ -2298,9 +2298,9 @@ AC_ARG_WITH(man,
if test "$with_man" = "yes" if test "$with_man" = "yes"
then then
man_dirs="man" man_dirs="man"
man1_files=`ls -1 $srcdir/man/*.1 | sed -e 's;^.*man/;;'` man1_files=`ls -1 $srcdir/man/*.1 2>/dev/null| sed -e 's;^.*man/;;'`
man1_files=`echo $man1_files` man1_files=`echo $man1_files`
man8_files=`ls -1 $srcdir/man/*.8 | sed -e 's;^.*man/;;'` man8_files=`ls -1 $srcdir/man/*.8 2>/dev/null| sed -e 's;^.*man/;;'`
man8_files=`echo $man8_files` man8_files=`echo $man8_files`
else else
man_dirs="" man_dirs=""
...@@ -2436,7 +2436,6 @@ AC_SUBST(readline_basedir) ...@@ -2436,7 +2436,6 @@ AC_SUBST(readline_basedir)
AC_SUBST(readline_link) AC_SUBST(readline_link)
AC_SUBST(readline_h_ln_cmd) AC_SUBST(readline_h_ln_cmd)
# If we have threads generate some library functions and test programs # If we have threads generate some library functions and test programs
sql_server_dirs= sql_server_dirs=
sql_server= sql_server=
......
...@@ -27,8 +27,8 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \ ...@@ -27,8 +27,8 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
my_getopt.h sslopt-longopts.h my_dir.h \ my_getopt.h sslopt-longopts.h my_dir.h \
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
m_ctype.h mysql/plugin.h $(HEADERS_GEN) m_ctype.h mysql/plugin.h $(HEADERS_GEN)
noinst_HEADERS = config-win.h config-netware.h \ noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \
heap.h my_bitmap.h my_uctype.h \ heap.h maria.h myisamchk.h my_bitmap.h my_uctype.h \
myisam.h myisampack.h myisammrg.h ft_global.h\ myisam.h myisampack.h myisammrg.h ft_global.h\
mysys_err.h my_base.h help_start.h help_end.h \ mysys_err.h my_base.h help_start.h help_end.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
...@@ -37,7 +37,7 @@ noinst_HEADERS = config-win.h config-netware.h \ ...@@ -37,7 +37,7 @@ noinst_HEADERS = config-win.h config-netware.h \
mysql_version.h.in my_handler.h my_time.h decimal.h \ mysql_version.h.in my_handler.h my_time.h decimal.h \
my_vle.h my_user.h my_atomic.h atomic/nolock.h \ my_vle.h my_user.h my_atomic.h atomic/nolock.h \
atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \ atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \
my_libwrap.h my_libwrap.h pagecache.h
# Remove built files and the symlinked directories # Remove built files and the symlinked directories
CLEANFILES = $(BUILT_SOURCES) readline openssl CLEANFILES = $(BUILT_SOURCES) readline openssl
......
...@@ -13,24 +13,25 @@ ...@@ -13,24 +13,25 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#if defined(__i386__) || defined(_M_IX86) #if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)
#ifdef MY_ATOMIC_MODE_DUMMY # ifdef MY_ATOMIC_MODE_DUMMY
# define LOCK "" # define LOCK_prefix ""
#else # else
# define LOCK "lock" # define LOCK_prefix "lock"
#endif # endif
#ifdef __GNUC__ # ifdef __GNUC__
#include "x86-gcc.h" # include "x86-gcc.h"
#elif defined(_MSC_VER) # elif defined(_MSC_VER)
#include "x86-msvc.h" # error Broken!
#endif # include "x86-msvc.h"
# endif
#endif #endif
#ifdef make_atomic_cas_body #ifdef make_atomic_cas_body
typedef struct { } my_atomic_rwlock_t; typedef struct { } my_atomic_rwlock_t __attribute__ ((unused));
#define my_atomic_rwlock_destroy(name) #define my_atomic_rwlock_destroy(name)
#define my_atomic_rwlock_init(name) #define my_atomic_rwlock_init(name)
#define my_atomic_rwlock_rdlock(name) #define my_atomic_rwlock_rdlock(name)
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
typedef struct {pthread_rwlock_t rw;} my_atomic_rwlock_t; typedef struct {pthread_mutex_t rw;} my_atomic_rwlock_t;
#ifdef MY_ATOMIC_MODE_DUMMY #ifdef MY_ATOMIC_MODE_DUMMY
/* /*
...@@ -31,17 +31,22 @@ typedef struct {pthread_rwlock_t rw;} my_atomic_rwlock_t; ...@@ -31,17 +31,22 @@ typedef struct {pthread_rwlock_t rw;} my_atomic_rwlock_t;
#define my_atomic_rwlock_wrunlock(name) #define my_atomic_rwlock_wrunlock(name)
#define MY_ATOMIC_MODE "dummy (non-atomic)" #define MY_ATOMIC_MODE "dummy (non-atomic)"
#else #else
#define my_atomic_rwlock_destroy(name) pthread_rwlock_destroy(& (name)->rw) /*
#define my_atomic_rwlock_init(name) pthread_rwlock_init(& (name)->rw, 0) we're using read-write lock macros but map them to mutex locks, and they're
#define my_atomic_rwlock_rdlock(name) pthread_rwlock_rdlock(& (name)->rw) faster. Still, having semantically rich API we can change the
#define my_atomic_rwlock_wrlock(name) pthread_rwlock_wrlock(& (name)->rw) underlying implementation, if necessary.
#define my_atomic_rwlock_rdunlock(name) pthread_rwlock_unlock(& (name)->rw) */
#define my_atomic_rwlock_wrunlock(name) pthread_rwlock_unlock(& (name)->rw) #define my_atomic_rwlock_destroy(name) pthread_mutex_destroy(& (name)->rw)
#define MY_ATOMIC_MODE "rwlocks" #define my_atomic_rwlock_init(name) pthread_mutex_init(& (name)->rw, 0)
#define my_atomic_rwlock_rdlock(name) pthread_mutex_lock(& (name)->rw)
#define my_atomic_rwlock_wrlock(name) pthread_mutex_lock(& (name)->rw)
#define my_atomic_rwlock_rdunlock(name) pthread_mutex_unlock(& (name)->rw)
#define my_atomic_rwlock_wrunlock(name) pthread_mutex_unlock(& (name)->rw)
#define MY_ATOMIC_MODE "mutex"
#endif #endif
#define make_atomic_add_body(S) int ## S sav; sav= *a; *a+= v; v=sav; #define make_atomic_add_body(S) int ## S sav; sav= *a; *a+= v; v=sav;
#define make_atomic_swap_body(S) int ## S sav; sav= *a; *a= v; v=sav; #define make_atomic_fas_body(S) int ## S sav; sav= *a; *a= v; v=sav;
#define make_atomic_cas_body(S) if ((ret= (*a == *cmp))) *a= set; else *cmp=*a; #define make_atomic_cas_body(S) if ((ret= (*a == *cmp))) *a= set; else *cmp=*a;
#define make_atomic_load_body(S) ret= *a; #define make_atomic_load_body(S) ret= *a;
#define make_atomic_store_body(S) *a= v; #define make_atomic_store_body(S) *a= v;
......
...@@ -19,10 +19,18 @@ ...@@ -19,10 +19,18 @@
architectures support double-word (128-bit) cas. architectures support double-word (128-bit) cas.
*/ */
#ifdef MY_ATOMIC_NO_XADD #ifdef __x86_64__
#define MY_ATOMIC_MODE "gcc-x86" LOCK "-no-xadd" # ifdef MY_ATOMIC_NO_XADD
# define MY_ATOMIC_MODE "gcc-amd64" LOCK_prefix "-no-xadd"
# else
# define MY_ATOMIC_MODE "gcc-amd64" LOCK_prefix
# endif
#else #else
#define MY_ATOMIC_MODE "gcc-x86" LOCK # ifdef MY_ATOMIC_NO_XADD
# define MY_ATOMIC_MODE "gcc-x86" LOCK_prefix "-no-xadd"
# else
# define MY_ATOMIC_MODE "gcc-x86" LOCK_prefix
# endif
#endif #endif
/* fix -ansi errors while maintaining readability */ /* fix -ansi errors while maintaining readability */
...@@ -32,12 +40,12 @@ ...@@ -32,12 +40,12 @@
#ifndef MY_ATOMIC_NO_XADD #ifndef MY_ATOMIC_NO_XADD
#define make_atomic_add_body(S) \ #define make_atomic_add_body(S) \
asm volatile (LOCK "; xadd %0, %1;" : "+r" (v) , "+m" (*a)) asm volatile (LOCK_prefix "; xadd %0, %1;" : "+r" (v) , "+m" (*a))
#endif #endif
#define make_atomic_swap_body(S) \ #define make_atomic_fas_body(S) \
asm volatile ("; xchg %0, %1;" : "+r" (v) , "+m" (*a)) asm volatile ("xchg %0, %1;" : "+r" (v) , "+m" (*a))
#define make_atomic_cas_body(S) \ #define make_atomic_cas_body(S) \
asm volatile (LOCK "; cmpxchg %3, %0; setz %2;" \ asm volatile (LOCK_prefix "; cmpxchg %3, %0; setz %2;" \
: "+m" (*a), "+a" (*cmp), "=q" (ret): "r" (set)) : "+m" (*a), "+a" (*cmp), "=q" (ret): "r" (set))
#ifdef MY_ATOMIC_MODE_DUMMY #ifdef MY_ATOMIC_MODE_DUMMY
...@@ -46,13 +54,16 @@ ...@@ -46,13 +54,16 @@
#else #else
/* /*
Actually 32-bit reads/writes are always atomic on x86 Actually 32-bit reads/writes are always atomic on x86
But we add LOCK here anyway to force memory barriers But we add LOCK_prefix here anyway to force memory barriers
*/ */
#define make_atomic_load_body(S) \ #define make_atomic_load_body(S) \
ret=0; \ ret=0; \
asm volatile (LOCK "; cmpxchg %2, %0" \ asm volatile (LOCK_prefix "; cmpxchg %2, %0" \
: "+m" (*a), "+a" (ret): "r" (ret)) : "+m" (*a), "+a" (ret): "r" (ret))
#define make_atomic_store_body(S) \ #define make_atomic_store_body(S) \
asm volatile ("; xchg %0, %1;" : "+m" (*a) : "r" (v)) asm volatile ("; xchg %0, %1;" : "+m" (*a), "+r" (v))
#endif #endif
/* TODO test on intel whether the below helps. on AMD it makes no difference */
//#define LF_BACKOFF ({asm volatile ("rep; nop"); 1; })
...@@ -25,24 +25,24 @@ ...@@ -25,24 +25,24 @@
#ifndef _atomic_h_cleanup_ #ifndef _atomic_h_cleanup_
#define _atomic_h_cleanup_ "atomic/x86-msvc.h" #define _atomic_h_cleanup_ "atomic/x86-msvc.h"
#define MY_ATOMIC_MODE "msvc-x86" LOCK #define MY_ATOMIC_MODE "msvc-x86" LOCK_prefix
#define make_atomic_add_body(S) \ #define make_atomic_add_body(S) \
_asm { \ _asm { \
_asm mov reg_ ## S, v \ _asm mov reg_ ## S, v \
_asm LOCK xadd *a, reg_ ## S \ _asm LOCK_prefix xadd *a, reg_ ## S \
_asm movzx v, reg_ ## S \ _asm movzx v, reg_ ## S \
} }
#define make_atomic_cas_body(S) \ #define make_atomic_cas_body(S) \
_asm { \ _asm { \
_asm mov areg_ ## S, *cmp \ _asm mov areg_ ## S, *cmp \
_asm mov reg2_ ## S, set \ _asm mov reg2_ ## S, set \
_asm LOCK cmpxchg *a, reg2_ ## S \ _asm LOCK_prefix cmpxchg *a, reg2_ ## S \
_asm mov *cmp, areg_ ## S \ _asm mov *cmp, areg_ ## S \
_asm setz al \ _asm setz al \
_asm movzx ret, al \ _asm movzx ret, al \
} }
#define make_atomic_swap_body(S) \ #define make_atomic_fas_body(S) \
_asm { \ _asm { \
_asm mov reg_ ## S, v \ _asm mov reg_ ## S, v \
_asm xchg *a, reg_ ## S \ _asm xchg *a, reg_ ## S \
...@@ -55,13 +55,13 @@ ...@@ -55,13 +55,13 @@
#else #else
/* /*
Actually 32-bit reads/writes are always atomic on x86 Actually 32-bit reads/writes are always atomic on x86
But we add LOCK here anyway to force memory barriers But we add LOCK_prefix here anyway to force memory barriers
*/ */
#define make_atomic_load_body(S) \ #define make_atomic_load_body(S) \
_asm { \ _asm { \
_asm mov areg_ ## S, 0 \ _asm mov areg_ ## S, 0 \
_asm mov reg2_ ## S, areg_ ## S \ _asm mov reg2_ ## S, areg_ ## S \
_asm LOCK cmpxchg *a, reg2_ ## S \ _asm LOCK_prefix cmpxchg *a, reg2_ ## S \
_asm mov ret, areg_ ## S \ _asm mov ret, areg_ ## S \
} }
#define make_atomic_store_body(S) \ #define make_atomic_store_body(S) \
......
...@@ -65,6 +65,17 @@ void ft_free_stopwords(void); ...@@ -65,6 +65,17 @@ void ft_free_stopwords(void);
FT_INFO *ft_init_search(uint,void *, uint, byte *, uint,CHARSET_INFO *, byte *); FT_INFO *ft_init_search(uint,void *, uint, byte *, uint,CHARSET_INFO *, byte *);
my_bool ft_boolean_check_syntax_string(const byte *); my_bool ft_boolean_check_syntax_string(const byte *);
/* Internal symbols for fulltext between maria and MyISAM */
#define HA_FT_WTYPE HA_KEYTYPE_FLOAT
#define HA_FT_WLEN 4
#define FT_SEGS 2
#define ft_sintXkorr(A) mi_sint4korr(A)
#define ft_intXstore(T,A) mi_int4store(T,A)
extern const HA_KEYSEG ft_keysegs[FT_SEGS];
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -127,7 +127,8 @@ extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup); ...@@ -127,7 +127,8 @@ extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup);
/* Functions to handle multiple key caches */ /* Functions to handle multiple key caches */
extern my_bool multi_keycache_init(void); extern my_bool multi_keycache_init(void);
extern void multi_keycache_free(void); extern void multi_keycache_free(void);
extern KEY_CACHE *multi_key_cache_search(byte *key, uint length); extern KEY_CACHE *multi_key_cache_search(byte *key, uint length,
KEY_CACHE *def);
extern my_bool multi_key_cache_set(const byte *key, uint length, extern my_bool multi_key_cache_set(const byte *key, uint length,
KEY_CACHE *key_cache); KEY_CACHE *key_cache);
extern void multi_key_cache_change(KEY_CACHE *old_data, extern void multi_key_cache_change(KEY_CACHE *old_data,
......
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef _lf_h
#define _lf_h
#include <my_atomic.h>
/*
Helpers to define both func() and _func(), where
func() is a _func() protected by my_atomic_rwlock_wrlock()
*/
#define lock_wrap(f, t, proto_args, args, lock) \
t _ ## f proto_args; \
static inline t f proto_args \
{ \
t ret; \
my_atomic_rwlock_wrlock(lock); \
ret= _ ## f args; \
my_atomic_rwlock_wrunlock(lock); \
return ret; \
}
#define lock_wrap_void(f, proto_args, args, lock) \
void _ ## f proto_args; \
static inline void f proto_args \
{ \
my_atomic_rwlock_wrlock(lock); \
_ ## f args; \
my_atomic_rwlock_wrunlock(lock); \
}
#define nolock_wrap(f, t, proto_args, args) \
t _ ## f proto_args; \
static inline t f proto_args \
{ \
return _ ## f args; \
}
#define nolock_wrap_void(f, proto_args, args) \
void _ ## f proto_args; \
static inline void f proto_args \
{ \
_ ## f args; \
}
/*
wait-free dynamic array, see lf_dynarray.c
4 levels of 256 elements each mean 4311810304 elements in an array - it
should be enough for a while
*/
#define LF_DYNARRAY_LEVEL_LENGTH 256
#define LF_DYNARRAY_LEVELS 4
typedef struct {
void * volatile level[LF_DYNARRAY_LEVELS];
uint size_of_element;
my_atomic_rwlock_t lock;
} LF_DYNARRAY;
typedef int (*lf_dynarray_func)(void *, void *);
void lf_dynarray_init(LF_DYNARRAY *array, uint element_size);
void lf_dynarray_destroy(LF_DYNARRAY *array);
nolock_wrap(lf_dynarray_value, void *,
(LF_DYNARRAY *array, uint idx),
(array, idx))
lock_wrap(lf_dynarray_lvalue, void *,
(LF_DYNARRAY *array, uint idx),
(array, idx),
&array->lock)
nolock_wrap(lf_dynarray_iterate, int,
(LF_DYNARRAY *array, lf_dynarray_func func, void *arg),
(array, func, arg))
/*
pin manager for memory allocator, lf_alloc-pin.c
*/
#define LF_PINBOX_PINS 4
#define LF_PURGATORY_SIZE 10
typedef void lf_pinbox_free_func(void *, void *);
typedef struct {
LF_DYNARRAY pinstack;
lf_pinbox_free_func *free_func;
void *free_func_arg;
uint free_ptr_offset;
uint32 volatile pinstack_top_ver; /* this is a versioned pointer */
uint32 volatile pins_in_stack; /* number of elements in array */
} LF_PINBOX;
typedef struct {
void * volatile pin[LF_PINBOX_PINS];
LF_PINBOX *pinbox;
void *purgatory;
uint32 purgatory_count;
uint32 volatile link;
/* we want sizeof(LF_PINS) to be 128 to avoid false sharing */
char pad[128-sizeof(uint32)*2
-sizeof(LF_PINBOX *)
-sizeof(void *)*(LF_PINBOX_PINS+1)];
} LF_PINS;
/*
shortcut macros to do an atomic_wrlock on a structure that uses pins
(e.g. lf_hash).
*/
#define lf_rwlock_by_pins(PINS) \
my_atomic_rwlock_wrlock(&(PINS)->pinbox->pinstack.lock)
#define lf_rwunlock_by_pins(PINS) \
my_atomic_rwlock_wrunlock(&(PINS)->pinbox->pinstack.lock)
/*
compile-time assert, to require "no less than N" pins
it's enough if it'll fail on at least one compiler, so
we'll enable it on GCC only, which supports zero-length arrays.
*/
#if defined(__GNUC__) && defined(MY_LF_EXTRA_DEBUG)
#define LF_REQUIRE_PINS(N) \
static const char require_pins[LF_PINBOX_PINS-N] __attribute__ ((unused)); \
static const int LF_NUM_PINS_IN_THIS_FILE= N
#define _lf_pin(PINS, PIN, ADDR) \
( \
assert(PIN < LF_NUM_PINS_IN_THIS_FILE), \
my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR)) \
)
#else
#define LF_REQUIRE_PINS(N)
#define _lf_pin(PINS, PIN, ADDR) my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR))
#endif
#define _lf_unpin(PINS, PIN) _lf_pin(PINS, PIN, NULL)
#define lf_pin(PINS, PIN, ADDR) \
do { \
lf_rwlock_by_pins(PINS); \
_lf_pin(PINS, PIN, ADDR); \
lf_rwunlock_by_pins(PINS); \
} while (0)
#define lf_unpin(PINS, PIN) lf_pin(PINS, PIN, NULL)
#define _lf_assert_pin(PINS, PIN) assert((PINS)->pin[PIN] != 0)
#define _lf_assert_unpin(PINS, PIN) assert((PINS)->pin[PIN] == 0)
void lf_pinbox_init(LF_PINBOX *pinbox, uint free_ptr_offset,
lf_pinbox_free_func *free_func, void * free_func_arg);
void lf_pinbox_destroy(LF_PINBOX *pinbox);
lock_wrap(lf_pinbox_get_pins, LF_PINS *,
(LF_PINBOX *pinbox),
(pinbox),
&pinbox->pinstack.lock)
lock_wrap_void(lf_pinbox_put_pins,
(LF_PINS *pins),
(pins),
&pins->pinbox->pinstack.lock)
lock_wrap_void(lf_pinbox_free,
(LF_PINS *pins, void *addr),
(pins, addr),
&pins->pinbox->pinstack.lock)
/*
memory allocator, lf_alloc-pin.c
*/
struct st_lf_alloc_node {
struct st_lf_alloc_node *next;
};
typedef struct st_lf_allocator {
LF_PINBOX pinbox;
struct st_lf_alloc_node * volatile top;
uint element_size;
uint32 volatile mallocs;
} LF_ALLOCATOR;
void lf_alloc_init(LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset);
void lf_alloc_destroy(LF_ALLOCATOR *allocator);
uint lf_alloc_in_pool(LF_ALLOCATOR *allocator);
/*
shortcut macros to access underlying pinbox functions from an LF_ALLOCATOR
see _lf_pinbox_get_pins() and _lf_pinbox_put_pins()
*/
#define _lf_alloc_free(PINS, PTR) _lf_pinbox_free((PINS), (PTR))
#define lf_alloc_free(PINS, PTR) lf_pinbox_free((PINS), (PTR))
#define _lf_alloc_get_pins(ALLOC) _lf_pinbox_get_pins(&(ALLOC)->pinbox)
#define lf_alloc_get_pins(ALLOC) lf_pinbox_get_pins(&(ALLOC)->pinbox)
#define _lf_alloc_put_pins(PINS) _lf_pinbox_put_pins(PINS)
#define lf_alloc_put_pins(PINS) lf_pinbox_put_pins(PINS)
#define lf_alloc_real_free(ALLOC, ADDR) my_free((gptr)(ADDR), MYF(0))
lock_wrap(lf_alloc_new, void *,
(LF_PINS *pins),
(pins),
&pins->pinbox->pinstack.lock)
/*
extendible hash, lf_hash.c
*/
#include <hash.h>
#define LF_HASH_UNIQUE 1
typedef struct {
LF_DYNARRAY array; /* hash itself */
LF_ALLOCATOR alloc; /* allocator for elements */
hash_get_key get_key; /* see HASH */
CHARSET_INFO *charset; /* see HASH */
uint key_offset, key_length; /* see HASH */
uint element_size, flags; /* LF_HASH_UNIQUE, etc */
int32 volatile size; /* size of array */
int32 volatile count; /* number of elements in the hash */
} LF_HASH;
void lf_hash_init(LF_HASH *hash, uint element_size, uint flags,
uint key_offset, uint key_length, hash_get_key get_key,
CHARSET_INFO *charset);
void lf_hash_destroy(LF_HASH *hash);
int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data);
void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen);
int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen);
/*
shortcut macros to access underlying pinbox functions from an LF_HASH
see _lf_pinbox_get_pins() and _lf_pinbox_put_pins()
*/
#define _lf_hash_get_pins(HASH) _lf_alloc_get_pins(&(HASH)->alloc)
#define lf_hash_get_pins(HASH) lf_alloc_get_pins(&(HASH)->alloc)
#define _lf_hash_put_pins(PINS) _lf_pinbox_put_pins(PINS)
#define lf_hash_put_pins(PINS) lf_pinbox_put_pins(PINS)
/*
cleanup
*/
#undef lock_wrap_void
#undef lock_wrap
#undef nolock_wrap_void
#undef nolock_wrap
#endif
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
# define bcopy(s, d, n) memcpy((d), (s), (n)) # define bcopy(s, d, n) memcpy((d), (s), (n))
# define bcmp(A,B,C) memcmp((A),(B),(C)) # define bcmp(A,B,C) memcmp((A),(B),(C))
# define bzero(A,B) memset((A),0,(B)) # define bzero(A,B) memset((A),0,(B))
# define bmove_align(A,B,C) memcpy((A),(B),(C)) # define bmove_align(A,B,C) memcpy((A),(B),(C))
#endif #endif
#if defined(__cplusplus) #if defined(__cplusplus)
...@@ -126,7 +126,10 @@ extern int bcmp(const char *s1,const char *s2,uint len); ...@@ -126,7 +126,10 @@ extern int bcmp(const char *s1,const char *s2,uint len);
extern int my_bcmp(const char *s1,const char *s2,uint len); extern int my_bcmp(const char *s1,const char *s2,uint len);
#undef bcmp #undef bcmp
#define bcmp(A,B,C) my_bcmp((A),(B),(C)) #define bcmp(A,B,C) my_bcmp((A),(B),(C))
#endif #define bzero_if_purify(A,B) bzero(A,B)
#else
#define bzero_if_purify(A,B)
#endif /* HAVE_purify */
#ifndef bmove512 #ifndef bmove512
extern void bmove512(gptr dst,const gptr src,uint len); extern void bmove512(gptr dst,const gptr src,uint len);
......
This diff is collapsed.
...@@ -13,6 +13,40 @@ ...@@ -13,6 +13,40 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
This header defines five atomic operations:
my_atomic_add#(&var, what)
add 'what' to *var, and return the old value of *var
my_atomic_fas#(&var, what)
'Fetch And Store'
store 'what' in *var, and return the old value of *var
my_atomic_cas#(&var, &old, new)
'Compare And Swap'
if *var is equal to *old, then store 'new' in *var, and return TRUE
otherwise store *var in *old, and return FALSE
my_atomic_load#(&var)
return *var
my_atomic_store#(&var, what)
store 'what' in *var
'#' is substituted by a size suffix - 8, 16, 32, or ptr
(e.g. my_atomic_add8, my_atomic_fas32, my_atomic_casptr).
NOTE This operations are not always atomic, so they always must be
enclosed in my_atomic_rwlock_rdlock(lock)/my_atomic_rwlock_rdunlock(lock)
or my_atomic_rwlock_wrlock(lock)/my_atomic_rwlock_wrunlock(lock).
Hint: if a code block makes intensive use of atomic ops, it make sense
to take/release rwlock once for the whole block, not for every statement.
On architectures where these operations are really atomic, rwlocks will
be optimized away.
*/
#ifndef my_atomic_rwlock_init #ifndef my_atomic_rwlock_init
#define intptr void * #define intptr void *
...@@ -26,70 +60,115 @@ ...@@ -26,70 +60,115 @@
#endif #endif
#ifndef make_atomic_add_body #ifndef make_atomic_add_body
#define make_atomic_add_body(S) \ #define make_atomic_add_body(S) \
int ## S tmp=*a; \ int ## S tmp=*a; \
while (!my_atomic_cas ## S(a, &tmp, tmp+v)); \ while (!my_atomic_cas ## S(a, &tmp, tmp+v)); \
v=tmp; v=tmp;
#endif #endif
#ifdef __GNUC__
/*
we want to be able to use my_atomic_xxx functions with
both signed and unsigned integers. But gcc will issue a warning
"passing arg N of `my_atomic_XXX' as [un]signed due to prototype"
if the signedness of the argument doesn't match the prototype, or
"pointer targets in passing argument N of my_atomic_XXX differ in signedness"
if int* is used where uint* is expected (or vice versa).
Let's shut these warnings up
*/
#define make_transparent_unions(S) \
typedef union { \
int ## S i; \
uint ## S u; \
} U_ ## S __attribute__ ((transparent_union)); \
typedef union { \
int ## S volatile *i; \
uint ## S volatile *u; \
} Uv_ ## S __attribute__ ((transparent_union));
#define uintptr intptr
make_transparent_unions(8)
make_transparent_unions(16)
make_transparent_unions(32)
make_transparent_unions(ptr)
#undef uintptr
#undef make_transparent_unions
#define a U_a.i
#define cmp U_cmp.i
#define v U_v.i
#define set U_set.i
#else
#define U_8 int8
#define U_16 int16
#define U_32 int32
#define U_ptr intptr
#define Uv_8 int8
#define Uv_16 int16
#define Uv_32 int32
#define Uv_ptr intptr
#define U_a volatile *a
#define U_cmp *cmp
#define U_v v
#define U_set set
#endif /* __GCC__ transparent_union magic */
#ifdef HAVE_INLINE #ifdef HAVE_INLINE
#define make_atomic_add(S) \ #define make_atomic_add(S) \
static inline int ## S my_atomic_add ## S( \ STATIC_INLINE int ## S my_atomic_add ## S( \
int ## S volatile *a, int ## S v) \ Uv_ ## S U_a, U_ ## S U_v) \
{ \ { \
make_atomic_add_body(S); \ make_atomic_add_body(S); \
return v; \ return v; \
} }
#define make_atomic_swap(S) \ #define make_atomic_fas(S) \
static inline int ## S my_atomic_swap ## S( \ STATIC_INLINE int ## S my_atomic_fas ## S( \
int ## S volatile *a, int ## S v) \ Uv_ ## S U_a, U_ ## S U_v) \
{ \ { \
make_atomic_swap_body(S); \ make_atomic_fas_body(S); \
return v; \ return v; \
} }
#define make_atomic_cas(S) \ #define make_atomic_cas(S) \
static inline int my_atomic_cas ## S(int ## S volatile *a, \ STATIC_INLINE int my_atomic_cas ## S(Uv_ ## S U_a, \
int ## S *cmp, int ## S set) \ Uv_ ## S U_cmp, U_ ## S U_set) \
{ \ { \
int8 ret; \ int8 ret; \
make_atomic_cas_body(S); \ make_atomic_cas_body(S); \
return ret; \ return ret; \
} }
#define make_atomic_load(S) \ #define make_atomic_load(S) \
static inline int ## S my_atomic_load ## S(int ## S volatile *a) \ STATIC_INLINE int ## S my_atomic_load ## S(Uv_ ## S U_a) \
{ \ { \
int ## S ret; \ int ## S ret; \
make_atomic_load_body(S); \ make_atomic_load_body(S); \
return ret; \ return ret; \
} }
#define make_atomic_store(S) \ #define make_atomic_store(S) \
static inline void my_atomic_store ## S( \ STATIC_INLINE void my_atomic_store ## S( \
int ## S volatile *a, int ## S v) \ Uv_ ## S U_a, U_ ## S U_v) \
{ \ { \
make_atomic_store_body(S); \ make_atomic_store_body(S); \
} }
#else /* no inline functions */ #else /* no inline functions */
#define make_atomic_add(S) \ #define make_atomic_add(S) \
extern int ## S my_atomic_add ## S(int ## S volatile *a, int ## S v); extern int ## S my_atomic_add ## S(Uv_ ## S, U_ ## S);
#define make_atomic_swap(S) \ #define make_atomic_fas(S) \
extern int ## S my_atomic_swap ## S(int ## S volatile *a, int ## S v); extern int ## S my_atomic_fas ## S(Uv_ ## S, U_ ## S);
#define make_atomic_cas(S) \ #define make_atomic_cas(S) \
extern int my_atomic_cas ## S(int ## S volatile *a, int ## S *cmp, int ## S set); extern int my_atomic_cas ## S(Uv_ ## S, Uv_ ## S, U_ ## S);
#define make_atomic_load(S) \ #define make_atomic_load(S) \
extern int ## S my_atomic_load ## S(int ## S volatile *a); extern int ## S my_atomic_load ## S(Uv_ ## S);
#define make_atomic_store(S) \ #define make_atomic_store(S) \
extern void my_atomic_store ## S(int ## S volatile *a, int ## S v); extern void my_atomic_store ## S(Uv_ ## S, U_ ## S);
#endif #endif
...@@ -112,34 +191,42 @@ make_atomic_store(16) ...@@ -112,34 +191,42 @@ make_atomic_store(16)
make_atomic_store(32) make_atomic_store(32)
make_atomic_store(ptr) make_atomic_store(ptr)
make_atomic_swap( 8) make_atomic_fas( 8)
make_atomic_swap(16) make_atomic_fas(16)
make_atomic_swap(32) make_atomic_fas(32)
make_atomic_swap(ptr) make_atomic_fas(ptr)
#ifdef _atomic_h_cleanup_
#include _atomic_h_cleanup_
#undef _atomic_h_cleanup_
#endif
#undef U_8
#undef U_16
#undef U_32
#undef U_ptr
#undef a
#undef cmp
#undef v
#undef set
#undef U_a
#undef U_cmp
#undef U_v
#undef U_set
#undef make_atomic_add #undef make_atomic_add
#undef make_atomic_cas #undef make_atomic_cas
#undef make_atomic_load #undef make_atomic_load
#undef make_atomic_store #undef make_atomic_store
#undef make_atomic_swap #undef make_atomic_fas
#undef make_atomic_add_body #undef make_atomic_add_body
#undef make_atomic_cas_body #undef make_atomic_cas_body
#undef make_atomic_load_body #undef make_atomic_load_body
#undef make_atomic_store_body #undef make_atomic_store_body
#undef make_atomic_swap_body #undef make_atomic_fas_body
#undef intptr #undef intptr
#ifdef _atomic_h_cleanup_ #ifndef LF_BACKOFF
#include _atomic_h_cleanup_ #define LF_BACKOFF (1)
#undef _atomic_h_cleanup_
#endif
#if SIZEOF_CHARP == SIZEOF_INT
typedef int intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG
typedef long intptr;
#else
#error
#endif #endif
#define MY_ATOMIC_OK 0 #define MY_ATOMIC_OK 0
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* This file includes constants used with all databases */ /* This file includes constants used with all databases */
/* Author: Michael Widenius */
#ifndef _my_base_h #ifndef _my_base_h
#define _my_base_h #define _my_base_h
...@@ -49,7 +48,7 @@ ...@@ -49,7 +48,7 @@
#define HA_OPEN_FROM_SQL_LAYER 64 #define HA_OPEN_FROM_SQL_LAYER 64
#define HA_OPEN_MMAP 128 /* open memory mapped */ #define HA_OPEN_MMAP 128 /* open memory mapped */
/* The following is parameter to ha_rkey() how to use key */ /* The following is parameter to ha_rkey() how to use key */
/* /*
We define a complete-field prefix of a key value as a prefix where We define a complete-field prefix of a key value as a prefix where
...@@ -449,7 +448,7 @@ enum en_fieldtype { ...@@ -449,7 +448,7 @@ enum en_fieldtype {
}; };
enum data_file_type { enum data_file_type {
STATIC_RECORD,DYNAMIC_RECORD,COMPRESSED_RECORD STATIC_RECORD, DYNAMIC_RECORD, COMPRESSED_RECORD, BLOCK_RECORD
}; };
/* For key ranges */ /* For key ranges */
...@@ -500,4 +499,7 @@ typedef ulong ha_rows; ...@@ -500,4 +499,7 @@ typedef ulong ha_rows;
#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2) #define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2)
/* invalidator function reference for Query Cache */
typedef void (* invalidator_by_filename)(const char * filename);
#endif /* _my_base_h */ #endif /* _my_base_h */
/*
Some useful bit functions
*/
#ifdef HAVE_INLINE
extern const char _my_bits_nbits[256];
extern const uchar _my_bits_reverse_table[256];
/*
Find smallest X in 2^X >= value
This can be used to divide a number with value by doing a shift instead
*/
STATIC_INLINE uint my_bit_log2(ulong value)
{
uint bit;
for (bit=0 ; value > 1 ; value>>=1, bit++) ;
return bit;
}
STATIC_INLINE uint my_count_bits(ulonglong v)
{
#if SIZEOF_LONG_LONG > 4
/* The following code is a bit faster on 16 bit machines than if we would
only shift v */
ulong v2=(ulong) (v >> 32);
return (uint) (uchar) (_my_bits_nbits[(uchar) v] +
_my_bits_nbits[(uchar) (v >> 8)] +
_my_bits_nbits[(uchar) (v >> 16)] +
_my_bits_nbits[(uchar) (v >> 24)] +
_my_bits_nbits[(uchar) (v2)] +
_my_bits_nbits[(uchar) (v2 >> 8)] +
_my_bits_nbits[(uchar) (v2 >> 16)] +
_my_bits_nbits[(uchar) (v2 >> 24)]);
#else
return (uint) (uchar) (_my_bits_nbits[(uchar) v] +
_my_bits_nbits[(uchar) (v >> 8)] +
_my_bits_nbits[(uchar) (v >> 16)] +
_my_bits_nbits[(uchar) (v >> 24)]);
#endif
}
STATIC_INLINE uint my_count_bits_ushort(ushort v)
{
return _my_bits_nbits[v];
}
/*
Next highest power of two
SYNOPSIS
my_round_up_to_next_power()
v Value to check
RETURN
Next or equal power of 2
Note: 0 will return 0
NOTES
Algorithm by Sean Anderson, according to:
http://graphics.stanford.edu/~seander/bithacks.html
(Orignal code public domain)
Comments shows how this works with 01100000000000000000000000001011
*/
STATIC_INLINE uint32 my_round_up_to_next_power(uint32 v)
{
v--; /* 01100000000000000000000000001010 */
v|= v >> 1; /* 01110000000000000000000000001111 */
v|= v >> 2; /* 01111100000000000000000000001111 */
v|= v >> 4; /* 01111111110000000000000000001111 */
v|= v >> 8; /* 01111111111111111100000000001111 */
v|= v >> 16; /* 01111111111111111111111111111111 */
return v+1; /* 10000000000000000000000000000000 */
}
STATIC_INLINE uint32 my_clear_highest_bit(uint32 v)
{
uint32 w=v >> 1;
w|= w >> 1;
w|= w >> 2;
w|= w >> 4;
w|= w >> 8;
w|= w >> 16;
return v & w;
}
STATIC_INLINE uint32 my_reverse_bits(uint32 key)
{
return
(_my_bits_reverse_table[ key & 255] << 24) |
(_my_bits_reverse_table[(key>> 8) & 255] << 16) |
(_my_bits_reverse_table[(key>>16) & 255] << 8) |
_my_bits_reverse_table[(key>>24) ];
}
#else
extern uint my_bit_log2(ulong value);
extern uint32 my_round_up_to_next_power(uint32 v);
uint32 my_clear_highest_bit(uint32 v);
uint32 my_reverse_bits(uint32 key);
extern uint my_count_bits(ulonglong v);
extern uint my_count_bits_ushort(ushort v);
#endif
...@@ -101,7 +101,7 @@ extern FILE *_db_fp_(void); ...@@ -101,7 +101,7 @@ extern FILE *_db_fp_(void);
#define DBUG_LONGJMP(a1) longjmp(a1) #define DBUG_LONGJMP(a1) longjmp(a1)
#define DBUG_DUMP(keyword,a1,a2) #define DBUG_DUMP(keyword,a1,a2)
#define DBUG_END() #define DBUG_END()
#define DBUG_ASSERT(A) #define DBUG_ASSERT(A) do { } while(0)
#define DBUG_LOCK_FILE #define DBUG_LOCK_FILE
#define DBUG_FILE (stderr) #define DBUG_FILE (stderr)
#define DBUG_UNLOCK_FILE #define DBUG_UNLOCK_FILE
......
...@@ -224,6 +224,8 @@ ...@@ -224,6 +224,8 @@
#endif #endif
#undef inline_test_2 #undef inline_test_2
#undef inline_test_1 #undef inline_test_1
/* helper macro for "instantiating" inline functions */
#define STATIC_INLINE static inline
/* /*
The following macros are used to control inlining a bit more than The following macros are used to control inlining a bit more than
...@@ -458,6 +460,14 @@ C_MODE_END ...@@ -458,6 +460,14 @@ C_MODE_END
*/ */
#include <assert.h> #include <assert.h>
/* an assert that works at compile-time. only for constant expression */
#define compile_time_assert(X) \
do \
{ \
char compile_time_assert[(X) ? 1 : -1] \
__attribute__ ((unused)); \
} while(0)
/* Go around some bugs in different OS and compilers */ /* Go around some bugs in different OS and compilers */
#if defined (HPUX11) && defined(_LARGEFILE_SOURCE) #if defined (HPUX11) && defined(_LARGEFILE_SOURCE)
#define _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE
...@@ -1016,6 +1026,14 @@ typedef unsigned __int64 my_ulonglong; ...@@ -1016,6 +1026,14 @@ typedef unsigned __int64 my_ulonglong;
typedef unsigned long long my_ulonglong; typedef unsigned long long my_ulonglong;
#endif #endif
#if SIZEOF_CHARP == SIZEOF_INT
typedef int intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG
typedef long intptr;
#else
#error
#endif
#ifdef USE_RAID #ifdef USE_RAID
/* /*
The following is done with a if to not get problems with pre-processors The following is done with a if to not get problems with pre-processors
...@@ -1479,4 +1497,12 @@ do { doubleget_union _tmp; \ ...@@ -1479,4 +1497,12 @@ do { doubleget_union _tmp; \
#define dlerror() "" #define dlerror() ""
#endif #endif
/*
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
#endif
#endif /* my_global_h */ #endif /* my_global_h */
...@@ -18,10 +18,30 @@ ...@@ -18,10 +18,30 @@
#ifndef _my_handler_h #ifndef _my_handler_h
#define _my_handler_h #define _my_handler_h
#include "my_base.h"
#include "m_ctype.h"
#include "myisampack.h" #include "myisampack.h"
/*
There is a hard limit for the maximum number of keys as there are only
8 bits in the index file header for the number of keys in a table.
This means that 0..255 keys can exist for a table. The idea of
HA_MAX_POSSIBLE_KEY is to ensure that one can use myisamchk & tools on
a MyISAM table for which one has more keys than MyISAM is normally
compiled for. If you don't have this, you will get a core dump when
running myisamchk compiled for 128 keys on a table with 255 keys.
*/
#define HA_MAX_POSSIBLE_KEY 255 /* For myisamchk */
/*
The following defines can be increased if necessary.
But beware the dependency of HA_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH.
*/
#define HA_MAX_KEY_LENGTH 1000 /* Max length in bytes */
#define HA_MAX_KEY_SEG 16 /* Max segments for key */
#define HA_MAX_POSSIBLE_KEY_BUFF (HA_MAX_KEY_LENGTH + 24+ 6+6)
#define HA_MAX_KEY_BUFF (HA_MAX_KEY_LENGTH+HA_MAX_KEY_SEG*6+8+8)
typedef struct st_HA_KEYSEG /* Key-portion */ typedef struct st_HA_KEYSEG /* Key-portion */
{ {
CHARSET_INFO *charset; CHARSET_INFO *charset;
...@@ -38,33 +58,35 @@ typedef struct st_HA_KEYSEG /* Key-portion */ ...@@ -38,33 +58,35 @@ typedef struct st_HA_KEYSEG /* Key-portion */
} HA_KEYSEG; } HA_KEYSEG;
#define get_key_length(length,key) \ #define get_key_length(length,key) \
{ if ((uchar) *(key) != 255) \ { if (*(uchar*) (key) != 255) \
length= (uint) (uchar) *((key)++); \ length= (uint) *(uchar*) ((key)++); \
else \ else \
{ length=mi_uint2korr((key)+1); (key)+=3; } \ { length= mi_uint2korr((key)+1); (key)+=3; } \
} }
#define get_key_length_rdonly(length,key) \ #define get_key_length_rdonly(length,key) \
{ if ((uchar) *(key) != 255) \ { if (*(uchar*) (key) != 255) \
length= ((uint) (uchar) *((key))); \ length= ((uint) *(uchar*) ((key))); \
else \ else \
{ length=mi_uint2korr((key)+1); } \ { length= mi_uint2korr((key)+1); } \
} }
#define get_key_pack_length(length,length_pack,key) \ #define get_key_pack_length(length,length_pack,key) \
{ if ((uchar) *(key) != 255) \ { if (*(uchar*) (key) != 255) \
{ length= (uint) (uchar) *((key)++); length_pack=1; }\ { length= (uint) *(uchar*) ((key)++); length_pack= 1; }\
else \ else \
{ length=mi_uint2korr((key)+1); (key)+=3; length_pack=3; } \ { length=mi_uint2korr((key)+1); (key)+= 3; length_pack= 3; } \
} }
#define store_key_length_inc(key,length) \ #define store_key_length_inc(key,length) \
{ if ((length) < 255) \ { if ((length) < 255) \
{ *(key)++=(length); } \ { *(key)++= (length); } \
else \ else \
{ *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \ { *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \
} }
#define size_to_store_key_length(length) ((length) < 255 ? 1 : 3)
#define get_rec_bits(bit_ptr, bit_ofs, bit_len) \ #define get_rec_bits(bit_ptr, bit_ofs, bit_len) \
(((((uint16) (bit_ptr)[1] << 8) | (uint16) (bit_ptr)[0]) >> (bit_ofs)) & \ (((((uint16) (bit_ptr)[1] << 8) | (uint16) (bit_ptr)[0]) >> (bit_ofs)) & \
((1 << (bit_len)) - 1)) ((1 << (bit_len)) - 1))
...@@ -81,7 +103,7 @@ typedef struct st_HA_KEYSEG /* Key-portion */ ...@@ -81,7 +103,7 @@ typedef struct st_HA_KEYSEG /* Key-portion */
#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \ #define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \
set_rec_bits(0, bit_ptr, bit_ofs, bit_len) set_rec_bits(0, bit_ptr, bit_ofs, bit_len)
extern int mi_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint , extern int ha_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint ,
my_bool, my_bool); my_bool, my_bool);
extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
register uchar *b, uint key_length, uint nextflag, register uchar *b, uint key_length, uint nextflag,
......
...@@ -54,6 +54,7 @@ extern int NEAR my_errno; /* Last error in mysys */ ...@@ -54,6 +54,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_WME 16 /* Write message on error */ #define MY_WME 16 /* Write message on error */
#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */ #define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */ #define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
#define MY_SYNC_DIR 1024 /* my_create/delete/rename: sync directory */
#define MY_RAID 64 /* Support for RAID */ #define MY_RAID 64 /* Support for RAID */
#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */ #define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */
#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */ #define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
...@@ -215,6 +216,7 @@ extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); ...@@ -215,6 +216,7 @@ extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
extern int (*fatal_error_handler_hook)(uint my_err, const char *str, extern int (*fatal_error_handler_hook)(uint my_err, const char *str,
myf MyFlags); myf MyFlags);
extern uint my_file_limit; extern uint my_file_limit;
extern ulong my_thread_stack_size;
#ifdef HAVE_LARGE_PAGES #ifdef HAVE_LARGE_PAGES
extern my_bool my_use_large_pages; extern my_bool my_use_large_pages;
...@@ -628,6 +630,8 @@ extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags); ...@@ -628,6 +630,8 @@ extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern int my_fclose(FILE *fd,myf MyFlags); extern int my_fclose(FILE *fd,myf MyFlags);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_sync(File fd, myf my_flags); extern int my_sync(File fd, myf my_flags);
extern int my_sync_dir(const char *dir_name, myf my_flags);
extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
extern int my_error _VARARGS((int nr,myf MyFlags, ...)); extern int my_error _VARARGS((int nr,myf MyFlags, ...));
extern int my_printf_error _VARARGS((uint my_err, const char *format, extern int my_printf_error _VARARGS((uint my_err, const char *format,
myf MyFlags, ...)) myf MyFlags, ...))
...@@ -767,6 +771,7 @@ extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element); ...@@ -767,6 +771,7 @@ extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element);
extern byte *alloc_dynamic(DYNAMIC_ARRAY *array); extern byte *alloc_dynamic(DYNAMIC_ARRAY *array);
extern byte *pop_dynamic(DYNAMIC_ARRAY*); extern byte *pop_dynamic(DYNAMIC_ARRAY*);
extern my_bool set_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index); extern my_bool set_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index);
extern my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements);
extern void get_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index); extern void get_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index);
extern void delete_dynamic(DYNAMIC_ARRAY *array); extern void delete_dynamic(DYNAMIC_ARRAY *array);
extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index); extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index);
...@@ -831,10 +836,6 @@ extern int packfrm(const void *, uint, const void **, uint *); ...@@ -831,10 +836,6 @@ extern int packfrm(const void *, uint, const void **, uint *);
extern int unpackfrm(const void **, uint *, const void *); extern int unpackfrm(const void **, uint *, const void *);
extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count); extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count);
extern uint my_bit_log2(ulong value);
extern uint32 my_round_up_to_next_power(uint32 v);
extern uint my_count_bits(ulonglong v);
extern uint my_count_bits_ushort(ushort v);
extern void my_sleep(ulong m_seconds); extern void my_sleep(ulong m_seconds);
extern ulong crc32(ulong crc, const uchar *buf, uint len); extern ulong crc32(ulong crc, const uchar *buf, uint len);
extern uint my_set_max_open_files(uint files); extern uint my_set_max_open_files(uint files);
...@@ -850,7 +851,7 @@ extern int my_getncpus(); ...@@ -850,7 +851,7 @@ extern int my_getncpus();
#ifndef MAP_NOSYNC #ifndef MAP_NOSYNC
#define MAP_NOSYNC 0 #define MAP_NOSYNC 0
#endif #endif
#ifndef MAP_NORESERVE #ifndef MAP_NORESERVE
#define MAP_NORESERVE 0 /* For irix and AIX */ #define MAP_NORESERVE 0 /* For irix and AIX */
#endif #endif
......
This diff is collapsed.
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Definitions needed for myisamchk/mariachk.c */
/*
Entries marked as "QQ to be removed" are NOT used to
pass check/repair options to xxx_check.c. They are used
internally by xxxchk.c or/and ha_xxxx.cc and should NOT
be stored together with other flags. They should be removed
from the following list to make addition of new flags possible.
*/
#ifndef _myisamchk_h
#define _myisamchk_h
#define T_AUTO_INC 1
#define T_AUTO_REPAIR 2 /* QQ to be removed */
#define T_BACKUP_DATA 4
#define T_CALC_CHECKSUM 8
#define T_CHECK 16 /* QQ to be removed */
#define T_CHECK_ONLY_CHANGED 32 /* QQ to be removed */
#define T_CREATE_MISSING_KEYS 64
#define T_DESCRIPT 128
#define T_DONT_CHECK_CHECKSUM 256
#define T_EXTEND 512
#define T_FAST (1L << 10) /* QQ to be removed */
#define T_FORCE_CREATE (1L << 11) /* QQ to be removed */
#define T_FORCE_UNIQUENESS (1L << 12)
#define T_INFO (1L << 13)
#define T_MEDIUM (1L << 14)
#define T_QUICK (1L << 15) /* QQ to be removed */
#define T_READONLY (1L << 16) /* QQ to be removed */
#define T_REP (1L << 17)
#define T_REP_BY_SORT (1L << 18) /* QQ to be removed */
#define T_REP_PARALLEL (1L << 19) /* QQ to be removed */
#define T_RETRY_WITHOUT_QUICK (1L << 20)
#define T_SAFE_REPAIR (1L << 21)
#define T_SILENT (1L << 22)
#define T_SORT_INDEX (1L << 23) /* QQ to be removed */
#define T_SORT_RECORDS (1L << 24) /* QQ to be removed */
#define T_STATISTICS (1L << 25)
#define T_UNPACK (1L << 26)
#define T_UPDATE_STATE (1L << 27)
#define T_VERBOSE (1L << 28)
#define T_VERY_SILENT (1L << 29)
#define T_WAIT_FOREVER (1L << 30)
#define T_WRITE_LOOP ((ulong) 1L << 31)
#define T_REP_ANY (T_REP | T_REP_BY_SORT | T_REP_PARALLEL)
/*
Flags used by xxxxchk.c or/and ha_xxxx.cc that are NOT passed
to xxxcheck.c follows:
*/
#define TT_USEFRM 1
#define TT_FOR_UPGRADE 2
#define O_NEW_INDEX 1 /* Bits set in out_flag */
#define O_NEW_DATA 2
#define O_DATA_LOST 4
typedef struct st_sort_key_blocks /* Used when sorting */
{
byte *buff, *end_pos;
byte lastkey[HA_MAX_POSSIBLE_KEY_BUFF];
uint last_length;
int inited;
} SORT_KEY_BLOCKS;
/*
MARIA/MYISAM supports several statistics collection
methods. Currently statistics collection method is not stored in
MARIA file and has to be specified for each table analyze/repair
operation in MI_CHECK::stats_method.
*/
typedef enum
{
/* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */
MI_STATS_METHOD_NULLS_NOT_EQUAL,
/* Treat NULLs as equal when collecting statistics (like 4.0 did) */
MI_STATS_METHOD_NULLS_EQUAL,
/* Ignore NULLs - count only tuples without NULLs in the index components */
MI_STATS_METHOD_IGNORE_NULLS
} enum_handler_stats_method;
typedef struct st_handler_check_param
{
char *isam_file_name;
MY_TMPDIR *tmpdir;
void *thd;
const char *db_name, *table_name, *op_name;
ulonglong auto_increment_value;
ulonglong max_data_file_length;
ulonglong keys_in_use;
ulonglong max_record_length;
/*
The next two are used to collect statistics, see update_key_parts for
description.
*/
ulonglong unique_count[HA_MAX_KEY_SEG + 1];
ulonglong notnull_count[HA_MAX_KEY_SEG + 1];
my_off_t search_after_block;
my_off_t new_file_pos, key_file_blocks;
my_off_t keydata, totaldata, key_blocks, start_check_pos;
my_off_t used, empty, splits, del_length, link_used;
ha_rows total_records, total_deleted, records,del_blocks;
ha_rows full_page_count, tail_count;
ha_checksum record_checksum, glob_crc;
ha_checksum key_crc[HA_MAX_POSSIBLE_KEY];
ha_checksum tmp_key_crc[HA_MAX_POSSIBLE_KEY];
ha_checksum tmp_record_checksum;
ulong use_buffers, read_buffer_length, write_buffer_length;
ulong sort_buffer_length, sort_key_blocks;
ulong rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY];
uint out_flag, warning_printed, error_printed, verbose;
uint opt_sort_key, total_files, max_level;
uint testflag, key_cache_block_size;
int tmpfile_createflag, err_count;
myf myf_rw;
uint8 language;
my_bool using_global_keycache, opt_lock_memory, opt_follow_links;
my_bool retry_repair, force_sort, calc_checksum, static_row_size;
char temp_filename[FN_REFLEN];
IO_CACHE read_cache;
enum_handler_stats_method stats_method;
} HA_CHECK;
typedef struct st_sort_ftbuf
{
byte *buf, *end;
int count;
byte lastkey[HA_MAX_KEY_BUFF];
} SORT_FT_BUF;
typedef struct st_buffpek {
my_off_t file_pos; /* Where we are in the sort file */
byte *base, *key; /* Key pointers */
ha_rows count; /* Number of rows in table */
ulong mem_count; /* numbers of keys in memory */
ulong max_keys; /* Max keys in buffert */
} BUFFPEK;
#endif /* _myisamchk_h */
This diff is collapsed.
#ifndef _wqueue_h
#define _wqueue_h
#include <my_global.h>
#include <my_pthread.h>
/* info about requests in a waiting queue */
typedef struct st_pagecache_wqueue
{
struct st_my_thread_var *last_thread; /* circular list of waiting
threads */
} WQUEUE;
#ifdef THREAD
void wqueue_link_into_queue(WQUEUE *wqueue, struct st_my_thread_var *thread);
void wqueue_unlink_from_queue(WQUEUE *wqueue, struct st_my_thread_var *thread);
void wqueue_add_to_queue(WQUEUE *wqueue, struct st_my_thread_var *thread);
void wqueue_add_and_wait(WQUEUE *wqueue,
struct st_my_thread_var *thread,
pthread_mutex_t *lock);
void wqueue_release_queue(WQUEUE *wqueue);
#endif
#endif
...@@ -52,6 +52,7 @@ ADD_LIBRARY(libmysql SHARED dll.c libmysql.def ...@@ -52,6 +52,7 @@ ADD_LIBRARY(libmysql SHARED dll.c libmysql.def
../mysys/my_open.c ../mysys/my_pread.c ../mysys/my_pthread.c ../mysys/my_read.c ../mysys/my_open.c ../mysys/my_pread.c ../mysys/my_pthread.c ../mysys/my_read.c
../mysys/my_realloc.c ../mysys/my_rename.c ../mysys/my_seek.c ../mysys/my_realloc.c ../mysys/my_rename.c ../mysys/my_seek.c
../mysys/my_static.c ../strings/my_strtoll10.c ../mysys/my_symlink.c ../mysys/my_static.c ../strings/my_strtoll10.c ../mysys/my_symlink.c
../mysys/my_sync.c
../mysys/my_symlink2.c ../mysys/my_thr_init.c ../sql-common/my_time.c ../mysys/my_symlink2.c ../mysys/my_thr_init.c ../sql-common/my_time.c
../strings/my_vsnprintf.c ../mysys/my_wincond.c ../mysys/my_winthread.c ../strings/my_vsnprintf.c ../mysys/my_wincond.c ../mysys/my_winthread.c
../mysys/my_write.c ../sql/net_serv.cc ../sql-common/pack.c ../sql/password.c ../mysys/my_write.c ../sql/net_serv.cc ../sql-common/pack.c ../sql/password.c
......
...@@ -68,7 +68,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \ ...@@ -68,7 +68,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
mf_iocache2.lo my_seek.lo my_sleep.lo \ mf_iocache2.lo my_seek.lo my_sleep.lo \
my_pread.lo mf_cache.lo md5.lo sha1.lo \ my_pread.lo mf_cache.lo md5.lo sha1.lo \
my_getopt.lo my_gethostbyname.lo my_port.lo \ my_getopt.lo my_gethostbyname.lo my_port.lo \
my_rename.lo my_chsize.lo my_rename.lo my_chsize.lo my_sync.lo
sqlobjects = net.lo sqlobjects = net.lo
sql_cmn_objects = pack.lo client.lo my_time.lo sql_cmn_objects = pack.lo client.lo my_time.lo
......
-- require r/have_maria.require
disable_query_log;
show variables like "have_maria";
enable_query_log;
...@@ -86,7 +86,7 @@ slo_val val ...@@ -86,7 +86,7 @@ slo_val val
20 0 20 0
1 0 1 0
"Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10" "Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10"
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; SELECT user_host, query_time, db, sql_text FROM mysql.slow_log where sql_text <> "DROP EVENT long_event";
user_host query_time db sql_text user_host query_time db sql_text
USER_HOST SLEEPVAL events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2) USER_HOST SLEEPVAL events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2)
DROP EVENT long_event2; DROP EVENT long_event2;
......
Variable_name Value
have_maria YES
This diff is collapsed.
This diff is collapsed.
...@@ -35,8 +35,9 @@ synchronization : Bug#24529 Test 'synchronization' fails on Mac pushb ...@@ -35,8 +35,9 @@ synchronization : Bug#24529 Test 'synchronization' fails on Mac pushb
#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events #ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
#ndb_binlog_discover : bug#21806 2006-08-24 #ndb_binlog_discover : bug#21806 2006-08-24
#ndb_autodiscover3 : bug#21806 #ndb_autodiscover3 : bug#21806
mysql_upgrade : Bug#25074 mysql_upgrade gives inconsisten results mysql_upgrade : Bug#25074 mysql_upgrade gives inconsisten results
plugin : Bug#25659 memory leak via "plugins" test plugin : Bug#25659 memory leak via "plugins" test
rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly
ndb_alter_table : Bug##25774 ndb_alter_table.test fails in DBUG_ASSERT() on Linux x64 ndb_alter_table : Bug##25774 ndb_alter_table.test fails in DBUG_ASSERT() on Linux x64
maria : Until maria is fully functional
ps_maria : Until maria is fully functional
...@@ -94,7 +94,7 @@ CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_te ...@@ -94,7 +94,7 @@ CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_te
SELECT * FROM slow_event_test; SELECT * FROM slow_event_test;
--echo "Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10" --echo "Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10"
--replace_column 1 USER_HOST 2 SLEEPVAL --replace_column 1 USER_HOST 2 SLEEPVAL
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; SELECT user_host, query_time, db, sql_text FROM mysql.slow_log where sql_text <> "DROP EVENT long_event";
DROP EVENT long_event2; DROP EVENT long_event2;
--echo "Make it quite long" --echo "Make it quite long"
SET SESSION long_query_time=300; SET SESSION long_query_time=300;
......
This diff is collapsed.
###############################################
# #
# Prepared Statements test on MARIA tables #
# #
###############################################
#
# NOTE: PLEASE SEE ps_1general.test (bottom)
# BEFORE ADDING NEW TEST CASES HERE !!!
use test;
-- source include/have_maria.inc
let $type= 'MARIA' ;
-- source include/ps_create.inc
-- source include/ps_renew.inc
-- source include/ps_query.inc
# parameter in SELECT ... MATCH/AGAINST
# case derived from client_test.c: test_bug1500()
--disable_warnings
drop table if exists t2 ;
--enable_warnings
eval create table t2 (s varchar(25), fulltext(s))
ENGINE = $type ;
insert into t2 values ('Gravedigger'), ('Greed'),('Hollow Dogs') ;
commit ;
prepare stmt1 from ' select s from t2 where match (s) against (?) ' ;
set @arg00='Dogs' ;
execute stmt1 using @arg00 ;
prepare stmt1 from ' SELECT s FROM t2
where match (s) against (concat(?,''digger'')) ';
set @arg00='Grave' ;
execute stmt1 using @arg00 ;
drop table t2 ;
-- source include/ps_modify.inc
-- source include/ps_modify1.inc
-- source include/ps_conv.inc
drop table t1, t9;
# End of 4.1 tests
...@@ -30,7 +30,8 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \ ...@@ -30,7 +30,8 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \ mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \
my_malloc.c my_realloc.c my_once.c mulalloc.c \ my_malloc.c my_realloc.c my_once.c mulalloc.c \
my_alloc.c safemalloc.c my_new.cc \ my_alloc.c safemalloc.c my_new.cc \
my_vle.c my_atomic.c \ my_vle.c my_atomic.c lf_hash.c \
lf_dynarray.c lf_alloc-pin.c \
my_fopen.c my_fstream.c my_getsystime.c \ my_fopen.c my_fstream.c my_getsystime.c \
my_error.c errors.c my_div.c my_messnc.c \ my_error.c errors.c my_div.c my_messnc.c \
mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c \ mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c \
...@@ -52,7 +53,8 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \ ...@@ -52,7 +53,8 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
my_gethostbyname.c rijndael.c my_aes.c sha1.c \ my_gethostbyname.c rijndael.c my_aes.c sha1.c \
my_handler.c my_netware.c my_largepage.c \ my_handler.c my_netware.c my_largepage.c \
my_memmem.c \ my_memmem.c \
my_windac.c my_access.c base64.c my_libwrap.c my_windac.c my_access.c base64.c my_libwrap.c \
mf_pagecache.c wqueue.c
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \ EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
thr_mutex.c thr_rwlock.c \ thr_mutex.c thr_rwlock.c \
CMakeLists.txt mf_soundex.c \ CMakeLists.txt mf_soundex.c \
...@@ -126,5 +128,6 @@ test_base64$(EXEEXT): base64.c $(LIBRARIES) ...@@ -126,5 +128,6 @@ test_base64$(EXEEXT): base64.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN ./test_base64.c $(LDADD) $(LIBS) $(LINK) $(FLAGS) -DMAIN ./test_base64.c $(LDADD) $(LIBS)
$(RM) -f ./test_base64.c $(RM) -f ./test_base64.c
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
...@@ -60,7 +60,8 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, ...@@ -60,7 +60,8 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
array->max_element=init_alloc; array->max_element=init_alloc;
array->alloc_increment=alloc_increment; array->alloc_increment=alloc_increment;
array->size_of_element=element_size; array->size_of_element=element_size;
if (!(array->buffer=(char*) my_malloc_ci(element_size*init_alloc,MYF(MY_WME)))) if (!(array->buffer=(char*) my_malloc_ci(element_size*init_alloc,
MYF(MY_WME))))
{ {
array->max_element=0; array->max_element=0;
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
...@@ -153,7 +154,7 @@ byte *pop_dynamic(DYNAMIC_ARRAY *array) ...@@ -153,7 +154,7 @@ byte *pop_dynamic(DYNAMIC_ARRAY *array)
} }
/* /*
Replace elemnent in array with given element and index Replace element in array with given element and index
SYNOPSIS SYNOPSIS
set_dynamic() set_dynamic()
...@@ -174,19 +175,8 @@ my_bool set_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx) ...@@ -174,19 +175,8 @@ my_bool set_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
{ {
if (idx >= array->elements) if (idx >= array->elements)
{ {
if (idx >= array->max_element) if (idx >= array->max_element && allocate_dynamic(array, idx))
{ return TRUE;
uint size;
char *new_ptr;
size=(idx+array->alloc_increment)/array->alloc_increment;
size*= array->alloc_increment;
if (!(new_ptr=(char*) my_realloc(array->buffer,size*
array->size_of_element,
MYF(MY_WME | MY_ALLOW_ZERO_PTR))))
return TRUE;
array->buffer=new_ptr;
array->max_element=size;
}
bzero((gptr) (array->buffer+array->elements*array->size_of_element), bzero((gptr) (array->buffer+array->elements*array->size_of_element),
(idx - array->elements)*array->size_of_element); (idx - array->elements)*array->size_of_element);
array->elements=idx+1; array->elements=idx+1;
...@@ -196,6 +186,42 @@ my_bool set_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx) ...@@ -196,6 +186,42 @@ my_bool set_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
return FALSE; return FALSE;
} }
/*
Ensure that dynamic array has enough elements
SYNOPSIS
allocate_dynamic()
array
max_elements Numbers of elements that is needed
NOTES
Any new allocated element are NOT initialized
RETURN VALUE
FALSE Ok
TRUE Allocation of new memory failed
*/
my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements)
{
if (max_elements >= array->max_element)
{
uint size;
char *new_ptr;
size= (max_elements + array->alloc_increment)/array->alloc_increment;
size*= array->alloc_increment;
if (!(new_ptr= (char*) my_realloc(array->buffer,size*
array->size_of_element,
MYF(MY_WME | MY_ALLOW_ZERO_PTR))))
return TRUE;
array->buffer= new_ptr;
array->max_element= size;
}
return FALSE;
}
/* /*
Get an element from array by given index Get an element from array by given index
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <keycache.h> #include <keycache.h>
#include "my_static.h" #include "my_static.h"
#include <m_string.h> #include <m_string.h>
#include <my_bit.h>
#include <errno.h> #include <errno.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -1009,12 +1010,12 @@ static void unlink_block(KEY_CACHE *keycache, BLOCK_LINK *block) ...@@ -1009,12 +1010,12 @@ static void unlink_block(KEY_CACHE *keycache, BLOCK_LINK *block)
KEYCACHE_THREAD_TRACE("unlink_block"); KEYCACHE_THREAD_TRACE("unlink_block");
#if defined(KEYCACHE_DEBUG) #if defined(KEYCACHE_DEBUG)
KEYCACHE_DBUG_ASSERT(keycache->blocks_available != 0);
keycache->blocks_available--; keycache->blocks_available--;
KEYCACHE_DBUG_PRINT("unlink_block", KEYCACHE_DBUG_PRINT("unlink_block",
("unlinked block %u status=%x #requests=%u #available=%u", ("unlinked block %u status=%x #requests=%u #available=%u",
BLOCK_NUMBER(block), block->status, BLOCK_NUMBER(block), block->status,
block->requests, keycache->blocks_available)); block->requests, keycache->blocks_available));
KEYCACHE_DBUG_ASSERT(keycache->blocks_available >= 0);
#endif #endif
} }
...@@ -1643,9 +1644,9 @@ restart: ...@@ -1643,9 +1644,9 @@ restart:
KEYCACHE_DBUG_ASSERT(page_status != -1); KEYCACHE_DBUG_ASSERT(page_status != -1);
*page_st=page_status; *page_st=page_status;
KEYCACHE_DBUG_PRINT("find_key_block", KEYCACHE_DBUG_PRINT("find_key_block",
("fd: %d pos: %lu block->status: %u page_status: %u", ("fd: %d pos: %lu block->status: %u page_status: %d",
file, (ulong) filepos, block->status, file, (ulong) filepos, block->status,
(uint) page_status)); page_status));
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
DBUG_EXECUTE("check_keycache2", DBUG_EXECUTE("check_keycache2",
...@@ -1793,8 +1794,6 @@ byte *key_cache_read(KEY_CACHE *keycache, ...@@ -1793,8 +1794,6 @@ byte *key_cache_read(KEY_CACHE *keycache,
uint offset= 0; uint offset= 0;
byte *start= buff; byte *start= buff;
DBUG_ENTER("key_cache_read"); DBUG_ENTER("key_cache_read");
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
(uint) file, (ulong) filepos, length));
if (keycache->can_be_used) if (keycache->can_be_used)
{ {
...@@ -1804,6 +1803,11 @@ byte *key_cache_read(KEY_CACHE *keycache, ...@@ -1804,6 +1803,11 @@ byte *key_cache_read(KEY_CACHE *keycache,
uint status; uint status;
int page_st; int page_st;
DBUG_PRINT("enter", ("fd: %u pos: %lu page: %lu length: %u",
(uint) file, (ulong) filepos,
(ulong) (filepos / keycache->key_cache_block_size),
length));
offset= (uint) (filepos & (keycache->key_cache_block_size-1)); offset= (uint) (filepos & (keycache->key_cache_block_size-1));
/* Read data in key_cache_block_size increments */ /* Read data in key_cache_block_size increments */
do do
...@@ -2055,10 +2059,6 @@ int key_cache_write(KEY_CACHE *keycache, ...@@ -2055,10 +2059,6 @@ int key_cache_write(KEY_CACHE *keycache,
reg1 BLOCK_LINK *block; reg1 BLOCK_LINK *block;
int error=0; int error=0;
DBUG_ENTER("key_cache_write"); DBUG_ENTER("key_cache_write");
DBUG_PRINT("enter",
("fd: %u pos: %lu length: %u block_length: %u key_block_length: %u",
(uint) file, (ulong) filepos, length, block_length,
keycache ? keycache->key_cache_block_size : 0));
if (!dont_write) if (!dont_write)
{ {
...@@ -2080,6 +2080,12 @@ int key_cache_write(KEY_CACHE *keycache, ...@@ -2080,6 +2080,12 @@ int key_cache_write(KEY_CACHE *keycache,
int page_st; int page_st;
uint offset; uint offset;
DBUG_PRINT("enter",
("fd: %u pos: %lu page: %lu length: %u block_length: %u",
(uint) file, (ulong) filepos,
(ulong) (filepos / keycache->key_cache_block_size),
length, block_length));
offset= (uint) (filepos & (keycache->key_cache_block_size-1)); offset= (uint) (filepos & (keycache->key_cache_block_size-1));
do do
{ {
......
...@@ -147,7 +147,8 @@ static void safe_hash_free(SAFE_HASH *hash) ...@@ -147,7 +147,8 @@ static void safe_hash_free(SAFE_HASH *hash)
Return the value stored for a key or default value if no key Return the value stored for a key or default value if no key
*/ */
static byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length) static byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length,
byte *def)
{ {
byte *result; byte *result;
DBUG_ENTER("safe_hash_search"); DBUG_ENTER("safe_hash_search");
...@@ -155,7 +156,7 @@ static byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length) ...@@ -155,7 +156,7 @@ static byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length)
result= hash_search(&hash->hash, key, length); result= hash_search(&hash->hash, key, length);
rw_unlock(&hash->mutex); rw_unlock(&hash->mutex);
if (!result) if (!result)
result= hash->default_value; result= def;
else else
result= ((SAFE_HASH_ENTRY*) result)->data; result= ((SAFE_HASH_ENTRY*) result)->data;
DBUG_PRINT("exit",("data: 0x%lx", (long) result)); DBUG_PRINT("exit",("data: 0x%lx", (long) result));
...@@ -315,6 +316,7 @@ void multi_keycache_free(void) ...@@ -315,6 +316,7 @@ void multi_keycache_free(void)
multi_key_cache_search() multi_key_cache_search()
key key to find (usually table path) key key to find (usually table path)
uint length Length of key. uint length Length of key.
def Default value if no key cache
NOTES NOTES
This function is coded in such a way that we will return the This function is coded in such a way that we will return the
...@@ -325,11 +327,13 @@ void multi_keycache_free(void) ...@@ -325,11 +327,13 @@ void multi_keycache_free(void)
key cache to use key cache to use
*/ */
KEY_CACHE *multi_key_cache_search(byte *key, uint length) KEY_CACHE *multi_key_cache_search(byte *key, uint length,
KEY_CACHE *def)
{ {
if (!key_cache_hash.hash.records) if (!key_cache_hash.hash.records)
return dflt_key_cache; return def;
return (KEY_CACHE*) safe_hash_search(&key_cache_hash, key, length); return (KEY_CACHE*) safe_hash_search(&key_cache_hash, key, length,
(void*) def);
} }
......
This diff is collapsed.
...@@ -17,11 +17,10 @@ ...@@ -17,11 +17,10 @@
#include <my_pthread.h> #include <my_pthread.h>
#ifndef HAVE_INLINE #ifndef HAVE_INLINE
/* /* the following will cause all inline functions to be instantiated */
the following will cause all inline functions to be instantiated
*/
#define HAVE_INLINE #define HAVE_INLINE
#define static extern #undef STATIC_INLINE
#define STATIC_INLINE extern
#endif #endif
#include <my_atomic.h> #include <my_atomic.h>
...@@ -35,7 +34,7 @@ ...@@ -35,7 +34,7 @@
*/ */
int my_atomic_initialize() int my_atomic_initialize()
{ {
DBUG_ASSERT(sizeof(intptr) == sizeof(void *)); compile_time_assert(sizeof(intptr) == sizeof(void *));
/* currently the only thing worth checking is SMP/UP issue */ /* currently the only thing worth checking is SMP/UP issue */
#ifdef MY_ATOMIC_MODE_DUMMY #ifdef MY_ATOMIC_MODE_DUMMY
return my_getncpus() == 1 ? MY_ATOMIC_OK : MY_ATOMIC_NOT_1CPU; return my_getncpus() == 1 ? MY_ATOMIC_OK : MY_ATOMIC_NOT_1CPU;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# empty for the moment; will fill it when we build under Windows
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment