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
75b9184c
Commit
75b9184c
authored
Aug 09, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysqldev@production.mysql.com:/data0/mysqldev/my/mysql-5.1-release
into janus.mylan:/usr/home/serg/Abk/mysql-5.1
parents
fc0241bc
082d2127
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
39 deletions
+89
-39
sql/sql_show.cc
sql/sql_show.cc
+55
-34
sql/unireg.h
sql/unireg.h
+34
-5
No files found.
sql/sql_show.cc
View file @
75b9184c
...
@@ -2952,49 +2952,70 @@ static int fill_schema_table_from_frm(THD *thd,TABLE *table,
...
@@ -2952,49 +2952,70 @@ static int fill_schema_table_from_frm(THD *thd,TABLE *table,
LEX_STRING
*
table_name
,
LEX_STRING
*
table_name
,
enum
enum_schema_tables
schema_table_idx
)
enum
enum_schema_tables
schema_table_idx
)
{
{
TABLE_SHARE
share
;
TABLE_SHARE
*
share
;
TABLE
tbl
;
TABLE
tbl
;
TABLE_LIST
table_list
;
TABLE_LIST
table_list
;
char
path
[
FN_REFLEN
];
uint
res
=
0
;
uint
res
;
int
error
;
char
key
[
MAX_DBKEY_LENGTH
];
uint
key_length
;
bzero
((
char
*
)
&
table_list
,
sizeof
(
TABLE_LIST
));
bzero
((
char
*
)
&
table_list
,
sizeof
(
TABLE_LIST
));
bzero
((
char
*
)
&
tbl
,
sizeof
(
TABLE
));
bzero
((
char
*
)
&
tbl
,
sizeof
(
TABLE
));
(
void
)
build_table_filename
(
path
,
sizeof
(
path
),
db_name
->
str
,
table_name
->
str
,
""
,
0
);
table_list
.
table_name
=
table_name
->
str
;
init_tmp_table_share
(
&
share
,
""
,
0
,
""
,
path
);
table_list
.
db
=
db_name
->
str
;
if
(
!
(
res
=
open_table_def
(
thd
,
&
share
,
OPEN_VIEW
)))
key_length
=
create_table_def_key
(
thd
,
key
,
&
table_list
,
0
);
pthread_mutex_lock
(
&
LOCK_open
);
share
=
get_table_share
(
thd
,
&
table_list
,
key
,
key_length
,
OPEN_VIEW
,
&
error
);
if
(
!
share
)
{
{
share
.
tmp_table
=
NO_TMP_TABLE
;
res
=
0
;
tbl
.
s
=
&
share
;
goto
err
;
table_list
.
table
=
&
tbl
;
}
if
(
schema_table
->
i_s_requested_object
&
OPEN_TABLE_FROM_SHARE
)
if
(
share
->
is_view
)
{
if
(
schema_table
->
i_s_requested_object
&
OPEN_TABLE_ONLY
)
{
{
if
(
share
.
is_view
||
/* skip view processing */
open_table_from_share
(
thd
,
&
share
,
table_name
->
str
,
0
,
res
=
0
;
(
READ_KEYINFO
|
COMPUTE_TYPES
|
goto
err1
;
EXTRA_RECORD
|
OPEN_FRM_FILE_ONLY
),
}
thd
->
open_options
,
&
tbl
,
FALSE
)
)
else
if
(
schema_table
->
i_s_requested_object
&
OPEN_VIEW_FULL
)
{
{
share
.
tmp_table
=
INTERNAL_TMP_TABLE
;
/*
free_table_share
(
&
share
);
tell get_all_tables() to fall back to
return
(
share
.
is_view
&&
open_normal_and_derived_tables()
!
(
schema_table
->
i_s_requested_object
&
*/
~
(
OPEN_TABLE_FROM_SHARE
|
OPTIMIZE_I_S_TABLE
)))
;
res
=
1
;
}
goto
err1
;
}
}
table_list
.
view
=
(
st_lex
*
)
share
.
is_view
;
}
if
(
share
->
is_view
||
!
open_table_from_share
(
thd
,
share
,
table_name
->
str
,
0
,
(
READ_KEYINFO
|
COMPUTE_TYPES
|
EXTRA_RECORD
|
OPEN_FRM_FILE_ONLY
),
thd
->
open_options
,
&
tbl
,
FALSE
))
{
tbl
.
s
=
share
;
table_list
.
table
=
&
tbl
;
table_list
.
view
=
(
st_lex
*
)
share
->
is_view
;
res
=
schema_table
->
process_table
(
thd
,
&
table_list
,
table
,
res
=
schema_table
->
process_table
(
thd
,
&
table_list
,
table
,
res
,
db_name
,
table_name
);
res
,
db_name
,
table_name
);
share
.
tmp_table
=
INTERNAL_TMP_TABLE
;
closefrm
(
&
tbl
,
true
);
if
(
schema_table
->
i_s_requested_object
&
OPEN_TABLE_FROM_SHARE
)
goto
err
;
closefrm
(
&
tbl
,
true
);
else
free_table_share
(
&
share
);
}
}
if
(
res
)
err1:
thd
->
clear_error
();
release_table_share
(
share
,
RELEASE_NORMAL
);
return
0
;
err:
pthread_mutex_unlock
(
&
LOCK_open
);
thd
->
clear_error
();
return
res
;
}
}
...
@@ -6398,7 +6419,7 @@ ST_SCHEMA_TABLE schema_tables[]=
...
@@ -6398,7 +6419,7 @@ ST_SCHEMA_TABLE schema_tables[]=
create_schema_table
,
fill_schema_coll_charset_app
,
0
,
0
,
-
1
,
-
1
,
0
,
0
},
create_schema_table
,
fill_schema_coll_charset_app
,
0
,
0
,
-
1
,
-
1
,
0
,
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
,
0
,
get_all_tables
,
make_columns_old_format
,
get_schema_column_record
,
1
,
2
,
0
,
OP
EN_TABLE_FROM_SHARE
|
OPTIMIZE_I_S_TABLE
},
OP
TIMIZE_I_S_TABLE
|
OPEN_VIEW_FULL
},
{
"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
,
0
,
0
},
fill_schema_column_privileges
,
0
,
0
,
-
1
,
-
1
,
0
,
0
},
{
"ENGINES"
,
engines_fields_info
,
create_schema_table
,
{
"ENGINES"
,
engines_fields_info
,
create_schema_table
,
...
@@ -6437,7 +6458,7 @@ ST_SCHEMA_TABLE schema_tables[]=
...
@@ -6437,7 +6458,7 @@ ST_SCHEMA_TABLE schema_tables[]=
fill_variables
,
make_old_format
,
0
,
-
1
,
-
1
,
0
,
0
},
fill_variables
,
make_old_format
,
0
,
-
1
,
-
1
,
0
,
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
,
0
,
get_all_tables
,
make_old_format
,
get_schema_stat_record
,
1
,
2
,
0
,
OPEN_TABLE_ONLY
|
OP
EN_TABLE_FROM_SHARE
|
OP
TIMIZE_I_S_TABLE
},
OPEN_TABLE_ONLY
|
OPTIMIZE_I_S_TABLE
},
{
"STATUS"
,
variables_fields_info
,
create_schema_table
,
fill_status
,
{
"STATUS"
,
variables_fields_info
,
create_schema_table
,
fill_status
,
make_old_format
,
0
,
-
1
,
-
1
,
1
,
0
},
make_old_format
,
0
,
-
1
,
-
1
,
1
,
0
},
{
"TABLES"
,
tables_fields_info
,
create_schema_table
,
{
"TABLES"
,
tables_fields_info
,
create_schema_table
,
...
...
sql/unireg.h
View file @
75b9184c
...
@@ -153,11 +153,40 @@
...
@@ -153,11 +153,40 @@
#define OPEN_VIEW 8192
/* Allow open on view */
#define OPEN_VIEW 8192
/* Allow open on view */
#define OPEN_VIEW_NO_PARSE 16384
/* Open frm only if it's a view,
#define OPEN_VIEW_NO_PARSE 16384
/* Open frm only if it's a view,
but do not parse view itself */
but do not parse view itself */
#define OPEN_FRM_FILE_ONLY 32768
/* Open frm file only */
/*
#define OPEN_TABLE_ONLY OPEN_FRM_FILE_ONLY*2
/* Open view only */
This flag is used in function get_all_tables() which fills
#define OPEN_VIEW_ONLY OPEN_TABLE_ONLY*2
/* Open table only */
I_S tables with data which are retrieved from frm files and storage engine
#define OPEN_TABLE_FROM_SHARE OPEN_VIEW_ONLY*2
/* For I_S tables*/
The flag means that we need to open FRM file only to get necessary data.
#define OPTIMIZE_I_S_TABLE OPEN_TABLE_FROM_SHARE*2
/* For I_S tables*/
*/
#define OPEN_FRM_FILE_ONLY 32768
/*
This flag is used in function get_all_tables() which fills
I_S tables with data which are retrieved from frm files and storage engine
The flag means that we need to process tables only to get necessary data.
Views are not processed.
*/
#define OPEN_TABLE_ONLY OPEN_FRM_FILE_ONLY*2
/*
This flag is used in function get_all_tables() which fills
I_S tables with data which are retrieved from frm files and storage engine
The flag means that we need to process views only to get necessary data.
Tables are not processed.
*/
#define OPEN_VIEW_ONLY OPEN_TABLE_ONLY*2
/*
This flag is used in function get_all_tables() which fills
I_S tables with data which are retrieved from frm files and storage engine.
The flag means that we need to open a view using
open_normal_and_derived_tables() function.
*/
#define OPEN_VIEW_FULL OPEN_VIEW_ONLY*2
/*
This flag is used in function get_all_tables() which fills
I_S tables with data which are retrieved from frm files and storage engine.
The flag means that I_S table uses optimization algorithm.
*/
#define OPTIMIZE_I_S_TABLE OPEN_VIEW_FULL*2
#define SC_INFO_LENGTH 4
/* Form format constant */
#define SC_INFO_LENGTH 4
/* Form format constant */
#define TE_INFO_LENGTH 3
#define TE_INFO_LENGTH 3
#define MTYP_NOEMPTY_BIT 128
#define MTYP_NOEMPTY_BIT 128
...
...
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