Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b07168ba
Commit
b07168ba
authored
Sep 29, 2006
by
holyfoot/hf@deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/hf/work/16813/my50-16813
into mysql.com:/home/hf/work/16813/my51-16813
parents
fb077c0e
3474fc9a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
mysql-test/r/view.result
mysql-test/r/view.result
+10
-0
mysql-test/t/view.test
mysql-test/t/view.test
+15
-0
sql/table.cc
sql/table.cc
+3
-2
No files found.
mysql-test/r/view.result
View file @
b07168ba
...
...
@@ -2935,4 +2935,14 @@ id select_type table type possible_keys key key_len ref rows Extra
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.
mysql-test/t/view.test
View file @
b07168ba
...
...
@@ -2855,4 +2855,19 @@ EXPLAIN SELECT * FROM v1 t WHERE t.s1+1 < (SELECT MAX(t1.s1) FROM t1);
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
.
sql/table.cc
View file @
b07168ba
...
...
@@ -2775,12 +2775,13 @@ bool st_table_list::prep_where(THD *thd, Item **conds,
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment