diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index f044f8e62da..ad9b1e0a259 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,6 @@ [MYSQL] -post_commit_to = "commits@lists.mysql.com" -post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.1" +tree_location = bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-maria/ +post_commit_to = maria@lists.mysql.com +post_commit_url = bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-maria/ +tree_name = mysql-maria +project_name = MySQL/Maria diff --git a/.bzrignore b/.bzrignore index 8ea3b361c87..a7166d4551f 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1,6 +1,7 @@ *-t *.Plo *.Po +*.Tpo *.a *.bb *.bbg @@ -9,11 +10,14 @@ *.core *.d *.da +*.dll *.exe +*.exp *.gcda *.gcno *.gcov *.idb +*.ilk *.la *.lai *.lib @@ -33,6 +37,9 @@ *.user *.vcproj *.vcproj.cmake +*.dsp +*.Po +*.Plo */*.dir/* */*_pure_*warnings */.deps @@ -86,6 +93,9 @@ BitKeeper/post-commit-manual BitKeeper/tmp/* BitKeeper/tmp/bkr3sAHD BitKeeper/tmp/gone +BitKeeper/tmp +BitKeeper/log +BitKeeper/etc/SCCS CMakeFiles/* COPYING COPYING.LIB @@ -147,7 +157,6 @@ Makefile.in Makefile.in' PENDING/* TAGS -VC++Files/client/mysql_amd64.dsp ac_available_languages_fragment acinclude.m4 aclocal.m4 @@ -156,6 +165,7 @@ autom4te-2.53.cache/* autom4te-2.53.cache/output.0 autom4te-2.53.cache/requests autom4te-2.53.cache/traces.0 +autom4te.cache autom4te.cache/* autom4te.cache/output.0 autom4te.cache/requests @@ -168,37 +178,9 @@ bdb/build_unix/* bdb/build_vxworks/db.h bdb/build_vxworks/db_int.h bdb/build_win32/db.h -bdb/build_win32/db_archive.dsp -bdb/build_win32/db_checkpoint.dsp bdb/build_win32/db_config.h bdb/build_win32/db_cxx.h -bdb/build_win32/db_deadlock.dsp -bdb/build_win32/db_dll.dsp -bdb/build_win32/db_dump.dsp bdb/build_win32/db_int.h -bdb/build_win32/db_java.dsp -bdb/build_win32/db_load.dsp -bdb/build_win32/db_perf.dsp -bdb/build_win32/db_printlog.dsp -bdb/build_win32/db_recover.dsp -bdb/build_win32/db_stat.dsp -bdb/build_win32/db_static.dsp -bdb/build_win32/db_tcl.dsp -bdb/build_win32/db_test.dsp -bdb/build_win32/db_upgrade.dsp -bdb/build_win32/db_verify.dsp -bdb/build_win32/ex_access.dsp -bdb/build_win32/ex_btrec.dsp -bdb/build_win32/ex_env.dsp -bdb/build_win32/ex_lock.dsp -bdb/build_win32/ex_mpool.dsp -bdb/build_win32/ex_tpcb.dsp -bdb/build_win32/excxx_access.dsp -bdb/build_win32/excxx_btrec.dsp -bdb/build_win32/excxx_env.dsp -bdb/build_win32/excxx_lock.dsp -bdb/build_win32/excxx_mpool.dsp -bdb/build_win32/excxx_tpcb.dsp bdb/build_win32/include.tcl bdb/build_win32/libdb.def bdb/build_win32/libdb.rc @@ -311,48 +293,7 @@ build_tags.sh client/#mysql.cc# client/*.ds? client/*.vcproj -client/.deps/base64.Po -client/.deps/completion_hash.Po -client/.deps/dummy.Po -client/.deps/mf_tempdir.Po -client/.deps/my_bit.Po -client/.deps/my_bitmap.Po -client/.deps/my_getsystime.Po -client/.deps/my_new.Po -client/.deps/my_user.Po -client/.deps/my_vle.Po -client/.deps/mysql.Po -client/.deps/mysql_upgrade.Po -client/.deps/mysqladmin.Po -client/.deps/mysqlbinlog.Po -client/.deps/mysqlcheck.Po -client/.deps/mysqldump.Po -client/.deps/mysqlimport.Po -client/.deps/mysqlshow.Po -client/.deps/mysqlslap.Po -client/.deps/mysqltest.Po -client/.deps/readline.Po -client/.deps/sql_string.Po client/.libs -prune -client/.libs/lt-mysql -client/.libs/lt-mysqladmin -client/.libs/lt-mysqlbinlog -client/.libs/lt-mysqlcheck -client/.libs/lt-mysqldump -client/.libs/lt-mysqlimport -client/.libs/lt-mysqlshow -client/.libs/lt-mysqlslap -client/.libs/lt-mysqltest -client/.libs/mysql -client/.libs/mysql_upgrade -client/.libs/mysqladmin -client/.libs/mysqlbinlog -client/.libs/mysqlcheck -client/.libs/mysqldump -client/.libs/mysqlimport -client/.libs/mysqlshow -client/.libs/mysqlslap -client/.libs/mysqltest client/completion_hash.cpp client/decimal.c client/insert_test @@ -402,66 +343,9 @@ client_debug/* client_release/* client_test cmake_install.cmake -cmd-line-utils/libedit/.deps/chared.Po -cmd-line-utils/libedit/.deps/common.Po -cmd-line-utils/libedit/.deps/el.Po -cmd-line-utils/libedit/.deps/emacs.Po -cmd-line-utils/libedit/.deps/fcns.Po -cmd-line-utils/libedit/.deps/fgetln.Po -cmd-line-utils/libedit/.deps/help.Po -cmd-line-utils/libedit/.deps/hist.Po -cmd-line-utils/libedit/.deps/history.Po -cmd-line-utils/libedit/.deps/key.Po -cmd-line-utils/libedit/.deps/map.Po -cmd-line-utils/libedit/.deps/parse.Po -cmd-line-utils/libedit/.deps/prompt.Po -cmd-line-utils/libedit/.deps/read.Po -cmd-line-utils/libedit/.deps/readline.Po -cmd-line-utils/libedit/.deps/refresh.Po -cmd-line-utils/libedit/.deps/search.Po -cmd-line-utils/libedit/.deps/sig.Po -cmd-line-utils/libedit/.deps/strlcat.Po -cmd-line-utils/libedit/.deps/strlcpy.Po -cmd-line-utils/libedit/.deps/term.Po -cmd-line-utils/libedit/.deps/tokenizer.Po -cmd-line-utils/libedit/.deps/tty.Po -cmd-line-utils/libedit/.deps/unvis.Po -cmd-line-utils/libedit/.deps/vi.Po -cmd-line-utils/libedit/.deps/vis.Po cmd-line-utils/libedit/common.h cmd-line-utils/libedit/makelist -cmd-line-utils/readline/.deps/bind.Po -cmd-line-utils/readline/.deps/callback.Po -cmd-line-utils/readline/.deps/compat.Po -cmd-line-utils/readline/.deps/complete.Po -cmd-line-utils/readline/.deps/display.Po -cmd-line-utils/readline/.deps/funmap.Po -cmd-line-utils/readline/.deps/histexpand.Po -cmd-line-utils/readline/.deps/histfile.Po -cmd-line-utils/readline/.deps/history.Po -cmd-line-utils/readline/.deps/histsearch.Po -cmd-line-utils/readline/.deps/input.Po -cmd-line-utils/readline/.deps/isearch.Po -cmd-line-utils/readline/.deps/keymaps.Po -cmd-line-utils/readline/.deps/kill.Po -cmd-line-utils/readline/.deps/macro.Po -cmd-line-utils/readline/.deps/mbutil.Po -cmd-line-utils/readline/.deps/misc.Po -cmd-line-utils/readline/.deps/nls.Po -cmd-line-utils/readline/.deps/parens.Po -cmd-line-utils/readline/.deps/readline.Po -cmd-line-utils/readline/.deps/rltty.Po -cmd-line-utils/readline/.deps/savestring.Po -cmd-line-utils/readline/.deps/search.Po -cmd-line-utils/readline/.deps/shell.Po -cmd-line-utils/readline/.deps/signals.Po -cmd-line-utils/readline/.deps/terminal.Po -cmd-line-utils/readline/.deps/text.Po -cmd-line-utils/readline/.deps/tilde.Po -cmd-line-utils/readline/.deps/undo.Po -cmd-line-utils/readline/.deps/util.Po -cmd-line-utils/readline/.deps/vi_mode.Po -cmd-line-utils/readline/.deps/xmalloc.Po +comments comon.h comp_err/*.ds? comp_err/*.vcproj @@ -486,17 +370,13 @@ cscope.po.out db-*.*.* dbug/*.ds? dbug/*.vcproj -dbug/.deps/dbug.Po -dbug/.deps/dbug_analyze.Po -dbug/.deps/factorial.Po -dbug/.deps/my_main.Po -dbug/.deps/sanity.Po dbug/dbug_analyze dbug/example*.r dbug/factorial dbug/factorial.r dbug/main.r dbug/output*.r +dbug/tests dbug/user.ps dbug/user.t debian/control @@ -506,15 +386,6 @@ emacs.h examples/*.ds? examples/*.vcproj examples/udf_example/udf_example.def -extra/.deps/charset2html.Po -extra/.deps/comp_err.Po -extra/.deps/innochecksum.Po -extra/.deps/my_print_defaults.Po -extra/.deps/mysql_waitpid.Po -extra/.deps/perror.Po -extra/.deps/replace.Po -extra/.deps/resolve_stack_dump.Po -extra/.deps/resolveip.Po extra/charset2html extra/comp_err extra/created_include_files @@ -531,54 +402,8 @@ extra/resolve_stack_dump extra/resolveip extra/sql_state.h extra/tztime.cc -extra/yassl/src/.deps/buffer.Plo -extra/yassl/src/.deps/cert_wrapper.Plo -extra/yassl/src/.deps/crypto_wrapper.Plo -extra/yassl/src/.deps/handshake.Plo -extra/yassl/src/.deps/lock.Plo -extra/yassl/src/.deps/log.Plo -extra/yassl/src/.deps/socket_wrapper.Plo -extra/yassl/src/.deps/ssl.Plo -extra/yassl/src/.deps/template_instnt.Plo -extra/yassl/src/.deps/timer.Plo -extra/yassl/src/.deps/yassl_error.Plo -extra/yassl/src/.deps/yassl_imp.Plo -extra/yassl/src/.deps/yassl_int.Plo -extra/yassl/taocrypt/benchmark/.deps/benchmark-benchmark.Po extra/yassl/taocrypt/benchmark/benchmark -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-aes.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-aestables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-algebra.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-arc4.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-asn.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-bftables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-blowfish.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-coding.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-des.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-dh.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-dsa.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-file.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-hash.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-integer.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md2.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md4.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md5.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-misc.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-random.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-ripemd.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-rsa.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-sha.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-template_instnt.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-tftables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-twofish.Plo -extra/yassl/taocrypt/test/.deps/test-test.Po extra/yassl/taocrypt/test/test -extra/yassl/testsuite/.deps/testsuite-client.Po -extra/yassl/testsuite/.deps/testsuite-echoclient.Po -extra/yassl/testsuite/.deps/testsuite-echoserver.Po -extra/yassl/testsuite/.deps/testsuite-server.Po -extra/yassl/testsuite/.deps/testsuite-test.Po -extra/yassl/testsuite/.deps/testsuite-testsuite.Po extra/yassl/testsuite/testsuite fcns.c fcns.h @@ -643,130 +468,6 @@ lib_release/* libmysql/*.c libmysql/*.ds? libmysql/*.vcproj -libmysql/.deps/array.Plo -libmysql/.deps/bchange.Plo -libmysql/.deps/bcmp.Plo -libmysql/.deps/bmove.Plo -libmysql/.deps/bmove_upp.Plo -libmysql/.deps/charset-def.Plo -libmysql/.deps/charset.Plo -libmysql/.deps/client.Plo -libmysql/.deps/conf_to_src.Po -libmysql/.deps/ctype-big5.Plo -libmysql/.deps/ctype-bin.Plo -libmysql/.deps/ctype-cp932.Plo -libmysql/.deps/ctype-czech.Plo -libmysql/.deps/ctype-euc_kr.Plo -libmysql/.deps/ctype-eucjpms.Plo -libmysql/.deps/ctype-extra.Plo -libmysql/.deps/ctype-gb2312.Plo -libmysql/.deps/ctype-gbk.Plo -libmysql/.deps/ctype-latin1.Plo -libmysql/.deps/ctype-mb.Plo -libmysql/.deps/ctype-simple.Plo -libmysql/.deps/ctype-sjis.Plo -libmysql/.deps/ctype-tis620.Plo -libmysql/.deps/ctype-uca.Plo -libmysql/.deps/ctype-ucs2.Plo -libmysql/.deps/ctype-ujis.Plo -libmysql/.deps/ctype-utf8.Plo -libmysql/.deps/ctype-win1250ch.Plo -libmysql/.deps/ctype.Plo -libmysql/.deps/dbug.Plo -libmysql/.deps/default.Plo -libmysql/.deps/default_modify.Plo -libmysql/.deps/errmsg.Plo -libmysql/.deps/errors.Plo -libmysql/.deps/get_password.Plo -libmysql/.deps/hash.Plo -libmysql/.deps/int2str.Plo -libmysql/.deps/is_prefix.Plo -libmysql/.deps/libmysql.Plo -libmysql/.deps/list.Plo -libmysql/.deps/llstr.Plo -libmysql/.deps/longlong2str.Plo -libmysql/.deps/manager.Plo -libmysql/.deps/md5.Plo -libmysql/.deps/mf_cache.Plo -libmysql/.deps/mf_dirname.Plo -libmysql/.deps/mf_fn_ext.Plo -libmysql/.deps/mf_format.Plo -libmysql/.deps/mf_iocache.Plo -libmysql/.deps/mf_iocache2.Plo -libmysql/.deps/mf_loadpath.Plo -libmysql/.deps/mf_pack.Plo -libmysql/.deps/mf_path.Plo -libmysql/.deps/mf_tempfile.Plo -libmysql/.deps/mf_unixpath.Plo -libmysql/.deps/mf_wcomp.Plo -libmysql/.deps/mulalloc.Plo -libmysql/.deps/my_alloc.Plo -libmysql/.deps/my_chsize.Plo -libmysql/.deps/my_compress.Plo -libmysql/.deps/my_create.Plo -libmysql/.deps/my_delete.Plo -libmysql/.deps/my_div.Plo -libmysql/.deps/my_error.Plo -libmysql/.deps/my_file.Plo -libmysql/.deps/my_fopen.Plo -libmysql/.deps/my_fstream.Plo -libmysql/.deps/my_gethostbyname.Plo -libmysql/.deps/my_getopt.Plo -libmysql/.deps/my_getwd.Plo -libmysql/.deps/my_init.Plo -libmysql/.deps/my_lib.Plo -libmysql/.deps/my_malloc.Plo -libmysql/.deps/my_messnc.Plo -libmysql/.deps/my_net.Plo -libmysql/.deps/my_once.Plo -libmysql/.deps/my_open.Plo -libmysql/.deps/my_port.Plo -libmysql/.deps/my_pread.Plo -libmysql/.deps/my_pthread.Plo -libmysql/.deps/my_read.Plo -libmysql/.deps/my_realloc.Plo -libmysql/.deps/my_rename.Plo -libmysql/.deps/my_seek.Plo -libmysql/.deps/my_sleep.Plo -libmysql/.deps/my_static.Plo -libmysql/.deps/my_strtoll10.Plo -libmysql/.deps/my_symlink.Plo -libmysql/.deps/my_thr_init.Plo -libmysql/.deps/my_time.Plo -libmysql/.deps/my_vsnprintf.Plo -libmysql/.deps/my_write.Plo -libmysql/.deps/net.Plo -libmysql/.deps/pack.Plo -libmysql/.deps/password.Plo -libmysql/.deps/safemalloc.Plo -libmysql/.deps/sha1.Plo -libmysql/.deps/str2int.Plo -libmysql/.deps/str_alloc.Plo -libmysql/.deps/strcend.Plo -libmysql/.deps/strcont.Plo -libmysql/.deps/strend.Plo -libmysql/.deps/strfill.Plo -libmysql/.deps/string.Plo -libmysql/.deps/strinstr.Plo -libmysql/.deps/strmake.Plo -libmysql/.deps/strmov.Plo -libmysql/.deps/strnlen.Plo -libmysql/.deps/strnmov.Plo -libmysql/.deps/strtod.Plo -libmysql/.deps/strtoll.Plo -libmysql/.deps/strtoull.Plo -libmysql/.deps/strxmov.Plo -libmysql/.deps/strxnmov.Plo -libmysql/.deps/thr_mutex.Plo -libmysql/.deps/typelib.Plo -libmysql/.deps/vio.Plo -libmysql/.deps/viosocket.Plo -libmysql/.deps/viossl.Plo -libmysql/.deps/viosslfactories.Plo -libmysql/.deps/xml.Plo -libmysql/.libs/libmysqlclient.lai -libmysql/.libs/libmysqlclient.so.15 -libmysql/.libs/libmysqlclient.so.15.0.0 libmysql/conf_to_src libmysql/debug/libmysql.exp libmysql/libmysql.ver @@ -779,130 +480,6 @@ libmysql/release/libmysql.exp libmysql/vio_priv.h libmysql/viosocket.o.6WmSJk libmysql_r/*.c -libmysql_r/.deps/array.Plo -libmysql_r/.deps/bchange.Plo -libmysql_r/.deps/bcmp.Plo -libmysql_r/.deps/bmove.Plo -libmysql_r/.deps/bmove_upp.Plo -libmysql_r/.deps/charset-def.Plo -libmysql_r/.deps/charset.Plo -libmysql_r/.deps/client.Plo -libmysql_r/.deps/conf_to_src.Po -libmysql_r/.deps/ctype-big5.Plo -libmysql_r/.deps/ctype-bin.Plo -libmysql_r/.deps/ctype-cp932.Plo -libmysql_r/.deps/ctype-czech.Plo -libmysql_r/.deps/ctype-euc_kr.Plo -libmysql_r/.deps/ctype-eucjpms.Plo -libmysql_r/.deps/ctype-extra.Plo -libmysql_r/.deps/ctype-gb2312.Plo -libmysql_r/.deps/ctype-gbk.Plo -libmysql_r/.deps/ctype-latin1.Plo -libmysql_r/.deps/ctype-mb.Plo -libmysql_r/.deps/ctype-simple.Plo -libmysql_r/.deps/ctype-sjis.Plo -libmysql_r/.deps/ctype-tis620.Plo -libmysql_r/.deps/ctype-uca.Plo -libmysql_r/.deps/ctype-ucs2.Plo -libmysql_r/.deps/ctype-ujis.Plo -libmysql_r/.deps/ctype-utf8.Plo -libmysql_r/.deps/ctype-win1250ch.Plo -libmysql_r/.deps/ctype.Plo -libmysql_r/.deps/dbug.Plo -libmysql_r/.deps/default.Plo -libmysql_r/.deps/default_modify.Plo -libmysql_r/.deps/errmsg.Plo -libmysql_r/.deps/errors.Plo -libmysql_r/.deps/get_password.Plo -libmysql_r/.deps/hash.Plo -libmysql_r/.deps/int2str.Plo -libmysql_r/.deps/is_prefix.Plo -libmysql_r/.deps/libmysql.Plo -libmysql_r/.deps/list.Plo -libmysql_r/.deps/llstr.Plo -libmysql_r/.deps/longlong2str.Plo -libmysql_r/.deps/manager.Plo -libmysql_r/.deps/md5.Plo -libmysql_r/.deps/mf_cache.Plo -libmysql_r/.deps/mf_dirname.Plo -libmysql_r/.deps/mf_fn_ext.Plo -libmysql_r/.deps/mf_format.Plo -libmysql_r/.deps/mf_iocache.Plo -libmysql_r/.deps/mf_iocache2.Plo -libmysql_r/.deps/mf_loadpath.Plo -libmysql_r/.deps/mf_pack.Plo -libmysql_r/.deps/mf_path.Plo -libmysql_r/.deps/mf_tempfile.Plo -libmysql_r/.deps/mf_unixpath.Plo -libmysql_r/.deps/mf_wcomp.Plo -libmysql_r/.deps/mulalloc.Plo -libmysql_r/.deps/my_alloc.Plo -libmysql_r/.deps/my_chsize.Plo -libmysql_r/.deps/my_compress.Plo -libmysql_r/.deps/my_create.Plo -libmysql_r/.deps/my_delete.Plo -libmysql_r/.deps/my_div.Plo -libmysql_r/.deps/my_error.Plo -libmysql_r/.deps/my_file.Plo -libmysql_r/.deps/my_fopen.Plo -libmysql_r/.deps/my_fstream.Plo -libmysql_r/.deps/my_gethostbyname.Plo -libmysql_r/.deps/my_getopt.Plo -libmysql_r/.deps/my_getwd.Plo -libmysql_r/.deps/my_init.Plo -libmysql_r/.deps/my_lib.Plo -libmysql_r/.deps/my_malloc.Plo -libmysql_r/.deps/my_messnc.Plo -libmysql_r/.deps/my_net.Plo -libmysql_r/.deps/my_once.Plo -libmysql_r/.deps/my_open.Plo -libmysql_r/.deps/my_port.Plo -libmysql_r/.deps/my_pread.Plo -libmysql_r/.deps/my_pthread.Plo -libmysql_r/.deps/my_read.Plo -libmysql_r/.deps/my_realloc.Plo -libmysql_r/.deps/my_rename.Plo -libmysql_r/.deps/my_seek.Plo -libmysql_r/.deps/my_sleep.Plo -libmysql_r/.deps/my_static.Plo -libmysql_r/.deps/my_strtoll10.Plo -libmysql_r/.deps/my_symlink.Plo -libmysql_r/.deps/my_thr_init.Plo -libmysql_r/.deps/my_time.Plo -libmysql_r/.deps/my_vsnprintf.Plo -libmysql_r/.deps/my_write.Plo -libmysql_r/.deps/net.Plo -libmysql_r/.deps/pack.Plo -libmysql_r/.deps/password.Plo -libmysql_r/.deps/safemalloc.Plo -libmysql_r/.deps/sha1.Plo -libmysql_r/.deps/str2int.Plo -libmysql_r/.deps/str_alloc.Plo -libmysql_r/.deps/strcend.Plo -libmysql_r/.deps/strcont.Plo -libmysql_r/.deps/strend.Plo -libmysql_r/.deps/strfill.Plo -libmysql_r/.deps/string.Plo -libmysql_r/.deps/strinstr.Plo -libmysql_r/.deps/strmake.Plo -libmysql_r/.deps/strmov.Plo -libmysql_r/.deps/strnlen.Plo -libmysql_r/.deps/strnmov.Plo -libmysql_r/.deps/strtod.Plo -libmysql_r/.deps/strtoll.Plo -libmysql_r/.deps/strtoull.Plo -libmysql_r/.deps/strxmov.Plo -libmysql_r/.deps/strxnmov.Plo -libmysql_r/.deps/thr_mutex.Plo -libmysql_r/.deps/typelib.Plo -libmysql_r/.deps/vio.Plo -libmysql_r/.deps/viosocket.Plo -libmysql_r/.deps/viossl.Plo -libmysql_r/.deps/viosslfactories.Plo -libmysql_r/.deps/xml.Plo -libmysql_r/.libs/libmysqlclient_r.lai -libmysql_r/.libs/libmysqlclient_r.so.15 -libmysql_r/.libs/libmysqlclient_r.so.15.0.0 libmysql_r/acconfig.h libmysql_r/client_settings.h libmysql_r/conf_to_src @@ -912,123 +489,6 @@ libmysql_r/mysys_priv.h libmysql_r/vio_priv.h libmysqld/*.ds? libmysqld/*.vcproj -libmysqld/.deps/client.Po -libmysqld/.deps/derror.Po -libmysqld/.deps/discover.Po -libmysqld/.deps/emb_qcache.Po -libmysqld/.deps/errmsg.Po -libmysqld/.deps/event_data_objects.Po -libmysqld/.deps/event_db_repository.Po -libmysqld/.deps/event_queue.Po -libmysqld/.deps/event_scheduler.Po -libmysqld/.deps/events.Po -libmysqld/.deps/field.Po -libmysqld/.deps/field_conv.Po -libmysqld/.deps/filesort.Po -libmysqld/.deps/get_password.Po -libmysqld/.deps/gstream.Po -libmysqld/.deps/ha_berkeley.Po -libmysqld/.deps/ha_federated.Po -libmysqld/.deps/ha_heap.Po -libmysqld/.deps/ha_innodb.Po -libmysqld/.deps/ha_myisam.Po -libmysqld/.deps/ha_myisammrg.Po -libmysqld/.deps/ha_ndbcluster.Po -libmysqld/.deps/ha_ndbcluster_binlog.Po -libmysqld/.deps/ha_partition.Po -libmysqld/.deps/handler.Po -libmysqld/.deps/hash_filo.Po -libmysqld/.deps/hostname.Po -libmysqld/.deps/init.Po -libmysqld/.deps/item.Po -libmysqld/.deps/item_buff.Po -libmysqld/.deps/item_cmpfunc.Po -libmysqld/.deps/item_create.Po -libmysqld/.deps/item_func.Po -libmysqld/.deps/item_geofunc.Po -libmysqld/.deps/item_row.Po -libmysqld/.deps/item_strfunc.Po -libmysqld/.deps/item_subselect.Po -libmysqld/.deps/item_sum.Po -libmysqld/.deps/item_timefunc.Po -libmysqld/.deps/item_uniq.Po -libmysqld/.deps/item_xmlfunc.Po -libmysqld/.deps/key.Po -libmysqld/.deps/lib_sql.Po -libmysqld/.deps/libmysql.Po -libmysqld/.deps/libmysqld.Po -libmysqld/.deps/lock.Po -libmysqld/.deps/log.Po -libmysqld/.deps/log_event.Po -libmysqld/.deps/my_decimal.Po -libmysqld/.deps/my_time.Po -libmysqld/.deps/my_user.Po -libmysqld/.deps/net_serv.Po -libmysqld/.deps/opt_range.Po -libmysqld/.deps/opt_sum.Po -libmysqld/.deps/pack.Po -libmysqld/.deps/parse_file.Po -libmysqld/.deps/partition_info.Po -libmysqld/.deps/password.Po -libmysqld/.deps/procedure.Po -libmysqld/.deps/protocol.Po -libmysqld/.deps/records.Po -libmysqld/.deps/rpl_filter.Po -libmysqld/.deps/rpl_injector.Po -libmysqld/.deps/set_var.Po -libmysqld/.deps/sp.Po -libmysqld/.deps/sp_cache.Po -libmysqld/.deps/sp_head.Po -libmysqld/.deps/sp_pcontext.Po -libmysqld/.deps/sp_rcontext.Po -libmysqld/.deps/spatial.Po -libmysqld/.deps/sql_acl.Po -libmysqld/.deps/sql_analyse.Po -libmysqld/.deps/sql_base.Po -libmysqld/.deps/sql_builtin.Po -libmysqld/.deps/sql_cache.Po -libmysqld/.deps/sql_class.Po -libmysqld/.deps/sql_crypt.Po -libmysqld/.deps/sql_cursor.Po -libmysqld/.deps/sql_db.Po -libmysqld/.deps/sql_delete.Po -libmysqld/.deps/sql_derived.Po -libmysqld/.deps/sql_do.Po -libmysqld/.deps/sql_error.Po -libmysqld/.deps/sql_handler.Po -libmysqld/.deps/sql_help.Po -libmysqld/.deps/sql_insert.Po -libmysqld/.deps/sql_lex.Po -libmysqld/.deps/sql_list.Po -libmysqld/.deps/sql_load.Po -libmysqld/.deps/sql_manager.Po -libmysqld/.deps/sql_map.Po -libmysqld/.deps/sql_parse.Po -libmysqld/.deps/sql_partition.Po -libmysqld/.deps/sql_plugin.Po -libmysqld/.deps/sql_prepare.Po -libmysqld/.deps/sql_rename.Po -libmysqld/.deps/sql_select.Po -libmysqld/.deps/sql_show.Po -libmysqld/.deps/sql_state.Po -libmysqld/.deps/sql_string.Po -libmysqld/.deps/sql_table.Po -libmysqld/.deps/sql_tablespace.Po -libmysqld/.deps/sql_test.Po -libmysqld/.deps/sql_trigger.Po -libmysqld/.deps/sql_udf.Po -libmysqld/.deps/sql_union.Po -libmysqld/.deps/sql_update.Po -libmysqld/.deps/sql_view.Po -libmysqld/.deps/sql_yacc.Po -libmysqld/.deps/stacktrace.Po -libmysqld/.deps/strfunc.Po -libmysqld/.deps/table.Po -libmysqld/.deps/thr_malloc.Po -libmysqld/.deps/time.Po -libmysqld/.deps/tztime.Po -libmysqld/.deps/uniques.Po -libmysqld/.deps/unireg.Po libmysqld/backup_dir libmysqld/client.c libmysqld/client_settings.h @@ -1046,11 +506,6 @@ libmysqld/event_queue.cc libmysqld/event_scheduler.cc libmysqld/event_timed.cc libmysqld/events.cc -libmysqld/examples/.deps/completion_hash.Po -libmysqld/examples/.deps/mysql.Po -libmysqld/examples/.deps/mysql_client_test.Po -libmysqld/examples/.deps/mysqltest.Po -libmysqld/examples/.deps/readline.Po libmysqld/examples/client_test.c libmysqld/examples/client_test.cc libmysqld/examples/completion_hash.cc @@ -1083,6 +538,7 @@ libmysqld/ha_innobase.cc libmysqld/ha_innodb.cc libmysqld/ha_isam.cc libmysqld/ha_isammrg.cc +libmysqld/ha_maria.cc libmysqld/ha_myisam.cc libmysqld/ha_myisammrg.cc libmysqld/ha_ndbcluster.cc @@ -1224,7 +680,11 @@ linked_server_sources linked_tools_sources locked ltmain.sh +ma_test_recovery.output man/*.1 +maria-win.patch +maria_log.00000* +maria_log_control merge/*.ds? merge/*.vcproj missing @@ -1287,7 +747,6 @@ mysql-test/*.vcproj mysql-test/.DS_Store mysql-test/funcs_1.log mysql-test/funcs_1.tar -mysql-test/gmon.out mysql-test/install_test_db mysql-test/lib/init_db.sql mysql-test/linux_sys_vars.inc @@ -1422,120 +881,6 @@ mysqlserver/*.vcproj mysys/#mf_iocache.c# mysys/*.ds? mysys/*.vcproj -mysys/.deps/array.Po -mysys/.deps/base64.Po -mysys/.deps/charset-def.Po -mysys/.deps/charset.Po -mysys/.deps/checksum.Po -mysys/.deps/default.Po -mysys/.deps/default_modify.Po -mysys/.deps/errors.Po -mysys/.deps/hash.Po -mysys/.deps/list.Po -mysys/.deps/md5.Po -mysys/.deps/mf_brkhant.Po -mysys/.deps/mf_cache.Po -mysys/.deps/mf_dirname.Po -mysys/.deps/mf_fn_ext.Po -mysys/.deps/mf_format.Po -mysys/.deps/mf_getdate.Po -mysys/.deps/mf_iocache.Po -mysys/.deps/mf_iocache2.Po -mysys/.deps/mf_keycache.Po -mysys/.deps/mf_keycaches.Po -mysys/.deps/mf_loadpath.Po -mysys/.deps/mf_pack.Po -mysys/.deps/mf_path.Po -mysys/.deps/mf_qsort.Po -mysys/.deps/mf_qsort2.Po -mysys/.deps/mf_radix.Po -mysys/.deps/mf_same.Po -mysys/.deps/mf_sort.Po -mysys/.deps/mf_strip.Po -mysys/.deps/mf_tempdir.Po -mysys/.deps/mf_tempfile.Po -mysys/.deps/mf_unixpath.Po -mysys/.deps/mf_wcomp.Po -mysys/.deps/mf_wfile.Po -mysys/.deps/mulalloc.Po -mysys/.deps/my_access.Po -mysys/.deps/my_aes.Po -mysys/.deps/my_alarm.Po -mysys/.deps/my_alloc.Po -mysys/.deps/my_append.Po -mysys/.deps/my_atomic.Po -mysys/.deps/my_bit.Po -mysys/.deps/my_bitmap.Po -mysys/.deps/my_chsize.Po -mysys/.deps/my_clock.Po -mysys/.deps/my_compress.Po -mysys/.deps/my_copy.Po -mysys/.deps/my_crc32.Po -mysys/.deps/my_create.Po -mysys/.deps/my_delete.Po -mysys/.deps/my_div.Po -mysys/.deps/my_dup.Po -mysys/.deps/my_error.Po -mysys/.deps/my_file.Po -mysys/.deps/my_fopen.Po -mysys/.deps/my_fstream.Po -mysys/.deps/my_gethostbyname.Po -mysys/.deps/my_gethwaddr.Po -mysys/.deps/my_getncpus.Po -mysys/.deps/my_getopt.Po -mysys/.deps/my_getsystime.Po -mysys/.deps/my_getwd.Po -mysys/.deps/my_handler.Po -mysys/.deps/my_init.Po -mysys/.deps/my_largepage.Po -mysys/.deps/my_lib.Po -mysys/.deps/my_libwrap.Po -mysys/.deps/my_lock.Po -mysys/.deps/my_lockmem.Po -mysys/.deps/my_lread.Po -mysys/.deps/my_lwrite.Po -mysys/.deps/my_malloc.Po -mysys/.deps/my_memmem.Po -mysys/.deps/my_messnc.Po -mysys/.deps/my_mkdir.Po -mysys/.deps/my_mmap.Po -mysys/.deps/my_net.Po -mysys/.deps/my_netware.Po -mysys/.deps/my_new.Po -mysys/.deps/my_once.Po -mysys/.deps/my_open.Po -mysys/.deps/my_port.Po -mysys/.deps/my_pread.Po -mysys/.deps/my_pthread.Po -mysys/.deps/my_quick.Po -mysys/.deps/my_read.Po -mysys/.deps/my_realloc.Po -mysys/.deps/my_redel.Po -mysys/.deps/my_rename.Po -mysys/.deps/my_seek.Po -mysys/.deps/my_semaphore.Po -mysys/.deps/my_sleep.Po -mysys/.deps/my_static.Po -mysys/.deps/my_symlink.Po -mysys/.deps/my_symlink2.Po -mysys/.deps/my_sync.Po -mysys/.deps/my_thr_init.Po -mysys/.deps/my_vle.Po -mysys/.deps/my_windac.Po -mysys/.deps/my_write.Po -mysys/.deps/ptr_cmp.Po -mysys/.deps/queues.Po -mysys/.deps/rijndael.Po -mysys/.deps/safemalloc.Po -mysys/.deps/sha1.Po -mysys/.deps/string.Po -mysys/.deps/thr_alarm.Po -mysys/.deps/thr_lock.Po -mysys/.deps/thr_mutex.Po -mysys/.deps/thr_rwlock.Po -mysys/.deps/tree.Po -mysys/.deps/trie.Po -mysys/.deps/typelib.Po mysys/charset2html mysys/getopt.c mysys/getopt1.c @@ -1678,48 +1023,16 @@ ndb/lib/libNEWTON_BASICTEST_COMMON.so ndb/lib/libREP_API.so ndb/lib/libndbclient.so ndb/lib/libndbclient_extra.so -ndb/src/common/debugger/libtrace.dsp -ndb/src/common/debugger/signaldata/libsignaldataprint.dsp -ndb/src/common/logger/liblogger.dsp -ndb/src/common/mgmcommon/libmgmsrvcommon.dsp ndb/src/common/mgmcommon/printConfig/*.d -ndb/src/common/portlib/libportlib.dsp -ndb/src/common/transporter/libtransporter.dsp -ndb/src/common/util/libgeneral.dsp ndb/src/common/util/testBitmask.cpp ndb/src/cw/cpcd/ndb_cpcd ndb/src/dummy.cpp -ndb/src/kernel/blocks/backup/libbackup.dsp ndb/src/kernel/blocks/backup/restore/ndb_restore -ndb/src/kernel/blocks/cmvmi/libcmvmi.dsp -ndb/src/kernel/blocks/dbacc/libdbacc.dsp -ndb/src/kernel/blocks/dbdict/libdbdict.dsp -ndb/src/kernel/blocks/dbdih/libdbdih.dsp -ndb/src/kernel/blocks/dblqh/libdblqh.dsp -ndb/src/kernel/blocks/dbtc/libdbtc.dsp -ndb/src/kernel/blocks/dbtup/libdbtup.dsp -ndb/src/kernel/blocks/dbtux/libdbtux.dsp -ndb/src/kernel/blocks/dbutil/libdbutil.dsp -ndb/src/kernel/blocks/grep/libgrep.dsp -ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp -ndb/src/kernel/blocks/ndbfs/libndbfs.dsp -ndb/src/kernel/blocks/qmgr/libqmgr.dsp -ndb/src/kernel/blocks/suma/libsuma.dsp -ndb/src/kernel/blocks/trix/libtrix.dsp -ndb/src/kernel/error/liberror.dsp ndb/src/kernel/ndbd -ndb/src/kernel/ndbd.dsp -ndb/src/kernel/vm/libkernel.dsp ndb/src/libndb.ver -ndb/src/libndbclient.dsp -ndb/src/mgmapi/libmgmapi.dsp -ndb/src/mgmclient/libndbmgmclient.dsp ndb/src/mgmclient/ndb_mgm -ndb/src/mgmclient/ndb_mgm.dsp ndb/src/mgmclient/test_cpcd/*.d ndb/src/mgmsrv/ndb_mgmd -ndb/src/mgmsrv/ndb_mgmd.dsp -ndb/src/ndbapi/libndbapi.dsp ndb/test/ndbapi/bank/bankCreator ndb/test/ndbapi/bank/bankMakeGL ndb/test/ndbapi/bank/bankSumAccounts @@ -1732,15 +1045,12 @@ ndb/test/ndbapi/create_tab ndb/test/ndbapi/drop_all_tabs ndb/test/ndbapi/flexAsynch ndb/test/ndbapi/flexBench -ndb/test/ndbapi/flexBench.dsp ndb/test/ndbapi/flexHammer ndb/test/ndbapi/flexTT ndb/test/ndbapi/testBackup ndb/test/ndbapi/testBasic -ndb/test/ndbapi/testBasic.dsp ndb/test/ndbapi/testBasicAsynch ndb/test/ndbapi/testBlobs -ndb/test/ndbapi/testBlobs.dsp ndb/test/ndbapi/testDataBuffers ndb/test/ndbapi/testDeadlock ndb/test/ndbapi/testDict @@ -1753,7 +1063,6 @@ ndb/test/ndbapi/testOperations ndb/test/ndbapi/testRestartGci ndb/test/ndbapi/testSRBank ndb/test/ndbapi/testScan -ndb/test/ndbapi/testScan.dsp ndb/test/ndbapi/testScanInterpreter ndb/test/ndbapi/testScanPerf ndb/test/ndbapi/testSystemRestart @@ -1761,7 +1070,6 @@ ndb/test/ndbapi/testTimeout ndb/test/ndbapi/testTransactions ndb/test/ndbapi/test_event ndb/test/run-test/atrt -ndb/test/src/libNDBT.dsp ndb/test/tools/copy_tab ndb/test/tools/create_index ndb/test/tools/hugoCalculator @@ -1779,23 +1087,15 @@ ndb/test/tools/restart ndb/test/tools/verify_index ndb/tools/ndb_config ndb/tools/ndb_delete_all -ndb/tools/ndb_delete_all.dsp ndb/tools/ndb_desc -ndb/tools/ndb_desc.dsp ndb/tools/ndb_drop_index -ndb/tools/ndb_drop_index.dsp ndb/tools/ndb_drop_table -ndb/tools/ndb_drop_table.dsp ndb/tools/ndb_restore ndb/tools/ndb_select_all -ndb/tools/ndb_select_all.dsp ndb/tools/ndb_select_count -ndb/tools/ndb_select_count.dsp ndb/tools/ndb_show_tables -ndb/tools/ndb_show_tables.dsp ndb/tools/ndb_test_platform ndb/tools/ndb_waiter -ndb/tools/ndb_waiter.dsp ndbcluster-1186 ndbcluster-1186/SCCS ndbcluster-1186/config.ini @@ -1809,40 +1109,15 @@ ndbcluster-1186/ndb_3.pid ndbcluster-1186/ndb_3_cluster.log ndbcluster-1186/ndb_3_out.log ndbcluster-1186/ndbcluster.pid -netware/.deps/libmysqlmain.Po -netware/.deps/my_manage.Po -netware/.deps/mysql_install_db.Po -netware/.deps/mysql_test_run.Po -netware/.deps/mysqld_safe.Po netware/init_db.sql netware/libmysql.imp netware/test_db.sql pack_isam/*.ds? perror/*.ds? perror/*.vcproj -plugin/fulltext/.deps/mypluglib_la-plugin_example.Plo -plugin/fulltext/.libs/mypluglib.lai -plugin/fulltext/.libs/mypluglib.so.0 -plugin/fulltext/.libs/mypluglib.so.0.0.0 -pstack/.deps/bucomm.Po -pstack/.deps/debug.Po -pstack/.deps/filemode.Po -pstack/.deps/ieee.Po -pstack/.deps/linuxthreads.Po -pstack/.deps/pstack.Po -pstack/.deps/rddbg.Po -pstack/.deps/stabs.Po pull.log regex/*.ds? regex/*.vcproj -regex/.deps/debug.Po -regex/.deps/main.Po -regex/.deps/regcomp.Po -regex/.deps/regerror.Po -regex/.deps/regexec.Po -regex/.deps/regfree.Po -regex/.deps/reginit.Po -regex/.deps/split.Po regex/re repl-tests/test-repl-ts/repl-timestamp.master.reject repl-tests/test-repl/foo-dump-slave.master. @@ -1887,28 +1162,6 @@ scripts/mysqlhotcopy scripts/mysqlhotcopy.sh.rej scripts/safe_mysqld select_test -server-tools/instance-manager/.deps/buffer.Po -server-tools/instance-manager/.deps/command.Po -server-tools/instance-manager/.deps/commands.Po -server-tools/instance-manager/.deps/guardian.Po -server-tools/instance-manager/.deps/instance.Po -server-tools/instance-manager/.deps/instance_map.Po -server-tools/instance-manager/.deps/instance_options.Po -server-tools/instance-manager/.deps/liboptions_la-options.Plo -server-tools/instance-manager/.deps/liboptions_la-priv.Plo -server-tools/instance-manager/.deps/listener.Po -server-tools/instance-manager/.deps/log.Po -server-tools/instance-manager/.deps/manager.Po -server-tools/instance-manager/.deps/messages.Po -server-tools/instance-manager/.deps/mysql_connection.Po -server-tools/instance-manager/.deps/mysqlmanager.Po -server-tools/instance-manager/.deps/net_serv.Po -server-tools/instance-manager/.deps/parse.Po -server-tools/instance-manager/.deps/parse_output.Po -server-tools/instance-manager/.deps/protocol.Po -server-tools/instance-manager/.deps/thread_registry.Po -server-tools/instance-manager/.deps/user_management_commands.Po -server-tools/instance-manager/.deps/user_map.Po server-tools/instance-manager/buffer.cpp server-tools/instance-manager/client.c server-tools/instance-manager/client_settings.h @@ -1966,140 +1219,10 @@ sql-bench/test-wisconsin sql/*.cpp sql/*.ds? sql/*.vcproj -sql/.deps/client.Po -sql/.deps/derror.Po -sql/.deps/des_key_file.Po -sql/.deps/discover.Po -sql/.deps/event_data_objects.Po -sql/.deps/event_db_repository.Po -sql/.deps/event_queue.Po -sql/.deps/event_scheduler.Po -sql/.deps/events.Po -sql/.deps/field.Po -sql/.deps/field_conv.Po -sql/.deps/filesort.Po -sql/.deps/gen_lex_hash.Po -sql/.deps/gstream.Po -sql/.deps/ha_berkeley.Po -sql/.deps/ha_federated.Po -sql/.deps/ha_heap.Po -sql/.deps/ha_innodb.Po -sql/.deps/ha_myisam.Po -sql/.deps/ha_myisammrg.Po -sql/.deps/ha_ndbcluster.Po -sql/.deps/ha_ndbcluster_binlog.Po -sql/.deps/ha_partition.Po -sql/.deps/handler.Po -sql/.deps/hash_filo.Po -sql/.deps/hostname.Po -sql/.deps/init.Po -sql/.deps/item.Po -sql/.deps/item_buff.Po -sql/.deps/item_cmpfunc.Po -sql/.deps/item_create.Po -sql/.deps/item_func.Po -sql/.deps/item_geofunc.Po -sql/.deps/item_row.Po -sql/.deps/item_strfunc.Po -sql/.deps/item_subselect.Po -sql/.deps/item_sum.Po -sql/.deps/item_timefunc.Po -sql/.deps/item_uniq.Po -sql/.deps/item_xmlfunc.Po -sql/.deps/key.Po -sql/.deps/lock.Po -sql/.deps/log.Po -sql/.deps/log_event.Po -sql/.deps/mf_iocache.Po -sql/.deps/mini_client_errors.Po -sql/.deps/my_decimal.Po -sql/.deps/my_lock.Po -sql/.deps/my_time.Po -sql/.deps/my_user.Po -sql/.deps/mysql_tzinfo_to_sql.Po -sql/.deps/mysqld.Po -sql/.deps/net_serv.Po -sql/.deps/opt_range.Po -sql/.deps/opt_sum.Po -sql/.deps/pack.Po -sql/.deps/parse_file.Po -sql/.deps/partition_info.Po -sql/.deps/password.Po -sql/.deps/procedure.Po -sql/.deps/protocol.Po -sql/.deps/records.Po -sql/.deps/repl_failsafe.Po -sql/.deps/rpl_filter.Po -sql/.deps/rpl_injector.Po -sql/.deps/rpl_tblmap.Po -sql/.deps/set_var.Po -sql/.deps/slave.Po -sql/.deps/sp.Po -sql/.deps/sp_cache.Po -sql/.deps/sp_head.Po -sql/.deps/sp_pcontext.Po -sql/.deps/sp_rcontext.Po -sql/.deps/spatial.Po -sql/.deps/sql_acl.Po -sql/.deps/sql_analyse.Po -sql/.deps/sql_base.Po -sql/.deps/sql_binlog.Po -sql/.deps/sql_builtin.Po -sql/.deps/sql_cache.Po -sql/.deps/sql_class.Po -sql/.deps/sql_client.Po -sql/.deps/sql_crypt.Po -sql/.deps/sql_cursor.Po -sql/.deps/sql_db.Po -sql/.deps/sql_delete.Po -sql/.deps/sql_derived.Po -sql/.deps/sql_do.Po -sql/.deps/sql_error.Po -sql/.deps/sql_handler.Po -sql/.deps/sql_help.Po -sql/.deps/sql_insert.Po -sql/.deps/sql_lex.Po -sql/.deps/sql_list.Po -sql/.deps/sql_load.Po -sql/.deps/sql_manager.Po -sql/.deps/sql_map.Po -sql/.deps/sql_olap.Po -sql/.deps/sql_parse.Po -sql/.deps/sql_partition.Po -sql/.deps/sql_plugin.Po -sql/.deps/sql_prepare.Po -sql/.deps/sql_rename.Po -sql/.deps/sql_repl.Po -sql/.deps/sql_select.Po -sql/.deps/sql_show.Po -sql/.deps/sql_state.Po -sql/.deps/sql_string.Po -sql/.deps/sql_table.Po -sql/.deps/sql_tablespace.Po -sql/.deps/sql_test.Po -sql/.deps/sql_trigger.Po -sql/.deps/sql_udf.Po -sql/.deps/sql_union.Po -sql/.deps/sql_update.Po -sql/.deps/sql_view.Po -sql/.deps/sql_yacc.Po -sql/.deps/stacktrace.Po -sql/.deps/strfunc.Po -sql/.deps/table.Po -sql/.deps/thr_malloc.Po -sql/.deps/time.Po -sql/.deps/tztime.Po -sql/.deps/udf_example.Plo -sql/.deps/uniques.Po -sql/.deps/unireg.Po sql/.gdbinit -sql/.libs/udf_example.lai -sql/.libs/udf_example.so.0 -sql/.libs/udf_example.so.0.0.0 sql/client.c sql/f.c sql/gen_lex_hash -sql/gmon.out sql/handlerton.cc sql/lex_hash.h sql/link_sources @@ -2122,13 +1245,33 @@ sql/new.cc sql/pack.c sql/safe_to_cache_query.txt sql/share/*.sys -sql/share/charsets/gmon.out sql/share/fixerrmsg.pl -sql/share/gmon.out sql/share/iso639-2.txt sql/share/mysql -sql/share/norwegian-ny/errmsg.sys -sql/share/norwegian/errmsg.sys +sql/share/czech/ +sql/share/danish/ +sql/share/dutch/ +sql/share/english/ +sql/share/estonian/ +sql/share/french/ +sql/share/german/ +sql/share/greek/ +sql/share/hungarian/ +sql/share/italian/ +sql/share/japanese/ +sql/share/japanese-sjis/ +sql/share/korean/ +sql/share/norwegian/ +sql/share/norwegian-ny/ +sql/share/polish/ +sql/share/portuguese/ +sql/share/romanian/ +sql/share/russian/ +sql/share/serbian/ +sql/share/slovak/ +sql/share/spanish/ +sql/share/swedish/ +sql/share/ukrainian/ sql/sql_builtin.cc sql/sql_select.cc.orig sql/sql_yacc.cc @@ -2148,12 +1291,6 @@ stamp-h2.in stamp-h3 stamp-h4 start_mysqld.sh -storage/archive/.deps/archive_test-archive_test.Po -storage/archive/.deps/archive_test-azio.Po -storage/archive/.deps/ha_archive_la-azio.Plo -storage/archive/.deps/ha_archive_la-ha_archive.Plo -storage/archive/.deps/libarchive_a-azio.Po -storage/archive/.deps/libarchive_a-ha_archive.Po storage/archive/archive_reader storage/archive/archive_test storage/bdb/*.ds? @@ -2175,44 +1312,14 @@ storage/bdb/build_vxworks/db_int.h storage/bdb/build_vxworks/dbdemo/dbdemo.c storage/bdb/build_vxworks/dbdemo/dbdemo20.wpj storage/bdb/build_vxworks/dbdemo/dbdemo22.wpj -storage/bdb/build_win32/*.dsp storage/bdb/build_win32/*.h storage/bdb/build_win32/db.h -storage/bdb/build_win32/db_archive.dsp -storage/bdb/build_win32/db_checkpoint.dsp storage/bdb/build_win32/db_config.h storage/bdb/build_win32/db_cxx.h -storage/bdb/build_win32/db_deadlock.dsp -storage/bdb/build_win32/db_dll.dsp -storage/bdb/build_win32/db_dump.dsp storage/bdb/build_win32/db_int.h -storage/bdb/build_win32/db_java.dsp -storage/bdb/build_win32/db_load.dsp -storage/bdb/build_win32/db_perf.dsp -storage/bdb/build_win32/db_printlog.dsp -storage/bdb/build_win32/db_recover.dsp -storage/bdb/build_win32/db_stat.dsp -storage/bdb/build_win32/db_static.dsp -storage/bdb/build_win32/db_tcl.dsp -storage/bdb/build_win32/db_test.dsp -storage/bdb/build_win32/db_upgrade.dsp -storage/bdb/build_win32/db_verify.dsp -storage/bdb/build_win32/ex_access.dsp -storage/bdb/build_win32/ex_btrec.dsp -storage/bdb/build_win32/ex_env.dsp -storage/bdb/build_win32/ex_lock.dsp -storage/bdb/build_win32/ex_mpool.dsp -storage/bdb/build_win32/ex_tpcb.dsp -storage/bdb/build_win32/excxx_access.dsp -storage/bdb/build_win32/excxx_btrec.dsp -storage/bdb/build_win32/excxx_env.dsp -storage/bdb/build_win32/excxx_lock.dsp -storage/bdb/build_win32/excxx_mpool.dsp -storage/bdb/build_win32/excxx_tpcb.dsp storage/bdb/build_win32/include.tcl storage/bdb/build_win32/libdb.def storage/bdb/build_win32/libdb.rc -storage/bdb/build_win64/*.dsp storage/bdb/build_win64/*.dsw storage/bdb/build_win64/*.h storage/bdb/db/crdel_auto.c @@ -2314,38 +1421,6 @@ storage/bdb/test/include.tcl storage/bdb/test/logtrack.list storage/bdb/txn/txn_auto.c storage/bdb/txn/txn_autop.c -storage/blackhole/.deps/ha_blackhole_la-ha_blackhole.Plo -storage/blackhole/.deps/libblackhole_a-ha_blackhole.Po -storage/csv/.deps/ha_csv_la-ha_tina.Plo -storage/csv/.deps/libcsv_a-ha_tina.Po -storage/example/.deps/ha_example_la-ha_example.Plo -storage/example/.deps/libexample_a-ha_example.Po -storage/heap/.deps/_check.Po -storage/heap/.deps/_rectest.Po -storage/heap/.deps/hp_block.Po -storage/heap/.deps/hp_clear.Po -storage/heap/.deps/hp_close.Po -storage/heap/.deps/hp_create.Po -storage/heap/.deps/hp_delete.Po -storage/heap/.deps/hp_extra.Po -storage/heap/.deps/hp_hash.Po -storage/heap/.deps/hp_info.Po -storage/heap/.deps/hp_open.Po -storage/heap/.deps/hp_panic.Po -storage/heap/.deps/hp_rename.Po -storage/heap/.deps/hp_rfirst.Po -storage/heap/.deps/hp_rkey.Po -storage/heap/.deps/hp_rlast.Po -storage/heap/.deps/hp_rnext.Po -storage/heap/.deps/hp_rprev.Po -storage/heap/.deps/hp_rrnd.Po -storage/heap/.deps/hp_rsame.Po -storage/heap/.deps/hp_scan.Po -storage/heap/.deps/hp_static.Po -storage/heap/.deps/hp_test1.Po -storage/heap/.deps/hp_test2.Po -storage/heap/.deps/hp_update.Po -storage/heap/.deps/hp_write.Po storage/heap/hp_test1 storage/heap/hp_test2 storage/innobase/autom4te-2.53.cache/* @@ -2356,155 +1431,55 @@ storage/innobase/autom4te.cache/* storage/innobase/autom4te.cache/output.0 storage/innobase/autom4te.cache/requests storage/innobase/autom4te.cache/traces.0 -storage/innobase/btr/.deps/btr0btr.Po -storage/innobase/btr/.deps/btr0cur.Po -storage/innobase/btr/.deps/btr0pcur.Po -storage/innobase/btr/.deps/btr0sea.Po -storage/innobase/buf/.deps/buf0buf.Po -storage/innobase/buf/.deps/buf0flu.Po -storage/innobase/buf/.deps/buf0lru.Po -storage/innobase/buf/.deps/buf0rea.Po storage/innobase/configure.lineno storage/innobase/conftest.s1 storage/innobase/conftest.subs -storage/innobase/data/.deps/data0data.Po -storage/innobase/data/.deps/data0type.Po -storage/innobase/dict/.deps/dict0boot.Po -storage/innobase/dict/.deps/dict0crea.Po -storage/innobase/dict/.deps/dict0dict.Po -storage/innobase/dict/.deps/dict0load.Po -storage/innobase/dict/.deps/dict0mem.Po -storage/innobase/dyn/.deps/dyn0dyn.Po -storage/innobase/eval/.deps/eval0eval.Po -storage/innobase/eval/.deps/eval0proc.Po -storage/innobase/fil/.deps/fil0fil.Po -storage/innobase/fsp/.deps/fsp0fsp.Po -storage/innobase/fut/.deps/fut0fut.Po -storage/innobase/fut/.deps/fut0lst.Po -storage/innobase/ha/.deps/ha0ha.Po -storage/innobase/ha/.deps/hash0hash.Po storage/innobase/ib_config.h storage/innobase/ib_config.h.in -storage/innobase/ibuf/.deps/ibuf0ibuf.Po -storage/innobase/lock/.deps/lock0lock.Po -storage/innobase/log/.deps/log0log.Po -storage/innobase/log/.deps/log0recv.Po -storage/innobase/mach/.deps/mach0data.Po -storage/innobase/mem/.deps/mem0mem.Po -storage/innobase/mem/.deps/mem0pool.Po storage/innobase/mkinstalldirs -storage/innobase/mtr/.deps/mtr0log.Po -storage/innobase/mtr/.deps/mtr0mtr.Po -storage/innobase/os/.deps/os0file.Po -storage/innobase/os/.deps/os0proc.Po -storage/innobase/os/.deps/os0sync.Po -storage/innobase/os/.deps/os0thread.Po -storage/innobase/page/.deps/page0cur.Po -storage/innobase/page/.deps/page0page.Po -storage/innobase/pars/.deps/lexyy.Po -storage/innobase/pars/.deps/pars0grm.Po -storage/innobase/pars/.deps/pars0opt.Po -storage/innobase/pars/.deps/pars0pars.Po -storage/innobase/pars/.deps/pars0sym.Po -storage/innobase/que/.deps/que0que.Po -storage/innobase/read/.deps/read0read.Po -storage/innobase/rem/.deps/rem0cmp.Po -storage/innobase/rem/.deps/rem0rec.Po -storage/innobase/row/.deps/row0ins.Po -storage/innobase/row/.deps/row0mysql.Po -storage/innobase/row/.deps/row0purge.Po -storage/innobase/row/.deps/row0row.Po -storage/innobase/row/.deps/row0sel.Po -storage/innobase/row/.deps/row0uins.Po -storage/innobase/row/.deps/row0umod.Po -storage/innobase/row/.deps/row0undo.Po -storage/innobase/row/.deps/row0upd.Po -storage/innobase/row/.deps/row0vers.Po -storage/innobase/srv/.deps/srv0que.Po -storage/innobase/srv/.deps/srv0srv.Po -storage/innobase/srv/.deps/srv0start.Po storage/innobase/stamp-h1 -storage/innobase/sync/.deps/sync0arr.Po -storage/innobase/sync/.deps/sync0rw.Po -storage/innobase/sync/.deps/sync0sync.Po -storage/innobase/thr/.deps/thr0loc.Po -storage/innobase/trx/.deps/trx0purge.Po -storage/innobase/trx/.deps/trx0rec.Po -storage/innobase/trx/.deps/trx0roll.Po -storage/innobase/trx/.deps/trx0rseg.Po -storage/innobase/trx/.deps/trx0sys.Po -storage/innobase/trx/.deps/trx0trx.Po -storage/innobase/trx/.deps/trx0undo.Po -storage/innobase/usr/.deps/usr0sess.Po -storage/innobase/ut/.deps/ut0byte.Po -storage/innobase/ut/.deps/ut0dbg.Po -storage/innobase/ut/.deps/ut0list.Po -storage/innobase/ut/.deps/ut0mem.Po -storage/innobase/ut/.deps/ut0rnd.Po -storage/innobase/ut/.deps/ut0ut.Po -storage/innobase/ut/.deps/ut0vec.Po -storage/innobase/ut/.deps/ut0wqueue.Po -storage/myisam/.deps/ft_boolean_search.Po -storage/myisam/.deps/ft_nlq_search.Po -storage/myisam/.deps/ft_parser.Po -storage/myisam/.deps/ft_static.Po -storage/myisam/.deps/ft_stopwords.Po -storage/myisam/.deps/ft_update.Po -storage/myisam/.deps/mi_cache.Po -storage/myisam/.deps/mi_changed.Po -storage/myisam/.deps/mi_check.Po -storage/myisam/.deps/mi_checksum.Po -storage/myisam/.deps/mi_close.Po -storage/myisam/.deps/mi_create.Po -storage/myisam/.deps/mi_dbug.Po -storage/myisam/.deps/mi_delete.Po -storage/myisam/.deps/mi_delete_all.Po -storage/myisam/.deps/mi_delete_table.Po -storage/myisam/.deps/mi_dynrec.Po -storage/myisam/.deps/mi_extra.Po -storage/myisam/.deps/mi_info.Po -storage/myisam/.deps/mi_key.Po -storage/myisam/.deps/mi_keycache.Po -storage/myisam/.deps/mi_locking.Po -storage/myisam/.deps/mi_log.Po -storage/myisam/.deps/mi_open.Po -storage/myisam/.deps/mi_packrec.Po -storage/myisam/.deps/mi_page.Po -storage/myisam/.deps/mi_panic.Po -storage/myisam/.deps/mi_preload.Po -storage/myisam/.deps/mi_range.Po -storage/myisam/.deps/mi_rename.Po -storage/myisam/.deps/mi_rfirst.Po -storage/myisam/.deps/mi_rkey.Po -storage/myisam/.deps/mi_rlast.Po -storage/myisam/.deps/mi_rnext.Po -storage/myisam/.deps/mi_rnext_same.Po -storage/myisam/.deps/mi_rprev.Po -storage/myisam/.deps/mi_rrnd.Po -storage/myisam/.deps/mi_rsame.Po -storage/myisam/.deps/mi_rsamepos.Po -storage/myisam/.deps/mi_scan.Po -storage/myisam/.deps/mi_search.Po -storage/myisam/.deps/mi_static.Po -storage/myisam/.deps/mi_statrec.Po -storage/myisam/.deps/mi_test1.Po -storage/myisam/.deps/mi_test2.Po -storage/myisam/.deps/mi_test3.Po -storage/myisam/.deps/mi_unique.Po -storage/myisam/.deps/mi_update.Po -storage/myisam/.deps/mi_write.Po -storage/myisam/.deps/myisam_ftdump.Po -storage/myisam/.deps/myisamchk.Po -storage/myisam/.deps/myisamlog.Po -storage/myisam/.deps/myisampack.Po -storage/myisam/.deps/rt_index.Po -storage/myisam/.deps/rt_key.Po -storage/myisam/.deps/rt_mbr.Po -storage/myisam/.deps/rt_split.Po -storage/myisam/.deps/rt_test.Po -storage/myisam/.deps/sort.Po -storage/myisam/.deps/sp_key.Po -storage/myisam/.deps/sp_test.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_control +storage/maria/maria_dump_log +storage/maria/maria_ftdump +storage/maria/maria_log +storage/maria/maria_log.* +storage/maria/maria_pack +storage/maria/maria_read_log +storage/maria/tmp +storage/maria/tmp/* +storage/maria/unittest/ma_pagecache_consist_1k-t-big +storage/maria/unittest/ma_pagecache_consist_1kHC-t-big +storage/maria/unittest/ma_pagecache_consist_1kRD-t-big +storage/maria/unittest/ma_pagecache_consist_1kWR-t-big +storage/maria/unittest/ma_pagecache_consist_64k-t-big +storage/maria/unittest/ma_pagecache_consist_64kHC-t-big +storage/maria/unittest/ma_pagecache_consist_64kRD-t-big +storage/maria/unittest/ma_pagecache_consist_64kWR-t-big +storage/maria/unittest/ma_pagecache_single_64k-t-big +storage/maria/unittest/ma_test_loghandler_long-t-big +storage/maria/unittest/maria_control +storage/maria/unittest/mf_pagecache_consist_1k-t-big +storage/maria/unittest/mf_pagecache_consist_1kHC-t-big +storage/maria/unittest/mf_pagecache_consist_1kRD-t-big +storage/maria/unittest/mf_pagecache_consist_1kWR-t-big +storage/maria/unittest/mf_pagecache_consist_64k-t-big +storage/maria/unittest/mf_pagecache_consist_64kHC-t-big +storage/maria/unittest/mf_pagecache_consist_64kRD-t-big +storage/maria/unittest/mf_pagecache_consist_64kWR-t-big +storage/maria/unittest/mf_pagecache_single_64k-t-big +storage/maria/unittest/page_cache_test_file_1 +storage/maria/unittest/pagecache_debug.log +storage/maria/unittest/tmp/* storage/myisam/FT1.MYD storage/myisam/FT1.MYI storage/myisam/ft_dump @@ -2530,27 +1505,6 @@ storage/myisam/test1.MYD storage/myisam/test1.MYI storage/myisam/test2.MYD storage/myisam/test2.MYI -storage/myisammrg/.deps/myrg_close.Po -storage/myisammrg/.deps/myrg_create.Po -storage/myisammrg/.deps/myrg_delete.Po -storage/myisammrg/.deps/myrg_extra.Po -storage/myisammrg/.deps/myrg_info.Po -storage/myisammrg/.deps/myrg_locking.Po -storage/myisammrg/.deps/myrg_open.Po -storage/myisammrg/.deps/myrg_panic.Po -storage/myisammrg/.deps/myrg_queue.Po -storage/myisammrg/.deps/myrg_range.Po -storage/myisammrg/.deps/myrg_rfirst.Po -storage/myisammrg/.deps/myrg_rkey.Po -storage/myisammrg/.deps/myrg_rlast.Po -storage/myisammrg/.deps/myrg_rnext.Po -storage/myisammrg/.deps/myrg_rnext_same.Po -storage/myisammrg/.deps/myrg_rprev.Po -storage/myisammrg/.deps/myrg_rrnd.Po -storage/myisammrg/.deps/myrg_rsame.Po -storage/myisammrg/.deps/myrg_static.Po -storage/myisammrg/.deps/myrg_update.Po -storage/myisammrg/.deps/myrg_write.Po storage/ndb/bin/DbAsyncGenerator storage/ndb/bin/DbCreate storage/ndb/bin/acid @@ -2686,53 +1640,21 @@ storage/ndb/ndbapi-examples/ndbapi_scan/ndbapi_scan storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index -storage/ndb/src/common/debugger/libtrace.dsp -storage/ndb/src/common/debugger/signaldata/libsignaldataprint.dsp -storage/ndb/src/common/logger/liblogger.dsp -storage/ndb/src/common/mgmcommon/libmgmsrvcommon.dsp storage/ndb/src/common/mgmcommon/printConfig/*.d -storage/ndb/src/common/portlib/libportlib.dsp -storage/ndb/src/common/transporter/libtransporter.dsp -storage/ndb/src/common/util/libgeneral.dsp storage/ndb/src/common/util/testBitmask.cpp storage/ndb/src/cw/cpcd/ndb_cpcd storage/ndb/src/dummy.cpp -storage/ndb/src/kernel/blocks/backup/libbackup.dsp storage/ndb/src/kernel/blocks/backup/ndb_print_backup_file storage/ndb/src/kernel/blocks/backup/restore/ndb_restore -storage/ndb/src/kernel/blocks/cmvmi/libcmvmi.dsp -storage/ndb/src/kernel/blocks/dbacc/libdbacc.dsp -storage/ndb/src/kernel/blocks/dbdict/libdbdict.dsp storage/ndb/src/kernel/blocks/dbdict/ndb_print_schema_file -storage/ndb/src/kernel/blocks/dbdih/libdbdih.dsp storage/ndb/src/kernel/blocks/dbdih/ndb_print_sys_file -storage/ndb/src/kernel/blocks/dblqh/libdblqh.dsp -storage/ndb/src/kernel/blocks/dbtc/libdbtc.dsp -storage/ndb/src/kernel/blocks/dbtup/libdbtup.dsp storage/ndb/src/kernel/blocks/dbtup/test_varpage -storage/ndb/src/kernel/blocks/dbtux/libdbtux.dsp -storage/ndb/src/kernel/blocks/dbutil/libdbutil.dsp -storage/ndb/src/kernel/blocks/grep/libgrep.dsp storage/ndb/src/kernel/blocks/ndb_print_file -storage/ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp -storage/ndb/src/kernel/blocks/ndbfs/libndbfs.dsp -storage/ndb/src/kernel/blocks/qmgr/libqmgr.dsp -storage/ndb/src/kernel/blocks/suma/libsuma.dsp -storage/ndb/src/kernel/blocks/trix/libtrix.dsp -storage/ndb/src/kernel/error/liberror.dsp storage/ndb/src/kernel/ndbd -storage/ndb/src/kernel/ndbd.dsp -storage/ndb/src/kernel/vm/libkernel.dsp storage/ndb/src/libndb.ver -storage/ndb/src/libndbclient.dsp -storage/ndb/src/mgmapi/libmgmapi.dsp -storage/ndb/src/mgmclient/libndbmgmclient.dsp storage/ndb/src/mgmclient/ndb_mgm -storage/ndb/src/mgmclient/ndb_mgm.dsp storage/ndb/src/mgmclient/test_cpcd/*.d storage/ndb/src/mgmsrv/ndb_mgmd -storage/ndb/src/mgmsrv/ndb_mgmd.dsp -storage/ndb/src/ndbapi/libndbapi.dsp storage/ndb/src/ndbapi/ndberror_check storage/ndb/test/ndbapi/DbAsyncGenerator storage/ndb/test/ndbapi/DbCreate @@ -2748,17 +1670,14 @@ storage/ndb/test/ndbapi/create_tab storage/ndb/test/ndbapi/drop_all_tabs storage/ndb/test/ndbapi/flexAsynch storage/ndb/test/ndbapi/flexBench -storage/ndb/test/ndbapi/flexBench.dsp storage/ndb/test/ndbapi/flexHammer storage/ndb/test/ndbapi/flexTT storage/ndb/test/ndbapi/ndbapi_slow_select storage/ndb/test/ndbapi/testBackup storage/ndb/test/ndbapi/testBasic -storage/ndb/test/ndbapi/testBasic.dsp storage/ndb/test/ndbapi/testBasicAsynch storage/ndb/test/ndbapi/testBitfield storage/ndb/test/ndbapi/testBlobs -storage/ndb/test/ndbapi/testBlobs.dsp storage/ndb/test/ndbapi/testDataBuffers storage/ndb/test/ndbapi/testDeadlock storage/ndb/test/ndbapi/testDict @@ -2776,7 +1695,6 @@ storage/ndb/test/ndbapi/testReadPerf storage/ndb/test/ndbapi/testRestartGci storage/ndb/test/ndbapi/testSRBank storage/ndb/test/ndbapi/testScan -storage/ndb/test/ndbapi/testScan.dsp storage/ndb/test/ndbapi/testScanInterpreter storage/ndb/test/ndbapi/testScanPerf storage/ndb/test/ndbapi/testSystemRestart @@ -2785,7 +1703,6 @@ storage/ndb/test/ndbapi/testTransactions storage/ndb/test/ndbapi/test_event storage/ndb/test/ndbapi/test_event_merge storage/ndb/test/run-test/atrt -storage/ndb/test/src/libNDBT.dsp storage/ndb/test/tools/copy_tab storage/ndb/test/tools/create_index storage/ndb/test/tools/hugoCalculator @@ -2805,83 +1722,17 @@ storage/ndb/test/tools/restart storage/ndb/test/tools/verify_index storage/ndb/tools/ndb_config storage/ndb/tools/ndb_delete_all -storage/ndb/tools/ndb_delete_all.dsp storage/ndb/tools/ndb_desc -storage/ndb/tools/ndb_desc.dsp storage/ndb/tools/ndb_drop_index -storage/ndb/tools/ndb_drop_index.dsp storage/ndb/tools/ndb_drop_table -storage/ndb/tools/ndb_drop_table.dsp storage/ndb/tools/ndb_restore storage/ndb/tools/ndb_select_all -storage/ndb/tools/ndb_select_all.dsp storage/ndb/tools/ndb_select_count -storage/ndb/tools/ndb_select_count.dsp storage/ndb/tools/ndb_show_tables -storage/ndb/tools/ndb_show_tables.dsp storage/ndb/tools/ndb_test_platform storage/ndb/tools/ndb_waiter -storage/ndb/tools/ndb_waiter.dsp strings/*.ds? strings/*.vcproj -strings/.deps/bchange.Po -strings/.deps/bcmp.Po -strings/.deps/bfill.Po -strings/.deps/bmove.Po -strings/.deps/bmove512.Po -strings/.deps/bmove_upp.Po -strings/.deps/conf_to_src.Po -strings/.deps/ctype-big5.Po -strings/.deps/ctype-bin.Po -strings/.deps/ctype-cp932.Po -strings/.deps/ctype-czech.Po -strings/.deps/ctype-euc_kr.Po -strings/.deps/ctype-eucjpms.Po -strings/.deps/ctype-extra.Po -strings/.deps/ctype-gb2312.Po -strings/.deps/ctype-gbk.Po -strings/.deps/ctype-latin1.Po -strings/.deps/ctype-mb.Po -strings/.deps/ctype-simple.Po -strings/.deps/ctype-sjis.Po -strings/.deps/ctype-tis620.Po -strings/.deps/ctype-uca.Po -strings/.deps/ctype-ucs2.Po -strings/.deps/ctype-ujis.Po -strings/.deps/ctype-utf8.Po -strings/.deps/ctype-win1250ch.Po -strings/.deps/ctype.Po -strings/.deps/decimal.Po -strings/.deps/int2str.Po -strings/.deps/is_prefix.Po -strings/.deps/llstr.Po -strings/.deps/longlong2str.Po -strings/.deps/longlong2str_asm.Po -strings/.deps/my_strchr.Po -strings/.deps/my_strtoll10.Po -strings/.deps/my_vsnprintf.Po -strings/.deps/r_strinstr.Po -strings/.deps/str2int.Po -strings/.deps/str_alloc.Po -strings/.deps/strappend.Po -strings/.deps/strcend.Po -strings/.deps/strcont.Po -strings/.deps/strend.Po -strings/.deps/strfill.Po -strings/.deps/strinstr.Po -strings/.deps/strmake.Po -strings/.deps/strmov.Po -strings/.deps/strnlen.Po -strings/.deps/strnmov.Po -strings/.deps/strstr.Po -strings/.deps/strtod.Po -strings/.deps/strtol.Po -strings/.deps/strtoll.Po -strings/.deps/strtoul.Po -strings/.deps/strtoull.Po -strings/.deps/strxmov.Po -strings/.deps/strxnmov.Po -strings/.deps/xml.Po strings/conf_to_src strings/ctype_autoconf.c strings/ctype_extra_sources.c @@ -2965,17 +1816,11 @@ test/tools/ndb_cpcc test/tools/restart test/tools/verify_index test1/* +test?.MA? test_xml tests/*.ds? tests/*.vcproj -tests/.deps/dummy.Po -tests/.deps/insert_test.Po -tests/.deps/mysql_client_test.Po -tests/.deps/select_test.Po -tests/.deps/thread_test.Po tests/.libs -prune -tests/.libs/lt-mysql_client_test -tests/.libs/mysql_client_test tests/bug25714 tests/client_test tests/connect_test @@ -2991,30 +1836,25 @@ tools/mysqlmngd tools/mysqltestmanager tools/mysys_priv.h unittest/examples/*.t -unittest/examples/.deps/no_plan-t.Po -unittest/examples/.deps/simple-t.Po -unittest/examples/.deps/skip-t.Po -unittest/examples/.deps/skip_all-t.Po -unittest/examples/.deps/todo-t.Po +unittest/maria_control unittest/mysys/*.t -unittest/mysys/.deps/base64-t.Po -unittest/mysys/.deps/bitmap-t.Po -unittest/mysys/.deps/my_atomic-t.Po -unittest/mytap/.deps/tap.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/t/*.t -unittest/mytap/t/.deps/basic-t.Po +unittest/page_cache_test_file_1 +unittest/pagecache_debug.log +unittest/tmp/* unittest/unit vi.h vio/*.ds? vio/*.vcproj -vio/.deps/dummy.Po -vio/.deps/test-ssl.Po -vio/.deps/test-sslclient.Po -vio/.deps/test-sslserver.Po -vio/.deps/vio.Po -vio/.deps/viosocket.Po -vio/.deps/viossl.Po -vio/.deps/viosslfactories.Po vio/test-ssl vio/test-sslclient vio/test-sslserver diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 3655d3eae67..7e561e85f58 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -147,6 +147,7 @@ base_configs="--prefix=$prefix --enable-assembler " base_configs="$base_configs --with-extra-charsets=complex " base_configs="$base_configs --enable-thread-safe-client " base_configs="$base_configs --with-big-tables" +base_configs="$base_configs --with-plugin-maria --with-maria-tmp-tables" if test -d "$path/../cmd-line-utils/readline" then diff --git a/BUILD/compile-amd64-gprof-no-ndb b/BUILD/compile-amd64-gprof-no-ndb new file mode 100755 index 00000000000..9fd4c67155c --- /dev/null +++ b/BUILD/compile-amd64-gprof-no-ndb @@ -0,0 +1,7 @@ +#! /bin/sh +path=`dirname $0` +. "$path/SETUP.sh" +extra_flags="$amd64_cflags -pg -g" +extra_configs="$amd64_configs $max_no_ndb_configs --disable-shared $static_link" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-dist b/BUILD/compile-dist index caee172f196..bc907ed2bd0 100755 --- a/BUILD/compile-dist +++ b/BUILD/compile-dist @@ -57,6 +57,7 @@ export CC CXX MAKE # Make sure to enable all features that affect "make dist" # Remember that configure restricts the man pages to the configured features ! ./configure \ + --with-maria-storage-engine \ --with-embedded-server \ --with-ndbcluster $MAKE diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit index c3a61ed2dde..e3cd589f50b 100755 --- a/BitKeeper/triggers/post-commit +++ b/BitKeeper/triggers/post-commit @@ -8,10 +8,10 @@ else COMMITTER=$USER fi FROM=$COMMITTER@mysql.com -COMMITS=commits@lists.mysql.com +COMMITS=maria@lists.mysql.com DOCS=docs-commit@mysql.com LIMIT=10000 -VERSION="5.1" +VERSION="maria" BKROOT=`bk root` if [ -x /usr/sbin/sendmail ]; then @@ -73,11 +73,11 @@ else fi #++ -# commits@ or dev-private@ mail +# maria@ or dev-private@ mail #-- LIST="commits" -TO="commits@lists.mysql.com" +TO="maria@lists.mysql.com" if [ -f .tree-is-private ] then LIST="dev-private" @@ -103,7 +103,7 @@ see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html EOF bk changes -v -r+ bk rset -r+ -ah | bk gnupatch -h -dup -T - ) | bk sed -e ${LIMIT}q > $BKROOT/BitKeeper/tmp/commits.txt + ) > $BKROOT/BitKeeper/tmp/commits.txt $SENDMAIL -t < $BKROOT/BitKeeper/tmp/commits.txt diff --git a/BitKeeper/triggers/pre-delta b/BitKeeper/triggers/pre-delta index cd861703bb5..d6afe0905e7 100755 --- a/BitKeeper/triggers/pre-delta +++ b/BitKeeper/triggers/pre-delta @@ -20,3 +20,18 @@ then exit 1 fi +# detect if C/C++ files have new trailing white space +trailingblank=`echo $BK_FILE | egrep '\.(c|.h)'` +if [ -n "$trailingblank" ] +then + trailingblank=`bk diffs $BK_FILE | grep '^> .*[[:space:]]$'` + if [ -n "$trailingblank" ] + then + echo "bk diffs $BK_FILE | grep '^> .*[[:space:]]$'" + echo "reported white space at end of some added/modified lines" + echo "" + echo "Checkin FAILED!" + echo "Fix the problem and retry." + exit 1 + fi +fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 7107a112f19..69fbf9f73b1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,13 @@ IF(WITH_FEDERATED_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_FEDERATED_STORAGE_ENGINE) SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_federated_plugin") ENDIF(WITH_FEDERATED_STORAGE_ENGINE) +IF(WITH_MARIA_STORAGE_ENGINE) + ADD_DEFINITIONS(-DWITH_MARIA_STORAGE_ENGINE) + IF(WITH_MARIA_TMP_TABLES) + ADD_DEFINITIONS(-DUSE_MARIA_FOR_TMP_TABLES) + ENDIF(WITH_MARIA_TMP_TABLES) + SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_maria_plugin") +ENDIF(WITH_MARIA_STORAGE_ENGINE) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in ${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc @ONLY) @@ -247,10 +254,17 @@ ENDIF(WITH_FEDERATED_STORAGE_ENGINE) IF(WITH_INNOBASE_STORAGE_ENGINE) ADD_SUBDIRECTORY(storage/innobase) ENDIF(WITH_INNOBASE_STORAGE_ENGINE) +IF(WITH_MARIA_STORAGE_ENGINE) + ADD_SUBDIRECTORY(storage/maria) + ADD_SUBDIRECTORY(storage/maria/unittest) +ENDIF(WITH_MARIA_STORAGE_ENGINE) ADD_SUBDIRECTORY(sql) ADD_SUBDIRECTORY(server-tools/instance-manager) ADD_SUBDIRECTORY(libmysql) ADD_SUBDIRECTORY(tests) +ADD_SUBDIRECTORY(unittest/mytap) +ADD_SUBDIRECTORY(unittest/examples) +ADD_SUBDIRECTORY(unittest/mysys) IF(WITH_EMBEDDED_SERVER) ADD_SUBDIRECTORY(libmysqld) ADD_SUBDIRECTORY(libmysqld/examples) diff --git a/KNOWN_BUGS.txt b/KNOWN_BUGS.txt new file mode 100644 index 00000000000..189c7dcd613 --- /dev/null +++ b/KNOWN_BUGS.txt @@ -0,0 +1,86 @@ +This file should contain all know fatal bugs in the Maria storage +engine for the last source or binary release. Minor bugs, extensions +and feature request and bugs found since this release can be find in the +MySQL bugs databases at: http://bugs.mysql.com/ (category "Maria +storage engine"). + +There shouldn't normally be any bugs that affects normal operations in +any Maria release. Still, there are always exceptions and edge cases +and that's what this file is for. + +For the first few Alpha releases of Maria there may be some edge cases +that crashes during recovery; We don't like that but we think it's +better to get the Maria alpha out early to get things tested and get +more developers on the code early than wait until these are fixed. We +do however think that the bugs are not seriously enough to stop anyone +from starting to test and even use Maria for real (as long as they are +prepared to upgrade to next MySQL-Maria release ASAP). + +If you have found a bug that is not listed here, please add it to +http://bugs.mysql.com/ so that we can either fix it for next release +or in the worst case add it here for others to know! + +IMPORTANT: + +If you have been using a MySQL-5.1-Maria-alpha build and upgrading to +MySQL-5.1-Maria-beta you MUST run maria_chk --recover on all your +Maria tables. This is because we made an incompatible change of how +transaction id is stored and old transaction id's must be reset! + +cd mysql-data-directory +maria_chk --recover */*.MAI + +As the Maria-1.5 engine is now in beta we will do our best to not +introduce any incompatible changes in the data format for the Maria +tables; If this would be ever be needed, we will, if possible, support +both the old and the new version to make upgrades as easy as possible. + +Known bugs that we are working on and will be fixed shortly +=========================================================== + +- We have some time ago some instabilities in log writing that is was + under investigation but we haven't been able to repeat in a while. + This causes mainly assert to triggers in the code and sometimes + the log handler doesn't start up after restart. + Most of this should now be fixed. + +- INSERT on a duplicate key against a key inserted by another connection + that has not yet ended will give a duplicate key error instead of + waiting for the other statement to end. + + +Known bugs that are planned to be fixed before Gamma/RC +======================================================= + +- If we get a write failure on disk (disk full or disk error) for the + log, we should stop all usage of transactional tables and mark all + transactional tables that are changed as crashed. + For the moment, if this happens, you have to take down mysqld, + remove all logs, restart mysqld and repair your tables. + + If you get the related error: + "Disk is full writing '/usr/local/mysql/var/maria_log.????????' (Errcode: 28) + Waiting for someone to free space..." + you should either free disk space, in which Maria will continue as before + or kill mysqld, remove logs and repair tables. + + +Known bugs that are planned to be fixed later +============================================= + +LOCK TABLES .. WRITE CONCURRENT is mainly done for testing MVCC. Don't +use this in production. + +Missing features that is planned to fix before Beta +=================================================== + +None + +Features planned for future releases +==================================== + +Most notable is full transaction support and multiple reader/writers +in Maria 2.0 + +http://forge.mysql.com/worklog/ +(you can enter "maria" in the "quick search" field there). diff --git a/Makefile.am b/Makefile.am index c0a5334a032..9595f9b1fce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -67,7 +67,7 @@ tags: .PHONY: init-db bin-dist \ test test-force test-full test-force-full test-force-mem \ test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \ - test-unit test-ps test-nr test-pr test-ns test-binlog-statement \ + test-unit test-unit-big test-ps test-nr test-pr test-ns test-binlog-statement \ test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp \ test-ext-stress test-ext test-embedded test-reprepare \ test-fast test-fast-cursor test-fast-view test-fast-prepare \ @@ -82,7 +82,10 @@ tags: # making sure each user use different ports. test-unit: - cd unittest && $(MAKE) test + cd unittest; $(MAKE) test + +test-unit-big: + cd unittest; MYTAP_CONFIG=big $(MAKE) test test-ps: cd mysql-test ; \ @@ -112,14 +115,14 @@ test-embedded: --embedded-server --skip-rpl --skip-ndbcluster ; \ else \ echo "no program found for 'embedded' tests - skipped testing" ; \ - fi + fi test-reprepare: cd mysql-test ; \ @PERL@ ./mysql-test-run.pl $(force) $(mem) --ps-protocol \ --mysqld=--debug=+d,reprepare_each_statement -test: test-unit test-ns test-pr +test: test-ns test-pr test-full: test test-nr test-ps diff --git a/client/client_priv.h b/client/client_priv.h index 06145232995..07b5cd72d84 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -80,5 +80,6 @@ enum options_client OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT, OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE, OPT_WRITE_BINLOG, OPT_DUMP_DATE, + OPT_ABORT_SOURCE_ON_ERROR, OPT_MAX_CLIENT_OPTION }; diff --git a/client/get_password.c b/client/get_password.c index ea024f76fb6..c6653183f48 100644 --- a/client/get_password.c +++ b/client/get_password.c @@ -113,7 +113,7 @@ static void get_password(char *to,uint length,int fd, my_bool echo) for (;;) { - char tmp; + uchar tmp; if (my_read(fd,&tmp,1,MYF(0)) != 1) break; if (tmp == '\b' || (int) tmp == 127) @@ -138,7 +138,7 @@ static void get_password(char *to,uint length,int fd, my_bool echo) fputc('*',stderr); fflush(stderr); } - *(pos++) = tmp; + *(pos++)= (char) tmp; } while (pos != to && isspace(pos[-1]) == ' ') pos--; /* Allow dummy space at end */ diff --git a/client/mysql.cc b/client/mysql.cc index ff53d623d07..e81a114a4b4 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -43,7 +43,7 @@ #include #endif -const char *VER= "14.14"; +const char *VER= "14.15"; /* Don't try to make a nice table if the data is too big */ #define MAX_COLUMN_LENGTH 1024 @@ -142,7 +142,7 @@ static my_bool ignore_errors=0,wait_flag=0,quick=0, default_charset_used= 0, opt_secure_auth= 0, default_pager_set= 0, opt_sigint_ignore= 0, show_warnings= 0, executing_query= 0, interrupted_query= 0; -static my_bool debug_info_flag, debug_check_flag; +static my_bool debug_info_flag, debug_check_flag, batch_abort_on_error; static my_bool column_types_flag; static my_bool preserve_comments= 0; static ulong opt_max_allowed_packet, opt_net_buffer_length; @@ -1308,6 +1308,10 @@ static struct my_option my_long_options[] = 0, 0, 0, 0, 0}, {"help", 'I', "Synonym for -?", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"abort-source-on-error", OPT_ABORT_SOURCE_ON_ERROR, + "Abort 'source filename' operations in case of errors", + (uchar**) &batch_abort_on_error, (uchar**) &batch_abort_on_error, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef __NETWARE__ {"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -1359,7 +1363,7 @@ static struct my_option my_long_options[] = {"vertical", 'E', "Print the output of a query (rows) vertically.", (uchar**) &vertical, (uchar**) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"force", 'f', "Continue even if we get an sql error.", + {"force", 'f', "Continue even if we get an sql error. Sets abort-source-on-error to 0", (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"named-commands", 'G', @@ -1718,6 +1722,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), #endif break; #include + case 'f': + batch_abort_on_error= 0; + break; case 'V': usage(1); exit(0); @@ -3896,6 +3903,7 @@ static int com_source(String *buffer, char *line) int error; STATUS old_status; FILE *sql_file; + my_bool save_ignore_errors; /* Skip space from file name */ while (my_isspace(charset_info,*line)) @@ -3927,16 +3935,25 @@ static int com_source(String *buffer, char *line) /* Save old status */ old_status=status; + save_ignore_errors= ignore_errors; bfill((char*) &status,sizeof(status),(char) 0); status.batch=old_status.batch; // Run in batch mode status.line_buff=line_buff; status.file_name=source_name; glob_buffer.length(0); // Empty command buffer + ignore_errors= !batch_abort_on_error; error= read_and_execute(false); + ignore_errors= save_ignore_errors; status=old_status; // Continue as before my_fclose(sql_file,MYF(0)); batch_readline_end(line_buff); + /* + If we got an error during source operation, don't abort the client + if ignore_errors is set + */ + if (error && batch_abort_on_error && ignore_errors) + error= -1; return error; } @@ -4442,12 +4459,19 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate) if (error) { if (sqlstate) - (void) tee_fprintf(file, "ERROR %d (%s): ", error, sqlstate); + (void) tee_fprintf(file, "ERROR %d (%s)", error, sqlstate); else - (void) tee_fprintf(file, "ERROR %d: ", error); + (void) tee_fprintf(file, "ERROR %d", error); } else - tee_puts("ERROR: ", file); + tee_fputs("ERROR", file); + if (status.query_start_line && line_numbers) + { + (void) fprintf(file," at line %lu",status.query_start_line); + if (status.file_name) + (void) fprintf(file," in file: '%s'", status.file_name); + } + tee_fputs(": ", file); } else vidattr(A_BOLD); @@ -4456,7 +4480,7 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate) } if (unbuffered) fflush(file); - return info_type == INFO_ERROR ? -1 : 0; + return info_type == INFO_ERROR ? (ignore_errors ? -1 : 1): 0; } diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index b3b699f61fd..01329c550d6 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -534,7 +534,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) If this behaviour is ever changed, Docs should be notified. */ - struct rand_struct rand_st; + struct my_rnd_struct rand_st; for (; argc > 0 ; argv++,argc--) { @@ -846,7 +846,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) time_t start_time; /* Do initialization the same way as we do in mysqld */ start_time=time((time_t*) 0); - randominit(&rand_st,(ulong) start_time,(ulong) start_time/2); + my_rnd_init(&rand_st,(ulong) start_time,(ulong) start_time/2); if (argc < 2) { diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 5ca0b1cd207..9904eeae9d0 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -1886,10 +1886,17 @@ limit_not_met: { if (mysql_field_count(mysql)) { - result= mysql_store_result(mysql); - while ((row = mysql_fetch_row(result))) - counter++; - mysql_free_result(result); + if ((result= mysql_store_result(mysql))) + { + while ((row = mysql_fetch_row(result))) + counter++; + mysql_free_result(result); + } + else + { + fprintf(stderr,"%s: Error in mysql_store_result(): %d %s\n", + my_progname, mysql_errno(mysql), mysql_error(mysql)); + } } } while(mysql_next_result(mysql) == 0); queries++; diff --git a/client/mysqltest.c b/client/mysqltest.c index 6babc42bcd0..149dee92cc5 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -75,7 +75,8 @@ enum { OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION, OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, - OPT_MAX_CONNECT_RETRIES, OPT_MARK_PROGRESS, OPT_LOG_DIR, OPT_TAIL_LINES + OPT_MAX_CONNECT_RETRIES, OPT_MARK_PROGRESS, OPT_LOG_DIR, OPT_TAIL_LINES, + OPT_GLOBAL_SUBST }; static int record= 0, opt_sleep= -1; @@ -116,6 +117,9 @@ static char delimiter[MAX_DELIMITER_LENGTH]= ";"; static uint delimiter_length= 1; static char TMPDIR[FN_REFLEN]; +static char global_subst_from[200]; +static char global_subst_to[200]; +static char *global_subst= NULL; /* Block stack */ enum block_cmd { @@ -182,6 +186,10 @@ static void init_re(void); static int match_re(my_regex_t *, char *); static void free_re(void); +static int replace(DYNAMIC_STRING *ds_str, + const char *search_str, ulong search_len, + const char *replace_str, ulong replace_len); + DYNAMIC_ARRAY q_lines; #include "sslopt-vars.h" @@ -1574,6 +1582,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname) void check_result(DYNAMIC_STRING* ds) { + int res; const char* mess= "Result content mismatch\n"; DBUG_ENTER("check_result"); @@ -1583,7 +1592,32 @@ void check_result(DYNAMIC_STRING* ds) if (access(result_file_name, F_OK) != 0) die("The specified result file does not exist: '%s'", result_file_name); - switch (dyn_string_cmp(ds, result_file_name)) { + res= dyn_string_cmp(ds, result_file_name); + if (global_subst && res != RESULT_OK) + { + /** + @todo MARIA_HACK + This serves for when a test is run with --default-storage-engine=X + where X is not MyISAM: tests using SHOW CREATE TABLE will always fail + because SHOW CREATE TABLE prints X instead of MyISAM. With + --global-subst=X,MyISAM , such trivial differences are eliminated and + test may be reported as passing. + --global-subst is only a quick way to run a lot of existing tests + with Maria and find bugs; it is not good enough for reaching the main + trees when Maria is merged into them. + --global-subst should be removed. + */ + uint global_subst_from_len= strlen(global_subst_from); + uint global_subst_to_len= strlen(global_subst_to); + while (replace(ds, + global_subst_from, global_subst_from_len, + global_subst_to, global_subst_to_len) == 0) + /* do nothing */ ; + /* let's compare again to see if it is ok now */ + res= dyn_string_cmp(ds, result_file_name); + } + switch(res) + { case RESULT_OK: break; /* ok */ case RESULT_LENGTH_MISMATCH: @@ -2041,9 +2075,9 @@ void var_set_query_get_value(struct st_command *command, VAR *var) static DYNAMIC_STRING ds_col; static DYNAMIC_STRING ds_row; const struct command_arg query_get_value_args[] = { - "query", ARG_STRING, TRUE, &ds_query, "Query to run", - "column name", ARG_STRING, TRUE, &ds_col, "Name of column", - "row number", ARG_STRING, TRUE, &ds_row, "Number for row" + {"query", ARG_STRING, TRUE, &ds_query, "Query to run"}, + {"column name", ARG_STRING, TRUE, &ds_col, "Name of column"}, + {"row number", ARG_STRING, TRUE, &ds_row, "Number for row"}, }; DBUG_ENTER("var_set_query_get_value"); @@ -2280,7 +2314,7 @@ void do_source(struct st_command *command) } dynstr_free(&ds_filename); - return; + DBUG_VOID_RETURN; } @@ -2789,7 +2823,7 @@ void do_mkdir(struct st_command *command) int error; static DYNAMIC_STRING ds_dirname; const struct command_arg mkdir_args[] = { - "dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to create" + {"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to create"} }; DBUG_ENTER("do_mkdir"); @@ -2819,7 +2853,7 @@ void do_rmdir(struct st_command *command) int error; static DYNAMIC_STRING ds_dirname; const struct command_arg rmdir_args[] = { - "dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to remove" + { "dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to remove" } }; DBUG_ENTER("do_rmdir"); @@ -5277,6 +5311,11 @@ static struct my_option my_long_options[] = {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (uchar**) &debug_info_flag, (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"global-subst", OPT_GLOBAL_SUBST, "argument should be 'X,Y' ;" + " substitute string X with another Y accross the whole test's current" + " result before comparing with expected result file", + (uchar**) &global_subst, (uchar**) &global_subst, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (uchar**) &opt_host, (uchar**) &opt_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"include", 'i', "Include SQL before each test case.", (uchar**) &opt_include, @@ -5535,6 +5574,16 @@ int parse_args(int argc, char **argv) if (debug_check_flag) my_end_arg= MY_CHECK_ERROR; + if (global_subst != NULL) + { + char *comma= strstr(global_subst, ","); + if (comma == NULL) + die("wrong --global-subst, must be X,Y"); + memcpy(global_subst_from, global_subst, (comma-global_subst)); + global_subst_from[comma-global_subst]= 0; + memcpy(global_subst_to, comma+1, strlen(comma)); + } + return 0; } diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c index baed1dfad49..84bf37bc993 100644 --- a/cmd-line-utils/readline/bind.c +++ b/cmd-line-utils/readline/bind.c @@ -701,7 +701,7 @@ rl_function_of_keyseq (keyseq, map, type) { unsigned char ic = keyseq[i]; - if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii) + if (META_CHAR_FOR_UCHAR(ic) && _rl_convert_meta_chars_to_ascii) { if (map[ESC].type == ISKMAP) { diff --git a/cmd-line-utils/readline/chardefs.h b/cmd-line-utils/readline/chardefs.h index def3a111bd3..a184ab30acb 100644 --- a/cmd-line-utils/readline/chardefs.h +++ b/cmd-line-utils/readline/chardefs.h @@ -60,6 +60,7 @@ #define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0)) #define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char) +#define META_CHAR_FOR_UCHAR(c) ((c) > meta_character_threshold) #define CTRL(c) ((c) & control_character_mask) #define META(c) ((c) | meta_character_bit) diff --git a/cmd-line-utils/readline/display.c b/cmd-line-utils/readline/display.c index 6f63faa9738..b8699c34b82 100644 --- a/cmd-line-utils/readline/display.c +++ b/cmd-line-utils/readline/display.c @@ -191,8 +191,6 @@ static int visible_first_line_len; (or is equal to) _rl_screenwidth. */ static int prompt_invis_chars_first_line; -static int prompt_last_screen_line; - static int prompt_physical_chars; /* Variables to save and restore prompt and display information. */ @@ -458,7 +456,7 @@ rl_redisplay () { register int in, out, c, linenum, cursor_linenum; register char *line; - int inv_botlin, lb_botlin, lb_linenum, o_cpos; + int inv_botlin, lb_linenum, o_cpos; int newlines, lpos, temp, modmark, n0, num; char *prompt_this_line; #if defined (HANDLE_MULTIBYTE) @@ -671,11 +669,9 @@ rl_redisplay () lpos -= _rl_screenwidth; } - prompt_last_screen_line = newlines; - /* Draw the rest of the line (after the prompt) into invisible_line, keeping track of where the cursor is (cpos_buffer_position), the number of the line containing - the cursor (lb_linenum), the last line number (lb_botlin and inv_botlin). + the cursor (lb_linenum), the last line number (inv_botlin). It maintains an array of line breaks for display (inv_lbreaks). This handles expanding tabs for display and displaying meta characters. */ lb_linenum = 0; @@ -858,7 +854,7 @@ rl_redisplay () lb_linenum = newlines; } - inv_botlin = lb_botlin = newlines; + inv_botlin = newlines; CHECK_INV_LBREAKS (); inv_lbreaks[newlines+1] = out; cursor_linenum = lb_linenum; @@ -1888,7 +1884,7 @@ rl_character_len (c, pos) uc = (unsigned char)c; - if (META_CHAR (uc)) + if (META_CHAR_FOR_UCHAR(uc)) return ((_rl_output_meta_chars == 0) ? 4 : 1); if (uc == '\t') diff --git a/cmd-line-utils/readline/histexpand.c b/cmd-line-utils/readline/histexpand.c index 45377fc3b5e..b52b0685c47 100644 --- a/cmd-line-utils/readline/histexpand.c +++ b/cmd-line-utils/readline/histexpand.c @@ -693,7 +693,7 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line) case 's': { char *new_event; - int delimiter, failed, si, l_temp, ws, we; + int delimiter, failed, si, l_temp, we; if (c == 's') { @@ -792,7 +792,6 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line) { for (; temp[si] && whitespace (temp[si]); si++) ; - ws = si; we = history_tokenize_word (temp, si); } diff --git a/cmd-line-utils/readline/history.c b/cmd-line-utils/readline/history.c index 5cd5788d1da..c81101fc555 100644 --- a/cmd-line-utils/readline/history.c +++ b/cmd-line-utils/readline/history.c @@ -306,7 +306,7 @@ add_history (string) } } - temp = alloc_history_entry (string, hist_inittime ()); + temp = alloc_history_entry ((char*) string, hist_inittime ()); the_history[history_length] = (HIST_ENTRY *)NULL; the_history[history_length - 1] = temp; diff --git a/cmd-line-utils/readline/readline.c b/cmd-line-utils/readline/readline.c index 8c3cad52d36..3a0f533fcd6 100644 --- a/cmd-line-utils/readline/readline.c +++ b/cmd-line-utils/readline/readline.c @@ -90,7 +90,6 @@ static void bind_arrow_keys_internal PARAMS((Keymap)); static void bind_arrow_keys PARAMS((void)); static void readline_default_bindings PARAMS((void)); -static void reset_default_bindings PARAMS((void)); static int _rl_subseq_result PARAMS((int, Keymap, int, int)); static int _rl_subseq_getchar PARAMS((int)); @@ -287,7 +286,7 @@ rl_set_prompt (prompt) { FREE (rl_prompt); rl_prompt = prompt ? savestring (prompt) : (char *)NULL; - rl_display_prompt = rl_prompt ? rl_prompt : ""; + rl_display_prompt = rl_prompt ? rl_prompt : (char*) ""; rl_visible_prompt_length = rl_expand_prompt (rl_prompt); return 0; @@ -1072,18 +1071,6 @@ readline_default_bindings () rl_tty_set_default_bindings (_rl_keymap); } -/* Reset the default bindings for the terminal special characters we're - interested in back to rl_insert and read the new ones. */ -static void -reset_default_bindings () -{ - if (_rl_bind_stty_chars) - { - rl_tty_unset_default_bindings (_rl_keymap); - rl_tty_set_default_bindings (_rl_keymap); - } -} - /* Bind some common arrow key sequences in MAP. */ static void bind_arrow_keys_internal (map) diff --git a/cmd-line-utils/readline/text.c b/cmd-line-utils/readline/text.c index b26afeda525..bcb5a5c32fd 100644 --- a/cmd-line-utils/readline/text.c +++ b/cmd-line-utils/readline/text.c @@ -1169,7 +1169,7 @@ rl_insert_comment (count, key) int rl_comment_len; rl_beg_of_line (1, key); - rl_comment_text = _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT; + rl_comment_text = _rl_comment_begin ? _rl_comment_begin : (char*) RL_COMMENT_BEGIN_DEFAULT; if (rl_explicit_arg == 0) rl_insert_text (rl_comment_text); @@ -1386,10 +1386,11 @@ rl_transpose_chars (count, key) #if defined (HANDLE_MULTIBYTE) char *dummy; int i; + int prev_point; #else char dummy[2]; #endif - int char_length, prev_point; + int char_length; if (count == 0) return 0; @@ -1408,7 +1409,9 @@ rl_transpose_chars (count, key) count = 1; } +#if defined (HANDLE_MULTIBYTE) prev_point = rl_point; +#endif rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); #if defined (HANDLE_MULTIBYTE) diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 index 8dfb698709f..62789e2fb15 100644 --- a/config/ac-macros/plugins.m4 +++ b/config/ac-macros/plugins.m4 @@ -280,7 +280,7 @@ dnl --------------------------------------------------------------------------- dnl Macro: MYSQL_CONFIGURE_PLUGINS dnl dnl SYNOPSIS -dnl MYSQL_PLUGIN_DEPENDS([name,name...]) +dnl MYSQL_CONFIGURE_PLUGINS([name,name...]) dnl dnl DESCRIPTION dnl Used last, emits all required shell code to configure the plugins @@ -735,13 +735,13 @@ dnl Emits shell script for checking configure arguments dnl Arguments to this macro is default value for selected plugins AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARGS],[ - __MYSQL_CHECK_PLUGIN_ARGS(m4_default([$1], [none])) + __MYSQL_CHECK_PLUGIN_ARGS(m4_default([$1], [default])) ]) AC_DEFUN([__MYSQL_CHECK_PLUGIN_ARGS],[ AC_ARG_WITH([plugins], AS_HELP_STRING([--with-plugins=PLUGIN[[[[[,PLUGIN..]]]]]], - [Plugins to include in mysqld. (default is: $1) Must be a + [Plugins to include in mysqld. Must be a configuration name or a comma separated list of plugins.]) AS_HELP_STRING([], [Available configurations are:] dnl diff --git a/configure.in b/configure.in index 106c46a45b6..3636398abc2 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM # # When changing major version number please also check switch statement # in mysqlbinlog::check_master_version(). -AM_INIT_AUTOMAKE(mysql, 5.1.31) +AM_INIT_AUTOMAKE(mysql, 5.1.31-maria-alpha) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 @@ -250,8 +250,6 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' # Not critical since the generated file is distributed AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL']) -AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf) -AC_CHECK_PROG(DVIS, tex, manual.dvi) #check the return type of sprintf AC_MSG_CHECKING("return type of sprintf") @@ -817,7 +815,7 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \ memory.h pwd.h select.h \ - stdlib.h stddef.h \ + stdlib.h stddef.h sys/stat.h \ strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \ @@ -1727,41 +1725,43 @@ fi AC_ARG_WITH([atomic-ops], AC_HELP_STRING([--with-atomic-ops=rwlocks|smp|up], [Implement atomic operations using pthread rwlocks or atomic CPU - instructions for multi-processor (default) or uniprocessor - configuration]), , [with_atomic_ops=smp]) + instructions for multi-processor or uniprocessor + configuration. By default gcc built-in sync functions are used, + if available and 'smp' configuration otherwise.])) case "$with_atomic_ops" in "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1], [Assume single-CPU mode, no concurrency]) ;; "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1], [Use pthread rwlocks for atomic ops]) ;; "smp") ;; + "") + AC_CACHE_CHECK([whether the compiler provides atomic builtins], + [mysql_cv_gcc_atomic_builtins], [AC_TRY_RUN([ + int main() + { + int foo= -10; int bar= 10; + if (!__sync_fetch_and_add(&foo, bar) || foo) + return -1; + bar= __sync_lock_test_and_set(&foo, bar); + if (bar || foo != 10) + return -1; + bar= __sync_val_compare_and_swap(&bar, foo, 15); + if (bar) + return -1; + return 0; + } + ], [mysql_cv_gcc_atomic_builtins=yes_but_disabled], + [mysql_cv_gcc_atomic_builtins=no], + [mysql_cv_gcc_atomic_builtins=no])]) + + if test "x$mysql_cv_gcc_atomic_builtins" = xyes; then + AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1, + [Define to 1 if compiler provides atomic builtins.]) + fi + ;; *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;; esac -AC_CACHE_CHECK([whether the compiler provides atomic builtins], - [mysql_cv_gcc_atomic_builtins], [AC_TRY_RUN([ - int main() - { - int foo= -10; int bar= 10; - if (!__sync_fetch_and_add(&foo, bar) || foo) - return -1; - bar= __sync_lock_test_and_set(&foo, bar); - if (bar || foo != 10) - return -1; - bar= __sync_val_compare_and_swap(&bar, foo, 15); - if (bar) - return -1; - return 0; - } -], [mysql_cv_gcc_atomic_builtins=yes], - [mysql_cv_gcc_atomic_builtins=no], - [mysql_cv_gcc_atomic_builtins=no])]) - -if test "x$mysql_cv_gcc_atomic_builtins" = xyes; then - AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1, - [Define to 1 if compiler provides atomic builtins.]) -fi - # Force static compilation to avoid linking problems/get more speed AC_ARG_WITH(mysqld-ldflags, [ --with-mysqld-ldflags Extra linking arguments for mysqld], @@ -2052,7 +2052,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \ pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ realpath rename rint rwlock_init setupterm \ shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \ - sighold sigset sigthreadmask port_create sleep \ + sighold sigset sigthreadmask port_create sleep thr_yield \ snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \ strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \ posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd) @@ -2396,12 +2396,23 @@ MYSQL_CHECK_SSL # functions tested above #-------------------------------------------------------------------- +# MyISAM is declared here,not in storage/myisam/plug.in +# because we want it to be the first in the list of plugins, +# Maria needs it. When it'll be fixed the declaration below can +# be removed and restored (uncommented) in storage/myisam/plug.in +MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine], + [Traditional non-transactional MySQL tables]) +MYSQL_PLUGIN_DIRECTORY(myisam, [storage/myisam]) +MYSQL_PLUGIN_STATIC(myisam, [libmyisam.a]) +MYSQL_PLUGIN_MANDATORY(myisam) dnl Default +MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisam, [ha_myisam.cc]) + MYSQL_STORAGE_ENGINE(partition, partition, [Partition Support], [MySQL Partitioning Support], [max,max-no-ndb]) dnl -- ndbcluster requires partition to be enabled -MYSQL_CONFIGURE_PLUGINS([none]) +MYSQL_CONFIGURE_PLUGINS([default]) # Only build client code? AC_ARG_WITH(server, @@ -2624,8 +2635,6 @@ AC_SUBST(readline_basedir) AC_SUBST(readline_link) AC_SUBST(readline_h_ln_cmd) - - # Include man pages, if desired, adapted to the configured parts. if test X"$with_man" = Xyes then @@ -2719,14 +2728,12 @@ if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no" then AC_DEFINE([THREAD], [1], [Define if you want to have threaded code. This may be undef on client code]) - # Avoid _PROGRAMS names - THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o mf_keycache.o" - AC_SUBST(THREAD_LOBJECTS) server_scripts="mysqld_safe mysql_install_db" sql_server_dirs="strings mysys dbug extra regex" sql_server="vio sql" fi +AM_CONDITIONAL(THREAD, test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no") # "innochecksum" is not in the "innobase/" subdirectory, but should be switched AM_CONDITIONAL([BUILD_INNODB_TOOLS], [test X"$with_plugin_innobase" = Xyes]) diff --git a/dbug/.cvsignore b/dbug/.cvsignore deleted file mode 100644 index e9955884756..00000000000 --- a/dbug/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -.deps -Makefile -Makefile.in diff --git a/dbug/CMakeLists.txt b/dbug/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/dbug/Makefile.am b/dbug/Makefile.am index 872ebdb7902..7e909f9154f 100644 --- a/dbug/Makefile.am +++ b/dbug/Makefile.am @@ -23,19 +23,20 @@ libdbug_a_SOURCES = dbug.c sanity.c EXTRA_DIST = CMakeLists.txt example1.c example2.c example3.c \ user.r monty.doc dbug_add_tags.pl \ my_main.c main.c factorial.c dbug_analyze.c \ - CMakeLists.txt + CMakeLists.txt tests.c tests-t.pl NROFF_INC = example1.r example2.r example3.r main.r \ factorial.r output1.r output2.r output3.r \ output4.r output5.r -CLEANFILES = $(NROFF_INC) user.t user.ps +CLEANFILES = $(NROFF_INC) user.t user.ps tests-t # Must be linked with libs that are not compiled yet -noinst_PROGRAMS = factorial dbug_analyze +noinst_PROGRAMS = factorial dbug_analyze tests factorial_SOURCES = my_main.c factorial.c +tests_SOURCES = tests.c dbug_analyze_SOURCES = dbug_analyze.c -all: user.t user.ps +all: user.t user.ps tests-t user.t: user.r $(NROFF_INC) -nroff -mm user.r > $@ @@ -61,5 +62,9 @@ output5.r: factorial @RM@ -f $@ @SED@ -e 's!\\!\\\\!g' $< > $@ +# a hack to have executable in builddir, not in srcdir +tests-t: tests-t.pl + cp -f $(srcdir)/tests-t.pl ./tests-t + # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/dbug/dbug.c b/dbug/dbug.c index baf080f5e27..fc2faf867e4 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -57,21 +57,34 @@ * seismo!bpa!sjuvax!bbanerje * * Michael Widenius: - * DBUG_DUMP - To dump a block of memory. - * PUSH_FLAG "O" - To be used insted of "o" if we - * want flushing after each write - * PUSH_FLAG "A" - as 'O', but we will append to the out file instead - * of creating a new one. - * Check of malloc on entry/exit (option "S") + * DBUG_DUMP - To dump a block of memory. + * PUSH_FLAG "O" - To be used insted of "o" if we + * want flushing after each write + * PUSH_FLAG "A" - as 'O', but we will append to the out file instead + * of creating a new one. + * Check of malloc on entry/exit (option "S") * - * DBUG_EXECUTE_IF - * incremental mode (-#+t:-d,info ...) - * DBUG_SET, _db_explain_ - * thread-local settings + * Sergei Golubchik: + * DBUG_EXECUTE_IF + * incremental mode (-#+t:-d,info ...) + * DBUG_SET, _db_explain_ + * thread-local settings + * negative lists (-#-d,info => everything but "info") + * + * function/ syntax + * (the logic is - think of a call stack as of a path. + * "function" means only this function, "function/" means the hierarchy. + * in the future, filters like function1/function2 could be supported. + * wildcards are a natural extension too: * and ?) * */ +/* + We can't have SAFE_MUTEX defined here as this will cause recursion + in pthread_mutex_lock +*/ +#undef SAFE_MUTEX #include #include #include @@ -79,7 +92,6 @@ #include #endif - #ifndef DBUG_OFF @@ -95,21 +107,24 @@ * The following flags are used to determine which * capabilities the user has enabled with the settings * push macro. + * + * TRACE_ON is also used in _db_stack_frame_->level + * (until we add flags to _db_stack_frame_, increasing it by 4 bytes) */ -#define TRACE_ON 000001 /* Trace enabled */ -#define DEBUG_ON 000002 /* Debug enabled */ -#define FILE_ON 000004 /* File name print enabled */ -#define LINE_ON 000010 /* Line number print enabled */ -#define DEPTH_ON 000020 /* Function nest level print enabled */ -#define PROCESS_ON 000040 /* Process name print enabled */ -#define NUMBER_ON 000100 /* Number each line of output */ -#define PROFILE_ON 000200 /* Print out profiling code */ -#define PID_ON 000400 /* Identify each line with process id */ -#define TIMESTAMP_ON 001000 /* timestamp every line of output */ -#define SANITY_CHECK_ON 002000 /* Check safemalloc on DBUG_ENTER */ -#define FLUSH_ON_WRITE 004000 /* Flush on every write */ -#define OPEN_APPEND 010000 /* Open for append */ +#define DEBUG_ON (1 << 1) /* Debug enabled */ +#define FILE_ON (1 << 2) /* File name print enabled */ +#define LINE_ON (1 << 3) /* Line number print enabled */ +#define DEPTH_ON (1 << 4) /* Function nest level print enabled */ +#define PROCESS_ON (1 << 5) /* Process name print enabled */ +#define NUMBER_ON (1 << 6) /* Number each line of output */ +#define PROFILE_ON (1 << 7) /* Print out profiling code */ +#define PID_ON (1 << 8) /* Identify each line with process id */ +#define TIMESTAMP_ON (1 << 9) /* timestamp every line of output */ +#define SANITY_CHECK_ON (1 << 10) /* Check safemalloc on DBUG_ENTER */ +#define FLUSH_ON_WRITE (1 << 11) /* Flush on every write */ +#define OPEN_APPEND (1 << 12) /* Open for append */ +#define TRACE_ON ((uint)1 << 31) /* Trace enabled. MUST be the highest bit!*/ #define TRACING (cs->stack->flags & TRACE_ON) #define DEBUGGING (cs->stack->flags & DEBUG_ON) @@ -119,11 +134,7 @@ * Typedefs to make things more obvious. */ -#ifndef __WIN__ -typedef int BOOLEAN; -#else -#define BOOLEAN BOOL -#endif +#define BOOLEAN my_bool /* * Make it easy to change storage classes if necessary. @@ -139,7 +150,7 @@ typedef int BOOLEAN; * (G?) which allowed the user to specify this. * * If the automatic variables get allocated on the stack in - * reverse order from their declarations, then define AUTOS_REVERSE. + * reverse order from their declarations, then define AUTOS_REVERSE to 1. * This is used by the code that keeps track of stack usage. For * forward allocation, the difference in the dbug frame pointers * represents stack used by the callee function. For reverse allocation, @@ -154,6 +165,8 @@ typedef int BOOLEAN; #ifdef M_I386 /* predefined by xenix 386 compiler */ #define AUTOS_REVERSE 1 +#else +#define AUTOS_REVERSE 0 #endif /* @@ -164,7 +177,11 @@ typedef int BOOLEAN; static void perror(); /* Fake system/library error print routine */ #endif +#ifdef SAFEMALLOC IMPORT int _sanity(const char *file,uint line); /* safemalloc sanity checker */ +#else +#define _sanity(X,Y) (1) +#endif /* * The user may specify a list of functions to trace or @@ -174,9 +191,18 @@ IMPORT int _sanity(const char *file,uint line); /* safemalloc sanity checker */ struct link { struct link *next_link; /* Pointer to the next link */ - char str[1]; /* Pointer to link's contents */ + char flags; + char str[1]; /* Pointer to link's contents */ }; +/* flags for struct link and return flags of InList */ +#define SUBDIR 1 /* this MUST be 1 */ +#define INCLUDE 2 +#define EXCLUDE 4 +/* this is not a struct link flag, but only a return flags of InList */ +#define MATCHED 65536 +#define NOT_MATCHED 0 + /* * Debugging settings can be pushed or popped off of a * stack which is implemented as a linked list. Note @@ -188,18 +214,18 @@ struct link { */ struct settings { - int flags; /* Current settings flags */ - int maxdepth; /* Current maximum trace depth */ - uint delay; /* Delay after each output line */ - int sub_level; /* Sub this from code_state->level */ - FILE *out_file; /* Current output stream */ - FILE *prof_file; /* Current profiling stream */ - char name[FN_REFLEN]; /* Name of output file */ - struct link *functions; /* List of functions */ - struct link *p_functions; /* List of profiled functions */ - struct link *keywords; /* List of debug keywords */ - struct link *processes; /* List of process names */ - struct settings *next; /* Next settings in the list */ + uint flags; /* Current settings flags */ + uint maxdepth; /* Current maximum trace depth */ + uint delay; /* Delay after each output line */ + uint sub_level; /* Sub this from code_state->level */ + FILE *out_file; /* Current output stream */ + FILE *prof_file; /* Current profiling stream */ + char name[FN_REFLEN]; /* Name of output file */ + struct link *functions; /* List of functions */ + struct link *p_functions; /* List of profiled functions */ + struct link *keywords; /* List of debug keywords */ + struct link *processes; /* List of process names */ + struct settings *next; /* Next settings in the list */ }; #define is_shared(S, V) ((S)->next && (S)->next->V == (S)->V) @@ -212,18 +238,19 @@ struct settings { static BOOLEAN init_done= FALSE; /* Set to TRUE when initialization done */ static struct settings init_settings; static const char *db_process= 0;/* Pointer to process name; argv[0] */ +my_bool _dbug_on_= TRUE; /* FALSE if no debugging at all */ typedef struct _db_code_state_ { const char *process; /* Pointer to process name; usually argv[0] */ - const char *func; /* Name of current user function */ - const char *file; /* Name of current user file */ - char **framep; /* Pointer to current frame */ - struct settings *stack; /* debugging settings */ - const char *jmpfunc; /* Remember current function for setjmp */ - const char *jmpfile; /* Remember current file for setjmp */ - int lineno; /* Current debugger output line number */ - int level; /* Current function nesting level */ - int jmplevel; /* Remember nesting level at setjmp() */ + const char *func; /* Name of current user function */ + const char *file; /* Name of current user file */ + struct _db_stack_frame_ *framep; /* Pointer to current frame */ + struct settings *stack; /* debugging settings */ + const char *jmpfunc; /* Remember current function for setjmp */ + const char *jmpfile; /* Remember current file for setjmp */ + int lineno; /* Current debugger output line number */ + uint level; /* Current function nesting level */ + int jmplevel; /* Remember nesting level at setjmp() */ /* * The following variables are used to hold the state information @@ -244,12 +271,16 @@ typedef struct _db_code_state_ { The test below is so we could call functions with DBUG_ENTER before my_thread_init(). */ -#define get_code_state_or_return if (!cs && !((cs=code_state()))) return +#define get_code_state_if_not_set_or_return if (!cs && !((cs=code_state()))) return +#define get_code_state_or_return if (!((cs=code_state()))) return /* Handling lists */ -static struct link *ListAdd(struct link *, const char *, const char *); -static struct link *ListDel(struct link *, const char *, const char *); +#define ListAdd(A,B,C) ListAddDel(A,B,C,INCLUDE) +#define ListDel(A,B,C) ListAddDel(A,B,C,EXCLUDE) +static struct link *ListAddDel(struct link *, const char *, const char *, int); static struct link *ListCopy(struct link *); +static int InList(struct link *linkp,const char *cp); +static uint ListFlags(struct link *linkp); static void FreeList(struct link *linkp); /* OpenClose debug output stream */ @@ -260,10 +291,18 @@ static void PushState(CODE_STATE *cs); /* Free memory associated with debug state. */ static void FreeState (CODE_STATE *cs, struct settings *state, int free_state); /* Test for tracing enabled */ -static BOOLEAN DoTrace(CODE_STATE *cs); +static int DoTrace(CODE_STATE *cs); +/* + return values of DoTrace. + Can also be used as bitmask: ret & DO_TRACE +*/ +#define DO_TRACE 1 +#define DONT_TRACE 2 +#define ENABLE_TRACE 3 +#define DISABLE_TRACE 4 /* Test to see if file is writable */ -#if !(!defined(HAVE_ACCESS) || defined(MSDOS)) +#if defined(HAVE_ACCESS) && !defined(MSDOS) static BOOLEAN Writable(const char *pathname); /* Change file owner and group */ static void ChangeOwner(CODE_STATE *cs, char *pathname); @@ -275,8 +314,7 @@ static void DoPrefix(CODE_STATE *cs, uint line); static char *DbugMalloc(size_t size); static const char *BaseName(const char *pathname); static void Indent(CODE_STATE *cs, int indent); -static BOOLEAN InList(struct link *linkp,const char *cp); -static void dbug_flush(CODE_STATE *); +static void DbugFlush(CODE_STATE *); static void DbugExit(const char *why); static const char *DbugStrTok(const char *s); @@ -322,34 +360,39 @@ static unsigned long Clock(void); #ifdef THREAD #include -pthread_mutex_t THR_LOCK_dbug; +static pthread_mutex_t THR_LOCK_dbug; static CODE_STATE *code_state(void) { - CODE_STATE *cs=0; - struct st_my_thread_var *tmp; + CODE_STATE *cs, **cs_ptr; + + /* + _dbug_on_ is reset if we don't plan to use any debug commands at all and + we want to run on maximum speed + */ + if (!_dbug_on_) + return 0; if (!init_done) { + init_done=TRUE; pthread_mutex_init(&THR_LOCK_dbug,MY_MUTEX_INIT_FAST); bzero(&init_settings, sizeof(init_settings)); init_settings.out_file=stderr; init_settings.flags=OPEN_APPEND; - init_done=TRUE; } - if ((tmp=my_thread_var)) + if (!(cs_ptr= (CODE_STATE**) my_thread_var_dbug())) + return 0; /* Thread not initialised */ + if (!(cs= *cs_ptr)) { - if (!(cs=(CODE_STATE *) tmp->dbug)) - { - cs=(CODE_STATE*) DbugMalloc(sizeof(*cs)); - bzero((uchar*) cs,sizeof(*cs)); - cs->process= db_process ? db_process : "dbug"; - cs->func="?func"; - cs->file="?file"; - cs->stack=&init_settings; - tmp->dbug= (void*) cs; - } + cs=(CODE_STATE*) DbugMalloc(sizeof(*cs)); + bzero((uchar*) cs,sizeof(*cs)); + cs->process= db_process ? db_process : "dbug"; + cs->func="?func"; + cs->file="?file"; + cs->stack=&init_settings; + *cs_ptr= cs; } return cs; } @@ -403,20 +446,19 @@ static CODE_STATE *code_state(void) void _db_process_(const char *name) { - CODE_STATE *cs=0; + CODE_STATE *cs; if (!db_process) db_process= name; - + get_code_state_or_return; cs->process= name; } - /* * FUNCTION * - * DbugParse parse control string and set current debugger setting + * DbugParse parse control string and set current debugger settings * * DESCRIPTION * @@ -438,15 +480,17 @@ void _db_process_(const char *name) * * For convenience, any leading "-#" is stripped off. * + * RETURN + * 1 - a list of functions ("f" flag) was possibly changed + * 0 - a list of functions was not changed */ -static void DbugParse(CODE_STATE *cs, const char *control) +int DbugParse(CODE_STATE *cs, const char *control) { const char *end; - int rel=0; + int rel, f_used=0; struct settings *stack; - get_code_state_or_return; stack= cs->stack; if (control[0] == '-' && control[1] == '#') @@ -497,7 +541,6 @@ static void DbugParse(CODE_STATE *cs, const char *control) { int c, sign= (*control == '+') ? 1 : (*control == '-') ? -1 : 0; if (sign) control++; - if (!rel) sign=0; c= *control++; if (*control == ',') control++; /* XXX when adding new cases here, don't forget _db_explain_ ! */ @@ -526,6 +569,7 @@ static void DbugParse(CODE_STATE *cs, const char *control) stack->delay= atoi(control); break; case 'f': + f_used= 1; if (sign < 0 && control == end) { if (!is_shared(stack,functions)) @@ -664,8 +708,111 @@ static void DbugParse(CODE_STATE *cs, const char *control) control=end+1; end= DbugStrTok(control); } + return !rel || f_used; } +#define framep_trace_flag(cs, frp) (frp ? \ + frp->level & TRACE_ON : \ + (ListFlags(cs->stack->functions) & INCLUDE) ? \ + 0 : (uint)TRACE_ON) + +void FixTraceFlags_helper(CODE_STATE *cs, const char *func, + struct _db_stack_frame_ *framep) +{ + if (framep->prev) + FixTraceFlags_helper(cs, framep->func, framep->prev); + + cs->func= func; + cs->level= framep->level & ~TRACE_ON; + framep->level= cs->level | framep_trace_flag(cs, framep->prev); + /* + we don't set cs->framep correctly, even though DoTrace uses it. + It's ok, because cs->framep may only affect DO_TRACE/DONT_TRACE return + values, but we ignore them here anyway + */ + switch(DoTrace(cs)) { + case ENABLE_TRACE: + framep->level|= TRACE_ON; + break; + case DISABLE_TRACE: + framep->level&= ~TRACE_ON; + break; + } +} + +#define fflags(cs) cs->stack->out_file ? ListFlags(cs->stack->functions) : TRACE_ON; + +void FixTraceFlags(uint old_fflags, CODE_STATE *cs) +{ + const char *func; + uint new_fflags, traceon, level; + struct _db_stack_frame_ *framep; + + /* + first (a.k.a. safety) check: + if we haven't started tracing yet, no call stack at all - we're safe. + */ + framep=cs->framep; + if (framep == 0) + return; + + /* + Ok, the tracing has started, call stack isn't empty. + + second check: does the new list have a SUBDIR rule ? + */ + new_fflags=fflags(cs); + if (new_fflags & SUBDIR) + goto yuck; + + /* + Ok, new list doesn't use SUBDIR. + + third check: we do NOT need to re-scan if + neither old nor new lists used SUBDIR flag and if a default behavior + (whether an unlisted function is traced) hasn't changed. + Default behavior depends on whether there're INCLUDE elements in the list. + */ + if (!(old_fflags & SUBDIR) && !((new_fflags^old_fflags) & INCLUDE)) + return; + + /* + Ok, old list may've used SUBDIR, or defaults could've changed. + + fourth check: are we inside a currently active SUBDIR rule ? + go up the call stack, if TRACE_ON flag ever changes its value - we are. + */ + for (traceon=framep->level; framep; framep=framep->prev) + if ((traceon ^ framep->level) & TRACE_ON) + goto yuck; + + /* + Ok, TRACE_ON flag doesn't change in the call stack. + + fifth check: but is the top-most value equal to a default one ? + */ + if (((traceon & TRACE_ON) != 0) == ((new_fflags & INCLUDE) == 0)) + return; + +yuck: + /* + Yuck! function list was changed, and one of the currently active rules + was possibly affected. For example, a tracing could've been enabled or + disabled for a function somewhere up the call stack. + To react correctly, we must go up the call stack all the way to + the top and re-match rules to set TRACE_ON bit correctly. + + We must traverse the stack forwards, not backwards. + That's what a recursive helper is doing. + It'll destroy two CODE_STATE fields, save them now. + */ + func= cs->func; + level= cs->level; + FixTraceFlags_helper(cs, func, cs->framep); + /* now we only need to restore CODE_STATE fields, and we're done */ + cs->func= func; + cs->level= level; +} /* * FUNCTION @@ -680,22 +827,21 @@ static void DbugParse(CODE_STATE *cs, const char *control) * DESCRIPTION * * Given pointer to a debug control string in "control", - * parses the control string, and sets up a current debug - * settings. Pushes a new debug settings if the current is - * set to the initial debugger settings. + * parses the control string, and sets + * up a current debug settings. + * */ -void _db_set_(CODE_STATE *cs, const char *control) +void _db_set_(const char *control) { + CODE_STATE *cs; + uint old_fflags; get_code_state_or_return; - - if (cs->stack == &init_settings) - PushState(cs); - - DbugParse(cs, control); + old_fflags=fflags(cs); + if (DbugParse(cs, control)) + FixTraceFlags(old_fflags, cs); } - /* * FUNCTION * @@ -710,16 +856,19 @@ void _db_set_(CODE_STATE *cs, const char *control) * * Given pointer to a debug control string in "control", pushes * the current debug settings, parses the control string, and sets - * up a new debug settings with DbugParse() + * up a new debug settings * */ void _db_push_(const char *control) { - CODE_STATE *cs=0; + CODE_STATE *cs; + uint old_fflags; get_code_state_or_return; + old_fflags=fflags(cs); PushState(cs); - DbugParse(cs, control); + if (DbugParse(cs, control)) + FixTraceFlags(old_fflags, cs); } /* @@ -765,15 +914,18 @@ void _db_set_init_(const char *control) void _db_pop_() { struct settings *discard; - CODE_STATE *cs=0; + uint old_fflags; + CODE_STATE *cs; get_code_state_or_return; discard= cs->stack; if (discard->next != NULL) { + old_fflags=fflags(cs); cs->stack= discard->next; FreeState(cs, discard, 1); + FixTraceFlags(old_fflags, cs); } } @@ -798,11 +950,16 @@ void _db_pop_() buf=strnmov(buf, (S), len+1); \ if (buf >= end) goto overflow; \ } while (0) -#define list_to_buf(l) do { \ +#define list_to_buf(l, f) do { \ struct link *listp=(l); \ while (listp) \ { \ - str_to_buf(listp->str); \ + if (listp->flags & (f)) \ + { \ + str_to_buf(listp->str); \ + if (listp->flags & SUBDIR) \ + char_to_buf('/'); \ + } \ listp=listp->next_link; \ } \ } while (0) @@ -842,9 +999,18 @@ void _db_pop_() #define op_list_to_buf(C, val, cond) do { \ if ((cond)) \ { \ + int f=ListFlags(val); \ colon_to_buf; \ char_to_buf((C)); \ - list_to_buf(val); \ + if (f & INCLUDE) \ + list_to_buf(val, INCLUDE); \ + if (f & EXCLUDE) \ + { \ + colon_to_buf; \ + char_to_buf('-'); \ + char_to_buf((C)); \ + list_to_buf(val, EXCLUDE); \ + } \ } \ } while (0) #define op_bool_to_buf(C, cond) do { \ @@ -859,7 +1025,7 @@ int _db_explain_ (CODE_STATE *cs, char *buf, size_t len) { char *start=buf, *end=buf+len-4; - get_code_state_or_return *buf=0; + get_code_state_if_not_set_or_return *buf=0; op_list_to_buf('d', cs->stack->keywords, DEBUGGING); op_int_to_buf ('D', cs->stack->delay, 0); @@ -927,15 +1093,11 @@ int _db_explain_init_(char *buf, size_t len) * * SYNOPSIS * - * VOID _db_enter_(_func_, _file_, _line_, - * _sfunc_, _sfile_, _slevel_, _sframep_) + * VOID _db_enter_(_func_, _file_, _line_, _stack_frame_) * char *_func_; points to current function name * char *_file_; points to current file name * int _line_; called from source line number - * char **_sfunc_; save previous _func_ - * char **_sfile_; save previous _file_ - * int *_slevel_; save previous nesting level - * char ***_sframep_; save previous frame pointer + * struct _db_stack_frame_ allocated on the caller's stack * * DESCRIPTION * @@ -959,55 +1121,66 @@ int _db_explain_init_(char *buf, size_t len) */ void _db_enter_(const char *_func_, const char *_file_, - uint _line_, const char **_sfunc_, const char **_sfile_, - uint *_slevel_, char ***_sframep_ __attribute__((unused))) + uint _line_, struct _db_stack_frame_ *_stack_frame_) { - int save_errno=errno; - CODE_STATE *cs=0; - get_code_state_or_return; + int save_errno; + CODE_STATE *cs; + if (!((cs=code_state()))) + { + _stack_frame_->level= 0; /* Set to avoid valgrind warnings if dbug is enabled later */ + _stack_frame_->prev= 0; + return; + } + save_errno= errno; - *_sfunc_= cs->func; - *_sfile_= cs->file; + _stack_frame_->func= cs->func; + _stack_frame_->file= cs->file; cs->func= _func_; cs->file= _file_; - *_slevel_= ++cs->level; + _stack_frame_->prev= cs->framep; + _stack_frame_->level= ++cs->level | framep_trace_flag(cs, cs->framep); + cs->framep= _stack_frame_; #ifndef THREAD - *_sframep_= cs->framep; - cs->framep= (char **) _sframep_; if (DoProfile(cs)) { long stackused; - if (*cs->framep == NULL) + if (cs->framep->prev == NULL) stackused= 0; else { - stackused= ((long)(*cs->framep)) - ((long)(cs->framep)); + stackused= (char*)(cs->framep->prev) - (char*)(cs->framep); stackused= stackused > 0 ? stackused : -stackused; } (void) fprintf(cs->stack->prof_file, PROF_EFMT , Clock(), cs->func); -#ifdef AUTOS_REVERSE - (void) fprintf(cs->stack->prof_file, PROF_SFMT, cs->framep, stackused, *_sfunc_); -#else (void) fprintf(cs->stack->prof_file, PROF_SFMT, (ulong) cs->framep, stackused, - cs->func); -#endif + AUTOS_REVERSE ? _stack_frame_->func : cs->func); (void) fflush(cs->stack->prof_file); } #endif - if (DoTrace(cs)) - { - if (!cs->locked) - pthread_mutex_lock(&THR_LOCK_dbug); - DoPrefix(cs, _line_); - Indent(cs, cs->level); - (void) fprintf(cs->stack->out_file, ">%s\n", cs->func); - dbug_flush(cs); /* This does a unlock */ - } -#ifdef SAFEMALLOC - if (cs->stack->flags & SANITY_CHECK_ON) - if (_sanity(_file_,_line_)) /* Check of safemalloc */ + switch (DoTrace(cs)) { + case ENABLE_TRACE: + cs->framep->level|= TRACE_ON; + if (!TRACING) break; + /* fall through */ + case DO_TRACE: + if ((cs->stack->flags & SANITY_CHECK_ON) && _sanity(_file_,_line_)) cs->stack->flags &= ~SANITY_CHECK_ON; -#endif + if (TRACING) + { + if (!cs->locked) + pthread_mutex_lock(&THR_LOCK_dbug); + DoPrefix(cs, _line_); + Indent(cs, cs->level); + (void) fprintf(cs->stack->out_file, ">%s\n", cs->func); + DbugFlush(cs); /* This does a unlock */ + } + break; + case DISABLE_TRACE: + cs->framep->level&= ~TRACE_ON; + /* fall through */ + case DONT_TRACE: + break; + } errno=save_errno; } @@ -1018,11 +1191,9 @@ void _db_enter_(const char *_func_, const char *_file_, * * SYNOPSIS * - * VOID _db_return_(_line_, _sfunc_, _sfile_, _slevel_) + * VOID _db_return_(_line_, _stack_frame_) * int _line_; current source line number - * char **_sfunc_; where previous _func_ is to be retrieved - * char **_sfile_; where previous _file_ is to be retrieved - * int *_slevel_; where previous level was stashed + * struct _db_stack_frame_ allocated on the caller's stack * * DESCRIPTION * @@ -1034,51 +1205,52 @@ void _db_enter_(const char *_func_, const char *_file_, */ /* helper macro */ -void _db_return_(uint _line_, const char **_sfunc_, - const char **_sfile_, uint *_slevel_) +void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_) { int save_errno=errno; - CODE_STATE *cs=0; + uint _slevel_= _stack_frame_->level & ~TRACE_ON; + CODE_STATE *cs; get_code_state_or_return; - if (cs->level != (int) *_slevel_) + if (cs->level != _slevel_) { if (!cs->locked) pthread_mutex_lock(&THR_LOCK_dbug); (void) fprintf(cs->stack->out_file, ERR_MISSING_RETURN, cs->process, cs->func); - dbug_flush(cs); + DbugFlush(cs); } else { -#ifdef SAFEMALLOC - if (cs->stack->flags & SANITY_CHECK_ON) - { - if (_sanity(*_sfile_,_line_)) - cs->stack->flags &= ~SANITY_CHECK_ON; - } -#endif #ifndef THREAD if (DoProfile(cs)) (void) fprintf(cs->stack->prof_file, PROF_XFMT, Clock(), cs->func); #endif - if (DoTrace(cs)) + if (DoTrace(cs) & DO_TRACE) { - if (!cs->locked) - pthread_mutex_lock(&THR_LOCK_dbug); - DoPrefix(cs, _line_); - Indent(cs, cs->level); - (void) fprintf(cs->stack->out_file, "<%s\n", cs->func); - dbug_flush(cs); + if ((cs->stack->flags & SANITY_CHECK_ON) && + _sanity(_stack_frame_->file,_line_)) + cs->stack->flags &= ~SANITY_CHECK_ON; + if (TRACING) + { + if (!cs->locked) + pthread_mutex_lock(&THR_LOCK_dbug); + DoPrefix(cs, _line_); + Indent(cs, cs->level); + (void) fprintf(cs->stack->out_file, "<%s\n", cs->func); + DbugFlush(cs); + } } } - cs->level= *_slevel_-1; - cs->func= *_sfunc_; - cs->file= *_sfile_; -#ifndef THREAD + /* + Check to not set level < 0. This can happen if DBUG was disabled when + function was entered and enabled in function. + */ + cs->level= _slevel_ != 0 ? _slevel_ - 1 : 0; + cs->func= _stack_frame_->func; + cs->file= _stack_frame_->file; if (cs->framep != NULL) - cs->framep= (char **) *cs->framep; -#endif + cs->framep= cs->framep->prev; errno=save_errno; } @@ -1105,7 +1277,7 @@ void _db_return_(uint _line_, const char **_sfunc_, void _db_pargs_(uint _line_, const char *keyword) { - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return; cs->u_line= _line_; cs->u_keyword= keyword; @@ -1141,13 +1313,12 @@ void _db_pargs_(uint _line_, const char *keyword) void _db_doprnt_(const char *format,...) { va_list args; - - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return; va_start(args,format); - if (_db_keyword_(cs, cs->u_keyword)) + if (_db_keyword_(cs, cs->u_keyword, 0)) { int save_errno=errno; if (!cs->locked) @@ -1160,7 +1331,7 @@ void _db_doprnt_(const char *format,...) (void) fprintf(cs->stack->out_file, "%s: ", cs->u_keyword); (void) vfprintf(cs->stack->out_file, format, args); (void) fputc('\n',cs->stack->out_file); - dbug_flush(cs); + DbugFlush(cs); errno=save_errno; } va_end(args); @@ -1190,11 +1361,10 @@ void _db_dump_(uint _line_, const char *keyword, { int pos; char dbuff[90]; - - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return; - if (_db_keyword_(cs, keyword)) + if (_db_keyword_(cs, keyword, 0)) { if (!cs->locked) pthread_mutex_lock(&THR_LOCK_dbug); @@ -1226,7 +1396,7 @@ void _db_dump_(uint _line_, const char *keyword, fputc(' ',cs->stack->out_file); } (void) fputc('\n',cs->stack->out_file); - dbug_flush(cs); + DbugFlush(cs); } } @@ -1234,93 +1404,72 @@ void _db_dump_(uint _line_, const char *keyword, /* * FUNCTION * - * ListAdd add to the list modifiers from debug control string - * - * SYNOPSIS - * - * static struct link *ListAdd(listp, ctlp, end) - * struct link *listp; - * char *ctlp; - * char *end; + * ListAddDel modify the list according to debug control string * * DESCRIPTION * * Given pointer to a comma separated list of strings in "cltp", - * parses the list, and adds it to listp, returning a pointer - * to the new list + * parses the list, and modifies "listp", returning a pointer + * to the new list. * - * Note that since each link is added at the head of the list, - * the final list will be in "reverse order", which is not - * significant for our usage here. + * The mode of operation is defined by "todo" parameter. * + * If it is INCLUDE, elements (strings from "cltp") are added to the + * list, they will have INCLUDE flag set. If the list already contains + * the string in question, new element is not added, but a flag of + * the existing element is adjusted (INCLUDE bit is set, EXCLUDE bit + * is removed). + * + * If it is EXCLUDE, elements are added to the list with the EXCLUDE + * flag set. If the list already contains the string in question, + * it is removed, new element is not added. */ -static struct link *ListAdd(struct link *head, - const char *ctlp, const char *end) -{ - const char *start; - struct link *new_malloc; - int len; - - while (ctlp < end) - { - start= ctlp; - while (ctlp < end && *ctlp != ',') - ctlp++; - len=ctlp-start; - new_malloc= (struct link *) DbugMalloc(sizeof(struct link)+len); - memcpy(new_malloc->str, start, len); - new_malloc->str[len]=0; - new_malloc->next_link= head; - head= new_malloc; - ctlp++; - } - return head; -} - -/* - * FUNCTION - * - * ListDel remove from the list modifiers in debug control string - * - * SYNOPSIS - * - * static struct link *ListDel(listp, ctlp, end) - * struct link *listp; - * char *ctlp; - * char *end; - * - * DESCRIPTION - * - * Given pointer to a comma separated list of strings in "cltp", - * parses the list, and removes these strings from the listp, - * returning a pointer to the new list. - * - */ - -static struct link *ListDel(struct link *head, - const char *ctlp, const char *end) +static struct link *ListAddDel(struct link *head, const char *ctlp, + const char *end, int todo) { const char *start; struct link **cur; - int len; + int len, subdir; - while (ctlp < end) + ctlp--; +next: + while (++ctlp < end) { start= ctlp; + subdir=0; while (ctlp < end && *ctlp != ',') ctlp++; len=ctlp-start; - cur=&head; - do + if (start[len-1] == '/') { - while (*cur && !strncmp((*cur)->str, start, len)) + len--; + subdir=SUBDIR; + } + if (len == 0) continue; + for (cur=&head; *cur; cur=&((*cur)->next_link)) + { + if (!strncmp((*cur)->str, start, len)) { - struct link *delme=*cur; - *cur=(*cur)->next_link; - free((void*) delme); + if (todo == EXCLUDE) + { + struct link *delme=*cur; + *cur=(*cur)->next_link; + free((void*) delme); + } + else + { + (*cur)->flags&=~(EXCLUDE & SUBDIR); + (*cur)->flags|=INCLUDE | subdir; + } + goto next; } - } while (*cur && *(cur=&((*cur)->next_link))); + } + *cur= (struct link *) DbugMalloc(sizeof(struct link)+len); + memcpy((*cur)->str, start, len); + (*cur)->str[len]=0; + (*cur)->flags=todo | subdir; + (*cur)->next_link=0; } return head; } @@ -1361,6 +1510,7 @@ static struct link *ListCopy(struct link *orig) new_malloc= (struct link *) DbugMalloc(sizeof(struct link)+len); memcpy(new_malloc->str, orig->str, len); new_malloc->str[len]= 0; + new_malloc->flags=orig->flags; new_malloc->next_link= head; head= new_malloc; orig= orig->next_link; @@ -1373,47 +1523,52 @@ static struct link *ListCopy(struct link *orig) * * InList test a given string for member of a given list * - * SYNOPSIS - * - * static BOOLEAN InList(linkp, cp) - * struct link *linkp; - * char *cp; - * * DESCRIPTION * * Tests the string pointed to by "cp" to determine if it is in * the list pointed to by "linkp". Linkp points to the first - * link in the list. If linkp is NULL then the string is treated - * as if it is in the list (I.E all strings are in the null list). + * link in the list. If linkp is NULL or contains only EXCLUDE + * elements then the string is treated as if it is in the list. * This may seem rather strange at first but leads to the desired * operation if no list is given. The net effect is that all * strings will be accepted when there is no list, and when there * is a list, only those strings in the list will be accepted. * + * RETURN + * combination of SUBDIR, INCLUDE, EXCLUDE, MATCHED flags + * */ -static BOOLEAN InList(struct link *linkp, const char *cp) +static int InList(struct link *linkp, const char *cp) { - REGISTER struct link *scan; - REGISTER BOOLEAN result; + int result; - if (linkp == NULL) - result= TRUE; - else + for (result=MATCHED; linkp != NULL; linkp= linkp->next_link) { - result= FALSE; - for (scan= linkp; scan != NULL; scan= scan->next_link) - { - if (!strcmp(scan->str, cp)) - { - result= TRUE; - break; - } - } + if (!strcmp(linkp->str, cp)) + return linkp->flags; + if (!(linkp->flags & EXCLUDE)) + result=NOT_MATCHED; + if (linkp->flags & SUBDIR) + result|=SUBDIR; } return result; } +/* + * FUNCTION + * + * ListFlags returns aggregated list flags (ORed over all elements) + * + */ + +static uint ListFlags(struct link *linkp) +{ + uint f; + for (f=0; linkp != NULL; linkp= linkp->next_link) + f|= linkp->flags; + return f; +} /* * FUNCTION @@ -1503,8 +1658,12 @@ void _db_end_() { struct settings *discard; static struct settings tmp; - CODE_STATE *cs=0; - + CODE_STATE *cs; + /* + Set _dbug_on_ to be able to do full reset even when DEBUGGER_OFF was + called after dbug was initialized + */ + _dbug_on_= 1; get_code_state_or_return; while ((discard= cs->stack)) @@ -1538,25 +1697,30 @@ void _db_end_() * * DoTrace check to see if tracing is current enabled * - * SYNOPSIS - * - * static BOOLEAN DoTrace(stack) - * * DESCRIPTION * - * Checks to see if tracing is enabled based on whether the - * user has specified tracing, the maximum trace depth has - * not yet been reached, the current function is selected, - * and the current process is selected. Returns TRUE if - * tracing is enabled, FALSE otherwise. + * Checks to see if dbug in this function is enabled based on + * whether the maximum trace depth has been reached, the current + * function is selected, and the current process is selected. * */ -static BOOLEAN DoTrace(CODE_STATE *cs) +static int DoTrace(CODE_STATE *cs) { - return (TRACING && cs->level <= cs->stack->maxdepth && - InList(cs->stack->functions, cs->func) && - InList(cs->stack->processes, cs->process)); + if ((cs->stack->maxdepth == 0 || cs->level <= cs->stack->maxdepth) && + InList(cs->stack->processes, cs->process) & (MATCHED|INCLUDE)) + switch(InList(cs->stack->functions, cs->func)) { + case INCLUDE|SUBDIR: return ENABLE_TRACE; + case INCLUDE: return DO_TRACE; + case MATCHED|SUBDIR: + case NOT_MATCHED|SUBDIR: + case MATCHED: return framep_trace_flag(cs, cs->framep) ? + DO_TRACE : DONT_TRACE; + case EXCLUDE: + case NOT_MATCHED: return DONT_TRACE; + case EXCLUDE|SUBDIR: return DISABLE_TRACE; + } + return DONT_TRACE; } @@ -1584,62 +1748,27 @@ static BOOLEAN DoProfile(CODE_STATE *cs) { return PROFILING && cs->level <= cs->stack->maxdepth && - InList(cs->stack->p_functions, cs->func) && - InList(cs->stack->processes, cs->process); + InList(cs->stack->p_functions, cs->func) & (INCLUDE|MATCHED) && + InList(cs->stack->processes, cs->process) & (INCLUDE|MATCHED); } #endif FILE *_db_fp_(void) { - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return NULL; return cs->stack->out_file; } - -/* - * FUNCTION - * - * _db_strict_keyword_ test keyword for member of keyword list - * - * SYNOPSIS - * - * BOOLEAN _db_strict_keyword_(keyword) - * char *keyword; - * - * DESCRIPTION - * - * Similar to _db_keyword_, but keyword is NOT accepted if keyword list - * is empty. Used in DBUG_EXECUTE_IF() - for actions that must not be - * executed by default. - * - * Returns TRUE if keyword accepted, FALSE otherwise. - * - */ - -BOOLEAN _db_strict_keyword_(const char *keyword) -{ - CODE_STATE *cs=0; - get_code_state_or_return FALSE; - if (!DEBUGGING || cs->stack->keywords == NULL) - return FALSE; - return _db_keyword_(cs, keyword); -} - /* * FUNCTION * * _db_keyword_ test keyword for member of keyword list * - * SYNOPSIS - * - * BOOLEAN _db_keyword_(keyword) - * char *keyword; - * * DESCRIPTION * * Test a keyword to determine if it is in the currently active - * keyword list. As with the function list, a keyword is accepted + * keyword list. If strict=0, a keyword is accepted * if the list is null, otherwise it must match one of the list * members. When debugging is not on, no keywords are accepted. * After the maximum trace level is exceeded, no keywords are @@ -1651,15 +1780,13 @@ BOOLEAN _db_strict_keyword_(const char *keyword) * */ -BOOLEAN _db_keyword_(CODE_STATE *cs, const char *keyword) +BOOLEAN _db_keyword_(CODE_STATE *cs, const char *keyword, int strict) { - get_code_state_or_return FALSE; + get_code_state_if_not_set_or_return FALSE; + strict=strict ? INCLUDE : INCLUDE|MATCHED; - return (DEBUGGING && - (!TRACING || cs->level <= cs->stack->maxdepth) && - InList(cs->stack->functions, cs->func) && - InList(cs->stack->keywords, keyword) && - InList(cs->stack->processes, cs->process)); + return DEBUGGING && DoTrace(cs) & DO_TRACE && + InList(cs->stack->keywords, keyword) & strict; } /* @@ -1955,7 +2082,7 @@ static void DBUGCloseFile(CODE_STATE *cs, FILE *fp) pthread_mutex_lock(&THR_LOCK_dbug); (void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process); perror(""); - dbug_flush(cs); + DbugFlush(cs); } } @@ -2172,7 +2299,7 @@ static void ChangeOwner(CODE_STATE *cs, char *pathname) EXPORT void _db_setjmp_() { - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return; cs->jmplevel= cs->level; @@ -2199,7 +2326,7 @@ EXPORT void _db_setjmp_() EXPORT void _db_longjmp_() { - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return; cs->level= cs->jmplevel; @@ -2250,11 +2377,9 @@ char *s; /* This is because some systems (MSDOS!!) dosn't flush fileheader */ /* and dbug-file isn't readable after a system crash !! */ -static void dbug_flush(CODE_STATE *cs) +static void DbugFlush(CODE_STATE *cs) { -#ifndef THREAD if (cs->stack->flags & FLUSH_ON_WRITE) -#endif { (void) fflush(cs->stack->out_file); if (cs->stack->delay) @@ -2262,12 +2387,22 @@ static void dbug_flush(CODE_STATE *cs) } if (!cs->locked) pthread_mutex_unlock(&THR_LOCK_dbug); -} /* dbug_flush */ +} /* DbugFlush */ + + +/* For debugging */ + +void _db_flush_() +{ + CODE_STATE *cs; + get_code_state_or_return; + (void) fflush(cs->stack->out_file); +} void _db_lock_file_() { - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return; pthread_mutex_lock(&THR_LOCK_dbug); cs->locked=1; @@ -2275,7 +2410,7 @@ void _db_lock_file_() void _db_unlock_file_() { - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return; cs->locked=0; pthread_mutex_unlock(&THR_LOCK_dbug); diff --git a/dbug/dbug_add_tags.pl b/dbug/dbug_add_tags.pl index 141a2ed85f1..3e51a54c707 100755 --- a/dbug/dbug_add_tags.pl +++ b/dbug/dbug_add_tags.pl @@ -7,7 +7,7 @@ $ctags="exctags -x -f - --c-types=f -u"; sub get_tag { local $.; local $_=; ($symbol, $line)= /^(.*\S)\s+function\s+(\d+)/; - $symbol=$1 if /\s(\S+)\s*\(/; + $symbol=$1 if /[\s*]([^\s*]+)\s*\(/; $line=1e50 unless $line; } @@ -51,7 +51,7 @@ while($src=shift) $skip=!$semicolon; $semicolon= /;\s*$/; print && next if $skip || - (/^\s+\w+((::\w+)?|<\w+>)\s+\**\w+/ && !/^\s*return/); + (/^\s+\w+((::\w+)?|<\w+>)\s+\**\w+/ && !/^\s*return\b/); last if /DBUG_ENTER/; print "$tab DBUG_ENTER(\"$symbol\");\n"; print "\n" unless $_ eq "\n"; diff --git a/dbug/doinstall.sh b/dbug/doinstall.sh deleted file mode 100644 index 707f193c761..00000000000 --- a/dbug/doinstall.sh +++ /dev/null @@ -1,15 +0,0 @@ - -# Warning - first line left blank for sh/csh/ksh compatibility. Do not -# remove it. fnf@Unisoft - -# doinstall.sh --- figure out environment and do recursive make with -# appropriate pathnames. Works under SV or BSD. - -if [ -r /usr/include/search.h ] -then - # System V - $* LLIB=/usr/lib -else - # 4.2 BSD - $* LLIB=/usr/lib/lint -fi diff --git a/dbug/install.sh b/dbug/install.sh deleted file mode 100644 index 7226e01b1cf..00000000000 --- a/dbug/install.sh +++ /dev/null @@ -1,64 +0,0 @@ - -# WARNING -- first line intentionally left blank for sh/csh/ksh -# compatibility. Do not remove it! FNF, UniSoft Systems. -# -# Usage is: -# install -# -# The file is replaced with the file , after first -# moving to a backup file. The backup file name is created -# by prepending the filename (after removing any leading pathname -# components) with "OLD". -# -# This script is currently not real robust in the face of signals -# or permission problems. It also does not do (by intention) all -# the things that the System V or BSD install scripts try to do -# - -if [ $# -ne 2 ] -then - echo "usage: $0 " - exit 1 -fi - -# Now extract the dirname and basename components. Unfortunately, BSD does -# not have dirname, so we do it the hard way. - -fd=`expr $1'/' : '\(/\)[^/]*/$' \| $1'/' : '\(.*[^/]\)//*[^/][^/]*//*$' \| .` -ff=`basename $1` -td=`expr $2'/' : '\(/\)[^/]*/$' \| $2'/' : '\(.*[^/]\)//*[^/][^/]*//*$' \| .` -tf=`basename $2` - -# Now test to make sure that they are not the same files. - -if [ $fd/$ff = $td/$tf ] -then - echo "install: input and output are same files" - exit 2 -fi - -# Save a copy of the "to" file as a backup. - -if test -f $td/$tf -then - if test -f $td/OLD$tf - then - rm -f $td/OLD$tf - fi - mv $td/$tf $td/OLD$tf - if [ $? != 0 ] - then - exit 3 - fi -fi - -# Now do the copy and return appropriate status - -cp $fd/$ff $td/$tf -if [ $? != 0 ] -then - exit 4 -else - exit 0 -fi - diff --git a/dbug/mklintlib.sh b/dbug/mklintlib.sh deleted file mode 100644 index 6963016f334..00000000000 --- a/dbug/mklintlib.sh +++ /dev/null @@ -1,30 +0,0 @@ - -# Warning - first line left blank for sh/csh/ksh compatibility. Do not -# remove it. fnf@Unisoft - -# mklintlib --- make a lint library, under either System V or 4.2 BSD -# -# usage: mklintlib -# - -if test $# -ne 2 -then - echo "usage: mklintlib " - exit 1 -fi - -if grep SIGTSTP /usr/include/signal.h >/dev/null -then # BSD - if test -r /usr/include/whoami.h # 4.1 - then - /lib/cpp -C -Dlint $1 >hlint - (/usr/lib/lint/lint1 $2) 2>&1 | grep -v warning - else # 4.2 - lint -Cxxxx $1 - mv llib-lxxxx.ln $2 - fi -else # USG - cc -E -C -Dlint $1 | /usr/lib/lint1 -vx -Hhlint >$2 - rm -f hlint -fi -exit 0 # don't kill make diff --git a/dbug/qmake.cmd b/dbug/qmake.cmd deleted file mode 100644 index ebd4432f7fc..00000000000 --- a/dbug/qmake.cmd +++ /dev/null @@ -1,4 +0,0 @@ -CL -I\my\include -AL -Gsm2 -FPi -DDBUG_OFF *.c -rm \my\lib\dbug.lib -lib.exe \my\lib\dbug dbug.obj sanity.obj; -link /NOD /STACK:8000 main factoria,factoria,,DBUG+STRINGS+LLIBCEP+DOSCALLS; diff --git a/dbug/remove_function_from_trace.pl b/dbug/remove_function_from_trace.pl new file mode 100755 index 00000000000..1da9e25f9ba --- /dev/null +++ b/dbug/remove_function_from_trace.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl + + +die <stdout) removes lines from dbug trace that were generated +by specified functions and all functions down the call stack. Produces the +same effect as if the original source had DBUG_PUSH(""); right after +DBUG_ENTER() and DBUG_POP(); right before DBUG_RETURN in every such a function. +EEE + +$re=join('|', @ARGV); +$skip=''; + +while() { + print unless $skip; + next unless /^(?:.*: )*((?:\| )*)([<>])($re)\n/o; + if ($2 eq '>') { + $skip=$1.$3 unless $skip; + next; + } + next if $skip ne $1.$3; + $skip=''; + print; +} diff --git a/dbug/tests-t.pl b/dbug/tests-t.pl new file mode 100755 index 00000000000..a4227e8aa07 --- /dev/null +++ b/dbug/tests-t.pl @@ -0,0 +1,485 @@ +#!/usr/bin/env perl + +# +# A driver program to test DBUG features - runs tests (shell commands) +# from the end of file to invoke tests.c, which does the real dbug work. +# + +use Test::More; + +$exe=$0; + +die unless $exe =~ s/(tests)-t(\.exe)?$/$1$2 /; + +# load tests +@tests=(); +while () { + if (/^% \.\/tests /) { + push @tests, [ $' ] + } elsif (/^#/) { + next; + } else { + push @{$tests[$#tests]}, $_ + } +} + +plan skip_all => "because dbug is disabled" if system $exe; + +plan tests => scalar(@tests); + +for (@tests) { + $t=$exe . shift @$_; + chomp($t); + open F, '-|', $t or die "open($t|): $!"; + local $"; + $out=join($", ); close(F); + # special cases are handled here: + $out =~ s/Memory: 0x[0-9A-Fa-f]+/Memory: 0x####/g if $t =~ /dump/; + # compare ("\n" at the beginning makes better output in case of errors) + is("\n$out","\n@$_", $t); +} + +__DATA__ +% ./tests -#d +func2: info: s=ok +=> execute +=> evaluate: ON +=> evaluate_if: OFF +main: explain: dbug explained: d +func2: info: s=ok +% ./tests d,ret3 +=> evaluate: OFF +=> evaluate_if: OFF +# +## Testing negative lists +# +% ./tests d:-d,ret3 +func2: info: s=ko +=> execute +=> evaluate: ON +=> evaluate_if: OFF +main: explain: dbug explained: d:-d,ret3 +func2: info: s=ko +% ./tests t:-d,ret3 +>main +| >func1 +| | >func2 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF +| >func2 +| | >func3 +| | main +| >func1 +| | >func2 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF +| >func2 +| | >func3 +| | main +| >func1 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF +| | >func3 +| | evaluate: ON +=> evaluate_if: OFF +% ./tests t:d,info:-d,ret3:-f,func2 d,evaluate_if +=> evaluate: OFF +=> evaluate_if: ON +% ./tests t:d:-d,ret3:-f,func2 d,evaluate_if +=> evaluate: OFF +=> evaluate_if: ON +% ./tests t:d:-d,ret3:-f,func2 +>main +| >func1 +| | | >func3 +| | | execute +=> evaluate: ON +=> evaluate_if: OFF +| explain: dbug explained: d:-d,ret3:f:-f,func2:t +| | >func3 +| | main +| >func1 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: ON +| | >func3 +| | main +| >func1 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF +| | >func3 +| | main +| >func1 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF +| | >func3 +| | main +| >func1 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF +| | >func3 +| | main +| >func1 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF +| explain: dbug explained: d,dump,explain:-d,ret3:f:-f,func2:t +| | >func3 +| | main +dbug-tests: | >func1 +dbug-tests: | | | >func3 +dbug-tests: | | | evaluate: OFF +=> evaluate_if: OFF +dbug-tests: | explain: dbug explained: d,dump,explain:-d,ret3:f:-f,func2:P:t +dbug-tests: | | >func3 +dbug-tests: | | main +dbug-tests: tests.c: | >func1 +dbug-tests: tests.c: | | | >func3 +dbug-tests: tests.c: | | | evaluate: OFF +=> evaluate_if: OFF +dbug-tests: tests.c: | explain: dbug explained: d,dump,explain:-d,ret3:f:-f,func2:F:P:t +dbug-tests: tests.c: | | >func3 +dbug-tests: tests.c: | | main +| >func1 +| | | >func3 +| | | execute +=> evaluate: ON +=> evaluate_if: OFF +| explain: dbug explained: d:-d,ret3:f:-f,func2:t +| | >func3 +| | main +| >func1 +| | >func2 +| | | >func3 +| | | execute +=> evaluate: ON +=> evaluate_if: OFF +| explain: dbug explained: d:-d,ret3:t +| >func2 +| | >func3 +| | evaluate: OFF +=> evaluate_if: OFF +| >func2 +| | >func3 +| | evaluate: OFF +=> evaluate_if: OFF +| explain: dbug explained: d,info,push,explain:-d,ret3:t +| >func2 +| | >func3 +| | evaluate: OFF +=> evaluate_if: OFF +main: explain: dbug explained: d,info,explain:-d,ret3 +func2: info: s=ko +% ./tests d,info:-d,ret3:d,explain,pop +func2: info: s=ko +=> evaluate: OFF +=> evaluate_if: OFF +% ./tests d,info:-d,ret3:d,explain t:d,pop +>main +| >func1 +| | >func2 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF +main: explain: dbug explained: d,info,explain:-d,ret3 +func2: info: s=ko +% ./tests d,info:-d,ret3:d,explain,pop +t +>main +| >func1 +| | >func2 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF +main: explain: dbug explained: d,info,explain,pop:-d,ret3 +func2: info: s=ko +% ./tests d,info:-d,ret3:d,explain,set +func2: info: s=ko +=> evaluate: OFF +=> evaluate_if: OFF + tests.c: main: explain: dbug explained: d,info,explain,set:-d,ret3:F + tests.c: func2: info: s=ko +% ./tests d,info:-d,ret3:d,explain,set:t +>main +| >func1 +| | >func2 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF + tests.c: | explain: dbug explained: d,info,explain,set:-d,ret3:F:t + tests.c: | >func2 + tests.c: | | >func3 + tests.c: | | main +| >func1 +| | >func2 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF + tests.c: | explain: dbug explained: d,info,explain,set:-d,ret3:F:t + tests.c: | >func2 + tests.c: | | >func3 + tests.c: | | evaluate: OFF +=> evaluate_if: OFF +| >func2 +| | >func3 +| | func2 +| | evaluate: OFF +=> evaluate_if: OFF +| >func2 +| main +| >func1 +| execute +=> evaluate: ON +=> evaluate_if: OFF +| explain: dbug explained: d:f:-f,func2/:t +
func1 +| | >func2 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF +% ./tests t:f,main/:d,pop +>main +| >func1 +| | >func2 +| | | >func3 +| | | evaluate: OFF +=> evaluate_if: OFF +% ./tests f,main/:d,push +=> evaluate: OFF +=> evaluate_if: OFF +| >func2 +| | >func3 +| | func1 +| | >func2 +| | | >func3 +| | | push1 +=> evaluate: OFF +=> evaluate_if: OFF +| | >func3 +| | main +=> push1 +| evaluate: OFF +=> evaluate_if: OFF +| >func2 +| | >func3 +| | func3 +| | | push1 +| evaluate: OFF +=> evaluate_if: OFF +| >func2 +| | >func3 +| | main +| >func1 +| | >func2 +| | | >func3 +| | | push1 +=> evaluate: OFF +=> evaluate_if: OFF +# change the defaults +% ./tests t:f,func3 --push1=t +| | | >func3 +| | | push1 +| evaluate: OFF +=> evaluate_if: OFF +| >func2 +| | >func3 +| | /* This includes dbug.h */ +#include +#include + +const char *func3() +{ + DBUG_ENTER("func3"); + DBUG_RETURN(DBUG_EVALUATE("ret3", "ok", "ko")); +} + +void func2() +{ + const char *s; + DBUG_ENTER("func2"); + s=func3(); + DBUG_PRINT("info", ("s=%s", s)); + DBUG_VOID_RETURN; +} + +int func1() +{ + DBUG_ENTER("func1"); + func2(); + if (push1) + { + DBUG_PUSH(push1); + fprintf(DBUG_FILE, "=> push1\n"); + } + DBUG_RETURN(10); +} + +int main (int argc, char *argv[]) +{ + int i; +#ifdef DBUG_OFF + return 1; +#endif + if (argc == 1) + return 0; + +#if defined(HAVE_PTHREAD_INIT) && defined(THREAD) + pthread_init(); /* Must be called before DBUG_ENTER */ +#endif +#ifdef THREAD + my_thread_global_init(); +#endif + dup2(1, 2); + for (i = 1; i < argc; i++) + { + if (strncmp(argv[i], "--push1=", 8) == 0) + push1=argv[i]+8; + else + DBUG_PUSH (argv[i]); + } + { + DBUG_ENTER ("main"); + DBUG_PROCESS ("dbug-tests"); + func1(); + DBUG_EXECUTE_IF("dump", + { + char s[1000]; + DBUG_EXPLAIN(s, sizeof(s)-1); + DBUG_DUMP("dump", (uchar*)s, strlen(s)); + }); + DBUG_EXECUTE_IF("push", DBUG_PUSH("+t"); ); + DBUG_EXECUTE("execute", fprintf(DBUG_FILE, "=> execute\n"); ); + DBUG_EXECUTE_IF("set", DBUG_SET("+F"); ); + fprintf(DBUG_FILE, "=> evaluate: %s\n", + DBUG_EVALUATE("evaluate", "ON", "OFF")); + fprintf(DBUG_FILE, "=> evaluate_if: %s\n", + DBUG_EVALUATE_IF("evaluate_if", "ON", "OFF")); + DBUG_EXECUTE_IF("pop", DBUG_POP(); ); + { + char s[1000] __attribute__((unused)); + DBUG_EXPLAIN(s, sizeof(s)-1); + DBUG_PRINT("explain", ("dbug explained: %s", s)); + } + func2(); + DBUG_RETURN (0); + } +} diff --git a/dbug/user.r b/dbug/user.r index 19de840d0ad..527ad1f43cd 100644 --- a/dbug/user.r +++ b/dbug/user.r @@ -511,7 +511,7 @@ possible since all code preceding the first call to .B DBUG_PUSH is essentially invisible to -.B dbug +.I dbug (this can be worked around by inserting a temporary .B DBUG_PUSH(argv[1]) @@ -707,7 +707,7 @@ EX:\ \fCDBUG_PROCESS\ (argv[0]);\fR .SP 1 .LI DBUG_PUSH\ Sets a new debugger state by pushing the current -.B dbug +.I dbug state onto an internal stack and setting up the new state using the debug control string passed as the macro argument. The most common usage is to set the state specified by a debug control string @@ -768,14 +768,14 @@ the 'd' flag. Used to conditionally execute "dangerous" actions, e.g to crash the program testing how recovery works, or to introduce an artificial delay checking for race conditions. .SP 1 -EX:\ \fCDBUG_EXECUTE_IF\ ("crashme",\ abort\ ());\fR +EX:\ \fCDBUG_EXECUTE_IF\ ("crashme",\ DBUG_ABORT()\ ());\fR .SP 1 .LI DBUG_EVALUATE\ The DBUG_EVALUATE macro is similar to DBUG_EXECUTE, but it can be used in the expression context. The first argument is the debug keyword that is used to choose whether the second (keyword is enabled) or the third (keyword is not enabled) argument is evaluated. When -.B dbug +.I dbug is compiled off, the third argument is evaluated. .SP 1 EX:\fC @@ -795,7 +795,7 @@ EX:\fC .br if (prepare_transaction () || .br - DBUG_EVALUATE ("crashme", (abort (), 0), 0) || + DBUG_EVALUATE ("crashme", (DBUG_ABORT(), 0), 0) || .br commit_transaction () )\fR .SP 1 @@ -874,6 +874,12 @@ library. So there will be no need to disable asserts separately with NDEBUG. .SP 1 EX:\ \fCDBUG_ASSERT(\ a\ >\ 0\ );\fR .SP 1 +.LI DBUG_ABORT\ +This macro could be used instead of abort(). It flushes DBUG_FILE stream +to ensure that no +.I dbug +output is lost and then calls abort(). +.SP 1 .LI DBUG_EXPLAIN\ Generates control string corresponding to the current debug state. The macro takes two arguments - a buffer to store the result string @@ -909,17 +915,17 @@ via the .B DBUG_PUSH or .B DBUG_SET -macros. Control string consists of colon separate flags. Colons +macros. Control string consists of colon separated flags. Colons that are part of ':\\', ':/', or '::' are not considered flag separators. A flag may take an argument or a list of arguments. If a control string starts from a '+' sign it works .I incrementally, -that is, it can modify existing state without overriding it. In such a -string every flag may be preceded by a '+' or '-' to enable or disable -a corresponding option in the debugger state. This section summarizes -the currently available debugger options and the flag characters which -enable or disable them. Argument lists enclosed in '[' and ']' are -optional. +that is, it can modify existing state without overriding it. Every +flag may be preceded by a '+' or '-' to enable or disable a +corresponding option in the debugger state or to add or remove +arguments to the list. This section summarizes the currently available +debugger options and the flag characters which enable or disable them. +Argument lists enclosed in '[' and ']' are optional. .SP 2 .BL 22 .LI a[,file] @@ -943,6 +949,15 @@ Default is zero. .LI f[,functions] Limit debugger actions to the specified list of functions. An empty list of functions implies that all functions are selected. +Every function in the list may optionally be followed by a '/' - +this will implicitly select all the functions down the call stack. +.SP 1 +EX: \fCf,func1,func2/:-f,func3,func4/\fR +.SP 1 +This would enable debugger in functions 'func1()', 'func2()' and all +functions called from it (directly or indirectly). But not in +functions 'func3()' or 'func4()' and all functions called from +it. .LI F Mark each debugger output line with the name of the source file containing the macro causing the output. diff --git a/dbug/vargs.h b/dbug/vargs.h deleted file mode 100644 index 4609c8301bb..00000000000 --- a/dbug/vargs.h +++ /dev/null @@ -1,139 +0,0 @@ -/****************************************************************************** - * * - * N O T I C E * - * * - * Copyright Abandoned, 1987, Fred Fish * - * * - * * - * This previously copyrighted work has been placed into the public * - * domain by the author and may be freely used for any purpose, * - * private or commercial. * - * * - * Because of the number of inquiries I was receiving about the use * - * of this product in commercially developed works I have decided to * - * simply make it public domain to further its unrestricted use. I * - * specifically would be most happy to see this material become a * - * part of the standard Unix distributions by AT&T and the Berkeley * - * Computer Science Research Group, and a standard part of the GNU * - * system from the Free Software Foundation. * - * * - * I would appreciate it, as a courtesy, if this notice is left in * - * all copies and derivative works. Thank you. * - * * - * The author makes no warranty of any kind with respect to this * - * product and explicitly disclaims any implied warranties of mer- * - * chantability or fitness for any particular purpose. * - * * - ****************************************************************************** - */ - - -/* - * FILE - * - * vargs.h include file for environments without varargs.h - * - * SCCS - * - * @(#)vargs.h 1.2 5/8/88 - * - * SYNOPSIS - * - * #include "vargs.h" - * - * DESCRIPTION - * - * This file implements a varargs macro set for use in those - * environments where there is no system supplied varargs. This - * generally works because systems which don't supply a varargs - * package are precisely those which don't strictly need a varargs - * package. Using this one then allows us to minimize source - * code changes. So in some sense, this is a "portable" varargs - * since it is only used for convenience, when it is not strictly - * needed. - * - */ - -/* - * These macros allow us to rebuild an argument list on the stack - * given only a va_list. We can use these to fake a function like - * vfprintf, which gets a fixed number of arguments, the last of - * which is a va_list, by rebuilding a stack and calling the variable - * argument form fprintf. Of course this only works when vfprintf - * is not available in the host environment, and thus is not available - * for fprintf to call (which would give us an infinite loop). - * - * Note that ARGS_TYPE is a long, which lets us get several bytes - * at a time while also preventing lots of "possible pointer alignment - * problem" messages from lint. The messages are valid, because this - * IS nonportable, but then we should only be using it in very - * nonrestrictive environments, and using the real varargs where it - * really counts. - * - */ - -#define ARG0 a0 -#define ARG1 a1 -#define ARG2 a2 -#define ARG3 a3 -#define ARG4 a4 -#define ARG5 a5 -#define ARG6 a6 -#define ARG7 a7 -#define ARG8 a8 -#define ARG9 a9 - -#define ARGS_TYPE long -#define ARGS_LIST ARG0,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8,ARG9 -#define ARGS_DCL auto ARGS_TYPE ARGS_LIST - -/* - * A pointer of type "va_list" points to a section of memory - * containing an array of variable sized arguments of unknown - * number. This pointer is initialized by the va_start - * macro to point to the first byte of the first argument. - * We can then use it to walk through the argument list by - * incrementing it by the size of the argument being referenced. - */ - -typedef char *va_list; - -/* - * The first variable argument overlays va_alist, which is - * nothing more than a "handle" which allows us to get the - * address of the first argument on the stack. Note that - * by definition, the va_dcl macro includes the terminating - * semicolon, which makes use of va_dcl in the source code - * appear to be missing a semicolon. - */ - -#define va_dcl ARGS_TYPE va_alist; - -/* - * The va_start macro takes a variable of type "va_list" and - * initializes it. In our case, it initializes a local variable - * of type "pointer to char" to point to the first argument on - * the stack. - */ - -#define va_start(list) list = (char *) &va_alist - -/* - * The va_end macro is a null operation for our use. - */ - -#define va_end(list) - -/* - * The va_arg macro is the tricky one. This one takes - * a va_list as the first argument, and a type as the second - * argument, and returns a value of the appropriate type - * while advancing the va_list to the following argument. - * For our case, we first increment the va_list arg by the - * size of the type being recovered, cast the result to - * a pointer of the appropriate type, and then dereference - * that pointer as an array to get the previous arg (which - * is the one we wanted. - */ - -#define va_arg(list,type) ((type *) (list += sizeof (type)))[-1] diff --git a/extra/Makefile.am b/extra/Makefile.am index 75422c4ee11..0ef679edcac 100644 --- a/extra/Makefile.am +++ b/extra/Makefile.am @@ -22,7 +22,8 @@ BUILT_SOURCES= $(top_builddir)/include/mysqld_error.h \ $(top_builddir)/include/sql_state.h \ $(top_builddir)/include/mysqld_ername.h pkginclude_HEADERS= $(BUILT_SOURCES) -DISTCLEANFILES = $(BUILT_SOURCES) +EXTRA_PROGRAMS = comp_err +DISTCLEANFILES = $(BUILT_SOURCES) $(EXTRA_PROGRAMS) SUBDIRS = @yassl_dir@ DIST_SUBDIRS = yassl @@ -50,7 +51,6 @@ bin_PROGRAMS += innochecksum endif noinst_PROGRAMS = charset2html -EXTRA_PROGRAMS = comp_err EXTRA_DIST = CMakeLists.txt perror.o: perror.c diff --git a/extra/replace.c b/extra/replace.c index 9b7695eddcb..e254a5e7176 100644 --- a/extra/replace.c +++ b/extra/replace.c @@ -136,6 +136,7 @@ int main(int argc, char *argv[]) } } free_buffer(); + my_free(replace, MYF(0)); my_end(verbose ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR); exit(error ? 2 : 0); return 0; /* No compiler warning */ diff --git a/include/Makefile.am b/include/Makefile.am index 64f73af8606..6ace3b6acf8 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -29,8 +29,8 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \ m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \ $(HEADERS_GEN_MAKE) -noinst_HEADERS = config-win.h config-netware.h my_bit.h \ - heap.h my_bitmap.h my_uctype.h \ +noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \ + heap.h maria.h myisamchk.h my_bitmap.h my_uctype.h \ myisam.h myisampack.h myisammrg.h ft_global.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 \ @@ -38,9 +38,9 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \ thr_lock.h t_ctype.h violite.h my_md5.h base64.h \ my_handler.h my_time.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/gcc_builtins.h my_libwrap.h my_stacktrace.h - + atomic/rwlock.h atomic/x86-gcc.h atomic/generic-msvc.h \ + atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h \ + wqueue.h waiting_threads.h EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp # Remove built files and the symlinked directories diff --git a/include/atomic/gcc_builtins.h b/include/atomic/gcc_builtins.h index 509701b30a5..3eba2fff984 100644 --- a/include/atomic/gcc_builtins.h +++ b/include/atomic/gcc_builtins.h @@ -25,7 +25,10 @@ #ifdef MY_ATOMIC_MODE_DUMMY #define make_atomic_load_body(S) ret= *a #define make_atomic_store_body(S) *a= v +#define MY_ATOMIC_MODE "gcc-builtins-up" + #else +#define MY_ATOMIC_MODE "gcc-builtins-smp" #define make_atomic_load_body(S) \ ret= __sync_fetch_and_or(a, 0); #define make_atomic_store_body(S) \ diff --git a/include/atomic/generic-msvc.h b/include/atomic/generic-msvc.h new file mode 100644 index 00000000000..bd3365fc243 --- /dev/null +++ b/include/atomic/generic-msvc.h @@ -0,0 +1,108 @@ +/* Copyright (C) 2006 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _atomic_h_cleanup_ +#define _atomic_h_cleanup_ "atomic/generic-msvc.h" +/* + We don't implement anything specific for MY_ATOMIC_MODE_DUMMY, always use + intrinsics. + 8 and 16-bit atomics are not implemented, but it can be done if necessary. +*/ + +/* + x86 compilers (both VS2003 or VS2005) never use instrinsics, but generate + function calls to kernel32 instead, even in the optimized build. + We force intrinsics as described in MSDN documentation for + _InterlockedCompareExchange. +*/ +#ifdef _M_IX86 + +#if (_MSC_VER >= 1400) +#include +#else +/*Visual Studio 2003 and earlier do not have prototypes for atomic intrinsics*/ +LONG _InterlockedExchange (LONG volatile *Target,LONG Value); +LONG _InterlockedCompareExchange (LONG volatile *Target, LONG Value, LONG Comp); +LONG _InterlockedExchangeAdd (LONG volatile *Addend, LONG Value); +#pragma intrinsic(_InterlockedExchangeAdd) +#pragma intrinsic(_InterlockedCompareExchange) +#pragma intrinsic(_InterlockedExchange) +#endif + +#define InterlockedExchange _InterlockedExchange +#define InterlockedExchangeAdd _InterlockedExchangeAdd +#define InterlockedCompareExchange _InterlockedCompareExchange +/* + No need to do something special for InterlockedCompareExchangePointer + as it is a #define to InterlockedCompareExchange. The same applies to + InterlockedExchangePointer. +*/ +#endif /*_M_IX86*/ + +#define MY_ATOMIC_MODE "msvc-intrinsics" +#define IL_EXCHG_ADD32(X,Y) InterlockedExchangeAdd((volatile LONG *)(X),(Y)) +#define IL_COMP_EXCHG32(X,Y,Z) InterlockedCompareExchange((volatile LONG *)(X),(Y),(Z)) +#define IL_COMP_EXCHGptr InterlockedCompareExchangePointer +#define IL_EXCHG32 InterlockedExchange +#define IL_EXCHGptr InterlockedExchangePointer +#define make_atomic_add_body(S) \ + v= IL_EXCHG_ADD ## S (a, v) +#define make_atomic_cas_body(S) \ + int ## S initial_cmp= *cmp; \ + int ## S initial_a= IL_COMP_EXCHG ## S (a, set, initial_cmp); \ + if (!(ret= (initial_a == initial_cmp))) *cmp= initial_a; +#define make_atomic_swap_body(S) \ + v= IL_EXCHG ## S (a, v) + +/* + my_yield_processor (equivalent of x86 PAUSE instruction) should be used + to improve performance on hyperthreaded CPUs. Intel recommends to use it in + spin loops also on non-HT machines to reduce power consumption (see e.g + http://softwarecommunity.intel.com/articles/eng/2004.htm) + + Running benchmarks for spinlocks implemented with InterlockedCompareExchange + and YieldProcessor shows that much better performance is achieved by calling + YieldProcessor in a loop - that is, yielding longer. On Intel boxes setting + loop count in the range 200-300 brought best results. + */ +#ifndef YIELD_LOOPS +#define YIELD_LOOPS 200 +#endif + +static __inline int my_yield_processor() +{ + int i; + for(i=0; irw) -#define my_atomic_rwlock_init(name) pthread_rwlock_init(& (name)->rw, 0) -#define my_atomic_rwlock_rdlock(name) pthread_rwlock_rdlock(& (name)->rw) -#define my_atomic_rwlock_wrlock(name) pthread_rwlock_wrlock(& (name)->rw) -#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_MODE "rwlocks" +/* + we're using read-write lock macros but map them to mutex locks, and they're + faster. Still, having semantically rich API we can change the + underlying implementation, if necessary. +*/ +#define my_atomic_rwlock_destroy(name) pthread_mutex_destroy(& (name)->rw) +#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 #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_load_body(S) ret= *a; #define make_atomic_store_body(S) *a= v; diff --git a/include/atomic/x86-gcc.h b/include/atomic/x86-gcc.h index d79dadbf05e..5a34bc22f9e 100644 --- a/include/atomic/x86-gcc.h +++ b/include/atomic/x86-gcc.h @@ -19,10 +19,18 @@ architectures support double-word (128-bit) cas. */ -#ifdef MY_ATOMIC_NO_XADD -#define MY_ATOMIC_MODE "gcc-x86" LOCK "-no-xadd" +#ifdef __x86_64__ +# 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 -#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 /* fix -ansi errors while maintaining readability */ @@ -32,12 +40,12 @@ #ifndef MY_ATOMIC_NO_XADD #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 -#define make_atomic_swap_body(S) \ - asm volatile ("; xchg %0, %1;" : "+r" (v) , "+m" (*a)) +#define make_atomic_fas_body(S) \ + asm volatile ("xchg %0, %1;" : "+r" (v) , "+m" (*a)) #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)) #ifdef MY_ATOMIC_MODE_DUMMY @@ -46,13 +54,16 @@ #else /* 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) \ ret=0; \ - asm volatile (LOCK "; cmpxchg %2, %0" \ + asm volatile (LOCK_prefix "; cmpxchg %2, %0" \ : "+m" (*a), "+a" (ret): "r" (ret)) #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 +/* TODO test on intel whether the below helps. on AMD it makes no difference */ +//#define LF_BACKOFF ({asm volatile ("rep; nop"); 1; }) + diff --git a/include/atomic/x86-msvc.h b/include/atomic/x86-msvc.h deleted file mode 100644 index c4885bb8451..00000000000 --- a/include/atomic/x86-msvc.h +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (C) 2006 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - XXX 64-bit atomic operations can be implemented using - cmpxchg8b, if necessary -*/ - -// Would it be better to use intrinsics ? -// (InterlockedCompareExchange, InterlockedCompareExchange16 -// InterlockedExchangeAdd, InterlockedExchange) - -#ifndef _atomic_h_cleanup_ -#define _atomic_h_cleanup_ "atomic/x86-msvc.h" - -#define MY_ATOMIC_MODE "msvc-x86" LOCK - -#define make_atomic_add_body(S) \ - _asm { \ - _asm mov reg_ ## S, v \ - _asm LOCK xadd *a, reg_ ## S \ - _asm movzx v, reg_ ## S \ - } -#define make_atomic_cas_body(S) \ - _asm { \ - _asm mov areg_ ## S, *cmp \ - _asm mov reg2_ ## S, set \ - _asm LOCK cmpxchg *a, reg2_ ## S \ - _asm mov *cmp, areg_ ## S \ - _asm setz al \ - _asm movzx ret, al \ - } -#define make_atomic_swap_body(S) \ - _asm { \ - _asm mov reg_ ## S, v \ - _asm xchg *a, reg_ ## S \ - _asm mov v, reg_ ## S \ - } - -#ifdef MY_ATOMIC_MODE_DUMMY -#define make_atomic_load_body(S) ret=*a -#define make_atomic_store_body(S) *a=v -#else -/* - Actually 32-bit reads/writes are always atomic on x86 - But we add LOCK here anyway to force memory barriers -*/ -#define make_atomic_load_body(S) \ - _asm { \ - _asm mov areg_ ## S, 0 \ - _asm mov reg2_ ## S, areg_ ## S \ - _asm LOCK cmpxchg *a, reg2_ ## S \ - _asm mov ret, areg_ ## S \ - } -#define make_atomic_store_body(S) \ - _asm { \ - _asm mov reg_ ## S, v \ - _asm xchg *a, reg_ ## S \ - } -#endif - -#define reg_8 al -#define reg_16 ax -#define reg_32 eax -#define areg_8 al -#define areg_16 ax -#define areg_32 eax -#define reg2_8 bl -#define reg2_16 bx -#define reg2_32 ebx - -#else /* cleanup */ - -#undef reg_8 -#undef reg_16 -#undef reg_32 -#undef areg_8 -#undef areg_16 -#undef areg_32 -#undef reg2_8 -#undef reg2_16 -#undef reg2_32 -#endif - diff --git a/include/config-win.h b/include/config-win.h index cc2b2767663..aab401346da 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -32,6 +32,7 @@ functions */ #endif #include +#include /* chmod() constants*/ #include #include /* Because of rint() */ #include @@ -93,6 +94,15 @@ functions */ #define S_IROTH S_IREAD /* for my_lib */ +/* + Constants used by chmod. Note, that group/others is ignored + - because unsupported by Windows due to different access control model. +*/ +#define S_IRWXU S_IREAD|S_IWRITE +#define S_IRWXG 0 +#define S_IRWXO 0 +typedef int mode_t; + #ifdef __BORLANDC__ #define FILE_BINARY O_BINARY /* my_fopen in binary mode */ #define O_TEMPORARY 0 diff --git a/include/ft_global.h b/include/ft_global.h index 752371d6bc6..dba8a6e75e5 100644 --- a/include/ft_global.h +++ b/include/ft_global.h @@ -65,6 +65,17 @@ void ft_free_stopwords(void); FT_INFO *ft_init_search(uint,void *, uint, uchar *, uint,CHARSET_INFO *, uchar *); my_bool ft_boolean_check_syntax_string(const uchar *); +/* 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 } #endif diff --git a/include/hash.h b/include/hash.h index 1f094d48585..1942e9974be 100644 --- a/include/hash.h +++ b/include/hash.h @@ -66,6 +66,7 @@ extern "C" { typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool); typedef void (*my_hash_free_key)(void *); +typedef my_bool (*my_hash_walk_action)(void *,void *); typedef struct st_hash { size_t key_offset,key_length; /* Length of key if const length */ @@ -104,6 +105,7 @@ my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, size_t old_key_length); void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row); my_bool my_hash_check(HASH *hash); /* Only in debug library */ +my_bool my_hash_iterate(HASH *hash, my_hash_walk_action action, void *argument); #define my_hash_clear(H) bzero((char*) (H), sizeof(*(H))) #define my_hash_inited(H) ((H)->array.buffer != 0) diff --git a/include/keycache.h b/include/keycache.h index a6005bae878..8c4ee4afe81 100644 --- a/include/keycache.h +++ b/include/keycache.h @@ -132,7 +132,8 @@ extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup); /* Functions to handle multiple key caches */ extern my_bool multi_keycache_init(void); extern void multi_keycache_free(void); -extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length); +extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length, + KEY_CACHE *def); extern my_bool multi_key_cache_set(const uchar *key, uint length, KEY_CACHE *key_cache); extern void multi_key_cache_change(KEY_CACHE *old_data, diff --git a/include/lf.h b/include/lf.h new file mode 100644 index 00000000000..0976aa4927f --- /dev/null +++ b/include/lf.h @@ -0,0 +1,262 @@ +/* Copyright (C) 2007 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 + +/* + 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 *, void*); + +typedef struct { + LF_DYNARRAY pinarray; + 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_array; /* number of elements in array */ +} LF_PINBOX; + +typedef struct { + void * volatile pin[LF_PINBOX_PINS]; + LF_PINBOX *pinbox; + void **stack_ends_here; + 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*) + -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->pinarray.lock) +#define lf_rwunlock_by_pins(PINS) \ + my_atomic_rwlock_wrunlock(&(PINS)->pinbox->pinarray.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->pinarray.lock) +lock_wrap_void(lf_pinbox_put_pins, + (LF_PINS *pins), + (pins), + &pins->pinbox->pinarray.lock) +lock_wrap_void(lf_pinbox_free, + (LF_PINS *pins, void *addr), + (pins, addr), + &pins->pinbox->pinarray.lock) + +/* + memory allocator, lf_alloc-pin.c +*/ + +typedef struct st_lf_allocator { + LF_PINBOX pinbox; + uchar * volatile top; + uint element_size; + uint32 volatile mallocs; + void (*constructor)(uchar *); + void (*destructor)(uchar *); +} 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_pool_count(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(A) _lf_pinbox_get_pins(&(A)->pinbox) +#define lf_alloc_get_pins(A) lf_pinbox_get_pins(&(A)->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_direct_free(ALLOC, ADDR) my_free((uchar*)(ADDR), MYF(0)) + +lock_wrap(lf_alloc_new, void *, + (LF_PINS *pins), + (pins), + &pins->pinbox->pinarray.lock) + +/* + extendible hash, lf_hash.c +*/ +#include + +#define LF_HASH_UNIQUE 1 + +/* lf_hash overhead per element (that is, sizeof(LF_SLIST) */ +#define LF_HASH_OVERHEAD (sizeof(int*)*4) + +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; /* size of memcpy'ed area on insert */ + uint 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) +#define lf_hash_search_unpin(PINS) lf_unpin((PINS), 2) +/* + cleanup +*/ + +#undef lock_wrap_void +#undef lock_wrap +#undef nolock_wrap_void +#undef nolock_wrap + +#endif + diff --git a/include/m_string.h b/include/m_string.h index c24bfd7aa6c..2fadd11af89 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -134,6 +134,12 @@ extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len); #define bzero_if_purify(A,B) #endif /* HAVE_purify */ +#if defined(_lint) || defined(FORCE_INIT_OF_VARS) +#define LINT_INIT_STRUCT(var) bzero(&var, sizeof(var)) /* No uninitialize-warning */ +#else +#define LINT_INIT_STRUCT(var) +#endif + #ifndef bmove512 extern void bmove512(uchar *dst,const uchar *src,size_t len); #endif @@ -266,4 +272,12 @@ typedef struct st_mysql_lex_string LEX_STRING; #define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1)) #define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1)) +/* A variant with const and unsigned */ +struct st_mysql_const_unsigned_lex_string +{ + const uchar *str; + size_t length; +}; +typedef struct st_mysql_const_unsigned_lex_string LEX_CUSTRING; + #endif diff --git a/include/maria.h b/include/maria.h new file mode 100644 index 00000000000..37dbfe6833b --- /dev/null +++ b/include/maria.h @@ -0,0 +1,474 @@ +/* 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 */ + +/* This file should be included when using maria functions */ + +#ifndef _maria_h +#define _maria_h +#ifdef __cplusplus +extern "C" { +#endif +#ifndef _my_base_h +#include +#endif +#ifndef _m_ctype_h +#include +#endif +#include "../storage/maria/ma_pagecache.h" +#include "my_handler.h" +#include "ft_global.h" +#include +#include + +/* + Limit max keys according to HA_MAX_POSSIBLE_KEY; See myisamchk.h for details +*/ + +#if MAX_INDEXES > HA_MAX_POSSIBLE_KEY +#define MARIA_MAX_KEY HA_MAX_POSSIBLE_KEY /* Max allowed keys */ +#else +#define MARIA_MAX_KEY MAX_INDEXES /* Max allowed keys */ +#endif + +#define MARIA_NAME_IEXT ".MAI" +#define MARIA_NAME_DEXT ".MAD" +/* Max extra space to use when sorting keys */ +#define MARIA_MAX_TEMP_LENGTH 2*1024L*1024L*1024L +/* Possible values for maria_block_size (must be power of 2) */ +#define MARIA_KEY_BLOCK_LENGTH 8192 /* default key block length */ +#define MARIA_MIN_KEY_BLOCK_LENGTH 1024 /* Min key block length */ +#define MARIA_MAX_KEY_BLOCK_LENGTH 32768 +/* Minimal page cache when we only want to be able to scan a table */ +#define MARIA_MIN_PAGE_CACHE_SIZE (8192L*16L) + +/* + In the following macros '_keyno_' is 0 .. keys-1. + If there can be more keys than bits in the key_map, the highest bit + is for all upper keys. They cannot be switched individually. + This means that clearing of high keys is ignored, setting one high key + sets all high keys. +*/ +#define MARIA_KEYMAP_BITS (8 * SIZEOF_LONG_LONG) +#define MARIA_KEYMAP_HIGH_MASK (ULL(1) << (MARIA_KEYMAP_BITS - 1)) +#define maria_get_mask_all_keys_active(_keys_) \ + (((_keys_) < MARIA_KEYMAP_BITS) ? \ + ((ULL(1) << (_keys_)) - ULL(1)) : \ + (~ ULL(0))) +#if MARIA_MAX_KEY > MARIA_KEYMAP_BITS +#define maria_is_key_active(_keymap_,_keyno_) \ + (((_keyno_) < MARIA_KEYMAP_BITS) ? \ + test((_keymap_) & (ULL(1) << (_keyno_))) : \ + test((_keymap_) & MARIA_KEYMAP_HIGH_MASK)) +#define maria_set_key_active(_keymap_,_keyno_) \ + (_keymap_)|= (((_keyno_) < MARIA_KEYMAP_BITS) ? \ + (ULL(1) << (_keyno_)) : \ + MARIA_KEYMAP_HIGH_MASK) +#define maria_clear_key_active(_keymap_,_keyno_) \ + (_keymap_)&= (((_keyno_) < MARIA_KEYMAP_BITS) ? \ + (~ (ULL(1) << (_keyno_))) : \ + (~ (ULL(0))) /*ignore*/ ) +#else +#define maria_is_key_active(_keymap_,_keyno_) \ + test((_keymap_) & (ULL(1) << (_keyno_))) +#define maria_set_key_active(_keymap_,_keyno_) \ + (_keymap_)|= (ULL(1) << (_keyno_)) +#define maria_clear_key_active(_keymap_,_keyno_) \ + (_keymap_)&= (~ (ULL(1) << (_keyno_))) +#endif +#define maria_is_any_key_active(_keymap_) \ + test((_keymap_)) +#define maria_is_all_keys_active(_keymap_,_keys_) \ + ((_keymap_) == maria_get_mask_all_keys_active(_keys_)) +#define maria_set_all_keys_active(_keymap_,_keys_) \ + (_keymap_)= maria_get_mask_all_keys_active(_keys_) +#define maria_clear_all_keys_active(_keymap_) \ + (_keymap_)= 0 +#define maria_intersect_keys_active(_to_,_from_) \ + (_to_)&= (_from_) +#define maria_is_any_intersect_keys_active(_keymap1_,_keys_,_keymap2_) \ + ((_keymap1_) & (_keymap2_) & \ + maria_get_mask_all_keys_active(_keys_)) +#define maria_copy_keys_active(_to_,_maxkeys_,_from_) \ + (_to_)= (maria_get_mask_all_keys_active(_maxkeys_) & \ + (_from_)) + + /* Param to/from maria_info */ + +typedef ulonglong MARIA_RECORD_POS; + +typedef struct st_maria_info +{ + ha_rows records; /* Records in database */ + ha_rows deleted; /* Deleted records in database */ + MARIA_RECORD_POS recpos; /* Pos for last used record */ + MARIA_RECORD_POS newrecpos; /* Pos if we write new record */ + MARIA_RECORD_POS dup_key_pos; /* Position to record with dup key */ + my_off_t data_file_length; /* Length of data file */ + my_off_t max_data_file_length, index_file_length; + my_off_t max_index_file_length, delete_length; + ulonglong auto_increment; + ulonglong key_map; /* Which keys are used */ + time_t create_time; /* When table was created */ + time_t check_time; + time_t update_time; + ulong record_offset; + double *rec_per_key; /* for sql optimizing */ + ulong reclength; /* Recordlength */ + ulong mean_reclength; /* Mean recordlength (if packed) */ + char *data_file_name, *index_file_name; + enum data_file_type data_file_type; + uint keys; /* Number of keys in use */ + uint options; /* HA_OPTION_... used */ + uint reflength; + int errkey, /* With key was dupplicated on err */ + sortkey; /* clustered by this key */ + File filenr; /* (uniq) filenr for datafile */ +} MARIA_INFO; + + +typedef struct st_maria_create_info +{ + const char *index_file_name, *data_file_name; /* If using symlinks */ + ha_rows max_rows; + ha_rows reloc_rows; + ulonglong auto_increment; + ulonglong data_file_length; + ulonglong key_file_length; + /* Size of null bitmap at start of row */ + uint null_bytes; + uint old_options; + enum data_file_type org_data_file_type; + uint8 language; + my_bool with_auto_increment, transactional; +} MARIA_CREATE_INFO; + +struct st_maria_share; +struct st_maria_handler; /* For referense */ +typedef struct st_maria_handler MARIA_HA; +struct st_maria_s_param; +struct st_maria_keydef; + +typedef struct st_maria_key /* Internal info about a key */ +{ + uchar *data; /* Data for key */ + struct st_maria_keydef *keyinfo; /* Definition for key */ + uint data_length; /* Length of key data */ + uint ref_length; /* record ref + transid */ + uint32 flag; /* 0 or SEARCH_PART_KEY */ +} MARIA_KEY; + + +typedef struct st_maria_keydef /* Key definition with open & info */ +{ + struct st_maria_share *share; /* Pointer to base (set in open) */ +#ifdef THREAD + rw_lock_t root_lock; /* locking of tree */ +#endif + uint16 keysegs; /* Number of key-segment */ + uint16 flag; /* NOSAME, PACK_USED */ + + uint8 key_alg; /* BTREE, RTREE */ + uint8 key_nr; /* key number (auto) */ + uint16 block_length; /* Length of keyblock (auto) */ + uint16 underflow_block_length; /* When to execute underflow */ + uint16 keylength; /* Tot length of keyparts (auto) */ + uint16 minlength; /* min length of (packed) key (auto) */ + uint16 maxlength; /* max length of (packed) key (auto) */ + uint32 write_comp_flag; /* compare flag for write key (auto) */ + uint32 version; /* For concurrent read/write */ + uint32 ftparser_nr; /* distinct ftparser number */ + + HA_KEYSEG *seg, *end; + struct st_mysql_ftparser *parser; /* Fulltext [pre]parser */ + int (*bin_search)(const MARIA_KEY *key, uchar *page, + uint32 comp_flag, uchar **ret_pos, uchar *buff, + my_bool *was_last_key); + uint (*get_key)(MARIA_KEY *key, uint page_flag, uint nod_flag, + uchar **page); + uchar *(*skip_key)(MARIA_KEY *key, uint page_flag, uint nod_flag, + uchar *page); + int (*pack_key)(const MARIA_KEY *key, uint nod_flag, + uchar *next_key, uchar *org_key, uchar *prev_key, + struct st_maria_s_param *s_temp); + void (*store_key)(struct st_maria_keydef *keyinfo, uchar *key_pos, + struct st_maria_s_param *s_temp); + my_bool (*ck_insert)(MARIA_HA *inf, MARIA_KEY *key); + int (*ck_delete)(MARIA_HA *inf, MARIA_KEY *klen); + MARIA_KEY *(*make_key)(MARIA_HA *info, MARIA_KEY *int_key, uint keynr, + uchar *key, const uchar *record, + MARIA_RECORD_POS filepos, ulonglong trid); +} MARIA_KEYDEF; + + +#define MARIA_UNIQUE_HASH_LENGTH 4 + +typedef struct st_maria_unique_def /* Segment definition of unique */ +{ + uint16 keysegs; /* Number of key-segment */ + uint8 key; /* Mapped to which key */ + uint8 null_are_equal; + HA_KEYSEG *seg, *end; +} MARIA_UNIQUEDEF; + +typedef struct st_maria_decode_tree /* Decode huff-table */ +{ + uint16 *table; + uint quick_table_bits; + uchar *intervalls; +} MARIA_DECODE_TREE; + + +struct st_maria_bit_buff; + +/* + Note that null markers should always be first in a row ! + When creating a column, one should only specify: + type, length, null_bit and null_pos +*/ + +typedef struct st_maria_columndef /* column information */ +{ + enum en_fieldtype type; + uint32 offset; /* Offset to position in row */ + uint16 length; /* length of field */ + uint16 column_nr; + /* Intern variable (size of total storage area for the row) */ + uint16 fill_length; + uint16 null_pos; /* Position for null marker */ + uint16 empty_pos; /* Position for empty marker */ + uint8 null_bit; /* If column may be NULL */ + /* Intern. Set if column should be zero packed (part of empty_bits) */ + uint8 empty_bit; + +#ifndef NOT_PACKED_DATABASES + void(*unpack)(struct st_maria_columndef *rec, + struct st_maria_bit_buff *buff, + uchar *start, uchar *end); + enum en_fieldtype base_type; + uint space_length_bits, pack_type; + MARIA_DECODE_TREE *huff_tree; +#endif +} MARIA_COLUMNDEF; + + +extern ulong maria_block_size, maria_checkpoint_frequency; +extern ulong maria_concurrent_insert; +extern my_bool maria_flush, maria_single_user, maria_page_checksums; +extern my_bool maria_delay_key_write; +extern my_off_t maria_max_temp_length; +extern ulong maria_bulk_insert_tree_size, maria_data_pointer_size; +extern PAGECACHE maria_pagecache_var, *maria_pagecache; +extern MY_TMPDIR *maria_tmpdir; +/* + This is used to check if a symlink points into the mysql data home, + which is normally forbidden as it can be used to get access to + not privileged data +*/ +extern int (*maria_test_invalid_symlink)(const char *filename); + + /* Prototypes for maria-functions */ + +extern int maria_init(void); +extern void maria_end(void); +extern int maria_close(MARIA_HA *file); +extern int maria_delete(MARIA_HA *file, const uchar *buff); +extern MARIA_HA *maria_open(const char *name, int mode, + uint wait_if_locked); +extern MARIA_HA *maria_clone(struct st_maria_share *share, int mode); +extern int maria_panic(enum ha_panic_function function); +extern int maria_rfirst(MARIA_HA *file, uchar *buf, int inx); +extern int maria_rkey(MARIA_HA *file, uchar *buf, int inx, + const uchar *key, key_part_map keypart_map, + enum ha_rkey_function search_flag); +extern int maria_rlast(MARIA_HA *file, uchar *buf, int inx); +extern int maria_rnext(MARIA_HA *file, uchar *buf, int inx); +extern int maria_rnext_same(MARIA_HA *info, uchar *buf); +extern int maria_rprev(MARIA_HA *file, uchar *buf, int inx); +extern int maria_rrnd(MARIA_HA *file, uchar *buf, + MARIA_RECORD_POS pos); +extern int maria_scan_init(MARIA_HA *file); +extern int maria_scan(MARIA_HA *file, uchar *buf); +extern void maria_scan_end(MARIA_HA *file); +extern int maria_rsame(MARIA_HA *file, uchar *record, int inx); +extern int maria_rsame_with_pos(MARIA_HA *file, uchar *record, + int inx, MARIA_RECORD_POS pos); +extern int maria_update(MARIA_HA *file, const uchar *old, + uchar *new_record); +extern int maria_write(MARIA_HA *file, uchar *buff); +extern MARIA_RECORD_POS maria_position(MARIA_HA *file); +extern int maria_status(MARIA_HA *info, MARIA_INFO *x, uint flag); +extern int maria_lock_database(MARIA_HA *file, int lock_type); +extern int maria_create(const char *name, enum data_file_type record_type, + uint keys, MARIA_KEYDEF *keydef, + uint columns, MARIA_COLUMNDEF *columndef, + uint uniques, MARIA_UNIQUEDEF *uniquedef, + MARIA_CREATE_INFO *create_info, uint flags); +extern int maria_delete_table(const char *name); +extern int maria_rename(const char *from, const char *to); +extern int maria_extra(MARIA_HA *file, + enum ha_extra_function function, void *extra_arg); +extern int maria_reset(MARIA_HA *file); +extern ha_rows maria_records_in_range(MARIA_HA *info, int inx, + key_range *min_key, key_range *max_key); +extern int maria_is_changed(MARIA_HA *info); +extern int maria_delete_all_rows(MARIA_HA *info); +extern uint maria_get_pointer_length(ulonglong file_length, uint def); +extern int maria_commit(MARIA_HA *info); +extern int maria_begin(MARIA_HA *info); +extern void maria_disable_logging(MARIA_HA *info); +extern void maria_enable_logging(MARIA_HA *info); + +/* this is used to pass to mysql_mariachk_table */ + +#define MARIA_CHK_REPAIR 1 /* equivalent to mariachk -r */ +#define MARIA_CHK_VERIFY 2 /* Verify, run repair if failure */ + +typedef uint maria_bit_type; + +typedef struct st_maria_bit_buff +{ /* Used for packing of record */ + maria_bit_type current_byte; + uint bits; + uchar *pos, *end, *blob_pos, *blob_end; + uint error; +} MARIA_BIT_BUFF; + + +typedef struct st_maria_sort_info +{ +#ifdef THREAD + /* sync things */ + pthread_mutex_t mutex; + pthread_cond_t cond; +#endif + MARIA_HA *info, *new_info; + HA_CHECK *param; + char *buff; + SORT_KEY_BLOCKS *key_block, *key_block_end; + SORT_FT_BUF *ft_buf; + my_off_t filelength, dupp, buff_length; + pgcache_page_no_t page; + ha_rows max_records; + uint current_key, total_keys; + uint got_error, threads_running; + myf myf_rw; + enum data_file_type new_data_file_type, org_data_file_type; +} MARIA_SORT_INFO; + +typedef struct st_maria_sort_param +{ + pthread_t thr; + IO_CACHE read_cache, tempfile, tempfile_for_exceptions; + DYNAMIC_ARRAY buffpek; + MARIA_BIT_BUFF bit_buff; /* For parallel repair of packrec. */ + + MARIA_KEYDEF *keyinfo; + MARIA_SORT_INFO *sort_info; + HA_KEYSEG *seg; + uchar **sort_keys; + uchar *rec_buff; + void *wordlist, *wordptr; + MEM_ROOT wordroot; + uchar *record; + MY_TMPDIR *tmpdir; + + /* + The next two are used to collect statistics, see maria_update_key_parts for + description. + */ + ulonglong unique[HA_MAX_KEY_SEG+1]; + ulonglong notnull[HA_MAX_KEY_SEG+1]; + + MARIA_RECORD_POS pos,max_pos,filepos,start_recpos, current_filepos; + uint key, key_length,real_key_length,sortbuff_size; + uint maxbuffers, keys, find_length, sort_keys_length; + my_bool fix_datafile, master; + my_bool calc_checksum; /* calculate table checksum */ + size_t rec_buff_size; + + int (*key_cmp)(struct st_maria_sort_param *, const void *, const void *); + int (*key_read)(struct st_maria_sort_param *, uchar *); + int (*key_write)(struct st_maria_sort_param *, const uchar *); + void (*lock_in_memory)(HA_CHECK *); + int (*write_keys)(struct st_maria_sort_param *, register uchar **, + uint , struct st_buffpek *, IO_CACHE *); + uint (*read_to_buffer)(IO_CACHE *,struct st_buffpek *, uint); + int (*write_key)(struct st_maria_sort_param *, IO_CACHE *,uchar *, + uint, uint); +} MARIA_SORT_PARAM; + + +/* functions in maria_check */ +void maria_chk_init(HA_CHECK *param); +void maria_chk_init_for_check(HA_CHECK *param, MARIA_HA *info); +int maria_chk_status(HA_CHECK *param, MARIA_HA *info); +int maria_chk_del(HA_CHECK *param, MARIA_HA *info, ulonglong test_flag); +int maria_chk_size(HA_CHECK *param, MARIA_HA *info); +int maria_chk_key(HA_CHECK *param, MARIA_HA *info); +int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info, my_bool extend); +int maria_repair(HA_CHECK *param, MARIA_HA *info, char * name, my_bool); +int maria_sort_index(HA_CHECK *param, MARIA_HA *info, char * name); +int maria_zerofill(HA_CHECK *param, MARIA_HA *info, const char *name); +int maria_repair_by_sort(HA_CHECK *param, MARIA_HA *info, + const char *name, my_bool rep_quick); +int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info, + const char *name, my_bool rep_quick); +int maria_change_to_newfile(const char *filename, const char *old_ext, + const char *new_ext, myf myflags); +void maria_lock_memory(HA_CHECK *param); +int maria_update_state_info(HA_CHECK *param, MARIA_HA *info, uint update); +void maria_update_key_parts(MARIA_KEYDEF *keyinfo, double *rec_per_key_part, + ulonglong *unique, ulonglong *notnull, + ulonglong records); +int maria_filecopy(HA_CHECK *param, File to, File from, my_off_t start, + my_off_t length, const char *type); +int maria_movepoint(MARIA_HA *info, uchar *record, my_off_t oldpos, + my_off_t newpos, uint prot_key); +int maria_write_data_suffix(MARIA_SORT_INFO *sort_info, my_bool fix_datafile); +int maria_test_if_almost_full(MARIA_HA *info); +int maria_recreate_table(HA_CHECK *param, MARIA_HA **org_info, char *filename); +int maria_disable_indexes(MARIA_HA *info); +int maria_enable_indexes(MARIA_HA *info); +int maria_indexes_are_disabled(MARIA_HA *info); +void maria_disable_non_unique_index(MARIA_HA *info, ha_rows rows); +my_bool maria_test_if_sort_rep(MARIA_HA *info, ha_rows rows, ulonglong key_map, + my_bool force); + +int maria_init_bulk_insert(MARIA_HA *info, ulong cache_size, ha_rows rows); +void maria_flush_bulk_insert(MARIA_HA *info, uint inx); +void maria_end_bulk_insert(MARIA_HA *info, my_bool table_will_be_deleted); +int maria_assign_to_pagecache(MARIA_HA *info, ulonglong key_map, + PAGECACHE *key_cache); +void maria_change_pagecache(PAGECACHE *old_key_cache, + PAGECACHE *new_key_cache); +int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves); +void maria_versioning(MARIA_HA *info, my_bool versioning); +void maria_ignore_trids(MARIA_HA *info); + +/* fulltext functions */ +FT_INFO *maria_ft_init_search(uint,void *, uint, uchar *, uint, + CHARSET_INFO *, uchar *); + +/* 'Almost-internal' Maria functions */ + +void _ma_update_auto_increment_key(HA_CHECK *param, MARIA_HA *info, + my_bool repair); + + +#ifdef __cplusplus +} +#endif +#endif diff --git a/include/my_alloc.h b/include/my_alloc.h index 93b7438a1df..6ade4d08980 100644 --- a/include/my_alloc.h +++ b/include/my_alloc.h @@ -26,8 +26,8 @@ typedef struct st_used_mem { /* struct for once_alloc (block) */ struct st_used_mem *next; /* Next block in use */ - unsigned int left; /* memory left in block */ - unsigned int size; /* size of block */ + size_t left; /* memory left in block */ + size_t size; /* size of block */ } USED_MEM; diff --git a/include/my_atomic.h b/include/my_atomic.h index ed439e5fe87..40d762f8ff0 100644 --- a/include/my_atomic.h +++ b/include/my_atomic.h @@ -13,6 +13,42 @@ along with this program; if not, write to the Free Software 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. + 8- and 16-bit atomics aren't implemented for windows (see generic-msvc.h), + but can be added, if necessary. +*/ + #ifndef my_atomic_rwlock_init #define intptr void * @@ -22,118 +58,200 @@ #endif #ifndef make_atomic_cas_body +/* nolock.h was not able to generate even a CAS function, fall back */ #include "atomic/rwlock.h" -#endif - +#else +/* define missing functions by using the already generated ones */ #ifndef make_atomic_add_body -#define make_atomic_add_body(S) \ +#define make_atomic_add_body(S) \ int ## S tmp=*a; \ while (!my_atomic_cas ## S(a, &tmp, tmp+v)); \ v=tmp; #endif +#ifndef make_atomic_fas_body +#define make_atomic_fas_body(S) \ + int ## S tmp=*a; \ + while (!my_atomic_cas ## S(a, &tmp, v)); \ + v=tmp; +#endif +#ifndef make_atomic_load_body +#define make_atomic_load_body(S) \ + ret= 0; /* avoid compiler warning */ \ + (void)(my_atomic_cas ## S(a, &ret, ret)); +#endif +#ifndef make_atomic_store_body +#define make_atomic_store_body(S) \ + (void)(my_atomic_fas ## S (a, v)); +#endif +#endif + +/* + transparent_union doesn't work in g++ + Bug ? + + Darwin's gcc doesn't want to put pointers in a transparent_union + when built with -arch ppc64. Complains: + warning: 'transparent_union' attribute ignored +*/ +#if defined(__GNUC__) && !defined(__cplusplus) && \ + ! (defined(__APPLE__) && defined(_ARCH_PPC64)) +/* + 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 -#define make_atomic_add(S) \ -STATIC_INLINE int ## S my_atomic_add ## S( \ - int ## S volatile *a, int ## S v) \ -{ \ - make_atomic_add_body(S); \ - return v; \ +#define make_atomic_cas(S) \ +STATIC_INLINE int my_atomic_cas ## S(Uv_ ## S U_a, \ + Uv_ ## S U_cmp, U_ ## S U_set) \ +{ \ + int8 ret; \ + make_atomic_cas_body(S); \ + return ret; \ } -#define make_atomic_swap(S) \ -STATIC_INLINE int ## S my_atomic_swap ## S( \ - int ## S volatile *a, int ## S v) \ -{ \ - make_atomic_swap_body(S); \ - return v; \ +#define make_atomic_add(S) \ +STATIC_INLINE int ## S my_atomic_add ## S( \ + Uv_ ## S U_a, U_ ## S U_v) \ +{ \ + make_atomic_add_body(S); \ + return v; \ } -#define make_atomic_cas(S) \ -STATIC_INLINE int my_atomic_cas ## S(int ## S volatile *a, \ - int ## S *cmp, int ## S set) \ -{ \ - int8 ret; \ - make_atomic_cas_body(S); \ - return ret; \ +#define make_atomic_fas(S) \ +STATIC_INLINE int ## S my_atomic_fas ## S( \ + Uv_ ## S U_a, U_ ## S U_v) \ +{ \ + make_atomic_fas_body(S); \ + return v; \ } -#define make_atomic_load(S) \ -STATIC_INLINE int ## S my_atomic_load ## S(int ## S volatile *a) \ -{ \ - int ## S ret; \ - make_atomic_load_body(S); \ - return ret; \ +#define make_atomic_load(S) \ +STATIC_INLINE int ## S my_atomic_load ## S(Uv_ ## S U_a) \ +{ \ + int ## S ret; \ + make_atomic_load_body(S); \ + return ret; \ } -#define make_atomic_store(S) \ -STATIC_INLINE void my_atomic_store ## S( \ - int ## S volatile *a, int ## S v) \ -{ \ - make_atomic_store_body(S); \ +#define make_atomic_store(S) \ +STATIC_INLINE void my_atomic_store ## S( \ + Uv_ ## S U_a, U_ ## S U_v) \ +{ \ + make_atomic_store_body(S); \ } #else /* no inline functions */ -#define make_atomic_add(S) \ -extern int ## S my_atomic_add ## S(int ## S volatile *a, int ## S v); +#define make_atomic_add(S) \ +extern int ## S my_atomic_add ## S(Uv_ ## S U_a, U_ ## S U_v); -#define make_atomic_swap(S) \ -extern int ## S my_atomic_swap ## S(int ## S volatile *a, int ## S v); +#define make_atomic_fas(S) \ +extern int ## S my_atomic_fas ## S(Uv_ ## S U_a, U_ ## S U_v); -#define make_atomic_cas(S) \ -extern int my_atomic_cas ## S(int ## S volatile *a, int ## S *cmp, int ## S set); +#define make_atomic_cas(S) \ +extern int my_atomic_cas ## S(Uv_ ## S U_a, Uv_ ## S U_cmp, U_ ## S U_set); -#define make_atomic_load(S) \ -extern int ## S my_atomic_load ## S(int ## S volatile *a); +#define make_atomic_load(S) \ +extern int ## S my_atomic_load ## S(Uv_ ## S U_a); -#define make_atomic_store(S) \ -extern void my_atomic_store ## S(int ## S volatile *a, int ## S v); +#define make_atomic_store(S) \ +extern void my_atomic_store ## S(Uv_ ## S U_a, U_ ## S U_v); #endif -make_atomic_cas( 8) -make_atomic_cas(16) make_atomic_cas(32) make_atomic_cas(ptr) -make_atomic_add( 8) -make_atomic_add(16) make_atomic_add(32) -make_atomic_load( 8) -make_atomic_load(16) make_atomic_load(32) make_atomic_load(ptr) -make_atomic_store( 8) -make_atomic_store(16) +make_atomic_fas(32) +make_atomic_fas(ptr) + make_atomic_store(32) make_atomic_store(ptr) -make_atomic_swap( 8) -make_atomic_swap(16) -make_atomic_swap(32) -make_atomic_swap(ptr) - -#undef make_atomic_add -#undef make_atomic_cas -#undef make_atomic_load -#undef make_atomic_store -#undef make_atomic_swap -#undef make_atomic_add_body -#undef make_atomic_cas_body -#undef make_atomic_load_body -#undef make_atomic_store_body -#undef make_atomic_swap_body -#undef intptr - #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_cas +#undef make_atomic_load +#undef make_atomic_store +#undef make_atomic_fas +#undef make_atomic_add_body +#undef make_atomic_cas_body +#undef make_atomic_load_body +#undef make_atomic_store_body +#undef make_atomic_fas_body +#undef intptr + +/* + the macro below defines (as an expression) the code that + will be run in spin-loops. Intel manuals recummend to have PAUSE there. + It is expected to be defined in include/atomic/ *.h files +*/ +#ifndef LF_BACKOFF +#define LF_BACKOFF (1) +#endif + #define MY_ATOMIC_OK 0 #define MY_ATOMIC_NOT_1CPU 1 extern int my_atomic_initialize(); diff --git a/include/my_base.h b/include/my_base.h index 22f518b0f9a..a2079f6745c 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -195,7 +195,9 @@ enum ha_extra_function { begin and end of a statement. */ HA_EXTRA_ATTACH_CHILDREN, - HA_EXTRA_DETACH_CHILDREN + HA_EXTRA_DETACH_CHILDREN, + /* Inform handler we will force a close as part of flush */ + HA_EXTRA_PREPARE_FOR_FORCED_CLOSE }; /* Compatible option, to be deleted in 6.0 */ @@ -238,7 +240,10 @@ enum ha_base_keytype { #define HA_MAX_KEYTYPE 31 /* Must be log2-1 */ - /* These flags kan be OR:ed to key-flag */ +/* + These flags kan be OR:ed to key-flag + Note that these can only be up to 16 bits! +*/ #define HA_NOSAME 1 /* Set if not dupplicated records */ #define HA_PACK_KEY 2 /* Pack string key to previous key */ @@ -249,11 +254,13 @@ enum ha_base_keytype { #define HA_SPATIAL 1024 /* For spatial search */ #define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */ #define HA_GENERATED_KEY 8192 /* Automaticly generated key */ +#define HA_RTREE_INDEX 16384 /* For RTREE search */ /* The combination of the above can be used for key type comparison. */ #define HA_KEYFLAG_MASK (HA_NOSAME | HA_PACK_KEY | HA_AUTO_KEY | \ HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \ - HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY) + HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY | \ + HA_RTREE_INDEX) #define HA_KEY_HAS_PART_KEY_SEG 65536 /* Key contains partial segments */ @@ -307,8 +314,10 @@ enum ha_base_keytype { #define HA_OPTION_RELIES_ON_SQL_LAYER 512 #define HA_OPTION_NULL_FIELDS 1024 #define HA_OPTION_PAGE_CHECKSUM 2048 -#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */ -#define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */ +#define HA_OPTION_TEMP_COMPRESS_RECORD (1L << 15) /* set by isamchk */ +#define HA_OPTION_READ_ONLY_DATA (1L << 16) /* Set by isamchk */ +#define HA_OPTION_NO_CHECKSUM (1L << 17) +#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18) /* Bits in flag to create() */ @@ -431,17 +440,17 @@ enum ha_base_keytype { /* row not actually updated: new values same as the old values */ #define HA_ERR_RECORD_IS_THE_SAME 169 /* It is not possible to log this statement */ -#define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this - statement */ -#define HA_ERR_CORRUPT_EVENT 171 /* The event was corrupt, leading to - illegal data being read */ +#define HA_ERR_LOGGING_IMPOSSIBLE 170 +/* The event was corrupt, leading to illegal data being read */ +#define HA_ERR_CORRUPT_EVENT 171 #define HA_ERR_NEW_FILE 172 /* New file format */ -#define HA_ERR_ROWS_EVENT_APPLY 173 /* The event could not be processed - no other hanlder error happened */ +/* The event could not be processed no other handler error happened */ +#define HA_ERR_ROWS_EVENT_APPLY 173 #define HA_ERR_INITIALIZATION 174 /* Error during initialization */ #define HA_ERR_FILE_TOO_SHORT 175 /* File too short */ #define HA_ERR_WRONG_CRC 176 /* Wrong CRC on page */ -#define HA_ERR_LAST 176 /* Copy of last error nr */ +#define HA_ERR_ROW_NOT_VISIBLE 177 +#define HA_ERR_LAST 177 /* Copy of last error nr */ /* Number of different errors */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) @@ -474,6 +483,14 @@ typedef ulong key_part_map; #define MBR_DATA 16384 #define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */ #define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */ +/* Use this when inserting a key in position order */ +#define SEARCH_INSERT SEARCH_NULL_ARE_NOT_EQUAL*2 +/* Only part of the key is specified while reading */ +#define SEARCH_PART_KEY SEARCH_INSERT*2 +/* Used when user key (key 2) contains transaction id's */ +#define SEARCH_USER_KEY_HAS_TRANSID SEARCH_PART_KEY*2 +/* Used when page key (key 1) contains transaction id's */ +#define SEARCH_PAGE_KEY_HAS_TRANSID SEARCH_USER_KEY_HAS_TRANSID*2 /* bits in opt_flag */ #define QUICK_USED 1 diff --git a/include/my_dbug.h b/include/my_dbug.h index a77e439b5db..4e883563759 100644 --- a/include/my_dbug.h +++ b/include/my_dbug.h @@ -16,58 +16,62 @@ #ifndef _dbug_h #define _dbug_h -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif #if !defined(DBUG_OFF) && !defined(_lint) -struct _db_code_state_; -extern int _db_keyword_(struct _db_code_state_ *cs, const char *keyword); -extern int _db_strict_keyword_(const char *keyword); + +struct _db_stack_frame_ { + const char *func; /* function name of the previous stack frame */ + const char *file; /* filename of the function of previous frame */ + uint level; /* this nesting level, highest bit enables tracing */ + struct _db_stack_frame_ *prev; /* pointer to the previous frame */ +}; + +struct _db_code_state_; +extern my_bool _dbug_on_; +extern my_bool _db_keyword_(struct _db_code_state_ *, const char *, int); extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len); extern int _db_explain_init_(char *buf, size_t len); -extern void _db_setjmp_(void); -extern void _db_longjmp_(void); +extern void _db_setjmp_(void); +extern void _db_longjmp_(void); extern void _db_process_(const char *name); -extern void _db_push_(const char *control); -extern void _db_pop_(void); -extern void _db_set_(struct _db_code_state_ *cs, const char *control); +extern void _db_push_(const char *control); +extern void _db_pop_(void); +extern void _db_set_(const char *control); extern void _db_set_init_(const char *control); -extern void _db_enter_(const char *_func_,const char *_file_,uint _line_, - const char **_sfunc_,const char **_sfile_, - uint *_slevel_, char ***); -extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_, - uint *_slevel_); -extern void _db_pargs_(uint _line_,const char *keyword); -extern void _db_doprnt_ _VARARGS((const char *format,...)) +extern void _db_enter_(const char *_func_, const char *_file_, uint _line_, + struct _db_stack_frame_ *_stack_frame_); +extern void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_); +extern void _db_pargs_(uint _line_,const char *keyword); +extern void _db_doprnt_ _VARARGS((const char *format,...)) ATTRIBUTE_FORMAT(printf, 1, 2); -extern void _db_dump_(uint _line_,const char *keyword, +extern void _db_dump_(uint _line_,const char *keyword, const unsigned char *memory, size_t length); -extern void _db_end_(void); -extern void _db_lock_file_(void); -extern void _db_unlock_file_(void); -extern FILE *_db_fp_(void); +extern void _db_end_(void); +extern void _db_lock_file_(void); +extern void _db_unlock_file_(void); +extern FILE *_db_fp_(void); +extern void _db_flush_(); -#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \ - char **_db_framep_; \ - _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \ - &_db_framep_) -#define DBUG_LEAVE \ - _db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_) +#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_; \ + _db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_) +#define DBUG_LEAVE _db_return_ (__LINE__, &_db_stack_frame_) #define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0) #define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0) #define DBUG_EXECUTE(keyword,a1) \ - do {if (_db_keyword_(0, (keyword))) { a1 }} while(0) + do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0) #define DBUG_EXECUTE_IF(keyword,a1) \ - do {if (_db_strict_keyword_ (keyword)) { a1 } } while(0) + do {if (_db_keyword_(0, (keyword), 1)) { a1 }} while(0) #define DBUG_EVALUATE(keyword,a1,a2) \ - (_db_keyword_(0,(keyword)) ? (a1) : (a2)) + (_db_keyword_(0,(keyword), 0) ? (a1) : (a2)) #define DBUG_EVALUATE_IF(keyword,a1,a2) \ - (_db_strict_keyword_((keyword)) ? (a1) : (a2)) + (_db_keyword_(0,(keyword), 1) ? (a1) : (a2)) #define DBUG_PRINT(keyword,arglist) \ do {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;} while(0) #define DBUG_PUSH(a1) _db_push_ (a1) #define DBUG_POP() _db_pop_ () -#define DBUG_SET(a1) _db_set_ (0, (a1)) +#define DBUG_SET(a1) _db_set_ (a1) #define DBUG_SET_INITIAL(a1) _db_set_init_ (a1) #define DBUG_PROCESS(a1) _db_process_(a1) #define DBUG_FILE _db_fp_() @@ -80,36 +84,55 @@ extern FILE *_db_fp_(void); #define DBUG_ASSERT(A) assert(A) #define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len)) #define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len)) +#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0) +#define DEBUGGER_ON do { _dbug_on_= 1; } while(0) #define IF_DBUG(A) A -#else /* No debugger */ +#ifndef __WIN__ +#define DBUG_ABORT() (_db_flush_(), abort()) +#else +/* + Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can + call abort() instead of _exit(3) (now it would cause a "test signal" popup). +*/ +#include +#define DBUG_ABORT() (_db_flush_(),\ + (void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\ + (void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\ + _exit(3)) +#endif + +#else /* No debugger */ #define DBUG_ENTER(a1) #define DBUG_LEAVE -#define DBUG_RETURN(a1) do { return(a1); } while(0) -#define DBUG_VOID_RETURN do { return; } while(0) -#define DBUG_EXECUTE(keyword,a1) do { } while(0) -#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0) +#define DBUG_RETURN(a1) do { return(a1); } while(0) +#define DBUG_VOID_RETURN do { return; } while(0) +#define DBUG_EXECUTE(keyword,a1) do { } while(0) +#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0) #define DBUG_EVALUATE(keyword,a1,a2) (a2) #define DBUG_EVALUATE_IF(keyword,a1,a2) (a2) -#define DBUG_PRINT(keyword,arglist) do { } while(0) -#define DBUG_PUSH(a1) -#define DBUG_SET(a1) -#define DBUG_SET_INITIAL(a1) -#define DBUG_POP() -#define DBUG_PROCESS(a1) +#define DBUG_PRINT(keyword,arglist) do { } while(0) +#define DBUG_PUSH(a1) do { } while(0) +#define DBUG_SET(a1) do { } while(0) +#define DBUG_SET_INITIAL(a1) do { } while(0) +#define DBUG_POP() do { } while(0) +#define DBUG_PROCESS(a1) do { } while(0) #define DBUG_SETJMP(a1) setjmp(a1) #define DBUG_LONGJMP(a1) longjmp(a1) -#define DBUG_DUMP(keyword,a1,a2) -#define DBUG_END() -#define DBUG_ASSERT(A) do { } while(0) -#define DBUG_LOCK_FILE +#define DBUG_DUMP(keyword,a1,a2) do { } while(0) +#define DBUG_END() do { } while(0) +#define DBUG_ASSERT(A) do { } while(0) +#define DBUG_LOCK_FILE do { } while(0) #define DBUG_FILE (stderr) -#define DBUG_UNLOCK_FILE +#define DBUG_UNLOCK_FILE do { } while(0) #define DBUG_EXPLAIN(buf,len) #define DBUG_EXPLAIN_INITIAL(buf,len) +#define DEBUGGER_OFF do { } while(0) +#define DEBUGGER_ON do { } while(0) #define IF_DBUG(A) +#define DBUG_ABORT() abort() #endif -#ifdef __cplusplus +#ifdef __cplusplus } #endif #endif diff --git a/include/my_global.h b/include/my_global.h index 4feed96e7d6..6712198e2f0 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -156,9 +156,14 @@ #define __builtin_expect(x, expected_value) (x) #endif -#define likely(x) __builtin_expect((x),1) -#define unlikely(x) __builtin_expect((x),0) - +/** + 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) /* The macros below are useful in optimising places where it has been @@ -410,6 +415,7 @@ C_MODE_END #ifndef stdin #include #endif +#include #ifdef HAVE_STDLIB_H #include #endif @@ -431,6 +437,9 @@ C_MODE_END #ifdef HAVE_FCNTL_H #include #endif +#ifdef HAVE_SYS_STAT_H +#include +#endif #ifdef HAVE_SYS_TIMEB_H #include /* Avoid warnings on SCO */ #endif @@ -469,14 +478,13 @@ C_MODE_END #include /* an assert that works at compile-time. only for constant expression */ -#ifndef __GNUC__ +#ifdef _some_old_compiler_that_does_not_understand_the_construct_below_ #define compile_time_assert(X) do { } while(0) #else #define compile_time_assert(X) \ do \ { \ - char compile_time_assert[(X) ? 1 : -1] \ - __attribute__ ((unused)); \ + typedef char compile_time_assert[(X) ? 1 : -1]; \ } while(0) #endif @@ -570,7 +578,7 @@ typedef unsigned short ushort; #define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1) #define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0) -#define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; } +#define swap_variables(t, a, b) { t swap_dummy; swap_dummy= a; a= b; b= swap_dummy; } #define test(a) ((a) ? 1 : 0) #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) @@ -636,6 +644,7 @@ C_MODE_END # endif #endif +typedef char my_bool; /* Small bool */ #include #define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/ @@ -1070,7 +1079,6 @@ typedef off_t os_off_t; typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */ typedef short int15; /* Most effective integer 0 <= x <= 32767 */ typedef int myf; /* Type of MyFlags in my_funcs */ -typedef char my_bool; /* Small bool */ #if !defined(bool) && (!defined(HAVE_BOOL) || !defined(__cplusplus)) typedef char bool; /* Ordinary boolean values 0 1 */ #endif @@ -1134,9 +1142,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */ #define SCALE_SEC 100 #define SCALE_USEC 10000 #define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */ -#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */ - - +#define MY_HOW_OFTEN_TO_WRITE 10000 /* How often we want info on screen */ /* Define-funktions for reading and storing in machine independent format @@ -1145,7 +1151,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */ /* Optimized store functions for Intel x86 */ #if defined(__i386__) || defined(_WIN32) -#define sint2korr(A) (*((int16 *) (A))) +#define sint2korr(A) (*((const int16 *) (A))) #define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ (((uint32) 255L << 24) | \ (((uint32) (uchar) (A)[2]) << 16) |\ @@ -1154,8 +1160,8 @@ typedef char bool; /* Ordinary boolean values 0 1 */ (((uint32) (uchar) (A)[2]) << 16) |\ (((uint32) (uchar) (A)[1]) << 8) | \ ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (*((long *) (A))) -#define uint2korr(A) (*((uint16 *) (A))) +#define sint4korr(A) (*((const long *) (A))) +#define uint2korr(A) (*((const uint16 *) (A))) #if defined(HAVE_purify) && !defined(_WIN32) #define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ (((uint32) ((uchar) (A)[1])) << 8) +\ @@ -1167,9 +1173,9 @@ typedef char bool; /* Ordinary boolean values 0 1 */ Please, note, uint3korr reads 4 bytes (not 3) ! It means, that you have to provide enough allocated space ! */ -#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) +#define uint3korr(A) (long) (*((const unsigned int *) (A)) & 0xFFFFFF) #endif /* HAVE_purify && !_WIN32 */ -#define uint4korr(A) (*((uint32 *) (A))) +#define uint4korr(A) (*((const uint32 *) (A))) #define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ (((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) ((uchar) (A)[2])) << 16) +\ @@ -1181,8 +1187,8 @@ typedef char bool; /* Ordinary boolean values 0 1 */ (((uint32) ((uchar) (A)[3])) << 24)) + \ (((ulonglong) ((uchar) (A)[4])) << 32) + \ (((ulonglong) ((uchar) (A)[5])) << 40)) -#define uint8korr(A) (*((ulonglong *) (A))) -#define sint8korr(A) (*((longlong *) (A))) +#define uint8korr(A) (*((const ulonglong *) (A))) +#define sint8korr(A) (*((const longlong *) (A))) #define int2store(T,A) *((uint16*) (T))= (uint16) (A) #define int3store(T,A) do { *(T)= (uchar) ((A));\ *(T+1)=(uchar) (((uint) (A) >> 8));\ @@ -1207,17 +1213,17 @@ typedef union { } doubleget_union; #define doubleget(V,M) \ do { doubleget_union _tmp; \ - _tmp.m[0] = *((long*)(M)); \ - _tmp.m[1] = *(((long*) (M))+1); \ + _tmp.m[0] = *((const long*)(M)); \ + _tmp.m[1] = *(((const long*) (M))+1); \ (V) = _tmp.v; } while(0) -#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0]; \ - *(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; \ +#define doublestore(T,V) do { *((long *) T) = ((const doubleget_union *)&V)->m[0]; \ + *(((long *) T)+1) = ((const doubleget_union *)&V)->m[1]; \ } while (0) -#define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while(0) +#define float4get(V,M) do { *((float *) &(V)) = *((const float*) (M)); } while(0) #define float8get(V,M) doubleget((V),(M)) -#define float4store(V,M) memcpy((uchar*) V,(uchar*) (&M),sizeof(float)) -#define floatstore(T,V) memcpy((uchar*)(T), (uchar*)(&V),sizeof(float)) -#define floatget(V,M) memcpy((uchar*) &V,(uchar*) (M),sizeof(float)) +#define float4store(V,M) memcpy((uchar*) V,(const uchar*) (&M),sizeof(float)) +#define floatstore(T,V) memcpy((uchar*)(T), (const uchar*)(&V),sizeof(float)) +#define floatget(V,M) memcpy((uchar*) &V,(const uchar*) (M),sizeof(float)) #define float8store(V,M) doublestore((V),(M)) #else @@ -1511,17 +1517,45 @@ inline void operator delete[](void*, void*) { /* Do nothing */ } #if !defined(max) #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) -#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 +#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 #endif #if !defined(__cplusplus) && !defined(bool) #define bool In_C_you_should_use_my_bool_instead() #endif +/* Provide __func__ macro definition for platforms that miss it. */ +#if __STDC_VERSION__ < 199901L +# if __GNUC__ >= 2 +# define __func__ __FUNCTION__ +# else +# define __func__ "" +# endif +#elif defined(_MSC_VER) +# if _MSC_VER < 1300 +# define __func__ "" +# else +# define __func__ __FUNCTION__ +# endif +#elif defined(__BORLANDC__) +# define __func__ __FUNC__ +#else +# define __func__ "" +#endif + #endif /* my_global_h */ diff --git a/include/my_handler.h b/include/my_handler.h index a3376cb74a2..537cf68c150 100644 --- a/include/my_handler.h +++ b/include/my_handler.h @@ -19,6 +19,7 @@ #define _my_handler_h #include "myisampack.h" + #ifdef __cplusplus extern "C" { #endif @@ -36,14 +37,15 @@ extern "C" { #define HA_MAX_POSSIBLE_KEY 255 /* For myisamchk */ /* The following defines can be increased if necessary. - But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH. + 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_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) +#define HA_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */ typedef struct st_HA_KEYSEG /* Key-portion */ { @@ -61,22 +63,22 @@ typedef struct st_HA_KEYSEG /* Key-portion */ } HA_KEYSEG; #define get_key_length(length,key) \ -{ if (*(uchar*) (key) != 255) \ - length= (uint) *(uchar*) ((key)++); \ +{ if (*(const uchar*) (key) != 255) \ + length= (uint) *(const uchar*) ((key)++); \ else \ { length= mi_uint2korr((key)+1); (key)+=3; } \ } #define get_key_length_rdonly(length,key) \ -{ if (*(uchar*) (key) != 255) \ - length= ((uint) *(uchar*) ((key))); \ +{ if (*(const uchar*) (key) != 255) \ + length= ((uint) *(const uchar*) ((key))); \ else \ { length= mi_uint2korr((key)+1); } \ } #define get_key_pack_length(length,length_pack,key) \ -{ if (*(uchar*) (key) != 255) \ - { length= (uint) *(uchar*) ((key)++); length_pack= 1; }\ +{ if (*(const uchar*) (key) != 255) \ + { length= (uint) *(const uchar*) ((key)++); length_pack= 1; }\ else \ { length=mi_uint2korr((key)+1); (key)+= 3; length_pack= 3; } \ } @@ -106,13 +108,13 @@ typedef struct st_HA_KEYSEG /* Key-portion */ #define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \ set_rec_bits(0, bit_ptr, bit_ofs, bit_len) -extern int ha_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint , - my_bool, my_bool); -extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, - register uchar *b, uint key_length, uint nextflag, - uint *diff_pos); +extern int ha_compare_text(CHARSET_INFO *, const uchar *, uint, + const uchar *, uint , my_bool, my_bool); +extern int ha_key_cmp(register HA_KEYSEG *keyseg, register const uchar *a, + register const uchar *b, uint key_length, + uint32 nextflag, uint *diff_pos); -extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a); +extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, const uchar *a); extern void my_handler_error_register(void); extern void my_handler_error_unregister(void); /* diff --git a/include/my_pthread.h b/include/my_pthread.h index 151cb34faff..1596495a40f 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -79,25 +79,27 @@ typedef void * (__cdecl *pthread_handler)(void *); so it can be used directly as a 64 bit value. The value stored is in 100ns units. */ - union ft64 { +union ft64 { FILETIME ft; __int64 i64; - }; +}; + struct timespec { union ft64 tv; /* The max timeout value in millisecond for pthread_cond_timedwait */ long max_timeout_msec; }; -#define set_timespec(ABSTIME,SEC) { \ - GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \ - (ABSTIME).tv.i64+= (__int64)(SEC)*10000000; \ - (ABSTIME).max_timeout_msec= (long)((SEC)*1000); \ -} -#define set_timespec_nsec(ABSTIME,NSEC) { \ - GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \ - (ABSTIME).tv.i64+= (__int64)(NSEC)/100; \ - (ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \ -} + +#define set_timespec_time_nsec(ABSTIME,TIME,NSEC) do { \ + (ABSTIME).tv.i64= (TIME)+(__int64)(NSEC)/100; \ + (ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \ +} while(0) + +#define set_timespec_nsec(ABSTIME,NSEC) do { \ + union ft64 tv; \ + GetSystemTimeAsFileTime(&tv.ft); \ + set_timespec_time_nsec((ABSTIME), tv.i64, (NSEC)); \ +} while(0) void win_pthread_init(void); int win_pthread_setspecific(void *A,void *B,uint length); @@ -125,6 +127,8 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ #define HAVE_LOCALTIME_R 1 #define _REENTRANT 1 #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 +#define PTHREAD_STACK_MIN 65536 + /* Windows has two ways to use thread local storage. The most efficient @@ -158,7 +162,7 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ #define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0) #define pthread_mutex_lock(A) (EnterCriticalSection(A),0) #define pthread_mutex_trylock(A) win_pthread_mutex_trylock((A)) -#define pthread_mutex_unlock(A) LeaveCriticalSection(A) +#define pthread_mutex_unlock(A) (LeaveCriticalSection(A),0) #define pthread_mutex_destroy(A) DeleteCriticalSection(A) #define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B)) #define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) @@ -172,6 +176,7 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ #define pthread_detach_this_thread() #define pthread_condattr_init(A) #define pthread_condattr_destroy(A) +#define pthread_yield() Sleep(0) /* according to MSDN */ #define my_pthread_getprio(thread_id) pthread_dummy(0) @@ -234,13 +239,13 @@ int my_sigwait(const sigset_t *set,int *sig); #ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT #ifndef SAFE_MUTEX -#define pthread_mutex_init(a,b) my_pthread_mutex_init((a),(b)) -extern int my_pthread_mutex_init(pthread_mutex_t *mp, - const pthread_mutexattr_t *attr); +#define pthread_mutex_init(a,b) my_pthread_mutex_noposix_init((a),(b)) +extern int my_pthread_mutex_noposix_init(pthread_mutex_t *mp, + const pthread_mutexattr_t *attr); #endif /* SAFE_MUTEX */ -#define pthread_cond_init(a,b) my_pthread_cond_init((a),(b)) -extern int my_pthread_cond_init(pthread_cond_t *mp, - const pthread_condattr_t *attr); +#define pthread_cond_init(a,b) my_pthread_cond_noposix_init((a),(b)) +extern int my_pthread_cond_noposix_init(pthread_cond_t *mp, + const pthread_condattr_t *attr); #endif /* HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */ #if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK) @@ -399,64 +404,80 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size); int my_pthread_mutex_trylock(pthread_mutex_t *mutex); #endif +#if !defined(HAVE_PTHREAD_YIELD_ONE_ARG) && !defined(HAVE_PTHREAD_YIELD_ZERO_ARG) +/* no pthread_yield() available */ +#ifdef HAVE_SCHED_YIELD +#define pthread_yield() sched_yield() +#elif defined(HAVE_PTHREAD_YIELD_NP) /* can be Mac OS X */ +#define pthread_yield() pthread_yield_np() +#elif defined(HAVE_THR_YIELD) +#define pthread_yield() thr_yield() +#endif +#endif + /* The defines set_timespec and set_timespec_nsec should be used for calculating an absolute time at which pthread_cond_timedwait should timeout */ + +#define set_timespec(ABSTIME,SEC) set_timespec_nsec((ABSTIME),(SEC)*1000000000ULL) + +#ifndef set_timespec_nsec +#define set_timespec_nsec(ABSTIME,NSEC) \ + set_timespec_time_nsec((ABSTIME),my_getsystime(),(NSEC)) +#endif /* !set_timespec_nsec */ + +/* adapt for two different flavors of struct timespec */ #ifdef HAVE_TIMESPEC_TS_SEC -#ifndef set_timespec -#define set_timespec(ABSTIME,SEC) \ -{ \ - (ABSTIME).ts_sec=time(0) + (time_t) (SEC); \ - (ABSTIME).ts_nsec=0; \ -} -#endif /* !set_timespec */ -#ifndef set_timespec_nsec -#define set_timespec_nsec(ABSTIME,NSEC) \ -{ \ - ulonglong now= my_getsystime() + (NSEC/100); \ - (ABSTIME).ts_sec= (now / ULL(10000000)); \ - (ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \ -} -#endif /* !set_timespec_nsec */ +#define TV_sec ts_sec +#define TV_nsec ts_nsec #else -#ifndef set_timespec -#define set_timespec(ABSTIME,SEC) \ -{\ - struct timeval tv;\ - gettimeofday(&tv,0);\ - (ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\ - (ABSTIME).tv_nsec=tv.tv_usec*1000;\ -} -#endif /* !set_timespec */ -#ifndef set_timespec_nsec -#define set_timespec_nsec(ABSTIME,NSEC) \ -{\ - ulonglong now= my_getsystime() + (NSEC/100); \ - (ABSTIME).tv_sec= (time_t) (now / ULL(10000000)); \ - (ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \ -} -#endif /* !set_timespec_nsec */ +#define TV_sec tv_sec +#define TV_nsec tv_nsec #endif /* HAVE_TIMESPEC_TS_SEC */ - /* safe_mutex adds checking to mutex for easier debugging */ +#ifndef set_timespec_time_nsec +#define set_timespec_time_nsec(ABSTIME,TIME,NSEC) do { \ + ulonglong nsec= (NSEC); \ + ulonglong now= (TIME) + (nsec/100); \ + (ABSTIME).TV_sec= (now / ULL(10000000)); \ + (ABSTIME).TV_nsec= (now % ULL(10000000) * 100 + (nsec % 100)); \ +} while(0) +#endif /* !set_timespec_time_nsec */ + +/* safe_mutex adds checking to mutex for easier debugging */ #if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY) #define SAFE_MUTEX_DETECT_DESTROY #endif +struct st_hash; typedef struct st_safe_mutex_t { pthread_mutex_t global,mutex; - const char *file; + const char *file, *name; uint line,count; + myf create_flags, active_flags; + ulong id; pthread_t thread; + struct st_hash *locked_mutex, *used_mutex; + struct st_safe_mutex_t *prev, *next; #ifdef SAFE_MUTEX_DETECT_DESTROY struct st_safe_mutex_info_t *info; /* to track destroying of mutexes */ #endif } safe_mutex_t; +typedef struct st_safe_mutex_deadlock_t +{ + const char *file, *name; + safe_mutex_t *mutex; + uint line; + ulong count; + ulong id; + my_bool warning_only; +} safe_mutex_deadlock_t; + #ifdef SAFE_MUTEX_DETECT_DESTROY /* Used to track the destroying of mutexes. This needs to be a seperate @@ -474,8 +495,10 @@ typedef struct st_safe_mutex_info_t #endif /* SAFE_MUTEX_DETECT_DESTROY */ int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr, + const char *name, myf my_flags, const char *file, uint line); -int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, const char *file, uint line); +int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file, + uint line); int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line); int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line); int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file, @@ -484,8 +507,12 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, struct timespec *abstime, const char *file, uint line); void safe_mutex_global_init(void); void safe_mutex_end(FILE *file); +void safe_mutex_free_deadlock_data(safe_mutex_t *mp); /* Wrappers if safe mutex is actually used */ +#define MYF_TRY_LOCK 1 +#define MYF_NO_DEADLOCK_DETECTION 2 + #ifdef SAFE_MUTEX #undef pthread_mutex_init #undef pthread_mutex_lock @@ -497,13 +524,15 @@ void safe_mutex_end(FILE *file); #undef pthread_cond_wait #undef pthread_cond_timedwait #undef pthread_mutex_trylock -#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),__FILE__,__LINE__) -#define pthread_mutex_lock(A) safe_mutex_lock((A), FALSE, __FILE__, __LINE__) +#define my_pthread_mutex_init(A,B,C,D) safe_mutex_init((A),(B),(C),(D),__FILE__,__LINE__) +#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),#A,0,__FILE__,__LINE__) +#define pthread_mutex_lock(A) safe_mutex_lock((A), 0, __FILE__, __LINE__) +#define my_pthread_mutex_lock(A,B) safe_mutex_lock((A), (B), __FILE__, __LINE__) #define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__) #define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__) #define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__) #define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__) -#define pthread_mutex_trylock(A) safe_mutex_lock((A), TRUE, __FILE__, __LINE__) +#define pthread_mutex_trylock(A) safe_mutex_lock((A), MYF_TRY_LOCK, __FILE__, __LINE__) #define pthread_mutex_t safe_mutex_t #define safe_mutex_assert_owner(mp) \ DBUG_ASSERT((mp)->count > 0 && \ @@ -512,8 +541,11 @@ void safe_mutex_end(FILE *file); DBUG_ASSERT(! (mp)->count || \ ! pthread_equal(pthread_self(), (mp)->thread)) #else +#define my_pthread_mutex_init(A,B,C,D) pthread_mutex_init((A),(B)) +#define my_pthread_mutex_lock(A,B) pthread_mutex_lock(A) #define safe_mutex_assert_owner(mp) #define safe_mutex_assert_not_owner(mp) +#define safe_mutex_free_deadlock_data(mp) #endif /* SAFE_MUTEX */ #if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) @@ -663,6 +695,9 @@ extern int pthread_dummy(int); #endif #endif +#define MY_PTHREAD_LOCK_READ 0 +#define MY_PTHREAD_LOCK_WRITE 1 + struct st_my_thread_var { int thr_errno; @@ -677,6 +712,9 @@ struct st_my_thread_var my_bool init; struct st_my_thread_var *next,**prev; void *opt_info; + uint lock_type; /* used by conditional release the queue */ + void *stack_ends_here; + safe_mutex_t *mutex_in_use; #ifndef DBUG_OFF void *dbug; char name[THREAD_NAME_SIZE+1]; @@ -684,7 +722,10 @@ struct st_my_thread_var }; extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); +extern void **my_thread_var_dbug(); +extern safe_mutex_t **my_thread_var_mutex_in_use(); extern uint my_thread_end_wait_time; +extern my_bool safe_mutex_deadlock_detector; #define my_thread_var (_my_thread_var()) #define my_errno my_thread_var->thr_errno /* diff --git a/include/my_sys.h b/include/my_sys.h index 60122eab94e..07e56f1c91f 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -62,12 +62,14 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */ #define MY_REDEL_MAKE_BACKUP 256 #define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */ -#define MY_DONT_WAIT 64 /* my_lock() don't wait if can't lock */ +#define MY_SHORT_WAIT 64 /* my_lock() don't wait if can't lock */ +#define MY_FORCE_LOCK 128 /* use my_lock() even if disable_locking */ +#define MY_NO_WAIT 256 /* my_lock() don't wait at all */ #define MY_ZEROFILL 32 /* my_malloc(), fill array with zero */ #define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */ #define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */ #define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */ -#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */ +#define MY_DONT_OVERWRITE_FILE 2048 /* my_copy: Don't overwrite file */ #define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ @@ -90,9 +92,11 @@ extern int NEAR my_errno; /* Last error in mysys */ #define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */ #define ME_COLOUR2 ((2 << ME_HIGHBYTE)) #define ME_COLOUR3 ((3 << ME_HIGHBYTE)) -#define ME_FATALERROR 1024 /* Fatal statement error */ -#define ME_NO_WARNING_FOR_ERROR 2048 /* Don't push a warning for error */ -#define ME_NO_SP_HANDLER 4096 /* Don't call stored routine error handlers */ +#define ME_JUST_INFO 1024 /**< not error but just info */ +#define ME_JUST_WARNING 2048 /**< not error but just warning */ +#define ME_FATALERROR 4096 /* Fatal statement error */ +#define ME_NO_WARNING_FOR_ERROR 8192 /* Don't push a warning for error */ +#define ME_NO_SP_HANDLER 16384 /* Don't call stored routine error handlers */ /* Bits in last argument to fn_format */ #define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */ @@ -211,6 +215,7 @@ extern int errno; /* declare errno */ extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; extern char *home_dir; /* Home directory for user */ extern const char *my_progname; /* program-name (printed in errors) */ +extern const char *my_progname_short; /* like above but without directory */ extern char NEAR curr_dir[]; /* Current directory for user */ 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, @@ -218,6 +223,9 @@ extern int (*fatal_error_handler_hook)(uint my_err, const char *str, extern uint my_file_limit; extern ulong my_thread_stack_size; +extern const char *(*proc_info_hook)(void *, const char *, const char *, + const char *, const unsigned int); + #ifdef HAVE_LARGE_PAGES extern my_bool my_use_large_pages; extern uint my_large_page_size; @@ -288,7 +296,13 @@ enum flush_type As my_disable_flush_pagecache_blocks is always 0, the following option is strictly equivalent to FLUSH_KEEP */ - FLUSH_FORCE_WRITE + FLUSH_FORCE_WRITE, + /** + @brief like FLUSH_KEEP but return immediately if file is already being + flushed (even partially) by another thread; only for page cache, + forbidden for key cache. + */ + FLUSH_KEEP_LAZY }; typedef struct st_record_cache /* Used when cacheing records */ @@ -547,6 +561,7 @@ my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */ *(info)->current_pos) typedef uint32 ha_checksum; +extern ha_checksum my_crc_dbug_check; /* Define the type of function to be passed to process_default_option_files */ typedef int (*Process_option_func)(void *ctx, const char *group_name, @@ -644,6 +659,7 @@ extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags); extern FILE *my_fdopen(File Filedes,const char *name, int Flags,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_chmod(const char *name, mode_t mode, 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); @@ -651,6 +667,8 @@ extern int my_error _VARARGS((int nr,myf MyFlags, ...)); extern int my_printf_error _VARARGS((uint my_err, const char *format, myf MyFlags, ...)) ATTRIBUTE_FORMAT(printf, 2, 4); +extern int my_printv_error(uint error, const char *format, myf MyFlags, + va_list ap); extern int my_error_register(const char **errmsgs, int first, int last); extern const char **my_error_unregister(int first, int last); extern int my_message(uint my_err, const char *str,myf MyFlags); @@ -794,7 +812,7 @@ extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint element_size, extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size, uint init_alloc,uint alloc_increment CALLER_INFO_PROTO); -extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element); +extern my_bool insert_dynamic(DYNAMIC_ARRAY *array, const uchar * element); extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array); extern uchar *pop_dynamic(DYNAMIC_ARRAY*); extern my_bool set_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index); @@ -865,6 +883,12 @@ extern int unpackfrm(uchar **, size_t *, const uchar *); extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem, size_t count); +#ifndef DBUG_OFF +extern void my_debug_put_break_here(void); +#else +#define my_debug_put_break_here() do {} while(0) +#endif + extern void my_sleep(ulong m_seconds); extern ulong crc32(ulong crc, const uchar *buf, uint len); extern uint my_set_max_open_files(uint files); @@ -923,6 +947,22 @@ int my_getpagesize(void); int my_msync(int, void *, size_t, int); +#define MY_UUID_SIZE 16 +#define MY_UUID_STRING_LENGTH (8+1+4+1+4+1+4+1+12) + +void my_uuid_init(ulong seed1, ulong seed2); +void my_uuid(uchar *guid); +void my_uuid2str(const uchar *guid, char *s); +void my_uuid_end(); + +struct my_rnd_struct { + unsigned long seed1,seed2,max_value; + double max_value_dbl; +}; + +void my_rnd_init(struct my_rnd_struct *rand_st, ulong seed1, ulong seed2); +double my_rnd(struct my_rnd_struct *rand_st); + /* character sets */ extern uint get_charset_number(const char *cs_name, uint cs_flags); extern uint get_collation_number(const char *name); diff --git a/include/my_tree.h b/include/my_tree.h index 24bbdd54019..e387b25d431 100644 --- a/include/my_tree.h +++ b/include/my_tree.h @@ -66,8 +66,8 @@ void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit, tree_element_free free_element, void *custom_arg); void delete_tree(TREE*); void reset_tree(TREE*); - /* similar to delete tree, except we do not my_free() blocks in mem_root - */ + + /* similar to delete tree, except we do not my_free() blocks in mem_root */ #define is_tree_inited(tree) ((tree)->root != 0) /* Functions on leafs */ @@ -86,6 +86,7 @@ void *tree_search_next(TREE *tree, TREE_ELEMENT ***last_pos, int l_offs, int r_offs); ha_rows tree_record_pos(TREE *tree, const void *key, enum ha_rkey_function search_flag, void *custom_arg); +#define reset_free_element(tree) (tree)->free= 0 #define TREE_ELEMENT_EXTRA_SIZE (sizeof(TREE_ELEMENT) + sizeof(void*)) diff --git a/include/myisam.h b/include/myisam.h index 16175547367..86cbeaffd5d 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -31,10 +31,11 @@ extern "C" { #include "keycache.h" #endif #include "my_handler.h" +#include #include /* - Limit max keys according to HA_MAX_POSSIBLE_KEY + Limit max keys according to HA_MAX_POSSIBLE_KEY; See myisamchk.h for details */ #if MAX_INDEXES > HA_MAX_POSSIBLE_KEY @@ -44,15 +45,7 @@ extern "C" { #endif #define MI_MAX_POSSIBLE_KEY_BUFF HA_MAX_POSSIBLE_KEY_BUFF -/* - The following defines can be increased if necessary. - But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH. -*/ -#define MI_MAX_KEY_LENGTH 1000 /* Max length in bytes */ -#define MI_MAX_KEY_SEG 16 /* Max segments for key */ -#define MI_MAX_KEY_BUFF (MI_MAX_KEY_LENGTH+MI_MAX_KEY_SEG*6+8+8) -#define MI_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */ #define MI_NAME_IEXT ".MYI" #define MI_NAME_DEXT ".MYD" /* Max extra space to use when sorting keys */ @@ -233,7 +226,7 @@ struct st_mi_bit_buff; typedef struct st_columndef /* column information */ { - int16 type; /* en_fieldtype */ + enum en_fieldtype type; uint16 length; /* length of field */ uint32 offset; /* Offset to position in row */ uint8 null_bit; /* If column may be 0 */ @@ -248,7 +241,6 @@ typedef struct st_columndef /* column information */ #endif } MI_COLUMNDEF; - extern char * myisam_log_filename; /* Name of logfile */ extern ulong myisam_block_size; extern ulong myisam_concurrent_insert; @@ -296,7 +288,7 @@ extern int mi_extra(struct st_myisam_info *file, enum ha_extra_function function, void *extra_arg); extern int mi_reset(struct st_myisam_info *file); -extern ha_rows mi_records_in_range(MI_INFO *info, int inx, +extern ha_rows mi_records_in_range(MI_INFO *info,int inx, key_range *min_key, key_range *max_key); extern int mi_log(int activate_log); extern int mi_is_changed(struct st_myisam_info *info); @@ -309,190 +301,112 @@ extern uint mi_get_pointer_length(ulonglong file_length, uint def); #define MYISAMCHK_REPAIR 1 /* equivalent to myisamchk -r */ #define MYISAMCHK_VERIFY 2 /* Verify, run repair if failure */ -/* - Definitions needed for myisamchk.c +typedef uint mi_bit_type; - Entries marked as "QQ to be removed" are NOT used to - pass check/repair options to mi_check.c. They are used - internally by myisamchk.c or/and ha_myisam.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. -*/ +typedef struct st_mi_bit_buff +{ /* Used for packing of record */ + mi_bit_type current_byte; + uint bits; + uchar *pos, *end, *blob_pos, *blob_end; + uint error; +} MI_BIT_BUFF; -#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 myisamchk.c or/and ha_myisam.cc that are NOT passed - to mi_check.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 - -/* these struct is used by my_check to tell it what to do */ - -typedef struct st_sort_key_blocks /* Used when sorting */ +typedef struct st_sort_info { - uchar *buff,*end_pos; - uchar lastkey[MI_MAX_POSSIBLE_KEY_BUFF]; - uint last_length; - int inited; -} SORT_KEY_BLOCKS; - - -/* - MyISAM supports several statistics collection methods. Currently statistics - collection method is not stored in MyISAM 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_mi_stats_method; - -typedef struct st_mi_check_param -{ - ulonglong auto_increment_value; - ulonglong max_data_file_length; - ulonglong keys_in_use; - ulonglong max_record_length; - 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; - ha_rows total_records,total_deleted; - ha_checksum record_checksum,glob_crc; - ulong use_buffers,read_buffer_length,write_buffer_length, - sort_buffer_length,sort_key_blocks; - uint out_flag,warning_printed,error_printed,verbose; - uint opt_sort_key,total_files,max_level; - uint testflag, key_cache_block_size; - uint8 language; - my_bool using_global_keycache, opt_lock_memory, opt_follow_links; - my_bool retry_repair, force_sort; - char temp_filename[FN_REFLEN],*isam_file_name; - MY_TMPDIR *tmpdir; - int tmpfile_createflag; +#ifdef THREAD + /* sync things */ + pthread_mutex_t mutex; + pthread_cond_t cond; +#endif + MI_INFO *info; + HA_CHECK *param; + uchar *buff; + SORT_KEY_BLOCKS *key_block, *key_block_end; + SORT_FT_BUF *ft_buf; + my_off_t filelength, dupp, buff_length; + ha_rows max_records; + uint current_key, total_keys; + uint got_error, threads_running; myf myf_rw; - IO_CACHE read_cache; + enum data_file_type new_data_file_type; +} MI_SORT_INFO; + +typedef struct st_mi_sort_param +{ + pthread_t thr; + IO_CACHE read_cache, tempfile, tempfile_for_exceptions; + DYNAMIC_ARRAY buffpek; + MI_BIT_BUFF bit_buff; /* For parallel repair of packrec. */ + MI_KEYDEF *keyinfo; + MI_SORT_INFO *sort_info; + HA_KEYSEG *seg; + uchar **sort_keys; + uchar *rec_buff; + void *wordlist, *wordptr; + MEM_ROOT wordroot; + uchar *record; + MY_TMPDIR *tmpdir; + /* The next two are used to collect statistics, see update_key_parts for description. */ - ulonglong unique_count[MI_MAX_KEY_SEG+1]; - ulonglong notnull_count[MI_MAX_KEY_SEG+1]; - - ha_checksum key_crc[HA_MAX_POSSIBLE_KEY]; - ulong rec_per_key_part[MI_MAX_KEY_SEG*HA_MAX_POSSIBLE_KEY]; - void *thd; - const char *db_name, *table_name; - const char *op_name; - enum_mi_stats_method stats_method; -} MI_CHECK; + ulonglong unique[HA_MAX_KEY_SEG+1]; + ulonglong notnull[HA_MAX_KEY_SEG+1]; -typedef struct st_sort_ft_buf -{ - uchar *buf, *end; - int count; - uchar lastkey[MI_MAX_KEY_BUFF]; -} SORT_FT_BUF; + my_off_t pos,max_pos,filepos,start_recpos; + uint key, key_length,real_key_length,sortbuff_size; + uint maxbuffers, keys, find_length, sort_keys_length; + my_bool fix_datafile, master; + my_bool calc_checksum; /* calculate table checksum */ + + int (*key_cmp)(struct st_mi_sort_param *, const void *, const void *); + int (*key_read)(struct st_mi_sort_param *,void *); + int (*key_write)(struct st_mi_sort_param *, const void *); + void (*lock_in_memory)(HA_CHECK *); + NEAR int (*write_keys)(struct st_mi_sort_param *, register uchar **, + uint , struct st_buffpek *, IO_CACHE *); + NEAR uint (*read_to_buffer)(IO_CACHE *,struct st_buffpek *, uint); + NEAR int (*write_key)(struct st_mi_sort_param *, IO_CACHE *,uchar *, + uint, uint); +} MI_SORT_PARAM; -typedef struct st_sort_info -{ - my_off_t filelength,dupp,buff_length; - ha_rows max_records; - uint current_key, total_keys; - myf myf_rw; - enum data_file_type new_data_file_type; - MI_INFO *info; - MI_CHECK *param; - uchar *buff; - SORT_KEY_BLOCKS *key_block,*key_block_end; - SORT_FT_BUF *ft_buf; - /* sync things */ - uint got_error, threads_running; -#ifdef THREAD - pthread_mutex_t mutex; - pthread_cond_t cond; -#endif -} SORT_INFO; /* functions in mi_check */ -void myisamchk_init(MI_CHECK *param); -int chk_status(MI_CHECK *param, MI_INFO *info); -int chk_del(MI_CHECK *param, register MI_INFO *info, uint test_flag); -int chk_size(MI_CHECK *param, MI_INFO *info); -int chk_key(MI_CHECK *param, MI_INFO *info); -int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend); -int mi_repair(MI_CHECK *param, register MI_INFO *info, +void myisamchk_init(HA_CHECK *param); +int chk_status(HA_CHECK *param, MI_INFO *info); +int chk_del(HA_CHECK *param, register MI_INFO *info, ulonglong test_flag); +int chk_size(HA_CHECK *param, MI_INFO *info); +int chk_key(HA_CHECK *param, MI_INFO *info); +int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend); +int mi_repair(HA_CHECK *param, register MI_INFO *info, char * name, int rep_quick); -int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name); -int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, +int mi_sort_index(HA_CHECK *param, register MI_INFO *info, char * name); +int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info, const char * name, int rep_quick); -int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, +int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info, const char * name, int rep_quick); int change_to_newfile(const char * filename, const char * old_ext, const char * new_ext, uint raid_chunks, myf myflags); -int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type, +int lock_file(HA_CHECK *param, File file, my_off_t start, int lock_type, const char *filetype, const char *filename); -void lock_memory(MI_CHECK *param); -void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, +void lock_memory(HA_CHECK *param); +void update_auto_increment_key(HA_CHECK *param, MI_INFO *info, my_bool repair); -int update_state_info(MI_CHECK *param, MI_INFO *info,uint update); +int update_state_info(HA_CHECK *param, MI_INFO *info,uint update); void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part, ulonglong *unique, ulonglong *notnull, ulonglong records); -int filecopy(MI_CHECK *param, File to,File from,my_off_t start, +int filecopy(HA_CHECK *param, File to,File from,my_off_t start, my_off_t length, const char *type); int movepoint(MI_INFO *info,uchar *record,my_off_t oldpos, my_off_t newpos, uint prot_key); -int write_data_suffix(SORT_INFO *sort_info, my_bool fix_datafile); +int write_data_suffix(MI_SORT_INFO *sort_info, my_bool fix_datafile); int test_if_almost_full(MI_INFO *info); -int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename); +int recreate_table(HA_CHECK *param, MI_INFO **org_info, char *filename); void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows); my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map, my_bool force); @@ -506,6 +420,13 @@ void mi_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache); int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves); +int write_data_suffix(MI_SORT_INFO *sort_info, my_bool fix_datafile); +int flush_pending_blocks(MI_SORT_PARAM *param); +int sort_ft_buf_flush(MI_SORT_PARAM *sort_param); +int thr_write_keys(MI_SORT_PARAM *sort_param); +int sort_write_record(MI_SORT_PARAM *sort_param); +int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, ulong); + #ifdef __cplusplus } #endif diff --git a/include/myisamchk.h b/include/myisamchk.h new file mode 100644 index 00000000000..f4651b81f8b --- /dev/null +++ b/include/myisamchk.h @@ -0,0 +1,176 @@ +/* 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_ZEROFILL ((ulonglong) 1L << 32) +#define T_ZEROFILL_KEEP_LSN ((ulonglong) 1L << 33) +/** If repair should not bump create_rename_lsn */ +#define T_NO_CREATE_RENAME_LSN ((ulonglong) 1L << 33) + +#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 */ +{ + uchar *buff, *end_pos; + uchar 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, lost; + 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; + ulonglong org_key_map; + ulonglong testflag; + + /* Following is used to check if rows are visible */ + ulonglong max_trid, max_found_trid; + ulonglong not_visible_rows_found; + + size_t use_buffers, read_buffer_length, write_buffer_length; + size_t sort_buffer_length, sort_key_blocks; + ulong rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY]; + double new_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 key_cache_block_size, pagecache_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 +{ + uchar *buf, *end; + int count; + uchar lastkey[HA_MAX_KEY_BUFF]; +} SORT_FT_BUF; + + +typedef struct st_buffpek { + my_off_t file_pos; /* Where we are in the sort file */ + uchar *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 */ diff --git a/include/myisampack.h b/include/myisampack.h index 7d4871bd1cb..34a085e4e5a 100644 --- a/include/myisampack.h +++ b/include/myisampack.h @@ -24,58 +24,58 @@ #define mi_sint1korr(A) ((int8)(*A)) #define mi_uint1korr(A) ((uint8)(*A)) -#define mi_sint2korr(A) ((int16) (((int16) (((uchar*) (A))[1])) +\ - ((int16) ((int16) ((char*) (A))[0]) << 8))) -#define mi_sint3korr(A) ((int32) (((((uchar*) (A))[0]) & 128) ? \ +#define mi_sint2korr(A) ((int16) (((int16) (((const uchar*) (A))[1])) +\ + ((int16) ((int16) ((const char*) (A))[0]) << 8))) +#define mi_sint3korr(A) ((int32) (((((const uchar*) (A))[0]) & 128) ? \ (((uint32) 255L << 24) | \ - (((uint32) ((uchar*) (A))[0]) << 16) |\ - (((uint32) ((uchar*) (A))[1]) << 8) | \ - ((uint32) ((uchar*) (A))[2])) : \ - (((uint32) ((uchar*) (A))[0]) << 16) |\ - (((uint32) ((uchar*) (A))[1]) << 8) | \ - ((uint32) ((uchar*) (A))[2]))) -#define mi_sint4korr(A) ((int32) (((int32) (((uchar*) (A))[3])) +\ - ((int32) (((uchar*) (A))[2]) << 8) +\ - ((int32) (((uchar*) (A))[1]) << 16) +\ - ((int32) ((int16) ((char*) (A))[0]) << 24))) + (((uint32) ((const uchar*) (A))[0]) << 16) |\ + (((uint32) ((const uchar*) (A))[1]) << 8) | \ + ((uint32) ((const uchar*) (A))[2])) : \ + (((uint32) ((const uchar*) (A))[0]) << 16) |\ + (((uint32) ((const uchar*) (A))[1]) << 8) | \ + ((uint32) ((const uchar*) (A))[2]))) +#define mi_sint4korr(A) ((int32) (((int32) (((const uchar*) (A))[3])) +\ + ((int32) (((const uchar*) (A))[2]) << 8) +\ + ((int32) (((const uchar*) (A))[1]) << 16) +\ + ((int32) ((int16) ((const char*) (A))[0]) << 24))) #define mi_sint8korr(A) ((longlong) mi_uint8korr(A)) -#define mi_uint2korr(A) ((uint16) (((uint16) (((uchar*) (A))[1])) +\ - ((uint16) (((uchar*) (A))[0]) << 8))) -#define mi_uint3korr(A) ((uint32) (((uint32) (((uchar*) (A))[2])) +\ - (((uint32) (((uchar*) (A))[1])) << 8) +\ - (((uint32) (((uchar*) (A))[0])) << 16))) -#define mi_uint4korr(A) ((uint32) (((uint32) (((uchar*) (A))[3])) +\ - (((uint32) (((uchar*) (A))[2])) << 8) +\ - (((uint32) (((uchar*) (A))[1])) << 16) +\ - (((uint32) (((uchar*) (A))[0])) << 24))) -#define mi_uint5korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[4])) +\ - (((uint32) (((uchar*) (A))[3])) << 8) +\ - (((uint32) (((uchar*) (A))[2])) << 16) +\ - (((uint32) (((uchar*) (A))[1])) << 24)) +\ - (((ulonglong) (((uchar*) (A))[0])) << 32)) -#define mi_uint6korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[5])) +\ - (((uint32) (((uchar*) (A))[4])) << 8) +\ - (((uint32) (((uchar*) (A))[3])) << 16) +\ - (((uint32) (((uchar*) (A))[2])) << 24)) +\ - (((ulonglong) (((uint32) (((uchar*) (A))[1])) +\ - (((uint32) (((uchar*) (A))[0]) << 8)))) <<\ +#define mi_uint2korr(A) ((uint16) (((uint16) (((const uchar*) (A))[1])) +\ + ((uint16) (((const uchar*) (A))[0]) << 8))) +#define mi_uint3korr(A) ((uint32) (((uint32) (((const uchar*) (A))[2])) +\ + (((uint32) (((const uchar*) (A))[1])) << 8) +\ + (((uint32) (((const uchar*) (A))[0])) << 16))) +#define mi_uint4korr(A) ((uint32) (((uint32) (((const uchar*) (A))[3])) +\ + (((uint32) (((const uchar*) (A))[2])) << 8) +\ + (((uint32) (((const uchar*) (A))[1])) << 16) +\ + (((uint32) (((const uchar*) (A))[0])) << 24))) +#define mi_uint5korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[4])) +\ + (((uint32) (((const uchar*) (A))[3])) << 8) +\ + (((uint32) (((const uchar*) (A))[2])) << 16) +\ + (((uint32) (((const uchar*) (A))[1])) << 24)) +\ + (((ulonglong) (((const uchar*) (A))[0])) << 32)) +#define mi_uint6korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[5])) +\ + (((uint32) (((const uchar*) (A))[4])) << 8) +\ + (((uint32) (((const uchar*) (A))[3])) << 16) +\ + (((uint32) (((const uchar*) (A))[2])) << 24)) +\ + (((ulonglong) (((uint32) (((const uchar*) (A))[1])) +\ + (((uint32) (((const uchar*) (A))[0]) << 8)))) <<\ 32)) -#define mi_uint7korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[6])) +\ - (((uint32) (((uchar*) (A))[5])) << 8) +\ - (((uint32) (((uchar*) (A))[4])) << 16) +\ - (((uint32) (((uchar*) (A))[3])) << 24)) +\ - (((ulonglong) (((uint32) (((uchar*) (A))[2])) +\ - (((uint32) (((uchar*) (A))[1])) << 8) +\ - (((uint32) (((uchar*) (A))[0])) << 16))) <<\ +#define mi_uint7korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[6])) +\ + (((uint32) (((const uchar*) (A))[5])) << 8) +\ + (((uint32) (((const uchar*) (A))[4])) << 16) +\ + (((uint32) (((const uchar*) (A))[3])) << 24)) +\ + (((ulonglong) (((uint32) (((const uchar*) (A))[2])) +\ + (((uint32) (((const uchar*) (A))[1])) << 8) +\ + (((uint32) (((const uchar*) (A))[0])) << 16))) <<\ 32)) -#define mi_uint8korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[7])) +\ - (((uint32) (((uchar*) (A))[6])) << 8) +\ - (((uint32) (((uchar*) (A))[5])) << 16) +\ - (((uint32) (((uchar*) (A))[4])) << 24)) +\ - (((ulonglong) (((uint32) (((uchar*) (A))[3])) +\ - (((uint32) (((uchar*) (A))[2])) << 8) +\ - (((uint32) (((uchar*) (A))[1])) << 16) +\ - (((uint32) (((uchar*) (A))[0])) << 24))) <<\ +#define mi_uint8korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[7])) +\ + (((uint32) (((const uchar*) (A))[6])) << 8) +\ + (((uint32) (((const uchar*) (A))[5])) << 16) +\ + (((uint32) (((const uchar*) (A))[4])) << 24)) +\ + (((ulonglong) (((uint32) (((const uchar*) (A))[3])) +\ + (((uint32) (((const uchar*) (A))[2])) << 8) +\ + (((uint32) (((const uchar*) (A))[1])) << 16) +\ + (((uint32) (((const uchar*) (A))[0])) << 24))) <<\ 32)) /* This one is for uniformity */ @@ -132,85 +132,85 @@ ((uchar*) (T))[3]= ((uchar*) &A)[3]; } #define mi_float4get(V,M) { float def_temp;\ - ((uchar*) &def_temp)[0]= ((uchar*) (M))[0];\ - ((uchar*) &def_temp)[1]= ((uchar*) (M))[1];\ - ((uchar*) &def_temp)[2]= ((uchar*) (M))[2];\ - ((uchar*) &def_temp)[3]= ((uchar*) (M))[3];\ + ((uchar*) &def_temp)[0]= ((const uchar*) (M))[0];\ + ((uchar*) &def_temp)[1]= ((const uchar*) (M))[1]; \ + ((uchar*) &def_temp)[2]= ((const uchar*) (M))[2];\ + ((uchar*) &def_temp)[3]= ((const uchar*) (M))[3];\ (V)= def_temp; } -#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((uchar*) &V)[0];\ - ((uchar*) (T))[1]= ((uchar*) &V)[1];\ - ((uchar*) (T))[2]= ((uchar*) &V)[2];\ - ((uchar*) (T))[3]= ((uchar*) &V)[3];\ - ((uchar*) (T))[4]= ((uchar*) &V)[4];\ - ((uchar*) (T))[5]= ((uchar*) &V)[5];\ - ((uchar*) (T))[6]= ((uchar*) &V)[6];\ - ((uchar*) (T))[7]= ((uchar*) &V)[7]; } +#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((const uchar*) &V)[0];\ + ((uchar*) (T))[1]= ((const uchar*) &V)[1];\ + ((uchar*) (T))[2]= ((const uchar*) &V)[2];\ + ((uchar*) (T))[3]= ((const uchar*) &V)[3];\ + ((uchar*) (T))[4]= ((const uchar*) &V)[4];\ + ((uchar*) (T))[5]= ((const uchar*) &V)[5];\ + ((uchar*) (T))[6]= ((const uchar*) &V)[6];\ + ((uchar*) (T))[7]= ((const uchar*) &V)[7]; } #define mi_float8get(V,M) { double def_temp;\ - ((uchar*) &def_temp)[0]= ((uchar*) (M))[0];\ - ((uchar*) &def_temp)[1]= ((uchar*) (M))[1];\ - ((uchar*) &def_temp)[2]= ((uchar*) (M))[2];\ - ((uchar*) &def_temp)[3]= ((uchar*) (M))[3];\ - ((uchar*) &def_temp)[4]= ((uchar*) (M))[4];\ - ((uchar*) &def_temp)[5]= ((uchar*) (M))[5];\ - ((uchar*) &def_temp)[6]= ((uchar*) (M))[6];\ - ((uchar*) &def_temp)[7]= ((uchar*) (M))[7]; \ + ((uchar*) &def_temp)[0]= ((const uchar*) (M))[0];\ + ((uchar*) &def_temp)[1]= ((const uchar*) (M))[1];\ + ((uchar*) &def_temp)[2]= ((const uchar*) (M))[2];\ + ((uchar*) &def_temp)[3]= ((const uchar*) (M))[3];\ + ((uchar*) &def_temp)[4]= ((const uchar*) (M))[4];\ + ((uchar*) &def_temp)[5]= ((const uchar*) (M))[5];\ + ((uchar*) &def_temp)[6]= ((const uchar*) (M))[6];\ + ((uchar*) &def_temp)[7]= ((const uchar*) (M))[7]; \ (V)= def_temp; } #else -#define mi_float4store(T,A) { ((uchar*) (T))[0]= ((uchar*) &A)[3];\ - ((uchar*) (T))[1]= ((uchar*) &A)[2];\ - ((uchar*) (T))[2]= ((uchar*) &A)[1];\ - ((uchar*) (T))[3]= ((uchar*) &A)[0]; } +#define mi_float4store(T,A) { ((uchar*) (T))[0]= ((const uchar*) &A)[3];\ + ((uchar*) (T))[1]= ((const uchar*) &A)[2];\ + ((uchar*) (T))[2]= ((const uchar*) &A)[1];\ + ((uchar*) (T))[3]= ((const uchar*) &A)[0]; } #define mi_float4get(V,M) { float def_temp;\ - ((uchar*) &def_temp)[0]= ((uchar*) (M))[3];\ - ((uchar*) &def_temp)[1]= ((uchar*) (M))[2];\ - ((uchar*) &def_temp)[2]= ((uchar*) (M))[1];\ - ((uchar*) &def_temp)[3]= ((uchar*) (M))[0];\ + ((uchar*) &def_temp)[0]= ((const uchar*) (M))[3];\ + ((uchar*) &def_temp)[1]= ((const uchar*) (M))[2];\ + ((uchar*) &def_temp)[2]= ((const uchar*) (M))[1];\ + ((uchar*) &def_temp)[3]= ((const uchar*) (M))[0];\ (V)= def_temp; } #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) -#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((uchar*) &V)[3];\ - ((uchar*) (T))[1]= ((uchar*) &V)[2];\ - ((uchar*) (T))[2]= ((uchar*) &V)[1];\ - ((uchar*) (T))[3]= ((uchar*) &V)[0];\ - ((uchar*) (T))[4]= ((uchar*) &V)[7];\ - ((uchar*) (T))[5]= ((uchar*) &V)[6];\ - ((uchar*) (T))[6]= ((uchar*) &V)[5];\ - ((uchar*) (T))[7]= ((uchar*) &V)[4];} +#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((const uchar*) &V)[3];\ + ((uchar*) (T))[1]= ((const uchar*) &V)[2];\ + ((uchar*) (T))[2]= ((const uchar*) &V)[1];\ + ((uchar*) (T))[3]= ((const uchar*) &V)[0];\ + ((uchar*) (T))[4]= ((const uchar*) &V)[7];\ + ((uchar*) (T))[5]= ((const uchar*) &V)[6];\ + ((uchar*) (T))[6]= ((const uchar*) &V)[5];\ + ((uchar*) (T))[7]= ((const uchar*) &V)[4];} #define mi_float8get(V,M) { double def_temp;\ - ((uchar*) &def_temp)[0]= ((uchar*) (M))[3];\ - ((uchar*) &def_temp)[1]= ((uchar*) (M))[2];\ - ((uchar*) &def_temp)[2]= ((uchar*) (M))[1];\ - ((uchar*) &def_temp)[3]= ((uchar*) (M))[0];\ - ((uchar*) &def_temp)[4]= ((uchar*) (M))[7];\ - ((uchar*) &def_temp)[5]= ((uchar*) (M))[6];\ - ((uchar*) &def_temp)[6]= ((uchar*) (M))[5];\ - ((uchar*) &def_temp)[7]= ((uchar*) (M))[4];\ + ((uchar*) &def_temp)[0]= ((const uchar*) (M))[3];\ + ((uchar*) &def_temp)[1]= ((const uchar*) (M))[2];\ + ((uchar*) &def_temp)[2]= ((const uchar*) (M))[1];\ + ((uchar*) &def_temp)[3]= ((const uchar*) (M))[0];\ + ((uchar*) &def_temp)[4]= ((const uchar*) (M))[7];\ + ((uchar*) &def_temp)[5]= ((const uchar*) (M))[6];\ + ((uchar*) &def_temp)[6]= ((const uchar*) (M))[5];\ + ((uchar*) &def_temp)[7]= ((const uchar*) (M))[4];\ (V)= def_temp; } #else -#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((uchar*) &V)[7];\ - ((uchar*) (T))[1]= ((uchar*) &V)[6];\ - ((uchar*) (T))[2]= ((uchar*) &V)[5];\ - ((uchar*) (T))[3]= ((uchar*) &V)[4];\ - ((uchar*) (T))[4]= ((uchar*) &V)[3];\ - ((uchar*) (T))[5]= ((uchar*) &V)[2];\ - ((uchar*) (T))[6]= ((uchar*) &V)[1];\ - ((uchar*) (T))[7]= ((uchar*) &V)[0];} +#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((const uchar*) &V)[7];\ + ((uchar*) (T))[1]= ((const uchar*) &V)[6];\ + ((uchar*) (T))[2]= ((const uchar*) &V)[5];\ + ((uchar*) (T))[3]= ((const uchar*) &V)[4];\ + ((uchar*) (T))[4]= ((const uchar*) &V)[3];\ + ((uchar*) (T))[5]= ((const uchar*) &V)[2];\ + ((uchar*) (T))[6]= ((const uchar*) &V)[1];\ + ((uchar*) (T))[7]= ((const uchar*) &V)[0];} #define mi_float8get(V,M) { double def_temp;\ - ((uchar*) &def_temp)[0]= ((uchar*) (M))[7];\ - ((uchar*) &def_temp)[1]= ((uchar*) (M))[6];\ - ((uchar*) &def_temp)[2]= ((uchar*) (M))[5];\ - ((uchar*) &def_temp)[3]= ((uchar*) (M))[4];\ - ((uchar*) &def_temp)[4]= ((uchar*) (M))[3];\ - ((uchar*) &def_temp)[5]= ((uchar*) (M))[2];\ - ((uchar*) &def_temp)[6]= ((uchar*) (M))[1];\ - ((uchar*) &def_temp)[7]= ((uchar*) (M))[0];\ + ((uchar*) &def_temp)[0]= ((const uchar*) (M))[7];\ + ((uchar*) &def_temp)[1]= ((const uchar*) (M))[6];\ + ((uchar*) &def_temp)[2]= ((const uchar*) (M))[5];\ + ((uchar*) &def_temp)[3]= ((const uchar*) (M))[4];\ + ((uchar*) &def_temp)[4]= ((const uchar*) (M))[3];\ + ((uchar*) &def_temp)[5]= ((const uchar*) (M))[2];\ + ((uchar*) &def_temp)[6]= ((const uchar*) (M))[1];\ + ((uchar*) &def_temp)[7]= ((const uchar*) (M))[0];\ (V)= def_temp; } #endif /* __FLOAT_WORD_ORDER */ #endif /* WORDS_BIGENDIAN */ @@ -223,7 +223,7 @@ #else #define mi_rowstore(T,A) { mi_int4store(T, 0);\ mi_int4store(((uchar*) (T) + 4), A); } -#define mi_rowkorr(T) mi_uint4korr((uchar*) (T) + 4) +#define mi_rowkorr(T) mi_uint4korr((const uchar*) (T) + 4) #endif #if SIZEOF_OFF_T > 4 @@ -234,5 +234,5 @@ bfill((char*) (T), 8, 255);\ else { mi_int4store((T), 0);\ mi_int4store(((T) + 4), A); }} -#define mi_sizekorr(T) mi_uint4korr((uchar*) (T) + 4) +#define mi_sizekorr(T) mi_uint4korr((const uchar*) (T) + 4) #endif diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 633cde41130..d9e9c7fa96d 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -98,12 +98,11 @@ unsigned long my_net_read(NET *net); struct sockaddr; int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, unsigned int timeout); -struct rand_struct { - unsigned long seed1,seed2,max_value; - double max_value_dbl; +struct my_rnd_struct; +enum Item_result +{ + STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT }; -enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, - DECIMAL_RESULT}; typedef struct st_udf_args { unsigned int arg_count; @@ -124,10 +123,8 @@ typedef struct st_udf_init my_bool const_item; void *extension; } UDF_INIT; -void randominit(struct rand_struct *, unsigned long seed1, - unsigned long seed2); -double my_rnd(struct rand_struct *); -void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st); +void create_random_string(char *to, unsigned int length, + struct my_rnd_struct *rand_st); void hash_password(unsigned long *to, const char *password, unsigned int password_len); void make_scrambled_password_323(char *to, const char *password); void scramble_323(char *to, const char *message, const char *password); @@ -205,8 +202,8 @@ typedef unsigned long long my_ulonglong; typedef struct st_used_mem { struct st_used_mem *next; - unsigned int left; - unsigned int size; + size_t left; + size_t size; } USED_MEM; typedef struct st_mem_root { diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index a978d44b918..fa38b90046d 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -676,7 +676,6 @@ int thd_in_lock_tables(const MYSQL_THD thd); int thd_tablespace_op(const MYSQL_THD thd); long long thd_test_options(const MYSQL_THD thd, long long test_options); int thd_sql_command(const MYSQL_THD thd); -const char *thd_proc_info(MYSQL_THD thd, const char *info); void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton); int thd_tx_isolation(const MYSQL_THD thd); char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length, @@ -684,6 +683,10 @@ char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length, /* Increments the row counter, see THD::row_count */ void thd_inc_row_count(MYSQL_THD thd); +#define thd_proc_info(thd, msg) set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__) +const char *set_thd_proc_info(MYSQL_THD, const char * info, const char *func, + const char *file, const unsigned int line); + /** Create a temporary file. diff --git a/include/mysql/plugin.h.pp b/include/mysql/plugin.h.pp index 50511f515ab..c781bae9a97 100644 --- a/include/mysql/plugin.h.pp +++ b/include/mysql/plugin.h.pp @@ -116,12 +116,13 @@ int thd_in_lock_tables(const void* thd); int thd_tablespace_op(const void* thd); long long thd_test_options(const void* thd, long long test_options); int thd_sql_command(const void* thd); -const char *thd_proc_info(void* thd, const char *info); void **thd_ha_data(const void* thd, const struct handlerton *hton); int thd_tx_isolation(const void* thd); char *thd_security_context(void* thd, char *buffer, unsigned int length, unsigned int max_query_len); void thd_inc_row_count(void* thd); +const char *set_thd_proc_info(void*, const char * info, const char *func, + const char *file, const unsigned int line); int mysql_tmpfile(const char *prefix); int thd_killed(const void* thd); unsigned long thd_get_thread_id(const void* thd); diff --git a/include/mysql_com.h b/include/mysql_com.h index db5a5eb8741..41941d01fd2 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -416,11 +416,7 @@ void my_net_set_read_timeout(NET *net, uint timeout); struct sockaddr; int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, unsigned int timeout); - -struct rand_struct { - unsigned long seed1,seed2,max_value; - double max_value_dbl; -}; +struct my_rnd_struct; #ifdef __cplusplus } @@ -428,8 +424,13 @@ struct rand_struct { /* The following is for user defined functions */ -enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, - DECIMAL_RESULT}; +enum Item_result +{ + STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT +#ifdef MYSQL_SERVER + ,IMPOSSIBLE_RESULT /* Yes, we know this is ugly, don't tell us */ +#endif +}; typedef struct st_udf_args { @@ -474,10 +475,8 @@ extern "C" { implemented in sql/password.c */ -void randominit(struct rand_struct *, unsigned long seed1, - unsigned long seed2); -double my_rnd(struct rand_struct *); -void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st); +void create_random_string(char *to, unsigned int length, + struct my_rnd_struct *rand_st); void hash_password(unsigned long *to, const char *password, unsigned int password_len); void make_scrambled_password_323(char *to, const char *password); diff --git a/include/mysys_err.h b/include/mysys_err.h index 09e77248c17..7167395f71f 100644 --- a/include/mysys_err.h +++ b/include/mysys_err.h @@ -62,7 +62,8 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */ #define EE_UNKNOWN_COLLATION 28 #define EE_FILENOTFOUND 29 #define EE_FILE_NOT_CLOSED 30 -#define EE_ERROR_LAST 30 /* Copy last error nr */ +#define EE_CANT_CHMOD 31 +#define EE_ERROR_LAST 31 /* Copy last error nr */ /* Add error numbers before EE_ERROR_LAST and change it accordingly. */ /* exit codes for all MySQL programs */ diff --git a/include/thr_lock.h b/include/thr_lock.h index 77d428d1805..cf27527cad4 100644 --- a/include/thr_lock.h +++ b/include/thr_lock.h @@ -131,11 +131,12 @@ typedef struct st_thr_lock { /* write_lock_count is incremented for write locks and reset on read locks */ ulong write_lock_count; uint read_no_write_count; - void (*get_status)(void*, int); /* When one gets a lock */ + void (*get_status)(void*, my_bool); /* When one gets a lock */ void (*copy_status)(void*,void*); void (*update_status)(void*); /* Before release of write */ void (*restore_status)(void*); /* Before release of read */ my_bool (*check_status)(void *); + my_bool allow_multiple_concurrent_insert; } THR_LOCK; diff --git a/include/waiting_threads.h b/include/waiting_threads.h new file mode 100644 index 00000000000..e872a6b6ab8 --- /dev/null +++ b/include/waiting_threads.h @@ -0,0 +1,201 @@ +/* Copyright (C) 2008 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _waiting_threads_h +#define _waiting_threads_h + +#include +#include + +#include + +C_MODE_START + +typedef struct st_wt_resource_id WT_RESOURCE_ID; + +typedef struct st_wt_resource_type { + int (*compare)(void *a, void *b); + const void *(*make_key)(WT_RESOURCE_ID *id, uint *len); +} WT_RESOURCE_TYPE; + +struct st_wt_resource_id { + ulonglong value; + WT_RESOURCE_TYPE *type; +}; +#define sizeof_WT_RESOURCE_ID (sizeof(ulonglong)+sizeof(void*)) + +#define WT_WAIT_STATS 24 +#define WT_CYCLE_STATS 32 +extern ulonglong wt_wait_table[WT_WAIT_STATS]; +extern uint32 wt_wait_stats[WT_WAIT_STATS+1]; +extern uint32 wt_cycle_stats[2][WT_CYCLE_STATS+1]; +extern uint32 wt_success_stats; + +/* + 'lock' protects 'owners', 'state', and 'waiter_count' + 'id' is read-only + + a resource is picked up from a hash in a lock-free manner + it's returned pinned, so it cannot be freed at once + but it may be freed right after the pin is removed + to free a resource it should be + 1. have no owners + 2. have no waiters + + two ways to access a resource: + 1. find it in a hash + - it's returned pinned. + a) take a lock in exclusive mode + b) check the state, it should be ACTIVE + c) unpin + 2. by a direct reference + - could only used if a resource cannot be freed + e.g. accessing a resource by thd->waiting_for is safe, + a resource cannot be freed as there's a thread waiting for it +*/ +typedef struct st_wt_resource { + WT_RESOURCE_ID id; + uint waiter_count; + enum { ACTIVE, FREE } state; +#ifndef DBUG_OFF + pthread_mutex_t *mutex; +#endif + /* + before the 'lock' all elements are mutable, after (and including) - + immutable in the sense that lf_hash_insert() won't memcpy() over them. + See wt_init(). + */ +#ifdef WT_RWLOCKS_USE_MUTEXES + /* + we need a special rwlock-like 'lock' to allow readers bypass + waiting writers, otherwise readers can deadlock. For example: + + A waits on resource x, owned by B, B waits on resource y, owned + by A, we have a cycle (A->x->B->y->A) + Both A and B start deadlock detection: + + A locks x B locks y + A goes deeper B goes deeper + A locks y B locks x + + with mutexes it would deadlock. With rwlocks it won't, as long + as both A and B are taking read locks (and they do). + But other threads may take write locks. Assume there's + C who wants to start waiting on x, and D who wants to start + waiting on y. + + A read-locks x B read-locks y + A goes deeper B goes deeper + => C write-locks x (to add a new edge) D write-locks y + .. C is blocked D is blocked + A read-locks y B read-locks x + + Now, if a read lock can bypass a pending wrote lock request, we're fine. + If it can not, we have a deadlock. + + writer starvation is technically possible, but unlikely, because + the contention is expected to be low. + */ + struct { + pthread_cond_t cond; + pthread_mutex_t mutex; + uint readers: 16; + uint pending_writers: 15; + uint write_locked: 1; + } lock; +#else + rw_lock_t lock; +#endif + pthread_cond_t cond; + DYNAMIC_ARRAY owners; +} WT_RESOURCE; + +typedef struct st_wt_thd { + /* + XXX + there's no protection (mutex) against concurrent access of + the dynarray below. it is assumed that a caller will have it + automatically (not to protect this array but to protect its + own - caller's - data structures, and we'll get it for free. + If not, we'll need to add a mutex + */ + DYNAMIC_ARRAY my_resources; + /* + 'waiting_for' is modified under waiting_for->lock, and only by thd itself + 'waiting_for' is read lock-free (using pinning protocol), but a thd object + can read its own 'waiting_for' without any locks or tricks. + */ + WT_RESOURCE *waiting_for; + LF_PINS *pins; + + /* pointers to values */ + ulong *timeout_short, *deadlock_search_depth_short; + ulong *timeout_long, *deadlock_search_depth_long; + + /* + weight relates to the desirability of a transaction being killed if it's + part of a deadlock. In a deadlock situation transactions with lower weights + are killed first. + + Examples of using the weight to implement different selection strategies: + + 1. Latest + Keep all weights equal. + 2. Random + Assight weights at random. + (variant: modify a weight randomly before every lock request) + 3. Youngest + Set weight to -NOW() + 4. Minimum locks + count locks granted in your lock manager, store the value as a weight + 5. Minimum work + depends on the definition of "work". For example, store the number + of rows modifies in this transaction (or a length of REDO log for a + transaction) as a weight. + + It is only statistically relevant and is not protected by any locks. + */ + ulong volatile weight; + /* + 'killed' is indirectly protected by waiting_for->lock - + a killed thread needs to clear its 'waiting_for', and thus needs a lock. + That is a thread needs an exclusive lock to read 'killed' reliably. + But other threads may change 'killed' from 0 to 1, a shared + lock is enough for that. + */ + my_bool volatile killed; +#ifndef DBUG_OFF + const char *name; +#endif +} WT_THD; + +#define WT_TIMEOUT ETIMEDOUT +#define WT_OK 0 +#define WT_DEADLOCK -1 +#define WT_DEPTH_EXCEEDED -2 + +void wt_init(void); +void wt_end(void); +void wt_thd_lazy_init(WT_THD *, ulong *, ulong *, ulong *, ulong *); +void wt_thd_destroy(WT_THD *); +int wt_thd_will_wait_for(WT_THD *, WT_THD *, WT_RESOURCE_ID *); +int wt_thd_cond_timedwait(WT_THD *, pthread_mutex_t *); +void wt_thd_release(WT_THD *, WT_RESOURCE_ID *); +#define wt_thd_release_all(THD) wt_thd_release((THD), 0) +int wt_resource_id_memcmp(void *, void *); + +C_MODE_END + +#endif diff --git a/include/wqueue.h b/include/wqueue.h new file mode 100644 index 00000000000..658f3d66f12 --- /dev/null +++ b/include/wqueue.h @@ -0,0 +1,27 @@ + +#ifndef _wqueue_h +#define _wqueue_h + +#include +#include + +/* 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); +void wqueue_release_one_locktype_from_queue(WQUEUE *wqueue); + +#endif + +#endif diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index 55138e4aa06..6e3e29e79b2 100755 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -71,10 +71,10 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c ../strings/ctype-simple.c ../strings/ctype-sjis.c ../strings/ctype-tis620.c ../strings/ctype-uca.c ../strings/ctype-ucs2.c ../strings/ctype-ujis.c ../strings/ctype-utf8.c ../strings/ctype-win1250ch.c ../strings/ctype.c - ../mysys/default.c errmsg.c ../mysys/errors.c + ../mysys/default.c errmsg.c ../mysys/errors.c ../mysys/my_sync.c ../mysys/hash.c ../mysys/my_sleep.c ../mysys/default_modify.c get_password.c ../strings/int2str.c ../strings/is_prefix.c - libmysql.c ../mysys/list.c ../strings/llstr.c + libmysql.c ../mysys/list.c ../strings/llstr.c ../mysys/my_rnd.c ../strings/longlong2str.c manager.c ../mysys/mf_arr_appstr.c ../mysys/mf_cache.c ../mysys/mf_dirname.c ../mysys/mf_fn_ext.c ../mysys/mf_format.c ../mysys/mf_iocache.c ../mysys/mf_iocache2.c ../mysys/mf_loadpath.c diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index 43e86ea31e8..cbee8673164 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -66,7 +66,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \ my_compress.lo array.lo my_once.lo list.lo my_net.lo \ charset.lo charset-def.lo hash.lo mf_iocache.lo \ mf_iocache2.lo my_seek.lo my_sleep.lo \ - my_pread.lo mf_cache.lo md5.lo sha1.lo \ + my_pread.lo mf_cache.lo md5.lo sha1.lo my_rnd.lo \ my_getopt.lo my_gethostbyname.lo my_port.lo \ my_rename.lo my_chsize.lo my_sync.lo my_getsystime.lo sqlobjects = net.lo diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index ca329eadf0f..c01f34b422c 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -4408,7 +4408,6 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field) field->max_length= 10; /* 2003-11-11 */ param->skip_result= skip_result_with_length; break; - break; case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_TIMESTAMP: param->skip_result= skip_result_with_length; diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index 1582f0898d8..ee08721b27c 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -145,6 +145,13 @@ IF(WITH_CSV_STORAGE_ENGINE) ENDFOREACH(rpath) ENDIF(WITH_CSV_STORAGE_ENGINE) +IF(WITH_MARIA_STORAGE_ENGINE) + INCLUDE(${CMAKE_SOURCE_DIR}/storage/maria/CMakeLists.txt) + FOREACH(rpath ${MARIA_SOURCES}) + SET(LIB_SOURCES ${LIB_SOURCES} ../storage/maria/${rpath}) + ENDFOREACH(rpath) +ENDIF(WITH_MARIA_STORAGE_ENGINE) + SET(SOURCE_SUBLIBS FALSE) SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc diff --git a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test index ee6b0ed1426..209ef6189d1 100644 --- a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test +++ b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test @@ -9,9 +9,9 @@ let $SERVER_VERSION=`select version()`; -create table t1 (a int); +create table t1 (a int) ENGINE=MyISAM; insert into t1 values (10); -create table t2 (a int); +create table t2 (a int) ENGINE=MyISAM; create table t3 (a int) engine=merge union(t1); create table t4 (a int); # We force the slave to open t3 (because we want to try confusing him) with this : diff --git a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test index e492903afad..16e6bb3c960 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test @@ -17,7 +17,7 @@ select @@global.binlog_format; # happened only in statement-based binlogging. # -CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)); +CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)) ENGINE=MyISAM; let $query = "INSERT DELAYED INTO t1 VALUES (null, 'Dr. No'), (null, 'From Russia With Love'), (null, 'Goldfinger'), (null, 'Thunderball'), (null, 'You Only Live Twice')"; --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=200 --query=$query --delimiter=";" diff --git a/mysql-test/include/have_maria.inc b/mysql-test/include/have_maria.inc new file mode 100644 index 00000000000..474e9db12b9 --- /dev/null +++ b/mysql-test/include/have_maria.inc @@ -0,0 +1,4 @@ +disable_query_log; +--require r/true.require +select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'maria'; +enable_query_log; diff --git a/mysql-test/include/maria_empty_logs.inc b/mysql-test/include/maria_empty_logs.inc new file mode 100644 index 00000000000..0783020c443 --- /dev/null +++ b/mysql-test/include/maria_empty_logs.inc @@ -0,0 +1,77 @@ +# Maria help script. +# Cleans up all logs to give recovery a fresh start. + +# API: set mel_keep_control_file=1 if want to keep control file; +# uses vardir, port and socket. + +connection default; +let $default_db=`select database()`; + +connection admin; +-- echo * shut down mysqld, removed logs, restarted it +append_file $MYSQLTEST_VARDIR/tmp/master0.expect; +wait-maria_empty_logs.inc +EOF + +--source include/mysqladmin_shutdown.inc + +if (!$mel_keep_control_file) +{ + remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log_control; +} +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000001; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000002; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000003; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000004; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000005; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000006; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000007; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000008; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000009; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000010; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000011; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000012; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000013; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000014; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000015; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000016; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000017; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000018; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000019; +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000020; +# hope there are not more than these logs... + +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/master-data/maria_recovery.trace; + +append_file $MYSQLTEST_VARDIR/tmp/master0.expect; +restart-maria_empty_logs.inc +EOF + +--source include/wait_until_connected_again.inc + +connection default; +# Restore current database as the effect of "use" was lost after restart +--disable_query_log +eval use $default_db; +--enable_query_log diff --git a/mysql-test/include/maria_make_snapshot.inc b/mysql-test/include/maria_make_snapshot.inc new file mode 100644 index 00000000000..679a65552c1 --- /dev/null +++ b/mysql-test/include/maria_make_snapshot.inc @@ -0,0 +1,49 @@ +# Maria helper script +# Copies table' data and index file to other directory, or back, or compares. +# The other directory looks like a database directory, so that we can +# read copies from inside mysqld, that's also why we copy the frm. + +# "mms" is a namespace for Maria_Make_Snapshot + +# API: +# 1) set one of +# $mms_copy : to copy table from database to spare directory +# $mms_reverse : to copy it back +# $mms_compare_physically : to compare both byte-for-byte +# 2) set $mms_tname to a string and set $mms_table_to_use to a number: tables +# will be mysqltest.$mms_tname$mms_table_to_use. +# 3) set $mms_purpose to say what this copy is for (influences the naming +# of the spare directory). + +if ($mms_copy) +{ + --echo * copied $mms_tname$mms_table_to_use for $mms_purpose + copy_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD; + copy_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI; + copy_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.frm $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.frm; +} + +if ($mms_reverse_copy) +{ + # do not call this without flushing target table first! + --echo * copied $mms_tname$mms_table_to_use back for $mms_purpose + -- error 0,1 + remove_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD; + copy_file $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD; + -- error 0,1 + remove_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI; + copy_file $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI; +} + +if ($mms_compare_physically) +{ + # After the UNDO phase this is normally impossible + # (UNDO execution has created new log records => pages have new LSNs). + # So, do this only when testing REDO phase. + # If UNDO phase, we nevertheless compare checksums + # (see maria_verify_recovery.inc). + --echo * compared $mms_tname$mms_table_to_use to old version + diff_files $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD; +# index file not yet recovered +# diff_files $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI; +} diff --git a/mysql-test/include/maria_make_snapshot_for_comparison.inc b/mysql-test/include/maria_make_snapshot_for_comparison.inc new file mode 100644 index 00000000000..cb756f60527 --- /dev/null +++ b/mysql-test/include/maria_make_snapshot_for_comparison.inc @@ -0,0 +1,31 @@ +# Maria helper script +# Copies clean tables' data and index file to other directory +# Tables are $mms_tname1...$mms_tname[$mms_tables] +# They are later used as a reference to see if recovery works. + +# API: +# set $mms_tname to a string, and $mms_tables to a number N, the script will +# cover tables mysqltest.$mms_tname1,...$mms_tnameN + +connection admin; + +let $mms_table_to_use=$mms_tables; +let $mms_purpose=comparison; +let $mms_copy=1; + +--disable_query_log +--disable_warnings +eval drop database if exists mysqltest_for_$mms_purpose; +--enable_warnings +eval create database mysqltest_for_$mms_purpose; +--enable_query_log + +while ($mms_table_to_use) +{ + # to serve as a reference, table must be in a clean state + eval flush table $mms_tname$mms_table_to_use; + -- source include/maria_make_snapshot.inc + dec $mms_table_to_use; +} +let $mms_copy=0; +connection default; diff --git a/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc b/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc new file mode 100644 index 00000000000..879aa3ef182 --- /dev/null +++ b/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc @@ -0,0 +1,37 @@ +# Maria helper script +# Copies tables' data and index file to other directory, and control file. +# Tables are $mms_tname1...$mms_tname[$mms_tables]. +# Later, mysqld is shutdown, and that snapshot is put back into the +# datadir, control file too ("flashing recovery's brain"), and recovery is let +# to run on it (see maria_verify_recovery.inc). + +# API: +# set $mms_tname to a string, and $mms_tables to a number N, the script will +# cover tables mysqltest.$mms_tname1,...$mms_tnameN + + +connection admin; + +let $mms_table_to_use=$mms_tables; +let $mms_purpose=feeding_recovery; +let $mms_copy=1; + +--disable_query_log +--disable_warnings +eval drop database if exists mysqltest_for_$mms_purpose; +--enable_warnings +eval create database mysqltest_for_$mms_purpose; +--enable_query_log + +while ($mms_table_to_use) +{ + -- source include/maria_make_snapshot.inc + dec $mms_table_to_use; +} +let $mms_copy=0; + +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control; +copy_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log_control $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control; + +connection default; diff --git a/mysql-test/include/maria_verify_recovery.inc b/mysql-test/include/maria_verify_recovery.inc new file mode 100644 index 00000000000..becdfb5df86 --- /dev/null +++ b/mysql-test/include/maria_verify_recovery.inc @@ -0,0 +1,97 @@ +# Maria helper script. +# Runs recovery, compare with expected table data. + +# API: +# 1) set $mms_tname to a string, and $mms_tables to a number N, the script +# will cover tables mysqltest.$mms_tname1,...$mms_tnameN +# 2) set $mvr_debug_option to the crash way +# 3) set $mvr_crash_statement to the statement which will trigger a crash +# 4) set $mvr_restore_old_snapshot to 1 if you want recovery to run on +# an old copy of tables and of the control file, 0 for normal recovery. +# 5) set $mms_compare_physically to 1 if you want a physical byte-for-byte +# comparison with expected table. Checksum comparison is always done. +# "mvr" is a namespace for Maria_Verify_Recovery + +connection admin; + +# we may do a copy-back of tables before comparison, so save comparison +# request made by caller: +let $mms_compare_physically_save=$mms_compare_physically; +let $mms_compare_physically=0; + +# warn mtr that mysqld is going to die and should not be restarted immediately +#append_file $MYSQLTEST_VARDIR/tmp/master0.expect; +#wait-maria_verify_recovery.inc +#EOF +# todo: remove this "system" and uncomment above when BUG#32296 is fixed +system echo wait-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/master0.expect; + +# flush page cache and log, only log, or nothing, and kill mysqld with +# abort(). +# When we restore an old snapshot, we could just kill mysqld nicely, +# but that would implicitely commit all work, which the tester may +# not want (tester may want to observe rollback happening). + +eval SET SESSION debug=$mvr_debug_option; +--echo * crashing mysqld intentionally +--error 2013 +eval $mvr_crash_statement; # this will crash (DBUG magic) + +if ($mvr_restore_old_snapshot) +{ + + # copy snapshot made by maria_make_snapshot_for_feeding_recovery back + # into datadir. + + let $mms_table_to_use=$mms_tables; + let $mms_purpose=feeding_recovery; + let $mms_reverse_copy=1; + while ($mms_table_to_use) + { + -- source include/maria_make_snapshot.inc + dec $mms_table_to_use; + } + let $mms_reverse_copy=0; + + # also copy back control file, to force recovery to start from an early + # point, ignoring further checkpoints. + -- error 0,1 + remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log_control; + copy_file $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log_control; +} + +--echo * recovery happens +# let mtr restart mysqld (and thus execute the maria log) +#append_file $MYSQLTEST_VARDIR/tmp/master0.expect; +#restart-maria_verify_recovery.inc +#EOF +system echo restart-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/master0.expect; + +--source include/wait_until_connected_again.inc + +# Compare that tables of $mms_tables are identical to old. +# We always compare with CHECKSUM TABLE, and if requested (which makes sense +# only for testing the REDO phase, as UNDO phase generates new records so new +# LSNs on pages.) with a physical byte-for-byte comparison. +let $mms_table_to_use=$mms_tables; +let $mms_purpose=comparison; +let $mms_compare_physically=$mms_compare_physically_save; +while ($mms_table_to_use) +{ + eval check table $mms_tname$mms_table_to_use extended; + --echo * testing that checksum after recovery is as expected + let $new_checksum=`CHECKSUM TABLE $mms_tname$mms_table_to_use`; + let $old_checksum=`CHECKSUM TABLE mysqltest_for_$mms_purpose.$mms_tname$mms_table_to_use`; + # the $ text variables above are of the form "db.tablename\tchecksum", + # as db differs, we use substring(). + --disable_query_log + eval select if(substring("$new_checksum",instr("$new_checksum",".t1")) = substring("$old_checksum",instr("$old_checksum",".t1")),"ok","failure") as "Checksum-check"; + --enable_query_log + # this script may compare physically or do nothing + -- source include/maria_make_snapshot.inc + dec $mms_table_to_use; +} + +connection default; +# the effect of "use" is lost after a restart so we are back into db "test" +use mysqltest; diff --git a/mysql-test/include/mysqladmin_shutdown.inc b/mysql-test/include/mysqladmin_shutdown.inc new file mode 100644 index 00000000000..16b33c2baf8 --- /dev/null +++ b/mysql-test/include/mysqladmin_shutdown.inc @@ -0,0 +1,7 @@ +# Initiates a clean shutdown of the server and waits for its completion + +--exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= shutdown 2>&1; + +# On Windows mysqladmin does not wait for shutdown to be finished, +# so we have to monitor this with our connection: +--source include/wait_until_disconnected.inc diff --git a/mysql-test/include/ps_conv.inc b/mysql-test/include/ps_conv.inc index 195d1061664..8cbe9450063 100644 --- a/mysql-test/include/ps_conv.inc +++ b/mysql-test/include/ps_conv.inc @@ -52,7 +52,7 @@ set @arg14= 'abc'; set @arg14= NULL ; set @arg15= CAST('abc' as binary) ; set @arg15= NULL ; -create table t5 as select +eval create table t5 engine = MyISAM as select 8 as const01, @arg01 as param01, 8.0 as const02, @arg02 as param02, 80.00000000000e-1 as const03, @arg03 as param03, diff --git a/mysql-test/include/varchar.inc b/mysql-test/include/varchar.inc index 15306ed8385..7accbd151a9 100644 --- a/mysql-test/include/varchar.inc +++ b/mysql-test/include/varchar.inc @@ -11,6 +11,11 @@ enable_query_log; # Simple basic test that endspace is saved # +# +# Remember to check that one doesn't get a warning or a note +# from a char field when end spaces get removed. SQL standard! +# + create table t1 (v varchar(10), c char(10), t text); insert into t1 values('+ ', '+ ', '+ '); set @a=repeat(' ',20); diff --git a/mysql-test/include/wait_until_connected_again.inc b/mysql-test/include/wait_until_connected_again.inc index dc96f646cb3..4379f4d3145 100644 --- a/mysql-test/include/wait_until_connected_again.inc +++ b/mysql-test/include/wait_until_connected_again.inc @@ -1,12 +1,17 @@ # # Include this script to wait until the connection to the -# server has been restored or timeout occurs +# server has been restored or timeout occurs. +# You should have done --enable_reconnect first +# When you change this file you may have to chance its cousin +# wait_until_disconnected.inc + --disable_result_log --disable_query_log -let $counter= 500; +let $counter= 5000; +let $mysql_errno= 1; while ($mysql_errno) { - --error 0,2002,2006 + --error 0,2002,2003,2006,1053 show status; dec $counter; diff --git a/mysql-test/include/wait_until_disconnected.inc b/mysql-test/include/wait_until_disconnected.inc new file mode 100644 index 00000000000..cf4a574573f --- /dev/null +++ b/mysql-test/include/wait_until_disconnected.inc @@ -0,0 +1,24 @@ +# +# Include this script after a shutdown to wait until the connection +# to the server has been lost or timeout occurs. +# When you change this file you may have to chance its cousin +# wait_until_connected_again.inc + +--disable_result_log +--disable_query_log +let $counter= 5000; +let $mysql_errno= 0; +while (!$mysql_errno) +{ + --error 0,2002,2003,2006,1053 + show status; + + dec $counter; + if (!$counter) + { + --die Server failed to disconnect me + } + --sleep 0.1 +} +--enable_query_log +--enable_result_log diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh index e4df8f619cc..855ec4351e3 100644 --- a/mysql-test/install_test_db.sh +++ b/mysql-test/install_test_db.sh @@ -102,7 +102,7 @@ basedir=. EXTRA_ARG="--windows" fi -INSTALL_CMD="$scriptdir/mysql_install_db --no-defaults $EXTRA_ARG --basedir=$basedir --datadir=mysql-test/$ldata --srcdir=." +INSTALL_CMD="$scriptdir/mysql_install_db --no-defaults $EXTRA_ARG --datadir=mysql-test/$ldata --srcdir=." echo "running $INSTALL_CMD" cd .. diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 3b47a89d3d2..1bb793fba49 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -511,19 +511,10 @@ sub collect_one_test_case($$$$$$$$$) { my $suite_opts= shift; my $path= "$testdir/$elem"; - - # ---------------------------------------------------------------------- - # Skip some tests silently - # ---------------------------------------------------------------------- - - if ( $::opt_start_from and $tname lt $::opt_start_from ) - { - return; - } - + my $name= basename($suite) . ".$tname"; my $tinfo= {}; - $tinfo->{'name'}= basename($suite) . ".$tname"; + $tinfo->{'name'}= $name; $tinfo->{'result_file'}= "$resdir/$tname.result"; $tinfo->{'component_id'} = $component_id; push(@$cases, $tinfo); @@ -532,7 +523,7 @@ sub collect_one_test_case($$$$$$$$$) { # Skip some tests but include in list, just mark them to skip # ---------------------------------------------------------------------- - if ( $skip_test and $tname =~ /$skip_test/o ) + if ( $skip_test and ($tname =~ /$skip_test/o || $name =~ /$skip_test/o)) { $tinfo->{'skip'}= 1; return; diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 8fd900330da..566ccfe0778 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -474,12 +474,6 @@ sub mtr_kill_leftovers () { } } } - else - { - mtr_warning("Found non pid file $elem in $rundir") - if -f "$rundir/$elem"; - next; - } } closedir(RUNDIR); @@ -886,15 +880,33 @@ sub check_expected_crash_and_restart($) mtr_verbose("$mysqld->{'type'} $mysqld->{'idx'} exited, pid: $ret_pid"); $mysqld->{'pid'}= 0; - # Check if crash expected and restart if it was + # Check if crash expected, and restart if it was my $expect_file= "$::opt_vardir/tmp/" . "$mysqld->{'type'}" . "$mysqld->{'idx'}" . ".expect"; - if ( -f $expect_file ) + while ( 1 ) { - mtr_verbose("Crash was expected, file $expect_file exists"); - mysqld_start($mysqld, $mysqld->{'start_opts'}, - $mysqld->{'start_slave_master_info'}); - unlink($expect_file); + if ( -f $expect_file ) + { + mtr_verbose("Crash was expected, file $expect_file exists"); + my $expect_file_handler; + open($expect_file_handler, "<$expect_file") or die; + my @expect_lines= <$expect_file_handler>; + close $expect_file_handler; + # look at most recent order by the test + my $expect_content= pop @expect_lines; + chomp $expect_content; + if ( $expect_content =~ /^wait/ ) + { + mtr_verbose("Test asks that we wait before restart"); + # Millisceond sleep emulated with select + select(undef, undef, undef, (0.1)); + next; + } + unlink($expect_file); + mysqld_start($mysqld, $mysqld->{'start_opts'}, + $mysqld->{'start_slave_master_info'}); + } + last; } return; @@ -914,8 +926,8 @@ sub check_expected_crash_and_restart($) if ( -f $expect_file ) { mtr_verbose("Crash was expected, file $expect_file exists"); - ndbmgmd_start($cluster); unlink($expect_file); + ndbmgmd_start($cluster); } return; } @@ -933,9 +945,9 @@ sub check_expected_crash_and_restart($) if ( -f $expect_file ) { mtr_verbose("Crash was expected, file $expect_file exists"); + unlink($expect_file); ndbd_start($cluster, $ndbd->{'idx'}, $ndbd->{'start_extra_args'}); - unlink($expect_file); } return; } diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 3c78c3ca064..7daf6743b03 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -220,7 +220,7 @@ sub mtr_report_stats ($) { # the "var/log/*.err" files. We save this info in "var/log/warnings" # ---------------------------------------------------------------------- - if ( ! $::glob_use_running_server ) + if ( ! $::glob_use_running_server && !$::opt_extern) { # Save and report if there was any fatal warnings/errors in err logs @@ -376,30 +376,29 @@ sub mtr_report_stats ($) { /Slave: Can't DROP 'c7'.* 1091/ or /Slave: Key column 'c6'.* 1072/ or - # rpl_idempotency.test produces warnings for the slave. - ($testname eq 'rpl.rpl_idempotency' and - (/Slave: Can\'t find record in \'t1\' Error_code: 1032/ or - /Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452/ - )) or - - # These tests does "kill" on queries, causing sporadic errors when writing to logs - (($testname eq 'rpl.rpl_skip_error' or - $testname eq 'rpl.rpl_err_ignoredtable' or - $testname eq 'binlog.binlog_killed_simulate' or - $testname eq 'binlog.binlog_killed') and - (/Failed to write to mysql\.\w+_log/ - )) or + # rpl_idempotency.test produces warnings for the slave. + ($testname eq 'rpl.rpl_idempotency' and + (/Slave: Can\'t find record in \'t1\' Error_code: 1032/ or + /Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452/ + )) or + + # These tests does "kill" on queries, causing sporadic errors when writing to logs + (($testname eq 'rpl.rpl_skip_error' or + $testname eq 'rpl.rpl_err_ignoredtable' or + $testname eq 'binlog.binlog_killed_simulate' or + $testname eq 'binlog.binlog_killed') and + (/Failed to write to mysql\.\w+_log/ + )) or # rpl_bug33931 has deliberate failures ($testname eq 'rpl.rpl_bug33931' and (/Failed during slave.*thread initialization/ )) or - # rpl_temporary has an error on slave that can be ignored - ($testname eq 'rpl.rpl_temporary' and - (/Slave: Can\'t find record in \'user\' Error_code: 1032/ - )) or - + # rpl_temporary has an error on slave that can be ignored + ($testname eq 'rpl.rpl_temporary' and + (/Slave: Can\'t find record in \'user\' Error_code: 1032/ + )) or # Test case for Bug#31590 produces the following error: /Out of sort memory; increase server sort buffer size/ or @@ -412,8 +411,18 @@ sub mtr_report_stats ($) { # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ - ) + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # maria-recovery.test has warning about missing log file + /File '.*maria_log.000.*' not found \(Errcode: 2\)/ or + # and about marked-corrupted table + /Table '..mysqltest.t_corrupted1' is crashed, skipping it. Please repair it with maria_chk -r/ or + # maria-recover.test corrupts tables on purpose + /Checking table: '..mysqltest.t_corrupted2'/ or + /Recovering table: '..mysqltest.t_corrupted2'/ or + /Table '..mysqltest.t_corrupted2' is marked as crashed and should be repaired/ or + /Incorrect key file for table '..mysqltest.t_corrupted2.MAI'; try to repair it/ + ) { next; # Skip these lines } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index b342421ca2e..530d8cd83cb 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -135,7 +135,7 @@ our $default_vardir; our $opt_usage; our $opt_suites; -our $opt_suites_default= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run +our $opt_suites_default= "main,binlog,rpl,rpl_ndb,ndb,maria"; # Default suites to run our $opt_script_debug= 0; # Script debugging, enable with --script-debug our $opt_verbose= 0; # Verbose output, enable with --verbose @@ -173,6 +173,7 @@ our @opt_combinations; our $opt_skip_combination; our @opt_extra_mysqld_opt; +our @opt_extra_mysqltest_opt; our $opt_compress; our $opt_ssl; @@ -432,7 +433,7 @@ sub main () { my $tests= collect_test_cases($opt_suites); # Turn off NDB and other similar options if no tests use it - my ($need_ndbcluster,$need_im); + my ($need_ndbcluster,$need_im, $need_debug); foreach my $test (@$tests) { next if $test->{skip}; @@ -440,6 +441,7 @@ sub main () { if (!$opt_extern) { $need_ndbcluster||= $test->{ndb_test}; + $need_debug||=$test->{need_debug}; $need_im||= $test->{component_id} eq 'im'; # Count max number of slaves used by a test case @@ -465,6 +467,11 @@ sub main () { $opt_skip_ndbcluster_slave= 1; } + if ( !$need_debug && !$opt_debug) + { + $opt_debug=0; + } + # Check if slave cluster can be skipped if ($max_slave_num == 0) { @@ -601,6 +608,9 @@ sub command_line_setup () { # Extra options used when starting mysqld 'mysqld=s' => \@opt_extra_mysqld_opt, + # Extra options used when starting mysqld + 'mysqltest=s' => \@opt_extra_mysqltest_opt, + # Run test on running server 'extern' => \$opt_extern, 'ndb-connectstring=s' => \$opt_ndbconnectstring, @@ -978,7 +988,7 @@ sub command_line_setup () { # -------------------------------------------------------------------------- if ($opt_extern) { - mtr_report("Disable instance manager when running with extern mysqld"); + # mtr_report("Disable instance manager when running with extern mysqld"); $opt_skip_im= 1; } elsif ( $mysql_version_id < 50000 ) @@ -1351,19 +1361,6 @@ sub command_line_setup () { $path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log"; $path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/"; - - if ( $opt_valgrind and $opt_debug ) - { - # When both --valgrind and --debug is selected, send - # all output to the trace file, making it possible to - # see the exact location where valgrind complains - foreach my $mysqld (@{$master}, @{$slave}) - { - my $sidx= $mysqld->{idx} ? "$mysqld->{idx}" : ""; - $mysqld->{path_myerr}= - "$opt_vardir/log/" . $mysqld->{type} . "$sidx.trace"; - } - } } # @@ -2166,7 +2163,10 @@ sub environment_setup () { $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables; } - $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables; + if ( !$opt_extern ) + { + $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables; + } # ---------------------------------------------------- # Setup env so childs can execute my_print_defaults @@ -2215,6 +2215,22 @@ sub environment_setup () { "$glob_basedir/storage/myisam/myisampack", "$glob_basedir/myisam/myisampack")); + # ---------------------------------------------------- + # Setup env so childs can execute maria_pack and maria_chk + # ---------------------------------------------------- + $ENV{'MARIA_CHK'}= mtr_native_path(mtr_exe_maybe_exists( + vs_config_dirs('storage/maria', 'maria_chk'), + vs_config_dirs('maria', 'maria_chk'), + "$path_client_bindir/maria_chk", + "$glob_basedir/storage/maria/maria_chk", + "$glob_basedir/maria/maria_chk")); + $ENV{'MARIA_PACK'}= mtr_native_path(mtr_exe_maybe_exists( + vs_config_dirs('storage/maria', 'maria_pack'), + vs_config_dirs('maria', 'maria_pack'), + "$path_client_bindir/maria_pack", + "$glob_basedir/storage/maria/maria_pack", + "$glob_basedir/maria/maria_pack")); + # ---------------------------------------------------- # We are nice and report a bit about our settings # ---------------------------------------------------- @@ -2466,6 +2482,25 @@ sub setup_vardir() { { unlink($name); } + if ( $opt_valgrind and $opt_debug ) + { + # When both --valgrind and --debug is selected, send + # all output to the trace file, making it possible to + # see the exact location where valgrind complains + foreach my $mysqld (@{$master}, @{$slave}) + { + my $sidx= $mysqld->{idx} ? "$mysqld->{idx}" : ""; + my $trace_name= "$opt_vardir/log/" . $mysqld->{type} . "$sidx.trace"; + open(LOG, ">$mysqld->{path_myerr}") or die "Can't create $mysqld->{path_myerr}\n"; + print LOG " +NOTE: When running with --valgrind --debug the output from the .err file is +stored together with the trace file to make it easier to find the exact +position for valgrind errors. +See trace file $trace_name.\n"; + close(LOG); + $mysqld->{path_myerr}= $trace_name; + } + } } @@ -3142,8 +3177,8 @@ sub install_db ($$) { mtr_report("Installing \u$type Database"); - my $args; + my $cmd_args; mtr_init_args(\$args); mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--bootstrap"); @@ -3151,9 +3186,17 @@ sub install_db ($$) { mtr_add_arg($args, "--datadir=%s", $data_dir); mtr_add_arg($args, "--loose-skip-innodb"); mtr_add_arg($args, "--loose-skip-ndbcluster"); + mtr_add_arg($args, "--disable-sync-frm"); + mtr_add_arg($args, "--loose-disable-debug"); mtr_add_arg($args, "--tmpdir=."); mtr_add_arg($args, "--core-file"); + # + # Setup args for bootstrap.test + # + mtr_init_args(\$cmd_args); + mtr_add_arg($cmd_args, "--loose-skip-maria"); + if ( $opt_debug ) { mtr_add_arg($args, "--debug=d:t:i:A,%s/log/bootstrap_%s.trace", @@ -3176,7 +3219,8 @@ sub install_db ($$) { # ---------------------------------------------------------------------- # export MYSQLD_BOOTSTRAP_CMD variable containing /mysqld # ---------------------------------------------------------------------- - $ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args); + $ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args) . + " " . join(" ", @$cmd_args); # ---------------------------------------------------------------------- # Create the bootstrap.sql file @@ -3287,9 +3331,11 @@ socket = $instance->{path_sock} pid-file = $instance->{path_pid} port = $instance->{port} datadir = $instance->{path_datadir} -log = $instance->{path_datadir}/mysqld$server_id.log +general-log-file = $instance->{path_datadir}/mysqld$server_id.log +general-log = 1 log-error = $instance->{path_datadir}/mysqld$server_id.err.log -log-slow-queries = $instance->{path_datadir}/mysqld$server_id.slow.log +slow-query-log-file = $instance->{path_datadir}/mysqld$server_id.slow.log +slow-query-log = 1 language = $path_language character-sets-dir = $path_charsetsdir basedir = $path_my_basedir @@ -3353,6 +3399,24 @@ sub run_testcase_check_skip_test($) { my ($tinfo)= @_; + # ---------------------------------------------------------------------- + # Skip some tests silently + # ---------------------------------------------------------------------- + + if ( $::opt_start_from ) + { + if ($tinfo->{'name'} eq $::opt_start_from ) + { + ## Found parting test. Run this test and all tests after this one + $::opt_start_from= ""; + } + else + { + $tinfo->{'result'}= 'MTR_RES_SKIPPED'; + return 1; + } + } + # ---------------------------------------------------------------------- # If marked to skip, just print out and return. # Note that a test case not marked as 'skip' can still be @@ -3886,15 +3950,17 @@ sub mysqld_arguments ($$$$) { mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir); mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir); - if ( $mysql_version_id >= 50036) + if (!$opt_extern) { - # By default, prevent the started mysqld to access files outside of vardir - mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir); - } + if ( $mysql_version_id >= 50036) + { + # Prevent the started mysqld to access files outside of vardir + mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir); + } - if ( $mysql_version_id >= 50000 ) - { - mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix); + if ( $mysql_version_id >= 50000 ) { + mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix); + } } mtr_add_arg($args, "%s--default-character-set=latin1", $prefix); @@ -3937,17 +4003,22 @@ sub mysqld_arguments ($$$$) { mtr_add_arg($args, "%s--datadir=%s", $prefix, $mysqld->{'path_myddir'}); + mtr_add_arg($args, "%s--disable-sync-frm", $prefix); # Faster test - if ( $mysql_version_id >= 50106 ) + if (!$opt_extern and $mysql_version_id >= 50106 ) { # Turn on logging to bothe tables and file mtr_add_arg($args, "%s--log-output=table,file", $prefix); } my $log_base_path= "$opt_vardir/log/$mysqld->{'type'}$sidx"; - mtr_add_arg($args, "%s--log=%s.log", $prefix, $log_base_path); + mtr_add_arg($args, "%s--general-log-file=%s.log", + $prefix, $log_base_path); + mtr_add_arg($args, "--general-log"); mtr_add_arg($args, - "%s--log-slow-queries=%s-slow.log", $prefix, $log_base_path); + "%s--slow-query-log-file=%s-slow.log", + $prefix, $log_base_path); + mtr_add_arg($args, "--slow-query-log"); # Check if "extra_opt" contains --skip-log-bin my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt, @opt_extra_mysqld_opt); @@ -4065,10 +4136,17 @@ sub mysqld_arguments ($$$$) { } # end slave - if ( $opt_debug ) + if ( $debug_compiled_binaries && defined $opt_debug ) { - mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/%s%s.trace", - $prefix, $path_vardir_trace, $mysqld->{'type'}, $sidx); + if ( $opt_debug ) + { + mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/%s%s.trace", + $prefix, $path_vardir_trace, $mysqld->{'type'}, $sidx); + } + else + { + mtr_add_arg($args, "--disable-debug"); + } } mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix); @@ -4923,6 +5001,11 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--skip-ssl"); } + foreach my $arg ( @opt_extra_mysqltest_opt ) + { + mtr_add_arg($args, "%s", $arg); + } + # ---------------------------------------------------------------------- # If embedded server, we create server args to give mysqltest to pass on # ---------------------------------------------------------------------- @@ -5038,13 +5121,9 @@ sub gdb_arguments { else { # write init file for mysqld - mtr_tofile($gdb_init_file, - "set args $str\n" . - "break mysql_parse\n" . - "commands 1\n" . - "disable 1\n" . - "end\n" . - "run"); + mtr_tofile($gdb_init_file, <='2008-08-01'; +1 +1 +drop table t1; +show warnings; +Level Code Message diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 5f8c59b9a0c..d4e3243733a 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1433,7 +1433,7 @@ insert t2 select * from t1; insert t3 select * from t1; checksum table t1, t2, t3, t4 quick; Table Checksum -test.t1 2948697075 +test.t1 3442722830 test.t2 NULL test.t3 NULL test.t4 NULL @@ -1441,17 +1441,17 @@ Warnings: Error 1146 Table 'test.t4' doesn't exist checksum table t1, t2, t3, t4; Table Checksum -test.t1 2948697075 -test.t2 2948697075 -test.t3 2948697075 +test.t1 3442722830 +test.t2 3442722830 +test.t3 3442722830 test.t4 NULL Warnings: Error 1146 Table 'test.t4' doesn't exist checksum table t1, t2, t3, t4 extended; Table Checksum -test.t1 2948697075 -test.t2 2948697075 -test.t3 2948697075 +test.t1 3442722830 +test.t2 3442722830 +test.t3 3442722830 test.t4 NULL Warnings: Error 1146 Table 'test.t4' doesn't exist diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index cc05efded02..7d8f052ef84 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -1,3 +1,5 @@ +set global storage_engine=myisam; +set session storage_engine=myisam; drop table if exists t1,t2,t3,t4,t5,t6; drop database if exists mysqltest; create table t1 (a int not null primary key auto_increment, message char(20)); diff --git a/mysql-test/r/mix2_myisam.result b/mysql-test/r/mix2_myisam.result index cabc4de8d21..e0a3d1af089 100644 --- a/mysql-test/r/mix2_myisam.result +++ b/mysql-test/r/mix2_myisam.result @@ -1232,34 +1232,34 @@ insert t5 select * from t1; insert t6 select * from t1; checksum table t1, t2, t3, t4, t5, t6, t7 quick; Table Checksum -test.t1 2948697075 +test.t1 3442722830 test.t2 NULL test.t3 NULL test.t4 NULL -test.t5 2948697075 +test.t5 3442722830 test.t6 NULL test.t7 NULL Warnings: Error 1146 Table 'test.t7' doesn't exist checksum table t1, t2, t3, t4, t5, t6, t7; Table Checksum -test.t1 2948697075 -test.t2 2948697075 -test.t3 2948697075 -test.t4 2948697075 -test.t5 2948697075 -test.t6 2948697075 +test.t1 3442722830 +test.t2 3442722830 +test.t3 3442722830 +test.t4 3442722830 +test.t5 3442722830 +test.t6 3442722830 test.t7 NULL Warnings: Error 1146 Table 'test.t7' doesn't exist checksum table t1, t2, t3, t4, t5, t6, t7 extended; Table Checksum -test.t1 2948697075 -test.t2 2948697075 -test.t3 2948697075 -test.t4 2948697075 -test.t5 2948697075 -test.t6 2948697075 +test.t1 3442722830 +test.t2 3442722830 +test.t3 3442722830 +test.t4 3442722830 +test.t5 3442722830 +test.t6 3442722830 test.t7 NULL Warnings: Error 1146 Table 'test.t7' doesn't exist diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 553a9f36690..241be890952 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2; +drop table if exists t1,t2,t3; SET SQL_WARNINGS=1; CREATE TABLE t1 ( STRING_DATA char(255) default NULL, @@ -551,22 +551,22 @@ insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); insert t2 select * from t1; checksum table t1, t2, t3 quick; Table Checksum -test.t1 2948697075 +test.t1 3442722830 test.t2 NULL test.t3 NULL Warnings: Error 1146 Table 'test.t3' doesn't exist checksum table t1, t2, t3; Table Checksum -test.t1 2948697075 -test.t2 2948697075 +test.t1 3442722830 +test.t2 3442722830 test.t3 NULL Warnings: Error 1146 Table 'test.t3' doesn't exist checksum table t1, t2, t3 extended; Table Checksum -test.t1 2948697075 -test.t2 2948697075 +test.t1 3442722830 +test.t2 3442722830 test.t3 NULL Warnings: Error 1146 Table 'test.t3' doesn't exist @@ -2226,4 +2226,29 @@ Key Start Len Index Type 1 2 30 multip. varchar 2 33 30 multip. char NULL DROP TABLE t1; +create table t1 (n int not null, c char(1)) transactional=1; +Warnings: +Error 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1' +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `n` int(11) NOT NULL, + `c` char(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 TRANSACTIONAL=1 +drop table t1; +CREATE TABLE t1 (line LINESTRING NOT NULL) engine=myisam; +INSERT INTO t1 VALUES (GeomFromText("POINT(0 0)")); +checksum table t1; +Table Checksum +test.t1 326284887 +CREATE TABLE t2 (line LINESTRING NOT NULL) engine=myisam; +INSERT INTO t2 VALUES (GeomFromText("POINT(0 0)")); +checksum table t2; +Table Checksum +test.t2 326284887 +CREATE TABLE t3 select * from t1; +checksum table t3; +Table Checksum +test.t3 326284887 +drop table t1,t2,t3; End of 5.1 tests diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index ec397d8fb89..83d5ec284c1 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -728,7 +728,7 @@ DROP TABLE t1; # # Test for --insert-ignore # -CREATE TABLE t1 (a int); +CREATE TABLE t1 (a int) ENGINE=MyISAM; INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t1 VALUES (4),(5),(6); @@ -3649,8 +3649,8 @@ CREATE TABLE t1(a int); INSERT INTO t1 VALUES (1), (2); mysqldump: Input filename too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DROP TABLE t1; -CREATE TABLE t2 (a int); -CREATE TABLE t3 (a int); +CREATE TABLE t2 (a int) ENGINE=MyISAM; +CREATE TABLE t3 (a int) ENGINE=MyISAM; CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3); /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; diff --git a/mysql-test/r/old-mode.result b/mysql-test/r/old-mode.result new file mode 100644 index 00000000000..a9815d7dab2 --- /dev/null +++ b/mysql-test/r/old-mode.result @@ -0,0 +1,18 @@ +drop table if exists t1,t2; +create table t1 (a int, b varchar(200), c text not null) checksum=1; +create table t2 (a int, b varchar(200), c text not null) checksum=0; +insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); +insert t2 select * from t1; +checksum table t1, t2; +Table Checksum +test.t1 2948697075 +test.t2 2948697075 +checksum table t1, t2 quick; +Table Checksum +test.t1 NULL +test.t2 NULL +checksum table t1, t2 extended; +Table Checksum +test.t1 2948697075 +test.t2 2948697075 +drop table t1,t2; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 0888b78618f..4e732db493e 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1755,7 +1755,7 @@ set @arg14= 'abc'; set @arg14= NULL ; set @arg15= CAST('abc' as binary) ; set @arg15= NULL ; -create table t5 as select +create table t5 engine = MyISAM as select 8 as const01, @arg01 as param01, 8.0 as const02, @arg02 as param02, 80.00000000000e-1 as const03, @arg03 as param03, diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index e5a57131b01..bddb160189f 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1738,7 +1738,7 @@ set @arg14= 'abc'; set @arg14= NULL ; set @arg15= CAST('abc' as binary) ; set @arg15= NULL ; -create table t5 as select +create table t5 engine = MyISAM as select 8 as const01, @arg01 as param01, 8.0 as const02, @arg02 as param02, 80.00000000000e-1 as const03, @arg03 as param03, diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 2c83916e952..6072e6e771e 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1739,7 +1739,7 @@ set @arg14= 'abc'; set @arg14= NULL ; set @arg15= CAST('abc' as binary) ; set @arg15= NULL ; -create table t5 as select +create table t5 engine = MyISAM as select 8 as const01, @arg01 as param01, 8.0 as const02, @arg02 as param02, 80.00000000000e-1 as const03, @arg03 as param03, diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 0348d100393..fde309d82e4 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1675,7 +1675,7 @@ set @arg14= 'abc'; set @arg14= NULL ; set @arg15= CAST('abc' as binary) ; set @arg15= NULL ; -create table t5 as select +create table t5 engine = MyISAM as select 8 as const01, @arg01 as param01, 8.0 as const02, @arg02 as param02, 80.00000000000e-1 as const03, @arg03 as param03, @@ -4696,7 +4696,7 @@ set @arg14= 'abc'; set @arg14= NULL ; set @arg15= CAST('abc' as binary) ; set @arg15= NULL ; -create table t5 as select +create table t5 engine = MyISAM as select 8 as const01, @arg01 as param01, 8.0 as const02, @arg02 as param02, 80.00000000000e-1 as const03, @arg03 as param03, diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 34c86d6c8c6..44ceb7ac159 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -42,9 +42,9 @@ drop table t1; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 -create table t1 (a int not null); +create table t1 (a int not null) ENGINE=MyISAM; insert into t1 values (1),(2),(3); -create table t2 (a int not null); +create table t2 (a int not null) ENGINE=MyISAM; insert into t2 values (4),(5),(6); create table t3 (a int not null) engine=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST; select * from t3; @@ -460,7 +460,7 @@ Qcache_queries_in_cache 2 drop table t1; flush query cache; reset query cache; -create table t1 (a int not null); +create table t1 (a int not null) ENGINE=MyISAM; insert into t1 values (1),(2),(3); select * from t1; a diff --git a/mysql-test/r/row-checksum-old.result b/mysql-test/r/row-checksum-old.result new file mode 100644 index 00000000000..3cf5a7104b9 --- /dev/null +++ b/mysql-test/r/row-checksum-old.result @@ -0,0 +1,85 @@ +drop table if exists t1; +create table t1 (a int null, v varchar(100)) engine=myisam checksum=0; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 452555338 +checksum table t1 quick; +Table Checksum +test.t1 NULL +checksum table t1 extended; +Table Checksum +test.t1 452555338 +drop table if exists t1; +create table t1 (a int null, v varchar(100)) engine=myisam checksum=1; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 452555338 +checksum table t1 quick; +Table Checksum +test.t1 NULL +checksum table t1 extended; +Table Checksum +test.t1 452555338 +drop table if exists t1; +create table t1 (a int null, v varchar(100)) engine=innodb checksum=0; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 452555338 +checksum table t1 quick; +Table Checksum +test.t1 NULL +checksum table t1 extended; +Table Checksum +test.t1 452555338 +drop table t1; +create table t1 (a int null, v varchar(100)) engine=maria checksum=0; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 452555338 +checksum table t1 quick; +Table Checksum +test.t1 NULL +checksum table t1 extended; +Table Checksum +test.t1 452555338 +drop table t1; +create table t1 (a int null, v varchar(100)) engine=maria checksum=1; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 452555338 +checksum table t1 quick; +Table Checksum +test.t1 NULL +checksum table t1 extended; +Table Checksum +test.t1 452555338 +drop table t1; +create table t1 (a int null, v varchar(100)) engine=myisam checksum=1 row_format=fixed; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 4108368782 +checksum table t1 quick; +Table Checksum +test.t1 NULL +checksum table t1 extended; +Table Checksum +test.t1 4108368782 +drop table if exists t1; +create table t1 (a int null, v varchar(100)) engine=innodb checksum=0 row_format=fixed; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 4108368782 +checksum table t1 quick; +Table Checksum +test.t1 NULL +checksum table t1 extended; +Table Checksum +test.t1 4108368782 +drop table t1; diff --git a/mysql-test/r/row-checksum.result b/mysql-test/r/row-checksum.result new file mode 100644 index 00000000000..31ae094859b --- /dev/null +++ b/mysql-test/r/row-checksum.result @@ -0,0 +1,85 @@ +drop table if exists t1; +create table t1 (a int null, v varchar(100)) engine=myisam checksum=0; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 229851577 +checksum table t1 quick; +Table Checksum +test.t1 NULL +checksum table t1 extended; +Table Checksum +test.t1 229851577 +drop table if exists t1; +create table t1 (a int null, v varchar(100)) engine=myisam checksum=1; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 229851577 +checksum table t1 quick; +Table Checksum +test.t1 229851577 +checksum table t1 extended; +Table Checksum +test.t1 229851577 +drop table if exists t1; +create table t1 (a int null, v varchar(100)) engine=innodb checksum=0; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 229851577 +checksum table t1 quick; +Table Checksum +test.t1 NULL +checksum table t1 extended; +Table Checksum +test.t1 229851577 +drop table t1; +create table t1 (a int null, v varchar(100)) engine=maria checksum=0; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 229851577 +checksum table t1 quick; +Table Checksum +test.t1 NULL +checksum table t1 extended; +Table Checksum +test.t1 229851577 +drop table t1; +create table t1 (a int null, v varchar(100)) engine=maria checksum=1; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 229851577 +checksum table t1 quick; +Table Checksum +test.t1 229851577 +checksum table t1 extended; +Table Checksum +test.t1 229851577 +drop table t1; +create table t1 (a int null, v varchar(100)) engine=myisam checksum=1 row_format=fixed; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 3885665021 +checksum table t1 quick; +Table Checksum +test.t1 3885665021 +checksum table t1 extended; +Table Checksum +test.t1 3885665021 +drop table if exists t1; +create table t1 (a int null, v varchar(100)) engine=innodb checksum=0 row_format=fixed; +insert into t1 values(null, null), (1, "hello"); +checksum table t1; +Table Checksum +test.t1 3885665021 +checksum table t1 quick; +Table Checksum +test.t1 NULL +checksum table t1 extended; +Table Checksum +test.t1 3885665021 +drop table t1; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index c1c81847b13..f54374166b4 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -626,8 +626,8 @@ a b 33 10 22 11 drop table t11, t12, t2; -CREATE TABLE t1 (x int); -create table t2 (a int); +CREATE TABLE t1 (x int) ENGINE=MyISAM; +create table t2 (a int) ENGINE=MyISAM; create table t3 (b int); insert into t2 values (1); insert into t3 values (1),(2); @@ -674,7 +674,7 @@ x 11 2 drop table t1, t2, t3; -CREATE TABLE t1 (x int not null, y int, primary key (x)); +CREATE TABLE t1 (x int not null, y int, primary key (x)) ENGINE=MyISAM; create table t2 (a int); create table t3 (a int); insert into t2 values (1); diff --git a/mysql-test/r/subselect_debug.result b/mysql-test/r/subselect_debug.result index 9ba552bbdf7..37a5c82a9f8 100644 --- a/mysql-test/r/subselect_debug.result +++ b/mysql-test/r/subselect_debug.result @@ -1,6 +1,7 @@ CREATE TABLE t1(id INT); INSERT INTO t1 VALUES (1),(2),(3),(4); INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d; +SET @orig_debug=@@debug; SET SESSION debug="d,subselect_exec_fail"; SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1; SUM(EXISTS(SELECT RAND() FROM t1)) @@ -8,5 +9,5 @@ SUM(EXISTS(SELECT RAND() FROM t1)) SELECT REVERSE(EXISTS(SELECT RAND() FROM t1)); REVERSE(EXISTS(SELECT RAND() FROM t1)) 0 -SET SESSION debug=DEFAULT; +SET SESSION debug=@orig_debug; DROP TABLE t1; diff --git a/mysql-test/r/sync_frm_basic.result b/mysql-test/r/sync_frm_basic.result index 9792307d17f..2467ea15e7c 100644 --- a/mysql-test/r/sync_frm_basic.result +++ b/mysql-test/r/sync_frm_basic.result @@ -1,7 +1,7 @@ SET @start_value = @@global.sync_frm; SELECT @start_value; @start_value -1 +VAL '#--------------------FN_DYNVARS_169_01------------------------#' SET @@global.sync_frm = FALSE; SET @@global.sync_frm = DEFAULT; @@ -94,4 +94,4 @@ ERROR 42S22: Unknown column 'sync_frm' in 'field list' SET @@global.sync_frm = @start_value; SELECT @@global.sync_frm; @@global.sync_frm -1 +VAL diff --git a/mysql-test/r/variables-big.result b/mysql-test/r/variables-big.result index ae1e20109b9..35882c7e284 100644 --- a/mysql-test/r/variables-big.result +++ b/mysql-test/r/variables-big.result @@ -1,20 +1,20 @@ set session transaction_prealloc_size=1024*1024*1024*1; show processlist; Id User Host db Command Time State Info -1 root localhost test Query 0 NULL show processlist +# root localhost test Query 0 NULL show processlist set session transaction_prealloc_size=1024*1024*1024*2; show processlist; Id User Host db Command Time State Info -1 root localhost test Query 0 NULL show processlist +# root localhost test Query 0 NULL show processlist set session transaction_prealloc_size=1024*1024*1024*3; show processlist; Id User Host db Command Time State Info -1 root localhost test Query 0 NULL show processlist +# root localhost test Query 0 NULL show processlist set session transaction_prealloc_size=1024*1024*1024*4; show processlist; Id User Host db Command Time State Info -1 root localhost test Query 0 NULL show processlist +# root localhost test Query 0 NULL show processlist set session transaction_prealloc_size=1024*1024*1024*5; show processlist; Id User Host db Command Time State Info -1 root localhost test Query 0 NULL show processlist +# root localhost test Query 0 NULL show processlist diff --git a/mysql-test/suite/funcs_1/datadict/is_routines.inc b/mysql-test/suite/funcs_1/datadict/is_routines.inc index 28a849e9df5..f81e8ef7c3a 100644 --- a/mysql-test/suite/funcs_1/datadict/is_routines.inc +++ b/mysql-test/suite/funcs_1/datadict/is_routines.inc @@ -75,6 +75,7 @@ eval SHOW TABLES FROM information_schema LIKE '$is_table'; --source suite/funcs_1/datadict/datadict_bug_12777.inc eval DESCRIBE information_schema.$is_table; --source suite/funcs_1/datadict/datadict_bug_12777.inc +--replace_result ENGINE=MyISAM "" ENGINE=MARIA "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" "" eval SHOW CREATE TABLE information_schema.$is_table; --source suite/funcs_1/datadict/datadict_bug_12777.inc eval SHOW COLUMNS FROM information_schema.$is_table; diff --git a/mysql-test/suite/funcs_1/datadict/is_triggers.inc b/mysql-test/suite/funcs_1/datadict/is_triggers.inc index 3b83a75295b..df3e6e7d2b6 100644 --- a/mysql-test/suite/funcs_1/datadict/is_triggers.inc +++ b/mysql-test/suite/funcs_1/datadict/is_triggers.inc @@ -70,6 +70,7 @@ eval SHOW TABLES FROM information_schema LIKE '$is_table'; --source suite/funcs_1/datadict/datadict_bug_12777.inc eval DESCRIBE information_schema.$is_table; --source suite/funcs_1/datadict/datadict_bug_12777.inc +--replace_result ENGINE=MyISAM "" ENGINE=MARIA "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" "" eval SHOW CREATE TABLE information_schema.$is_table; --source suite/funcs_1/datadict/datadict_bug_12777.inc eval SHOW COLUMNS FROM information_schema.$is_table; diff --git a/mysql-test/suite/funcs_1/datadict/is_views.inc b/mysql-test/suite/funcs_1/datadict/is_views.inc index 32e66e4f684..b04904c2eba 100644 --- a/mysql-test/suite/funcs_1/datadict/is_views.inc +++ b/mysql-test/suite/funcs_1/datadict/is_views.inc @@ -57,6 +57,7 @@ eval SHOW TABLES FROM information_schema LIKE '$is_table'; --source suite/funcs_1/datadict/datadict_bug_12777.inc eval DESCRIBE information_schema.$is_table; --source suite/funcs_1/datadict/datadict_bug_12777.inc +--replace_result ENGINE=MyISAM "" ENGINE=MARIA "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" "" eval SHOW CREATE TABLE information_schema.$is_table; --source suite/funcs_1/datadict/datadict_bug_12777.inc eval SHOW COLUMNS FROM information_schema.$is_table; diff --git a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc index d8e1b398bfc..9c0ebda24b6 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc @@ -135,6 +135,7 @@ let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE DB = 'information_schema' AND COMMAND = 'Sleep' AND USER = 'ddicttestuser1'; --source include/wait_condition.inc +--replace_result ENGINE=MyISAM "" ENGINE=MARIA "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" "" eval SHOW CREATE TABLE $table; --replace_column 1 ID 3 HOST_NAME 6 TIME eval SHOW $table; @@ -143,6 +144,7 @@ eval SELECT * FROM $table $select_where ORDER BY id; --replace_column 1 ID 3 HOST_NAME 6 TIME eval SELECT $columns FROM $table $select_where ORDER BY id; --source suite/funcs_1/datadict/datadict_priv.inc +--real_sleep 0.3 --echo #################################################################################### @@ -153,6 +155,7 @@ connection con100; # No need for poll routine here. # The current state of the default session might depend on load of testing box # but "ddicttestuser1" must not see anything of the root session. +--replace_result ENGINE=MyISAM "" ENGINE=MARIA "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" "" eval SHOW CREATE TABLE $table; --replace_column 1 ID 3 HOST_NAME 6 TIME eval SHOW $table; diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc index c34fb626bcd..ee5347fa529 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc @@ -72,6 +72,7 @@ echo # Show the definition of the PROCESSLIST table #-------------------------------------------------------------------------- ; +--replace_result ENGINE=MyISAM "" ENGINE=MARIA "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" "" SHOW CREATE TABLE INFORMATION_SCHEMA.PROCESSLIST; echo diff --git a/mysql-test/suite/funcs_1/datadict/tables2.inc b/mysql-test/suite/funcs_1/datadict/tables2.inc index 6442aab493c..f9bb296eeaa 100644 --- a/mysql-test/suite/funcs_1/datadict/tables2.inc +++ b/mysql-test/suite/funcs_1/datadict/tables2.inc @@ -31,6 +31,7 @@ let $ndb_pattern = 'number_of_replicas'; --vertical_results # We do not unify the engine name here, because the rowformat is # specific to the engine. +--replace_result Dynamic DYNAMIC_OR_PAGE Page DYNAMIC_OR_PAGE MyISAM MYISAM_OR_MARIA MARIA MYISAM_OR_MARIA --replace_column 8 "#TBLR#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT#" 16 "#UT#" 17 "#CT#" 20 "#CO#" 21 "#TC#" eval SELECT *, diff --git a/mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result b/mysql-test/suite/funcs_1/r/is_collation_charset_applic.result similarity index 100% rename from mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result rename to mysql-test/suite/funcs_1/r/is_collation_charset_applic.result diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result index e0780a60e2e..7901902e729 100644 --- a/mysql-test/suite/funcs_1/r/is_columns.result +++ b/mysql-test/suite/funcs_1/r/is_columns.result @@ -69,7 +69,7 @@ COLUMNS CREATE TEMPORARY TABLE `COLUMNS` ( `EXTRA` varchar(27) NOT NULL DEFAULT '', `PRIVILEGES` varchar(80) NOT NULL DEFAULT '', `COLUMN_COMMENT` varchar(255) NOT NULL DEFAULT '' -) ENGINE=MyISAM DEFAULT CHARSET=utf8 +) DEFAULT CHARSET=utf8 SHOW COLUMNS FROM information_schema.COLUMNS; Field Type Null Key Default Extra TABLE_CATALOG varchar(512) YES NULL diff --git a/mysql-test/suite/funcs_1/r/is_events.result b/mysql-test/suite/funcs_1/r/is_events.result index 6dfe5899bf4..69ff40b304e 100644 --- a/mysql-test/suite/funcs_1/r/is_events.result +++ b/mysql-test/suite/funcs_1/r/is_events.result @@ -79,7 +79,7 @@ EVENTS CREATE TEMPORARY TABLE `EVENTS` ( `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' -) ENGINE=MyISAM DEFAULT CHARSET=utf8 +) DEFAULT CHARSET=utf8 SHOW COLUMNS FROM information_schema.EVENTS; Field Type Null Key Default Extra EVENT_CATALOG varchar(64) YES NULL diff --git a/mysql-test/suite/funcs_1/r/is_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result index e7a900f5c0b..bc0b1c655ca 100644 --- a/mysql-test/suite/funcs_1/r/is_routines.result +++ b/mysql-test/suite/funcs_1/r/is_routines.result @@ -77,7 +77,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' -) ENGINE=MyISAM DEFAULT CHARSET=utf8 +) DEFAULT CHARSET=utf8 SHOW COLUMNS FROM information_schema.ROUTINES; Field Type Null Key Default Extra SPECIFIC_NAME varchar(64) NO diff --git a/mysql-test/suite/funcs_1/r/is_tables_is.result b/mysql-test/suite/funcs_1/r/is_tables_is.result index 83eaef22e0c..59e5c6ecf57 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_is.result +++ b/mysql-test/suite/funcs_1/r/is_tables_is.result @@ -86,9 +86,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME COLUMNS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -155,9 +155,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME EVENTS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -270,9 +270,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME PARTITIONS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -293,9 +293,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME PLUGINS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -316,9 +316,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME PROCESSLIST TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -362,9 +362,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME ROUTINES TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -569,9 +569,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME TRIGGERS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -615,9 +615,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME VIEWS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -724,9 +724,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME COLUMNS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -793,9 +793,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME EVENTS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -908,9 +908,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME PARTITIONS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -931,9 +931,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME PLUGINS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -954,9 +954,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME PROCESSLIST TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -1000,9 +1000,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME ROUTINES TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -1207,9 +1207,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME TRIGGERS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -1253,9 +1253,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA information_schema TABLE_NAME VIEWS TABLE_TYPE SYSTEM VIEW -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# diff --git a/mysql-test/suite/funcs_1/r/is_tables_myisam.result b/mysql-test/suite/funcs_1/r/is_tables_myisam.result index 0f476309303..59673fcbf45 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_myisam.result +++ b/mysql-test/suite/funcs_1/r/is_tables_myisam.result @@ -19,12 +19,12 @@ FROM information_schema.tables WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' ORDER BY table_schema,table_name; TABLE_CATALOG NULL -TABLE_SCHEMA test1 +TABLE_SCHEMA test TABLE_NAME t1 TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -42,12 +42,58 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test1 +TABLE_SCHEMA test +TABLE_NAME t10 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t11 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test TABLE_NAME t2 TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -65,12 +111,242 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test2 -TABLE_NAME t1 +TABLE_SCHEMA test +TABLE_NAME t3 TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t4 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t7 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t8 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t9 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb1 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb2 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb3 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb4 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test1 +TABLE_NAME tb2 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test4 +TABLE_NAME t6 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -111,12 +387,12 @@ FROM information_schema.tables WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' ORDER BY table_schema,table_name; TABLE_CATALOG NULL -TABLE_SCHEMA test1 +TABLE_SCHEMA test TABLE_NAME t1 TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -134,12 +410,265 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test1 +TABLE_SCHEMA test +TABLE_NAME t10 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t11 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test TABLE_NAME t2 TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t3 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t4 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t7 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t8 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t9 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb1 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb2 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb3 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb4 +TABLE_TYPE BASE TABLE +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result index 4b33009904f..b41318d9bae 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result @@ -16,7 +16,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME columns_priv TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -39,7 +39,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME db TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -62,9 +62,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME event TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -85,7 +85,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME func TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -110,7 +110,7 @@ TABLE_NAME general_log TABLE_TYPE BASE TABLE ENGINE CSV VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -131,7 +131,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME help_category TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -154,7 +154,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME help_keyword TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -177,7 +177,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME help_relation TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -200,9 +200,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME help_topic TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -223,7 +223,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME host TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -246,9 +246,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME ndb_binlog_index TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -269,7 +269,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME plugin TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -292,9 +292,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME proc TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -315,7 +315,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME procs_priv TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -338,7 +338,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME servers TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -363,7 +363,7 @@ TABLE_NAME slow_log TABLE_TYPE BASE TABLE ENGINE CSV VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -384,7 +384,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME tables_priv TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -407,7 +407,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME time_zone TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -430,7 +430,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME time_zone_leap_second TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -453,7 +453,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME time_zone_name TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -476,7 +476,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME time_zone_transition TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -499,7 +499,7 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME time_zone_transition_type TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 ROW_FORMAT Fixed TABLE_ROWS #TBLR# @@ -522,9 +522,9 @@ TABLE_CATALOG NULL TABLE_SCHEMA mysql TABLE_NAME user TABLE_TYPE BASE TABLE -ENGINE MyISAM +ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Dynamic +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result index edf4a9e5032..5940e900a37 100644 --- a/mysql-test/suite/funcs_1/r/is_triggers.result +++ b/mysql-test/suite/funcs_1/r/is_triggers.result @@ -75,7 +75,7 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` ( `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' -) ENGINE=MyISAM DEFAULT CHARSET=utf8 +) DEFAULT CHARSET=utf8 SHOW COLUMNS FROM information_schema.TRIGGERS; Field Type Null Key Default Extra TRIGGER_CATALOG varchar(512) YES NULL diff --git a/mysql-test/suite/funcs_1/r/is_views.result b/mysql-test/suite/funcs_1/r/is_views.result index f960c26b21d..0cce7a83d62 100644 --- a/mysql-test/suite/funcs_1/r/is_views.result +++ b/mysql-test/suite/funcs_1/r/is_views.result @@ -51,7 +51,7 @@ VIEWS CREATE TEMPORARY TABLE `VIEWS` ( `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '' -) ENGINE=MyISAM DEFAULT CHARSET=utf8 +) DEFAULT CHARSET=utf8 SHOW COLUMNS FROM information_schema.VIEWS; Field Type Null Key Default Extra TABLE_CATALOG varchar(512) YES NULL diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result index d862b7424e0..b1e1cbbc4a9 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result @@ -30,7 +30,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( `TIME` bigint(7) NOT NULL DEFAULT '0', `STATE` varchar(64) DEFAULT NULL, `INFO` longtext -) ENGINE=MyISAM DEFAULT CHARSET=utf8 +) DEFAULT CHARSET=utf8 SHOW processlist; Id User Host db Command Time State Info ID root HOST_NAME information_schema Query TIME NULL SHOW processlist @@ -100,7 +100,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( `TIME` bigint(7) NOT NULL DEFAULT '0', `STATE` varchar(64) DEFAULT NULL, `INFO` longtext -) ENGINE=MyISAM DEFAULT CHARSET=utf8 +) DEFAULT CHARSET=utf8 SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result index 56230a0f806..e9aef731ade 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result @@ -30,7 +30,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( `TIME` bigint(7) NOT NULL DEFAULT '0', `STATE` varchar(64) DEFAULT NULL, `INFO` longtext -) ENGINE=MyISAM DEFAULT CHARSET=utf8 +) DEFAULT CHARSET=utf8 SHOW processlist; Id User Host db Command Time State Info ID root HOST_NAME information_schema Query TIME NULL SHOW processlist @@ -100,7 +100,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( `TIME` bigint(7) NOT NULL DEFAULT '0', `STATE` varchar(64) DEFAULT NULL, `INFO` longtext -) ENGINE=MyISAM DEFAULT CHARSET=utf8 +) DEFAULT CHARSET=utf8 SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist diff --git a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result index 482e143fd23..6edcd98784d 100644 --- a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result +++ b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result @@ -20,240 +20,139 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( `TIME` bigint(7) NOT NULL DEFAULT '0', `STATE` varchar(64) DEFAULT NULL, `INFO` longtext -) ENGINE=MyISAM DEFAULT CHARSET=utf8 -# Ensure that the information about the own connection is correct. -#-------------------------------------------------------------------------- - +) DEFAULT CHARSET=utf8 +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST; +COUNT(*) +1 +USE test; SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ID USER HOST DB COMMAND TIME STATE INFO - root test Query