summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt7
-rw-r--r--cmake/os/Linux.cmake1
-rw-r--r--dbug/dbug.c12
-rw-r--r--dbug/my_main.c4
-rw-r--r--include/my_time.h2
-rw-r--r--libmysql/CMakeLists.txt2
-rw-r--r--libmysqld/CMakeLists.txt5
-rw-r--r--mysql-test/include/have_mutex_deadlock_detector.inc4
-rw-r--r--mysql-test/r/have_mutex_deadlock_detector.require2
-rw-r--r--mysql-test/suite/pbxt/r/having.result2
-rw-r--r--mysql-test/suite/pbxt/r/heap.result4
-rw-r--r--mysql-test/suite/pbxt/r/select_safe.result12
-rw-r--r--mysql-test/suite/pbxt/t/heap.test2
-rw-r--r--mysql-test/suite/perfschema/r/all_instances.result5
-rw-r--r--mysql-test/suite/perfschema/r/relaylog.result4
-rw-r--r--mysql-test/suite/perfschema/t/all_instances.test3
-rw-r--r--mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test3
-rw-r--r--mysys/CMakeLists.txt2
-rw-r--r--plugin/semisync/semisync_master.cc2
-rw-r--r--sql-common/my_time.c2
-rw-r--r--sql/CMakeLists.txt2
-rw-r--r--sql/event_db_repository.cc8
-rw-r--r--sql/field.cc18
-rw-r--r--sql/field.h18
-rw-r--r--sql/ha_partition.cc2
-rw-r--r--sql/handler.cc20
-rw-r--r--sql/item.cc18
-rw-r--r--sql/item.h20
-rw-r--r--sql/item_cmpfunc.cc2
-rw-r--r--sql/item_cmpfunc.h2
-rw-r--r--sql/item_func.cc2
-rw-r--r--sql/item_func.h2
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_strfunc.h2
-rw-r--r--sql/item_timefunc.cc38
-rw-r--r--sql/item_timefunc.h38
-rw-r--r--sql/log.cc17
-rw-r--r--sql/log.h16
-rw-r--r--sql/log_event.cc4
-rw-r--r--sql/log_event.h4
-rw-r--r--sql/mysqld.cc20
-rw-r--r--sql/mysqld.h7
-rw-r--r--sql/partition_info.cc2
-rw-r--r--sql/rpl_rli.cc3
-rw-r--r--sql/set_var.h4
-rw-r--r--sql/sp.cc19
-rw-r--r--sql/sp_head.cc4
-rw-r--r--sql/sp_head.h4
-rw-r--r--sql/sql_acl.cc6
-rw-r--r--sql/sql_cache.cc4
-rw-r--r--sql/sql_cache.h2
-rw-r--r--sql/sql_db.cc2
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_time.cc16
-rw-r--r--sql/sql_time.h14
-rw-r--r--sql/sql_trigger.cc4
-rw-r--r--sql/sql_view.cc2
-rw-r--r--sql/sys_vars.cc16
-rw-r--r--sql/sys_vars.h16
-rw-r--r--storage/heap/CMakeLists.txt4
-rw-r--r--storage/innobase/sync/sync0sync.c3
-rw-r--r--storage/maria/unittest/CMakeLists.txt2
-rw-r--r--storage/xtradb/handler/i_s.cc26
-rw-r--r--strings/ctype-cp932.c16
-rw-r--r--strings/ctype-eucjpms.c26
-rw-r--r--strings/ctype-gbk.c2
-rw-r--r--unittest/mytap/tap.c2
68 files changed, 286 insertions, 259 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5fd951584e2..83145c72f43 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -285,12 +285,7 @@ SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
ENDIF()
ADD_SUBDIRECTORY(include)
-IF(CMAKE_GENERATOR MATCHES "Makefiles" AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")
- SET(DBUG_LIBRARY)
-ELSE()
- SET(DBUG_LIBRARY dbug)
- ADD_SUBDIRECTORY(dbug)
-ENDIF()
+ADD_SUBDIRECTORY(dbug)
ADD_SUBDIRECTORY(strings)
ADD_SUBDIRECTORY(vio)
ADD_SUBDIRECTORY(regex)
diff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake
index 61361d1d48b..ccdf7e8d931 100644
--- a/cmake/os/Linux.cmake
+++ b/cmake/os/Linux.cmake
@@ -22,6 +22,7 @@ INCLUDE(CheckSymbolExists)
SET(TARGET_OS_LINUX 1)
SET(HAVE_NPTL 1)
SET(_GNU_SOURCE 1)
+SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE=1)
# Fix CMake (< 2.8) flags. -rdynamic exports too many symbols.
FOREACH(LANG C CXX)
diff --git a/dbug/dbug.c b/dbug/dbug.c
index 8d2d5082b6a..3dce91cd2ca 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -86,6 +86,8 @@
#include <m_string.h>
#include <errno.h>
+#ifndef DBUG_OFF
+
#ifdef HAVE_FNMATCH_H
#include <fnmatch.h>
#else
@@ -424,7 +426,7 @@ void _db_process_(const char *name)
* 0 - a list of functions was not changed
*/
-int DbugParse(CODE_STATE *cs, const char *control)
+static int DbugParse(CODE_STATE *cs, const char *control)
{
const char *end;
int rel, f_used=0;
@@ -661,8 +663,8 @@ int DbugParse(CODE_STATE *cs, const char *control)
(ListFlags(cs->stack->functions) & INCLUDE) ? \
0 : (uint)TRACE_ON)
-void FixTraceFlags_helper(CODE_STATE *cs, const char *func,
- struct _db_stack_frame_ *framep)
+static void FixTraceFlags_helper(CODE_STATE *cs, const char *func,
+ struct _db_stack_frame_ *framep)
{
if (framep->prev)
FixTraceFlags_helper(cs, framep->func, framep->prev);
@@ -687,7 +689,7 @@ void FixTraceFlags_helper(CODE_STATE *cs, const char *func,
#define fflags(cs) cs->stack->out_file ? ListFlags(cs->stack->functions) : TRACE_ON;
-void FixTraceFlags(uint old_fflags, CODE_STATE *cs)
+static void FixTraceFlags(uint old_fflags, CODE_STATE *cs)
{
const char *func;
uint new_fflags, traceon, level;
@@ -2489,3 +2491,5 @@ static void sf_terminate()
return;
}
+
+#endif /* DBUG_OFF */
diff --git a/dbug/my_main.c b/dbug/my_main.c
index 490e1808dd2..d8bffe662e2 100644
--- a/dbug/my_main.c
+++ b/dbug/my_main.c
@@ -3,10 +3,6 @@
fixed so that it could compile and run in MySQL source tree
*/
-#ifdef DBUG_OFF /* We are testing dbug */
-#undef DBUG_OFF
-#endif
-
#include <my_global.h> /* This includes dbug.h */
#include <my_pthread.h>
diff --git a/include/my_time.h b/include/my_time.h
index 9a2e78ceefe..668b57fc052 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -91,7 +91,7 @@ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
ulonglong flags, int *was_cut);
enum enum_mysql_timestamp_type
str_to_time(const char *str, uint length, MYSQL_TIME *l_time,
- ulong flag, int *warning);
+ ulonglong flag, int *warning);
enum enum_mysql_timestamp_type
str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
ulonglong flags, int *was_cut);
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index 34bc20d77a1..6cd9b287262 100644
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -150,7 +150,7 @@ ADD_CONVENIENCE_LIBRARY(clientlib ${CLIENT_SOURCES})
DTRACE_INSTRUMENT(clientlib)
ADD_DEPENDENCIES(clientlib GenError)
-SET(LIBS clientlib ${DBUG_LIBRARY} strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIBDL})
+SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIBDL})
# Merge several convenience libraries into one big mysqlclient
# and link them together into shared library.
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index f45a03cdb19..2b3b9b4347f 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -113,7 +113,7 @@ ENDIF()
SET(LIBS
- ${DBUG_LIBRARY} strings regex mysys vio
+ dbug strings regex mysys vio
${ZLIB_LIBRARY} ${SSL_LIBRARIES}
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
${MYSQLD_STATIC_PLUGIN_LIBS}
@@ -145,7 +145,8 @@ IF(UNIX)
${CMAKE_STATIC_LIBRARY_PREFIX}mysqld-debug)
ENDIF()
-IF(MSVC AND NOT DISABLE_SHARED)
+IF(NOT DISABLE_SHARED)
MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS}
COMPONENT Embedded)
+ SET_TARGET_PROPERTIES(libmysqld PROPERTIES PREFIX "")
ENDIF()
diff --git a/mysql-test/include/have_mutex_deadlock_detector.inc b/mysql-test/include/have_mutex_deadlock_detector.inc
new file mode 100644
index 00000000000..3672f3eccef
--- /dev/null
+++ b/mysql-test/include/have_mutex_deadlock_detector.inc
@@ -0,0 +1,4 @@
+--require r/have_mutex_deadlock_detector.require
+disable_query_log;
+select 1 from information_schema.global_variables where variable_name = "mutex_deadlock_detector";
+enable_query_log;
diff --git a/mysql-test/r/have_mutex_deadlock_detector.require b/mysql-test/r/have_mutex_deadlock_detector.require
new file mode 100644
index 00000000000..6ed281c757a
--- /dev/null
+++ b/mysql-test/r/have_mutex_deadlock_detector.require
@@ -0,0 +1,2 @@
+1
+1
diff --git a/mysql-test/suite/pbxt/r/having.result b/mysql-test/suite/pbxt/r/having.result
index d76cd81022b..fede184f9f7 100644
--- a/mysql-test/suite/pbxt/r/having.result
+++ b/mysql-test/suite/pbxt/r/having.result
@@ -400,7 +400,7 @@ select f1 from t1 group by f1 having max(f1)=f1;
f1
set session sql_mode='ONLY_FULL_GROUP_BY';
select f1 from t1 having max(f1)=f1;
-ERROR 42000: non-grouping field 'f1' is used in HAVING clause
+ERROR 42000: Non-grouping field 'f1' is used in HAVING clause
select f1 from t1 group by f1 having max(f1)=f1;
f1
set session sql_mode='';
diff --git a/mysql-test/suite/pbxt/r/heap.result b/mysql-test/suite/pbxt/r/heap.result
index 17088ee01a6..0404e8b98f9 100644
--- a/mysql-test/suite/pbxt/r/heap.result
+++ b/mysql-test/suite/pbxt/r/heap.result
@@ -715,8 +715,8 @@ create table t1 (c char(10)) engine=memory;
create table t2 (c varchar(10)) engine=memory;
show table status like 't_';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
+t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
drop table t1, t2;
CREATE TABLE t1(a VARCHAR(1), b VARCHAR(2), c VARCHAR(256),
KEY(a), KEY(b), KEY(c)) ENGINE=MEMORY;
diff --git a/mysql-test/suite/pbxt/r/select_safe.result b/mysql-test/suite/pbxt/r/select_safe.result
index 27e4154fe71..801c8fa67a3 100644
--- a/mysql-test/suite/pbxt/r/select_safe.result
+++ b/mysql-test/suite/pbxt/r/select_safe.result
@@ -37,7 +37,7 @@ ERROR HY000: You are using safe update mode and you tried to update a table with
delete from t1 where a+0=1;
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
update t1 set b="a" order by a limit 1;
update t1 set b="a" where b="b" order by a limit 2;
delete from t1 where b="test" order by a limit 1;
@@ -49,7 +49,7 @@ SELECT @@MAX_JOIN_SIZE, @@SQL_BIG_SELECTS;
2 0
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
SELECT * from t1 order by a;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
SET SQL_BIG_SELECTS=1;
SELECT * from t1 order by a;
a b
@@ -59,7 +59,7 @@ a b
5 a
SET MAX_JOIN_SIZE=2;
SELECT * from t1;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
SET MAX_JOIN_SIZE=DEFAULT;
SELECT * from t1;
a b
@@ -89,13 +89,13 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
set local max_join_size=8;
select * from (select * from t1) x;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
set local max_join_size=1;
select * from (select a.a as aa, b.a as ba from t1 a, t1 b) x;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
set local max_join_size=1;
select * from (select 1 union select 2 union select 3) x;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
drop table t1;
SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT;
Warnings:
diff --git a/mysql-test/suite/pbxt/t/heap.test b/mysql-test/suite/pbxt/t/heap.test
index 2d863827b2b..452bcb754d3 100644
--- a/mysql-test/suite/pbxt/t/heap.test
+++ b/mysql-test/suite/pbxt/t/heap.test
@@ -454,7 +454,7 @@ drop table t1;
#
create table t1 (c char(10)) engine=memory;
create table t2 (c varchar(10)) engine=memory;
---replace_column 8 #
+--replace_column 8 # 12 #
show table status like 't_';
drop table t1, t2;
diff --git a/mysql-test/suite/perfschema/r/all_instances.result b/mysql-test/suite/perfschema/r/all_instances.result
index 356ffda13c1..756b5207714 100644
--- a/mysql-test/suite/perfschema/r/all_instances.result
+++ b/mysql-test/suite/perfschema/r/all_instances.result
@@ -1,5 +1,5 @@
use performance_schema;
-select name from mutex_instances where name not rlike '/(DEBUG_SYNC::mutex|LOCK_des_key_file)$' group by name;
+select name from mutex_instances where name not rlike '/(DEBUG_SYNC::mutex)$' group by name;
name
wait/synch/mutex/archive/archive_mutex
wait/synch/mutex/aria/LOCK_trn_list
@@ -42,6 +42,7 @@ wait/synch/mutex/sql/LOCK_crypt
wait/synch/mutex/sql/LOCK_delayed_create
wait/synch/mutex/sql/LOCK_delayed_insert
wait/synch/mutex/sql/LOCK_delayed_status
+wait/synch/mutex/sql/LOCK_des_key_file
wait/synch/mutex/sql/LOCK_error_log
wait/synch/mutex/sql/LOCK_error_messages
wait/synch/mutex/sql/LOCK_event_queue
@@ -120,7 +121,9 @@ wait/synch/cond/sql/Master_info::data_cond
wait/synch/cond/sql/Master_info::start_cond
wait/synch/cond/sql/Master_info::stop_cond
wait/synch/cond/sql/MDL_context::COND_wait_status
+wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy
wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond
+wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_queue_busy
wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond
wait/synch/cond/sql/Query_cache::COND_cache_status_changed
wait/synch/cond/sql/Relay_log_info::data_cond
diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result
index 0a7d0a5b2be..a1d10265f4d 100644
--- a/mysql-test/suite/perfschema/r/relaylog.result
+++ b/mysql-test/suite/perfschema/r/relaylog.result
@@ -57,6 +57,7 @@ where event_name like "%MYSQL_BIN_LOG%"
order by event_name;
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
+wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
"Expect no slave relay log"
@@ -73,6 +74,7 @@ where event_name like "%MYSQL_RELAY_LOG%"
and event_name not like "%MYSQL_RELAY_LOG::update_cond"
order by event_name;
EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_queue_busy 0 0 0 0 0
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0
"============ Performance schema on slave ============"
select * from performance_schema.file_summary_by_instance
@@ -130,6 +132,7 @@ where event_name like "%MYSQL_BIN_LOG%"
order by event_name;
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
+wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy NONE
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
"Expect a slave relay log"
@@ -169,5 +172,6 @@ where event_name like "%MYSQL_RELAY_LOG%"
and event_name not like "%MYSQL_RELAY_LOG::update_cond"
order by event_name;
EVENT_NAME COUNT_STAR
+wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_queue_busy NONE
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY
include/stop_slave.inc
diff --git a/mysql-test/suite/perfschema/t/all_instances.test b/mysql-test/suite/perfschema/t/all_instances.test
index 5fe1a347a2d..76262e78255 100644
--- a/mysql-test/suite/perfschema/t/all_instances.test
+++ b/mysql-test/suite/perfschema/t/all_instances.test
@@ -3,6 +3,7 @@
--source include/have_maria.inc
--source include/have_archive.inc
--source include/have_blackhole.inc
+--source include/have_ssl.inc
use performance_schema;
@@ -15,7 +16,7 @@ use performance_schema;
# "where" filters out instances that can be conditionally compiled out
#
-select name from mutex_instances where name not rlike '/(DEBUG_SYNC::mutex|LOCK_des_key_file)$' group by name;
+select name from mutex_instances where name not rlike '/(DEBUG_SYNC::mutex)$' group by name;
select name from rwlock_instances group by name;
select name from cond_instances where name not rlike '/(DEBUG_SYNC::cond)$' group by name;
select event_name from file_instances group by event_name;
diff --git a/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test b/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
index 98f5af90cac..398636fcb13 100644
--- a/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
+++ b/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
@@ -1,4 +1,5 @@
---source include/have_debug.inc
+--source include/have_mutex_deadlock_detector.inc
+
# bool readonly
#
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index 0eadd4629c6..5837764a171 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -66,7 +66,7 @@ IF(HAVE_MLOCK)
ENDIF()
ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES})
-TARGET_LINK_LIBRARIES(mysys ${DBUG_LIBRARY} strings ${ZLIB_LIBRARY}
+TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY}
${LIBNSL} ${LIBM} ${LIBRT})
DTRACE_INSTRUMENT(mysys)
diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc
index 8656a40a3f4..7504697a21f 100644
--- a/plugin/semisync/semisync_master.cc
+++ b/plugin/semisync/semisync_master.cc
@@ -683,7 +683,7 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
abstime.tv_sec++;
diff_nsecs -= TIME_BILLION;
}
- abstime.tv_nsec = diff_nsecs;
+ abstime.tv_nsec = (long)diff_nsecs;
/* In semi-synchronous replication, we wait until the binlog-dump
* thread has received the reply on the relevant binlog segment from the
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 5a436fa9819..0a00a09257d 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -489,7 +489,7 @@ err:
enum enum_mysql_timestamp_type
str_to_time(const char *str, uint length, MYSQL_TIME *l_time,
- ulong fuzzydate, int *warning)
+ ulonglong fuzzydate, int *warning)
{
ulong date[5];
ulonglong value;
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 5e6e6b48a27..6d7b73ffcee 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -92,7 +92,7 @@ ADD_LIBRARY(sql STATIC ${SQL_SOURCE})
ADD_DEPENDENCIES(sql GenServerSource)
DTRACE_INSTRUMENT(sql)
TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
- mysys ${DBUG_LIBRARY} strings vio regex
+ mysys dbug strings vio regex
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
${SSL_LIBRARIES})
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index 252dac5f01d..8099d87b580 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -201,7 +201,7 @@ mysql_event_fill_row(THD *thd,
TABLE *table,
Event_parse_data *et,
sp_head *sp,
- ulong sql_mode,
+ ulonglong sql_mode,
my_bool is_update)
{
CHARSET_INFO *scs= system_charset_info;
@@ -652,7 +652,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
int ret= 1;
TABLE *table= NULL;
sp_head *sp= thd->lex->sphead;
- ulong saved_mode= thd->variables.sql_mode;
+ ulonglong saved_mode= thd->variables.sql_mode;
/*
Take a savepoint to release only the lock on mysql.event
table at the end but keep the global read lock and
@@ -769,7 +769,7 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data,
CHARSET_INFO *scs= system_charset_info;
TABLE *table= NULL;
sp_head *sp= thd->lex->sphead;
- ulong saved_mode= thd->variables.sql_mode;
+ ulonglong saved_mode= thd->variables.sql_mode;
/*
Take a savepoint to release only the lock on mysql.event
table at the end but keep the global read lock and
@@ -1053,7 +1053,7 @@ Event_db_repository::load_named_event(THD *thd, LEX_STRING dbname,
LEX_STRING name, Event_basic *etn)
{
bool ret;
- ulong saved_mode= thd->variables.sql_mode;
+ ulonglong saved_mode= thd->variables.sql_mode;
Open_tables_backup open_tables_backup;
TABLE_LIST event_table;
diff --git a/sql/field.cc b/sql/field.cc
index 550cc435467..42d71477372 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1762,7 +1762,7 @@ uint Field::fill_cache_field(CACHE_FIELD *copy)
}
-bool Field::get_date(MYSQL_TIME *ltime,uint fuzzydate)
+bool Field::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
{
char buff[40];
String tmp(buff,sizeof(buff),&my_charset_bin),*res;
@@ -4254,7 +4254,7 @@ my_decimal *Field_real::val_decimal(my_decimal *decimal_value)
}
-bool Field_real::get_date(MYSQL_TIME *ltime,uint fuzzydate)
+bool Field_real::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
{
ASSERT_COLUMN_MARKED_FOR_READ;
double nr= val_real();
@@ -4640,7 +4640,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr)
}
-bool Field_timestamp::get_date(MYSQL_TIME *ltime, uint fuzzydate)
+bool Field_timestamp::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
THD *thd= table->in_use;
thd->time_zone_used= 1;
@@ -5185,7 +5185,7 @@ String *Field_time::val_str(String *val_buffer,
DATE_FORMAT(time, "%l.%i %p")
*/
-bool Field_time::get_date(MYSQL_TIME *ltime, uint fuzzydate)
+bool Field_time::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
THD *thd= table->in_use;
if (!(fuzzydate & (TIME_FUZZY_DATE|TIME_TIME_ONLY)))
@@ -5303,7 +5303,7 @@ String *Field_time_hires::val_str(String *str,
return str;
}
-bool Field_time_hires::get_date(MYSQL_TIME *ltime, uint fuzzydate)
+bool Field_time_hires::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
uint32 len= pack_length();
longlong packed= read_bigendian(ptr, len);
@@ -5483,7 +5483,7 @@ String *Field_year::val_str(String *val_buffer,
}
-bool Field_year::get_date(MYSQL_TIME *ltime,uint fuzzydate)
+bool Field_year::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
{
int tmp= (int) ptr[0];
if (tmp || field_length != 4)
@@ -5654,7 +5654,7 @@ String *Field_newdate::val_str(String *val_buffer,
}
-bool Field_newdate::get_date(MYSQL_TIME *ltime,uint fuzzydate)
+bool Field_newdate::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
{
uint32 tmp=(uint32) uint3korr(ptr);
ltime->day= tmp & 31;
@@ -5774,7 +5774,7 @@ String *Field_datetime::val_str(String *val_buffer,
return val_buffer;
}
-bool Field_datetime::get_date(MYSQL_TIME *ltime, uint fuzzydate)
+bool Field_datetime::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
longlong tmp=Field_datetime::val_int();
uint32 part1,part2;
@@ -5890,7 +5890,7 @@ String *Field_datetime_hires::val_str(String *str,
return str;
}
-bool Field_datetime_hires::get_date(MYSQL_TIME *ltime, uint fuzzydate)
+bool Field_datetime_hires::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
ulonglong packed= read_bigendian(ptr, Field_datetime_hires::pack_length());
unpack_time(sec_part_unshift(packed, dec), ltime);
diff --git a/sql/field.h b/sql/field.h
index 8e7e5a6d854..84d60012a85 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -526,7 +526,7 @@ public:
}
void copy_from_tmp(int offset);
uint fill_cache_field(struct st_cache_field *copy);
- virtual bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ virtual bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
bool get_time(MYSQL_TIME *ltime) { return get_date(ltime, TIME_TIME_ONLY); }
virtual CHARSET_INFO *charset(void) const { return &my_charset_bin; }
virtual CHARSET_INFO *charset_for_protocol(void) const
@@ -792,7 +792,7 @@ public:
Item_result result_type () const { return REAL_RESULT; }
int store_decimal(const my_decimal *);
int store_time_dec(MYSQL_TIME *ltime, uint dec);
- bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
my_decimal *val_decimal(my_decimal *);
uint32 max_display_length() { return field_length; }
uint size_of() const { return sizeof(*this); }
@@ -1257,7 +1257,7 @@ public:
{
int4store(ptr,timestamp);
}
- bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
timestamp_auto_set_type get_auto_set_type() const;
uchar *pack(uchar *to, const uchar *from,
uint max_length __attribute__((unused)))
@@ -1327,7 +1327,7 @@ public:
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
- bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
bool send_binary(Protocol *protocol);
uint32 max_display_length() { return field_length; }
void sql_type(String &str) const;
@@ -1420,7 +1420,7 @@ public:
uint32 pack_length() const { return 3; }
void sql_type(String &str) const;
bool zero_pack() const { return 1; }
- bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
};
@@ -1443,7 +1443,7 @@ public:
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
- bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
bool send_binary(Protocol *protocol);
int cmp(const uchar *,const uchar *);
void sort_string(uchar *buff,uint length);
@@ -1476,7 +1476,7 @@ public:
double val_real(void);
String *val_str(String*,String *);
int reset(void);
- bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
bool send_binary(Protocol *protocol);
int cmp(const uchar *,const uchar *);
void sort_string(uchar *buff,uint length);
@@ -1507,7 +1507,7 @@ public:
uint32 pack_length() const { return 8; }
void sql_type(String &str) const;
bool zero_pack() const { return 1; }
- bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
uchar *pack(uchar* to, const uchar *from,
uint max_length __attribute__((unused)))
{
@@ -1548,7 +1548,7 @@ public:
void sort_string(uchar *buff,uint length);
uint32 pack_length() const;
void sql_type(String &str) const;
- bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
uchar *pack(uchar *to, const uchar *from, uint max_length)
{ return Field::pack(to, from, max_length); }
const uchar *unpack(uchar* to, const uchar *from, uint param_data)
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index c580ae86439..b4dc3f79e0c 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3325,7 +3325,7 @@ int ha_partition::write_row(uchar * buf)
my_bitmap_map *old_map;
THD *thd= ha_thd();
timestamp_auto_set_type saved_timestamp_type= table->timestamp_field_type;
- ulong saved_sql_mode= thd->variables.sql_mode;
+ ulonglong saved_sql_mode= thd->variables.sql_mode;
bool saved_auto_inc_field_not_null= table->auto_increment_field_not_null;
#ifdef NOT_NEEDED
uchar *rec0= m_rec0;
diff --git a/sql/handler.cc b/sql/handler.cc
index b2736e4559d..90889e046e9 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -4091,9 +4091,9 @@ int ha_init_key_cache(const char *name, KEY_CACHE *key_cache, void *unused
mysql_mutex_lock(&LOCK_global_system_variables);
size_t tmp_buff_size= (size_t) key_cache->param_buff_size;
uint tmp_block_size= (uint) key_cache->param_block_size;
- uint division_limit= key_cache->param_division_limit;
- uint age_threshold= key_cache->param_age_threshold;
- uint partitions= key_cache->param_partitions;
+ uint division_limit= (uint)key_cache->param_division_limit;
+ uint age_threshold= (uint)key_cache->param_age_threshold;
+ uint partitions= (uint)key_cache->param_partitions;
mysql_mutex_unlock(&LOCK_global_system_variables);
DBUG_RETURN(!init_key_cache(key_cache,
tmp_block_size,
@@ -4117,8 +4117,8 @@ int ha_resize_key_cache(KEY_CACHE *key_cache)
mysql_mutex_lock(&LOCK_global_system_variables);
size_t tmp_buff_size= (size_t) key_cache->param_buff_size;
long tmp_block_size= (long) key_cache->param_block_size;
- uint division_limit= key_cache->param_division_limit;
- uint age_threshold= key_cache->param_age_threshold;
+ uint division_limit= (uint)key_cache->param_division_limit;
+ uint age_threshold= (uint)key_cache->param_age_threshold;
mysql_mutex_unlock(&LOCK_global_system_variables);
DBUG_RETURN(!resize_key_cache(key_cache, tmp_block_size,
tmp_buff_size,
@@ -4138,8 +4138,8 @@ int ha_change_key_cache_param(KEY_CACHE *key_cache)
if (key_cache->key_cache_inited)
{
mysql_mutex_lock(&LOCK_global_system_variables);
- uint division_limit= key_cache->param_division_limit;
- uint age_threshold= key_cache->param_age_threshold;
+ uint division_limit= (uint)key_cache->param_division_limit;
+ uint age_threshold= (uint)key_cache->param_age_threshold;
mysql_mutex_unlock(&LOCK_global_system_variables);
change_key_cache_param(key_cache, division_limit, age_threshold);
}
@@ -4159,9 +4159,9 @@ int ha_repartition_key_cache(KEY_CACHE *key_cache)
mysql_mutex_lock(&LOCK_global_system_variables);
size_t tmp_buff_size= (size_t) key_cache->param_buff_size;
long tmp_block_size= (long) key_cache->param_block_size;
- uint division_limit= key_cache->param_division_limit;
- uint age_threshold= key_cache->param_age_threshold;
- uint partitions= key_cache->param_partitions;
+ uint division_limit= (uint)key_cache->param_division_limit;
+ uint age_threshold= (uint)key_cache->param_age_threshold;
+ uint partitions= (uint)key_cache->param_partitions;
mysql_mutex_unlock(&LOCK_global_system_variables);
DBUG_RETURN(!repartition_key_cache(key_cache, tmp_block_size,
tmp_buff_size,
diff --git a/sql/item.cc b/sql/item.cc
index e4b7b1f5092..d768c7a4218 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1182,7 +1182,7 @@ bool Item_string::eq(const Item *item, bool binary_cmp) const
As a extra convenience the time structure is reset on error or NULL values!
*/
-bool Item::get_date(MYSQL_TIME *ltime,uint fuzzydate)
+bool Item::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
{
if (field_type() == MYSQL_TYPE_TIME)
fuzzydate|= TIME_TIME_ONLY;
@@ -2468,7 +2468,7 @@ String *Item_field::str_result(String *str)
return result_field->val_str(str,&str_value);
}
-bool Item_field::get_date(MYSQL_TIME *ltime,uint fuzzydate)
+bool Item_field::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
{
if ((null_value=field->is_null()) || field->get_date(ltime,fuzzydate))
{
@@ -2478,7 +2478,7 @@ bool Item_field::get_date(MYSQL_TIME *ltime,uint fuzzydate)
return 0;
}
-bool Item_field::get_date_result(MYSQL_TIME *ltime,uint fuzzydate)
+bool Item_field::get_date_result(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
if (result_field->is_null() || result_field->get_date(ltime,fuzzydate))
{
@@ -3396,7 +3396,7 @@ int Item_param::save_in_field(Field *field, bool no_conversions)
}
-bool Item_param::get_date(MYSQL_TIME *res, uint fuzzydate)
+bool Item_param::get_date(MYSQL_TIME *res, ulonglong fuzzydate)
{
if (state == TIME_VALUE)
{
@@ -4218,7 +4218,7 @@ String* Item_ref_null_helper::val_str(String* s)
}
-bool Item_ref_null_helper::get_date(MYSQL_TIME *ltime, uint fuzzydate)
+bool Item_ref_null_helper::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
return (owner->was_null|= null_value= (*ref)->get_date(ltime, fuzzydate));
}
@@ -7177,7 +7177,7 @@ bool Item_ref::is_null()
}
-bool Item_ref::get_date(MYSQL_TIME *ltime,uint fuzzydate)
+bool Item_ref::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
{
return (null_value=(*ref)->get_date_result(ltime,fuzzydate));
}
@@ -7314,7 +7314,7 @@ bool Item_direct_ref::is_null()
}
-bool Item_direct_ref::get_date(MYSQL_TIME *ltime,uint fuzzydate)
+bool Item_direct_ref::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
{
return (null_value=(*ref)->get_date(ltime,fuzzydate));
}
@@ -7676,7 +7676,7 @@ bool Item_cache_wrapper::is_null()
Get the date value of the possibly cached item
*/
-bool Item_cache_wrapper::get_date(MYSQL_TIME *ltime, uint fuzzydate)
+bool Item_cache_wrapper::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
Item *cached_value;
DBUG_ENTER("Item_cache_wrapper::get_date");
@@ -8735,7 +8735,7 @@ bool Item_cache_temporal::cache_value()
}
-bool Item_cache_temporal::get_date(MYSQL_TIME *ltime, uint fuzzydate)
+bool Item_cache_temporal::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
ErrConvInteger str(value);
diff --git a/sql/item.h b/sql/item.h
index cda2ab73c4a..c3bdc5042c8 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1021,11 +1021,11 @@ public:
/* Called for items that really have to be split */
void split_sum_func2(THD *thd, Item **ref_pointer_array, List<Item> &fields,
Item **ref, bool skip_registered);
- virtual bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ virtual bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
bool get_time(MYSQL_TIME *ltime)
{ return get_date(ltime, TIME_TIME_ONLY | TIME_FUZZY_DATE); }
bool get_seconds(ulonglong *sec, ulong *sec_part);
- virtual bool get_date_result(MYSQL_TIME *ltime,uint fuzzydate)
+ virtual bool get_date_result(MYSQL_TIME *ltime, ulonglong fuzzydate)
{ return get_date(ltime,fuzzydate); }
/*
The method allows to determine nullness of a complex expression
@@ -2018,8 +2018,8 @@ public:
longlong val_int_endpoint(bool left_endp, bool *incl_endp);
Field *get_tmp_table_field() { return result_field; }
Field *tmp_table_field(TABLE *t_arg) { return result_field; }
- bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
- bool get_date_result(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
+ bool get_date_result(MYSQL_TIME *ltime,ulonglong fuzzydate);
bool is_null() { return field->is_null(); }
void update_null_value();
Item *get_tmp_table_item(THD *thd);
@@ -2201,7 +2201,7 @@ public:
longlong val_int();
my_decimal *val_decimal(my_decimal*);
String *val_str(String*);
- bool get_date(MYSQL_TIME *tm, uint fuzzydate);
+ bool get_date(MYSQL_TIME *tm, ulonglong fuzzydate);
int save_in_field(Field *field, bool no_conversions);
void set_null();
@@ -2817,7 +2817,7 @@ public:
bool val_bool();
String *val_str(String* tmp);
bool is_null();
- bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
double val_result();
longlong val_int_result();
String *str_result(String* tmp);
@@ -2953,7 +2953,7 @@ public:
my_decimal *val_decimal(my_decimal *);
bool val_bool();
bool is_null();
- bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
virtual Ref_Type ref_type() { return DIRECT_REF; }
};
@@ -3041,7 +3041,7 @@ public:
my_decimal *val_decimal(my_decimal *);
bool val_bool();
bool is_null();
- bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
bool send(Protocol *protocol, String *buffer);
void save_org_in_field(Field *field)
{
@@ -3253,7 +3253,7 @@ public:
String* val_str(String* s);
my_decimal *val_decimal(my_decimal *);
bool val_bool();
- bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
virtual void print(String *str, enum_query_type query_type);
table_map used_tables() const;
};
@@ -3877,7 +3877,7 @@ public:
Item_cache_temporal(enum_field_types field_type_arg);
String* val_str(String *str);
bool cache_value();
- bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
int save_in_field(Field *field, bool no_conversions);
void store_packed(longlong val_arg);
/*
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 325e4ac219e..7a062b413ce 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -3167,7 +3167,7 @@ double Item_func_coalesce::real_op()
}
-bool Item_func_coalesce::get_date(MYSQL_TIME *ltime,uint fuzzydate)
+bool Item_func_coalesce::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
{
DBUG_ASSERT(fixed == 1);
null_value= 0;
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 67035384cf7..ef12364ae68 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -744,7 +744,7 @@ public:
const char *func_name() const { return "coalesce"; }
table_map not_null_tables() const { return 0; }
enum_field_types field_type() const { return cached_field_type; }
- bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
};
diff --git a/sql/item_func.cc b/sql/item_func.cc
index c765d142285..1c6a9c23b26 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2730,7 +2730,7 @@ void Item_func_min_max::fix_length_and_dec()
0 Otherwise
*/
-bool Item_func_min_max::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_func_min_max::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
longlong UNINIT_VAR(min_max);
DBUG_ASSERT(fixed == 1);
diff --git a/sql/item_func.h b/sql/item_func.h
index 5477c27b13d..8e9fbd9af5c 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -970,7 +970,7 @@ public:
longlong val_int();
String *val_str(String *);
my_decimal *val_decimal(my_decimal *);
- bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
void fix_length_and_dec();
enum Item_result result_type () const { return cmp_type; }
enum_field_types field_type() const { return cached_field_type; }
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 5ca66801796..1b3c1a616b9 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -4402,7 +4402,7 @@ null:
}
-bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
DYNAMIC_COLUMN_VALUE val;
char buff[STRING_BUFFER_USUAL_SIZE];
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index b15179e641b..69800e7e674 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -1025,7 +1025,7 @@ public:
double val_real();
my_decimal *val_decimal(my_decimal *);
bool get_dyn_value(DYNAMIC_COLUMN_VALUE *val, String *tmp);
- bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
void print(String *str, enum_query_type query_type);
};
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index da40e3b99d6..37418e990a8 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -106,7 +106,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
timestamp_type cached_timestamp_type,
const char **sub_pattern_end,
const char *date_time_type,
- uint fuzzy_date)
+ ulonglong fuzzy_date)
{
int weekday= 0, yearday= 0, daypart= 0;
int week_number= -1;
@@ -1500,7 +1500,7 @@ double Item_temporal_func::val_real()
}
-bool Item_func_from_days::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_func_from_days::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
longlong value=args[0]->val_int();
if (args[0]->null_value)
@@ -1558,7 +1558,7 @@ void Item_func_curdate_utc::store_now_in_TIME(MYSQL_TIME *now_time)
bool Item_func_curdate::get_date(MYSQL_TIME *res,
- uint fuzzy_date __attribute__((unused)))
+ ulonglong fuzzy_date __attribute__((unused)))
{
*res=ltime;
return 0;
@@ -1577,7 +1577,7 @@ bool Item_func_curtime::fix_fields(THD *thd, Item **items)
}
bool Item_func_curtime::get_date(MYSQL_TIME *res,
- uint fuzzy_date __attribute__((unused)))
+ ulonglong fuzzy_date __attribute__((unused)))
{
*res= ltime;
return 0;
@@ -1668,7 +1668,7 @@ void Item_func_now_utc::store_now_in_TIME(MYSQL_TIME *now_time)
bool Item_func_now::get_date(MYSQL_TIME *res,
- uint fuzzy_date __attribute__((unused)))
+ ulonglong fuzzy_date __attribute__((unused)))
{
*res= ltime;
return 0;
@@ -1690,13 +1690,13 @@ void Item_func_sysdate_local::store_now_in_TIME(MYSQL_TIME *now_time)
bool Item_func_sysdate_local::get_date(MYSQL_TIME *res,
- uint fuzzy_date __attribute__((unused)))
+ ulonglong fuzzy_date __attribute__((unused)))
{
store_now_in_TIME(res);
return 0;
}
-bool Item_func_sec_to_time::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_func_sec_to_time::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
DBUG_ASSERT(fixed == 1);
bool sign;
@@ -1923,7 +1923,7 @@ void Item_func_from_unixtime::fix_length_and_dec()
bool Item_func_from_unixtime::get_date(MYSQL_TIME *ltime,
- uint fuzzy_date __attribute__((unused)))
+ ulonglong fuzzy_date __attribute__((unused)))
{
bool sign;
ulonglong sec;
@@ -1953,7 +1953,7 @@ void Item_func_convert_tz::fix_length_and_dec()
bool Item_func_convert_tz::get_date(MYSQL_TIME *ltime,
- uint fuzzy_date __attribute__((unused)))
+ ulonglong fuzzy_date __attribute__((unused)))
{
my_time_t my_time_tmp;
String str;
@@ -2046,7 +2046,7 @@ void Item_date_add_interval::fix_length_and_dec()
/* Here arg[1] is a Item_interval object */
-bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
INTERVAL interval;
@@ -2412,7 +2412,7 @@ void Item_char_typecast::fix_length_and_dec()
}
-bool Item_time_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_time_typecast::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
if (get_arg0_time(ltime))
return 1;
@@ -2429,7 +2429,7 @@ bool Item_time_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
}
-bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_date_typecast::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
if (get_arg0_date(ltime, TIME_FUZZY_DATE))
return 1;
@@ -2450,7 +2450,7 @@ bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
}
-bool Item_datetime_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_datetime_typecast::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
if (get_arg0_date(ltime, fuzzy_date & ~TIME_TIME_ONLY))
return 1;
@@ -2495,7 +2495,7 @@ bool Item_datetime_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
0099-12-31
*/
-bool Item_func_makedate::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_func_makedate::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
DBUG_ASSERT(fixed == 1);
long daynr= (long) args[1]->val_int();
@@ -2560,7 +2560,7 @@ void Item_func_add_time::fix_length_and_dec()
Result: Time value or datetime value
*/
-bool Item_func_add_time::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_func_add_time::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
DBUG_ASSERT(fixed == 1);
MYSQL_TIME l_time1, l_time2;
@@ -2665,7 +2665,7 @@ void Item_func_add_time::print(String *str, enum_query_type query_type)
Result: Time value
*/
-bool Item_func_timediff::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_func_timediff::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
DBUG_ASSERT(fixed == 1);
longlong seconds;
@@ -2728,7 +2728,7 @@ bool Item_func_timediff::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
Result: Time value
*/
-bool Item_func_maketime::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_func_maketime::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
DBUG_ASSERT(fixed == 1);
bool overflow= 0;
@@ -3111,7 +3111,7 @@ void Item_func_str_to_date::fix_length_and_dec()
}
-bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
DATE_TIME_FORMAT date_time_format;
char val_buff[64], format_buff[64];
@@ -3144,7 +3144,7 @@ bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
}
-bool Item_func_last_day::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
+bool Item_func_last_day::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE) ||
(ltime->month == 0))
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 239f7e92bba..d9e58857c9d 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -498,7 +498,7 @@ public:
String *val_str(String *str);
longlong val_int();
double val_real();
- bool get_date(MYSQL_TIME *res, uint fuzzy_date) { DBUG_ASSERT(0); return 1; }
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date) { DBUG_ASSERT(0); return 1; }
my_decimal *val_decimal(my_decimal *decimal_value)
{ return val_decimal_from_date(decimal_value); }
Field *tmp_table_field(TABLE *table)
@@ -543,7 +543,7 @@ public:
Item_timefunc::fix_length_and_dec();
maybe_null= false;
}
- bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
/*
Abstract method that defines which time zone is used for conversion.
Converts time current time in my_time_t representation to broken-down
@@ -583,7 +583,7 @@ class Item_func_curdate :public Item_datefunc
public:
Item_func_curdate() :Item_datefunc() {}
void fix_length_and_dec();
- bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0;
bool check_vcol_func_processor(uchar *int_arg)
{
@@ -625,7 +625,7 @@ public:
Item_temporal_func::fix_length_and_dec();
maybe_null= false;
}
- bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0;
bool check_vcol_func_processor(uchar *int_arg)
{
@@ -664,7 +664,7 @@ public:
bool const_item() const { return 0; }
const char *func_name() const { return "sysdate"; }
void store_now_in_TIME(MYSQL_TIME *now_time);
- bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
void update_used_tables()
{
Item_func_now::update_used_tables();
@@ -679,7 +679,7 @@ class Item_func_from_days :public Item_datefunc
public:
Item_func_from_days(Item *a) :Item_datefunc(a) {}
const char *func_name() const { return "from_days"; }
- bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
bool check_valid_arguments_processor(uchar *int_arg)
@@ -713,7 +713,7 @@ class Item_func_from_unixtime :public Item_temporal_func
Item_func_from_unixtime(Item *a) :Item_temporal_func(a) {}
const char *func_name() const { return "from_unixtime"; }
void fix_length_and_dec();
- bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
};
@@ -746,7 +746,7 @@ class Item_func_convert_tz :public Item_temporal_func
Item_temporal_func(a, b, c), from_tz_cached(0), to_tz_cached(0) {}
const char *func_name() const { return "convert_tz"; }
void fix_length_and_dec();
- bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
void cleanup();
};
@@ -755,7 +755,7 @@ class Item_func_sec_to_time :public Item_timefunc
{
public:
Item_func_sec_to_time(Item *item) :Item_timefunc(item) {}
- bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
void fix_length_and_dec()
{
decimals= args[0]->decimals;
@@ -776,7 +776,7 @@ public:
const char *func_name() const { return "date_add_interval"; }
void fix_length_and_dec();
enum_field_types field_type() const { return cached_field_type; }
- bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
bool eq(const Item *item, bool binary_cmp) const;
void print(String *str, enum_query_type query_type);
};
@@ -873,7 +873,7 @@ class Item_date_typecast :public Item_temporal_typecast
public:
Item_date_typecast(Item *a) :Item_temporal_typecast(a) {}
const char *func_name() const { return "cast_as_date"; }
- bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date);
const char *cast_type() const { return "date"; }
enum_field_types field_type() const { return MYSQL_TYPE_DATE; }
};
@@ -885,7 +885,7 @@ public:
Item_time_typecast(Item *a, uint dec_arg)
:Item_temporal_typecast(a) { decimals= dec_arg; }
const char *func_name() const { return "cast_as_time"; }
- bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date);
const char *cast_type() const { return "time"; }
enum_field_types field_type() const { return MYSQL_TYPE_TIME; }
};
@@ -899,7 +899,7 @@ public:
const char *func_name() const { return "cast_as_datetime"; }
const char *cast_type() const { return "datetime"; }
enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; }
- bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date);
};
@@ -909,7 +909,7 @@ public:
Item_func_makedate(Item *a,Item *b) :Item_temporal_func(a,b) {}
const char *func_name() const { return "makedate"; }
enum_field_types field_type() const { return MYSQL_TYPE_DATE; }
- bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date);
};
@@ -924,7 +924,7 @@ public:
:Item_temporal_func(a, b), is_date(type_arg) { sign= neg_arg ? -1 : 1; }
enum_field_types field_type() const { return cached_field_type; }
void fix_length_and_dec();
- bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date);
void print(String *str, enum_query_type query_type);
const char *func_name() const { return "add_time"; }
};
@@ -940,7 +940,7 @@ public:
decimals= max(args[0]->decimals, args[1]->decimals);
Item_timefunc::fix_length_and_dec();
}
- bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date);
};
class Item_func_maketime :public Item_timefunc
@@ -950,7 +950,7 @@ public:
:Item_timefunc(a, b, c)
{}
const char *func_name() const { return "maketime"; }
- bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date);
};
@@ -1024,7 +1024,7 @@ public:
Item_func_str_to_date(Item *a, Item *b)
:Item_temporal_func(a, b), const_item(false)
{}
- bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date);
const char *func_name() const { return "str_to_date"; }
enum_field_types field_type() const { return cached_field_type; }
void fix_length_and_dec();
@@ -1036,7 +1036,7 @@ class Item_func_last_day :public Item_datefunc
public:
Item_func_last_day(Item *a) :Item_datefunc(a) {}
const char *func_name() const { return "last_day"; }
- bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
};
diff --git a/sql/log.cc b/sql/log.cc
index c60cca3a2e9..6819a1e767d 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1334,7 +1334,7 @@ bool LOGGER::general_log_print(THD *thd, enum enum_server_command command,
return general_log_write(thd, command, message_buff, message_buff_len);
}
-void LOGGER::init_error_log(uint error_log_printer)
+void LOGGER::init_error_log(ulonglong error_log_printer)
{
if (error_log_printer & LOG_NONE)
{
@@ -1357,7 +1357,7 @@ void LOGGER::init_error_log(uint error_log_printer)
}
}
-void LOGGER::init_slow_log(uint slow_log_printer)
+void LOGGER::init_slow_log(ulonglong slow_log_printer)
{
if (slow_log_printer & LOG_NONE)
{
@@ -1382,7 +1382,7 @@ void LOGGER::init_slow_log(uint slow_log_printer)
}
}
-void LOGGER::init_general_log(uint general_log_printer)
+void LOGGER::init_general_log(ulonglong general_log_printer)
{
if (general_log_printer & LOG_NONE)
{
@@ -1495,9 +1495,9 @@ bool Log_to_csv_event_handler::init()
return 0;
}
-int LOGGER::set_handlers(uint error_log_printer,
- uint slow_log_printer,
- uint general_log_printer)
+int LOGGER::set_handlers(ulonglong error_log_printer,
+ ulonglong slow_log_printer,
+ ulonglong general_log_printer)
{
/* error log table is not supported yet */
DBUG_ASSERT(error_log_printer < LOG_TABLE);
@@ -5946,7 +5946,8 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
{
if (!current->error &&
RUN_HOOK(binlog_storage, after_flush,
- (current->thd, log_file_name, log_file.pos_in_file, synced)))
+ (current->thd, log_file_name,
+ current->cache_mngr->last_commit_pos_offset, synced)))
{
current->error= ER_ERROR_ON_WRITE;
current->commit_errno= -1;
@@ -6828,7 +6829,7 @@ int TC_LOG_MMAP::open(const char *opt_name)
mysql_mutex_init(key_LOCK_pool, &LOCK_pool, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_COND_active, &COND_active, 0);
mysql_cond_init(key_COND_pool, &COND_pool, 0);
- mysql_cond_init(key_COND_queue_busy, &COND_queue_busy, 0);
+ mysql_cond_init(key_TC_LOG_MMAP_COND_queue_busy, &COND_queue_busy, 0);
inited=6;
diff --git a/sql/log.h b/sql/log.h
index c85e643d4e9..bad86e7615d 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -539,12 +539,14 @@ public:
void set_psi_keys(PSI_mutex_key key_LOCK_index,
PSI_cond_key key_update_cond,
PSI_file_key key_file_log,
- PSI_file_key key_file_log_index)
+ PSI_file_key key_file_log_index,
+ PSI_file_key key_COND_queue_busy)
{
m_key_LOCK_index= key_LOCK_index;
m_key_update_cond= key_update_cond;
m_key_file_log= key_file_log;
m_key_file_log_index= key_file_log_index;
+ m_key_COND_queue_busy= key_COND_queue_busy;
}
#endif
@@ -818,12 +820,12 @@ public:
const char *query, uint query_length);
/* we use this function to setup all enabled log event handlers */
- int set_handlers(uint error_log_printer,
- uint slow_log_printer,
- uint general_log_printer);
- void init_error_log(uint error_log_printer);
- void init_slow_log(uint slow_log_printer);
- void init_general_log(uint general_log_printer);
+ int set_handlers(ulonglong error_log_printer,
+ ulonglong slow_log_printer,
+ ulonglong general_log_printer);
+ void init_error_log(ulonglong error_log_printer);
+ void init_slow_log(ulonglong slow_log_printer);
+ void init_general_log(ulonglong general_log_printer);
void deactivate_log_handler(THD* thd, uint log_type);
bool activate_log_handler(THD* thd, uint log_type);
MYSQL_QUERY_LOG *get_slow_log_file_handler() const
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 93f0f8dd96a..37245e6eb21 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2881,7 +2881,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
else
cache_type= Log_event::EVENT_STMT_CACHE;
DBUG_ASSERT(cache_type != Log_event::EVENT_INVALID_CACHE);
- DBUG_PRINT("info",("Query_log_event has flags2: %lu sql_mode: %lu",
+ DBUG_PRINT("info",("Query_log_event has flags2: %lu sql_mode: %llu",
(ulong) flags2, sql_mode));
}
#endif /* MYSQL_CLIENT */
@@ -8228,7 +8228,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
Don't allow generation of auto_increment value when processing
rows event by setting 'MODE_NO_AUTO_VALUE_ON_ZERO'.
*/
- ulong saved_sql_mode= thd->variables.sql_mode;
+ ulonglong saved_sql_mode= thd->variables.sql_mode;
thd->variables.sql_mode= MODE_NO_AUTO_VALUE_ON_ZERO;
// row processing loop
diff --git a/sql/log_event.h b/sql/log_event.h
index e1fdc70663b..0383e746d94 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -690,7 +690,7 @@ typedef struct st_print_event_info
bool flags2_inited;
uint32 flags2;
bool sql_mode_inited;
- ulong sql_mode; /* must be same as THD.variables.sql_mode */
+ ulonglong sql_mode; /* must be same as THD.variables.sql_mode */
ulong auto_increment_increment, auto_increment_offset;
bool charset_inited;
char charset[6]; // 3 variables, each of them storable in 2 bytes
@@ -1754,7 +1754,7 @@ public:
uint32 flags2;
/* In connections sql_mode is 32 bits now but will be 64 bits soon */
- ulong sql_mode;
+ ulonglong sql_mode;
ulong auto_increment_increment, auto_increment_offset;
char charset[6];
uint time_zone_len; /* 0 means uninited */
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 53f7cfe944f..b6801d92ca8 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -474,9 +474,9 @@ ulong slave_exec_mode_options;
ulonglong slave_type_conversions_options;
ulong thread_cache_size=0;
ulong binlog_cache_size=0;
-ulonglong max_binlog_cache_size=0;
+ulong max_binlog_cache_size=0;
ulong binlog_stmt_cache_size=0;
-ulonglong max_binlog_stmt_cache_size=0;
+ulong max_binlog_stmt_cache_size=0;
ulong query_cache_size=0;
ulong refresh_version; /* Increments on each reload */
query_id_t global_query_id;
@@ -811,7 +811,7 @@ static PSI_rwlock_info all_server_rwlocks[]=
};
#ifdef HAVE_MMAP
-PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool, key_COND_queue_busy;
+PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool;
#endif /* HAVE_MMAP */
PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
@@ -823,8 +823,11 @@ PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
key_relay_log_info_data_cond, key_relay_log_info_log_space_cond,
key_relay_log_info_start_cond, key_relay_log_info_stop_cond,
key_TABLE_SHARE_cond, key_user_level_lock_cond,
- key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache;
+ key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache,
+ key_BINLOG_COND_queue_busy;
PSI_cond_key key_RELAYLOG_update_cond, key_COND_wakeup_ready;
+PSI_cond_key key_RELAYLOG_COND_queue_busy;
+PSI_cond_key key_TC_LOG_MMAP_COND_queue_busy;
static PSI_cond_info all_server_conds[]=
{
@@ -835,10 +838,13 @@ static PSI_cond_info all_server_conds[]=
{ &key_PAGE_cond, "PAGE::cond", 0},
{ &key_COND_active, "TC_LOG_MMAP::COND_active", 0},
{ &key_COND_pool, "TC_LOG_MMAP::COND_pool", 0},
+ { &key_TC_LOG_MMAP_COND_queue_busy, "TC_LOG_MMAP::COND_queue_busy", 0},
#endif /* HAVE_MMAP */
{ &key_BINLOG_COND_prep_xids, "MYSQL_BIN_LOG::COND_prep_xids", 0},
{ &key_BINLOG_update_cond, "MYSQL_BIN_LOG::update_cond", 0},
+ { &key_BINLOG_COND_queue_busy, "MYSQL_BIN_LOG::COND_queue_busy", 0},
{ &key_RELAYLOG_update_cond, "MYSQL_RELAY_LOG::update_cond", 0},
+ { &key_RELAYLOG_COND_queue_busy, "MYSQL_RELAY_LOG::COND_queue_busy", 0},
{ &key_COND_wakeup_ready, "THD::COND_wakeup_ready", 0},
{ &key_COND_cache_status_changed, "Query_cache::COND_cache_status_changed", 0},
{ &key_COND_manager, "COND_manager", PSI_FLAG_GLOBAL},
@@ -2213,7 +2219,7 @@ static void network_init(void)
extra_ip_sock= activate_tcp_port(mysqld_extra_port);
}
-#ifdef __NT__
+#ifdef _WIN32
/* create named pipe */
if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap &&
opt_enable_named_pipe)
@@ -3543,7 +3549,8 @@ static int init_common_variables()
mysql_bin_log.set_psi_keys(key_BINLOG_LOCK_index,
key_BINLOG_update_cond,
key_file_binlog,
- key_file_binlog_index);
+ key_file_binlog_index,
+ key_BINLOG_COND_queue_busy);
#endif
/*
@@ -5110,6 +5117,7 @@ int mysqld_main(int argc, char **argv)
}
#endif
mysqld_exit(0);
+ return 0;
}
#endif /* !EMBEDDED_LIBRARY */
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 1ad46f94817..7b760c911d0 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -166,7 +166,7 @@ extern ulong what_to_log,flush_time;
extern ulong max_prepared_stmt_count, prepared_stmt_count;
extern ulong open_files_limit;
extern ulong binlog_cache_size, binlog_stmt_cache_size;
-extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size;
+extern ulong max_binlog_cache_size, max_binlog_stmt_cache_size;
extern ulong max_binlog_size, max_relay_log_size;
extern ulong opt_binlog_rows_event_max_size;
extern ulong rpl_recovery_rank, thread_cache_size;
@@ -247,8 +247,7 @@ extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,
key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock;
#ifdef HAVE_MMAP
-extern PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool,
- key_COND_queue_busy;
+extern PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool;
#endif /* HAVE_MMAP */
extern PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
@@ -262,6 +261,8 @@ extern PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
key_TABLE_SHARE_cond, key_user_level_lock_cond,
key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache;
extern PSI_cond_key key_RELAYLOG_update_cond, key_COND_wakeup_ready;
+extern PSI_cond_key key_RELAYLOG_COND_queue_busy;
+extern PSI_cond_key key_TC_LOG_MMAP_COND_queue_busy;
extern PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert,
key_thread_handle_manager, key_thread_kill_server, key_thread_main,
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index e62b895a839..7c8a520879f 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -2088,7 +2088,7 @@ bool partition_info::fix_column_value_functions(THD *thd,
{
uchar *val_ptr;
uint len= field->pack_length();
- ulong save_sql_mode;
+ ulonglong save_sql_mode;
bool save_got_warning;
if (!(column_item= get_column_item(column_item,
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 26d405306c9..2e5202d7cb6 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -61,7 +61,8 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery)
relay_log.set_psi_keys(key_RELAYLOG_LOCK_index,
key_RELAYLOG_update_cond,
key_file_relaylog,
- key_file_relaylog_index);
+ key_file_relaylog_index,
+ key_RELAYLOG_COND_queue_busy);
#endif
group_relay_log_name[0]= event_relay_log_name[0]=
diff --git a/sql/set_var.h b/sql/set_var.h
index d34b1db8b71..2c345f3af5f 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -305,8 +305,8 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list);
bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type);
-ulong expand_sql_mode(ulonglong sql_mode);
-bool sql_mode_string_representation(THD *thd, ulong sql_mode, LEX_STRING *ls);
+ulonglong expand_sql_mode(ulonglong sql_mode);
+bool sql_mode_string_representation(THD *thd, ulonglong sql_mode, LEX_STRING *ls);
extern sys_var *Sys_autocommit_ptr;
diff --git a/sql/sp.cc b/sql/sp.cc
index b693569753f..af864989abd 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -43,11 +43,11 @@ create_string(THD *thd, String *buf,
st_sp_chistics *chistics,
const LEX_STRING *definer_user,
const LEX_STRING *definer_host,
- ulong sql_mode);
+ ulonglong sql_mode);
static int
db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
- ulong sql_mode, const char *params, const char *returns,
+ ulonglong sql_mode, const char *params, const char *returns,
const char *body, st_sp_chistics &chistics,
const char *definer, longlong created, longlong modified,
Stored_program_creation_ctx *creation_ctx);
@@ -542,7 +542,7 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp)
char buff[65];
String str(buff, sizeof(buff), &my_charset_bin);
bool saved_time_zone_used= thd->time_zone_used;
- ulong sql_mode, saved_mode= thd->variables.sql_mode;
+ ulonglong sql_mode, saved_mode= thd->variables.sql_mode;
Open_tables_backup open_tables_state_backup;
Stored_program_creation_ctx *creation_ctx;
@@ -716,11 +716,11 @@ Silence_deprecated_warning::handle_condition(
@retval 0 error
*/
-static sp_head *sp_compile(THD *thd, String *defstr, ulong sql_mode,
+static sp_head *sp_compile(THD *thd, String *defstr, ulonglong sql_mode,
Stored_program_creation_ctx *creation_ctx)
{
sp_head *sp;
- ulong old_sql_mode= thd->variables.sql_mode;
+ ulonglong old_sql_mode= thd->variables.sql_mode;
ha_rows old_select_limit= thd->variables.select_limit;
sp_rcontext *old_spcont= thd->spcont;
Silence_deprecated_warning warning_handler;
@@ -798,7 +798,7 @@ Bad_db_error_handler::handle_condition(THD *thd,
static int
db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
- ulong sql_mode, const char *params, const char *returns,
+ ulonglong sql_mode, const char *params, const char *returns,
const char *body, st_sp_chistics &chistics,
const char *definer, longlong created, longlong modified,
Stored_program_creation_ctx *creation_ctx)
@@ -971,7 +971,7 @@ sp_create_routine(THD *thd, int type, sp_head *sp)
int ret;
TABLE *table;
char definer[USER_HOST_BUFF_SIZE];
- ulong saved_mode= thd->variables.sql_mode;
+ ulonglong saved_mode= thd->variables.sql_mode;
MDL_key::enum_mdl_namespace mdl_type= type == TYPE_ENUM_FUNCTION ?
MDL_key::FUNCTION : MDL_key::PROCEDURE;
@@ -2127,7 +2127,6 @@ int sp_cache_routine(THD *thd, int type, sp_name *name,
Returns TRUE on success, FALSE on (alloc) failure.
*/
static bool
-
create_string(THD *thd, String *buf,
int type,
const char *db, ulong dblen,
@@ -2138,9 +2137,9 @@ create_string(THD *thd, String *buf,
st_sp_chistics *chistics,
const LEX_STRING *definer_user,
const LEX_STRING *definer_host,
- ulong sql_mode)
+ ulonglong sql_mode)
{
- ulong old_sql_mode= thd->variables.sql_mode;
+ ulonglong old_sql_mode= thd->variables.sql_mode;
/* Make some room to begin with */
if (buf->alloc(100 + dblen + 1 + namelen + paramslen + returnslen + bodylen +
chistics->comment.length + 10 /* length of " DEFINER= "*/ +
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index ff104d04aec..f8802acb75b 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1195,7 +1195,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
sp_rcontext *ctx= thd->spcont;
bool err_status= FALSE;
uint ip= 0;
- ulong save_sql_mode;
+ ulonglong save_sql_mode;
bool save_abort_on_warning;
Query_arena *old_arena;
/* per-instruction arena */
@@ -2477,7 +2477,7 @@ sp_head::do_cont_backpatch()
void
sp_head::set_info(longlong created, longlong modified,
- st_sp_chistics *chistics, ulong sql_mode)
+ st_sp_chistics *chistics, ulonglong sql_mode)
{
m_created= created;
m_modified= modified;
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 0f6fddc75f0..5442d5d84b4 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -172,7 +172,7 @@ public:
const char *m_tmp_query; ///< Temporary pointer to sub query string
st_sp_chistics *m_chistics;
- ulong m_sql_mode; ///< For SHOW CREATE and execution
+ ulonglong m_sql_mode; ///< For SHOW CREATE and execution
LEX_STRING m_qname; ///< db.name
bool m_explicit_name; ///< Prepend the db name? */
LEX_STRING m_db;
@@ -394,7 +394,7 @@ public:
Create_field *field_def);
void set_info(longlong created, longlong modified,
- st_sp_chistics *chistics, ulong sql_mode);
+ st_sp_chistics *chistics, ulonglong sql_mode);
void set_definer(const char *definer, uint definerlen);
void set_definer(const LEX_STRING *user_name, const LEX_STRING *host_name);
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 1f34712b044..7a453bc6090 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -740,7 +740,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE;
char tmp_name[SAFE_NAME_LEN+1];
int password_length;
- ulong old_sql_mode= thd->variables.sql_mode;
+ ulonglong old_sql_mode= thd->variables.sql_mode;
DBUG_ENTER("acl_load");
thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH;
@@ -4307,7 +4307,7 @@ static my_bool grant_load(THD *thd, TABLE_LIST *tables)
bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE;
MEM_ROOT **save_mem_root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**,
THR_MALLOC);
- ulong old_sql_mode= thd->variables.sql_mode;
+ ulonglong old_sql_mode= thd->variables.sql_mode;
DBUG_ENTER("grant_load");
thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH;
@@ -6541,7 +6541,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
List_iterator <LEX_USER> user_list(list);
TABLE_LIST tables[GRANT_TABLES];
bool some_users_deleted= FALSE;
- ulong old_sql_mode= thd->variables.sql_mode;
+ ulonglong old_sql_mode= thd->variables.sql_mode;
bool save_binlog_row_based;
DBUG_ENTER("mysql_drop_user");
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index db0da4bdae6..452cc0b02b8 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1422,7 +1422,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
DBUG_PRINT("qcache", ("\
long %d, 4.1: %d, bin_proto: %d, more results %d, pkt_nr: %d, \
CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \
-sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
+sql mode: 0x%llx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
def_week_frmt: %lu, in_trans: %d, autocommit: %d",
(int)flags.client_long_flag,
(int)flags.client_protocol_41,
@@ -1824,7 +1824,7 @@ Query_cache::send_result_to_client(THD *thd, char *org_sql, uint query_length)
DBUG_PRINT("qcache", ("\
long %d, 4.1: %d, bin_proto: %d, more results %d, pkt_nr: %d, \
CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \
-sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
+sql mode: 0x%llx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
def_week_frmt: %lu, in_trans: %d, autocommit: %d",
(int)flags.client_long_flag,
(int)flags.client_protocol_41,
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index 36a05b49fa9..87b861b34f8 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -537,7 +537,7 @@ struct Query_cache_query_flags
uint collation_connection_num;
ha_rows limit;
Time_zone *time_zone;
- ulong sql_mode;
+ ulonglong sql_mode;
ulong max_sort_length;
ulong group_concat_max_len;
ulong default_week_format;
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 1cd615394fb..8013d2bd6e2 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1660,7 +1660,7 @@ bool mysql_upgrade_db(THD *thd, LEX_STRING *old_db)
/* Lock the old name, the new name will be locked by mysql_create_db().*/
if (lock_schema_name(thd, old_db->str))
- DBUG_RETURN(-1);
+ DBUG_RETURN(1);
/*
Let's remember if we should do "USE newdb" afterwards.
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index b6ab3e4a7ff..f8327ccee04 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1877,7 +1877,7 @@ public:
enum_duplicates dup;
my_time_t start_time;
ulong start_time_sec_part;
- ulong sql_mode;
+ ulonglong sql_mode;
bool auto_increment_field_not_null;
bool query_start_used, ignore, log_query, query_start_sec_part_used;
bool stmt_depends_on_first_successful_insert_id_in_prev_stmt;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 1b0279c9969..abd29ea6a02 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -7156,7 +7156,7 @@ copy_data_between_tables(THD *thd, TABLE *from,TABLE *to,
List<Item> all_fields;
ha_rows examined_rows;
bool auto_increment_field_copied= 0;
- ulong save_sql_mode= thd->variables.sql_mode;
+ ulonglong save_sql_mode= thd->variables.sql_mode;
ulonglong prev_insert_id, time_to_report_progress;
List_iterator<Create_field> it(create);
Create_field *def;
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index e30c74a148e..5972c8918ba 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -245,7 +245,7 @@ to_ascii(CHARSET_INFO *cs,
wc < 128)
{
src+= cnvres;
- *dst++= wc;
+ *dst++= static_cast<char>(wc);
}
*dst= '\0';
return dst - dst0;
@@ -255,7 +255,7 @@ to_ascii(CHARSET_INFO *cs,
/* Character set-aware version of str_to_time() */
timestamp_type
str_to_time(CHARSET_INFO *cs, const char *str,uint length,
- MYSQL_TIME *l_time, ulong fuzzydate, int *warning)
+ MYSQL_TIME *l_time, ulonglong fuzzydate, int *warning)
{
char cnv[32];
if ((cs->state & MY_CS_NONASCII) != 0)
@@ -270,7 +270,7 @@ str_to_time(CHARSET_INFO *cs, const char *str,uint length,
/* Character set-aware version of str_to_datetime() */
timestamp_type str_to_datetime(CHARSET_INFO *cs,
const char *str, uint length,
- MYSQL_TIME *l_time, uint flags, int *was_cut)
+ MYSQL_TIME *l_time, ulonglong flags, int *was_cut)
{
char cnv[32];
if ((cs->state & MY_CS_NONASCII) != 0)
@@ -293,7 +293,7 @@ timestamp_type str_to_datetime(CHARSET_INFO *cs,
timestamp_type
str_to_datetime_with_warn(CHARSET_INFO *cs,
const char *str, uint length, MYSQL_TIME *l_time,
- ulong flags)
+ ulonglong flags)
{
int was_cut;
THD *thd= current_thd;
@@ -324,7 +324,7 @@ str_to_datetime_with_warn(CHARSET_INFO *cs,
@returns 0 for success, 1 for a failure
*/
static bool number_to_time_with_warn(bool neg, ulonglong nr, ulong sec_part,
- MYSQL_TIME *ltime, ulong fuzzydate,
+ MYSQL_TIME *ltime, ulonglong fuzzydate,
const ErrConv *str,
const char *field_name)
{
@@ -356,7 +356,7 @@ static bool number_to_time_with_warn(bool neg, ulonglong nr, ulong sec_part,
bool double_to_datetime_with_warn(double value, MYSQL_TIME *ltime,
- ulong fuzzydate, const char *field_name)
+ ulonglong fuzzydate, const char *field_name)
{
const ErrConvDouble str(value);
bool neg= value < 0;
@@ -375,7 +375,7 @@ bool double_to_datetime_with_warn(double value, MYSQL_TIME *ltime,
bool decimal_to_datetime_with_warn(const my_decimal *value, MYSQL_TIME *ltime,
- ulong fuzzydate, const char *field_name)
+ ulonglong fuzzydate, const char *field_name)
{
const ErrConvDecimal str(value);
ulonglong nr;
@@ -387,7 +387,7 @@ bool decimal_to_datetime_with_warn(const my_decimal *value, MYSQL_TIME *ltime,
bool int_to_datetime_with_warn(longlong value, MYSQL_TIME *ltime,
- ulong fuzzydate, const char *field_name)
+ ulonglong fuzzydate, const char *field_name)
{
const ErrConvInteger str(value);
bool neg= value < 0;
diff --git a/sql/sql_time.h b/sql/sql_time.h
index 7d0d9610872..026a15cb796 100644
--- a/sql/sql_time.h
+++ b/sql/sql_time.h
@@ -36,18 +36,18 @@ ulong convert_month_to_period(ulong month);
void get_date_from_daynr(long daynr,uint *year, uint *month, uint *day);
my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, uint *error_code);
bool str_to_time_with_warn(CHARSET_INFO *cs, const char *str, uint length,
- MYSQL_TIME *l_time, ulong fuzzydate);
+ MYSQL_TIME *l_time, ulonglong fuzzydate);
timestamp_type str_to_datetime_with_warn(CHARSET_INFO *cs, const char *str,
uint length, MYSQL_TIME *l_time,
- ulong flags);
+ ulonglong flags);
bool double_to_datetime_with_warn(double value, MYSQL_TIME *ltime,
- ulong fuzzydate,
+ ulonglong fuzzydate,
const char *name);
bool decimal_to_datetime_with_warn(const my_decimal *value, MYSQL_TIME *ltime,
- ulong fuzzydate,
+ ulonglong fuzzydate,
const char *name);
bool int_to_datetime_with_warn(longlong value, MYSQL_TIME *ltime,
- ulong fuzzydate,
+ ulonglong fuzzydate,
const char *name);
void make_truncated_value_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
@@ -87,11 +87,11 @@ bool parse_date_time_format(timestamp_type format_type,
DATE_TIME_FORMAT *date_time_format);
/* Character set-aware version of str_to_time() */
timestamp_type str_to_time(CHARSET_INFO *cs, const char *str,uint length,
- MYSQL_TIME *l_time, ulong fuzzydate, int *warning);
+ MYSQL_TIME *l_time, ulonglong fuzzydate, int *warning);
/* Character set-aware version of str_to_datetime() */
timestamp_type str_to_datetime(CHARSET_INFO *cs,
const char *str, uint length,
- MYSQL_TIME *l_time, uint flags, int *was_cut);
+ MYSQL_TIME *l_time, ulonglong flags, int *was_cut);
/* convenience wrapper */
inline bool parse_date_time_format(timestamp_type format_type,
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 30da842e0c5..0ecc43b512f 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1349,7 +1349,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
List_iterator_fast<LEX_STRING> it_db_cl_name(triggers->db_cl_names);
LEX *old_lex= thd->lex, lex;
sp_rcontext *save_spcont= thd->spcont;
- ulong save_sql_mode= thd->variables.sql_mode;
+ ulonglong save_sql_mode= thd->variables.sql_mode;
LEX_STRING *on_table_name;
thd->lex= &lex;
@@ -1849,7 +1849,7 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd,
{
char path_buff[FN_REFLEN];
LEX_STRING *def, *on_table_name, new_def;
- ulong save_sql_mode= thd->variables.sql_mode;
+ ulonglong save_sql_mode= thd->variables.sql_mode;
List_iterator_fast<LEX_STRING> it_def(definitions_list);
List_iterator_fast<LEX_STRING> it_on_table_name(on_table_names_list);
List_iterator_fast<ulonglong> it_mode(definition_modes_list);
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index cb1c57ea0ba..c09b39c2450 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1225,7 +1225,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
view_select= &lex->select_lex;
view_select->select_number= ++thd->select_number;
- ulong saved_mode= thd->variables.sql_mode;
+ ulonglong saved_mode= thd->variables.sql_mode;
/* switch off modes which can prevent normal parsing of VIEW
- MODE_REAL_AS_FLOAT affect only CREATE TABLE parsing
+ MODE_PIPES_AS_CONCAT affect expression parsing
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 168c8a9c998..37dfb95bc6f 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1040,20 +1040,20 @@ static Sys_var_ulong Sys_max_allowed_packet(
BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG,
ON_CHECK(check_max_allowed_packet));
-static Sys_var_ulonglong Sys_max_binlog_cache_size(
+static Sys_var_ulong Sys_max_binlog_cache_size(
"max_binlog_cache_size",
"Sets the total size of the transactional cache",
GLOBAL_VAR(max_binlog_cache_size), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(IO_SIZE, ULONGLONG_MAX),
- DEFAULT((ULONGLONG_MAX/IO_SIZE)*IO_SIZE),
+ VALID_RANGE(IO_SIZE, ULONG_MAX),
+ DEFAULT((ULONG_MAX/IO_SIZE)*IO_SIZE),
BLOCK_SIZE(IO_SIZE));
-static Sys_var_ulonglong Sys_max_binlog_stmt_cache_size(
+static Sys_var_ulong Sys_max_binlog_stmt_cache_size(
"max_binlog_stmt_cache_size",
"Sets the total size of the statement cache",
GLOBAL_VAR(max_binlog_stmt_cache_size), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(IO_SIZE, ULONGLONG_MAX),
- DEFAULT((ULONGLONG_MAX/IO_SIZE)*IO_SIZE),
+ VALID_RANGE(IO_SIZE, ULONG_MAX),
+ DEFAULT((ULONG_MAX/IO_SIZE)*IO_SIZE),
BLOCK_SIZE(IO_SIZE));
static bool fix_max_binlog_size(sys_var *self, THD *thd, enum_var_type type)
@@ -1977,7 +1977,7 @@ static Sys_var_ulong Sys_sort_buffer(
VALID_RANGE(MIN_SORT_MEMORY, ULONG_MAX), DEFAULT(MAX_SORT_MEMORY),
BLOCK_SIZE(1));
-export ulong expand_sql_mode(ulonglong sql_mode)
+export ulonglong expand_sql_mode(ulonglong sql_mode)
{
if (sql_mode & MODE_ANSI)
{
@@ -2064,7 +2064,7 @@ static const char *sql_mode_names[]=
"PAD_CHAR_TO_FULL_LENGTH",
0
};
-export bool sql_mode_string_representation(THD *thd, ulong sql_mode,
+export bool sql_mode_string_representation(THD *thd, ulonglong sql_mode,
LEX_STRING *ls)
{
set_to_string(thd, ls, sql_mode, sql_mode_names);
diff --git a/sql/sys_vars.h b/sql/sys_vars.h
index 1b9a22b1db7..f152c944a3e 100644
--- a/sql/sys_vars.h
+++ b/sql/sys_vars.h
@@ -154,12 +154,12 @@ public:
}
bool session_update(THD *thd, set_var *var)
{
- session_var(thd, T)= var->save_result.ulonglong_value;
+ session_var(thd, T)= static_cast<T>(var->save_result.ulonglong_value);
return false;
}
bool global_update(THD *thd, set_var *var)
{
- global_var(T)= var->save_result.ulonglong_value;
+ global_var(T)= static_cast<T>(var->save_result.ulonglong_value);
return false;
}
bool check_update_type(Item_result type)
@@ -276,12 +276,12 @@ public:
}
bool session_update(THD *thd, set_var *var)
{
- session_var(thd, ulong)= var->save_result.ulonglong_value;
+ session_var(thd, ulong)= static_cast<ulong>(var->save_result.ulonglong_value);
return false;
}
bool global_update(THD *thd, set_var *var)
{
- global_var(ulong)= var->save_result.ulonglong_value;
+ global_var(ulong)= static_cast<ulong>(var->save_result.ulonglong_value);
return false;
}
void session_save_default(THD *thd, set_var *var)
@@ -324,12 +324,12 @@ public:
}
bool session_update(THD *thd, set_var *var)
{
- session_var(thd, my_bool)= var->save_result.ulonglong_value;
+ session_var(thd, my_bool)= var->save_result.ulonglong_value != 0;
return false;
}
bool global_update(THD *thd, set_var *var)
{
- global_var(my_bool)= var->save_result.ulonglong_value;
+ global_var(my_bool)= var->save_result.ulonglong_value != 0;
return false;
}
void session_save_default(THD *thd, set_var *var)
@@ -651,7 +651,7 @@ public:
const char *comment, int flag_args, ptrdiff_t off, size_t size,
CMD_LINE getopt,
ulonglong min_val, ulonglong max_val, ulonglong def_val,
- ulonglong block_size, PolyLock *lock,
+ uint block_size, PolyLock *lock,
enum binlog_status_enum binlog_status_arg,
on_check_function on_check_func,
keycache_update_function on_update_func,
@@ -1410,7 +1410,7 @@ public:
Sys_var_session_special(const char *name_arg,
const char *comment, int flag_args,
CMD_LINE getopt,
- ulonglong min_val, ulonglong max_val, ulonglong block_size,
+ ulonglong min_val, ulonglong max_val, uint block_size,
PolyLock *lock, enum binlog_status_enum binlog_status_arg,
on_check_function on_check_func,
session_special_update_function update_func_arg,
diff --git a/storage/heap/CMakeLists.txt b/storage/heap/CMakeLists.txt
index 4d8dc2bdd3e..0b9372bf224 100644
--- a/storage/heap/CMakeLists.txt
+++ b/storage/heap/CMakeLists.txt
@@ -22,7 +22,7 @@ SET(HEAP_SOURCES _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create
MYSQL_ADD_PLUGIN(heap ${HEAP_SOURCES} STORAGE_ENGINE MANDATORY RECOMPILE_FOR_EMBEDDED)
ADD_EXECUTABLE(hp_test1 hp_test1.c)
-TARGET_LINK_LIBRARIES(hp_test1 heap mysys ${DBUG_LIBRARY} strings)
+TARGET_LINK_LIBRARIES(hp_test1 heap mysys dbug strings)
ADD_EXECUTABLE(hp_test2 hp_test2.c)
-TARGET_LINK_LIBRARIES(hp_test2 heap mysys ${DBUG_LIBRARY} strings)
+TARGET_LINK_LIBRARIES(hp_test2 heap mysys dbug strings)
diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c
index 8ea57b8655c..993d44173ee 100644
--- a/storage/innobase/sync/sync0sync.c
+++ b/storage/innobase/sync/sync0sync.c
@@ -35,6 +35,9 @@ Created 9/5/1995 Heikki Tuuri
#include "sync0sync.ic"
#endif
+/* disable timed_mutexes - obsolete feature that doesn't link on windows */
+#define timed_mutexes 0
+
#include "sync0rw.h"
#include "buf0buf.h"
#include "srv0srv.h"
diff --git a/storage/maria/unittest/CMakeLists.txt b/storage/maria/unittest/CMakeLists.txt
index 8a83a589706..fd3e3f909ce 100644
--- a/storage/maria/unittest/CMakeLists.txt
+++ b/storage/maria/unittest/CMakeLists.txt
@@ -16,7 +16,7 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/unittest/mytap)
-LINK_LIBRARIES(aria myisam mytap mysys ${DBUG_LIBRARY} strings ${ZLIB_LIBRARY})
+LINK_LIBRARIES(aria myisam mytap mysys dbug strings ${ZLIB_LIBRARY})
MY_ADD_TESTS(ma_control_file trnman)
diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc
index 70de838cf18..12e7448316d 100644
--- a/storage/xtradb/handler/i_s.cc
+++ b/storage/xtradb/handler/i_s.cc
@@ -3910,19 +3910,19 @@ i_s_innodb_buffer_pool_pages_index_fill(
if (fil_page_get_type(frame) == FIL_PAGE_INDEX) {
index_id = btr_page_get_index_id(frame);
- table->field[0]->store(index_id);
- table->field[1]->store(block->page.space);
- table->field[2]->store(block->page.offset);
- table->field[3]->store(page_get_n_recs(frame));
- table->field[4]->store(page_get_data_size(frame));
- table->field[5]->store(block->is_hashed);
- table->field[6]->store(block->page.access_time);
- table->field[7]->store(block->page.newest_modification != 0);
- table->field[8]->store(block->page.oldest_modification != 0);
- table->field[9]->store(block->page.old);
- table->field[10]->store(0);
- table->field[11]->store(block->page.buf_fix_count);
- table->field[12]->store(block->page.flush_type);
+ table->field[0]->store(index_id, TRUE);
+ table->field[1]->store(block->page.space, TRUE);
+ table->field[2]->store(block->page.offset, TRUE);
+ table->field[3]->store(page_get_n_recs(frame), TRUE);
+ table->field[4]->store(page_get_data_size(frame), TRUE);
+ table->field[5]->store(block->is_hashed, TRUE);
+ table->field[6]->store(block->page.access_time, TRUE);
+ table->field[7]->store(block->page.newest_modification != 0, TRUE);
+ table->field[8]->store(block->page.oldest_modification != 0, TRUE);
+ table->field[9]->store(block->page.old, TRUE);
+ table->field[10]->store(0, TRUE);
+ table->field[11]->store(block->page.buf_fix_count, TRUE);
+ table->field[12]->store(block->page.flush_type, TRUE);
if (schema_table_store_record(thd, table)) {
status = 1;
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index 68a13dbedbd..ffab57a7d96 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -197,7 +197,7 @@ static uint mbcharlen_cp932(CHARSET_INFO *cs __attribute__((unused)),uint c)
#define cp932code(c,d) ((((uint) (uchar)(c)) << 8) | (uint) (uchar) (d))
-static const MY_UNICASE_INFO c81[256]=
+static MY_UNICASE_INFO c81[256]=
{
/* 8100-810F */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -407,7 +407,7 @@ static const MY_UNICASE_INFO c81[256]=
};
-static const MY_UNICASE_INFO c82[256]=
+static MY_UNICASE_INFO c82[256]=
{
/* 8200-820F */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -615,7 +615,7 @@ static const MY_UNICASE_INFO c82[256]=
};
-static const MY_UNICASE_INFO c83[256]=
+static MY_UNICASE_INFO c83[256]=
{
/* 8300-830F */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -825,7 +825,7 @@ static const MY_UNICASE_INFO c83[256]=
};
-static const MY_UNICASE_INFO c84[256]=
+static MY_UNICASE_INFO c84[256]=
{
/* 8400-840F */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -1035,7 +1035,7 @@ static const MY_UNICASE_INFO c84[256]=
};
-static const MY_UNICASE_INFO c87[256]=
+static MY_UNICASE_INFO c87[256]=
{
/* 8700-870F */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -1245,7 +1245,7 @@ static const MY_UNICASE_INFO c87[256]=
};
-static const MY_UNICASE_INFO cEE[256]=
+static MY_UNICASE_INFO cEE[256]=
{
/* EE00-EE0F */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -1456,7 +1456,7 @@ static const MY_UNICASE_INFO cEE[256]=
};
-static const MY_UNICASE_INFO cFA[256]=
+static MY_UNICASE_INFO cFA[256]=
{
/* FA00-FA0F */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -1666,7 +1666,7 @@ static const MY_UNICASE_INFO cFA[256]=
};
-static const MY_UNICASE_INFO *my_caseinfo_cp932[256]=
+static MY_UNICASE_INFO *my_caseinfo_cp932[256]=
{
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c
index b2af2cb5608..9ad64ca2457 100644
--- a/strings/ctype-eucjpms.c
+++ b/strings/ctype-eucjpms.c
@@ -203,7 +203,7 @@ static uint mbcharlen_eucjpms(CHARSET_INFO *cs __attribute__((unused)),uint c)
/* Case info pages for JIS-X-0208 range */
-static const MY_UNICASE_INFO cA2[256]=
+static MY_UNICASE_INFO cA2[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -324,7 +324,7 @@ static const MY_UNICASE_INFO cA2[256]=
};
-static const MY_UNICASE_INFO cA3[256]=
+static MY_UNICASE_INFO cA3[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -445,7 +445,7 @@ static const MY_UNICASE_INFO cA3[256]=
};
-static const MY_UNICASE_INFO cA6[256]=
+static MY_UNICASE_INFO cA6[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -566,7 +566,7 @@ static const MY_UNICASE_INFO cA6[256]=
};
-static const MY_UNICASE_INFO cA7[256]=
+static MY_UNICASE_INFO cA7[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -687,7 +687,7 @@ static const MY_UNICASE_INFO cA7[256]=
};
-static const MY_UNICASE_INFO cAD[256]=
+static MY_UNICASE_INFO cAD[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -810,7 +810,7 @@ static const MY_UNICASE_INFO cAD[256]=
/* Case info pages for JIS-X-0212 range */
-static const MY_UNICASE_INFO c8FA6[256]=
+static MY_UNICASE_INFO c8FA6[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -931,7 +931,7 @@ static const MY_UNICASE_INFO c8FA6[256]=
};
-static const MY_UNICASE_INFO c8FA7[256]=
+static MY_UNICASE_INFO c8FA7[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -1052,7 +1052,7 @@ static const MY_UNICASE_INFO c8FA7[256]=
};
-static const MY_UNICASE_INFO c8FA9[256]=
+static MY_UNICASE_INFO c8FA9[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -1173,7 +1173,7 @@ static const MY_UNICASE_INFO c8FA9[256]=
};
-static const MY_UNICASE_INFO c8FAA[256]=
+static MY_UNICASE_INFO c8FAA[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -1294,7 +1294,7 @@ static const MY_UNICASE_INFO c8FAA[256]=
};
-static const MY_UNICASE_INFO c8FAB[256]=
+static MY_UNICASE_INFO c8FAB[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -1415,7 +1415,7 @@ static const MY_UNICASE_INFO c8FAB[256]=
};
-static const MY_UNICASE_INFO c8FF3[256]=
+static MY_UNICASE_INFO c8FF3[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -1536,7 +1536,7 @@ static const MY_UNICASE_INFO c8FF3[256]=
};
-static const MY_UNICASE_INFO c8FF4[256]=
+static MY_UNICASE_INFO c8FF4[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
@@ -1657,7 +1657,7 @@ static const MY_UNICASE_INFO c8FF4[256]=
};
-static const MY_UNICASE_INFO *my_caseinfo_eucjpms[512]=
+static MY_UNICASE_INFO *my_caseinfo_eucjpms[512]=
{
/* JIS-X-0208 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index a33d0d82f56..601bbabddb5 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -136,7 +136,7 @@ static const uchar to_upper_gbk[]=
(uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377',
};
-static const MY_UNICASE_INFO cA2[256]=
+static MY_UNICASE_INFO cA2[256]=
{
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */
{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
diff --git a/unittest/mytap/tap.c b/unittest/mytap/tap.c
index 05407a442f0..ad08789a275 100644
--- a/unittest/mytap/tap.c
+++ b/unittest/mytap/tap.c
@@ -274,7 +274,7 @@ ok1(int const pass)
}
void
-skip(int how_many, char const *fmt, ...)
+skip(int how_many, char const * const fmt, ...)
{
char reason[80];
if (fmt && *fmt)