List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:November 30 2007 9:15am
Subject:bk commit into 5.1 tree (anozdrin:1.2672) BUG#26676
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of alik. When alik 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@stripped, 2007-11-30 12:14:07+03:00, anozdrin@ibm. +2 -0
  A test case for BUG#26676: VIEW using old table schema in a session.
  
  The following clarification should be made in The Manual:
  
  Standard SQL is quite clear that, if new columns are added
  to a table after a view on that table is created with
  "select *", the new columns will not become part of the view.
  In all cases, the view definition (view structure) is frozen
  at CREATE time, so changes to the underlying tables do not
  affect the view structure.

  mysql-test/r/view.result@stripped, 2007-11-30 12:14:00+03:00, anozdrin@ibm. +43 -0
    Update result file.

  mysql-test/t/view.test@stripped, 2007-11-30 12:14:00+03:00, anozdrin@ibm. +51 -0
    Add a test case for BUG#26676: VIEW using old table schema in a session.

diff -Nrup a/mysql-test/r/view.result b/mysql-test/r/view.result
--- a/mysql-test/r/view.result	2007-10-10 13:22:19 +04:00
+++ b/mysql-test/r/view.result	2007-11-30 12:14:00 +03:00
@@ -3617,4 +3617,47 @@ DROP TABLE `t-2`;
 DROP VIEW  `v-2`;
 DROP DATABASE `d-1`;
 USE test;
+
+#
+# Bug#26676: VIEW using old table schema in a session.
+#
+
+DROP VIEW IF EXISTS v1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(c1 INT, c2 INT);
+INSERT INTO t1 VALUES (1, 2), (3, 4);
+
+SELECT * FROM t1;
+c1	c2
+1	2
+3	4
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+SELECT * FROM v1;
+c1	c2
+1	2
+3	4
+
+ALTER TABLE t1 ADD COLUMN c3 INT AFTER c2;
+
+SELECT * FROM t1;
+c1	c2	c3
+1	2	NULL
+3	4	NULL
+
+SELECT * FROM v1;
+c1	c2
+1	2
+3	4
+
+SHOW CREATE VIEW v1;
+View	Create View	character_set_client	collation_connection
+v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`c1` AS `c1`,`t1`.`c2` AS `c2` from `t1`	latin1	latin1_swedish_ci
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+# End of test case for Bug#26676.
+
 End of 5.1 tests.
diff -Nrup a/mysql-test/t/view.test b/mysql-test/t/view.test
--- a/mysql-test/t/view.test	2007-10-10 11:37:04 +04:00
+++ b/mysql-test/t/view.test	2007-11-30 12:14:00 +03:00
@@ -3475,4 +3475,55 @@ DROP VIEW  `v-2`;
 DROP DATABASE `d-1`;
 USE test;
 
+--echo
+--echo #
+--echo # Bug#26676: VIEW using old table schema in a session.
+--echo #
+--echo
+
+--disable_warnings
+DROP VIEW IF EXISTS v1;
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(c1 INT, c2 INT);
+INSERT INTO t1 VALUES (1, 2), (3, 4);
+
+--echo
+
+SELECT * FROM t1;
+
+--echo
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+--echo
+
+SELECT * FROM v1;
+
+--echo
+
+ALTER TABLE t1 ADD COLUMN c3 INT AFTER c2;
+
+--echo
+
+SELECT * FROM t1;
+
+--echo
+
+SELECT * FROM v1;
+
+--echo
+
+SHOW CREATE VIEW v1;
+
+--echo
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo
+--echo # End of test case for Bug#26676.
+--echo
+
 --echo End of 5.1 tests.
Thread
bk commit into 5.1 tree (anozdrin:1.2672) BUG#26676Alexander Nozdrin30 Nov