mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge branch '10.3' into 10.4
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
|
||||
|
||||
|
||||
/* A lexical scanner on a temporary buffer with a yacc interface */
|
||||
@ -2365,6 +2365,7 @@ void st_select_lex_unit::init_query()
|
||||
with_element= 0;
|
||||
columns_are_renamed= false;
|
||||
intersect_mark= NULL;
|
||||
with_wrapped_tvc= false;
|
||||
}
|
||||
|
||||
void st_select_lex::init_query()
|
||||
@ -3509,6 +3510,19 @@ bool st_select_lex_unit::union_needs_tmp_table()
|
||||
{
|
||||
if (with_element && with_element->is_recursive)
|
||||
return true;
|
||||
if (!with_wrapped_tvc)
|
||||
{
|
||||
for (st_select_lex *sl= first_select(); sl; sl=sl->next_select())
|
||||
{
|
||||
if (sl->tvc && sl->tvc->to_be_wrapped_as_with_tail())
|
||||
{
|
||||
with_wrapped_tvc= true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (with_wrapped_tvc)
|
||||
return true;
|
||||
return union_distinct != NULL ||
|
||||
global_parameters()->order_list.elements != 0 ||
|
||||
thd->lex->sql_command == SQLCOM_INSERT_SELECT ||
|
||||
@ -8808,6 +8822,8 @@ bool LEX::tvc_finalize()
|
||||
current_select->options))))
|
||||
return true;
|
||||
many_values.empty();
|
||||
if (!current_select->master_unit()->fake_select_lex)
|
||||
current_select->master_unit()->add_fake_select_lex(thd);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -8926,12 +8942,12 @@ void Lex_select_lock::set_to(SELECT_LEX *sel)
|
||||
if (update_lock)
|
||||
{
|
||||
sel->lock_type= TL_WRITE;
|
||||
sel->set_lock_for_tables(TL_WRITE);
|
||||
sel->set_lock_for_tables(TL_WRITE, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
sel->lock_type= TL_READ_WITH_SHARED_LOCKS;
|
||||
sel->set_lock_for_tables(TL_READ_WITH_SHARED_LOCKS);
|
||||
sel->set_lock_for_tables(TL_READ_WITH_SHARED_LOCKS, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9266,6 +9282,16 @@ SELECT_LEX_UNIT *LEX::parsed_body_select(SELECT_LEX *sel,
|
||||
return NULL;
|
||||
|
||||
SELECT_LEX_UNIT *res= create_unit(sel);
|
||||
if (res && sel->tvc && sel->order_list.elements)
|
||||
{
|
||||
if (res->add_fake_select_lex(thd))
|
||||
return NULL;
|
||||
SELECT_LEX *fake= res->fake_select_lex;
|
||||
fake->order_list= sel->order_list;
|
||||
fake->explicit_limit= sel->explicit_limit;
|
||||
fake->select_limit= sel->select_limit;
|
||||
fake->offset_limit= sel->offset_limit;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user