Loading mysql-test/r/view.result +8 −0 Original line number Diff line number Diff line Loading @@ -1770,3 +1770,11 @@ two 1025,2025,3025 two 1050,1050 drop view v1; drop table t1; create table t1 (s1 int, s2 char); create view v1 as select s1, s2 from t1; select s2 from v1 vq1 where 2 = (select count(*) from v1 vq2 having vq1.s2 = vq2.s2); ERROR 42S22: Unknown column 'vq2.s2' in 'having clause' select s2 from v1 vq1 where 2 = (select count(*) aa from v1 vq2 having vq1.s2 = aa); s2 drop view v1; drop table t1; sql/sql_parse.cc +2 −0 Original line number Diff line number Diff line Loading @@ -4347,6 +4347,7 @@ mysql_execute_command(THD *thd) if (!(res= mysql_create_view(thd, thd->lex->create_view_mode)) && mysql_bin_log.is_open()) { thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } Loading @@ -4360,6 +4361,7 @@ mysql_execute_command(THD *thd) if (!(res= mysql_drop_view(thd, first_table, thd->lex->drop_mode)) && mysql_bin_log.is_open()) { thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } Loading Loading
mysql-test/r/view.result +8 −0 Original line number Diff line number Diff line Loading @@ -1770,3 +1770,11 @@ two 1025,2025,3025 two 1050,1050 drop view v1; drop table t1; create table t1 (s1 int, s2 char); create view v1 as select s1, s2 from t1; select s2 from v1 vq1 where 2 = (select count(*) from v1 vq2 having vq1.s2 = vq2.s2); ERROR 42S22: Unknown column 'vq2.s2' in 'having clause' select s2 from v1 vq1 where 2 = (select count(*) aa from v1 vq2 having vq1.s2 = aa); s2 drop view v1; drop table t1;
sql/sql_parse.cc +2 −0 Original line number Diff line number Diff line Loading @@ -4347,6 +4347,7 @@ mysql_execute_command(THD *thd) if (!(res= mysql_create_view(thd, thd->lex->create_view_mode)) && mysql_bin_log.is_open()) { thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } Loading @@ -4360,6 +4361,7 @@ mysql_execute_command(THD *thd) if (!(res= mysql_drop_view(thd, first_table, thd->lex->drop_mode)) && mysql_bin_log.is_open()) { thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } Loading