MCPcopy Create free account
hub / github.com/MariaDB/server / check_one_table_access

Function check_one_table_access

sql/sql_parse.cc:6880–6906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6878*/
6879
6880bool check_one_table_access(THD *thd, privilege_t privilege,
6881 TABLE_LIST *all_tables)
6882{
6883 if (check_single_table_access (thd,privilege,all_tables, FALSE))
6884 return 1;
6885
6886 /* Check rights on tables of subselects and implicitly opened tables */
6887 TABLE_LIST *subselects_tables, *view= all_tables->view ? all_tables : 0;
6888 if ((subselects_tables= all_tables->next_global))
6889 {
6890 /*
6891 Access rights asked for the first table of a view should be the same
6892 as for the view
6893 */
6894 if (view && subselects_tables->belong_to_view == view)
6895 {
6896 if (check_single_table_access (thd, privilege, subselects_tables, FALSE))
6897 return 1;
6898 subselects_tables= subselects_tables->next_global;
6899 }
6900 if (subselects_tables &&
6901 (check_table_access(thd, SELECT_ACL, subselects_tables, FALSE,
6902 UINT_MAX, FALSE)))
6903 return 1;
6904 }
6905 return 0;
6906}
6907
6908
6909static bool check_show_access(THD *thd, TABLE_LIST *table)

Callers 4

sql_parse.ccFile · 0.70
update_precheckFunction · 0.70
delete_precheckFunction · 0.70
insert_precheckFunction · 0.70

Calls 2

check_table_accessFunction · 0.70

Tested by

no test coverage detected