Commit b0379ea4 authored by Alexander Barkov's avatar Alexander Barkov

Cleanup: Adding "const" to the member Spvar_definition::m_column_type_ref

and to related methods and their parameters:
- The return value of Spvar_definition::m_column_type_ref()
- The parameter of Spvar_definition::set_column_type_ref()
- The method Qualified_column_ident::resolve_type_ref()
- The parameter of LEX::sp_variable_declarations_column_type_finalize()
parent b8f9f796
...@@ -5585,8 +5585,8 @@ class Row_definition_list: public List<class Spvar_definition> ...@@ -5585,8 +5585,8 @@ class Row_definition_list: public List<class Spvar_definition>
*/ */
class Spvar_definition: public Column_definition class Spvar_definition: public Column_definition
{ {
Qualified_column_ident *m_column_type_ref; // for %TYPE const Qualified_column_ident *m_column_type_ref; // for %TYPE
Table_ident *m_table_rowtype_ref; // for table%ROWTYPE Table_ident *m_table_rowtype_ref; // for table%ROWTYPE
bool m_cursor_rowtype_ref; // for cursor%ROWTYPE bool m_cursor_rowtype_ref; // for cursor%ROWTYPE
uint m_cursor_rowtype_offset; // for cursor%ROWTYPE uint m_cursor_rowtype_offset; // for cursor%ROWTYPE
Row_definition_list *m_row_field_definitions; // for ROW Row_definition_list *m_row_field_definitions; // for ROW
...@@ -5619,11 +5619,11 @@ class Spvar_definition: public Column_definition ...@@ -5619,11 +5619,11 @@ class Spvar_definition: public Column_definition
!is_table_rowtype_ref() && !is_table_rowtype_ref() &&
!is_cursor_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; 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; m_column_type_ref= ref;
} }
......
...@@ -226,7 +226,8 @@ check_column_grant_for_type_ref(THD *thd, TABLE_LIST *table_list, ...@@ -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(). 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; Open_tables_backup open_tables_state_backup;
thd->reset_n_backup_open_tables_state(&open_tables_state_backup); thd->reset_n_backup_open_tables_state(&open_tables_state_backup);
......
...@@ -7142,7 +7142,7 @@ class Qualified_column_ident: public Table_ident ...@@ -7142,7 +7142,7 @@ class Qualified_column_ident: public Table_ident
:Table_ident(thd, db, table, false), :Table_ident(thd, db, table, false),
m_column(*column) 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; bool append_to(THD *thd, String *to) const;
}; };
......
...@@ -6715,9 +6715,9 @@ LEX::sp_variable_declarations_with_ref_finalize(THD *thd, int nvars, ...@@ -6715,9 +6715,9 @@ LEX::sp_variable_declarations_with_ref_finalize(THD *thd, int nvars,
bool bool
LEX::sp_variable_declarations_column_type_finalize(THD *thd, int nvars, LEX::sp_variable_declarations_column_type_finalize(THD *thd, int nvars,
Qualified_column_ident *ref, const Qualified_column_ident *ref,
Item *def, Item *def,
const LEX_CSTRING &expr_str) const LEX_CSTRING &expr_str)
{ {
for (uint i= 0 ; i < (uint) nvars; i++) for (uint i= 0 ; i < (uint) nvars; i++)
{ {
...@@ -6757,7 +6757,7 @@ LEX::sp_variable_declarations_vartype_finalize(THD *thd, int nvars, ...@@ -6757,7 +6757,7 @@ LEX::sp_variable_declarations_vartype_finalize(THD *thd, int nvars,
if (t->field_def.is_column_type_ref()) 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, return sp_variable_declarations_column_type_finalize(thd, nvars, tmp,
default_value, default_value,
expr_str); expr_str);
......
...@@ -3972,9 +3972,9 @@ struct LEX: public Query_tables_list ...@@ -3972,9 +3972,9 @@ struct LEX: public Query_tables_list
Item *def, Item *def,
const LEX_CSTRING &expr_str); const LEX_CSTRING &expr_str);
bool sp_variable_declarations_column_type_finalize(THD *thd, int nvars, bool sp_variable_declarations_column_type_finalize(THD *thd, int nvars,
Qualified_column_ident *ref, const Qualified_column_ident *ref,
Item *def, Item *def,
const LEX_CSTRING &expr_str); const LEX_CSTRING &expr_str);
bool sp_variable_declarations_vartype_finalize(THD *thd, int nvars, bool sp_variable_declarations_vartype_finalize(THD *thd, int nvars,
const LEX_CSTRING &name, const LEX_CSTRING &name,
Item *def, Item *def,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment