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
c4479b1d
Commit
c4479b1d
authored
Oct 16, 2009
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
7b4ef910
f7d759ac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
3 deletions
+46
-3
mysql-test/r/view_grant.result
mysql-test/r/view_grant.result
+19
-0
mysql-test/t/view_grant.test
mysql-test/t/view_grant.test
+26
-0
mysys/mf_keycache.c
mysys/mf_keycache.c
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+0
-2
No files found.
mysql-test/r/view_grant.result
View file @
c4479b1d
...
@@ -1218,3 +1218,22 @@ Warnings:
...
@@ -1218,3 +1218,22 @@ Warnings:
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
DROP TABLE t1;
DROP TABLE t1;
DROP VIEW v1;
DROP VIEW v1;
#
# Bug #46019: ERROR 1356 When selecting from within another
# view that has Group By
#
CREATE DATABASE mysqltest1;
USE mysqltest1;
CREATE TABLE t1 (a INT);
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT a FROM t1 GROUP BY a;
CREATE SQL SECURITY INVOKER VIEW v2 AS SELECT a FROM v1;
CREATE USER mysqluser1;
GRANT SELECT ON TABLE t1 TO mysqluser1;
GRANT SELECT, SHOW VIEW ON TABLE v1 TO mysqluser1;
GRANT SELECT, SHOW VIEW ON TABLE v2 TO mysqluser1;
SELECT a FROM v1;
a
SELECT a FROM v2;
a
DROP USER mysqluser1;
DROP DATABASE mysqltest1;
mysql-test/t/view_grant.test
View file @
c4479b1d
...
@@ -1506,3 +1506,29 @@ DROP VIEW v1;
...
@@ -1506,3 +1506,29 @@ DROP VIEW v1;
# Wait till we reached the initial number of concurrent sessions
# Wait till we reached the initial number of concurrent sessions
--
source
include
/
wait_until_count_sessions
.
inc
--
source
include
/
wait_until_count_sessions
.
inc
--
echo
#
--
echo
# Bug #46019: ERROR 1356 When selecting from within another
--
echo
# view that has Group By
--
echo
#
CREATE
DATABASE
mysqltest1
;
USE
mysqltest1
;
CREATE
TABLE
t1
(
a
INT
);
CREATE
SQL
SECURITY
INVOKER
VIEW
v1
AS
SELECT
a
FROM
t1
GROUP
BY
a
;
CREATE
SQL
SECURITY
INVOKER
VIEW
v2
AS
SELECT
a
FROM
v1
;
CREATE
USER
mysqluser1
;
GRANT
SELECT
ON
TABLE
t1
TO
mysqluser1
;
GRANT
SELECT
,
SHOW
VIEW
ON
TABLE
v1
TO
mysqluser1
;
GRANT
SELECT
,
SHOW
VIEW
ON
TABLE
v2
TO
mysqluser1
;
--
connect
(
mysqluser1
,
localhost
,
mysqluser1
,,
mysqltest1
)
SELECT
a
FROM
v1
;
SELECT
a
FROM
v2
;
--
connection
default
--
disconnect
mysqluser1
DROP
USER
mysqluser1
;
DROP
DATABASE
mysqltest1
;
mysys/mf_keycache.c
View file @
c4479b1d
...
@@ -1729,7 +1729,7 @@ restart:
...
@@ -1729,7 +1729,7 @@ restart:
- block assigned but not yet read from file (invalid data).
- block assigned but not yet read from file (invalid data).
*/
*/
#if THREAD
#if
def
THREAD
if
(
keycache
->
in_resize
)
if
(
keycache
->
in_resize
)
{
{
/* This is a request during a resize operation */
/* This is a request during a resize operation */
...
...
sql/sql_parse.cc
View file @
c4479b1d
...
@@ -5090,8 +5090,6 @@ bool check_single_table_access(THD *thd, ulong privilege,
...
@@ -5090,8 +5090,6 @@ bool check_single_table_access(THD *thd, ulong privilege,
/* Show only 1 table for check_grant */
/* Show only 1 table for check_grant */
if
(
!
(
all_tables
->
belong_to_view
&&
if
(
!
(
all_tables
->
belong_to_view
&&
(
thd
->
lex
->
sql_command
==
SQLCOM_SHOW_FIELDS
))
&&
(
thd
->
lex
->
sql_command
==
SQLCOM_SHOW_FIELDS
))
&&
!
(
all_tables
->
view
&&
all_tables
->
effective_algorithm
==
VIEW_ALGORITHM_TMPTABLE
)
&&
check_grant
(
thd
,
privilege
,
all_tables
,
0
,
1
,
no_errors
))
check_grant
(
thd
,
privilege
,
all_tables
,
0
,
1
,
no_errors
))
goto
deny
;
goto
deny
;
...
...
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