summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 289bf9d28a3..9f0c3260d8f 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1000,8 +1000,9 @@ bool check_key_in_view(THD *thd, TABLE_LIST *view)
we do not support updatable UNIONs in VIEW, so we can check just limit of
LEX::select_lex
*/
- if ((!view->view && !view->belong_to_view) || thd->lex->sql_command == SQLCOM_INSERT ||
- thd->lex->select_lex.select_limit == HA_POS_ERROR)
+ if ((!view->view && !view->belong_to_view) ||
+ thd->lex->sql_command == SQLCOM_INSERT ||
+ thd->lex->select_lex.select_limit == 0)
DBUG_RETURN(FALSE); /* it is normal table or query without LIMIT */
table= view->table;
if (view->belong_to_view)