diff options
-rwxr-xr-x | CMakeLists.txt | 2 | ||||
-rw-r--r-- | include/my_pthread.h | 5 | ||||
-rw-r--r-- | mysql-test/extra/rpl_tests/rpl_auto_increment.test | 1 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 14 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb_bug38231.test | 5 | ||||
-rw-r--r-- | mysql-test/suite/innodb_plugin/t/innodb_bug38231.test | 6 | ||||
-rwxr-xr-x | scripts/make_win_bin_dist | 2 | ||||
-rwxr-xr-x | server-tools/instance-manager/CMakeLists.txt | 2 | ||||
-rwxr-xr-x | sql/CMakeLists.txt | 2 | ||||
-rw-r--r-- | sql/set_var.cc | 2 | ||||
-rw-r--r-- | storage/innodb_plugin/CMakeLists.txt | 19 | ||||
-rw-r--r-- | storage/maria/ma_loghandler.c | 23 | ||||
-rw-r--r-- | storage/maria/ma_pagecache.c | 54 | ||||
-rw-r--r-- | storage/xtradb/CMakeLists.txt | 20 | ||||
-rw-r--r-- | storage/xtradb/include/fsp0types.h | 2 | ||||
-rw-r--r-- | win/configure-mariadb.bat | 8 |
16 files changed, 129 insertions, 38 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5aa865d600f..67fd7a9d0d5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,7 +116,7 @@ IF(MSVC) STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT}) - # set stack size (see bug#20815) + # generate map files, set stack size (see bug#20815) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1048576") # remove support for Exception handling diff --git a/include/my_pthread.h b/include/my_pthread.h index 169225c1e9b..9ada1d90712 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -127,9 +127,8 @@ struct tm *gmtime_r(const time_t *timep,struct tm *tmp); void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ - -#ifndef ETIMEDOUT
-#define ETIMEDOUT 145
+#ifndef ETIMEDOUT +#define ETIMEDOUT 145 /* Win32 doesn't have this */ #endif #define getpid() GetCurrentThreadId() #define HAVE_LOCALTIME_R 1 diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test index 06e3a154bc3..8d2f6c32233 100644 --- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test +++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test @@ -251,6 +251,7 @@ connection master; CREATE TABLE t1(s VARCHAR(10)) ENGINE=myisam; # -slave.opt has --replicate-ignore-table=test.t_ignored1 CREATE TABLE t_ignored1(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam; +sync_slave_with_master; connection slave; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c32edf81f27..bc88d0d43f9 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2513,14 +2513,12 @@ sub fix_vs_config_dir () { my $modified = 1e30; $opt_vs_config=""; - for my $dir (qw(client/*.dir libmysql/libmysql.dir sql/mysqld.dir - sql/udf_example.dir storage/*/*.dir plugin/*/*.dir)) { - for (<$basedir/$dir/*/BuildLog.htm>) { - if (-M $_ < $modified) - { - $modified = -M _; - $opt_vs_config = basename(dirname($_)); - } + + for (<$basedir/sql/*/mysqld.exe>) { + if (-M $_ < $modified) + { + $modified = -M _; + $opt_vs_config = basename(dirname($_)); } } diff --git a/mysql-test/suite/innodb/t/innodb_bug38231.test b/mysql-test/suite/innodb/t/innodb_bug38231.test index 1611cb56203..5021f23d07e 100644 --- a/mysql-test/suite/innodb/t/innodb_bug38231.test +++ b/mysql-test/suite/innodb/t/innodb_bug38231.test @@ -76,6 +76,11 @@ UNLOCK TABLES; UNLOCK TABLES; -- connection con3 +# +# We may get a timeout error here if the tables are locked in a different +# order than expected. This is ok as the purpose of this patch is to ensure +# we don't get a crash in the previous unlock tables. +-- error 0, 1205 -- reap UNLOCK TABLES; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test b/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test index 05e39cc16ea..23d8061c9da 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test @@ -72,8 +72,12 @@ UNLOCK TABLES; # clean up -- connection con2 --- reap +# +# We may get a timeout error here if the tables are locked in a different +# order than expected. This is ok as the purpose of this patch is to ensure +# we don't get a crash in the previous unlock tables. -- error 0, 1205 +-- reap UNLOCK TABLES; -- connection con3 diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 8940c8b4eb4..37149440922 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -177,7 +177,6 @@ cp tests/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe -cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map if [ x"$TARGET" != x"release" ] ; then cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb fi @@ -186,7 +185,6 @@ if [ x"$PACK_DEBUG" = x"" -a -f "sql/debug/mysqld.exe" -o \ x"$PACK_DEBUG" = x"yes" ] ; then cp sql/debug/mysqld.exe $DESTDIR/bin/mysqld-debug.exe cp sql/debug/mysqld.pdb $DESTDIR/bin/mysqld-debug.pdb - cp sql/debug/mysqld.map $DESTDIR/bin/mysqld-debug.map fi # ---------------------------------------------------------------------- diff --git a/server-tools/instance-manager/CMakeLists.txt b/server-tools/instance-manager/CMakeLists.txt index 2d04e522a6d..813a07a6b1d 100755 --- a/server-tools/instance-manager/CMakeLists.txt +++ b/server-tools/instance-manager/CMakeLists.txt @@ -20,7 +20,7 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ADD_DEFINITIONS(-DMYSQL_SERVER -DMYSQL_INSTANCE_MANAGER) INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql ${PROJECT_SOURCE_DIR}/extra/yassl/include) - + ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instance.cc instance_map.cc instance_options.cc listener.cc log.cc manager.cc messages.cc mysql_connection.cc mysqlmanager.cc options.cc parse.cc parse_output.cc priv.cc protocol.cc diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index b431ee075fe..7e8484eeb50 100755 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -18,7 +18,7 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi") -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS") +SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include diff --git a/sql/set_var.cc b/sql/set_var.cc index 38721c154e6..910deafc432 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -128,7 +128,9 @@ static void fix_net_write_timeout(THD *thd, enum_var_type type); static void fix_net_retry_count(THD *thd, enum_var_type type); static void fix_max_join_size(THD *thd, enum_var_type type); static void fix_query_cache_size(THD *thd, enum_var_type type); +#ifdef HAVE_QUERY_CACHE static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type); +#endif static void fix_myisam_max_sort_file_size(THD *thd, enum_var_type type); static void fix_max_binlog_size(THD *thd, enum_var_type type); static void fix_max_relay_log_size(THD *thd, enum_var_type type); diff --git a/storage/innodb_plugin/CMakeLists.txt b/storage/innodb_plugin/CMakeLists.txt index 87318ceec78..f79962e1c24 100644 --- a/storage/innodb_plugin/CMakeLists.txt +++ b/storage/innodb_plugin/CMakeLists.txt @@ -40,12 +40,19 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/extra/yassl/include) -# Removing compiler optimizations for innodb/mem/* files on 64-bit Windows -# due to 64-bit compiler error, See MySQL Bug #19424, #36366, #34297 -IF (MSVC AND $(WIN64)) - SET_SOURCE_FILES_PROPERTIES(mem/mem0mem.c mem/mem0pool.c - PROPERTIES COMPILE_FLAGS -Od) -ENDIF (MSVC AND $(WIN64)) +IF(MSVC) + # Removing compiler optimizations for innodb/mem/* files on 64-bit Windows + # due to 64-bit compiler error, See MySQL Bug #19424, #36366, #34297 + IF(CMAKE_SIZEOF_VOID_P MATCHES 8) + SET_SOURCE_FILES_PROPERTIES(mem/mem0mem.c mem/mem0pool.c + PROPERTIES COMPILE_FLAGS -Od) + ENDIF() + # Avoid "unreferenced label" warning in generated file + SET_SOURCE_FILES_PROPERTIES(pars/pars0grm.c + PROPERTIES COMPILE_FLAGS "/wd4102") + SET_SOURCE_FILES_PROPERTIES(pars/lexyy.c + PROPERTIES COMPILE_FLAGS "/wd4003") +ENDIF() SET(INNODB_PLUGIN_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c buf/buf0buddy.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index ab186b6468d..a8fcc639b58 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2007 MySQL AB & Sanja Belkin +/* Copyright (C) 2007 MySQL AB & Sanja Belkin. 2010 Monty Program Ab. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2598,11 +2598,10 @@ static my_bool translog_buffer_flush(struct st_translog_buffer *buffer) { /* some other flush in progress */ translog_wait_for_closing(buffer); + if (buffer->file != file || buffer->offset != offset || buffer->ver != ver) + DBUG_RETURN(0); /* some the thread flushed the buffer already */ } - if (buffer->file != file || buffer->offset != offset || buffer->ver != ver) - DBUG_RETURN(0); /* some the thread flushed the buffer already */ - if (buffer->overlay && translog_prev_buffer_flush_wait(buffer)) DBUG_RETURN(0); /* some the thread flushed the buffer already */ @@ -7769,6 +7768,7 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn, uint i; uint8 last_buffer_no, start_buffer_no; DBUG_ENTER("translog_flush_buffers"); + LINT_INIT(last_buffer_no); /* We will recheck information when will lock buffers one by @@ -7789,7 +7789,6 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn, (uint) start_buffer_no, (uint) log_descriptor.bc.buffer_no, LSN_IN_PARTS(log_descriptor.bc.buffer->prev_last_lsn))); - /* if LSN up to which we have to flush bigger then maximum LSN of previous buffer and at least one LSN was saved in the current buffer (last_lsn != @@ -7801,18 +7800,28 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn, struct st_translog_buffer *buffer= log_descriptor.bc.buffer; *lsn= log_descriptor.bc.buffer->last_lsn; /* fix lsn if it was horizon */ DBUG_PRINT("info", ("LSN to flush fixed to last lsn: (%lu,0x%lx)", - LSN_IN_PARTS(log_descriptor.bc.buffer->last_lsn))); + LSN_IN_PARTS(*lsn))); last_buffer_no= log_descriptor.bc.buffer_no; log_descriptor.is_everything_flushed= 1; translog_force_current_buffer_to_finish(); translog_buffer_unlock(buffer); } - else + else if (log_descriptor.bc.buffer->prev_last_lsn != LSN_IMPOSSIBLE) { + /* fix lsn if it was horizon */ + *lsn= log_descriptor.bc.buffer->prev_last_lsn; + DBUG_PRINT("info", ("LSN to flush fixed to prev last lsn: (%lu,0x%lx)", + LSN_IN_PARTS(*lsn))); last_buffer_no= ((log_descriptor.bc.buffer_no + TRANSLOG_BUFFERS_NO -1) % TRANSLOG_BUFFERS_NO); translog_unlock(); } + else if (log_descriptor.bc.buffer->last_lsn == LSN_IMPOSSIBLE) + { + DBUG_PRINT("info", ("There is no LSNs yet generated => do nothing")); + translog_unlock(); + DBUG_VOID_RETURN; + } /* flush buffers */ *sent_to_disk= translog_get_sent_to_disk(); diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index 1bb82ba92cd..83785e6a1af 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -1025,6 +1025,7 @@ finish: */ static inline void inc_counter_for_resize_op(PAGECACHE *pagecache) { + safe_mutex_assert_owner(&pagecache->cache_lock); pagecache->cnt_for_resize_op++; } @@ -1037,6 +1038,7 @@ static inline void dec_counter_for_resize_op(PAGECACHE *pagecache) { #ifdef THREAD struct st_my_thread_var *last_thread; + safe_mutex_assert_owner(&pagecache->cache_lock); if (!--pagecache->cnt_for_resize_op && (last_thread= pagecache->resize_queue.last_thread)) { @@ -1044,6 +1046,7 @@ static inline void dec_counter_for_resize_op(PAGECACHE *pagecache) ("thread %ld", last_thread->next->id)); pagecache_pthread_cond_signal(&last_thread->next->suspend); } + DBUG_ASSERT((longlong) pagecache->cnt_for_resize_op >= 0); #else pagecache->cnt_for_resize_op--; #endif @@ -1085,6 +1088,37 @@ void change_pagecache_param(PAGECACHE *pagecache, uint division_limit, /* + Check that pagecache was used and cleaned up properly. +*/ + +#ifndef DBUG_OFF +void check_pagecache_is_cleaned_up(PAGECACHE *pagecache) +{ + DBUG_ENTER("check_pagecache_is_cleaned_up"); + /* + Ensure we called inc_counter_for_resize_op and dec_counter_for_resize_op + the same number of times. (If not, a resize() could never happen. + */ + DBUG_ASSERT(pagecache->cnt_for_resize_op == 0); + + if (pagecache->disk_blocks > 0) + { + if (pagecache->block_mem) + { + uint i; + for (i=0 ; i < pagecache->blocks_used ; i++) + { + DBUG_ASSERT(pagecache->block_root[i].status == 0); + DBUG_ASSERT(pagecache->block_root[i].type == PAGECACHE_EMPTY_PAGE); + } + } + } + DBUG_VOID_RETURN; +} +#endif + + +/* Removes page cache from memory. Does NOT flush pages to disk. SYNOPSIS @@ -1106,6 +1140,10 @@ void end_pagecache(PAGECACHE *pagecache, my_bool cleanup) if (pagecache->disk_blocks > 0) { +#ifndef DBUG_OFF + check_pagecache_is_cleaned_up(pagecache); +#endif + if (pagecache->block_mem) { my_large_free(pagecache->block_mem, MYF(0)); @@ -2250,6 +2288,7 @@ static my_bool pagecache_wait_lock(PAGECACHE *pagecache, &pagecache->cache_lock); } while(thread->next); + inc_counter_for_resize_op(pagecache); #else DBUG_ASSERT(0); #endif @@ -3457,7 +3496,7 @@ static my_bool pagecache_delete_internal(PAGECACHE *pagecache, { /* this call is just 'hint' for the cache to free the page so we will - not interferes with flushing process but gust return success + not interferes with flushing process but must return success */ goto out; } @@ -3527,8 +3566,17 @@ static my_bool pagecache_delete_internal(PAGECACHE *pagecache, page_link->requests--; /* See NOTE for pagecache_unlock about registering requests. */ free_block(pagecache, block); + dec_counter_for_resize_op(pagecache); + return 0; out: + /* Cache is locked, so we can relese page before freeing it */ + if (make_lock_and_pin(pagecache, block, + PAGECACHE_LOCK_WRITE_UNLOCK, + PAGECACHE_UNPIN, FALSE)) + DBUG_ASSERT(0); + page_link->requests--; + unreg_request(pagecache, block, 1); dec_counter_for_resize_op(pagecache); return error; } @@ -3579,6 +3627,8 @@ my_bool pagecache_delete_by_link(PAGECACHE *pagecache, */ DBUG_ASSERT((block->status & (PCBLOCK_IN_SWITCH | PCBLOCK_REASSIGNED)) == 0); + + inc_counter_for_resize_op(pagecache); /* make_lock_and_pin() can't fail here, because we are keeping pin on the block and it can't be evicted (which is cause of lock fail and retry) @@ -3695,6 +3745,7 @@ restart: if (!page_link) { DBUG_PRINT("info", ("There is no such page in the cache")); + dec_counter_for_resize_op(pagecache); pagecache_pthread_mutex_unlock(&pagecache->cache_lock); DBUG_RETURN(0); } @@ -3707,6 +3758,7 @@ restart: "reassigned" : "in switch"))); PCBLOCK_INFO(block); page_link->requests--; + dec_counter_for_resize_op(pagecache); goto end; } /* See NOTE for pagecache_unlock about registering requests. */ diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt index 759bb525bdf..0187cf097c1 100644 --- a/storage/xtradb/CMakeLists.txt +++ b/storage/xtradb/CMakeLists.txt @@ -42,12 +42,20 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/extra/yassl/include) -# Removing compiler optimizations for innodb/mem/* files on 64-bit Windows -# due to 64-bit compiler error, See MySQL Bug #19424, #36366, #34297 -IF (MSVC AND $(WIN64)) - SET_SOURCE_FILES_PROPERTIES(mem/mem0mem.c mem/mem0pool.c - PROPERTIES COMPILE_FLAGS -Od) -ENDIF (MSVC AND $(WIN64)) + +IF(MSVC) + # Removing compiler optimizations for innodb/mem/* files on 64-bit Windows + # due to 64-bit compiler error, See MySQL Bug #19424, #36366, #34297 + IF(CMAKE_SIZEOF_VOID_P MATCHES 8) + SET_SOURCE_FILES_PROPERTIES(mem/mem0mem.c mem/mem0pool.c + PROPERTIES COMPILE_FLAGS -Od) + ENDIF() + # Avoid "unreferenced label" warning in generated file + SET_SOURCE_FILES_PROPERTIES(pars/pars0grm.c + PROPERTIES COMPILE_FLAGS "/wd4102") + SET_SOURCE_FILES_PROPERTIES(pars/lexyy.c + PROPERTIES COMPILE_FLAGS "/wd4003") +ENDIF() SET(XTRADB_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c buf/buf0buddy.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c diff --git a/storage/xtradb/include/fsp0types.h b/storage/xtradb/include/fsp0types.h index 2dd2deca671..6678dacb547 100644 --- a/storage/xtradb/include/fsp0types.h +++ b/storage/xtradb/include/fsp0types.h @@ -42,7 +42,7 @@ fseg_alloc_free_page) */ /* @} */ /** File space extent size (one megabyte) in pages */ -#define FSP_EXTENT_SIZE (1u << (20 - UNIV_PAGE_SIZE_SHIFT)) +#define FSP_EXTENT_SIZE (1ULL << (20 - UNIV_PAGE_SIZE_SHIFT)) /** On a page of any file segment, data may be put starting from this offset */ diff --git a/win/configure-mariadb.bat b/win/configure-mariadb.bat new file mode 100644 index 00000000000..834d73732b8 --- /dev/null +++ b/win/configure-mariadb.bat @@ -0,0 +1,8 @@ +cscript win\configure.js ^ + WITH_EXAMPLE_STORAGE_ENGINE ^ + WITH_FEDERATEDX_STORAGE_ENGINE ^ + WITH_MERGE_STORAGE_ENGINE ^ + WITH_PARTITION_STORAGE_ENGINE ^ + WITH_MARIA_STORAGE_ENGINE ^ + WITH_PBXT_STORAGE_ENGINE ^ + WITH_XTRADB_STORAGE_ENGINE |