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
ea3388f2
Commit
ea3388f2
authored
Aug 02, 2007
by
kostja@bodhi.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test case for Bug#5719 "impossible to lock VIEW".
It has been possible to lock a view in 5.1 for some time.
parent
24595580
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
0 deletions
+135
-0
mysql-test/r/lock.result
mysql-test/r/lock.result
+70
-0
mysql-test/t/lock.test
mysql-test/t/lock.test
+65
-0
No files found.
mysql-test/r/lock.result
View file @
ea3388f2
...
...
@@ -96,4 +96,74 @@ ERROR HY000: You can't combine write-locking of system tables with other tables
LOCK TABLES mysql.time_zone READ, mysql.proc WRITE;
ERROR HY000: You can't combine write-locking of system tables with other tables or lock types
DROP TABLE t1;
Bug#5719 impossible to lock VIEW
Just covering existing behaviour with tests.
Consistency has not been found here.
drop view if exists v_bug5719;
drop table if exists t1, t2, t3;
create table t1 (a int);
create temporary table t2 (a int);
create table t3 (a int);
create view v_bug5719 as select 1;
lock table v_bug5719 write;
select * from t1;
ERROR HY000: Table 't1' was not locked with LOCK TABLES
Allowed to select from a temporary talbe under LOCK TABLES
select * from t2;
a
select * from t3;
ERROR HY000: Table 't3' was not locked with LOCK TABLES
select * from v_bug5719;
1
1
drop view v_bug5719;
sic: did not left LOCK TABLES mode automatically
select * from t1;
ERROR HY000: Table 't1' was not locked with LOCK TABLES
unlock tables;
create view v_bug5719 as select * from t1;
lock tables v_bug5719 write;
select * from v_bug5719;
a
Allowed to use an underlying table under LOCK TABLES <view>
select * from t1;
a
Allowed to select from a temporary table under LOCK TABLES
select * from t2;
a
select * from t3;
ERROR HY000: Table 't3' was not locked with LOCK TABLES
drop table t1;
sic: left LOCK TABLES mode
select * from t3;
a
select * from v_bug5719;
ERROR HY000: View 'test.v_bug5719' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
unlock tables;
drop view v_bug5719;
When limitation to use temporary tables in views is removed, please
add a test that shows what happens under LOCK TABLES when a view
references a temporary table, is locked, and the underlying table
is dropped.
create view v_bug5719 as select * from t2;
ERROR HY000: View's SELECT refers to a temporary table 't2'
Cleanup.
drop table t2, t3;
End of 5.1 tests.
mysql-test/t/lock.test
View file @
ea3388f2
...
...
@@ -148,5 +148,70 @@ LOCK TABLES mysql.time_zone READ, mysql.proc WRITE;
DROP
TABLE
t1
;
--
echo
--
echo
Bug
#5719 impossible to lock VIEW
--
echo
--
echo
Just
covering
existing
behaviour
with
tests
.
--
echo
Consistency
has
not
been
found
here
.
--
echo
--
disable_warnings
drop
view
if
exists
v_bug5719
;
drop
table
if
exists
t1
,
t2
,
t3
;
--
enable_warnings
create
table
t1
(
a
int
);
create
temporary
table
t2
(
a
int
);
create
table
t3
(
a
int
);
create
view
v_bug5719
as
select
1
;
lock
table
v_bug5719
write
;
--
error
ER_TABLE_NOT_LOCKED
select
*
from
t1
;
--
echo
--
echo
Allowed
to
select
from
a
temporary
talbe
under
LOCK
TABLES
--
echo
select
*
from
t2
;
--
error
ER_TABLE_NOT_LOCKED
select
*
from
t3
;
select
*
from
v_bug5719
;
drop
view
v_bug5719
;
--
echo
--
echo
sic
:
did
not
left
LOCK
TABLES
mode
automatically
--
echo
--
error
ER_TABLE_NOT_LOCKED
select
*
from
t1
;
unlock
tables
;
create
view
v_bug5719
as
select
*
from
t1
;
lock
tables
v_bug5719
write
;
select
*
from
v_bug5719
;
--
echo
--
echo
Allowed
to
use
an
underlying table under LOCK TABLES <view>
--echo
select * from t1
;
--
echo
--
echo
Allowed
to
select
from
a
temporary
table
under
LOCK
TABLES
--
echo
select
*
from
t2
;
--
error
ER_TABLE_NOT_LOCKED
select
*
from
t3
;
drop
table
t1
;
--
echo
--
echo
sic
:
left
LOCK
TABLES
mode
--
echo
select
*
from
t3
;
--
error
ER_VIEW_INVALID
select
*
from
v_bug5719
;
unlock
tables
;
drop
view
v_bug5719
;
--
echo
--
echo
When
limitation
to
use
temporary
tables in views is removed, please
--echo add a test that shows what happens under LOCK TABLES when a view
--echo references a temporary table, is locked, and the underlying table
--echo is dropped.
--echo
--error ER_VIEW_SELECT_TMPTABLE
create view v_bug5719
as
select
* from t2
;
--
echo
--
echo
Cleanup
.
--
echo
drop
table
t2
,
t3
;
--
echo
End
of
5.1
tests
.
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