diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/share/errmsg.txt | 2 | ||||
-rw-r--r-- | sql/sql_view.cc | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 2c28eef1ea1..65afefef35a 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5194,7 +5194,7 @@ ER_VIEW_SELECT_VARIABLE rus "View SELECT содержит переменную или параметр" ukr "View SELECT ма╓ зминну або параметер" ER_VIEW_SELECT_TMPTABLE - eng "View's SELECT contains a temporary table '%-.64s'" + eng "View's SELECT refers to a temporary table '%-.64s'" rus "View SELECT содержит ссылку на временную таблицу '%-.64s'" ukr "View SELECT використову╓ тимчасову таблицю '%-.64s'" ER_VIEW_WRONG_LIST diff --git a/sql/sql_view.cc b/sql/sql_view.cc index c3222f951bb..ddc47d26a69 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -310,9 +310,11 @@ bool mysql_create_view(THD *thd, /* check that tables are not temporary and this VIEW do not used in query - (it is possible with ALTERing VIEW) - */ - for (tbl= tables; tbl; tbl= tbl->next_global) + (it is possible with ALTERing VIEW). + open_and_lock_tables can change the value of tables, + e.g. it may happen if before the function call tables was equal to 0. + */ + for (tbl= tables= lex->query_tables; tbl; tbl= tbl->next_global) { /* is this table temporary and is not view? */ if (tbl->table->s->tmp_table != NO_TMP_TABLE && !tbl->view && |