summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2005-12-02 21:18:12 +0200
committerunknown <bell@sanja.is.com.ua>2005-12-02 21:18:12 +0200
commitd65c5f103b76e08a87bdd66b44f1f4fa82e52fef (patch)
tree68ef4b9d68ef96bb3c8739f3c040c31da4baf232 /mysql-test
parent7453e2c21cc9491d68d82567b513bfea72d98872 (diff)
downloadmariadb-git-d65c5f103b76e08a87bdd66b44f1f4fa82e52fef.tar.gz
Now we shall store only position (index of first character)
of SELECT from query begining, to be independet of query buffer allocation. Correct procedure used to find beginning of the current statement during parsing (BUG#14885). mysql-test/r/view.result: BUG#14885 test suite. mysql-test/t/view.test: BUG#14885 test suite. sql/sp_head.cc: The debug print statement fixed to prevent crash in case of NULL in m_next_cached_sp. sql/sql_lex.h: Now we shall store only position (index of first character) of SELECT from query beginning. sql/sql_view.cc: Position of the SELECT used to output it to .frm. sql/sql_yacc.yy: Now we shall store only position (index of first character) of SELECT from query beginning. Correct procedure used to find beginning of the current statement during parsing.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/view.result12
-rw-r--r--mysql-test/t/view.test19
2 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index ebb2c190eb1..5da6a4f95fd 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -2424,3 +2424,15 @@ f1 sum(f2)
NULL 12
drop view v1;
drop table t1;
+drop procedure if exists p1;
+create procedure p1 () deterministic
+begin
+create view v1 as select 1;
+end;
+//
+call p1();
+show create view v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1`
+drop view v1;
+drop procedure p1;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index ac103278f08..be4fb571320 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -2280,3 +2280,22 @@ create view v1 as select * from t1;
select f1, sum(f2) from v1 group by f1;
drop view v1;
drop table t1;
+
+#
+# BUG#14885: incorrect SOURCE in view created in a procedure
+# TODO: here SOURCE string must be shown when it will be possible
+#
+--disable_warnings
+drop procedure if exists p1;
+--enable_warnings
+delimiter //;
+create procedure p1 () deterministic
+begin
+create view v1 as select 1;
+end;
+//
+delimiter ;//
+call p1();
+show create view v1;
+drop view v1;
+drop procedure p1;