From db9398ba5e385143e6c64af472962f62fa892959 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 15 Mar 2021 14:53:55 +0200 Subject: [PATCH] Improved code comment and removed nop test --- sql/sql_join_cache.h | 7 +++++-- sql/sql_select.h | 2 +- sql/sql_table.cc | 4 +--- storage/maria/ha_s3.cc | 10 +++++++++- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/sql/sql_join_cache.h b/sql/sql_join_cache.h index d0bf4761f65..2c3bf4022ca 100644 --- a/sql/sql_join_cache.h +++ b/sql/sql_join_cache.h @@ -206,11 +206,14 @@ protected: /* This flag indicates that records written into the join buffer contain - a match flag field. The flag must be set by the init method. + a match flag field. + This is set to true for the first inner table of an outer join or a + semi-join. + The flag must be set by the init method. Currently any implementation of the virtial init method calls the function JOIN_CACHE::calc_record_fields() to set this flag. */ - bool with_match_flag; + bool with_match_flag; /* This flag indicates that any record is prepended with the length of the record which allows us to skip the record or part of it without reading. diff --git a/sql/sql_select.h b/sql/sql_select.h index 79a80e4eb21..3b736198541 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -566,7 +566,7 @@ typedef struct st_join_table { } bool is_first_inner_for_outer_join() { - return first_inner && first_inner == this; + return first_inner == this; } bool use_match_flag() { diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8a89f97808a..6bff92fa3f7 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6899,10 +6899,8 @@ static bool mysql_inplace_alter_table(THD *thd, Alter_info *alter_info= ha_alter_info->alter_info; bool reopen_tables= false; bool res; - const enum_alter_inplace_result inplace_supported= ha_alter_info->inplace_supported; - DBUG_ENTER("mysql_inplace_alter_table"); /* Downgrade DDL lock while we are waiting for exclusive lock below */ @@ -7152,7 +7150,7 @@ static bool mysql_inplace_alter_table(THD *thd, DBUG_RETURN(true); } - // Rename altered table if requested. + // Rename altered table in case of ALTER TABLE ... RENAME if (alter_ctx->is_table_renamed()) { DBUG_ASSERT(!tdc_share_is_cached(thd, alter_ctx->db.str, diff --git a/storage/maria/ha_s3.cc b/storage/maria/ha_s3.cc index b27afc2fcf7..e7428385a60 100644 --- a/storage/maria/ha_s3.cc +++ b/storage/maria/ha_s3.cc @@ -736,7 +736,15 @@ static int s3_hton_panic(handlerton *hton, ha_panic_function flag) /** - Check if a table is in S3 as part of discovery + Check if a table is in S3 as part of discovery. Returns TABLE_SHARE if found. + + @param hton S3 handlerton + @param thd MariaDB thd + @param [out] share If table exists, this is updated to contain the found + TABLE_SHARE (based on the .frm in S3) + + @return 0 Table exists + @return # Error number */ static int s3_discover_table(handlerton *hton, THD* thd, TABLE_SHARE *share)