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
4b3ab339
Commit
4b3ab339
authored
Jan 21, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1-arch
into zim.(none):/home/brian/mysql/archive-newformat-5.1
parents
0caaf405
e48ef21d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
18 deletions
+25
-18
storage/archive/archive_reader.c
storage/archive/archive_reader.c
+2
-1
storage/archive/archive_test.c
storage/archive/archive_test.c
+3
-3
storage/archive/azio.c
storage/archive/azio.c
+5
-1
storage/archive/azlib.h
storage/archive/azlib.h
+15
-13
No files found.
storage/archive/archive_reader.c
View file @
4b3ab339
...
...
@@ -41,9 +41,10 @@ int main(int argc, char *argv[])
}
printf
(
"Version %u
\n
"
,
reader_handle
.
version
);
printf
(
"
\t
Start position %llu
\n
"
,
(
unsigned
long
long
)
reader_handle
.
start
);
if
(
reader_handle
.
version
>
2
)
{
printf
(
"
\t
Minor version %u
\n
"
,
reader_handle
.
minor_version
);
printf
(
"
\t
Start position %llu
\n
"
,
(
unsigned
long
long
)
reader_handle
.
start
);
printf
(
"
\t
Block size %u
\n
"
,
reader_handle
.
block_size
);
printf
(
"
\t
Rows %llu
\n
"
,
reader_handle
.
rows
);
printf
(
"
\t
Autoincrement %llu
\n
"
,
reader_handle
.
auto_increment
);
...
...
storage/archive/archive_test.c
View file @
4b3ab339
...
...
@@ -94,7 +94,7 @@ int main(int argc, char *argv[])
azflush
(
&
reader_handle
,
Z_SYNC_FLUSH
);
assert
(
reader_handle
.
rows
==
TEST_LOOP_NUM
);
assert
(
reader_handle
.
auto_increment
==
0
);
assert
(
reader_handle
.
check_point
==
6
1
);
assert
(
reader_handle
.
check_point
==
6
2
);
assert
(
reader_handle
.
forced_flushes
==
1
);
assert
(
reader_handle
.
dirty
==
AZ_STATE_SAVED
);
...
...
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
azflush
(
&
writer_handle
,
Z_SYNC_FLUSH
);
assert
(
writer_handle
.
rows
==
TEST_LOOP_NUM
);
assert
(
writer_handle
.
auto_increment
==
4
);
assert
(
writer_handle
.
check_point
==
6
1
);
assert
(
writer_handle
.
check_point
==
6
2
);
assert
(
writer_handle
.
forced_flushes
==
2
);
assert
(
writer_handle
.
dirty
==
AZ_STATE_SAVED
);
...
...
@@ -181,7 +181,7 @@ int main(int argc, char *argv[])
azflush
(
&
reader_handle
,
Z_SYNC_FLUSH
);
assert
(
reader_handle
.
rows
==
102
);
assert
(
reader_handle
.
auto_increment
==
4
);
assert
(
reader_handle
.
check_point
==
125
5
);
assert
(
reader_handle
.
check_point
==
125
6
);
assert
(
reader_handle
.
forced_flushes
==
4
);
assert
(
reader_handle
.
dirty
==
AZ_STATE_SAVED
);
...
...
storage/archive/azio.c
View file @
4b3ab339
...
...
@@ -17,7 +17,7 @@
#include <string.h>
static
int
const
gz_magic
[
2
]
=
{
0x1f
,
0x8b
};
/* gzip magic header */
static
int
const
az_magic
[
2
]
=
{
0xfe
,
0x03
};
/* az magic header */
static
int
const
az_magic
[
3
]
=
{
0xfe
,
0x03
,
0x01
};
/* az magic header */
/* gzip flag byte */
#define ASCII_FLAG 0x01
/* bit 0 set: file probably ascii text */
...
...
@@ -69,6 +69,7 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd)
s
->
transparent
=
0
;
s
->
mode
=
'r'
;
s
->
version
=
(
unsigned
char
)
az_magic
[
1
];
/* this needs to be a define to version */
s
->
version
=
(
unsigned
char
)
az_magic
[
2
];
/* minor version */
/*
We do our own version of append by nature.
...
...
@@ -155,12 +156,14 @@ void write_header(azio_stream *s)
s
->
start
=
AZHEADER_SIZE
+
AZMETA_BUFFER_SIZE
;
s
->
block_size
=
AZ_BUFSIZE
;
s
->
version
=
(
unsigned
char
)
az_magic
[
1
];
s
->
minor_version
=
(
unsigned
char
)
az_magic
[
2
];
/* Write a very simple .az header: */
memset
(
buffer
,
0
,
AZHEADER_SIZE
+
AZMETA_BUFFER_SIZE
);
*
(
ptr
+
AZ_MAGIC_POS
)
=
az_magic
[
0
];
*
(
ptr
+
AZ_VERSION_POS
)
=
(
unsigned
char
)
s
->
version
;
*
(
ptr
+
AZ_MINOR_VERSION_POS
)
=
(
unsigned
char
)
s
->
minor_version
;
*
(
ptr
+
AZ_BLOCK_POS
)
=
(
unsigned
char
)(
s
->
block_size
/
1024
);
/* Reserved for block size */
*
(
ptr
+
AZ_STRATEGY_POS
)
=
(
unsigned
char
)
Z_DEFAULT_STRATEGY
;
/* Compression Type */
...
...
@@ -314,6 +317,7 @@ void read_header(azio_stream *s, unsigned char *buffer)
if
(
buffer
[
0
]
==
az_magic
[
0
]
&&
buffer
[
1
]
==
az_magic
[
1
])
{
s
->
version
=
(
unsigned
int
)
buffer
[
AZ_VERSION_POS
];
s
->
minor_version
=
(
unsigned
int
)
buffer
[
AZ_MINOR_VERSION_POS
];
s
->
block_size
=
1024
*
buffer
[
AZ_BLOCK_POS
];
s
->
start
=
(
unsigned
long
long
)
uint8korr
(
buffer
+
AZ_START_POS
);
s
->
rows
=
(
unsigned
long
long
)
uint8korr
(
buffer
+
AZ_ROW_POS
);
...
...
storage/archive/azlib.h
View file @
4b3ab339
...
...
@@ -51,22 +51,23 @@ extern "C" {
+ sizeof(unsigned int) + sizeof(unsigned int) \
+ sizeof(unsigned char)
#define AZHEADER_SIZE 2
0
#define AZHEADER_SIZE 2
1
#define AZ_MAGIC_POS 0
#define AZ_VERSION_POS 1
#define AZ_BLOCK_POS 2
#define AZ_STRATEGY_POS 3
#define AZ_FRM_POS 4
#define AZ_META_POS 8
#define AZ_START_POS 12
#define AZ_ROW_POS 20
#define AZ_FLUSH_POS 28
#define AZ_CHECK_POS 36
#define AZ_AUTOINCREMENT_POS 44
#define AZ_LONGEST_POS 52
#define AZ_SHORTEST_POS 56
#define AZ_DIRTY_POS 60
#define AZ_MINOR_VERSION_POS 2
#define AZ_BLOCK_POS 3
#define AZ_STRATEGY_POS 4
#define AZ_FRM_POS 5
#define AZ_META_POS 9
#define AZ_START_POS 13
#define AZ_ROW_POS 21
#define AZ_FLUSH_POS 29
#define AZ_CHECK_POS 37
#define AZ_AUTOINCREMENT_POS 45
#define AZ_LONGEST_POS 53
#define AZ_SHORTEST_POS 57
#define AZ_DIRTY_POS 61
/*
...
...
@@ -210,6 +211,7 @@ typedef struct azio_stream {
int
back
;
/* one character push-back */
int
last
;
/* true if push-back is last character */
unsigned
char
version
;
/* Version */
unsigned
char
minor_version
;
/* Version */
unsigned
int
block_size
;
/* Block Size */
unsigned
long
long
check_point
;
/* Last position we checked */
unsigned
long
long
forced_flushes
;
/* Forced Flushes */
...
...
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