From 8d4c159b1bfc75fcddc50f740ec9a001aa6d2bc4 Mon Sep 17 00:00:00 2001 From: Monty Date: Tue, 25 Jun 2019 13:09:06 +0300 Subject: [PATCH] Added s3_debug to be able to debug s3 connections --- libmysqld/libmysql.c | 4 ++++ mysql-test/suite/s3/basic.result | 1 + storage/maria/ha_s3.cc | 10 +++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libmysqld/libmysql.c b/libmysqld/libmysql.c index 840c00ee2d0..d931b251bfd 100644 --- a/libmysqld/libmysql.c +++ b/libmysqld/libmysql.c @@ -5030,5 +5030,9 @@ uint8_t ms3_move(ms3_st *ms3, const char *source_bucket, const char *source_key, return 1; } +void ms3_debug() +{ +} + C_MODE_END #endif /* WITH_S3_STORAGE_ENGINE */ diff --git a/mysql-test/suite/s3/basic.result b/mysql-test/suite/s3/basic.result index d6e6f86f598..94fe14ab989 100644 --- a/mysql-test/suite/s3/basic.result +++ b/mysql-test/suite/s3/basic.result @@ -88,6 +88,7 @@ Variable_name Value s3_access_key X s3_block_size X s3_bucket X +s3_debug X s3_host_name X s3_pagecache_age_threshold X s3_pagecache_buffer_size X diff --git a/storage/maria/ha_s3.cc b/storage/maria/ha_s3.cc index 2eb627a698c..89a7e6ea773 100644 --- a/storage/maria/ha_s3.cc +++ b/storage/maria/ha_s3.cc @@ -78,6 +78,7 @@ static ulonglong s3_pagecache_buffer_size; static char *s3_bucket, *s3_access_key=0, *s3_secret_key=0, *s3_region; static char *s3_host_name; static char *s3_tmp_access_key=0, *s3_tmp_secret_key=0; +static my_bool s3_debug= 0; handlerton *s3_hton= 0; /* Don't show access or secret keys to users if they exists */ @@ -117,6 +118,11 @@ static MYSQL_SYSVAR_ULONG(block_size, s3_block_size, "Block size for S3", 0, 0, 4*1024*1024, 65536, 16*1024*1024, 8192); +static MYSQL_SYSVAR_BOOL(debug, s3_debug, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Generates trace file from libmarias3 on stderr for debugging", + 0, 0, 0); + static MYSQL_SYSVAR_ENUM(protocol_version, s3_protocol_version, PLUGIN_VAR_RQCMDARG, "Protocol used to communication with S3. One of " @@ -173,7 +179,6 @@ static MYSQL_SYSVAR_STR(region, s3_region, "AWS region", 0, 0, ""); - ha_create_table_option s3_table_option_list[]= { /* @@ -696,6 +701,8 @@ static int ha_s3_init(void *p) s3_pagecache.big_block_read= s3_block_read; s3_pagecache.big_block_free= s3_free; s3_init_library(); + if (s3_debug) + ms3_debug(); return res ? HA_ERR_INITIALIZATION : 0; } @@ -716,6 +723,7 @@ static SHOW_VAR status_variables[]= { static struct st_mysql_sys_var* system_variables[]= { MYSQL_SYSVAR(block_size), + MYSQL_SYSVAR(debug), MYSQL_SYSVAR(protocol_version), MYSQL_SYSVAR(pagecache_age_threshold), MYSQL_SYSVAR(pagecache_buffer_size),