diff options
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 57bcb0b5942..94f869f5377 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -16502,6 +16502,14 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) /* go through join tree */ print_join(thd, str, &top_join_list, query_type); } + else if (where) + { + /* + "SELECT 1 FROM DUAL WHERE 2" should not be printed as + "SELECT 1 WHERE 2": the 1st syntax is valid, but the 2nd is not. + */ + str->append(STRING_WITH_LEN(" from DUAL ")); + } // Where Item *cur_where= where; |