diff --git a/sql/field.h b/sql/field.h index 4006052cadb..eae2aea1830 100644 --- a/sql/field.h +++ b/sql/field.h @@ -5585,8 +5585,8 @@ public: */ class Spvar_definition: public Column_definition { - Qualified_column_ident *m_column_type_ref; // for %TYPE - Table_ident *m_table_rowtype_ref; // for table%ROWTYPE + const Qualified_column_ident *m_column_type_ref; // for %TYPE + Table_ident *m_table_rowtype_ref; // for table%ROWTYPE bool m_cursor_rowtype_ref; // for cursor%ROWTYPE uint m_cursor_rowtype_offset; // for cursor%ROWTYPE Row_definition_list *m_row_field_definitions; // for ROW @@ -5619,11 +5619,11 @@ public: !is_table_rowtype_ref() && !is_cursor_rowtype_ref(); } - Qualified_column_ident *column_type_ref() const + const Qualified_column_ident *column_type_ref() const { return m_column_type_ref; } - void set_column_type_ref(Qualified_column_ident *ref) + void set_column_type_ref(const Qualified_column_ident *ref) { m_column_type_ref= ref; } diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index 81aaf9b3bbf..cff6c31d652 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -226,7 +226,8 @@ check_column_grant_for_type_ref(THD *thd, TABLE_LIST *table_list, /** This method implementation is very close to fill_schema_table_by_open(). */ -bool Qualified_column_ident::resolve_type_ref(THD *thd, Column_definition *def) +bool Qualified_column_ident::resolve_type_ref(THD *thd, + Column_definition *def) const { Open_tables_backup open_tables_state_backup; thd->reset_n_backup_open_tables_state(&open_tables_state_backup); diff --git a/sql/sql_class.h b/sql/sql_class.h index 906b09c388e..b615a755e98 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -7142,7 +7142,7 @@ public: :Table_ident(thd, db, table, false), m_column(*column) { } - bool resolve_type_ref(THD *thd, Column_definition *def); + bool resolve_type_ref(THD *thd, Column_definition *def) const; bool append_to(THD *thd, String *to) const; }; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 111f929d369..a84fd29affc 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -6715,9 +6715,9 @@ LEX::sp_variable_declarations_with_ref_finalize(THD *thd, int nvars, bool LEX::sp_variable_declarations_column_type_finalize(THD *thd, int nvars, - Qualified_column_ident *ref, - Item *def, - const LEX_CSTRING &expr_str) + const Qualified_column_ident *ref, + Item *def, + const LEX_CSTRING &expr_str) { for (uint i= 0 ; i < (uint) nvars; i++) { @@ -6757,7 +6757,7 @@ LEX::sp_variable_declarations_vartype_finalize(THD *thd, int nvars, if (t->field_def.is_column_type_ref()) { - Qualified_column_ident *tmp= t->field_def.column_type_ref(); + const Qualified_column_ident *tmp= t->field_def.column_type_ref(); return sp_variable_declarations_column_type_finalize(thd, nvars, tmp, default_value, expr_str); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 0e4e01becf8..1d2e201170b 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -3972,9 +3972,9 @@ public: Item *def, const LEX_CSTRING &expr_str); bool sp_variable_declarations_column_type_finalize(THD *thd, int nvars, - Qualified_column_ident *ref, - Item *def, - const LEX_CSTRING &expr_str); + const Qualified_column_ident *ref, + Item *def, + const LEX_CSTRING &expr_str); bool sp_variable_declarations_vartype_finalize(THD *thd, int nvars, const LEX_CSTRING &name, Item *def,