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
3336ecf8
Commit
3336ecf8
authored
Sep 28, 2006
by
svoj@mysql.com/april.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/svoj/devel/bk/mysql-5.0-engines
into mysql.com:/home/svoj/devel/mysql/BUG21675/mysql-5.0-engines
parents
b724a03e
efb75811
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
sql/ha_archive.cc
sql/ha_archive.cc
+20
-4
sql/ha_archive.h
sql/ha_archive.h
+1
-0
No files found.
sql/ha_archive.cc
View file @
3336ecf8
...
...
@@ -120,6 +120,8 @@ static bool archive_inited= FALSE;
/* Variables for archive share methods */
pthread_mutex_t
archive_mutex
;
static
HASH
archive_open_tables
;
static
z_off_t
max_zfile_size
;
static
int
zoffset_size
;
/* The file extension */
#define ARZ ".ARZ" // The data file
...
...
@@ -203,6 +205,8 @@ bool archive_db_init()
}
else
{
zoffset_size
=
2
<<
((
zlibCompileFlags
()
>>
6
)
&
3
);
max_zfile_size
=
(
z_off_t
)
(
~
(
1
<<
(
zoffset_size
*
8
-
1
)));
archive_inited
=
TRUE
;
DBUG_RETURN
(
FALSE
);
}
...
...
@@ -240,7 +244,7 @@ ha_archive::ha_archive(TABLE *table_arg)
buffer
.
set
((
char
*
)
byte_buffer
,
IO_SIZE
,
system_charset_info
);
/* The size of the offset value we will use for position() */
ref_length
=
2
<<
((
zlibCompileFlags
()
>>
6
)
&
3
)
;
ref_length
=
zoffset_size
;
DBUG_ASSERT
(
ref_length
<=
sizeof
(
z_off_t
));
}
...
...
@@ -480,7 +484,8 @@ int ha_archive::init_archive_writer()
DBUG_RETURN
(
1
);
}
share
->
archive_write_open
=
TRUE
;
info
(
HA_STATUS_TIME
);
share
->
approx_file_size
=
data_file_length
;
DBUG_RETURN
(
0
);
}
...
...
@@ -651,10 +656,21 @@ int ha_archive::create(const char *name, TABLE *table_arg,
*/
int
ha_archive
::
real_write_row
(
byte
*
buf
,
gzFile
writer
)
{
z_off_t
written
;
z_off_t
written
,
total_row_length
;
uint
*
ptr
,
*
end
;
DBUG_ENTER
(
"ha_archive::real_write_row"
);
total_row_length
=
table
->
s
->
reclength
;
for
(
ptr
=
table
->
s
->
blob_field
,
end
=
ptr
+
table
->
s
->
blob_fields
;
ptr
!=
end
;
ptr
++
)
total_row_length
+=
((
Field_blob
*
)
table
->
field
[
*
ptr
])
->
get_length
();
if
(
share
->
approx_file_size
>
max_zfile_size
-
total_row_length
)
{
info
(
HA_STATUS_TIME
);
share
->
approx_file_size
=
data_file_length
;
if
(
share
->
approx_file_size
>
max_zfile_size
-
total_row_length
)
DBUG_RETURN
(
HA_ERR_RECORD_FILE_FULL
);
}
share
->
approx_file_size
+=
total_row_length
;
written
=
gzwrite
(
writer
,
buf
,
table
->
s
->
reclength
);
DBUG_PRINT
(
"ha_archive::real_write_row"
,
(
"Wrote %d bytes expected %d"
,
written
,
table
->
s
->
reclength
));
if
(
!
delayed_insert
||
!
bulk_insert
)
...
...
sql/ha_archive.h
View file @
3336ecf8
...
...
@@ -38,6 +38,7 @@ typedef struct st_archive_share {
bool
dirty
;
/* Flag for if a flush should occur */
bool
crashed
;
/* Meta file is crashed */
ha_rows
rows_recorded
;
/* Number of rows in tables */
z_off_t
approx_file_size
;
/* Approximate archive data file size */
}
ARCHIVE_SHARE
;
/*
...
...
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