List:Commits« Previous MessageNext Message »
From:holyfoot Date:September 29 2006 7:17am
Subject:bk commit into 5.1 tree (holyfoot:1.2337)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of hf. When hf 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, 2006-09-29 12:17:33+05:00, holyfoot@deer.(none) +3 -0
  Merge mysql.com:/home/hf/work/16813/my50-16813
  into  mysql.com:/home/hf/work/16813/my51-16813
  MERGE: 1.1810.1697.150

  mysql-test/r/view.result@stripped, 2006-09-29 12:17:27+05:00, holyfoot@deer.(none) +0 -0
    Auto merged
    MERGE: 1.138.1.39

  mysql-test/t/view.test@stripped, 2006-09-29 12:17:27+05:00, holyfoot@deer.(none) +0 -0
    Auto merged
    MERGE: 1.126.1.38

  sql/table.cc@stripped, 2006-09-29 12:17:27+05:00, holyfoot@deer.(none) +0 -0
    Auto merged
    MERGE: 1.160.1.73

# 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:	holyfoot
# Host:	deer.(none)
# Root:	/home/hf/work/16813/my51-16813/RESYNC

--- 1.246/sql/table.cc	2006-09-29 12:17:40 +05:00
+++ 1.247/sql/table.cc	2006-09-29 12:17:40 +05:00
@@ -2775,12 +2775,13 @@ bool st_table_list::prep_where(THD *thd,
             this expression will not be moved to WHERE condition (i.e. will
             be clean correctly for PS/SP)
           */
-          tbl->on_expr= and_conds(tbl->on_expr, where);
+          tbl->on_expr= and_conds(tbl->on_expr,
+                                  where->copy_andor_structure(thd));
           break;
         }
       }
       if (tbl == 0)
-        *conds= and_conds(*conds, where);
+        *conds= and_conds(*conds, where->copy_andor_structure(thd));
       if (arena)
         thd->restore_active_arena(arena, &backup);
       where_processed= TRUE;

--- 1.179/mysql-test/r/view.result	2006-09-29 12:17:40 +05:00
+++ 1.180/mysql-test/r/view.result	2006-09-29 12:17:40 +05:00
@@ -2935,4 +2935,14 @@ id	select_type	table	type	possible_keys	
 2	SUBQUERY	t1	ALL	NULL	NULL	NULL	NULL	3	
 DROP VIEW v1;
 DROP TABLE t1;
+CREATE TABLE t1(id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, val INT UNSIGNED NOT NULL);
+CREATE VIEW v1 AS SELECT id, val FROM t1 WHERE val >= 1 AND val <= 5 WITH CHECK OPTION;
+INSERT INTO v1 (val) VALUES (2);
+INSERT INTO v1 (val) VALUES (4);
+INSERT INTO v1 (val) VALUES (6);
+ERROR HY000: CHECK OPTION failed 'test.v1'
+UPDATE v1 SET val=6 WHERE id=2;
+ERROR HY000: CHECK OPTION failed 'test.v1'
+DROP VIEW v1;
+DROP TABLE t1;
 End of 5.0 tests.

--- 1.160/mysql-test/t/view.test	2006-09-29 12:17:40 +05:00
+++ 1.161/mysql-test/t/view.test	2006-09-29 12:17:40 +05:00
@@ -2855,4 +2855,19 @@ EXPLAIN SELECT * FROM v1 t WHERE t.s1+1 
 
 DROP VIEW v1;
 DROP TABLE t1;
+
+#
+# Bug #16813 (WITH CHECK OPTION doesn't work with UPDATE)
+#
+CREATE TABLE t1(id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, val INT UNSIGNED NOT NULL);
+CREATE VIEW v1 AS SELECT id, val FROM t1 WHERE val >= 1 AND val <= 5 WITH CHECK OPTION;
+INSERT INTO v1 (val) VALUES (2);
+INSERT INTO v1 (val) VALUES (4);
+-- error 1369
+INSERT INTO v1 (val) VALUES (6);
+-- error 1369
+UPDATE v1 SET val=6 WHERE id=2;
+DROP VIEW v1;
+DROP TABLE t1;
+
 --echo End of 5.0 tests.
Thread
bk commit into 5.1 tree (holyfoot:1.2337)holyfoot29 Sep