summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-01-29 15:41:05 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2022-01-29 15:41:05 +0100
commit41a163ac5ccf4ac5394edc84e40b3f47acea6b08 (patch)
tree60d5259e290b4a0166d8ef1651975b14b5afe304 /sql/sql_view.cc
parenta85d942be9008cf19086d8bd330c4be83a18167f (diff)
parente2b50213cf12623da31c8b49be4d40772876223c (diff)
downloadmariadb-git-41a163ac5ccf4ac5394edc84e40b3f47acea6b08.tar.gz
Merge branch '10.2' into 10.3mariadb-10.3.33
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 258e6e2ca4e..024bd36f483 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);
/*