diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-20 10:26:49 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-20 10:41:32 +0200 |
commit | 514b305dfb2839c619a623bbdae5f21cf0077672 (patch) | |
tree | 2f9700f05ccf0ddc7e46a547d9a191404e8dbbd7 /sql/sql_view.cc | |
parent | de51acd03730311505677eb7212756e7126183b3 (diff) | |
parent | 117291db8b35ddb4cd8c89ee4d8de888160b7163 (diff) | |
download | mariadb-git-514b305dfb2839c619a623bbdae5f21cf0077672.tar.gz |
Merge 10.3 into 10.4
The MDEV-17262 commit 26432e49d37a37d09b862bb49a021e44bdf4789c
was skipped. In Galera 4, the implementation would seem to require
changes to the streaming replication.
In the tests archive.rnd_pos main.profiling, disable_ps_protocol
for SHOW STATUS and SHOW PROFILE commands until MDEV-18974
has been fixed.
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 31032c5cd5e..ec1141668b5 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -216,7 +216,8 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view) LEX *lex= thd->lex; TABLE_LIST decoy; - memcpy (&decoy, view, sizeof (TABLE_LIST)); + decoy= *view; + decoy.mdl_request.key.mdl_key_init(&view->mdl_request.key); if (tdc_open_view(thd, &decoy, OPEN_VIEW_NO_PARSE)) return TRUE; @@ -330,12 +331,11 @@ bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view, { if (!tbl->table_in_first_from_clause) { - if (check_access(thd, SELECT_ACL, tbl->db.str, - &tbl->grant.privilege, - &tbl->grant.m_internal, - 0, 0) || - check_grant(thd, SELECT_ACL, tbl, FALSE, 1, FALSE)) + if (check_single_table_access(thd, SELECT_ACL, tbl, FALSE)) + { + tbl->hide_view_error(thd); goto err; + } } } } @@ -912,15 +912,8 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, View definition query is stored in the client character set. */ - char view_query_buff[4096]; - String view_query(view_query_buff, - sizeof (view_query_buff), - thd->charset()); - - char is_query_buff[4096]; - String is_query(is_query_buff, - sizeof (is_query_buff), - system_charset_info); + StringBuffer<4096> view_query(thd->charset()); + StringBuffer<4096> is_query(system_charset_info); char md5[MD5_BUFF_LENGTH]; bool can_be_merged; @@ -2197,7 +2190,7 @@ mysql_rename_view(THD *thd, view definition parsing or use temporary 'view_def' object for it. */ - bzero(&view_def, sizeof(view_def)); + view_def.reset(); view_def.timestamp.str= view_def.timestamp_buffer; view_def.view_suid= TRUE; |