Skip to content

Commit

Permalink
Merge branch '10.6' into 10.11
Browse files Browse the repository at this point in the history
  • Loading branch information
mariadb-YuchenPei committed Sep 12, 2024
2 parents b168859 + 09b1269 commit a8c5717
Show file tree
Hide file tree
Showing 22 changed files with 856 additions and 4,487 deletions.
8 changes: 4 additions & 4 deletions client/mysql_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,8 @@ static int check_options(int argc, char **argv, char *operation)
{
int i= 0; /* loop counter */
int num_found= 0; /* number of options found (shortcut loop) */
char config_file[FN_REFLEN]; /* configuration file name */
char plugin_name[FN_REFLEN]; /* plugin name */
char config_file[FN_REFLEN+1]; /* configuration file name */
char plugin_name[FN_REFLEN+1]; /* plugin name */

/* Form prefix strings for the options. */
const char *basedir_prefix = "--basedir=";
Expand Down Expand Up @@ -787,8 +787,8 @@ static int check_options(int argc, char **argv, char *operation)
/* read the plugin config file and check for match against argument */
else
{
if (safe_strcpy_truncated(plugin_name, sizeof plugin_name, argv[i]) ||
safe_strcpy_truncated(config_file, sizeof config_file, argv[i]) ||
if (safe_strcpy_truncated(plugin_name, sizeof(plugin_name)-1, argv[i]) ||
safe_strcpy_truncated(config_file, sizeof(config_file)-1, argv[i]) ||
safe_strcat(config_file, sizeof(config_file), ".ini"))
{
fprintf(stderr, "ERROR: argument is too long.\n");
Expand Down
11 changes: 11 additions & 0 deletions mysql-test/include/optimizer_trace_no_costs.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Mask the cost value from any field that looks like
# "xxx_cost" : double_number
# Print the
# "xxx_cost" : "REPLACED"
# instead
--replace_regex /(_cost": )[0-9.e-]+/\1"REPLACED"/
#--replace_regex /(_cost": )[0-9.e-]+/"REPLACED"/
#--replace_regex /[0-9]+/BBB/

#--replace_regex /("r_engine_stats":) {[^}]*}/\1 REPLACED/

20 changes: 10 additions & 10 deletions mysql-test/main/order_by_limit_join.result
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ JS
}
],
"can_skip_filesort": true,
"full_join_cost": 46064.98442,
"full_join_cost": "REPLACED",
"risk_ratio": 10,
"shortcut_join_cost": 97.28224614,
"shortcut_join_cost": "REPLACED",
"shortcut_cost_with_risk": 972.8224614,
"use_shortcut_cost": true
}
Expand Down Expand Up @@ -161,9 +161,9 @@ JS
"test_if_skip_sort_order_early":
[],
"can_skip_filesort": false,
"full_join_cost": 46064.98442,
"full_join_cost": "REPLACED",
"risk_ratio": 10,
"shortcut_join_cost": 2097.281246,
"shortcut_join_cost": "REPLACED",
"shortcut_cost_with_risk": 20972.81246,
"use_shortcut_cost": true
}
Expand Down Expand Up @@ -246,9 +246,9 @@ JS
}
],
"can_skip_filesort": false,
"full_join_cost": 46064.98442,
"full_join_cost": "REPLACED",
"risk_ratio": 10,
"shortcut_join_cost": 24059.12698,
"shortcut_join_cost": "REPLACED",
"shortcut_cost_with_risk": 240591.2698,
"use_shortcut_cost": false
}
Expand Down Expand Up @@ -366,9 +366,9 @@ JS
}
],
"can_skip_filesort": true,
"full_join_cost": 47079.71684,
"full_join_cost": "REPLACED",
"risk_ratio": 10,
"shortcut_join_cost": 98.29697856,
"shortcut_join_cost": "REPLACED",
"shortcut_cost_with_risk": 982.9697856,
"use_shortcut_cost": true
}
Expand Down Expand Up @@ -452,9 +452,9 @@ JS
}
],
"can_skip_filesort": true,
"full_join_cost": 46064.98442,
"full_join_cost": "REPLACED",
"risk_ratio": 10,
"shortcut_join_cost": 97.28224614,
"shortcut_join_cost": "REPLACED",
"shortcut_cost_with_risk": 972.8224614,
"use_shortcut_cost": true
}
Expand Down
6 changes: 6 additions & 0 deletions mysql-test/main/order_by_limit_join.test
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ set optimizer_join_limit_pref_ratio=10;
eval $query;

