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
97cf755a
Commit
97cf755a
authored
Oct 05, 2004
by
brian@brian-akers-computer.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Row level lock code for the archive storage engine.
parent
ef7bdbf4
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
421 additions
and
96 deletions
+421
-96
sql/examples/ha_archive.cc
sql/examples/ha_archive.cc
+409
-94
sql/examples/ha_archive.h
sql/examples/ha_archive.h
+12
-2
No files found.
sql/examples/ha_archive.cc
View file @
97cf755a
This diff is collapsed.
Click to expand it.
sql/examples/ha_archive.h
View file @
97cf755a
...
@@ -32,8 +32,10 @@ typedef struct st_archive_share {
...
@@ -32,8 +32,10 @@ typedef struct st_archive_share {
uint
table_name_length
,
use_count
;
uint
table_name_length
,
use_count
;
pthread_mutex_t
mutex
;
pthread_mutex_t
mutex
;
THR_LOCK
lock
;
THR_LOCK
lock
;
File
meta_file
;
/* Meta file we use */
gzFile
archive_write
;
/* Archive file we are working with */
gzFile
archive_write
;
/* Archive file we are working with */
bool
dirty
;
/* Flag for if a flush should occur */
bool
dirty
;
/* Flag for if a flush should occur */
ulonglong
rows_recorded
;
/* Number of rows in tables */
}
ARCHIVE_SHARE
;
}
ARCHIVE_SHARE
;
/*
/*
...
@@ -50,7 +52,8 @@ class ha_archive: public handler
...
@@ -50,7 +52,8 @@ class ha_archive: public handler
z_off_t
current_position
;
/* The position of the row we just read */
z_off_t
current_position
;
/* The position of the row we just read */
byte
byte_buffer
[
IO_SIZE
];
/* Initial buffer for our string */
byte
byte_buffer
[
IO_SIZE
];
/* Initial buffer for our string */
String
buffer
;
/* Buffer used for blob storage */
String
buffer
;
/* Buffer used for blob storage */
unsigned
int
version
;
/* Used for recording version */
uint
version
;
/* Used for recording version */
ulonglong
scan_rows
;
/* Number of rows left in scan */
public:
public:
ha_archive
(
TABLE
*
table
)
:
handler
(
table
)
ha_archive
(
TABLE
*
table
)
:
handler
(
table
)
...
@@ -104,7 +107,14 @@ public:
...
@@ -104,7 +107,14 @@ public:
int
rnd_init
(
bool
scan
=
1
);
int
rnd_init
(
bool
scan
=
1
);
int
rnd_next
(
byte
*
buf
);
int
rnd_next
(
byte
*
buf
);
int
rnd_pos
(
byte
*
buf
,
byte
*
pos
);
int
rnd_pos
(
byte
*
buf
,
byte
*
pos
);
int
get_row
(
byte
*
buf
);
int
get_row
(
gzFile
file_to_read
,
byte
*
buf
);
int
read_meta_file
(
File
meta_file
,
ulonglong
*
rows
);
int
write_meta_file
(
File
meta_file
,
ulonglong
rows
,
bool
dirty
);
ARCHIVE_SHARE
*
get_share
(
const
char
*
table_name
,
TABLE
*
table
);
int
free_share
(
ARCHIVE_SHARE
*
share
);
int
rebuild_meta_file
(
char
*
table_name
,
File
meta_file
);
int
read_data_header
(
gzFile
file_to_read
);
int
write_data_header
(
gzFile
file_to_write
);
void
position
(
const
byte
*
record
);
void
position
(
const
byte
*
record
);
void
info
(
uint
);
void
info
(
uint
);
int
extra
(
enum
ha_extra_function
operation
);
int
extra
(
enum
ha_extra_function
operation
);
...
...
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