Go to the source code of this file.
|
bool | update_referencing_views_metadata (THD *thd, const char *db_name, const char *table_name, bool commit_dd_changes, Uncommitted_tables_guard *uncommitted_tables) |
| Update metadata of views referencing the table. More...
|
|
bool | update_referencing_views_metadata (THD *thd, const Table_ref *table, bool commit_dd_changes, Uncommitted_tables_guard *uncommitted_tables) |
| Update metadata of views referencing the table. More...
|
|
bool | update_referencing_views_metadata (THD *thd, const Table_ref *table, const char *new_db, const char *new_table_name, bool commit_dd_changes, Uncommitted_tables_guard *uncommitted_tables) |
| Update metadata of views referencing "table" being renamed and views referencing (if there any) new table name "new_db.new_table_name". More...
|
|
bool | update_referencing_views_metadata (THD *thd, const sp_name *spname) |
| Method to update metadata of views using stored function. More...
|
|
bool | mark_referencing_views_invalid (THD *thd, const Table_ref *table, bool skip_same_db, bool commit_dd_changes, MEM_ROOT *mem_root) |
| Mark views referencing the table as invalid. More...
|
|
bool | mark_referencing_views_invalid (THD *thd, const sp_name *spname, MEM_ROOT *mem_root) |
| Mark views using stored function as invalid. More...
|
|
std::string | push_view_warning_or_error (THD *thd, const char *db, const char *view_name) |
| Push error or warnings in case a view is invalid and return the error message to the caller. More...
|
|
◆ mark_referencing_views_invalid() [1/2]
bool mark_referencing_views_invalid |
( |
THD * |
thd, |
|
|
const sp_name * |
spname, |
|
|
MEM_ROOT * |
mem_root |
|
) |
| |
Mark views using stored function as invalid.
- Parameters
-
thd | Thread handle. |
spname | Name of the stored function. |
mem_root | Memory root for allocation of temporary objects which will be cleared after each call to this function. |
- Note
- This call is a version of update_referencing_views_metadata(), which is optimized for DROP DATABASE case.
- Return values
-
false | Success. |
true | Failure. |
◆ mark_referencing_views_invalid() [2/2]
bool mark_referencing_views_invalid |
( |
THD * |
thd, |
|
|
const Table_ref * |
table, |
|
|
bool |
skip_same_db, |
|
|
bool |
commit_dd_changes, |
|
|
MEM_ROOT * |
mem_root |
|
) |
| |
Mark views referencing the table as invalid.
- Parameters
-
thd | Thread handle. |
table | Views referencing this table need to be marked as invalid. |
skip_same_db | Indicates whether it is OK to skip views belonging to the same database as table (as they will be dropped anyway). |
commit_dd_changes | Indicates whether changes to DD need to be committed. |
mem_root | Memory root for allocation of temporary objects which will be cleared after each call to this function. |
- Note
- In case when commit_dd_changes is false, the caller must rollback both statement and transaction on failure, before any further accesses to DD. This is because such a failure might be caused by a deadlock, which requires rollback before any other operations on SE (including reads using attachable transactions) can be done. If case when commit_dd_changes is true this function will handle transaction rollback itself.
-
This call is a version of update_referencing_views_metadata(), which is optimized for DROP DATABASE case.
- Return values
-
false | Success. |
true | Failure. |
◆ push_view_warning_or_error()
std::string push_view_warning_or_error |
( |
THD * |
thd, |
|
|
const char * |
db, |
|
|
const char * |
view_name |
|
) |
| |
Push error or warnings in case a view is invalid and return the error message to the caller.
- Parameters
-
thd | Thread handle. |
db | Database name. |
view_name | View name. |
returns The error/warning message string.
◆ update_referencing_views_metadata() [1/4]
bool update_referencing_views_metadata |
( |
THD * |
thd, |
|
|
const char * |
db_name, |
|
|
const char * |
table_name, |
|
|
bool |
commit_dd_changes, |
|
|
Uncommitted_tables_guard * |
uncommitted_tables |
|
) |
| |
Update metadata of views referencing the table.
- Parameters
-
| thd | Thread handle. |
| db_name | Database name. |
| table_name | Update metadata of views referencing this table. |
| commit_dd_changes | Indicates whether changes to DD need to be committed. |
[in,out] | uncommitted_tables | Helper class to store list of views which shares need to be removed from TDC if we fail to commit changes to DD. Only used if commit_dd_changes is false. |
- Note
- In case when commit_dd_changes is false, the caller must rollback both statement and transaction on failure, before any further accesses to DD. This is because such a failure might be caused by a deadlock, which requires rollback before any other operations on SE (including reads using attachable transactions) can be done. If case when commit_dd_changes is true this function will handle transaction rollback itself.
- Return values
-
false | Success. |
true | Failure. |
◆ update_referencing_views_metadata() [2/4]
bool update_referencing_views_metadata |
( |
THD * |
thd, |
|
|
const sp_name * |
spname |
|
) |
| |
Method to update metadata of views using stored function.
- Parameters
-
thd | Thread handle. |
spname | Name of the stored function. |
- Return values
-
false | Success. |
true | Failure. |
◆ update_referencing_views_metadata() [3/4]
Update metadata of views referencing the table.
- Parameters
-
| thd | Thread handle. |
| table | Update metadata of views referencing this table. |
| commit_dd_changes | Indicates whether changes to DD need to be committed. |
[in,out] | uncommitted_tables | Helper class to store list of views which shares need to be removed from TDC if we fail to commit changes to DD. Only used if commit_dd_changes is false. |
- Note
- In case when commit_dd_changes is false, the caller must rollback both statement and transaction on failure, before any further accesses to DD. This is because such a failure might be caused by a deadlock, which requires rollback before any other operations on SE (including reads using attachable transactions) can be done. If case when commit_dd_changes is true this function will handle transaction rollback itself.
- Return values
-
false | Success. |
true | Failure. |
◆ update_referencing_views_metadata() [4/4]
bool update_referencing_views_metadata |
( |
THD * |
thd, |
|
|
const Table_ref * |
table, |
|
|
const char * |
new_db, |
|
|
const char * |
new_table_name, |
|
|
bool |
commit_dd_changes, |
|
|
Uncommitted_tables_guard * |
uncommitted_tables |
|
) |
| |
Update metadata of views referencing "table" being renamed and views referencing (if there any) new table name "new_db.new_table_name".
- Parameters
-
| thd | Thread handle. |
| table | Update metadata of views referencing this table. |
| new_db | New db name set in the rename operation. |
| new_table_name | New table name set in the rename |
| commit_dd_changes | Indicates whether changes to DD need to be committed. |
[in,out] | uncommitted_tables | Helper class to store list of views which shares need to be removed from TDC if we fail to commit changes to DD. Only used if commit_dd_changes is false. |
- Note
- In case when commit_dd_changes is false, the caller must rollback both statement and transaction on failure, before any further accesses to DD. This is because such a failure might be caused by a deadlock, which requires rollback before any other operations on SE (including reads using attachable transactions) can be done. If case when commit_dd_changes is true this function will handle transaction rollback itself. operation.
- Return values
-
false | Success. |
true | Failure. |