List:Internals« Previous MessageNext Message »
From:sanja Date:December 2 2005 7:20pm
Subject:bk commit into 5.0 tree (bell:1.2042)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of bell. When bell does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2042 05/12/02 21:20:25 bell@stripped +5 -0
  Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0
  into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge1-5.0

  mysql-test/t/view.test
    1.128 05/12/02 21:20:22 bell@stripped +0 -0
    SCCS merged

  mysql-test/r/view.result
    1.138 05/12/02 21:20:22 bell@stripped +0 -0
    SCCS merged

  sql/sql_yacc.yy
    1.442 05/12/02 21:19:21 bell@stripped +0 -0
    Auto merged

  sql/sql_view.cc
    1.80 05/12/02 21:19:21 bell@stripped +0 -0
    Auto merged

  sql/sp_head.cc
    1.197 05/12/02 21:19:21 bell@stripped +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	bell
# Host:	sanja.is.com.ua
# Root:	/home/bell/mysql/bk/work-merge1-5.0/RESYNC

--- 1.441/sql/sql_yacc.yy	2005-12-02 15:58:50 +02:00
+++ 1.442/sql/sql_yacc.yy	2005-12-02 21:19:21 +02:00
@@ -3380,7 +3380,6 @@
 	    THD *thd= YYTHD;
 	    LEX *lex= thd->lex;
 	    lex->sql_command= SQLCOM_CREATE_VIEW;
-            lex->create_view_start= thd->query;
 	    lex->create_view_mode= VIEW_ALTER;
 	    /* first table in list is target VIEW name */
 	    lex->select_lex.add_table_to_list(thd, $6, NULL, 0);
@@ -8984,7 +8983,6 @@
 	  THD *thd= YYTHD;
 	  LEX *lex= thd->lex;
 	  lex->sql_command= SQLCOM_CREATE_VIEW;
-	  lex->create_view_start= thd->query;
 	  /* first table in list is target VIEW name */
 	  if (!lex->select_lex.add_table_to_list(thd, $3, NULL, 0))
 	    YYABORT;
@@ -9015,11 +9013,21 @@
 view_select:
 	SELECT_SYM remember_name select_init2
 	{
-	  Lex->create_view_select_start= $2;
+          THD *thd=YYTHD;
+          LEX *lex= thd->lex;
+          char *stmt_beg= (lex->sphead ?
+                           (char *)lex->sphead->m_tmp_query :
+                           thd->query);
+	  lex->create_view_select_start= $2 - stmt_beg;
 	}
 	| '(' remember_name select_paren ')' union_opt
 	{
-	  Lex->create_view_select_start= $2;
+          THD *thd=YYTHD;
+          LEX *lex= thd->lex;
+          char *stmt_beg= (lex->sphead ?
+                           (char *)lex->sphead->m_tmp_query :
+                           thd->query);
+	  lex->create_view_select_start= $2 - stmt_beg;
 	}
 	;
 

--- 1.137/mysql-test/r/view.result	2005-12-01 12:15:43 +02:00
+++ 1.138/mysql-test/r/view.result	2005-12-02 21:20:22 +02:00
@@ -2424,6 +2424,18 @@
 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;
 CREATE VIEW v1 AS SELECT 42 AS Meaning;
 DROP FUNCTION IF EXISTS f1;
 CREATE FUNCTION f1() RETURNS INTEGER

--- 1.127/mysql-test/t/view.test	2005-12-01 12:15:43 +02:00
+++ 1.128/mysql-test/t/view.test	2005-12-02 21:20:22 +02:00
@@ -2282,6 +2282,25 @@
 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;
+
+#
 # BUG#15096: using function with view for view creation
 #
 CREATE VIEW v1 AS SELECT 42 AS Meaning;

--- 1.79/sql/sql_view.cc	2005-12-01 12:15:43 +02:00
+++ 1.80/sql/sql_view.cc	2005-12-02 21:19:21 +02:00
@@ -650,10 +650,9 @@
   /* fill structure */
   view->query.str= (char*)str.ptr();
   view->query.length= str.length()-1; // we do not need last \0
-  view->source.str= thd->lex->create_view_select_start;
+  view->source.str= thd->query + thd->lex->create_view_select_start;
   view->source.length= (thd->query_length -
-                        (thd->lex->create_view_select_start -
-                         thd->lex->create_view_start));
+                        thd->lex->create_view_select_start);
   view->file_version= 1;
   view->calc_md5(md5);
   view->md5.str= md5;

--- 1.196/sql/sp_head.cc	2005-12-01 12:26:28 +02:00
+++ 1.197/sql/sp_head.cc	2005-12-02 21:19:21 +02:00
@@ -954,8 +954,12 @@
   m_first_instance->m_first_free_instance= m_next_cached_sp;
   DBUG_PRINT("info", ("first free for 0x%lx ++: 0x%lx->0x%lx, level: %lu, flags %x",
                       (ulong)m_first_instance, this, m_next_cached_sp,
-                      m_next_cached_sp->m_recursion_level,
-                      m_next_cached_sp->m_flags));
+                      (m_next_cached_sp ?
+                       m_next_cached_sp->m_recursion_level :
+                       0),
+                      (m_next_cached_sp ?
+                       m_next_cached_sp->m_flags :
+                       0)));
   /*
     Check that if there are not any instances after this one then
     pointer to the last instance points on this instance or if there are
Thread
bk commit into 5.0 tree (bell:1.2042)sanja2 Dec