[Commits] Rev 4475: Adding servere-version on the view creation to view frm. (MDEV-6916 followup) in file:///home/bell/maria/bzr/work-maria-10.0-MDEV-6916/

sanja at askmonty.org sanja at askmonty.org
Wed Nov 12 19:48:58 EET 2014


At file:///home/bell/maria/bzr/work-maria-10.0-MDEV-6916/

------------------------------------------------------------
revno: 4475
revision-id: sanja at askmonty.org-20141112174834-w08uxj0rsxk5vg42
parent: psergey at askmonty.org-20141111165931-d61nkv28s0pcajoz
committer: sanja at askmonty.org
branch nick: work-maria-10.0-MDEV-6916
timestamp: Wed 2014-11-12 18:48:34 +0100
message:
  Adding servere-version on the view creation to view frm. (MDEV-6916 followup)
-------------- next part --------------
=== modified file 'mysql-test/r/view.result'
--- a/mysql-test/r/view.result	2014-08-07 16:06:56 +0000
+++ b/mysql-test/r/view.result	2014-11-12 17:48:34 +0000
@@ -5500,6 +5500,8 @@ a	b	a	b	a	c
 9	10	9	10	9	10
 drop view v1;
 drop table t1,t2;
+create view v1 as select 1;
+drop view v1;
 # -----------------------------------------------------------------
 # -- End of 10.0 tests.
 # -----------------------------------------------------------------

=== modified file 'mysql-test/t/view.test'
--- a/mysql-test/t/view.test	2014-08-07 16:06:56 +0000
+++ b/mysql-test/t/view.test	2014-11-12 17:48:34 +0000
@@ -5364,6 +5364,16 @@ select * from t2, t1, v1 where t1.a=t2.a
 drop view v1;
 drop table t1,t2;
 
+
+create view v1 as select 1;
+
+--let $MYSQLD_DATADIR= `select @@datadir`
+--let SEARCH_FILE= $MYSQLD_DATADIR/test/v1.frm
+--let SEARCH_PATTERN=server-version
+--source include/search_pattern_in_file.inc
+
+drop view v1;
+
 --echo # -----------------------------------------------------------------
 --echo # -- End of 10.0 tests.
 --echo # -----------------------------------------------------------------

=== modified file 'sql/sql_view.cc'
--- a/sql/sql_view.cc	2014-09-30 17:31:14 +0000
+++ b/sql/sql_view.cc	2014-11-12 17:48:34 +0000
@@ -736,6 +736,9 @@ static File_option view_parameters[]=
  {{(char*) STRING_WITH_LEN("view_body_utf8")},
   my_offsetof(TABLE_LIST, view_body_utf8),
   FILE_OPTIONS_ESTRING},
+ {{ C_STRING_WITH_LEN("server-version")},
+  my_offsetof(TABLE_LIST, server_version),
+  FILE_OPTIONS_ULONGLONG},
  {{NullS, 0},			0,
   FILE_OPTIONS_STRING}
 };
@@ -836,6 +839,7 @@ static int mysql_register_view(THD *thd,
     version 2 - empty definer_host means a role
   */
   view->file_version= 2;
+  view->server_version= MYSQL_VERSION_ID;
   view->calc_md5(md5);
   if (!(view->md5.str= (char*) thd->memdup(md5, 32)))
   {

=== modified file 'sql/table.h'
--- a/sql/table.h	2014-09-16 12:03:17 +0000
+++ b/sql/table.h	2014-11-12 17:48:34 +0000
@@ -1897,6 +1897,7 @@ struct TABLE_LIST
   LEX_STRING	timestamp;		/* GMT time stamp of last operation */
   st_lex_user   definer;                /* definer of view */
   ulonglong	file_version;		/* version of file's field set */
+  ulonglong	server_version;	        /* version of server on creation */
   ulonglong     updatable_view;         /* VIEW can be updated */
   /** 
       @brief The declared algorithm, if this is a view.



More information about the commits mailing list