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
cce39fe8
Commit
cce39fe8
authored
Apr 09, 2009
by
Narayanan V
Browse files
Options
Browse Files
Download
Plain Diff
merging with mysql-5.1-bugteam tree
parents
53f89223
92aee5a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.cc
+15
-6
storage/myisammrg/ha_myisammrg.cc
storage/myisammrg/ha_myisammrg.cc
+3
-2
No files found.
storage/myisam/ha_myisam.cc
View file @
cce39fe8
...
...
@@ -315,6 +315,7 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out,
t2_keys in Number of keys in second table
t2_recs in Number of records in second table
strict in Strict check switch
table in handle to the table object
DESCRIPTION
This function compares two MyISAM definitions. By intention it was done
...
...
@@ -330,6 +331,10 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out,
Otherwise 'strict' flag must be set to 1 and it is not required to pass
converted dot-frm definition as t1_*.
For compatibility reasons we relax some checks, specifically:
- 4.0 (and earlier versions) always set key_alg to 0.
- 4.0 (and earlier versions) have the same language for all keysegs.
RETURN VALUE
0 - Equal definitions.
1 - Different definitions.
...
...
@@ -344,10 +349,11 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out,
int
check_definition
(
MI_KEYDEF
*
t1_keyinfo
,
MI_COLUMNDEF
*
t1_recinfo
,
uint
t1_keys
,
uint
t1_recs
,
MI_KEYDEF
*
t2_keyinfo
,
MI_COLUMNDEF
*
t2_recinfo
,
uint
t2_keys
,
uint
t2_recs
,
bool
strict
)
uint
t2_keys
,
uint
t2_recs
,
bool
strict
,
TABLE
*
table_arg
)
{
uint
i
,
j
;
DBUG_ENTER
(
"check_definition"
);
my_bool
mysql_40_compat
=
table_arg
&&
table_arg
->
s
->
frm_version
<
FRM_VER_TRUE_VARCHAR
;
if
((
strict
?
t1_keys
!=
t2_keys
:
t1_keys
>
t2_keys
))
{
DBUG_PRINT
(
"error"
,
(
"Number of keys differs: t1_keys=%u, t2_keys=%u"
,
...
...
@@ -386,8 +392,9 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
test
(
t2_keyinfo
[
i
].
flag
&
HA_SPATIAL
)));
DBUG_RETURN
(
1
);
}
if
(
t1_keyinfo
[
i
].
keysegs
!=
t2_keyinfo
[
i
].
keysegs
||
t1_keyinfo
[
i
].
key_alg
!=
t2_keyinfo
[
i
].
key_alg
)
if
((
mysql_40_compat
&&
t1_keyinfo
[
i
].
key_alg
!=
t2_keyinfo
[
i
].
key_alg
)
||
t1_keyinfo
[
i
].
keysegs
!=
t2_keyinfo
[
i
].
keysegs
)
{
DBUG_PRINT
(
"error"
,
(
"Key %d has different definition"
,
i
));
DBUG_PRINT
(
"error"
,
(
"t1_keysegs=%d, t1_key_alg=%d"
,
...
...
@@ -417,8 +424,9 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
t1_keysegs_j__type
=
HA_KEYTYPE_VARBINARY1
;
/* purecov: inspected */
}
if
(
t1_keysegs_j__type
!=
t2_keysegs
[
j
].
type
||
t1_keysegs
[
j
].
language
!=
t2_keysegs
[
j
].
language
||
if
((
mysql_40_compat
&&
t1_keysegs
[
j
].
language
!=
t2_keysegs
[
j
].
language
)
||
t1_keysegs_j__type
!=
t2_keysegs
[
j
].
type
||
t1_keysegs
[
j
].
null_bit
!=
t2_keysegs
[
j
].
null_bit
||
t1_keysegs
[
j
].
length
!=
t2_keysegs
[
j
].
length
)
{
...
...
@@ -671,7 +679,8 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked)
}
if
(
check_definition
(
keyinfo
,
recinfo
,
table
->
s
->
keys
,
recs
,
file
->
s
->
keyinfo
,
file
->
s
->
rec
,
file
->
s
->
base
.
keys
,
file
->
s
->
base
.
fields
,
true
))
file
->
s
->
base
.
keys
,
file
->
s
->
base
.
fields
,
true
,
table
))
{
/* purecov: begin inspected */
my_errno
=
HA_ERR_CRASHED
;
...
...
storage/myisammrg/ha_myisammrg.cc
View file @
cce39fe8
...
...
@@ -137,7 +137,8 @@ extern int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out,
extern
int
check_definition
(
MI_KEYDEF
*
t1_keyinfo
,
MI_COLUMNDEF
*
t1_recinfo
,
uint
t1_keys
,
uint
t1_recs
,
MI_KEYDEF
*
t2_keyinfo
,
MI_COLUMNDEF
*
t2_recinfo
,
uint
t2_keys
,
uint
t2_recs
,
bool
strict
);
uint
t2_keys
,
uint
t2_recs
,
bool
strict
,
TABLE
*
table_arg
);
static
void
split_file_name
(
const
char
*
file_name
,
LEX_STRING
*
db
,
LEX_STRING
*
name
);
...
...
@@ -595,7 +596,7 @@ int ha_myisammrg::attach_children(void)
if
(
check_definition
(
keyinfo
,
recinfo
,
keys
,
recs
,
u_table
->
table
->
s
->
keyinfo
,
u_table
->
table
->
s
->
rec
,
u_table
->
table
->
s
->
base
.
keys
,
u_table
->
table
->
s
->
base
.
fields
,
false
))
u_table
->
table
->
s
->
base
.
fields
,
false
,
NULL
))
{
DBUG_PRINT
(
"error"
,
(
"table definition mismatch: '%s'"
,
u_table
->
table
->
filename
));
...
...
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