summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2023-03-17 06:58:33 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2023-03-17 06:58:33 +0200
commitfffa4b28a136d1297066cc652127619d0ed82449 (patch)
tree346762d8c175e191ace4e8d138739c1f1bda63db /sql
parent47036387756d465c68ac4360eb031e78f48d9e58 (diff)
parentacf46b7b36a794cd66033e61e064f16896cf7d22 (diff)
downloadmariadb-git-fffa4b28a136d1297066cc652127619d0ed82449.tar.gz
Merge 10.8 into 10.9
Diffstat (limited to 'sql')
-rw-r--r--sql/item.h23
-rw-r--r--sql/sql_class.h2
-rw-r--r--sql/temporary_tables.cc13
3 files changed, 24 insertions, 14 deletions
diff --git a/sql/item.h b/sql/item.h
index 0d507de2d0e..163c000f46c 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -2687,18 +2687,27 @@ public:
void register_in(THD *thd);
bool depends_only_on(table_map view_map)
- { return marker & MARKER_FULL_EXTRACTION; }
- int get_extraction_flag() const
- { return marker & MARKER_EXTRACTION_MASK; }
+ { return get_extraction_flag() & MARKER_FULL_EXTRACTION; }
+ int get_extraction_flag() const
+ {
+ if (basic_const_item())
+ return MARKER_FULL_EXTRACTION;
+ else
+ return marker & MARKER_EXTRACTION_MASK;
+ }
void set_extraction_flag(int16 flags)
{
- marker &= ~MARKER_EXTRACTION_MASK;
- marker|= flags;
+ if (!basic_const_item())
+ {
+ marker= marker & ~MARKER_EXTRACTION_MASK;
+ marker|= flags;
+ }
}
void clear_extraction_flag()
{
- marker &= ~MARKER_EXTRACTION_MASK;
- }
+ if (!basic_const_item())
+ marker= marker & ~MARKER_EXTRACTION_MASK;
+ }
void check_pushable_cond(Pushdown_checker excl_dep_func, uchar *arg);
bool pushable_cond_checker_for_derived(uchar *arg)
{
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 3c10a6bbc3b..b53fe9ef14b 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -5305,7 +5305,7 @@ private:
bool use_temporary_table(TABLE *table, TABLE **out_table);
void close_temporary_table(TABLE *table);
bool log_events_and_free_tmp_shares();
- void free_tmp_table_share(TMP_TABLE_SHARE *share, bool delete_table);
+ bool free_tmp_table_share(TMP_TABLE_SHARE *share, bool delete_table);
void free_temporary_table(TABLE *table);
bool lock_temporary_tables();
void unlock_temporary_tables();
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc
index a477aef0bc3..3ba6a772549 100644
--- a/sql/temporary_tables.cc
+++ b/sql/temporary_tables.cc
@@ -671,7 +671,7 @@ bool THD::drop_temporary_table(TABLE *table, bool *is_trans, bool delete_table)
temporary_tables->remove(share);
/* Free the TABLE_SHARE and/or delete the files. */
- free_tmp_table_share(share, delete_table);
+ result= free_tmp_table_share(share, delete_table);
end:
if (locked)
@@ -1464,20 +1464,21 @@ bool THD::log_events_and_free_tmp_shares()
@param share [IN] TABLE_SHARE to free
@param delete_table [IN] Whether to delete the table files?
- @return void
+ @return false Success
+ true Error
*/
-void THD::free_tmp_table_share(TMP_TABLE_SHARE *share, bool delete_table)
+bool THD::free_tmp_table_share(TMP_TABLE_SHARE *share, bool delete_table)
{
+ bool error= false;
DBUG_ENTER("THD::free_tmp_table_share");
if (delete_table)
{
- rm_temporary_table(share->db_type(), share->path.str);
+ error= rm_temporary_table(share->db_type(), share->path.str);
}
free_table_share(share);
my_free(share);
-
- DBUG_VOID_RETURN;
+ DBUG_RETURN(error);
}