mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge branch '10.7' into 10.8
This commit is contained in:
37
sql/table.cc
37
sql/table.cc
@@ -8991,14 +8991,18 @@ void TABLE::vers_update_fields()
|
||||
return;
|
||||
}
|
||||
|
||||
if (versioned(VERS_TIMESTAMP) &&
|
||||
vers_start_field()->store_timestamp(in_use->query_start(),
|
||||
in_use->query_start_sec_part()))
|
||||
if (versioned(VERS_TIMESTAMP))
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
if (vers_start_field()->store_timestamp(in_use->query_start(),
|
||||
in_use->query_start_sec_part()))
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
}
|
||||
vers_start_field()->set_has_explicit_value();
|
||||
}
|
||||
|
||||
vers_end_field()->set_max();
|
||||
vers_end_field()->set_has_explicit_value();
|
||||
bitmap_set_bit(read_set, vers_end_field()->field_index);
|
||||
file->column_bitmaps_signal();
|
||||
if (vfield)
|
||||
@@ -9011,6 +9015,7 @@ void TABLE::vers_update_end()
|
||||
if (vers_end_field()->store_timestamp(in_use->query_start(),
|
||||
in_use->query_start_sec_part()))
|
||||
DBUG_ASSERT(0);
|
||||
vers_end_field()->set_has_explicit_value();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9319,6 +9324,24 @@ void TABLE_LIST::wrap_into_nested_join(List<TABLE_LIST> &join_list)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Check whether optimization has been performed and a derived table either
|
||||
been merged to upper select level or materialized.
|
||||
|
||||
@param table a TABLE_LIST object containing a derived table
|
||||
|
||||
@return true in case the derived table has been merged to surrounding select,
|
||||
false otherwise
|
||||
*/
|
||||
|
||||
static inline bool derived_table_optimization_done(TABLE_LIST *table)
|
||||
{
|
||||
return table->derived &&
|
||||
(table->derived->is_excluded() ||
|
||||
table->is_materialized_derived());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@brief
|
||||
Initialize this derived table/view
|
||||
@@ -9369,13 +9392,15 @@ bool TABLE_LIST::init_derived(THD *thd, bool init_view)
|
||||
}
|
||||
}
|
||||
|
||||
if (init_view && !view)
|
||||
if (init_view && !view &&
|
||||
!derived_table_optimization_done(this))
|
||||
{
|
||||
/* This is all what we can do for a derived table for now. */
|
||||
set_derived();
|
||||
}
|
||||
|
||||
if (!is_view())
|
||||
if (!is_view() &&
|
||||
!derived_table_optimization_done(this))
|
||||
{
|
||||
/* A subquery might be forced to be materialized due to a side-effect. */
|
||||
if (!is_materialized_derived() && first_select->is_mergeable() &&
|
||||
|
Reference in New Issue
Block a user