diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2018-01-15 18:59:27 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2018-01-26 10:37:46 +0000 |
commit | 477a1bc42b318e93baa3de5dbbd20c90aeaddc28 (patch) | |
tree | e58785c5d299b0324121900b22463bde276f4015 /sql | |
parent | db28f0f8da5c5847366e6caeec4bf3e81781d94f (diff) | |
download | mariadb-git-477a1bc42b318e93baa3de5dbbd20c90aeaddc28.tar.gz |
Windows : fix compile warnings C4267, on 32bit first
Diffstat (limited to 'sql')
-rw-r--r-- | sql/create_options.cc | 3 | ||||
-rw-r--r-- | sql/log_event.cc | 3 | ||||
-rw-r--r-- | sql/sql_acl.cc | 3 |
3 files changed, 6 insertions, 3 deletions
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); } |