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
6d4b0958
Commit
6d4b0958
authored
Dec 07, 2017
by
Monty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing test mysql_client_test
Backported patch from 10.3 that allows one to remove short .frm files
parent
bce40651
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
sql/datadict.cc
sql/datadict.cc
+18
-15
No files found.
sql/datadict.cc
View file @
6d4b0958
...
...
@@ -72,33 +72,36 @@ Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name,
if
((
file
=
mysql_file_open
(
key_file_frm
,
path
,
O_RDONLY
|
O_SHARE
,
MYF
(
0
)))
<
0
)
DBUG_RETURN
(
TABLE_TYPE_UNKNOWN
);
error
=
mysql_file_read
(
file
,
(
uchar
*
)
header
,
sizeof
(
header
),
MYF
(
MY_NABP
));
if
(
error
)
/*
We return TABLE_TYPE_NORMAL if we can open the .frm file. This allows us
to drop a bad .frm file with DROP TABLE
*/
type
=
TABLE_TYPE_NORMAL
;
/*
Initialize engine name in case we are not able to find it out
The cast is safe, as engine_name->str points to a usable buffer.
*/
if
(
engine_name
)
{
engine_name
->
length
=
0
;
((
char
*
)
(
engine_name
->
str
))[
0
]
=
0
;
}
if
((
error
=
mysql_file_read
(
file
,
(
uchar
*
)
header
,
sizeof
(
header
),
MYF
(
MY_NABP
))))
goto
err
;
if
(
!
strncmp
((
char
*
)
header
,
"TYPE=VIEW
\n
"
,
10
))
{
type
=
TABLE_TYPE_VIEW
;
goto
err
;
}
/*
We return TABLE_TYPE_NORMAL if we can read the .frm file. This allows us
to drop a bad .frm file with DROP TABLE
*/
type
=
TABLE_TYPE_NORMAL
;
/* engine_name is 0 if we only want to know if table is view or not */
if
(
!
engine_name
)
goto
err
;
/*
Initialize engine name in case we are not able to find it out
The cast is safe, as engine_name->str points to a usable buffer.
*/
engine_name
->
length
=
0
;
((
char
*
)
(
engine_name
->
str
))[
0
]
=
0
;
if
(
!
is_binary_frm_header
(
header
))
goto
err
;
...
...
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