summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/os/Windows.cmake7
-rw-r--r--sql/create_options.cc3
-rw-r--r--sql/log_event.cc3
-rw-r--r--sql/sql_acl.cc3
-rw-r--r--storage/connect/odbconn.cpp4
5 files changed, 13 insertions, 7 deletions
diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake
index b089a7f59f0..02c2d86617d 100644
--- a/cmake/os/Windows.cmake
+++ b/cmake/os/Windows.cmake
@@ -140,8 +140,11 @@ IF(MSVC)
#TODO: update the code and remove the disabled warnings
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4805 /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267")
-
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4805 /wd4291 /wd4996 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090")
+ IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ # Temporarily disable size_t warnings, due to their amount
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
+ ENDIF()
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
diff --git a/sql/create_options.cc b/sql/create_options.cc
index 96893aa172e..53258dac3fc 100644
--- a/sql/create_options.cc
+++ b/sql/create_options.cc
@@ -613,7 +613,8 @@ uchar *engine_option_value::frm_image(uchar *buff)
{
if (value.str)
{
- *buff++= name.length;
+ DBUG_ASSERT(name.length <= 0xff);
+ *buff++= (uchar)name.length;
memcpy(buff, name.str, name.length);
buff+= name.length;
int2store(buff, value.length | (quoted_value ? FRM_QUOTED_VALUE : 0));
diff --git a/sql/log_event.cc b/sql/log_event.cc
index d80f45dffc1..4120342c2c5 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -11791,7 +11791,8 @@ int Table_map_log_event::rewrite_db(const char* new_db, size_t new_len,
cnt += header_len;
// Write new db name length and new name
- *ptr++ = new_len;
+ DBUG_ASSERT(new_len < 0xff);
+ *ptr++ = (char)new_len;
memcpy(ptr, new_db, new_len + 1);
ptr += new_len + 1;
cnt += m_dblen + 2;
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 1a2c7fc302f..029de16cfbb 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -3007,7 +3007,8 @@ exit:
(entry= (acl_entry*) malloc(sizeof(acl_entry)+key_length)))
{
entry->access=(db_access & host_access);
- entry->length=key_length;
+ DBUG_ASSERT(key_length < 0xffff);
+ entry->length=(uint16)key_length;
memcpy((uchar*) entry->key,key,key_length);
acl_cache->add(entry);
}
diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp
index 3b0cb562672..45662779b81 100644
--- a/storage/connect/odbconn.cpp
+++ b/storage/connect/odbconn.cpp
@@ -2250,10 +2250,10 @@ public:
return (SQLCHAR *) (m_part[i].length ? m_part[i].str : NULL);
} // end of ptr
- size_t length(uint i)
+ SQLSMALLINT length(uint i)
{
DBUG_ASSERT(i < max_parts);
- return m_part[i].length;
+ return (SQLSMALLINT)m_part[i].length;
} // end of length
}; // end of class SQLQualifiedName