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
d79d4ff6
Commit
d79d4ff6
authored
Jan 11, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jwinstead2/mysql-4.1-7762
into mysql.com:/home/jwinstead2/mysql-4.1-clean
parents
d43e7473
d61c360c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
sql/examples/ha_archive.cc
sql/examples/ha_archive.cc
+17
-13
No files found.
sql/examples/ha_archive.cc
View file @
d79d4ff6
...
...
@@ -341,10 +341,8 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, TABLE *table)
if
((
share
->
archive_write
=
gzopen
(
share
->
data_file_name
,
"ab"
))
==
NULL
)
goto
error2
;
if
(
my_hash_insert
(
&
archive_open_tables
,
(
byte
*
)
share
))
goto
error2
;
thr_lock_init
(
&
share
->
lock
);
if
(
pthread_mutex_init
(
&
share
->
mutex
,
MY_MUTEX_INIT_FAST
))
goto
error3
;
thr_lock_init
(
&
share
->
lock
);
}
share
->
use_count
++
;
pthread_mutex_unlock
(
&
archive_mutex
);
...
...
@@ -352,14 +350,13 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, TABLE *table)
return
share
;
error3:
VOID
(
pthread_mutex_destroy
(
&
share
->
mutex
));
thr_lock_delete
(
&
share
->
lock
);
/* We close, but ignore errors since we already have errors */
(
void
)
gzclose
(
share
->
archive_write
);
error2:
my_close
(
share
->
meta_file
,
MYF
(
0
));
error:
pthread_mutex_unlock
(
&
archive_mutex
);
VOID
(
pthread_mutex_destroy
(
&
share
->
mutex
));
my_free
((
gptr
)
share
,
MYF
(
0
));
return
NULL
;
...
...
@@ -493,23 +490,30 @@ int ha_archive::create(const char *name, TABLE *table_arg,
if
((
archive
=
gzdopen
(
create_file
,
"ab"
))
==
NULL
)
{
error
=
errno
;
delete_table
(
name
);
goto
error
;
goto
error2
;
}
if
(
write_data_header
(
archive
))
{
gzclose
(
archive
)
;
goto
error
2
;
error
=
errno
;
goto
error
3
;
}
if
(
gzclose
(
archive
))
{
error
=
errno
;
goto
error2
;
}
my_close
(
create_file
,
MYF
(
0
));
DBUG_RETURN
(
0
);
error3:
/* We already have an error, so ignore results of gzclose. */
(
void
)
gzclose
(
archive
);
error2:
error
=
errno
;
delete_table
(
name
);
my_close
(
create_file
,
MYF
(
0
))
;
delete_table
(
name
);
error:
/* Return error number, if we got one */
DBUG_RETURN
(
error
?
error
:
-
1
);
...
...
@@ -736,7 +740,7 @@ int ha_archive::rebuild_meta_file(char *table_name, File meta_file)
if
((
rebuild_file
=
gzopen
(
data_file_name
,
"rb"
))
==
NULL
)
DBUG_RETURN
(
errno
?
errno
:
-
1
);
if
(
rc
=
read_data_header
(
rebuild_file
))
if
(
(
rc
=
read_data_header
(
rebuild_file
)
))
goto
error
;
/*
...
...
@@ -800,7 +804,7 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
DBUG_RETURN
(
-
1
);
}
while
(
read
=
gzread
(
reader
,
block
,
IO_SIZE
))
while
(
(
read
=
gzread
(
reader
,
block
,
IO_SIZE
)
))
gzwrite
(
writer
,
block
,
read
);
gzclose
(
reader
);
...
...
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