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
6bc7d383
Commit
6bc7d383
authored
Feb 12, 2010
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for BUG48757 to mysql-5.1-bugteam.
parents
e3eafe84
91f0212c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
8 deletions
+33
-8
mysql-test/r/archive.result
mysql-test/r/archive.result
+9
-0
mysql-test/t/archive.test
mysql-test/t/archive.test
+11
-0
storage/archive/ha_archive.cc
storage/archive/ha_archive.cc
+13
-8
No files found.
mysql-test/r/archive.result
View file @
6bc7d383
...
...
@@ -12728,3 +12728,12 @@ Table Op Msg_type Msg_text
test.t1 repair Error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
test.t1 repair error Corrupt
DROP TABLE t1;
#
# BUG#48757 - missing .ARZ file causes server crash
#
CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
FLUSH TABLE t1;
SELECT * FROM t1;
ERROR HY000: Can't find file: 't1' (errno: 2)
DROP TABLE t1;
ERROR 42S02: Unknown table 't1'
mysql-test/t/archive.test
View file @
6bc7d383
...
...
@@ -1644,3 +1644,14 @@ INSERT INTO t1 (col1, col2) VALUES (1, "value");
REPAIR
TABLE
t1
;
DROP
TABLE
t1
;
remove_file
$MYSQLD_DATADIR
/
test
/
t1
.
ARM
;
--
echo
#
--
echo
# BUG#48757 - missing .ARZ file causes server crash
--
echo
#
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
ARCHIVE
;
FLUSH
TABLE
t1
;
--
remove_file
$MYSQLD_DATADIR
/
test
/
t1
.
ARZ
--
error
ER_FILE_NOT_FOUND
SELECT
*
FROM
t1
;
--
error
ER_BAD_TABLE_ERROR
DROP
TABLE
t1
;
storage/archive/ha_archive.cc
View file @
6bc7d383
...
...
@@ -355,6 +355,9 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc)
*/
if
(
!
(
azopen
(
&
archive_tmp
,
share
->
data_file_name
,
O_RDONLY
|
O_BINARY
)))
{
*
rc
=
my_errno
?
my_errno
:
-
1
;
pthread_mutex_unlock
(
&
archive_mutex
);
my_free
(
share
,
MYF
(
0
));
DBUG_RETURN
(
NULL
);
}
stats
.
auto_increment_value
=
archive_tmp
.
auto_increment
+
1
;
...
...
@@ -504,16 +507,18 @@ int ha_archive::open(const char *name, int mode, uint open_options)
For now we have to refuse to open such table to avoid
potential data loss.
*/
if
((
rc
==
HA_ERR_CRASHED_ON_USAGE
&&
!
(
open_options
&
HA_OPEN_FOR_REPAIR
))
||
rc
==
HA_ERR_TABLE_NEEDS_UPGRADE
)
switch
(
rc
)
{
/* purecov: begin inspected */
case
0
:
break
;
case
HA_ERR_CRASHED_ON_USAGE
:
if
(
open_options
&
HA_OPEN_FOR_REPAIR
)
break
;
/* fall through */
case
HA_ERR_TABLE_NEEDS_UPGRADE
:
free_share
();
DBUG_RETURN
(
rc
);
/* purecov: end */
}
else
if
(
rc
==
HA_ERR_OUT_OF_MEM
)
{
/* fall through */
default:
DBUG_RETURN
(
rc
);
}
...
...
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