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
a70ab653
Commit
a70ab653
authored
Dec 18, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #7213: information_schema: redundant non-standard TABLE_NAMES table
parent
7c590f33
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
23 deletions
+31
-23
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+2
-5
mysql-test/t/information_schema.test
mysql-test/t/information_schema.test
+6
-0
sql/sql_parse.cc
sql/sql_parse.cc
+3
-1
sql/sql_show.cc
sql/sql_show.cc
+19
-17
sql/table.h
sql/table.h
+1
-0
No files found.
mysql-test/r/information_schema.result
View file @
a70ab653
...
@@ -49,7 +49,6 @@ TABLE_PRIVILEGES
...
@@ -49,7 +49,6 @@ TABLE_PRIVILEGES
COLUMN_PRIVILEGES
COLUMN_PRIVILEGES
TABLE_CONSTRAINTS
TABLE_CONSTRAINTS
KEY_COLUMN_USAGE
KEY_COLUMN_USAGE
TABLE_NAMES
columns_priv
columns_priv
db
db
func
func
...
@@ -78,7 +77,6 @@ c table_name
...
@@ -78,7 +77,6 @@ c table_name
TABLES TABLES
TABLES TABLES
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_NAMES TABLE_NAMES
tables_priv tables_priv
tables_priv tables_priv
time_zone time_zone
time_zone time_zone
time_zone_leap_second time_zone_leap_second
time_zone_leap_second time_zone_leap_second
...
@@ -96,7 +94,6 @@ c table_name
...
@@ -96,7 +94,6 @@ c table_name
TABLES TABLES
TABLES TABLES
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_NAMES TABLE_NAMES
tables_priv tables_priv
tables_priv tables_priv
time_zone time_zone
time_zone time_zone
time_zone_leap_second time_zone_leap_second
time_zone_leap_second time_zone_leap_second
...
@@ -577,7 +574,6 @@ Tables_in_information_schema (T%) Table_type
...
@@ -577,7 +574,6 @@ Tables_in_information_schema (T%) Table_type
TABLES TEMPORARY
TABLES TEMPORARY
TABLE_PRIVILEGES TEMPORARY
TABLE_PRIVILEGES TEMPORARY
TABLE_CONSTRAINTS TEMPORARY
TABLE_CONSTRAINTS TEMPORARY
TABLE_NAMES TEMPORARY
create table t1(a int);
create table t1(a int);
ERROR 42S02: Unknown table 't1' in information_schema
ERROR 42S02: Unknown table 't1' in information_schema
use test;
use test;
...
@@ -589,7 +585,6 @@ Tables_in_information_schema (T%)
...
@@ -589,7 +585,6 @@ Tables_in_information_schema (T%)
TABLES
TABLES
TABLE_PRIVILEGES
TABLE_PRIVILEGES
TABLE_CONSTRAINTS
TABLE_CONSTRAINTS
TABLE_NAMES
select table_name from tables where table_name='user';
select table_name from tables where table_name='user';
table_name
table_name
user
user
...
@@ -644,3 +639,5 @@ constraint_name
...
@@ -644,3 +639,5 @@ constraint_name
drop view t2;
drop view t2;
drop view t3;
drop view t3;
drop table t4;
drop table t4;
select * from information_schema.table_names;
ERROR 42S02: Unknown table 'table_names' in information_schema
mysql-test/t/information_schema.test
View file @
a70ab653
...
@@ -325,3 +325,9 @@ where table_schema='test';
...
@@ -325,3 +325,9 @@ where table_schema='test';
drop
view
t2
;
drop
view
t2
;
drop
view
t3
;
drop
view
t3
;
drop
table
t4
;
drop
table
t4
;
#
# Bug#7213: information_schema: redundant non-standard TABLE_NAMES table
#
--
error
1109
select
*
from
information_schema
.
table_names
;
sql/sql_parse.cc
View file @
a70ab653
...
@@ -5280,7 +5280,9 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
...
@@ -5280,7 +5280,9 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
information_schema_name
.
str
))
information_schema_name
.
str
))
{
{
ST_SCHEMA_TABLE
*
schema_table
=
find_schema_table
(
thd
,
ptr
->
real_name
);
ST_SCHEMA_TABLE
*
schema_table
=
find_schema_table
(
thd
,
ptr
->
real_name
);
if
(
!
schema_table
)
if
(
!
schema_table
||
(
schema_table
->
hidden
&&
lex
->
orig_sql_command
==
SQLCOM_END
))
// not a 'show' command
{
{
my_error
(
ER_UNKNOWN_TABLE
,
MYF
(
0
),
my_error
(
ER_UNKNOWN_TABLE
,
MYF
(
0
),
ptr
->
real_name
,
information_schema_name
.
str
);
ptr
->
real_name
,
information_schema_name
.
str
);
...
...
sql/sql_show.cc
View file @
a70ab653
...
@@ -1976,6 +1976,8 @@ int schema_tables_add(THD *thd, List<char> *files, const char *wild)
...
@@ -1976,6 +1976,8 @@ int schema_tables_add(THD *thd, List<char> *files, const char *wild)
ST_SCHEMA_TABLE
*
tmp_schema_table
=
schema_tables
;
ST_SCHEMA_TABLE
*
tmp_schema_table
=
schema_tables
;
for
(
;
tmp_schema_table
->
table_name
;
tmp_schema_table
++
)
for
(
;
tmp_schema_table
->
table_name
;
tmp_schema_table
++
)
{
{
if
(
tmp_schema_table
->
hidden
)
continue
;
if
(
wild
)
if
(
wild
)
{
{
if
(
lower_case_table_names
)
if
(
lower_case_table_names
)
...
@@ -3688,38 +3690,38 @@ ST_FIELD_INFO table_names_fields_info[]=
...
@@ -3688,38 +3690,38 @@ ST_FIELD_INFO table_names_fields_info[]=
ST_SCHEMA_TABLE
schema_tables
[]
=
ST_SCHEMA_TABLE
schema_tables
[]
=
{
{
{
"SCHEMATA"
,
schema_fields_info
,
create_schema_table
,
{
"SCHEMATA"
,
schema_fields_info
,
create_schema_table
,
fill_schema_shemata
,
make_schemata_old_format
,
0
,
1
,
-
1
},
fill_schema_shemata
,
make_schemata_old_format
,
0
,
1
,
-
1
,
0
},
{
"TABLES"
,
tables_fields_info
,
create_schema_table
,
{
"TABLES"
,
tables_fields_info
,
create_schema_table
,
get_all_tables
,
make_old_format
,
get_schema_tables_record
,
1
,
2
},
get_all_tables
,
make_old_format
,
get_schema_tables_record
,
1
,
2
,
0
},
{
"COLUMNS"
,
columns_fields_info
,
create_schema_table
,
{
"COLUMNS"
,
columns_fields_info
,
create_schema_table
,
get_all_tables
,
make_columns_old_format
,
get_schema_column_record
,
1
,
2
},
get_all_tables
,
make_columns_old_format
,
get_schema_column_record
,
1
,
2
,
0
},
{
"CHARACTER_SETS"
,
charsets_fields_info
,
create_schema_table
,
{
"CHARACTER_SETS"
,
charsets_fields_info
,
create_schema_table
,
fill_schema_charsets
,
make_character_sets_old_format
,
0
,
-
1
,
-
1
},
fill_schema_charsets
,
make_character_sets_old_format
,
0
,
-
1
,
-
1
,
0
},
{
"COLLATIONS"
,
collation_fields_info
,
create_schema_table
,
{
"COLLATIONS"
,
collation_fields_info
,
create_schema_table
,
fill_schema_collation
,
make_old_format
,
0
,
-
1
,
-
1
},
fill_schema_collation
,
make_old_format
,
0
,
-
1
,
-
1
,
0
},
{
"COLLATION_CHARACTER_SET_APPLICABILITY"
,
coll_charset_app_fields_info
,
{
"COLLATION_CHARACTER_SET_APPLICABILITY"
,
coll_charset_app_fields_info
,
create_schema_table
,
fill_schema_coll_charset_app
,
0
,
0
,
-
1
,
-
1
},
create_schema_table
,
fill_schema_coll_charset_app
,
0
,
0
,
-
1
,
-
1
,
0
},
{
"ROUTINES"
,
proc_fields_info
,
create_schema_table
,
{
"ROUTINES"
,
proc_fields_info
,
create_schema_table
,
fill_schema_proc
,
make_proc_old_format
,
0
,
-
1
,
-
1
},
fill_schema_proc
,
make_proc_old_format
,
0
,
-
1
,
-
1
,
0
},
{
"STATISTICS"
,
stat_fields_info
,
create_schema_table
,
{
"STATISTICS"
,
stat_fields_info
,
create_schema_table
,
get_all_tables
,
make_old_format
,
get_schema_stat_record
,
1
,
2
},
get_all_tables
,
make_old_format
,
get_schema_stat_record
,
1
,
2
,
0
},
{
"VIEWS"
,
view_fields_info
,
create_schema_table
,
{
"VIEWS"
,
view_fields_info
,
create_schema_table
,
get_all_tables
,
0
,
get_schema_views_record
,
1
,
2
},
get_all_tables
,
0
,
get_schema_views_record
,
1
,
2
,
0
},
{
"USER_PRIVILEGES"
,
user_privileges_fields_info
,
create_schema_table
,
{
"USER_PRIVILEGES"
,
user_privileges_fields_info
,
create_schema_table
,
fill_schema_user_privileges
,
0
,
0
,
-
1
,
-
1
},
fill_schema_user_privileges
,
0
,
0
,
-
1
,
-
1
,
0
},
{
"SCHEMA_PRIVILEGES"
,
schema_privileges_fields_info
,
create_schema_table
,
{
"SCHEMA_PRIVILEGES"
,
schema_privileges_fields_info
,
create_schema_table
,
fill_schema_schema_privileges
,
0
,
0
,
-
1
,
-
1
},
fill_schema_schema_privileges
,
0
,
0
,
-
1
,
-
1
,
0
},
{
"TABLE_PRIVILEGES"
,
table_privileges_fields_info
,
create_schema_table
,
{
"TABLE_PRIVILEGES"
,
table_privileges_fields_info
,
create_schema_table
,
fill_schema_table_privileges
,
0
,
0
,
-
1
,
-
1
},
fill_schema_table_privileges
,
0
,
0
,
-
1
,
-
1
,
0
},
{
"COLUMN_PRIVILEGES"
,
column_privileges_fields_info
,
create_schema_table
,
{
"COLUMN_PRIVILEGES"
,
column_privileges_fields_info
,
create_schema_table
,
fill_schema_column_privileges
,
0
,
0
,
-
1
,
-
1
},
fill_schema_column_privileges
,
0
,
0
,
-
1
,
-
1
,
0
},
{
"TABLE_CONSTRAINTS"
,
table_constraints_fields_info
,
create_schema_table
,
{
"TABLE_CONSTRAINTS"
,
table_constraints_fields_info
,
create_schema_table
,
get_all_tables
,
0
,
get_schema_constraints_record
,
3
,
4
},
get_all_tables
,
0
,
get_schema_constraints_record
,
3
,
4
,
0
},
{
"KEY_COLUMN_USAGE"
,
key_column_usage_fields_info
,
create_schema_table
,
{
"KEY_COLUMN_USAGE"
,
key_column_usage_fields_info
,
create_schema_table
,
get_all_tables
,
0
,
get_schema_key_column_usage_record
,
4
,
5
},
get_all_tables
,
0
,
get_schema_key_column_usage_record
,
4
,
5
,
0
},
{
"TABLE_NAMES"
,
table_names_fields_info
,
create_schema_table
,
{
"TABLE_NAMES"
,
table_names_fields_info
,
create_schema_table
,
get_all_tables
,
make_table_names_old_format
,
0
,
1
,
2
},
get_all_tables
,
make_table_names_old_format
,
0
,
1
,
2
,
1
},
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
};
};
...
...
sql/table.h
View file @
a70ab653
...
@@ -254,6 +254,7 @@ typedef struct st_schema_table
...
@@ -254,6 +254,7 @@ typedef struct st_schema_table
TABLE
*
table
,
bool
res
,
const
char
*
base_name
,
TABLE
*
table
,
bool
res
,
const
char
*
base_name
,
const
char
*
file_name
);
const
char
*
file_name
);
int
idx_field1
,
idx_field2
;
int
idx_field1
,
idx_field2
;
bool
hidden
;
}
ST_SCHEMA_TABLE
;
}
ST_SCHEMA_TABLE
;
...
...
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