diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-01-30 09:46:52 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-01-30 09:46:52 +0100 |
commit | a576a1cea5b0f06fb8fff0fbdb9035d89510b83a (patch) | |
tree | d25987402c55bdaec0897ab28c236acfa50116ef /sql/sql_view.cc | |
parent | 12cad0c3468d734e041d4ef0cd5a26d2a28606fc (diff) | |
parent | 41a163ac5ccf4ac5394edc84e40b3f47acea6b08 (diff) | |
download | mariadb-git-a576a1cea5b0f06fb8fff0fbdb9035d89510b83a.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 9091de619e6..81ed160560e 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -407,8 +407,18 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, bool res= FALSE; DBUG_ENTER("mysql_create_view"); - /* This is ensured in the parser. */ - DBUG_ASSERT(!lex->proc_list.first && !lex->result && + /* + This is ensured in the parser. + NOTE: Originally, the assert below contained the extra condition + && !lex->result + but in this form the assert is failed in case CREATE VIEW run under + cursor (the case when the byte 'flags' in the COM_STMT_EXECUTE packet has + the flag CURSOR_TYPE_READ_ONLY set). For the cursor use case + thd->lex->result is assigned a pointer to the class Select_materialize + inside the function mysql_open_cursor() just before handling of a statement + will be started and the function mysql_create_view() called. + */ + DBUG_ASSERT(!lex->proc_list.first && !lex->param_list.elements); /* |