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
edfd29dd
Commit
edfd29dd
authored
Nov 11, 2009
by
Christopher Powers
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
9bb40dc1
862c422c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
5 deletions
+60
-5
mysql-test/r/archive.result
mysql-test/r/archive.result
+11
-0
mysql-test/std_data/bug47012.ARM
mysql-test/std_data/bug47012.ARM
+0
-0
mysql-test/std_data/bug47012.ARZ
mysql-test/std_data/bug47012.ARZ
+0
-0
mysql-test/std_data/bug47012.frm
mysql-test/std_data/bug47012.frm
+0
-0
mysql-test/t/archive.test
mysql-test/t/archive.test
+21
-0
storage/archive/azio.c
storage/archive/azio.c
+13
-4
storage/archive/ha_archive.cc
storage/archive/ha_archive.cc
+15
-1
No files found.
mysql-test/r/archive.result
View file @
edfd29dd
...
@@ -12717,3 +12717,14 @@ COUNT(t1.a)
...
@@ -12717,3 +12717,14 @@ COUNT(t1.a)
729
729
DROP TABLE t1;
DROP TABLE t1;
SET @@join_buffer_size= @save_join_buffer_size;
SET @@join_buffer_size= @save_join_buffer_size;
SHOW CREATE TABLE t1;
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
SELECT * FROM t1;
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
INSERT INTO t1 (col1, col2) VALUES (1, "value");
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
REPAIR TABLE t1;
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;
mysql-test/std_data/bug47012.ARM
0 → 100644
View file @
edfd29dd
File added
mysql-test/std_data/bug47012.ARZ
0 → 100644
View file @
edfd29dd
File added
mysql-test/std_data/bug47012.frm
0 → 100644
View file @
edfd29dd
File added
mysql-test/t/archive.test
View file @
edfd29dd
...
@@ -1623,3 +1623,24 @@ INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
...
@@ -1623,3 +1623,24 @@ INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
SELECT
COUNT
(
t1
.
a
)
FROM
t1
,
t1
a
,
t1
b
,
t1
c
,
t1
d
,
t1
e
;
SELECT
COUNT
(
t1
.
a
)
FROM
t1
,
t1
a
,
t1
b
,
t1
c
,
t1
d
,
t1
e
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
SET
@@
join_buffer_size
=
@
save_join_buffer_size
;
SET
@@
join_buffer_size
=
@
save_join_buffer_size
;
#
# BUG#47012 archive tables are not upgradeable, and server crashes on any access
#
let
$MYSQLD_DATADIR
=
`SELECT @@datadir`
;
copy_file
std_data
/
bug47012
.
frm
$MYSQLD_DATADIR
/
test
/
t1
.
frm
;
copy_file
std_data
/
bug47012
.
ARZ
$MYSQLD_DATADIR
/
test
/
t1
.
ARZ
;
copy_file
std_data
/
bug47012
.
ARM
$MYSQLD_DATADIR
/
test
/
t1
.
ARM
;
--
error
ER_TABLE_NEEDS_UPGRADE
SHOW
CREATE
TABLE
t1
;
--
error
ER_TABLE_NEEDS_UPGRADE
SELECT
*
FROM
t1
;
--
error
ER_TABLE_NEEDS_UPGRADE
INSERT
INTO
t1
(
col1
,
col2
)
VALUES
(
1
,
"value"
);
REPAIR
TABLE
t1
;
DROP
TABLE
t1
;
remove_file
$MYSQLD_DATADIR
/
test
/
t1
.
ARM
;
storage/archive/azio.c
View file @
edfd29dd
...
@@ -69,7 +69,7 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd)
...
@@ -69,7 +69,7 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd)
s
->
transparent
=
0
;
s
->
transparent
=
0
;
s
->
mode
=
'r'
;
s
->
mode
=
'r'
;
s
->
version
=
(
unsigned
char
)
az_magic
[
1
];
/* this needs to be a define to version */
s
->
version
=
(
unsigned
char
)
az_magic
[
1
];
/* this needs to be a define to version */
s
->
version
=
(
unsigned
char
)
az_magic
[
2
];
/* minor version */
s
->
minor_version
=
(
unsigned
char
)
az_magic
[
2
];
/* minor version */
/*
/*
We do our own version of append by nature.
We do our own version of append by nature.
...
@@ -352,10 +352,19 @@ void read_header(azio_stream *s, unsigned char *buffer)
...
@@ -352,10 +352,19 @@ void read_header(azio_stream *s, unsigned char *buffer)
s
->
comment_length
=
(
unsigned
int
)
uint4korr
(
buffer
+
AZ_COMMENT_LENGTH_POS
);
s
->
comment_length
=
(
unsigned
int
)
uint4korr
(
buffer
+
AZ_COMMENT_LENGTH_POS
);
s
->
dirty
=
(
unsigned
int
)
buffer
[
AZ_DIRTY_POS
];
s
->
dirty
=
(
unsigned
int
)
buffer
[
AZ_DIRTY_POS
];
}
}
else
else
if
(
buffer
[
0
]
==
gz_magic
[
0
]
&&
buffer
[
1
]
==
gz_magic
[
1
])
{
{
DBUG_ASSERT
(
buffer
[
0
]
==
az_magic
[
0
]
&&
buffer
[
1
]
==
az_magic
[
1
]);
/*
return
;
Set version number to previous version (2).
*/
s
->
version
=
(
unsigned
char
)
2
;
}
else
{
/*
Unknown version.
Most probably due to a corrupt archive.
*/
s
->
dirty
=
AZ_STATE_DIRTY
;
s
->
z_err
=
Z_VERSION_ERROR
;
}
}
}
}
...
...
storage/archive/ha_archive.cc
View file @
edfd29dd
...
@@ -360,6 +360,12 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc)
...
@@ -360,6 +360,12 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc)
stats
.
auto_increment_value
=
archive_tmp
.
auto_increment
+
1
;
stats
.
auto_increment_value
=
archive_tmp
.
auto_increment
+
1
;
share
->
rows_recorded
=
(
ha_rows
)
archive_tmp
.
rows
;
share
->
rows_recorded
=
(
ha_rows
)
archive_tmp
.
rows
;
share
->
crashed
=
archive_tmp
.
dirty
;
share
->
crashed
=
archive_tmp
.
dirty
;
/*
If archive version is less than 3, It should be upgraded before
use.
*/
if
(
archive_tmp
.
version
<
ARCHIVE_VERSION
)
*
rc
=
HA_ERR_TABLE_NEEDS_UPGRADE
;
azclose
(
&
archive_tmp
);
azclose
(
&
archive_tmp
);
VOID
(
my_hash_insert
(
&
archive_open_tables
,
(
uchar
*
)
share
));
VOID
(
my_hash_insert
(
&
archive_open_tables
,
(
uchar
*
)
share
));
...
@@ -491,7 +497,15 @@ int ha_archive::open(const char *name, int mode, uint open_options)
...
@@ -491,7 +497,15 @@ int ha_archive::open(const char *name, int mode, uint open_options)
(
open_options
&
HA_OPEN_FOR_REPAIR
)
?
"yes"
:
"no"
));
(
open_options
&
HA_OPEN_FOR_REPAIR
)
?
"yes"
:
"no"
));
share
=
get_share
(
name
,
&
rc
);
share
=
get_share
(
name
,
&
rc
);
if
(
rc
==
HA_ERR_CRASHED_ON_USAGE
&&
!
(
open_options
&
HA_OPEN_FOR_REPAIR
))
/*
Allow open on crashed table in repair mode only.
Block open on 5.0 ARCHIVE table. Though we have almost all
routines to access these tables, they were not well tested.
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
)
{
{
/* purecov: begin inspected */
/* purecov: begin inspected */
free_share
();
free_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