diff options
author | unknown <gshchepa/uchum@gleb.loc> | 2007-05-30 12:21:39 +0500 |
---|---|---|
committer | unknown <gshchepa/uchum@gleb.loc> | 2007-05-30 12:21:39 +0500 |
commit | 94507ee756a36f98eb67d0ca09e4a1cb429a4a08 (patch) | |
tree | 2fd31510209f867f4c9d434c670aa5bcfc89ac64 /mysql-test/r/view.result | |
parent | c57d6f729db784d02a0d0d62f1f9d03ab22fcfda (diff) | |
download | mariadb-git-94507ee756a36f98eb67d0ca09e4a1cb429a4a08.tar.gz |
Fixed bug #28716.
The result of the CHECK OPTION condition evaluation over an
updated record and records of merged tables was arbitrary and
dependant on the order of records in the merged tables during
the execution of SELECT statement.
The CHECK OPTION expression was evaluated over expired record
buffers (with arbitrary data in the fields).
Rowids of tables used in the CHECK OPTION expression were
added to temporary table rows. The multi_update::do_updates()
method was modified to restore necessary record buffers
before evaluation of the CHECK OPTION condition.
sql/sql_class.h:
Fixed bug #29716.
The multi_update::unupdatable_check_opt_tables variable
has been added.
sql/sql_update.cc:
Fixed bug #29716.
Rowids of tables used in the CHECK OPTION expression were
added to temporary table rows. The multi_update::do_updates()
method was modified to restore necessary record buffers
before evaluation of the CHECK OPTION condition.
mysql-test/t/view.test:
Updated test case for bug #28716.
mysql-test/r/view.result:
Updated test case for bug #28716.
Diffstat (limited to 'mysql-test/r/view.result')
-rw-r--r-- | mysql-test/r/view.result | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 8d9d802949d..998bca751d0 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3367,4 +3367,21 @@ SHOW CREATE VIEW v1; View Create View v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(1.23456789 as decimal(8,0)) AS `col` DROP VIEW v1; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT, c INT DEFAULT 0); +INSERT INTO t1 (a) VALUES (1), (2); +INSERT INTO t2 (b) VALUES (1), (2); +CREATE VIEW v1 AS SELECT t2.b,t2.c FROM t1, t2 +WHERE t1.a=t2.b AND t2.b < 3 WITH CHECK OPTION; +SELECT * FROM v1; +b c +1 0 +2 0 +UPDATE v1 SET c=1 WHERE b=1; +SELECT * FROM v1; +b c +1 1 +2 0 +DROP VIEW v1; +DROP TABLE t1,t2; End of 5.0 tests. |