From 689a32385ae0857aa52e77c693f3212b5eb01734 Mon Sep 17 00:00:00 2001 From: "thek@kpdesk.mysql.com" <> Date: Mon, 6 Nov 2006 11:41:52 +0100 Subject: [PATCH 01/24] Bug#23010 _my_b_read() passing illegal file handles to my_seek() - The io cache flag seek_not_done was not set properly in the reinit_io_cache function call and this led my_seek to be called desipite an invalid file handle. - Added a test in reinit_io_cache to ensure we have a valid file handle before setting seek_not_done flag. --- mysys/mf_iocache.c | 6 +++++- mysys/my_seek.c | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index a7937da0cc2..5f0069d9bed 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -313,7 +313,11 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, if (info->type == READ_CACHE) { info->write_end=info->write_buffer+info->buffer_length; - info->seek_not_done=1; + /* + Trigger a new seek only if we have a valid + file handle. + */ + info->seek_not_done= (info->file >= 0); } info->end_of_file = ~(my_off_t) 0; } diff --git a/mysys/my_seek.c b/mysys/my_seek.c index ec24a26b3d9..f47383b7ace 100644 --- a/mysys/my_seek.c +++ b/mysys/my_seek.c @@ -30,6 +30,11 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, whence, MyFlags)); DBUG_ASSERT(pos != MY_FILEPOS_ERROR); /* safety check */ + /* + Make sure we are using a valid file descriptor + */ + DBUG_ASSERT(fd >= 0); + newpos=lseek(fd, pos, whence); if (newpos == (os_off_t) -1) { From 438d4631452671d4475021741d548fe4cf228ec3 Mon Sep 17 00:00:00 2001 From: "df@kahlann.erinye.com" <> Date: Wed, 6 Dec 2006 09:17:08 +0100 Subject: [PATCH 02/24] build fix for instance manager build on aix and hpux --- server-tools/instance-manager/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-tools/instance-manager/Makefile.am b/server-tools/instance-manager/Makefile.am index 2d2365caa44..b401686adfe 100644 --- a/server-tools/instance-manager/Makefile.am +++ b/server-tools/instance-manager/Makefile.am @@ -61,7 +61,7 @@ client_settings.h: libexec_PROGRAMS= mysqlmanager -mysqlmanager_CXXFLAGS= -Wall -W +mysqlmanager_CXXFLAGS= mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \ manager.h manager.cc log.h log.cc \ From 9746070d4b966769dd80dcfa2d4a3135b73fbc7c Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Wed, 6 Dec 2006 09:54:21 +0100 Subject: [PATCH 03/24] log_event.cc: On Windows, byte != char --- sql/log_event.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 44cba324a02..8afc1f387bb 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5558,8 +5558,8 @@ unpack_row(RELAY_LOG_INFO *rli, if (bitmap_is_set(cols, field_ptr - begin_ptr)) { - DBUG_ASSERT(table->record[0] <= f->ptr); - DBUG_ASSERT(f->ptr < (table->record[0] + table->s->reclength + + DBUG_ASSERT((const char *)table->record[0] <= f->ptr); + DBUG_ASSERT(f->ptr < ((const char *)table->record[0] + table->s->reclength + (f->pack_length_in_rec() == 0))); DBUG_PRINT("info", ("unpacking column '%s' to 0x%lx", f->field_name, @@ -6843,8 +6843,8 @@ static int find_and_fetch_row(TABLE *table, byte *key) trigger false warnings. */ #ifndef HAVE_purify - DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength); - DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength); + DBUG_DUMP("table->record[0]", (const char *)table->record[0], table->s->reclength); + DBUG_DUMP("table->record[1]", (const char *)table->record[1], table->s->reclength); #endif /* @@ -6870,8 +6870,8 @@ static int find_and_fetch_row(TABLE *table, byte *key) trigger false warnings. */ #ifndef HAVE_purify - DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength); - DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength); + DBUG_DUMP("table->record[0]", (const char *)table->record[0], table->s->reclength); + DBUG_DUMP("table->record[1]", (const char *)table->record[1], table->s->reclength); #endif /* Below is a minor "optimization". If the key (i.e., key number From 3cdcd684f3df6eae316cf9156bf25ed766429885 Mon Sep 17 00:00:00 2001 From: "df@kahlann.erinye.com" <> Date: Wed, 6 Dec 2006 14:23:10 +0100 Subject: [PATCH 04/24] stole magnus' fix for random im test failures from 5.1-maint --- server-tools/instance-manager/guardian.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/server-tools/instance-manager/guardian.cc b/server-tools/instance-manager/guardian.cc index e601ce0111c..812e5fad9e0 100644 --- a/server-tools/instance-manager/guardian.cc +++ b/server-tools/instance-manager/guardian.cc @@ -67,6 +67,7 @@ Guardian::Guardian(Thread_registry *thread_registry_arg, monitoring_interval(monitoring_interval_arg), thread_registry(thread_registry_arg), instance_map(instance_map_arg), + guarded_instances(0), shutdown_requested(FALSE) { pthread_mutex_init(&LOCK_guardian, 0); From 499bd3c7fc0936822e550b4bf7c2dbebb84e4730 Mon Sep 17 00:00:00 2001 From: "df@kahlann.erinye.com" <> Date: Wed, 6 Dec 2006 16:15:20 +0100 Subject: [PATCH 05/24] apply magnus' rpl_000015 fix --- mysql-test/mysql-test-run.pl | 1 + mysql-test/r/rpl_000015.result | 2 +- mysql-test/t/rpl_000015.test | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3a98c0b1305..93615f468e7 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1677,6 +1677,7 @@ sub environment_setup () { $ENV{'SLAVE_MYPORT1'}= $slave->[1]->{'port'}; $ENV{'SLAVE_MYPORT2'}= $slave->[2]->{'port'}; $ENV{'MYSQL_TCP_PORT'}= $mysqld_variables{'port'}; + $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'master-port'}; $ENV{'IM_PATH_SOCK'}= $instance_manager->{path_sock}; $ENV{'IM_USERNAME'}= $instance_manager->{admin_login}; diff --git a/mysql-test/r/rpl_000015.result b/mysql-test/r/rpl_000015.result index a2763d4f023..a53750f82ad 100644 --- a/mysql-test/r/rpl_000015.result +++ b/mysql-test/r/rpl_000015.result @@ -8,7 +8,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File change master to master_host='127.0.0.1'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 test MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # +# 127.0.0.1 test DEFAULT_MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=MASTER_PORT; show slave status; diff --git a/mysql-test/t/rpl_000015.test b/mysql-test/t/rpl_000015.test index cf93beb2bfe..ffe7ab87632 100644 --- a/mysql-test/t/rpl_000015.test +++ b/mysql-test/t/rpl_000015.test @@ -18,7 +18,7 @@ show slave status; change master to master_host='127.0.0.1'; # The following needs to be cleaned up when change master is fixed ---replace_result $MYSQL_TCP_PORT MASTER_PORT +--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT --replace_column 1 # 8 # 9 # 23 # 33 # show slave status; --replace_result $MASTER_MYPORT MASTER_PORT From dbf5fe90a63424f70dcf9bf3a9f347e0588c61a5 Mon Sep 17 00:00:00 2001 From: "df@kahlann.erinye.com" <> Date: Wed, 20 Dec 2006 13:23:33 +0100 Subject: [PATCH 06/24] add file to VC++ project file --- VC++Files/mysys/mysys.vcproj | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/VC++Files/mysys/mysys.vcproj b/VC++Files/mysys/mysys.vcproj index 3f2c5e755ac..87100ce8e5e 100644 --- a/VC++Files/mysys/mysys.vcproj +++ b/VC++Files/mysys/mysys.vcproj @@ -3417,6 +3417,49 @@ PreprocessorDefinitions=""/> + + + + + + + + + + + + + + + + + Date: Thu, 28 Dec 2006 10:00:16 +0100 Subject: [PATCH 07/24] fix breakage on qnx --- cmd-line-utils/readline/undo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd-line-utils/readline/undo.c b/cmd-line-utils/readline/undo.c index b4b5a6511ba..4d256f492b8 100644 --- a/cmd-line-utils/readline/undo.c +++ b/cmd-line-utils/readline/undo.c @@ -175,7 +175,7 @@ _rl_fix_last_undo_of_type (type, start, end) for (rl = rl_undo_list; rl; rl = rl->next) { - if (rl->what == (uint) type) + if (rl->what == (unsigned int) type) { rl->start = start; rl->end = end; From 0255a1c9c2155d7beeb76517d1a9770789960369 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 1 Jan 2007 05:30:31 +0100 Subject: [PATCH 08/24] mysql_secure_installation.sh: Portable handling of "echo" without newline (bug#24605) check-cpu: In developer script safe to use "printf", not "echo -n" --- BUILD/check-cpu | 3 +-- scripts/mysql_secure_installation.sh | 29 +++++++++++++++++++--------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/BUILD/check-cpu b/BUILD/check-cpu index e207d12d972..9dd10b8ec3e 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -167,8 +167,7 @@ check_cpu () { touch __test.c while [ "$cpu_arg" ] ; do - # FIXME: echo -n isn't portable - see contortions autoconf goes through - echo -n testing $cpu_arg "... " >&2 + printf "testing $cpu_arg ... " >&2 # compile check check_cpu_cflags=`eval echo $check_cpu_args` diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 1c7ca34ad59..e42e83233c3 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -22,6 +22,16 @@ command=".mysql.$$" trap "interrupt" 2 rootpass="" +echo_n= +echo_c= + +set_echo_compat() { + case `echo "testing\c"`,`echo -n testing` in + *c*,-n*) echo_n= echo_c= ;; + *c*,*) echo_n=-n echo_c= ;; + *) echo_n= echo_c='\c' ;; + esac +} prepare() { touch $config $command @@ -45,7 +55,7 @@ get_root_password() { status=1 while [ $status -eq 1 ]; do stty -echo - echo -n "Enter current password for root (enter for none): " + echo $echo_n "Enter current password for root (enter for none): $echo_c" read password echo stty echo @@ -65,10 +75,10 @@ get_root_password() { set_root_password() { stty -echo - echo -n "New password: " + echo $echo_n "New password: $echo_c" read password1 echo - echo -n "Re-enter new password: " + echo $echo_n "Re-enter new password: $echo_c" read password2 echo stty echo @@ -173,6 +183,7 @@ cleanup() { # The actual script starts here prepare +set_echo_compat echo echo @@ -201,11 +212,11 @@ echo "root user without the proper authorisation." echo if [ $hadpass -eq 0 ]; then - echo -n "Set root password? [Y/n] " + echo $echo_n "Set root password? [Y/n] $echo_c" else echo "You already have a root password set, so you can safely answer 'n'." echo - echo -n "Change the root password? [Y/n] " + echo $echo_n "Change the root password? [Y/n] $echo_c" fi read reply @@ -232,7 +243,7 @@ echo "go a bit smoother. You should remove them before moving into a" echo "production environment." echo -echo -n "Remove anonymous users? [Y/n] " +echo $echo_n "Remove anonymous users? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then @@ -251,7 +262,7 @@ echo "Normally, root should only be allowed to connect from 'localhost'. This" echo "ensures that someone cannot guess at the root password from the network." echo -echo -n "Disallow root login remotely? [Y/n] " +echo $echo_n "Disallow root login remotely? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then echo " ... skipping." @@ -270,7 +281,7 @@ echo "access. This is also intended only for testing, and should be removed" echo "before moving into a production environment." echo -echo -n "Remove test database and access to it? [Y/n] " +echo $echo_n "Remove test database and access to it? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then echo " ... skipping." @@ -288,7 +299,7 @@ echo "Reloading the privilege tables will ensure that all changes made so far" echo "will take effect immediately." echo -echo -n "Reload privilege tables now? [Y/n] " +echo $echo_n "Reload privilege tables now? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then echo " ... skipping." From 473b0c7287b5980e61bf66fe99f900d0a3d1ff47 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 1 Jan 2007 07:22:57 +0100 Subject: [PATCH 09/24] configure.in: Don't build server when configured --without-server (bug#23973) --- configure.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 4ac0637e42c..8457a2dcad0 100644 --- a/configure.in +++ b/configure.in @@ -2990,10 +2990,14 @@ AM_CONDITIONAL(HAVE_NETWARE, test "$netware_dir" = "netware") export CC CXX CFLAGS CXXFLAGS LD LDFLAGS AR ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'" -if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no" +if test "$with_server" != "no" -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]) +fi + +if test "$with_server" != "no" +then # Avoid _PROGRAMS names THREAD_LPROGRAMS="test_thr_alarm\$(EXEEXT) test_thr_lock\$(EXEEXT)" AC_SUBST(THREAD_LPROGRAMS) From fd833d70377d947d59169aa45ff7c2ce637ae6ec Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 1 Jan 2007 08:49:17 +0100 Subject: [PATCH 10/24] configure.in: Build "mysqld_error.h" even if configured --withouth-server (bug#21265) --- configure.in | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 3cf7327d185..26ccd3f4155 100644 --- a/configure.in +++ b/configure.in @@ -2494,12 +2494,14 @@ thread_dirs= dnl This probably should be cleaned up more - for now the threaded dnl client is just using plain-old libs. -sql_client_dirs="strings regex mysys libmysql client" +sql_client_dirs= linked_client_targets="linked_libmysql_sources" -if test "$THREAD_SAFE_CLIENT" != "no" +if test "$THREAD_SAFE_CLIENT" = "no" then - sql_client_dirs="libmysql_r $sql_client_dirs" + sql_client_dirs="strings regex mysys extra libmysql client" +else + sql_client_dirs="strings regex mysys extra libmysql libmysql_r client" linked_client_targets="$linked_client_targets linked_libmysql_r_sources" AC_CONFIG_FILES(libmysql_r/Makefile) AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe]) @@ -2532,13 +2534,13 @@ if test "$with_server" != "no" -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) fi if test "$with_server" != "no" then - # 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" From 344599948d2867ddd13ba6045faaa08a6129386a Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 1 Jan 2007 09:54:41 +0100 Subject: [PATCH 11/24] mysqld.cc, configure.in: Don't use thread priority by default on Mac OS X (bug#18526) --- configure.in | 2 ++ sql/mysqld.cc | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 26ccd3f4155..69a0f9b576e 100644 --- a/configure.in +++ b/configure.in @@ -1073,6 +1073,8 @@ case $SYSTEM_TYPE in fi ;; *darwin*) + AC_DEFINE([DEFAULT_SKIP_THREAD_PRIORITY], [1], [default to skip thread priority]) + CPPFLAGS="-D" if test "$ac_cv_prog_gcc" = "yes" then FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT" diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 95de1f91ecf..783bca70739 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -51,6 +51,10 @@ #define OPT_NDBCLUSTER_DEFAULT 0 #endif +#ifndef DEFAULT_SKIP_THREAD_PRIORITY +#define DEFAULT_SKIP_THREAD_PRIORITY 0 +#endif + #include #include #include @@ -5384,8 +5388,8 @@ Can't be set to 1 if --log-slave-updates is used.", {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. Deprecated option. Use --skip-symbolic-links instead.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"skip-thread-priority", OPT_SKIP_PRIOR, - "Don't give threads different priorities.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, - 0, 0, 0, 0, 0}, + "Don't give threads different priorities.", 0, 0, 0, GET_NO_ARG, NO_ARG, + DEFAULT_SKIP_THREAD_PRIORITY, 0, 0, 0, 0, 0}, #ifdef HAVE_REPLICATION {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR, "The location where the slave should put its temporary files when \ From 0bc6df6a2496f46af30a27c46a230a5b36d16cb0 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 1 Jan 2007 10:50:39 +0100 Subject: [PATCH 12/24] Many files: Renamed hash_create() not to clash with imap using embedded server (bug#13859) --- innobase/buf/buf0buf.c | 2 +- innobase/dict/dict0dict.c | 6 +++--- innobase/fil/fil0fil.c | 4 ++-- innobase/ha/ha0ha.c | 2 +- innobase/ha/hash0hash.c | 2 +- innobase/include/hash0hash.h | 2 +- innobase/lock/lock0lock.c | 2 +- innobase/log/log0recv.c | 4 ++-- innobase/thr/thr0loc.c | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index 31a581d2ba8..704b8e0a5c7 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -621,7 +621,7 @@ buf_pool_init( } } - buf_pool->page_hash = hash_create(2 * max_size); + buf_pool->page_hash = hash0_create(2 * max_size); buf_pool->n_pend_reads = 0; diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 4b23ce047b2..5e55a44ce56 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -703,13 +703,13 @@ dict_init(void) mutex_create(&(dict_sys->mutex)); mutex_set_level(&(dict_sys->mutex), SYNC_DICT); - dict_sys->table_hash = hash_create(buf_pool_get_max_size() / + dict_sys->table_hash = hash0_create(buf_pool_get_max_size() / (DICT_POOL_PER_TABLE_HASH * UNIV_WORD_SIZE)); - dict_sys->table_id_hash = hash_create(buf_pool_get_max_size() / + dict_sys->table_id_hash = hash0_create(buf_pool_get_max_size() / (DICT_POOL_PER_TABLE_HASH * UNIV_WORD_SIZE)); - dict_sys->col_hash = hash_create(buf_pool_get_max_size() / + dict_sys->col_hash = hash0_create(buf_pool_get_max_size() / (DICT_POOL_PER_COL_HASH * UNIV_WORD_SIZE)); dict_sys->size = 0; diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index b576e4f5a70..269c25833a4 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -1295,8 +1295,8 @@ fil_system_create( mutex_set_level(&(system->mutex), SYNC_ANY_LATCH); - system->spaces = hash_create(hash_size); - system->name_hash = hash_create(hash_size); + system->spaces = hash0_create(hash_size); + system->name_hash = hash0_create(hash_size); UT_LIST_INIT(system->LRU); diff --git a/innobase/ha/ha0ha.c b/innobase/ha/ha0ha.c index ad1391ff83e..a64fb13a5bb 100644 --- a/innobase/ha/ha0ha.c +++ b/innobase/ha/ha0ha.c @@ -32,7 +32,7 @@ ha_create( hash_table_t* table; ulint i; - table = hash_create(n); + table = hash0_create(n); if (in_btr_search) { table->adaptive = TRUE; diff --git a/innobase/ha/hash0hash.c b/innobase/ha/hash0hash.c index facdea66198..18b5b3cefd6 100644 --- a/innobase/ha/hash0hash.c +++ b/innobase/ha/hash0hash.c @@ -74,7 +74,7 @@ Creates a hash table with >= n array cells. The actual number of cells is chosen to be a prime number slightly bigger than n. */ hash_table_t* -hash_create( +hash0_create( /*========*/ /* out, own: created table */ ulint n) /* in: number of array cells */ diff --git a/innobase/include/hash0hash.h b/innobase/include/hash0hash.h index 51315e40875..3abc05f174c 100644 --- a/innobase/include/hash0hash.h +++ b/innobase/include/hash0hash.h @@ -23,7 +23,7 @@ Creates a hash table with >= n array cells. The actual number of cells is chosen to be a prime number slightly bigger than n. */ hash_table_t* -hash_create( +hash0_create( /*========*/ /* out, own: created table */ ulint n); /* in: number of array cells */ diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 1c08d3defaa..19a285ed3f3 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -550,7 +550,7 @@ lock_sys_create( { lock_sys = mem_alloc(sizeof(lock_sys_t)); - lock_sys->rec_hash = hash_create(n_cells); + lock_sys->rec_hash = hash0_create(n_cells); /* hash_create_mutexes(lock_sys->rec_hash, 2, SYNC_REC_LOCK); */ diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c index ddb33de6fa6..37d9f5883b2 100644 --- a/innobase/log/log0recv.c +++ b/innobase/log/log0recv.c @@ -147,7 +147,7 @@ recv_sys_init( recv_sys->len = 0; recv_sys->recovered_offset = 0; - recv_sys->addr_hash = hash_create(available_memory / 64); + recv_sys->addr_hash = hash0_create(available_memory / 64); recv_sys->n_addrs = 0; recv_sys->apply_log_recs = FALSE; @@ -186,7 +186,7 @@ recv_sys_empty_hash(void) hash_table_free(recv_sys->addr_hash); mem_heap_empty(recv_sys->heap); - recv_sys->addr_hash = hash_create(buf_pool_get_curr_size() / 256); + recv_sys->addr_hash = hash0_create(buf_pool_get_curr_size() / 256); } /************************************************************ diff --git a/innobase/thr/thr0loc.c b/innobase/thr/thr0loc.c index 033bb22807f..f71048af2ba 100644 --- a/innobase/thr/thr0loc.c +++ b/innobase/thr/thr0loc.c @@ -224,7 +224,7 @@ thr_local_init(void) ut_a(thr_local_hash == NULL); - thr_local_hash = hash_create(OS_THREAD_MAX_N + 100); + thr_local_hash = hash0_create(OS_THREAD_MAX_N + 100); mutex_create(&thr_local_mutex); mutex_set_level(&thr_local_mutex, SYNC_THR_LOCAL); From 37ae5bbbbeb8ed892bf53cf0ff4ab1b5f671aa00 Mon Sep 17 00:00:00 2001 From: "mmj@tiger.mmj.dk" <> Date: Thu, 4 Jan 2007 22:22:25 +0100 Subject: [PATCH 13/24] my_global.h: Add patch from Alfredo for TARGET_FAT_BINARY --- include/my_global.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/include/my_global.h b/include/my_global.h index 19ba37fd58b..2a2b4a2ba99 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -92,6 +92,42 @@ #define NETWARE_SET_SCREEN_MODE(A) #endif +/* + The macros below are used to allow build of Universal/fat binaries of + MySQL and MySQL applications under darwin. +*/ +#ifdef TARGET_FAT_BINARY +# undef SIZEOF_CHARP +# undef SIZEOF_INT +# undef SIZEOF_LONG +# undef SIZEOF_LONG_LONG +# undef SIZEOF_OFF_T +# undef SIZEOF_SHORT + +#if defined(__i386__) +# undef WORDS_BIGENDIAN +# define SIZEOF_CHARP 4 +# define SIZEOF_INT 4 +# define SIZEOF_LONG 4 +# define SIZEOF_LONG_LONG 8 +# define SIZEOF_OFF_T 8 +# define SIZEOF_SHORT 2 + +#elif defined(__ppc__) +# define WORDS_BIGENDIAN +# define SIZEOF_CHARP 4 +# define SIZEOF_INT 4 +# define SIZEOF_LONG 4 +# define SIZEOF_LONG_LONG 8 +# define SIZEOF_OFF_T 8 +# define SIZEOF_SHORT 2 + +#else +# error Building FAT binary for an unknown architecture. +#endif +#endif /* TARGET_FAT_BINARY */ + + /* The macros below are borrowed from include/linux/compiler.h in the Linux kernel. Use them to indicate the likelyhood of the truthfulness From f61a873c60c2e619b402a1add2d95a75ddc95b58 Mon Sep 17 00:00:00 2001 From: "mmj@tiger.mmj.dk" <> Date: Thu, 4 Jan 2007 23:18:04 +0100 Subject: [PATCH 14/24] my_global.h: Patch from Alfredo for TARGET_FAT_BINARY --- include/my_global.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/include/my_global.h b/include/my_global.h index 41b660227b5..2de54e521b5 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -84,6 +84,42 @@ #define NETWARE_SET_SCREEN_MODE(A) #endif +/* + The macros below are used to allow build of Universal/fat binaries of + MySQL and MySQL applications under darwin. +*/ +#ifdef TARGET_FAT_BINARY +# undef SIZEOF_CHARP +# undef SIZEOF_INT +# undef SIZEOF_LONG +# undef SIZEOF_LONG_LONG +# undef SIZEOF_OFF_T +# undef SIZEOF_SHORT + +#if defined(__i386__) +# undef WORDS_BIGENDIAN +# define SIZEOF_CHARP 4 +# define SIZEOF_INT 4 +# define SIZEOF_LONG 4 +# define SIZEOF_LONG_LONG 8 +# define SIZEOF_OFF_T 8 +# define SIZEOF_SHORT 2 + +#elif defined(__ppc__) +# define WORDS_BIGENDIAN +# define SIZEOF_CHARP 4 +# define SIZEOF_INT 4 +# define SIZEOF_LONG 4 +# define SIZEOF_LONG_LONG 8 +# define SIZEOF_OFF_T 8 +# define SIZEOF_SHORT 2 + +#else +# error Building FAT binary for an unknown architecture. +#endif +#endif /* TARGET_FAT_BINARY */ + + /* The macros below are borrowed from include/linux/compiler.h in the Linux kernel. Use them to indicate the likelyhood of the truthfulness From 7a2d8c14dd7443b9679b9ced49a82daa92e73374 Mon Sep 17 00:00:00 2001 From: "tsmith@siva.hindu.god" <> Date: Thu, 4 Jan 2007 19:51:34 -0700 Subject: [PATCH 15/24] Applied innodb-5.1-ss1039 and innodb-5.1-ss1134 snapshots. Fixes: - Bug #24712: SHOW TABLE STATUS for file-per-table showing incorrect time fields - Bug #24386: Performance degradation caused by instrumentation in mutex_struct - Bug #24190: many exportable definitions of field_in_record_is_null - Bug #21468: InnoDB crash during recovery with corrupted data pages: XA bug? --- storage/innobase/buf/buf0buf.c | 20 ++--- storage/innobase/buf/buf0flu.c | 2 + storage/innobase/dict/dict0dict.c | 47 +++-------- storage/innobase/ha/ha0ha.c | 12 +-- storage/innobase/ha/hash0hash.c | 12 +-- storage/innobase/handler/ha_innodb.cc | 104 +++++++++++------------ storage/innobase/include/btr0sea.h | 2 +- storage/innobase/include/buf0buf.ic | 5 +- storage/innobase/include/data0type.ic | 4 +- storage/innobase/include/dict0dict.h | 22 ++--- storage/innobase/include/ha0ha.h | 17 ++-- storage/innobase/include/hash0hash.h | 16 +++- storage/innobase/include/sync0rw.h | 22 ++++- storage/innobase/include/sync0sync.h | 65 ++++++++------ storage/innobase/include/sync0sync.ic | 4 +- storage/innobase/include/univ.i | 30 ++++--- storage/innobase/include/ut0lst.h | 2 +- storage/innobase/lock/lock0lock.c | 4 - storage/innobase/log/log0recv.c | 12 +++ storage/innobase/row/row0ins.c | 3 +- storage/innobase/row/row0sel.c | 8 +- storage/innobase/row/row0upd.c | 3 +- storage/innobase/srv/srv0start.c | 11 --- storage/innobase/sync/sync0rw.c | 15 ++-- storage/innobase/sync/sync0sync.c | 117 ++++++++++++++------------ storage/innobase/trx/trx0roll.c | 20 ++++- storage/innobase/trx/trx0trx.c | 25 +++++- 27 files changed, 336 insertions(+), 268 deletions(-) diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c index 99e365d6129..ad775fbd6d5 100644 --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c @@ -1755,22 +1755,22 @@ buf_page_init_for_read( if (*err == DB_TABLESPACE_DELETED || NULL != buf_page_hash_get(space, offset)) { - /* The page belongs to a space which has been - deleted or is being deleted, or the page is - already in buf_pool, return */ + /* The page belongs to a space which has been + deleted or is being deleted, or the page is + already in buf_pool, return */ mutex_exit(&block->mutex); - mutex_exit(&(buf_pool->mutex)); + mutex_exit(&(buf_pool->mutex)); - buf_block_free(block); + buf_block_free(block); - if (mode == BUF_READ_IBUF_PAGES_ONLY) { + if (mode == BUF_READ_IBUF_PAGES_ONLY) { - mtr_commit(&mtr); - } + mtr_commit(&mtr); + } - return(NULL); - } + return(NULL); + } ut_ad(block); diff --git a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c index 49b81196a64..64060dab8ae 100644 --- a/storage/innobase/buf/buf0flu.c +++ b/storage/innobase/buf/buf0flu.c @@ -854,8 +854,10 @@ buf_flush_batch( ut_ad((flush_type == BUF_FLUSH_LRU) || (flush_type == BUF_FLUSH_LIST)); +#ifdef UNIV_SYNC_DEBUG ut_ad((flush_type != BUF_FLUSH_LIST) || sync_thread_levels_empty_gen(TRUE)); +#endif /* UNIV_SYNC_DEBUG */ mutex_enter(&(buf_pool->mutex)); if ((buf_pool->n_flush[flush_type] > 0) diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index 7c2fc18accd..2b3cfdba27d 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -801,16 +801,20 @@ dict_init(void) } /************************************************************************** -Returns a table object. NOTE! This is a high-level function to be used -mainly from outside the 'dict' directory. Inside this directory -dict_table_get_low is usually the appropriate function. */ +Returns a table object and optionally increment its MySQL open handle count. +NOTE! This is a high-level function to be used mainly from outside the +'dict' directory. Inside this directory dict_table_get_low is usually the +appropriate function. */ dict_table_t* dict_table_get( /*===========*/ /* out: table, NULL if does not exist */ - const char* table_name) /* in: table name */ + const char* table_name, /* in: table name */ + ibool inc_mysql_count) + /* in: whether to increment the open + handle count on the table */ { dict_table_t* table; @@ -818,42 +822,17 @@ dict_table_get( table = dict_table_get_low(table_name); - mutex_exit(&(dict_sys->mutex)); - - if (table != NULL) { - if (!table->stat_initialized) { - dict_update_statistics(table); - } - } - - return(table); -} - -/************************************************************************** -Returns a table object and increments MySQL open handle count on the table. */ - -dict_table_t* -dict_table_get_and_increment_handle_count( -/*======================================*/ - /* out: table, NULL if - does not exist */ - const char* table_name) /* in: table name */ -{ - dict_table_t* table; - - mutex_enter(&(dict_sys->mutex)); - - table = dict_table_get_low(table_name); - - if (table != NULL) { - + if (inc_mysql_count && table) { table->n_mysql_handles_opened++; } mutex_exit(&(dict_sys->mutex)); if (table != NULL) { - if (!table->stat_initialized && !table->ibd_file_missing) { + if (!table->stat_initialized) { + /* If table->ibd_file_missing == TRUE, this will + print an error message and return without doing + anything. */ dict_update_statistics(table); } } diff --git a/storage/innobase/ha/ha0ha.c b/storage/innobase/ha/ha0ha.c index 23ea2554f01..07dfb66afa8 100644 --- a/storage/innobase/ha/ha0ha.c +++ b/storage/innobase/ha/ha0ha.c @@ -18,16 +18,18 @@ Creates a hash table with >= n array cells. The actual number of cells is chosen to be a prime number slightly bigger than n. */ hash_table_t* -ha_create( -/*======*/ +ha_create_func( +/*===========*/ /* out, own: created table */ ibool in_btr_search, /* in: TRUE if the hash table is used in the btr_search module */ ulint n, /* in: number of array cells */ - ulint n_mutexes, /* in: number of mutexes to protect the - hash table: must be a power of 2, or 0 */ - ulint mutex_level) /* in: level of the mutexes in the latching +#ifdef UNIV_SYNC_DEBUG + ulint mutex_level, /* in: level of the mutexes in the latching order: this is used in the debug version */ +#endif /* UNIV_SYNC_DEBUG */ + ulint n_mutexes) /* in: number of mutexes to protect the + hash table: must be a power of 2, or 0 */ { hash_table_t* table; ulint i; diff --git a/storage/innobase/ha/hash0hash.c b/storage/innobase/ha/hash0hash.c index 6084a19fa27..4807015eee5 100644 --- a/storage/innobase/ha/hash0hash.c +++ b/storage/innobase/ha/hash0hash.c @@ -129,13 +129,15 @@ hash_table_free( Creates a mutex array to protect a hash table. */ void -hash_create_mutexes( -/*================*/ +hash_create_mutexes_func( +/*=====================*/ hash_table_t* table, /* in: hash table */ - ulint n_mutexes, /* in: number of mutexes, must be a - power of 2 */ - ulint sync_level) /* in: latching order level of the +#ifdef UNIV_SYNC_DEBUG + ulint sync_level, /* in: latching order level of the mutexes: used in the debug version */ +#endif /* UNIV_SYNC_DEBUG */ + ulint n_mutexes) /* in: number of mutexes, must be a + power of 2 */ { ulint i; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 4d835b41863..90d1701a565 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -39,9 +39,6 @@ have disables the InnoDB inlining in this file. */ #include #include #include - -#define MAX_ULONG_BIT ((ulong) 1 << (sizeof(ulong)*8-1)) - #include "ha_innodb.h" pthread_mutex_t innobase_share_mutex, /* to protect innobase_open_files */ @@ -1261,18 +1258,6 @@ trx_is_interrupted( return(trx && trx->mysql_thd && ((THD*) trx->mysql_thd)->killed); } -/************************************************************************** -Obtain a pointer to the MySQL THD object, as in current_thd(). This -definition must match the one in sql/ha_innodb.cc! */ -extern "C" -void* -innobase_current_thd(void) -/*======================*/ - /* out: MySQL THD object */ -{ - return(current_thd); -} - /********************************************************************* Call this when you have opened a new table handle in HANDLER, before you call index_read_idx() etc. Actually, we can let the cursor stay open even @@ -2354,7 +2339,7 @@ ha_innobase::open( /* Get pointer to a table object in InnoDB dictionary cache */ - ib_table = dict_table_get_and_increment_handle_count(norm_name); + ib_table = dict_table_get(norm_name, TRUE); if (NULL == ib_table) { ut_print_timestamp(stderr); @@ -4451,7 +4436,7 @@ ha_innobase::rnd_pos( } if (error) { - DBUG_PRINT("error", ("Got error: %d", error)); + DBUG_PRINT("error", ("Got error: %d", error)); DBUG_RETURN(error); } @@ -4932,7 +4917,7 @@ ha_innobase::create( log_buffer_flush_to_disk(); - innobase_table = dict_table_get(norm_name); + innobase_table = dict_table_get(norm_name, FALSE); DBUG_ASSERT(innobase_table != 0); @@ -5543,16 +5528,10 @@ ha_innobase::info( prebuilt->trx->op_info = (char*) "returning various info to MySQL"; - if (ib_table->space != 0) { - my_snprintf(path, sizeof(path), "%s/%s%s", - mysql_data_home, ib_table->name, ".ibd"); - unpack_filename(path,path); - } else { - my_snprintf(path, sizeof(path), "%s/%s%s", + my_snprintf(path, sizeof(path), "%s/%s%s", mysql_data_home, ib_table->name, reg_ext); - unpack_filename(path,path); - } + unpack_filename(path,path); /* Note that we do not know the access time of the table, nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ @@ -6605,22 +6584,23 @@ innodb_mutex_show_status( { char buf1[IO_SIZE], buf2[IO_SIZE]; mutex_t* mutex; +#ifdef UNIV_DEBUG ulint rw_lock_count= 0; ulint rw_lock_count_spin_loop= 0; ulint rw_lock_count_spin_rounds= 0; ulint rw_lock_count_os_wait= 0; ulint rw_lock_count_os_yield= 0; ulonglong rw_lock_wait_time= 0; +#endif /* UNIV_DEBUG */ uint hton_name_len= strlen(innobase_hton_name), buf1len, buf2len; DBUG_ENTER("innodb_mutex_show_status"); -#ifdef MUTEX_PROTECT_TO_BE_ADDED_LATER - mutex_enter(&mutex_list_mutex); -#endif + mutex_enter_noninline(&mutex_list_mutex); mutex = UT_LIST_GET_FIRST(mutex_list); while (mutex != NULL) { +#ifdef UNIV_DEBUG if (mutex->mutex_type != 1) { if (mutex->count_using > 0) { buf1len= my_snprintf(buf1, sizeof(buf1), @@ -6636,14 +6616,13 @@ innodb_mutex_show_status( mutex->count_spin_rounds, mutex->count_os_wait, mutex->count_os_yield, - (ulong) (mutex->lspent_time/1000)); + (ulong) (mutex->lspent_time/1000)); if (stat_print(thd, innobase_hton_name, hton_name_len, buf1, buf1len, buf2, buf2len)) { -#ifdef MUTEX_PROTECT_TO_BE_ADDED_LATER - mutex_exit(&mutex_list_mutex); -#endif + mutex_exit_noninline( + &mutex_list_mutex); DBUG_RETURN(1); } } @@ -6656,26 +6635,39 @@ innodb_mutex_show_status( rw_lock_count_os_yield += mutex->count_os_yield; rw_lock_wait_time += mutex->lspent_time; } +#else /* UNIV_DEBUG */ + buf1len= my_snprintf(buf1, sizeof(buf1), "%s:%lu", + mutex->cfile_name, (ulong) mutex->cline); + buf2len= my_snprintf(buf2, sizeof(buf2), "os_waits=%lu", + mutex->count_os_wait); + + if (stat_print(thd, innobase_hton_name, + hton_name_len, buf1, buf1len, + buf2, buf2len)) { + mutex_exit_noninline(&mutex_list_mutex); + DBUG_RETURN(1); + } +#endif /* UNIV_DEBUG */ mutex = UT_LIST_GET_NEXT(list, mutex); } + mutex_exit_noninline(&mutex_list_mutex); + +#ifdef UNIV_DEBUG buf2len= my_snprintf(buf2, sizeof(buf2), "count=%lu, spin_waits=%lu, spin_rounds=%lu, " "os_waits=%lu, os_yields=%lu, os_wait_times=%lu", rw_lock_count, rw_lock_count_spin_loop, rw_lock_count_spin_rounds, rw_lock_count_os_wait, rw_lock_count_os_yield, - (ulong) (rw_lock_wait_time/1000)); + (ulong) (rw_lock_wait_time/1000)); if (stat_print(thd, innobase_hton_name, hton_name_len, STRING_WITH_LEN("rw_lock_mutexes"), buf2, buf2len)) { DBUG_RETURN(1); } - -#ifdef MUTEX_PROTECT_TO_BE_ADDED_LATER - mutex_exit(&mutex_list_mutex); -#endif +#endif /* UNIV_DEBUG */ DBUG_RETURN(FALSE); } @@ -7348,7 +7340,6 @@ innobase_get_at_most_n_mbchars( } } -extern "C" { /********************************************************************** This function returns true if @@ -7358,33 +7349,34 @@ is either REPLACE or LOAD DATA INFILE REPLACE. 2) SQL-query in the current thread is INSERT ON DUPLICATE KEY UPDATE. -NOTE that /mysql/innobase/row/row0ins.c must contain the +NOTE that storage/innobase/row/row0ins.c must contain the prototype for this function ! */ - +extern "C" ibool innobase_query_is_update(void) /*==========================*/ { - THD* thd; + THD* thd = current_thd; - thd = (THD *)innobase_current_thd(); + if (!thd) { + /* InnoDB's internal threads may run InnoDB stored procedures + that call this function. Then current_thd is not defined + (it is probably NULL). */ - if (thd->lex->sql_command == SQLCOM_REPLACE || - thd->lex->sql_command == SQLCOM_REPLACE_SELECT || - (thd->lex->sql_command == SQLCOM_LOAD && - thd->lex->duplicates == DUP_REPLACE)) { - - return(1); + return(FALSE); } - if (thd->lex->sql_command == SQLCOM_INSERT && - thd->lex->duplicates == DUP_UPDATE) { - - return(1); + switch (thd->lex->sql_command) { + case SQLCOM_REPLACE: + case SQLCOM_REPLACE_SELECT: + return(TRUE); + case SQLCOM_LOAD: + return(thd->lex->duplicates == DUP_REPLACE); + case SQLCOM_INSERT: + return(thd->lex->duplicates == DUP_UPDATE); + default: + return(FALSE); } - - return(0); -} } /*********************************************************************** diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h index 8b4408ef852..281587ad060 100644 --- a/storage/innobase/include/btr0sea.h +++ b/storage/innobase/include/btr0sea.h @@ -160,7 +160,7 @@ struct btr_search_struct{ number of full fields */ ulint n_bytes; /* recommended prefix: number of bytes in an incomplete field; - cf. BTR_PAGE_MAX_REC_SIZE */ + see also BTR_PAGE_MAX_REC_SIZE */ ibool left_side; /* TRUE or FALSE, depending on whether the leftmost record of several records with the same prefix should be indexed in the diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index 43895295734..c448c28933a 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -625,8 +625,6 @@ buf_page_release( RW_NO_LATCH */ mtr_t* mtr) /* in: mtr */ { - ulint buf_fix_count; - ut_ad(block); ut_a(block->state == BUF_BLOCK_FILE_PAGE); @@ -643,8 +641,7 @@ buf_page_release( #ifdef UNIV_SYNC_DEBUG rw_lock_s_unlock(&(block->debug_latch)); #endif - buf_fix_count = block->buf_fix_count; - block->buf_fix_count = buf_fix_count - 1; + block->buf_fix_count--; mutex_exit(&block->mutex); diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.ic index b447c9c39c2..b8c24bb074a 100644 --- a/storage/innobase/include/data0type.ic +++ b/storage/innobase/include/data0type.ic @@ -65,8 +65,8 @@ dtype_get_mblen( innobase_get_cset_width(dtype_get_charset_coll(prtype), mbminlen, mbmaxlen); ut_ad(*mbminlen <= *mbmaxlen); - ut_ad(*mbminlen <= 2); /* cf. the bit-field in dtype_t */ - ut_ad(*mbmaxlen < 1 << 3); /* cf. the bit-field in dtype_t */ + ut_ad(*mbminlen <= 2); /* mbminlen in dtype_t is 0..3 */ + ut_ad(*mbmaxlen < 1 << 3); /* mbmaxlen in dtype_t is 0..7 */ #else /* !UNIV_HOTBACKUP */ ut_a(mtype <= DATA_BINARY); *mbminlen = *mbmaxlen = 1; diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 2582effbb29..836a6290498 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -326,26 +326,20 @@ dict_foreign_parse_drop_constraints( const char*** constraints_to_drop); /* out: id's of the constraints to drop */ /************************************************************************** -Returns a table object. NOTE! This is a high-level function to be used -mainly from outside the 'dict' directory. Inside this directory -dict_table_get_low is usually the appropriate function. */ +Returns a table object and optionally increment its MySQL open handle count. +NOTE! This is a high-level function to be used mainly from outside the +'dict' directory. Inside this directory dict_table_get_low is usually the +appropriate function. */ dict_table_t* dict_table_get( /*===========*/ /* out: table, NULL if does not exist */ - const char* table_name); /* in: table name */ -/************************************************************************** -Returns a table object and increments MySQL open handle count on the table. -*/ - -dict_table_t* -dict_table_get_and_increment_handle_count( -/*======================================*/ - /* out: table, NULL if - does not exist */ - const char* table_name); /* in: table name */ + const char* table_name, /* in: table name */ + ibool inc_mysql_count); + /* in: whether to increment the open + handle count on the table */ /************************************************************************** Returns a table object based on table id. */ diff --git a/storage/innobase/include/ha0ha.h b/storage/innobase/include/ha0ha.h index 9fc80ed301c..beaa06ae755 100644 --- a/storage/innobase/include/ha0ha.h +++ b/storage/innobase/include/ha0ha.h @@ -41,16 +41,23 @@ Creates a hash table with >= n array cells. The actual number of cells is chosen to be a prime number slightly bigger than n. */ hash_table_t* -ha_create( -/*======*/ +ha_create_func( +/*===========*/ /* out, own: created table */ ibool in_btr_search, /* in: TRUE if the hash table is used in the btr_search module */ ulint n, /* in: number of array cells */ - ulint n_mutexes, /* in: number of mutexes to protect the - hash table: must be a power of 2 */ - ulint mutex_level); /* in: level of the mutexes in the latching +#ifdef UNIV_SYNC_DEBUG + ulint mutex_level, /* in: level of the mutexes in the latching order: this is used in the debug version */ +#endif /* UNIV_SYNC_DEBUG */ + ulint n_mutexes); /* in: number of mutexes to protect the + hash table: must be a power of 2 */ +#ifdef UNIV_SYNC_DEBUG +# define ha_create(b,n_c,n_m,level) ha_create_func(b,n_c,level,n_m) +#else /* UNIV_SYNC_DEBUG */ +# define ha_create(b,n_c,n_m,level) ha_create_func(b,n_c,n_m) +#endif /* UNIV_SYNC_DEBUG */ /***************************************************************** Inserts an entry into a hash table. If an entry with the same fold number is found, its node is updated to point to the new data, and no new node diff --git a/storage/innobase/include/hash0hash.h b/storage/innobase/include/hash0hash.h index 31c5c57ae35..0ab02801fd1 100644 --- a/storage/innobase/include/hash0hash.h +++ b/storage/innobase/include/hash0hash.h @@ -31,12 +31,20 @@ hash_create( Creates a mutex array to protect a hash table. */ void -hash_create_mutexes( -/*================*/ +hash_create_mutexes_func( +/*=====================*/ hash_table_t* table, /* in: hash table */ - ulint n_mutexes, /* in: number of mutexes */ - ulint sync_level); /* in: latching order level of the +#ifdef UNIV_SYNC_DEBUG + ulint sync_level, /* in: latching order level of the mutexes: used in the debug version */ +#endif /* UNIV_SYNC_DEBUG */ + ulint n_mutexes); /* in: number of mutexes */ +#ifdef UNIV_SYNC_DEBUG +# define hash_create_mutexes(t,n,level) hash_create_mutexes_func(t,level,n) +#else /* UNIV_SYNC_DEBUG */ +# define hash_create_mutexes(t,n,level) hash_create_mutexes_func(t,n) +#endif /* UNIV_SYNC_DEBUG */ + /***************************************************************** Frees a hash table. */ diff --git a/storage/innobase/include/sync0rw.h b/storage/innobase/include/sync0rw.h index 7c0241f2e02..abf04253141 100644 --- a/storage/innobase/include/sync0rw.h +++ b/storage/innobase/include/sync0rw.h @@ -61,8 +61,18 @@ Creates, or rather, initializes an rw-lock object in a specified memory location (which must be appropriately aligned). The rw-lock is initialized to the non-locked state. Explicit freeing of the rw-lock with rw_lock_free is necessary only if the memory block containing it is freed. */ -#define rw_lock_create(L, level) \ - rw_lock_create_func((L), (level), __FILE__, __LINE__, #L) +#ifdef UNIV_DEBUG +# ifdef UNIV_SYNC_DEBUG +# define rw_lock_create(L, level) \ + rw_lock_create_func((L), (level), #L, __FILE__, __LINE__) +# else /* UNIV_SYNC_DEBUG */ +# define rw_lock_create(L, level) \ + rw_lock_create_func((L), #L, __FILE__, __LINE__) +# endif /* UNIV_SYNC_DEBUG */ +#else /* UNIV_DEBUG */ +# define rw_lock_create(L, level) \ + rw_lock_create_func((L), __FILE__, __LINE__) +#endif /* UNIV_DEBUG */ /********************************************************************** Creates, or rather, initializes an rw-lock object in a specified memory @@ -74,10 +84,14 @@ void rw_lock_create_func( /*================*/ rw_lock_t* lock, /* in: pointer to memory */ +#ifdef UNIV_DEBUG +# ifdef UNIV_SYNC_DEBUG ulint level, /* in: level */ +# endif /* UNIV_SYNC_DEBUG */ + const char* cmutex_name, /* in: mutex name */ +#endif /* UNIV_DEBUG */ const char* cfile_name, /* in: file name where created */ - ulint cline, /* in: file line where created */ - const char* cmutex_name); /* in: mutex name */ + ulint cline); /* in: file line where created */ /********************************************************************** Calling this function is obligatory only if the memory buffer containing the rw-lock is freed. Removes an rw-lock object from the global list. The diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h index a1184d44257..e7e135c0c7e 100644 --- a/storage/innobase/include/sync0sync.h +++ b/storage/innobase/include/sync0sync.h @@ -39,8 +39,18 @@ location (which must be appropriately aligned). The mutex is initialized in the reset state. Explicit freeing of the mutex with mutex_free is necessary only if the memory block containing it is freed. */ -#define mutex_create(M, level) \ - mutex_create_func((M), (level), __FILE__, __LINE__, #M) +#ifdef UNIV_DEBUG +# ifdef UNIV_SYNC_DEBUG +# define mutex_create(M, level) \ + mutex_create_func((M), #M, (level), __FILE__, __LINE__) +# else +# define mutex_create(M, level) \ + mutex_create_func((M), #M, __FILE__, __LINE__) +# endif +#else +# define mutex_create(M, level) \ + mutex_create_func((M), __FILE__, __LINE__) +#endif /********************************************************************** Creates, or rather, initializes a mutex object in a specified memory @@ -52,10 +62,14 @@ void mutex_create_func( /*==============*/ mutex_t* mutex, /* in: pointer to memory */ +#ifdef UNIV_DEBUG + const char* cmutex_name, /* in: mutex name */ +# ifdef UNIV_SYNC_DEBUG ulint level, /* in: level */ +# endif /* UNIV_SYNC_DEBUG */ +#endif /* UNIV_DEBUG */ const char* cfile_name, /* in: file name where created */ - ulint cline, /* in: file line where created */ - const char* cmutex_name); /* in: mutex name */ + ulint cline); /* in: file line where created */ /********************************************************************** Calling this function is obligatory only if the memory buffer containing the mutex is freed. Removes a mutex object from the mutex list. The mutex @@ -149,6 +163,7 @@ void sync_print( /*=======*/ FILE* file); /* in: file where to print */ +#ifdef UNIV_DEBUG /********************************************************************** Checks that the mutex has been initialized. */ @@ -156,6 +171,8 @@ ibool mutex_validate( /*===========*/ mutex_t* mutex); +#endif /* UNIV_DEBUG */ +#ifdef UNIV_SYNC_DEBUG /********************************************************************** Adds a latch and its level in the thread level array. Allocates the memory for the array if called first time for this OS thread. Makes the checks @@ -197,7 +214,6 @@ sync_thread_levels_empty_gen( allowed to be owned by the thread, also purge_is_running mutex is allowed */ -#ifdef UNIV_SYNC_DEBUG /********************************************************************** Checks that the current thread owns the mutex. Works only in the debug version. */ @@ -465,26 +481,29 @@ struct mutex_struct { ulint line; /* Line where the mutex was locked */ os_thread_id_t thread_id; /* Debug version: The thread id of the thread which locked the mutex. */ -#endif /* UNIV_SYNC_DEBUG */ ulint level; /* Level in the global latching order */ +#endif /* UNIV_SYNC_DEBUG */ const char* cfile_name;/* File name where mutex created */ - ulint cline; /* Line where created */ - ulint magic_n; + ulint cline; /* Line where created */ +#ifdef UNIV_DEBUG + ulint magic_n; +# define MUTEX_MAGIC_N (ulint)979585 +#endif /* UNIV_DEBUG */ #ifndef UNIV_HOTBACKUP - ulong count_using; /* count of times mutex used */ - ulong count_spin_loop; /* count of spin loops */ - ulong count_spin_rounds; /* count of spin rounds */ - ulong count_os_wait; /* count of os_wait */ - ulong count_os_yield; /* count of os_wait */ - ulonglong lspent_time; /* mutex os_wait timer msec */ - ulonglong lmax_spent_time; /* mutex os_wait timer msec */ - const char* cmutex_name;/* mutex name */ - ulint mutex_type;/* 0 - usual mutex 1 - rw_lock mutex */ + ulong count_os_wait; /* count of os_wait */ +# ifdef UNIV_DEBUG + ulong count_using; /* count of times mutex used */ + ulong count_spin_loop; /* count of spin loops */ + ulong count_spin_rounds; /* count of spin rounds */ + ulong count_os_yield; /* count of os_wait */ + ulonglong lspent_time; /* mutex os_wait timer msec */ + ulonglong lmax_spent_time; /* mutex os_wait timer msec */ + const char* cmutex_name;/* mutex name */ + ulint mutex_type;/* 0 - usual mutex 1 - rw_lock mutex */ +# endif /* UNIV_DEBUG */ #endif /* !UNIV_HOTBACKUP */ }; -#define MUTEX_MAGIC_N (ulint)979585 - /* The global array of wait cells for implementation of the databases own mutexes and read-write locks. Appears here for debugging purposes only! */ @@ -496,20 +515,16 @@ to 20 microseconds. */ #define SYNC_SPIN_ROUNDS srv_n_spin_wait_rounds -#define SYNC_INFINITE_TIME ((ulint)(-1)) - -/* Means that a timeout elapsed when waiting */ - -#define SYNC_TIME_EXCEEDED (ulint)1 - /* The number of system calls made in this module. Intended for performance monitoring. */ extern ulint mutex_system_call_count; extern ulint mutex_exit_count; +#ifdef UNIV_SYNC_DEBUG /* Latching order checks start when this is set TRUE */ extern ibool sync_order_checks_on; +#endif /* UNIV_SYNC_DEBUG */ /* This variable is set to TRUE when sync_init is called */ extern ibool sync_initialized; diff --git a/storage/innobase/include/sync0sync.ic b/storage/innobase/include/sync0sync.ic index bcecc3478b3..4b48a1469ff 100644 --- a/storage/innobase/include/sync0sync.ic +++ b/storage/innobase/include/sync0sync.ic @@ -254,9 +254,9 @@ mutex_enter_func( /* Note that we do not peek at the value of lock_word before trying the atomic test_and_set; we could peek, and possibly save time. */ -#ifndef UNIV_HOTBACKUP +#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP mutex->count_using++; -#endif /* UNIV_HOTBACKUP */ +#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */ if (!mutex_test_and_set(mutex)) { #ifdef UNIV_SYNC_DEBUG diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index f471fe136b0..7a5cb21f07a 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -83,19 +83,27 @@ memory is read outside the allocated blocks. */ /* Make a non-inline debug version */ #if 0 -#define UNIV_DEBUG -#define UNIV_MEM_DEBUG -#define UNIV_IBUF_DEBUG -#define UNIV_SYNC_DEBUG -#define UNIV_SEARCH_DEBUG -#define UNIV_SYNC_PERF_STAT -#define UNIV_SEARCH_PERF_STAT -#define UNIV_SRV_PRINT_LATCH_WAITS -#define UNIV_BTR_PRINT +#define UNIV_DEBUG /* Enable ut_ad() assertions */ +#define UNIV_LIST_DEBUG /* debug UT_LIST_ macros */ +#define UNIV_MEM_DEBUG /* detect memory leaks etc */ +#define UNIV_IBUF_DEBUG /* debug the insert buffer; +this limits the database to IBUF_COUNT_N_SPACES and IBUF_COUNT_N_PAGES, +and the insert buffer must be empty when the database is started */ +#define UNIV_SYNC_DEBUG /* debug mutex and latch +operations (very slow); also UNIV_DEBUG must be defined */ +#define UNIV_SEARCH_DEBUG /* debug B-tree comparisons */ +#define UNIV_SYNC_PERF_STAT /* operation counts for + rw-locks and mutexes */ +#define UNIV_SEARCH_PERF_STAT /* statistics for the + adaptive hash index */ +#define UNIV_SRV_PRINT_LATCH_WAITS /* enable diagnostic output + in sync0sync.c */ +#define UNIV_BTR_PRINT /* enable functions for + printing B-trees */ #endif -#define UNIV_BTR_DEBUG -#define UNIV_LIGHT_MEM_DEBUG +#define UNIV_BTR_DEBUG /* check B-tree links */ +#define UNIV_LIGHT_MEM_DEBUG /* light memory debugging */ #ifdef HAVE_purify /* The following sets all new allocated memory to zero before use: diff --git a/storage/innobase/include/ut0lst.h b/storage/innobase/include/ut0lst.h index d19885d6edc..9735bf315c6 100644 --- a/storage/innobase/include/ut0lst.h +++ b/storage/innobase/include/ut0lst.h @@ -124,7 +124,7 @@ name, NODE1 and NODE2 are pointers to nodes. */ }\ /* Invalidate the pointers in a list node. */ -#ifdef UNIV_DEBUG +#ifdef UNIV_LIST_DEBUG # define UT_LIST_REMOVE_CLEAR(NAME, N) \ ((N)->NAME.prev = (N)->NAME.next = (void*) -1) #else diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c index 551470f49b6..84b64b146dc 100644 --- a/storage/innobase/lock/lock0lock.c +++ b/storage/innobase/lock/lock0lock.c @@ -4391,10 +4391,6 @@ loop: trx->read_view->up_limit_id)); } - fprintf(file, - "Trx has approximately %lu row locks\n", - (ulong) lock_number_of_rows_locked(trx)); - if (trx->que_state == TRX_QUE_LOCK_WAIT) { fprintf(file, "------- TRX HAS BEEN WAITING %lu SEC" diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c index 280ebbb6bf2..41e2b921664 100644 --- a/storage/innobase/log/log0recv.c +++ b/storage/innobase/log/log0recv.c @@ -33,6 +33,7 @@ Created 9/20/1997 Heikki Tuuri #include "btr0cur.h" #include "dict0boot.h" #include "fil0fil.h" +#include "sync0sync.h" #ifdef UNIV_HOTBACKUP /* This is set to FALSE if the backup was originally taken with the @@ -190,6 +191,7 @@ recv_sys_empty_hash(void) recv_sys->addr_hash = hash_create(buf_pool_get_curr_size() / 256); } +#ifndef UNIV_LOG_DEBUG /************************************************************ Frees the recovery system. */ static @@ -209,6 +211,7 @@ recv_sys_free(void) mutex_exit(&(recv_sys->mutex)); } +#endif /* UNIV_LOG_DEBUG */ /************************************************************ Truncates possible corrupted or extra records from a log group. */ @@ -2855,6 +2858,15 @@ recv_recovery_from_checkpoint_finish(void) #ifndef UNIV_LOG_DEBUG recv_sys_free(); #endif + +#ifdef UNIV_SYNC_DEBUG + /* Wait for a while so that created threads have time to suspend + themselves before we switch the latching order checks on */ + os_thread_sleep(1000000); + + /* Switch latching order checks on in sync0sync.c */ + sync_order_checks_on = TRUE; +#endif if (srv_force_recovery < SRV_FORCE_NO_TRX_UNDO) { /* Rollback the uncommitted transactions which have no user session */ diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c index aeaa83daa4d..1fba0abcdaf 100644 --- a/storage/innobase/row/row0ins.c +++ b/storage/innobase/row/row0ins.c @@ -1524,7 +1524,8 @@ row_ins_check_foreign_constraints( if (foreign->foreign_index == index) { if (foreign->referenced_table == NULL) { - dict_table_get(foreign->referenced_table_name); + dict_table_get(foreign->referenced_table_name, + FALSE); } if (0 == trx->dict_operation_lock_mode) { diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index c6b117cdafa..bee9f1472ce 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -1831,7 +1831,9 @@ stop_for_a_while: mtr_commit(&mtr); +#ifdef UNIV_SYNC_DEBUG ut_ad(sync_thread_levels_empty_gen(TRUE)); +#endif /* UNIV_SYNC_DEBUG */ err = DB_SUCCESS; goto func_exit; @@ -1850,7 +1852,9 @@ commit_mtr_for_a_while: leaf_contains_updates = FALSE; mtr_has_extra_clust_latch = FALSE; +#ifdef UNIV_SYNC_DEBUG ut_ad(sync_thread_levels_empty_gen(TRUE)); +#endif /* UNIV_SYNC_DEBUG */ goto table_loop; @@ -1866,7 +1870,9 @@ lock_wait_or_error: mtr_commit(&mtr); +#ifdef UNIV_SYNC_DEBUG ut_ad(sync_thread_levels_empty_gen(TRUE)); +#endif /* UNIV_SYNC_DEBUG */ func_exit: if (UNIV_LIKELY_NULL(heap)) { @@ -4447,7 +4453,7 @@ row_search_check_if_query_cache_permitted( dict_table_t* table; ibool ret = FALSE; - table = dict_table_get(norm_name); + table = dict_table_get(norm_name, FALSE); if (table == NULL) { diff --git a/storage/innobase/row/row0upd.c b/storage/innobase/row/row0upd.c index 6533ac93d7d..c91cc449b96 100644 --- a/storage/innobase/row/row0upd.c +++ b/storage/innobase/row/row0upd.c @@ -202,7 +202,8 @@ row_upd_check_references_constraints( foreign->n_fields))) { if (foreign->foreign_table == NULL) { - dict_table_get(foreign->foreign_table_name); + dict_table_get(foreign->foreign_table_name, + FALSE); } if (foreign->foreign_table) { diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c index 5eaea26b75d..25f6f05e878 100644 --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c @@ -1601,17 +1601,6 @@ innobase_start_or_create_for_mysql(void) srv_was_started = TRUE; srv_is_being_started = FALSE; -#ifdef UNIV_DEBUG - /* Wait a while so that the created threads have time to suspend - themselves before we switch sync debugging on; otherwise a thread may - execute mutex_enter() before the checks are on, and mutex_exit() after - the checks are on, which will cause an assertion failure in sync - debug. */ - - os_thread_sleep(3000000); -#endif - sync_order_checks_on = TRUE; - if (trx_doublewrite == NULL) { /* Create the doublewrite buffer to a new tablespace */ diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c index 441933843d7..549ad36271b 100644 --- a/storage/innobase/sync/sync0rw.c +++ b/storage/innobase/sync/sync0rw.c @@ -89,11 +89,14 @@ void rw_lock_create_func( /*================*/ rw_lock_t* lock, /* in: pointer to memory */ - ulint level __attribute__((unused)), - /* in: level */ +#ifdef UNIV_DEBUG +# ifdef UNIV_SYNC_DEBUG + ulint level, /* in: level */ +# endif /* UNIV_SYNC_DEBUG */ + const char* cmutex_name, /* in: mutex name */ +#endif /* UNIV_DEBUG */ const char* cfile_name, /* in: file name where created */ - ulint cline, /* in: file line where created */ - const char* cmutex_name) /* in: mutex name */ + ulint cline) /* in: file line where created */ { /* If this is the very first time a synchronization object is created, then the following call initializes the sync system. */ @@ -103,10 +106,10 @@ rw_lock_create_func( lock->mutex.cfile_name = cfile_name; lock->mutex.cline = cline; -#ifndef UNIV_HOTBACKUP +#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP lock->mutex.cmutex_name = cmutex_name; lock->mutex.mutex_type = 1; -#endif /* !UNIV_HOTBACKUP */ +#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */ rw_lock_set_waiters(lock, 0); rw_lock_set_writer(lock, RW_LOCK_NOT_LOCKED); diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c index ff7056b0afe..c0198469491 100644 --- a/storage/innobase/sync/sync0sync.c +++ b/storage/innobase/sync/sync0sync.c @@ -108,8 +108,6 @@ will set the waiters field to 0 in mutex_exit, and then call sync_array_signal_object with the mutex as an argument. Q.E.D. */ -ulint sync_dummy = 0; - /* The number of system calls made in this module. Intended for performance monitoring. */ @@ -133,6 +131,7 @@ ibool sync_initialized = FALSE; typedef struct sync_level_struct sync_level_t; typedef struct sync_thread_struct sync_thread_t; +#ifdef UNIV_SYNC_DEBUG /* The latch levels currently owned by threads are stored in this data structure; the size of this array is OS_THREAD_MAX_N */ @@ -140,6 +139,7 @@ sync_thread_t* sync_thread_level_arrays; /* Mutex protecting sync_thread_level_arrays */ mutex_t sync_thread_mutex; +#endif /* UNIV_SYNC_DEBUG */ /* Global list of database mutexes (not OS mutexes) created. */ ut_list_base_node_t mutex_list; @@ -147,11 +147,10 @@ ut_list_base_node_t mutex_list; /* Mutex protecting the mutex_list variable */ mutex_t mutex_list_mutex; +#ifdef UNIV_SYNC_DEBUG /* Latching order checks start when this is set TRUE */ ibool sync_order_checks_on = FALSE; - -/* Dummy mutex used to implement mutex_fence */ -mutex_t dummy_mutex_for_fence; +#endif /* UNIV_SYNC_DEBUG */ struct sync_thread_struct{ os_thread_id_t id; /* OS thread id */ @@ -202,10 +201,14 @@ void mutex_create_func( /*==============*/ mutex_t* mutex, /* in: pointer to memory */ +#ifdef UNIV_DEBUG + const char* cmutex_name, /* in: mutex name */ +# ifdef UNIV_SYNC_DEBUG ulint level, /* in: level */ +# endif /* UNIV_SYNC_DEBUG */ +#endif /* UNIV_DEBUG */ const char* cfile_name, /* in: file name where created */ - ulint cline, /* in: file line where created */ - const char* cmutex_name) /* in: mutex name */ + ulint cline) /* in: file line where created */ { #if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER) mutex_reset_lock_word(mutex); @@ -214,15 +217,19 @@ mutex_create_func( mutex->lock_word = 0; #endif mutex_set_waiters(mutex, 0); +#ifdef UNIV_DEBUG mutex->magic_n = MUTEX_MAGIC_N; +#endif /* UNIV_DEBUG */ #ifdef UNIV_SYNC_DEBUG mutex->line = 0; mutex->file_name = "not yet reserved"; -#endif /* UNIV_SYNC_DEBUG */ mutex->level = level; +#endif /* UNIV_SYNC_DEBUG */ mutex->cfile_name = cfile_name; mutex->cline = cline; #ifndef UNIV_HOTBACKUP + mutex->count_os_wait = 0; +# ifdef UNIV_DEBUG mutex->cmutex_name= cmutex_name; mutex->count_using= 0; mutex->mutex_type= 0; @@ -230,8 +237,8 @@ mutex_create_func( mutex->lmax_spent_time= 0; mutex->count_spin_loop= 0; mutex->count_spin_rounds= 0; - mutex->count_os_wait= 0; mutex->count_os_yield= 0; +# endif /* UNIV_DEBUG */ #endif /* !UNIV_HOTBACKUP */ /* Check that lock_word is aligned; this is important on Intel */ @@ -239,16 +246,19 @@ mutex_create_func( /* NOTE! The very first mutexes are not put to the mutex list */ - if ((mutex == &mutex_list_mutex) || (mutex == &sync_thread_mutex)) { + if ((mutex == &mutex_list_mutex) +#ifdef UNIV_SYNC_DEBUG + || (mutex == &sync_thread_mutex) +#endif /* UNIV_SYNC_DEBUG */ + ) { return; } mutex_enter(&mutex_list_mutex); - if (UT_LIST_GET_LEN(mutex_list) > 0) { - ut_a(UT_LIST_GET_FIRST(mutex_list)->magic_n == MUTEX_MAGIC_N); - } + ut_ad(UT_LIST_GET_LEN(mutex_list) == 0 + || UT_LIST_GET_FIRST(mutex_list)->magic_n == MUTEX_MAGIC_N); UT_LIST_ADD_FIRST(list, mutex_list, mutex); @@ -265,24 +275,24 @@ mutex_free( /*=======*/ mutex_t* mutex) /* in: mutex */ { -#ifdef UNIV_DEBUG - ut_a(mutex_validate(mutex)); -#endif /* UNIV_DEBUG */ + ut_ad(mutex_validate(mutex)); ut_a(mutex_get_lock_word(mutex) == 0); ut_a(mutex_get_waiters(mutex) == 0); - if (mutex != &mutex_list_mutex && mutex != &sync_thread_mutex) { + if (mutex != &mutex_list_mutex +#ifdef UNIV_SYNC_DEBUG + && mutex != &sync_thread_mutex +#endif /* UNIV_SYNC_DEBUG */ + ) { mutex_enter(&mutex_list_mutex); - if (UT_LIST_GET_PREV(list, mutex)) { - ut_a(UT_LIST_GET_PREV(list, mutex)->magic_n - == MUTEX_MAGIC_N); - } - if (UT_LIST_GET_NEXT(list, mutex)) { - ut_a(UT_LIST_GET_NEXT(list, mutex)->magic_n - == MUTEX_MAGIC_N); - } + ut_ad(!UT_LIST_GET_PREV(list, mutex) + || UT_LIST_GET_PREV(list, mutex)->magic_n + == MUTEX_MAGIC_N); + ut_ad(!UT_LIST_GET_NEXT(list, mutex) + || UT_LIST_GET_NEXT(list, mutex)->magic_n + == MUTEX_MAGIC_N); UT_LIST_REMOVE(list, mutex_list, mutex); @@ -295,8 +305,9 @@ mutex_free( /* If we free the mutex protecting the mutex list (freeing is not necessary), we have to reset the magic number AFTER removing it from the list. */ - +#ifdef UNIV_DEBUG mutex->magic_n = 0; +#endif /* UNIV_DEBUG */ } /************************************************************************ @@ -328,6 +339,7 @@ mutex_enter_nowait( return(1); } +#ifdef UNIV_DEBUG /********************************************************************** Checks that the mutex has been initialized. */ @@ -341,6 +353,7 @@ mutex_validate( return(TRUE); } +#endif /* UNIV_DEBUG */ /********************************************************************** Sets the waiters field in a mutex. */ @@ -376,13 +389,13 @@ mutex_spin_wait( { ulint index; /* index of the reserved wait cell */ ulint i; /* spin round count */ -#ifndef UNIV_HOTBACKUP +#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP ib_longlong lstart_time = 0, lfinish_time; /* for timing os_wait */ ulint ltime_diff; ulint sec; ulint ms; uint timer_started = 0; -#endif /* !UNIV_HOTBACKUP */ +#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */ ut_ad(mutex); mutex_loop: @@ -396,10 +409,10 @@ mutex_loop: a memory word. */ spin_loop: -#ifndef UNIV_HOTBACKUP +#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP mutex_spin_wait_count++; mutex->count_spin_loop++; -#endif /* !UNIV_HOTBACKUP */ +#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */ while (mutex_get_lock_word(mutex) != 0 && i < SYNC_SPIN_ROUNDS) { if (srv_spin_wait_delay) { @@ -410,14 +423,14 @@ spin_loop: } if (i == SYNC_SPIN_ROUNDS) { -#ifndef UNIV_HOTBACKUP +#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP mutex->count_os_yield++; if (timed_mutexes == 1 && timer_started==0) { ut_usectime(&sec, &ms); lstart_time= (ib_longlong)sec * 1000000 + ms; timer_started = 1; } -#endif /* !UNIV_HOTBACKUP */ +#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */ os_thread_yield(); } @@ -431,9 +444,9 @@ spin_loop: mutex_spin_round_count += i; -#ifndef UNIV_HOTBACKUP +#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP mutex->count_spin_rounds += i; -#endif /* !UNIV_HOTBACKUP */ +#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */ if (mutex_test_and_set(mutex) == 0) { /* Succeeded! */ @@ -514,6 +527,7 @@ spin_loop: #ifndef UNIV_HOTBACKUP mutex->count_os_wait++; +# ifdef UNIV_DEBUG /* !!!!! Sometimes os_wait can be called without os_thread_yield */ if (timed_mutexes == 1 && timer_started==0) { @@ -521,13 +535,14 @@ spin_loop: lstart_time= (ib_longlong)sec * 1000000 + ms; timer_started = 1; } +# endif /* UNIV_DEBUG */ #endif /* !UNIV_HOTBACKUP */ sync_array_wait_event(sync_primary_wait_array, index); goto mutex_loop; finish_timing: -#ifndef UNIV_HOTBACKUP +#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP if (timed_mutexes == 1 && timer_started==1) { ut_usectime(&sec, &ms); lfinish_time= (ib_longlong)sec * 1000000 + ms; @@ -539,7 +554,7 @@ finish_timing: mutex->lmax_spent_time= ltime_diff; } } -#endif /* !UNIV_HOTBACKUP */ +#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */ return; } @@ -598,9 +613,7 @@ mutex_get_debug_info( *line = mutex->line; *thread_id = mutex->thread_id; } -#endif /* UNIV_SYNC_DEBUG */ -#ifdef UNIV_SYNC_DEBUG /********************************************************************** Checks that the current thread owns the mutex. Works only in the debug version. */ @@ -611,7 +624,7 @@ mutex_own( /* out: TRUE if owns */ mutex_t* mutex) /* in: mutex */ { - ut_a(mutex_validate(mutex)); + ut_ad(mutex_validate(mutex)); if (mutex_get_lock_word(mutex) != 1) { @@ -710,7 +723,6 @@ sync_all_freed(void) { return(mutex_n_reserved() + rw_lock_n_locked() == 0); } -#endif /* UNIV_SYNC_DEBUG */ /********************************************************************** Gets the value in the nth slot in the thread level arrays. */ @@ -834,7 +846,6 @@ sync_thread_levels_g( (ulong) mutex->cline); if (mutex_get_lock_word(mutex) != 0) { -#ifdef UNIV_SYNC_DEBUG const char* file_name; ulint line; os_thread_id_t thread_id; @@ -852,19 +863,11 @@ sync_thread_levels_g( thread_id), file_name, (ulong) line); -#else /* UNIV_SYNC_DEBUG */ - fprintf(stderr, - "InnoDB: Locked mutex:" - " addr %p\n", - (void*) mutex); -#endif /* UNIV_SYNC_DEBUG */ } else { fputs("Not locked\n", stderr); } } else { -#ifdef UNIV_SYNC_DEBUG rw_lock_print(lock); -#endif /* UNIV_SYNC_DEBUG */ } return(FALSE); @@ -996,9 +999,7 @@ sync_thread_add_level( if ((latch == (void*)&sync_thread_mutex) || (latch == (void*)&mutex_list_mutex) -#ifdef UNIV_SYNC_DEBUG || (latch == (void*)&rw_lock_debug_mutex) -#endif /* UNIV_SYNC_DEBUG */ || (latch == (void*)&rw_lock_list_mutex)) { return; @@ -1219,9 +1220,7 @@ sync_thread_reset_level( if ((latch == (void*)&sync_thread_mutex) || (latch == (void*)&mutex_list_mutex) -#ifdef UNIV_SYNC_DEBUG || (latch == (void*)&rw_lock_debug_mutex) -#endif /* UNIV_SYNC_DEBUG */ || (latch == (void*)&rw_lock_list_mutex)) { return(FALSE); @@ -1260,6 +1259,7 @@ sync_thread_reset_level( return(FALSE); } +#endif /* UNIV_SYNC_DEBUG */ /********************************************************************** Initializes the synchronization data structures. */ @@ -1268,8 +1268,10 @@ void sync_init(void) /*===========*/ { +#ifdef UNIV_SYNC_DEBUG sync_thread_t* thread_slot; ulint i; +#endif /* UNIV_SYNC_DEBUG */ ut_a(sync_initialized == FALSE); @@ -1280,7 +1282,7 @@ sync_init(void) sync_primary_wait_array = sync_array_create(OS_THREAD_MAX_N, SYNC_ARRAY_OS_MUTEX); - +#ifdef UNIV_SYNC_DEBUG /* Create the thread latch level array where the latch levels are stored for each OS thread */ @@ -1291,13 +1293,14 @@ sync_init(void) thread_slot = sync_thread_level_arrays_get_nth(i); thread_slot->levels = NULL; } - +#endif /* UNIV_SYNC_DEBUG */ /* Init the mutex list and create the mutex to protect it. */ UT_LIST_INIT(mutex_list); mutex_create(&mutex_list_mutex, SYNC_NO_ORDER_CHECK); - +#ifdef UNIV_SYNC_DEBUG mutex_create(&sync_thread_mutex, SYNC_NO_ORDER_CHECK); +#endif /* UNIV_SYNC_DEBUG */ /* Init the rw-lock list and create the mutex to protect it. */ @@ -1332,7 +1335,9 @@ sync_close(void) } mutex_free(&mutex_list_mutex); +#ifdef UNIV_SYNC_DEBUG mutex_free(&sync_thread_mutex); +#endif /* UNIV_SYNC_DEBUG */ } /*********************************************************************** diff --git a/storage/innobase/trx/trx0roll.c b/storage/innobase/trx/trx0roll.c index 1b00ae63ecd..201d1be3656 100644 --- a/storage/innobase/trx/trx0roll.c +++ b/storage/innobase/trx/trx0roll.c @@ -131,8 +131,26 @@ trx_rollback_for_mysql( trx->op_info = "rollback"; - err = trx_general_rollback_for_mysql(trx, FALSE, NULL); + /* If we are doing the XA recovery of prepared transactions, then + the transaction object does not have an InnoDB session object, and we + set a dummy session that we use for all MySQL transactions. */ + mutex_enter(&kernel_mutex); + + if (trx->sess == NULL) { + /* Open a dummy session */ + + if (!trx_dummy_sess) { + trx_dummy_sess = sess_open(); + } + + trx->sess = trx_dummy_sess; + } + + mutex_exit(&kernel_mutex); + + err = trx_general_rollback_for_mysql(trx, FALSE, NULL); + trx->op_info = ""; return(err); diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c index 4d0a26b5757..cfa2b01f406 100644 --- a/storage/innobase/trx/trx0trx.c +++ b/storage/innobase/trx/trx0trx.c @@ -1598,6 +1598,24 @@ trx_commit_for_mysql( trx->op_info = "committing"; + /* If we are doing the XA recovery of prepared transactions, then + the transaction object does not have an InnoDB session object, and we + set the dummy session that we use for all MySQL transactions. */ + + mutex_enter(&kernel_mutex); + + if (trx->sess == NULL) { + /* Open a dummy session */ + + if (!trx_dummy_sess) { + trx_dummy_sess = sess_open(); + } + + trx->sess = trx_dummy_sess; + } + + mutex_exit(&kernel_mutex); + trx_start_if_not_started(trx); mutex_enter(&kernel_mutex); @@ -1761,11 +1779,10 @@ trx_print( || mem_heap_get_size(trx->lock_heap) > 400) { newline = TRUE; - fprintf(f, "%lu lock struct(s), heap size %lu", + fprintf(f, "%lu lock struct(s), heap size %lu," + " %lu row lock(s)", (ulong) UT_LIST_GET_LEN(trx->trx_locks), - (ulong) mem_heap_get_size(trx->lock_heap)); - - fprintf(f, "%lu row lock(s)", + (ulong) mem_heap_get_size(trx->lock_heap), (ulong) lock_number_of_rows_locked(trx)); } From 528b457644eb6907c9b25c5842d9824451ca6091 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Fri, 5 Jan 2007 16:53:03 +0100 Subject: [PATCH 16/24] mysql.spec.sh, make_binary_distribution.sh: Add CFLAGS to gcc call with --print-libgcc-file, to make sure the correct "libgcc.a" path is returned for the 32/64 bit architecture --- scripts/make_binary_distribution.sh | 2 +- support-files/mysql.spec.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 6359eb009ce..917ac0a19c1 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -322,7 +322,7 @@ BASE=$BASE2 # if [ x"@GXX@" = x"yes" ] ; then - gcclib=`@CC@ --print-libgcc-file` + gcclib=`@CC@ @CFLAGS@ --print-libgcc-file` if [ $? -ne 0 ] ; then echo "Warning: Couldn't find libgcc.a!" else diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 083b89d9275..02176ea0b41 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -340,7 +340,7 @@ install -m 644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql/ # Include libgcc.a in the devel subpackage (BUG 4921) if expr "$CC" : ".*gcc.*" > /dev/null ; then - libgcc=`$CC --print-libgcc-file` + libgcc=`$CC $CFLAGS --print-libgcc-file` if [ -f $libgcc ] then %define have_libgcc 1 @@ -726,6 +726,11 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Fri Jan 05 2007 Kent Boortz + +- Add CFLAGS to gcc call with --print-libgcc-file, to make sure the + correct "libgcc.a" path is returned for the 32/64 bit architecture. + * Thu Dec 14 2006 Joerg Bruehe - Include the new man pages for "my_print_defaults" and "mysql_tzinfo_to_sql" From 68d6f7ae52f5de3eaeeb6ee76de2f1d0066af19c Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Mon, 8 Jan 2007 18:33:55 +0100 Subject: [PATCH 17/24] Changes necessary to build version 4.0.28: - "make_binary_distribution" accepts a dummy "--platform=" argument. - "MySQL-shared-compat.spec" uses a "version40" define symbol internally. --- scripts/make_binary_distribution.sh | 1 + support-files/MySQL-shared-compat.spec.sh | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 5748c024387..cb9e8ecbb91 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -27,6 +27,7 @@ parse_arguments() { --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --no-strip) STRIP=0 ;; --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; + --platform=*) echo "Ignoring argument '$arg', continuing" ;; --silent) SILENT=1 ;; *) echo "Unknown argument '$arg'" diff --git a/support-files/MySQL-shared-compat.spec.sh b/support-files/MySQL-shared-compat.spec.sh index 068daadab58..d851873e687 100644 --- a/support-files/MySQL-shared-compat.spec.sh +++ b/support-files/MySQL-shared-compat.spec.sh @@ -26,7 +26,7 @@ # # Change this to match the version of the shared libs you want to include # -%define version4 @MYSQL_NO_DASH_VERSION@ +%define version40 @MYSQL_NO_DASH_VERSION@ %define version3 3.23.58 Name: MySQL-shared-compat @@ -36,13 +36,13 @@ License: GPL Group: Applications/Databases URL: http://www.mysql.com/ Autoreqprov: on -Version: %{version4} +Version: %{version40} Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Obsoletes: MySQL-shared, mysql-shared Provides: MySQL-shared -Summary: MySQL shared libraries for MySQL %{version4} and %{version3} -Source0: MySQL-shared-%{version4}-0.%{_arch}.rpm +Summary: MySQL shared libraries for MySQL %{version40} and %{version3} +Source0: MySQL-shared-%{version40}-0.%{_arch}.rpm Source1: MySQL-shared-%{version3}-1.%{_arch}.rpm # No need to include the RPMs once more - they can be downloaded seperately # if you want to rebuild this package @@ -52,7 +52,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %description This package includes the shared libraries for both MySQL %{version3} and -MySQL %{version4}. Install this package instead of "MySQL-shared", if you +MySQL %{version40}. Install this package instead of "MySQL-shared", if you have applications installed that are dynamically linked against MySQL 3.23.xx but you want to upgrade to MySQL 4.0.xx without breaking the library dependencies. From cca28699c81e6e523cb026b8b653315f75383c37 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Tue, 9 Jan 2007 12:21:06 +0100 Subject: [PATCH 18/24] configure.in : Fix a wrong comment. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index a799780d6ed..53cf94e08b7 100644 --- a/configure.in +++ b/configure.in @@ -6,7 +6,7 @@ AC_PREREQ(2.52)dnl Minimum Autoconf version required. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! -# remember to also change ndb version below and update version.c in ndb +# remember to also update version.c in ndb AM_INIT_AUTOMAKE(mysql, 5.1.15-beta) AM_CONFIG_HEADER(config.h) From 090699345776cd31d3ee004d539fd181766ea084 Mon Sep 17 00:00:00 2001 From: "thek@kpdesk.mysql.com" <> Date: Tue, 9 Jan 2007 12:28:46 +0100 Subject: [PATCH 19/24] Cset exclude: thek@kpdesk.mysql.com|ChangeSet|20061106104152|07628 --- mysys/mf_iocache.c | 6 +----- mysys/my_seek.c | 5 ----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 5f0069d9bed..a7937da0cc2 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -313,11 +313,7 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, if (info->type == READ_CACHE) { info->write_end=info->write_buffer+info->buffer_length; - /* - Trigger a new seek only if we have a valid - file handle. - */ - info->seek_not_done= (info->file >= 0); + info->seek_not_done=1; } info->end_of_file = ~(my_off_t) 0; } diff --git a/mysys/my_seek.c b/mysys/my_seek.c index f47383b7ace..ec24a26b3d9 100644 --- a/mysys/my_seek.c +++ b/mysys/my_seek.c @@ -30,11 +30,6 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, whence, MyFlags)); DBUG_ASSERT(pos != MY_FILEPOS_ERROR); /* safety check */ - /* - Make sure we are using a valid file descriptor - */ - DBUG_ASSERT(fd >= 0); - newpos=lseek(fd, pos, whence); if (newpos == (os_off_t) -1) { From 46a8d14e21887365823977bf631ae2ecb4e8a358 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Tue, 9 Jan 2007 17:21:54 +0100 Subject: [PATCH 20/24] Version 4.0 is in "extended maintenance" by now, and so no future build of it will include Berkeley DB: Remove it from the Windows VC++ project files. --- VC++Files/libmysqld/libmysqld.dsp | 6 +++--- VC++Files/mysql.dsw | 18 ------------------ VC++Files/mysqldemb/mysqldemb.dsp | 10 +++++----- VC++Files/mysqlserver/mysqlserver.dsp | 4 ++-- VC++Files/sql/mysqld.dsp | 12 ++++++------ VC++Files/sql/mysqldmax.dsp | 6 +++--- 6 files changed, 19 insertions(+), 37 deletions(-) diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp index 2d6800de9dc..b5eb0a793c2 100644 --- a/VC++Files/libmysqld/libmysqld.dsp +++ b/VC++Files/libmysqld/libmysqld.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FR /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x416 /d "NDEBUG" @@ -55,7 +55,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "libmysqld - Win32 Debug" @@ -72,7 +72,7 @@ LINK32=xilink6.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "SAFEMALLOC" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /D "WIN32" /D "SAFEMALLOC" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c +# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../sql" /I "../regex" /D "WIN32" /D "SAFEMALLOC" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x416 /d "_DEBUG" diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index 6bc9f2e8cb8..a0635447439 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -18,18 +18,6 @@ Package=<4> ############################################################################### -Project: "bdb"=".\bdb\bdb.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - Project: "comp_err"=".\comp_err\comp_err.dsp" - Package Owner=<4> Package=<5> @@ -143,9 +131,6 @@ Package=<5> Package=<4> {{{ - Begin Project Dependency - Project_Dep_Name bdb - End Project Dependency Begin Project Dependency Project_Dep_Name dbug End Project Dependency @@ -489,9 +474,6 @@ Package=<4> Project_Dep_Name myisammrg End Project Dependency Begin Project Dependency - Project_Dep_Name bdb - End Project Dependency - Begin Project Dependency Project_Dep_Name vio End Project Dependency Begin Project Dependency diff --git a/VC++Files/mysqldemb/mysqldemb.dsp b/VC++Files/mysqldemb/mysqldemb.dsp index 85b9c6ad116..a60d94b25b6 100644 --- a/VC++Files/mysqldemb/mysqldemb.dsp +++ b/VC++Files/mysqldemb/mysqldemb.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" @@ -67,7 +67,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "_DEBUG" # ADD RSC /l 0x416 /d "_DEBUG" @@ -92,7 +92,7 @@ LIB32=xilink6.exe -lib # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "USE_TLS" /D "__WIN__" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "USE_TLS" /D "__WIN__" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" @@ -115,9 +115,9 @@ LIB32=xilink6.exe -lib # PROP Output_Dir "pro" # PROP Intermediate_Dir "pro" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c +# ADD BASE CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "EMBEDDED_LIBRARY" /D "USE_TLS" /D "__WIN__" /D "USE_SYMDIR" /D "MYSQL_SERVER" /D LICENSE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /FD /D MYSQL_SERVER_SUFFIX=-pro /c +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "EMBEDDED_LIBRARY" /D "USE_TLS" /D "__WIN__" /D "USE_SYMDIR" /D "MYSQL_SERVER" /D LICENSE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /FD /D MYSQL_SERVER_SUFFIX=-pro /c # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" BSC32=bscmake.exe diff --git a/VC++Files/mysqlserver/mysqlserver.dsp b/VC++Files/mysqlserver/mysqlserver.dsp index 9c23975f5f6..ff0e39e7a60 100644 --- a/VC++Files/mysqlserver/mysqlserver.dsp +++ b/VC++Files/mysqlserver/mysqlserver.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "NDEBUG" /YX /FD /c +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "NDEBUG" /YX /FD /c # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" BSC32=bscmake.exe @@ -64,7 +64,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /YX /FD /GZ /c # ADD BASE RSC /l 0x416 /d "_DEBUG" # ADD RSC /l 0x416 /d "_DEBUG" BSC32=bscmake.exe diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index 3198c918a5e..ed35c9aef4e 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -75,7 +75,7 @@ LINK32=xilink6.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../regex" /I "../bdb/build_win32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../regex" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c # SUBTRACT CPP /Fr /YX # ADD BASE RSC /l 0x410 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" @@ -84,7 +84,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept !ELSEIF "$(CFG)" == "mysqld - Win32 nt" @@ -130,7 +130,7 @@ LINK32=xilink6.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../bdb/build_win32" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "_WINDOWS" /D "_CONSOLE" /D "HAVE_DLOPEN" /D "NDEBUG" /D "MYSQL_SERVER" /D "_MBCS" /FD /D MYSQL_SERVER_SUFFIX=-nt-max /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "HAVE_DLOPEN" /D "NDEBUG" /D "MYSQL_SERVER" /D "_MBCS" /FD /D MYSQL_SERVER_SUFFIX=-nt-max /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -140,7 +140,7 @@ BSC32=bscmake.exe LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe" # SUBTRACT BASE LINK32 /pdb:none /debug -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-max-nt.exe" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib ..\lib_release\innodb.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-max-nt.exe" # SUBTRACT LINK32 /pdb:none /debug !ELSEIF "$(CFG)" == "mysqld - Win32 Max" @@ -159,7 +159,7 @@ LINK32=xilink6.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../bdb/build_win32" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /D MYSQL_SERVER_SUFFIX=-max /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "HAVE_INNOBASE_DB" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /D MYSQL_SERVER_SUFFIX=-max /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -168,7 +168,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"../client_release/mysqld-opt.exe" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-max.exe" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-max.exe" # SUBTRACT LINK32 /debug !ELSEIF "$(CFG)" == "mysqld - Win32 classic" diff --git a/VC++Files/sql/mysqldmax.dsp b/VC++Files/sql/mysqldmax.dsp index 24ea83159d9..1f2354a6661 100644 --- a/VC++Files/sql/mysqldmax.dsp +++ b/VC++Files/sql/mysqldmax.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "HAVE_INNOBASE_DB" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_INNOBASE_DB" /FD /c # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -67,7 +67,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../regex" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "HAVE_INNOBASE_DB" /FR /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../regex" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_INNOBASE_DB" /FR /FD /c # ADD BASE RSC /l 0x416 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -92,7 +92,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "HAVE_INNOBASE_DB" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_INNOBASE_DB" /FD /c # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe From b63c167f6607a9a2cc671d578a0eb33bced72698 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Wed, 10 Jan 2007 00:36:41 +0100 Subject: [PATCH 21/24] support-files/MySQL-shared-compat.spec.sh : Dummy, irrelevant change - just trigger a new build. --- support-files/MySQL-shared-compat.spec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-files/MySQL-shared-compat.spec.sh b/support-files/MySQL-shared-compat.spec.sh index 37733141451..14a98616863 100644 --- a/support-files/MySQL-shared-compat.spec.sh +++ b/support-files/MySQL-shared-compat.spec.sh @@ -29,7 +29,7 @@ # Change this to match the version of the shared libs you want to include # %define version50 @MYSQL_NO_DASH_VERSION@ -%define version41 4.1.16 +%define version41 4.1.17 %define version40 4.0.26 %define version3 3.23.58 From bac65ee90a724278b76b27da12c0728b7427324c Mon Sep 17 00:00:00 2001 From: "tsmith@siva.hindu.god" <> Date: Tue, 9 Jan 2007 19:22:01 -0700 Subject: [PATCH 22/24] WL #3670: Compile-time option to remove GRANT-related startup options - configure --disable-grant-options defines DISABLE_GRANT_OPTIONS - configure.js/cmake also updated - if DISABLE_GRANT_OPTIONS is defined, mysqld no longer recognizes: --bootstrap --init-file --skip-grant-tables Scripts which rely on those three options are modified to check the environment for MYSQLD_BOOTSTRAP; it should be set to the full path of a mysqld which does handle those options. For example: $ export MYSQLD_BOOTSTRAP $ MYSQLD_BOOTSTRAP=/path/to/full/MySQL/bin/mysqld $ mysql_install_db $ make test --- configure.in | 16 ++++++++++++++++ mysql-test/install_test_db.sh | 14 ++++++++++---- mysql-test/mysql-test-run.pl | 11 +++++++++-- mysql-test/mysql_test_run_new.c | 8 ++++++++ scripts/mysql_install_db.sh | 3 ++- sql/CMakeLists.txt | 4 ++++ sql/mysqld.cc | 6 ++++++ win/README | 3 +++ win/configure.js | 1 + 9 files changed, 59 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index f6a6eedac70..19fe70c0c4d 100644 --- a/configure.in +++ b/configure.in @@ -713,6 +713,22 @@ else AC_MSG_RESULT([no]) fi +# If we should allow init-file and skip-grant-table options +AC_MSG_CHECKING(If we should should enable init-file and skip-grant-table options) +AC_ARG_ENABLE(grant-options, + [ --disable-grant-options Disables the use of --init-file and --skip-grant-tables options], + [ mysql_grant_options_enabled=$enableval ], + [ mysql_grant_options_enabled=no ] + ) +if test "$mysql_grant_options_enabled" = "yes" +then + AC_MSG_RESULT([yes]) +else + AC_DEFINE([DISABLE_GRANT_OPTIONS], [1], + [Disables the use of --init-file and --skip-grant-tables options]) + AC_MSG_RESULT([no]) +fi + MYSQL_SYS_LARGEFILE # Types that must be checked AFTER large file support is checked diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh index c30583503dc..7e5d232ef6f 100644 --- a/mysql-test/install_test_db.sh +++ b/mysql-test/install_test_db.sh @@ -55,14 +55,17 @@ fi mdata=$data/mysql EXTRA_ARG="" -if test ! -x $execdir/mysqld +mysqld= +if test -x $execdir/mysqld then + mysqld=$execdir/mysqld +else if test ! -x $libexecdir/mysqld then echo "mysqld is missing - looked in $execdir and in $libexecdir" exit 1 else - execdir=$libexecdir + mysqld=$libexecdir/mysqld fi fi @@ -88,8 +91,11 @@ basedir=. EXTRA_ARG="--language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/" fi -mysqld_boot=" $execdir/mysqld --no-defaults --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata --skip-innodb --skip-ndbcluster --skip-bdb \ +mysqld_boot="${MYSQLD_BOOTSTRAP-$mysqld}" + +mysqld_boot="$mysqld_boot --no-defaults --bootstrap --skip-grant-tables \ + --basedir=$basedir --datadir=$ldata \ + --skip-innodb --skip-ndbcluster --skip-bdb \ $EXTRA_ARG" echo "running $mysqld_boot" diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 36f5b0a776f..b56b385a2bf 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2873,12 +2873,19 @@ sub install_db ($$) { mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); } + # If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g., + # configure --disable-grant-options), mysqld will not recognize the + # --bootstrap or --skip-grant-tables options. The user can set + # MYSQLD_BOOTSTRAP to the full path to a mysqld which does accept + # --bootstrap, to accommodate this. + my $exe_mysqld_bootstrap = $ENV{'MYSQLD_BOOTSTRAP'} || $exe_mysqld; + # Log bootstrap command my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log"; mtr_tofile($path_bootstrap_log, - "$exe_mysqld " . join(" ", @$args) . "\n"); + "$exe_mysqld_bootstrap " . join(" ", @$args) . "\n"); - if ( mtr_run($exe_mysqld, $args, $init_db_sql_tmp, + if ( mtr_run($exe_mysqld_bootstrap, $args, $init_db_sql_tmp, $path_bootstrap_log, $path_bootstrap_log, "", { append_log_file => 1 }) != 0 ) diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index 79db71fa274..f9c0045472d 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -292,6 +292,14 @@ void install_db(char *datadir) die("Unable to create init_db.sql."); /* args */ init_args(&al); + /* + XXX: If mysqld is compiled with DISABLE_GRANT_OPTIONS defined, it + will not recognize the --bootstrap, --init-file or --skip-grant- + tables options. If this is needed here, please check + MYSQLD_BOOTSTRAP in the environment, and use its value instead of + mysqld_file if it is set. See mysql-test-run.pl and + mysql_install_db. + */ add_arg(&al, mysqld_file); add_arg(&al, "--no-defaults"); add_arg(&al, "--bootstrap"); diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index e43b586054e..53324f59f53 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -224,7 +224,8 @@ if test "$in_rpm" -eq 0 -a "$windows" -eq 0 then echo "Installing all prepared tables" fi -mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ +mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" +mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ --skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 9b2fae847d6..e77ac3d3a93 100755 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -25,6 +25,10 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc ADD_DEFINITIONS(-DHAVE_INNOBASE -DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN) + +IF(DISABLE_GRANT_OPTIONS) + ADD_DEFINITIONS(-DDISABLE_GRANT_OPTIONS) +ENDIF(DISABLE_GRANT_OPTIONS) ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc discover.cc ../libmysql/errmsg.c field.cc field_conv.cc diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5890a2af21d..687e59204fa 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4775,8 +4775,10 @@ Disable with --skip-bdb (will save memory).", {"binlog-ignore-db", OPT_BINLOG_IGNORE_DB, "Tells the master that updates to the given database should not be logged tothe binary log.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#ifndef DISABLE_GRANT_OPTIONS {"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#endif {"character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE, "Don't ignore client side character set value sent during handshake.", (gptr*) &opt_character_set_client_handshake, @@ -4892,9 +4894,11 @@ Disable with --skip-large-pages.", {"init-connect", OPT_INIT_CONNECT, "Command(s) that are executed for each new connection", (gptr*) &opt_init_connect, (gptr*) &opt_init_connect, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#ifndef DISABLE_GRANT_OPTIONS {"init-file", OPT_INIT_FILE, "Read SQL commands from this file at startup.", (gptr*) &opt_init_file, (gptr*) &opt_init_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#endif {"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"init-slave", OPT_INIT_SLAVE, "Command(s) that are executed when a slave connects to this master", @@ -5349,10 +5353,12 @@ Can't be set to 1 if --log-slave-updates is used.", "Show user and password in SHOW SLAVE HOSTS on this master", (gptr*) &opt_show_slave_auth_info, (gptr*) &opt_show_slave_auth_info, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifndef DISABLE_GRANT_OPTIONS {"skip-grant-tables", OPT_SKIP_GRANT, "Start without grant tables. This gives all users FULL ACCESS to all tables!", (gptr*) &opt_noacl, (gptr*) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, +#endif {"skip-host-cache", OPT_SKIP_HOST_CACHE, "Don't cache host names.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"skip-locking", OPT_SKIP_LOCK, diff --git a/win/README b/win/README index cbda33e1184..8fe3dc21d1e 100644 --- a/win/README +++ b/win/README @@ -49,6 +49,9 @@ The options right now are COMPILATION_COMMENT= Server comment, default "Source distribution" MYSQL_TCP_PORT= Server port, default 3306 CYBOZU + DISABLE_GRANT_OPTIONS Disables the use of --init-file and --skip-grant-tables + options of mysqld.exe + So the command line could look like: diff --git a/win/configure.js b/win/configure.js index ef90ce982a6..a7c706ce27c 100755 --- a/win/configure.js +++ b/win/configure.js @@ -32,6 +32,7 @@ try case "WITH_PARTITION_STORAGE_ENGINE": case "__NT__": case "CYBOZU": + case "DISABLE_GRANT_OPTIONS": configfile.WriteLine("SET (" + args.Item(i) + " TRUE)"); break; case "MYSQL_SERVER_SUFFIX": From 1768b21a1482e7737ff2c752d12a2f8049ec8263 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Wed, 10 Jan 2007 14:50:09 +0100 Subject: [PATCH 23/24] configure.in: Removed line accidently inserted when correcting bug#18526 --- configure.in | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.in b/configure.in index 69a0f9b576e..99a9f3b74ea 100644 --- a/configure.in +++ b/configure.in @@ -1074,7 +1074,6 @@ case $SYSTEM_TYPE in ;; *darwin*) AC_DEFINE([DEFAULT_SKIP_THREAD_PRIORITY], [1], [default to skip thread priority]) - CPPFLAGS="-D" if test "$ac_cv_prog_gcc" = "yes" then FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT" From ba7b6e86f269ed5a634af13f422b92be3294431c Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Wed, 10 Jan 2007 18:19:51 +0100 Subject: [PATCH 24/24] configure.in: Corrected default for --disable-grant-options --- configure.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 19fe70c0c4d..b04ae9f9384 100644 --- a/configure.in +++ b/configure.in @@ -713,19 +713,19 @@ else AC_MSG_RESULT([no]) fi -# If we should allow init-file and skip-grant-table options -AC_MSG_CHECKING(If we should should enable init-file and skip-grant-table options) +# If we should allow init-file, skip-grant-table and bootstrap options +AC_MSG_CHECKING(If we should should enable init-file, skip-grant-table options and bootstrap) AC_ARG_ENABLE(grant-options, - [ --disable-grant-options Disables the use of --init-file and --skip-grant-tables options], + [ --disable-grant-options Disables the use of --init-file, --skip-grant-tables and --bootstrap options], [ mysql_grant_options_enabled=$enableval ], - [ mysql_grant_options_enabled=no ] + [ mysql_grant_options_enabled=yes ] ) if test "$mysql_grant_options_enabled" = "yes" then AC_MSG_RESULT([yes]) else AC_DEFINE([DISABLE_GRANT_OPTIONS], [1], - [Disables the use of --init-file and --skip-grant-tables options]) + [Disables the use of --init-file, --skip-grant-tables and --bootstrap options]) AC_MSG_RESULT([no]) fi