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
4fcff3d2
Commit
4fcff3d2
authored
May 04, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't rely on readdir() returning . and .. first
parent
8c2ce22e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
sql/sql_base.cc
sql/sql_base.cc
+7
-1
sql/sql_db.cc
sql/sql_db.cc
+6
-1
No files found.
sql/sql_base.cc
View file @
4fcff3d2
...
@@ -2255,9 +2255,15 @@ static void mysql_rm_tmp_tables(void)
...
@@ -2255,9 +2255,15 @@ static void mysql_rm_tmp_tables(void)
** Remove all SQLxxx tables from directory
** Remove all SQLxxx tables from directory
*/
*/
for
(
idx
=
2
;
idx
<
(
uint
)
dirp
->
number_off_files
;
idx
++
)
for
(
idx
=
0
;
idx
<
(
uint
)
dirp
->
number_off_files
;
idx
++
)
{
{
file
=
dirp
->
dir_entry
+
idx
;
file
=
dirp
->
dir_entry
+
idx
;
/* skiping . and .. */
if
(
file
->
name
[
0
]
==
'.'
&&
(
!
file
->
name
[
1
]
||
(
file
->
name
[
1
]
==
'.'
&&
!
file
->
name
[
2
])))
continue
;
if
(
!
bcmp
(
file
->
name
,
tmp_file_prefix
,
tmp_file_prefix_length
))
if
(
!
bcmp
(
file
->
name
,
tmp_file_prefix
,
tmp_file_prefix_length
))
{
{
sprintf
(
filePath
,
"%s%s"
,
mysql_tmpdir
,
file
->
name
);
/* purecov: inspected */
sprintf
(
filePath
,
"%s%s"
,
mysql_tmpdir
,
file
->
name
);
/* purecov: inspected */
...
...
sql/sql_db.cc
View file @
4fcff3d2
...
@@ -237,7 +237,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
...
@@ -237,7 +237,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
tot_list_next
=
&
tot_list
;
tot_list_next
=
&
tot_list
;
for
(
uint
idx
=
2
;
for
(
uint
idx
=
0
;
idx
<
(
uint
)
dirp
->
number_off_files
&&
!
thd
->
killed
;
idx
<
(
uint
)
dirp
->
number_off_files
&&
!
thd
->
killed
;
idx
++
)
idx
++
)
{
{
...
@@ -245,6 +245,11 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
...
@@ -245,6 +245,11 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
char
*
extension
;
char
*
extension
;
DBUG_PRINT
(
"info"
,(
"Examining: %s"
,
file
->
name
));
DBUG_PRINT
(
"info"
,(
"Examining: %s"
,
file
->
name
));
/* skiping . and .. */
if
(
file
->
name
[
0
]
==
'.'
&&
(
!
file
->
name
[
1
]
||
(
file
->
name
[
1
]
==
'.'
&&
!
file
->
name
[
2
])))
continue
;
/* Check if file is a raid directory */
/* Check if file is a raid directory */
if
((
isdigit
(
file
->
name
[
0
])
||
if
((
isdigit
(
file
->
name
[
0
])
||
(
file
->
name
[
0
]
>=
'a'
&&
file
->
name
[
0
]
<=
'f'
))
&&
(
file
->
name
[
0
]
>=
'a'
&&
file
->
name
[
0
]
<=
'f'
))
&&
...
...
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