set @trace=(select trace from information_schema.optimizer_trace);
--source include/optimizer_trace_no_costs.inc
select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS;

--echo #
Expand Down Expand Up @@ -95,6 +96,7 @@ set optimizer_join_limit_pref_ratio=10;
eval $query;

set @trace=(select trace from information_schema.optimizer_trace);
--source include/optimizer_trace_no_costs.inc
select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS;

--echo #
Expand All @@ -121,6 +123,7 @@ set optimizer_join_limit_pref_ratio=10;
eval $query;

set @trace=(select trace from information_schema.optimizer_trace);
--source include/optimizer_trace_no_costs.inc
select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS;

--echo #
Expand All @@ -140,6 +143,7 @@ limit 10;
set @trace=(select trace from information_schema.optimizer_trace);
--echo # This will show nothing as limit shortcut code figures that
--echo # it's not possible to use t1 to construct shortcuts:
--source include/optimizer_trace_no_costs.inc
select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS;

--echo #
Expand Down Expand Up @@ -169,6 +173,7 @@ set optimizer_join_limit_pref_ratio=10;
eval $query;

set @trace=(select trace from information_schema.optimizer_trace);
--source include/optimizer_trace_no_costs.inc
select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS;

--echo #
Expand Down Expand Up @@ -197,6 +202,7 @@ set optimizer_join_limit_pref_ratio=10;
eval $query;

set @trace=(select trace from information_schema.optimizer_trace);
--source include/optimizer_trace_no_costs.inc
select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS;


Expand Down
3 changes: 3 additions & 0 deletions mysql-test/suite/s3/basic.result
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,19 @@ s3_block_size X
s3_bucket X
s3_debug X
s3_host_name X
s3_no_content_type X
s3_pagecache_age_threshold X
s3_pagecache_buffer_size X
s3_pagecache_division_limit X
s3_pagecache_file_hash_size X
s3_port X
s3_protocol_version X
s3_provider X
s3_region X
s3_replicate_alter_as_create_select X
s3_secret_key X
s3_slave_ignore_updates X
s3_ssl_no_verify X
s3_use_http X
show variables like "s3_slave%";
Variable_name Value
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/s3/my.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ [email protected]_SECRET_KEY
s3-region[email protected]_REGION
s3-port[email protected]_PORT
s3-use-http[email protected]_USE_HTTP
s3-ssl-no-verify[email protected]_SSL_NO_VERIFY
s3-provider[email protected]_PROVIDER

#s3-host-name=s3.amazonaws.com
#s3-protocol-version=Amazon
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/s3/slave.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ [email protected]_SECRET_KEY
s3-region[email protected]_REGION
s3-port[email protected]_PORT
s3-use-http[email protected]_USE_HTTP
s3-ssl-no-verify[email protected]_SSL_NO_VERIFY
s3-provider[email protected]_PROVIDER

# You can change the following when running the tests against
# your own S3 setup
Expand Down
13 changes: 13 additions & 0 deletions mysql-test/suite/s3/suite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ if(connect(SOCK, $paddr))
$ENV{'S3_REGION'} = "";
$ENV{'S3_PROTOCOL_VERSION'} = "Auto";
$ENV{'S3_USE_HTTP'} = "ON";
$ENV{'S3_SSL_NO_VERIFY'} = "OFF";
$ENV{'S3_PROVIDER'} = "Default";
}
else
{
Expand Down Expand Up @@ -62,6 +64,17 @@ else
{
$ENV{'S3_USE_HTTP'} = "OFF";
}

if (!$ENV{'S3_SSL_NO_VERIFY'})
{
$ENV{'S3_SSL_NO_VERIFY'} = "OFF";
}

if (!$ENV{'S3_PROVIDER'})
{
$ENV{'S3_PROVIDER'} = "Default";
}

}
bless { };

