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
3a58dc5a
Commit
3a58dc5a
authored
Nov 13, 2002
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql into serg.mysql.com:/usr/home/serg/Abk/mysql
parents
f8680cf0
ffb4dee5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
2 deletions
+54
-2
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+4
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+40
-0
sql/ha_myisam.cc
sql/ha_myisam.cc
+10
-2
No files found.
mysql-test/r/myisam.result
View file @
3a58dc5a
...
...
@@ -38,3 +38,7 @@ table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4
Table Op Msg_type Msg_text
test.t1 optimize status OK
Table Op Msg_type Msg_text
test.t1 optimize status OK
Table Op Msg_type Msg_text
test.t1 check status OK
mysql-test/t/myisam.test
View file @
3a58dc5a
...
...
@@ -75,6 +75,46 @@ INSERT INTO t1 VALUES (1), (2), (3);
OPTIMIZE
TABLE
t1
;
DROP
TABLE
t1
;
#
# Test of optimize, when only mi_sort_index (but not mi_repair*) is done
# in ha_myisam::repair, and index size is changed (decreased).
#
drop
table
if
exists
t1
;
create
table
t1
(
t1
char
(
255
),
key
(
t1
(
250
)));
insert
t1
values
(
'137513751375137513751375137513751375137569516951695169516951695169516951695169'
);
insert
t1
values
(
'178417841784178417841784178417841784178403420342034203420342034203420342034203'
);
insert
t1
values
(
'213872387238723872387238723872387238723867376737673767376737673767376737673767'
);
insert
t1
values
(
'242624262426242624262426242624262426242607890789078907890789078907890789078907'
);
insert
t1
values
(
'256025602560256025602560256025602560256011701170117011701170117011701170117011'
);
insert
t1
values
(
'276027602760276027602760276027602760276001610161016101610161016101610161016101'
);
insert
t1
values
(
'281528152815281528152815281528152815281564956495649564956495649564956495649564'
);
insert
t1
values
(
'292129212921292129212921292129212921292102100210021002100210021002100210021002'
);
insert
t1
values
(
'380638063806380638063806380638063806380634483448344834483448344834483448344834'
);
insert
t1
values
(
'411641164116411641164116411641164116411616301630163016301630163016301630163016'
);
insert
t1
values
(
'420842084208420842084208420842084208420899889988998899889988998899889988998899'
);
insert
t1
values
(
'438443844384438443844384438443844384438482448244824482448244824482448244824482'
);
insert
t1
values
(
'443244324432443244324432443244324432443239613961396139613961396139613961396139'
);
insert
t1
values
(
'485448544854485448544854485448544854485477847784778477847784778477847784778477'
);
insert
t1
values
(
'494549454945494549454945494549454945494555275527552755275527552755275527552755'
);
insert
t1
values
(
'538647864786478647864786478647864786478688918891889188918891889188918891889188'
);
insert
t1
values
(
'565556555655565556555655565556555655565554845484548454845484548454845484548454'
);
insert
t1
values
(
'607860786078607860786078607860786078607856665666566656665666566656665666566656'
);
insert
t1
values
(
'640164016401640164016401640164016401640141274127412741274127412741274127412741'
);
insert
t1
values
(
'719471947194719471947194719471947194719478717871787178717871787178717871787178'
);
insert
t1
values
(
'742574257425742574257425742574257425742549604960496049604960496049604960496049'
);
insert
t1
values
(
'887088708870887088708870887088708870887035963596359635963596359635963596359635'
);
insert
t1
values
(
'917791779177917791779177917791779177917773857385738573857385738573857385738573'
);
insert
t1
values
(
'933293329332933293329332933293329332933278987898789878987898789878987898789878'
);
insert
t1
values
(
'963896389638963896389638963896389638963877807780778077807780778077807780778077'
);
delete
from
t1
where
t1
>
'2'
;
insert
t1
values
(
'70'
),
(
'84'
),
(
'60'
),
(
'20'
),
(
'76'
),
(
'89'
),
(
'49'
),
(
'50'
),
(
'88'
),
(
'61'
),
(
'42'
),
(
'98'
),
(
'39'
),
(
'30'
),
(
'25'
),
(
'66'
),
(
'61'
),
(
'48'
),
(
'80'
),
(
'84'
),
(
'98'
),
(
'19'
),
(
'91'
),
(
'42'
),
(
'47'
);
optimize
table
t1
;
check
table
t1
;
drop
table
t1
;
#
# test of myisam with huge number of packed fields
#
...
...
sql/ha_myisam.cc
View file @
3a58dc5a
...
...
@@ -561,7 +561,6 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
}
if
(
!
optimize
||
memcmp
(
file
->
state
,
&
share
->
state
.
state
,
sizeof
(
MI_STATUS_INFO
))
||
((
file
->
state
->
del
||
share
->
state
.
split
!=
file
->
state
->
records
)
&&
(
!
param
.
opt_rep_quick
||
!
(
share
->
state
.
changed
&
STATE_NOT_OPTIMIZED_KEYS
))))
...
...
@@ -618,7 +617,16 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
STATE_CRASHED_ON_REPAIR
);
file
->
update
|=
HA_STATE_CHANGED
|
HA_STATE_ROW_CHANGED
;
}
file
->
save_state
=
file
->
s
->
state
.
state
;
/* Here we need to make file->save_state and file->s->state.state
equal. Unfortunately, sometime table comes locked here (so
file->save_state represents actual table state), and sometime
unlocked (and actual is file->s->state.state instead). This all
is very confusing, and should be streamlined (TODO).
*/
if
(
file
->
state
==
&
file
->
save_state
)
file
->
s
->
state
.
state
=
file
->
save_state
;
else
file
->
save_state
=
file
->
s
->
state
.
state
;
if
(
file
->
s
->
base
.
auto_key
)
update_auto_increment_key
(
&
param
,
file
,
1
);
if
(
optimize_done
)
...
...
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