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
127d01dd
Commit
127d01dd
authored
Dec 10, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ANALYZE for MERGE
parent
6271ea35
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
13 deletions
+35
-13
include/myisammrg.h
include/myisammrg.h
+2
-0
myisammrg/myrg_info.c
myisammrg/myrg_info.c
+8
-9
myisammrg/myrg_open.c
myisammrg/myrg_open.c
+18
-4
sql/ha_myisammrg.cc
sql/ha_myisammrg.cc
+7
-0
No files found.
include/myisammrg.h
View file @
127d01dd
...
@@ -51,6 +51,7 @@ typedef struct st_mymerge_info /* Struct from h_info */
...
@@ -51,6 +51,7 @@ typedef struct st_mymerge_info /* Struct from h_info */
uint
reclength
;
/* Recordlength */
uint
reclength
;
/* Recordlength */
int
errkey
;
/* With key was dupplicated on err */
int
errkey
;
/* With key was dupplicated on err */
uint
options
;
/* HA_OPTION_... used */
uint
options
;
/* HA_OPTION_... used */
ulong
*
rec_per_key
;
/* for sql optimizing */
}
MYMERGE_INFO
;
}
MYMERGE_INFO
;
typedef
struct
st_myrg_table_info
typedef
struct
st_myrg_table_info
...
@@ -71,6 +72,7 @@ typedef struct st_myrg_info
...
@@ -71,6 +72,7 @@ typedef struct st_myrg_info
my_bool
cache_in_use
;
my_bool
cache_in_use
;
LIST
open_list
;
LIST
open_list
;
QUEUE
by_key
;
QUEUE
by_key
;
ulong
*
rec_per_key_part
;
/* for sql optimizing */
}
MYRG_INFO
;
}
MYRG_INFO
;
...
...
myisammrg/myrg_info.c
View file @
127d01dd
...
@@ -28,8 +28,6 @@ ulonglong myrg_position(MYRG_INFO *info)
...
@@ -28,8 +28,6 @@ ulonglong myrg_position(MYRG_INFO *info)
~
(
ulonglong
)
0
;
~
(
ulonglong
)
0
;
}
}
/* If flag != 0 one only gets pos of last record */
int
myrg_status
(
MYRG_INFO
*
info
,
register
MYMERGE_INFO
*
x
,
int
flag
)
int
myrg_status
(
MYRG_INFO
*
info
,
register
MYMERGE_INFO
*
x
,
int
flag
)
{
{
MYRG_TABLE
*
current_table
;
MYRG_TABLE
*
current_table
;
...
@@ -55,15 +53,16 @@ int myrg_status(MYRG_INFO *info,register MYMERGE_INFO *x,int flag)
...
@@ -55,15 +53,16 @@ int myrg_status(MYRG_INFO *info,register MYMERGE_INFO *x,int flag)
DBUG_PRINT
(
"info2"
,(
"table: %s, offset: %lu"
,
DBUG_PRINT
(
"info2"
,(
"table: %s, offset: %lu"
,
file
->
table
->
filename
,(
ulong
)
file
->
file_offset
));
file
->
table
->
filename
,(
ulong
)
file
->
file_offset
));
}
}
x
->
records
=
info
->
records
;
x
->
records
=
info
->
records
;
x
->
deleted
=
info
->
del
;
x
->
deleted
=
info
->
del
;
x
->
data_file_length
=
info
->
data_file_length
;
x
->
data_file_length
=
info
->
data_file_length
;
x
->
reclength
=
info
->
reclength
;
x
->
reclength
=
info
->
reclength
;
x
->
options
=
info
->
options
;
x
->
options
=
info
->
options
;
if
(
current_table
)
if
(
current_table
)
x
->
errkey
=
current_table
->
table
->
errkey
;
x
->
errkey
=
current_table
->
table
->
errkey
;
else
else
x
->
errkey
=
0
;
x
->
errkey
=
0
;
x
->
rec_per_key
=
info
->
rec_per_key_part
;
}
}
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
myisammrg/myrg_open.c
View file @
127d01dd
...
@@ -32,8 +32,8 @@
...
@@ -32,8 +32,8 @@
MYRG_INFO
*
myrg_open
(
const
char
*
name
,
int
mode
,
int
handle_locking
)
MYRG_INFO
*
myrg_open
(
const
char
*
name
,
int
mode
,
int
handle_locking
)
{
{
int
save_errno
,
i
,
errpos
;
int
save_errno
,
i
,
j
,
errpos
;
uint
files
,
dir_length
,
length
,
options
;
uint
files
,
dir_length
,
length
,
options
,
key_parts
;
ulonglong
file_offset
;
ulonglong
file_offset
;
char
name_buff
[
FN_REFLEN
*
2
],
buff
[
FN_REFLEN
],
*
end
;
char
name_buff
[
FN_REFLEN
*
2
],
buff
[
FN_REFLEN
],
*
end
;
MYRG_INFO
info
,
*
m_info
;
MYRG_INFO
info
,
*
m_info
;
...
@@ -89,13 +89,25 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
...
@@ -89,13 +89,25 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
}
}
info
.
reclength
=
isam
->
s
->
base
.
reclength
;
info
.
reclength
=
isam
->
s
->
base
.
reclength
;
}
}
key_parts
=
(
isam
?
isam
->
s
->
base
.
key_parts
:
0
);
if
(
!
(
m_info
=
(
MYRG_INFO
*
)
my_malloc
(
sizeof
(
MYRG_INFO
)
+
if
(
!
(
m_info
=
(
MYRG_INFO
*
)
my_malloc
(
sizeof
(
MYRG_INFO
)
+
files
*
sizeof
(
MYRG_TABLE
),
files
*
sizeof
(
MYRG_TABLE
)
+
sizeof
(
long
)
*
key_parts
,
MYF
(
MY_WME
))))
MYF
(
MY_WME
))))
goto
err
;
goto
err
;
*
m_info
=
info
;
*
m_info
=
info
;
m_info
->
open_tables
=
(
files
)
?
(
MYRG_TABLE
*
)
(
m_info
+
1
)
:
0
;
m_info
->
tables
=
files
;
m_info
->
tables
=
files
;
if
(
files
)
{
m_info
->
open_tables
=
(
MYRG_TABLE
*
)
(
m_info
+
1
);
m_info
->
rec_per_key_part
=
(
ulong
*
)
(
m_info
->
open_tables
+
files
);
bzero
((
char
*
)
m_info
->
rec_per_key_part
,
sizeof
(
long
)
*
key_parts
);
}
else
{
m_info
->
open_tables
=
0
;
m_info
->
rec_per_key_part
=
0
;
}
errpos
=
2
;
errpos
=
2
;
options
=
(
uint
)
~
0
;
options
=
(
uint
)
~
0
;
...
@@ -107,6 +119,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
...
@@ -107,6 +119,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
m_info
->
records
+=
isam
->
state
->
records
;
m_info
->
records
+=
isam
->
state
->
records
;
m_info
->
del
+=
isam
->
state
->
del
;
m_info
->
del
+=
isam
->
state
->
del
;
m_info
->
data_file_length
+=
isam
->
state
->
data_file_length
;
m_info
->
data_file_length
+=
isam
->
state
->
data_file_length
;
for
(
j
=
0
;
j
<
key_parts
;
j
++
)
m_info
->
rec_per_key_part
[
j
]
+=
isam
->
s
->
state
.
rec_per_key_part
[
j
]
/
files
;
if
(
i
)
if
(
i
)
isam
=
(
MI_INFO
*
)
(
isam
->
open_list
.
next
->
data
);
isam
=
(
MI_INFO
*
)
(
isam
->
open_list
.
next
->
data
);
}
}
...
...
sql/ha_myisammrg.cc
View file @
127d01dd
...
@@ -229,6 +229,13 @@ void ha_myisammrg::info(uint flag)
...
@@ -229,6 +229,13 @@ void ha_myisammrg::info(uint flag)
#else
#else
ref_length
=
4
;
// Can't be > than my_off_t
ref_length
=
4
;
// Can't be > than my_off_t
#endif
#endif
if
(
flag
&
HA_STATUS_CONST
)
{
if
(
table
->
key_parts
)
memcpy
((
char
*
)
table
->
key_info
[
0
].
rec_per_key
,
(
char
*
)
info
.
rec_per_key
,
sizeof
(
table
->
key_info
[
0
].
rec_per_key
)
*
table
->
key_parts
);
}
}
}
...
...
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