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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
1bd699e0
Commit
1bd699e0
authored
Oct 21, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
value should be checked after 'before' trigger work (BUG#5992)
parent
73e4ac71
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
9 deletions
+34
-9
mysql-test/r/view.result
mysql-test/r/view.result
+11
-0
mysql-test/t/view.test
mysql-test/t/view.test
+14
-0
sql/sql_insert.cc
sql/sql_insert.cc
+9
-9
No files found.
mysql-test/r/view.result
View file @
1bd699e0
...
...
@@ -1547,3 +1547,14 @@ s1
3
drop view v1;
drop table t1;
create table t1 (s1 tinyint);
create trigger t1_bi before insert on t1 for each row set new.s1 = 500;
create view v1 as select * from t1 where s1 <> 127 with check option;
insert into v1 values (0);
ERROR HY000: CHECK OPTION failed 'test.v1'
select * from v1;
s1
select * from t1;
s1
drop view v1;
drop table t1;
mysql-test/t/view.test
View file @
1bd699e0
...
...
@@ -1497,3 +1497,17 @@ select * from t1;
drop
view
v1
;
drop
table
t1
;
#
# changing value by trigger and CHECK OPTION
#
create
table
t1
(
s1
tinyint
);
create
trigger
t1_bi
before
insert
on
t1
for
each
row
set
new
.
s1
=
500
;
create
view
v1
as
select
*
from
t1
where
s1
<>
127
with
check
option
;
--
error
1369
insert
into
v1
values
(
0
);
select
*
from
v1
;
select
*
from
t1
;
drop
view
v1
;
drop
table
t1
;
sql/sql_insert.cc
View file @
1bd699e0
...
...
@@ -319,6 +319,15 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
break
;
}
}
/*
FIXME: Actually we should do this before
check_that_all_fields_are_given_values Or even go into write_record ?
*/
if
(
table
->
triggers
)
table
->
triggers
->
process_triggers
(
thd
,
TRG_EVENT_INSERT
,
TRG_ACTION_BEFORE
);
if
((
res
=
table_list
->
view_check_option
(
thd
,
(
values_list
.
elements
==
1
?
0
:
...
...
@@ -330,15 +339,6 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
error
=
1
;
break
;
}
/*
FIXME: Actually we should do this before
check_that_all_fields_are_given_values Or even go into write_record ?
*/
if
(
table
->
triggers
)
table
->
triggers
->
process_triggers
(
thd
,
TRG_EVENT_INSERT
,
TRG_ACTION_BEFORE
);
#ifndef EMBEDDED_LIBRARY
if
(
lock_type
==
TL_WRITE_DELAYED
)
{
...
...
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