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
73e4ac71
Commit
73e4ac71
authored
Oct 21, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inserting single value with check option failed always get error (part of BUG#5995)
parent
05af0c26
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
mysql-test/r/view.result
mysql-test/r/view.result
+12
-0
mysql-test/t/view.test
mysql-test/t/view.test
+15
-0
sql/sql_insert.cc
sql/sql_insert.cc
+4
-1
No files found.
mysql-test/r/view.result
View file @
73e4ac71
...
@@ -1535,3 +1535,15 @@ insert into v2 values (0);
...
@@ -1535,3 +1535,15 @@ insert into v2 values (0);
ERROR HY000: CHECK OPTION failed 'test.v2'
ERROR HY000: CHECK OPTION failed 'test.v2'
drop view v2, v1;
drop view v2, v1;
drop table t1;
drop table t1;
create table t1 (s1 int);
create view v1 as select * from t1 where s1 < 5 with check option;
insert ignore into v1 values (6);
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (6),(3);
Warnings:
Error 1369 CHECK OPTION failed 'test.v1'
select * from t1;
s1
3
drop view v1;
drop table t1;
mysql-test/t/view.test
View file @
73e4ac71
...
@@ -1482,3 +1482,18 @@ create view v2 as select * from v1 with cascaded check option;
...
@@ -1482,3 +1482,18 @@ create view v2 as select * from v1 with cascaded check option;
insert
into
v2
values
(
0
);
insert
into
v2
values
(
0
);
drop
view
v2
,
v1
;
drop
view
v2
,
v1
;
drop
table
t1
;
drop
table
t1
;
#
# inserting single value with check option failed always get error
#
create
table
t1
(
s1
int
);
create
view
v1
as
select
*
from
t1
where
s1
<
5
with
check
option
;
#single value
--
error
1369
insert
ignore
into
v1
values
(
6
);
#several values
insert
ignore
into
v1
values
(
6
),(
3
);
select
*
from
t1
;
drop
view
v1
;
drop
table
t1
;
sql/sql_insert.cc
View file @
73e4ac71
...
@@ -319,7 +319,10 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
...
@@ -319,7 +319,10 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
break
;
break
;
}
}
}
}
if
((
res
=
table_list
->
view_check_option
(
thd
,
ignore_err
))
==
if
((
res
=
table_list
->
view_check_option
(
thd
,
(
values_list
.
elements
==
1
?
0
:
ignore_err
)))
==
VIEW_CHECK_SKIP
)
VIEW_CHECK_SKIP
)
continue
;
continue
;
else
if
(
res
==
VIEW_CHECK_ERROR
)
else
if
(
res
==
VIEW_CHECK_ERROR
)
...
...
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