mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed compile errors of the merge of the patch for mdev-8789 with 10.2.
This commit is contained in:
@ -270,7 +270,7 @@ bool With_clause::prepare_unreferenced_elements(THD *thd)
|
||||
bool With_element::set_unparsed_spec(THD *thd, char *spec_start, char *spec_end)
|
||||
{
|
||||
unparsed_spec.length= spec_end - spec_start;
|
||||
unparsed_spec.str= (char*) sql_memdup(spec_start, unparsed_spec.length+1);
|
||||
unparsed_spec.str= (char*) thd->memdup(spec_start, unparsed_spec.length+1);
|
||||
unparsed_spec.str[unparsed_spec.length]= '\0';
|
||||
|
||||
if (!unparsed_spec.str)
|
||||
@ -394,6 +394,8 @@ err:
|
||||
@brief
|
||||
Process optional column list of this with element
|
||||
|
||||
@param thd The context of the statement containing this with element
|
||||
|
||||
@details
|
||||
The method processes the column list in this with element.
|
||||
It reports an error if the cardinality of this list differs from
|
||||
@ -407,7 +409,7 @@ err:
|
||||
false otherwise
|
||||
*/
|
||||
|
||||
bool With_element::process_column_list()
|
||||
bool With_element::process_column_list(THD *thd)
|
||||
{
|
||||
if (column_list_is_processed)
|
||||
return false;
|
||||
@ -429,12 +431,12 @@ bool With_element::process_column_list()
|
||||
/* Rename the columns of the first select in the specification query */
|
||||
while ((item= it++, name= nm++))
|
||||
{
|
||||
item->set_name(name->str, (uint) name->length, system_charset_info);
|
||||
item->set_name(thd, name->str, (uint) name->length, system_charset_info);
|
||||
item->is_autogenerated_name= false;
|
||||
}
|
||||
}
|
||||
|
||||
make_valid_column_names(select->item_list);
|
||||
make_valid_column_names(thd, select->item_list);
|
||||
|
||||
column_list_is_processed= true;
|
||||
return false;
|
||||
@ -471,8 +473,8 @@ bool With_element::prepare_unreferenced(THD *thd)
|
||||
thd->lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_DERIVED;
|
||||
if (!spec->prepared &&
|
||||
(spec->prepare(thd, 0, 0) ||
|
||||
process_column_list() ||
|
||||
check_duplicate_names(first_sl->item_list, 1)))
|
||||
process_column_list(thd) ||
|
||||
check_duplicate_names(thd, first_sl->item_list, 1)))
|
||||
rc= true;
|
||||
|
||||
thd->lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_DERIVED;
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
|
||||
st_select_lex_unit *clone_parsed_spec(THD *thd, TABLE_LIST *with_table);
|
||||
|
||||
bool process_column_list();
|
||||
bool process_column_list(THD *thd);
|
||||
|
||||
bool is_referenced() { return references != 0; }
|
||||
|
||||
|
@ -672,7 +672,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
|
||||
if ((res= unit->prepare(thd, derived->derived_result, 0)))
|
||||
goto exit;
|
||||
if (derived->with &&
|
||||
(res= derived->with->process_column_list()))
|
||||
(res= derived->with->process_column_list(thd)))
|
||||
goto exit;
|
||||
lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_DERIVED;
|
||||
if ((res= check_duplicate_names(thd, unit->types, 0)))
|
||||
|
@ -56,6 +56,8 @@ bool check_duplicate_names(THD *thd, List<Item>& item_list,
|
||||
bool mysql_rename_view(THD *thd, const char *new_db, const char *new_name,
|
||||
TABLE_LIST *view);
|
||||
|
||||
void make_valid_column_names(THD *thd, List<Item> &item_list);
|
||||
|
||||
#define VIEW_ANY_ACL (SELECT_ACL | UPDATE_ACL | INSERT_ACL | DELETE_ACL)
|
||||
|
||||
extern const LEX_STRING view_type;
|
||||
|
@ -10868,7 +10868,7 @@ table_factor:
|
||||
also do not merge them
|
||||
*/
|
||||
if (!sel->next_select())
|
||||
$2->select_n_where_fields+=
|
||||
$3->select_n_where_fields+=
|
||||
sel->select_n_where_fields;
|
||||
}
|
||||
/*else if (($4->select_lex &&
|
||||
|
Reference in New Issue
Block a user