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
b2c9d65b
Commit
b2c9d65b
authored
Oct 18, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.0
into zim.(none):/home/brian/mysql/mysql-5.0
parents
6e0222cb
8701728f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1303 additions
and
1 deletion
+1303
-1
mysql-test/r/archive.result
mysql-test/r/archive.result
+1218
-0
mysql-test/t/archive.test
mysql-test/t/archive.test
+5
-1
sql/ha_archive.cc
sql/ha_archive.cc
+77
-0
sql/ha_archive.h
sql/ha_archive.h
+3
-0
No files found.
mysql-test/r/archive.result
View file @
b2c9d65b
This diff is collapsed.
Click to expand it.
mysql-test/t/archive.test
View file @
b2c9d65b
...
...
@@ -1339,8 +1339,12 @@ SELECT * FROM t2;
TRUNCATE
TABLE
t2
;
SELECT
*
FROM
t2
;
# Adding support for CHECK table
CHECK
TABLE
t2
;
SELECT
*
FROM
t2
;
# Just test syntax, we will never know if the out
put is right or wrong
# Just test syntax, we will never know if the output is right or wrong
# Must be the last test
INSERT
DELAYED
INTO
t2
VALUES
(
4
,
011403
,
37
,
'intercepted'
,
'audiology'
,
'tinily'
,
''
);
#
...
...
sql/ha_archive.cc
View file @
b2c9d65b
...
...
@@ -1053,4 +1053,81 @@ int ha_archive::delete_all_rows()
DBUG_ENTER
(
"ha_archive::delete_all_rows"
);
DBUG_RETURN
(
0
);
}
/*
We just return state if asked.
*/
bool
ha_archive
::
is_crashed
()
const
{
return
share
->
crashed
;
}
/*
Simple scan of the tables to make sure everything is ok.
*/
int
ha_archive
::
check
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
{
int
rc
=
0
;
byte
*
buf
;
const
char
*
old_proc_info
=
thd
->
proc_info
;
ha_rows
count
=
share
->
rows_recorded
;
DBUG_ENTER
(
"ha_archive::check"
);
thd
->
proc_info
=
"Checking table"
;
/* Flush any waiting data */
gzflush
(
share
->
archive_write
,
Z_SYNC_FLUSH
);
/*
First we create a buffer that we can use for reading rows, and can pass
to get_row().
*/
if
(
!
(
buf
=
(
byte
*
)
my_malloc
(
table
->
s
->
reclength
,
MYF
(
MY_WME
))))
rc
=
HA_ERR_OUT_OF_MEM
;
/*
Now we will rewind the archive file so that we are positioned at the
start of the file.
*/
if
(
!
rc
)
read_data_header
(
archive
);
if
(
!
rc
)
while
(
!
(
rc
=
get_row
(
archive
,
buf
)))
count
--
;
my_free
((
char
*
)
buf
,
MYF
(
0
));
thd
->
proc_info
=
old_proc_info
;
if
((
rc
&&
rc
!=
HA_ERR_END_OF_FILE
)
||
count
)
{
share
->
crashed
=
FALSE
;
DBUG_RETURN
(
HA_ADMIN_CORRUPT
);
}
else
{
DBUG_RETURN
(
HA_ADMIN_OK
);
}
}
/*
Check and repair the table if needed.
*/
bool
ha_archive
::
check_and_repair
(
THD
*
thd
)
{
HA_CHECK_OPT
check_opt
;
DBUG_ENTER
(
"ha_archive::check_and_repair"
);
check_opt
.
init
();
if
(
check
(
thd
,
&
check_opt
)
==
HA_ADMIN_CORRUPT
)
{
DBUG_RETURN
(
repair
(
thd
,
&
check_opt
));
}
else
{
DBUG_RETURN
(
HA_ADMIN_OK
);
}
}
#endif
/* HAVE_ARCHIVE_DB */
sql/ha_archive.h
View file @
b2c9d65b
...
...
@@ -103,6 +103,9 @@ class ha_archive: public handler
}
THR_LOCK_DATA
**
store_lock
(
THD
*
thd
,
THR_LOCK_DATA
**
to
,
enum
thr_lock_type
lock_type
);
bool
is_crashed
()
const
;
int
check
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
);
bool
check_and_repair
(
THD
*
thd
);
};
bool
archive_db_init
(
void
);
...
...
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