1
0
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:
Igor Babaev
2015-12-21 12:13:39 -08:00
parent dfc4772f83
commit 6dbdb433cb
5 changed files with 13 additions and 9 deletions

View File

@ -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) bool With_element::set_unparsed_spec(THD *thd, char *spec_start, char *spec_end)
{ {
unparsed_spec.length= spec_end - spec_start; 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'; unparsed_spec.str[unparsed_spec.length]= '\0';
if (!unparsed_spec.str) if (!unparsed_spec.str)
@ -394,6 +394,8 @@ err:
@brief @brief
Process optional column list of this with element Process optional column list of this with element
@param thd The context of the statement containing this with element
@details @details
The method processes the column list in this with element. The method processes the column list in this with element.
It reports an error if the cardinality of this list differs from It reports an error if the cardinality of this list differs from
@ -407,7 +409,7 @@ err:
false otherwise false otherwise
*/ */
bool With_element::process_column_list() bool With_element::process_column_list(THD *thd)
{ {
if (column_list_is_processed) if (column_list_is_processed)
return false; return false;
@ -429,12 +431,12 @@ bool With_element::process_column_list()
/* Rename the columns of the first select in the specification query */ /* Rename the columns of the first select in the specification query */
while ((item= it++, name= nm++)) 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; 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; column_list_is_processed= true;
return false; return false;
@ -471,8 +473,8 @@ bool With_element::prepare_unreferenced(THD *thd)
thd->lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_DERIVED; thd->lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_DERIVED;
if (!spec->prepared && if (!spec->prepared &&
(spec->prepare(thd, 0, 0) || (spec->prepare(thd, 0, 0) ||
process_column_list() || process_column_list(thd) ||
check_duplicate_names(first_sl->item_list, 1))) check_duplicate_names(thd, first_sl->item_list, 1)))
rc= true; rc= true;
thd->lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_DERIVED; thd->lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_DERIVED;

View File

@ -85,7 +85,7 @@ public:
st_select_lex_unit *clone_parsed_spec(THD *thd, TABLE_LIST *with_table); 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; } bool is_referenced() { return references != 0; }

View File

@ -672,7 +672,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
if ((res= unit->prepare(thd, derived->derived_result, 0))) if ((res= unit->prepare(thd, derived->derived_result, 0)))
goto exit; goto exit;
if (derived->with && if (derived->with &&
(res= derived->with->process_column_list())) (res= derived->with->process_column_list(thd)))
goto exit; goto exit;
lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_DERIVED; lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_DERIVED;
if ((res= check_duplicate_names(thd, unit->types, 0))) if ((res= check_duplicate_names(thd, unit->types, 0)))

View File

@ -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, bool mysql_rename_view(THD *thd, const char *new_db, const char *new_name,
TABLE_LIST *view); 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) #define VIEW_ANY_ACL (SELECT_ACL | UPDATE_ACL | INSERT_ACL | DELETE_ACL)
extern const LEX_STRING view_type; extern const LEX_STRING view_type;

View File

@ -10868,7 +10868,7 @@ table_factor:
also do not merge them also do not merge them
*/ */
if (!sel->next_select()) if (!sel->next_select())
$2->select_n_where_fields+= $3->select_n_where_fields+=
sel->select_n_where_fields; sel->select_n_where_fields;
} }
/*else if (($4->select_lex && /*else if (($4->select_lex &&