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
3ce315ce
Commit
3ce315ce
authored
May 07, 2005
by
gluh@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/gluh/MySQL/Bugs/5.0.10261
parents
fa8673a6
f6bf2680
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
2 deletions
+35
-2
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+14
-0
mysql-test/t/information_schema.test
mysql-test/t/information_schema.test
+13
-0
sql/sql_show.cc
sql/sql_show.cc
+8
-2
No files found.
mysql-test/r/information_schema.result
View file @
3ce315ce
...
...
@@ -734,3 +734,17 @@ x_real NULL NULL
x_float NULL NULL
x_double_precision NULL NULL
drop table t1;
create user mysqltest_4@localhost;
SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME='TABLE_NAME';
TABLE_NAME COLUMN_NAME PRIVILEGES
TABLES TABLE_NAME select
COLUMNS TABLE_NAME select
STATISTICS TABLE_NAME select
VIEWS TABLE_NAME select
TABLE_PRIVILEGES TABLE_NAME select
COLUMN_PRIVILEGES TABLE_NAME select
TABLE_CONSTRAINTS TABLE_NAME select
KEY_COLUMN_USAGE TABLE_NAME select
delete from mysql.user where user='mysqltest_4';
flush privileges;
mysql-test/t/information_schema.test
View file @
3ce315ce
...
...
@@ -473,3 +473,16 @@ SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
't1'
;
drop
table
t1
;
#
# Bug#10261 INFORMATION_SCHEMA.COLUMNS, incomplete result for non root user
#
create
user
mysqltest_4
@
localhost
;
connect
(
user4
,
localhost
,
mysqltest_4
,,);
connection
user4
;
SELECT
TABLE_NAME
,
COLUMN_NAME
,
PRIVILEGES
FROM
INFORMATION_SCHEMA
.
COLUMNS
where
COLUMN_NAME
=
'TABLE_NAME'
;
connection
default
;
delete
from
mysql
.
user
where
user
=
'mysqltest_4'
;
flush
privileges
;
sql/sql_show.cc
View file @
3ce315ce
...
...
@@ -2306,7 +2306,8 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
col_access
=
get_column_grant
(
thd
,
&
tables
->
grant
,
base_name
,
file_name
,
field
->
field_name
)
&
COL_ACLS
;
if
(
lex
->
orig_sql_command
!=
SQLCOM_SHOW_FIELDS
&&
!
col_access
)
if
(
lex
->
orig_sql_command
!=
SQLCOM_SHOW_FIELDS
&&
!
tables
->
schema_table
&&
!
col_access
)
continue
;
for
(
uint
bitnr
=
0
;
col_access
;
col_access
>>=
1
,
bitnr
++
)
{
...
...
@@ -2319,7 +2320,12 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
#else
*
end
=
0
;
#endif
table
->
field
[
17
]
->
store
(
tmp
+
1
,
end
==
tmp
?
0
:
(
uint
)
(
end
-
tmp
-
1
),
cs
);
if
(
tables
->
schema_table
)
// any user has 'select' privilege on all
// I_S table columns
table
->
field
[
17
]
->
store
(
grant_types
.
type_names
[
0
],
strlen
(
grant_types
.
type_names
[
0
]),
cs
);
else
table
->
field
[
17
]
->
store
(
tmp
+
1
,
end
==
tmp
?
0
:
(
uint
)
(
end
-
tmp
-
1
),
cs
);
table
->
field
[
1
]
->
store
(
base_name
,
strlen
(
base_name
),
cs
);
table
->
field
[
2
]
->
store
(
file_name
,
strlen
(
file_name
),
cs
);
...
...
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