diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-03-12 16:27:19 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-03-14 16:33:17 +0100 |
commit | 3d2d060b626a94a19480db55feecc3020440b5c3 (patch) | |
tree | 52a1c7c7add53908023d23f90a95a764bbc23d06 /sql/encryption.cc | |
parent | ddfa722a03ab3649783f8798df02d94a8a8ef6e3 (diff) | |
download | mariadb-git-3d2d060b626a94a19480db55feecc3020440b5c3.tar.gz |
fix gcc 8 compiler warnings
There were two newly enabled warnings:
1. cast for a function pointers. Affected sql_analyse.h, mi_write.c
and ma_write.cc, mf_iocache-t.cc, mysqlbinlog.cc, encryption.cc, etc
2. memcpy/memset of nontrivial structures. Fixed as:
* the warning disabled for InnoDB
* TABLE, TABLE_SHARE, and TABLE_LIST got a new method reset() which
does the bzero(), which is safe for these classes, but any other
bzero() will still cause a warning
* Table_scope_and_contents_source_st uses `TABLE_LIST *` (trivial)
instead of `SQL_I_List<TABLE_LIST>` (not trivial) so it's safe to
bzero now.
* added casts in debug_sync.cc and sql_select.cc (for JOIN)
* move assignment method for MDL_request instead of memcpy()
* PARTIAL_INDEX_INTERSECT_INFO::init() instead of bzero()
* remove constructor from READ_RECORD() to make it trivial
* replace some memcpy() with c++ copy assignments
Diffstat (limited to 'sql/encryption.cc')
-rw-r--r-- | sql/encryption.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sql/encryption.cc b/sql/encryption.cc index 52eab262570..e5b54633066 100644 --- a/sql/encryption.cc +++ b/sql/encryption.cc @@ -25,6 +25,10 @@ struct encryption_service_st encryption_handler; extern "C" { +uint no_get_key(uint, uint, uchar*, uint*) +{ + return ENCRYPTION_KEY_VERSION_INVALID; +} uint no_key(uint) { return ENCRYPTION_KEY_VERSION_INVALID; @@ -47,6 +51,11 @@ static unsigned int get_length(unsigned int slen, unsigned int key_id, return my_aes_get_size(MY_AES_CBC, slen); } +uint ctx_size(unsigned int, unsigned int) +{ + return MY_AES_CTX_SIZE; +} + } /* extern "C" */ int initialize_encryption_plugin(st_plugin_int *plugin) @@ -72,8 +81,7 @@ int initialize_encryption_plugin(st_plugin_int *plugin) if (handle->crypt_ctx_size) encryption_handler.encryption_ctx_size_func= handle->crypt_ctx_size; else - encryption_handler.encryption_ctx_size_func= - (uint (*)(unsigned int, unsigned int))my_aes_ctx_size; + encryption_handler.encryption_ctx_size_func= ctx_size; encryption_handler.encryption_ctx_init_func= handle->crypt_ctx_init ? handle->crypt_ctx_init : ctx_init; @@ -102,8 +110,7 @@ int finalize_encryption_plugin(st_plugin_int *plugin) if (used) { - encryption_handler.encryption_key_get_func= - (uint (*)(uint, uint, uchar*, uint*))no_key; + encryption_handler.encryption_key_get_func= no_get_key; encryption_handler.encryption_key_get_latest_version_func= no_key; encryption_handler.encryption_ctx_size_func= zero_size; } |