32 changes: 32 additions & 0 deletions storage/maria/aria_s3_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ static const char *opt_database;
static const char *opt_s3_bucket="MariaDB";
static my_bool opt_compression, opt_verbose, opt_force, opt_s3_debug;
static my_bool opt_s3_use_http;
static my_bool opt_s3_ssl_no_verify;
static my_bool opt_s3_no_content_type;
static ulong opt_operation= OP_IMPOSSIBLE, opt_protocol_version= 1;
static ulong opt_provider= 0;
static ulong opt_block_size;
static ulong opt_s3_port;
static char **default_argv=0;
Expand Down Expand Up @@ -73,6 +76,13 @@ static struct my_option my_long_options[] =
{"s3_use_http", 'P', "If true, force use of HTTP protocol",
(char**) &opt_s3_use_http, (char**) &opt_s3_use_http,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"s3_ssl_no_verify", 's', "If true, verification of the S3 endpoint SSL "
"certificate is disabled",
(char**) &opt_s3_ssl_no_verify, (char**) &opt_s3_ssl_no_verify,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"s3_no_content_type", 'n', "If true, disables the Content-Type header",
(char**) &opt_s3_no_content_type, (char**) &opt_s3_no_content_type,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'c', "Use compression", &opt_compression, &opt_compression,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"op", 'o', "Operation to execute. One of 'from_s3', 'to_s3' or "
Expand All @@ -92,6 +102,10 @@ static struct my_option my_long_options[] =
"Note: \"Legacy\", \"Original\" and \"Amazon\" are deprecated.",
&opt_protocol_version, &opt_protocol_version, &s3_protocol_typelib,
GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"s3_provider", 'R', "Enable S3 provider specific compatibility tweaks "
"\"Default\", \"Amazon\", or \"Huawei\".",
&opt_provider, &opt_provider, &s3_provider_typelib,
GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f', "Force copy even if target exists",
&opt_force, &opt_force, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Write more information", &opt_verbose, &opt_verbose,
Expand Down Expand Up @@ -220,6 +234,19 @@ int main(int argc, char** argv)

ms3_set_option(global_s3_client, MS3_OPT_BUFFER_CHUNK_SIZE, &block_size);

/* Provider specific overrides */
switch (opt_provider)
{
case 0: /* Default */
break;
case 1: /* Amazon */
opt_protocol_version = 5;
break;
case 2: /* Huawei */
opt_s3_no_content_type = 1;
break;
}

if (opt_protocol_version > 2)
{
uint8_t protocol_version;
Expand All @@ -245,6 +272,11 @@ int main(int argc, char** argv)
if (opt_s3_use_http)
ms3_set_option(global_s3_client, MS3_OPT_USE_HTTP, NULL);

if (opt_s3_ssl_no_verify)
ms3_set_option(global_s3_client, MS3_OPT_DISABLE_SSL_VERIFY, NULL);

if (opt_s3_no_content_type)
ms3_set_option(global_s3_client, MS3_OPT_NO_CONTENT_TYPE, NULL);

for (; *argv ; argv++)
{
Expand Down
23 changes: 22 additions & 1 deletion storage/maria/ha_s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,16 @@
#define DEFAULT_AWS_HOST_NAME "s3.amazonaws.com"

static PAGECACHE s3_pagecache;
static ulong s3_block_size, s3_protocol_version;
static ulong s3_block_size, s3_protocol_version, s3_provider;
static ulong s3_pagecache_division_limit, s3_pagecache_age_threshold;
static ulong s3_pagecache_file_hash_size;
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 int s3_port;
static my_bool s3_use_http;
static my_bool s3_ssl_no_verify;
static my_bool s3_no_content_type;
static char *s3_tmp_access_key=0, *s3_tmp_secret_key=0;
static my_bool s3_debug= 0, s3_slave_ignore_updates= 0;
static my_bool s3_replicate_alter_as_create_select= 0;
Expand Down Expand Up @@ -222,6 +224,10 @@ static MYSQL_SYSVAR_BOOL(use_http, s3_use_http,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"If true, force use of HTTP protocol",
NULL /*check*/, NULL /*update*/, 0 /*default*/);
static MYSQL_SYSVAR_BOOL(ssl_no_verify, s3_ssl_no_verify,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"If true, SSL certificate verifiction for the S3 endpoint is disabled",
NULL, NULL, 0);
static MYSQL_SYSVAR_STR(access_key, s3_tmp_access_key,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY | PLUGIN_VAR_MEMALLOC,
"AWS access key",
Expand All @@ -234,6 +240,15 @@ static MYSQL_SYSVAR_STR(region, s3_region,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"AWS region",
0, 0, "");
static MYSQL_SYSVAR_BOOL(no_content_type, s3_no_content_type,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"If true, disables the Content-Type header, required for some providers",
NULL, NULL, 0);
static MYSQL_SYSVAR_ENUM(provider, s3_provider,
PLUGIN_VAR_RQCMDARG,
"Enable S3 provider specific compatibility tweaks "
"\"Default\", \"Amazon\", or \"Huawei\". ",
NULL, NULL, 0, &s3_provider_typelib);

ha_create_table_option s3_table_option_list[]=
{
Expand Down Expand Up @@ -319,6 +334,9 @@ static my_bool s3_info_init(S3_INFO *info)
lex_string_set(&info->host_name, s3_host_name);
info->port= s3_port;
info->use_http= s3_use_http;
info->ssl_no_verify= s3_ssl_no_verify;
info->no_content_type = s3_no_content_type;
info->provider= s3_provider;
lex_string_set(&info->access_key, s3_access_key);
lex_string_set(&info->secret_key, s3_secret_key);
lex_string_set(&info->region, s3_region);
Expand Down Expand Up @@ -1120,12 +1138,15 @@ static struct st_mysql_sys_var* system_variables[]= {
MYSQL_SYSVAR(host_name),
MYSQL_SYSVAR(port),
MYSQL_SYSVAR(use_http),
MYSQL_SYSVAR(ssl_no_verify),
MYSQL_SYSVAR(bucket),
MYSQL_SYSVAR(access_key),
MYSQL_SYSVAR(secret_key),
MYSQL_SYSVAR(region),
MYSQL_SYSVAR(slave_ignore_updates),
MYSQL_SYSVAR(replicate_alter_as_create_select),
MYSQL_SYSVAR(no_content_type),
MYSQL_SYSVAR(provider),
NULL
};

Expand Down
2 changes: 1 addition & 1 deletion storage/maria/libmarias3
Submodule libmarias3 updated 84 files
+1 −0 .gitignore
+1 −1 VERSION.txt
+1 −1 configure.ac
+94 −5 docs/_themes/sphinx_rtd_theme/__init__.py
+71 −13 docs/_themes/sphinx_rtd_theme/breadcrumbs.html
+44 −14 docs/_themes/sphinx_rtd_theme/footer.html
+169 −101 docs/_themes/sphinx_rtd_theme/layout.html
+ docs/_themes/sphinx_rtd_theme/locale/da/LC_MESSAGES/sphinx.mo
+206 −0 docs/_themes/sphinx_rtd_theme/locale/da/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/de/LC_MESSAGES/sphinx.mo
+136 −0 docs/_themes/sphinx_rtd_theme/locale/de/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.mo
+201 −0 docs/_themes/sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/es/LC_MESSAGES/sphinx.mo
+169 −0 docs/_themes/sphinx_rtd_theme/locale/es/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/et/LC_MESSAGES/sphinx.mo
+166 −0 docs/_themes/sphinx_rtd_theme/locale/et/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/fa_IR/LC_MESSAGES/sphinx.mo
+161 −0 docs/_themes/sphinx_rtd_theme/locale/fa_IR/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/fr/LC_MESSAGES/sphinx.mo
+169 −0 docs/_themes/sphinx_rtd_theme/locale/fr/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/hr/LC_MESSAGES/sphinx.mo
+23 −0 docs/_themes/sphinx_rtd_theme/locale/hr/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/hu/LC_MESSAGES/sphinx.mo
+23 −0 docs/_themes/sphinx_rtd_theme/locale/hu/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/it/LC_MESSAGES/sphinx.mo
+192 −0 docs/_themes/sphinx_rtd_theme/locale/it/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/lt/LC_MESSAGES/sphinx.mo
+188 −0 docs/_themes/sphinx_rtd_theme/locale/lt/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/nl/LC_MESSAGES/sphinx.mo
+188 −0 docs/_themes/sphinx_rtd_theme/locale/nl/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/pl/LC_MESSAGES/sphinx.mo
+137 −0 docs/_themes/sphinx_rtd_theme/locale/pl/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/pt/LC_MESSAGES/sphinx.mo
+161 −0 docs/_themes/sphinx_rtd_theme/locale/pt/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/pt_BR/LC_MESSAGES/sphinx.mo
+191 −0 docs/_themes/sphinx_rtd_theme/locale/pt_BR/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/ru/LC_MESSAGES/sphinx.mo
+189 −0 docs/_themes/sphinx_rtd_theme/locale/ru/LC_MESSAGES/sphinx.po
+182 −0 docs/_themes/sphinx_rtd_theme/locale/sphinx.pot
+ docs/_themes/sphinx_rtd_theme/locale/sv/LC_MESSAGES/sphinx.mo
+151 −0 docs/_themes/sphinx_rtd_theme/locale/sv/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/tr/LC_MESSAGES/sphinx.mo
+143 −0 docs/_themes/sphinx_rtd_theme/locale/tr/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/zh_CN/LC_MESSAGES/sphinx.mo
+188 −0 docs/_themes/sphinx_rtd_theme/locale/zh_CN/LC_MESSAGES/sphinx.po
+ docs/_themes/sphinx_rtd_theme/locale/zh_TW/LC_MESSAGES/sphinx.mo
+23 −0 docs/_themes/sphinx_rtd_theme/locale/zh_TW/LC_MESSAGES/sphinx.po
+11 −5 docs/_themes/sphinx_rtd_theme/search.html
+4 −2 docs/_themes/sphinx_rtd_theme/searchbox.html
+1 −1 docs/_themes/sphinx_rtd_theme/static/css/badge_only.css
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/Roboto-Slab-Bold.woff
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/Roboto-Slab-Bold.woff2
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/Roboto-Slab-Regular.woff
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/Roboto-Slab-Regular.woff2
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/fontawesome-webfont.eot
+2,671 −0 docs/_themes/sphinx_rtd_theme/static/css/fonts/fontawesome-webfont.svg
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/fontawesome-webfont.ttf
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/fontawesome-webfont.woff
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/fontawesome-webfont.woff2
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/lato-bold-italic.woff
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/lato-bold-italic.woff2
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/lato-bold.woff
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/lato-bold.woff2
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/lato-normal-italic.woff
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/lato-normal-italic.woff2
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/lato-normal.woff
+ docs/_themes/sphinx_rtd_theme/static/css/fonts/lato-normal.woff2
+3 −3 docs/_themes/sphinx_rtd_theme/static/css/theme.css
+1 −0 docs/_themes/sphinx_rtd_theme/static/js/badge_only.js
+1 −47 docs/_themes/sphinx_rtd_theme/static/js/theme.js
+125 −0 docs/_themes/sphinx_rtd_theme/static/js/versions.js_t
+16 −3 docs/_themes/sphinx_rtd_theme/theme.conf
+0 −37 docs/_themes/sphinx_rtd_theme/versions.html
+29 −2 docs/api/functions.rst
+18 −2 docs/api/types.rst
+10 −1 libmarias3/marias3.h
+9 −0 src/assume_role.c
+66 −0 src/marias3.c
+47 −9 src/request.c
+7 −0 src/structs.h
+180 −0 tests/basic_no_type.c
+158 −0 tests/content_type.c
+10 −0 tests/include.am
23 changes: 23 additions & 0 deletions storage/maria/s3_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ static const char *protocol_types[]= {"Auto", "Original", "Amazon", "Legacy", "P
TYPELIB s3_protocol_typelib= {array_elements(protocol_types)-1,"",
protocol_types, NULL};

static const char *providers[]= {"Default", "Amazon", "Huawei", NullS};
TYPELIB s3_provider_typelib = {array_elements(providers)-1,"",providers, NULL};

/******************************************************************************
Allocations handler for libmarias3
To be removed when we do the init allocation in mysqld.cc
Expand Down Expand Up @@ -154,6 +157,20 @@ ms3_st *s3_open_connection(S3_INFO *s3)
errno, ms3_error(errno));
my_errno= HA_ERR_NO_SUCH_TABLE;
}

/* Provider specific overrides */
switch (s3->provider)
{
case 0: /* Default */
break;
case 1: /* Amazon */
s3->protocol_version = 5;
break;
case 2: /* Huawei */
s3->no_content_type = 1;
break;
}

if (s3->protocol_version > 2)
{
uint8_t protocol_version;
Expand All @@ -177,6 +194,12 @@ ms3_st *s3_open_connection(S3_INFO *s3)
if (s3->use_http)
ms3_set_option(s3_client, MS3_OPT_USE_HTTP, NULL);

if (s3->ssl_no_verify)
ms3_set_option(s3_client, MS3_OPT_DISABLE_SSL_VERIFY, NULL);

if (s3->no_content_type)
ms3_set_option(s3_client, MS3_OPT_NO_CONTENT_TYPE, NULL);

return s3_client;
}

Expand Down
Loading

0 comments on commit a8c5717

Please sign in to comment.