summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-01-30 09:46:52 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2022-01-30 09:46:52 +0100
commita576a1cea5b0f06fb8fff0fbdb9035d89510b83a (patch)
treed25987402c55bdaec0897ab28c236acfa50116ef /sql/sql_view.cc
parent12cad0c3468d734e041d4ef0cd5a26d2a28606fc (diff)
parent41a163ac5ccf4ac5394edc84e40b3f47acea6b08 (diff)
downloadmariadb-git-a576a1cea5b0f06fb8fff0fbdb9035d89510b83a.tar.gz
Merge branch '10.3' into 10.4
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc14
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);
/*