mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
SQL: optimized build fix on view/derived
This commit is contained in:
@ -748,7 +748,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
|
|||||||
// Leading versioning table specified explicitly
|
// Leading versioning table specified explicitly
|
||||||
// (i.e. if at least one system field is selected)
|
// (i.e. if at least one system field is selected)
|
||||||
TABLE_LIST *expli_table= NULL;
|
TABLE_LIST *expli_table= NULL;
|
||||||
const LString_i *impli_start, *impli_end;
|
LEX_CSTRING impli_start, impli_end;
|
||||||
Item_field *expli_start= NULL, *expli_end= NULL;
|
Item_field *expli_start= NULL, *expli_end= NULL;
|
||||||
|
|
||||||
for (TABLE_LIST *table= sl->table_list.first; table; table= table->next_local)
|
for (TABLE_LIST *table= sl->table_list.first; table; table= table->next_local)
|
||||||
@ -761,8 +761,8 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
|
|||||||
if (!impli_table)
|
if (!impli_table)
|
||||||
{
|
{
|
||||||
impli_table= table;
|
impli_table= table;
|
||||||
impli_start= &table_start;
|
impli_start= table_start;
|
||||||
impli_end= &table_end;
|
impli_end= table_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Implicitly add versioning fields if needed */
|
/* Implicitly add versioning fields if needed */
|
||||||
@ -809,7 +809,7 @@ expli_table_err:
|
|||||||
else
|
else
|
||||||
expli_table= table;
|
expli_table= table;
|
||||||
expli_start= fld;
|
expli_start= fld;
|
||||||
impli_end= &table_end;
|
impli_end= table_end;
|
||||||
}
|
}
|
||||||
else if (table_end == fld->field_name)
|
else if (table_end == fld->field_name)
|
||||||
{
|
{
|
||||||
@ -833,7 +833,7 @@ expli_table_err:
|
|||||||
else
|
else
|
||||||
expli_table= table;
|
expli_table= table;
|
||||||
expli_end= fld;
|
expli_end= fld;
|
||||||
impli_start= &table_start;
|
impli_start= table_start;
|
||||||
}
|
}
|
||||||
} // while ((item= it++))
|
} // while ((item= it++))
|
||||||
} // for (TABLE_LIST *table)
|
} // for (TABLE_LIST *table)
|
||||||
@ -844,9 +844,9 @@ expli_table_err:
|
|||||||
if (impli_table)
|
if (impli_table)
|
||||||
{
|
{
|
||||||
Query_arena_stmt on_stmt_arena(thd);
|
Query_arena_stmt on_stmt_arena(thd);
|
||||||
if (!expli_start && (res= sl->vers_push_field(thd, impli_table, *impli_start)))
|
if (!expli_start && (res= sl->vers_push_field(thd, impli_table, impli_start)))
|
||||||
goto exit;
|
goto exit;
|
||||||
if (!expli_end && (res= sl->vers_push_field(thd, impli_table, *impli_end)))
|
if (!expli_end && (res= sl->vers_push_field(thd, impli_table, impli_end)))
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
if (impli_table->vers_conditions)
|
if (impli_table->vers_conditions)
|
||||||
|
@ -7441,6 +7441,7 @@ Item *LEX::make_item_func_replace(THD *thd,
|
|||||||
|
|
||||||
bool SELECT_LEX::vers_push_field(THD *thd, TABLE_LIST *table, const LEX_CSTRING field_name)
|
bool SELECT_LEX::vers_push_field(THD *thd, TABLE_LIST *table, const LEX_CSTRING field_name)
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(field_name.str);
|
||||||
Item_field *fld= new (thd->mem_root) Item_field(thd, &context,
|
Item_field *fld= new (thd->mem_root) Item_field(thd, &context,
|
||||||
table->db, table->alias, &field_name);
|
table->db, table->alias, &field_name);
|
||||||
if (!fld)
|
if (!fld)
|
||||||
|
@ -466,7 +466,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
|
|||||||
// Leading versioning table specified explicitly
|
// Leading versioning table specified explicitly
|
||||||
// (i.e. if at least one system field is selected)
|
// (i.e. if at least one system field is selected)
|
||||||
TABLE_LIST *expli_table= NULL;
|
TABLE_LIST *expli_table= NULL;
|
||||||
const LString_i *impli_start, *impli_end;
|
LEX_CSTRING impli_start, impli_end;
|
||||||
Item_field *expli_start= NULL, *expli_end= NULL;
|
Item_field *expli_start= NULL, *expli_end= NULL;
|
||||||
|
|
||||||
for (TABLE_LIST *table= tables; table; table= table->next_local)
|
for (TABLE_LIST *table= tables; table; table= table->next_local)
|
||||||
@ -496,8 +496,8 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
|
|||||||
if (!impli_table)
|
if (!impli_table)
|
||||||
{
|
{
|
||||||
impli_table= table;
|
impli_table= table;
|
||||||
impli_start= &table_start;
|
impli_start= table_start;
|
||||||
impli_end= &table_end;
|
impli_end= table_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Implicitly add versioning fields if needed */
|
/* Implicitly add versioning fields if needed */
|
||||||
@ -546,7 +546,7 @@ expli_table_err:
|
|||||||
else
|
else
|
||||||
expli_table= table;
|
expli_table= table;
|
||||||
expli_start= fld;
|
expli_start= fld;
|
||||||
impli_end= &table_end;
|
impli_end= table_end;
|
||||||
}
|
}
|
||||||
else if (table_end == fld->field_name)
|
else if (table_end == fld->field_name)
|
||||||
{
|
{
|
||||||
@ -571,7 +571,7 @@ expli_table_err:
|
|||||||
else
|
else
|
||||||
expli_table= table;
|
expli_table= table;
|
||||||
expli_end= fld;
|
expli_end= fld;
|
||||||
impli_start= &table_start;
|
impli_start= table_start;
|
||||||
}
|
}
|
||||||
} // while ((item= it++))
|
} // while ((item= it++))
|
||||||
} // for (TABLE_LIST *table)
|
} // for (TABLE_LIST *table)
|
||||||
@ -581,9 +581,9 @@ expli_table_err:
|
|||||||
|
|
||||||
if (impli_table)
|
if (impli_table)
|
||||||
{
|
{
|
||||||
if (!expli_start && sl->vers_push_field(thd, impli_table, *impli_start))
|
if (!expli_start && sl->vers_push_field(thd, impli_table, impli_start))
|
||||||
goto err;
|
goto err;
|
||||||
if (!expli_end && sl->vers_push_field(thd, impli_table, *impli_end))
|
if (!expli_end && sl->vers_push_field(thd, impli_table, impli_end))
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
Reference in New Issue
Block a user