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
fb1f8c4f
Commit
fb1f8c4f
authored
Nov 18, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in OPTIMIZE TABLE that reset index cardinality if it
was up to date.
parent
7c779521
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
17 deletions
+53
-17
Docs/manual.texi
Docs/manual.texi
+8
-0
configure.in
configure.in
+1
-1
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+10
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+12
-0
sql/ha_myisam.cc
sql/ha_myisam.cc
+22
-16
No files found.
Docs/manual.texi
View file @
fb1f8c4f
...
@@ -46844,6 +46844,14 @@ not yet 100% confident in this code.
...
@@ -46844,6 +46844,14 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.45
@appendixsubsec Changes in release 3.23.45
@itemize @bullet
@itemize @bullet
@item
@item
Fix a bug which could cause InnoDB to complain if it cannot find free blocks
from the buffer cache during recovery.
@item
Fixed a bug in InnoDB insert buffer B-tree handling that could cause crashes.
@item
Fixed bug in @code{OPTIMIZE TABLE} that reset index cardinality if it
was up to date.
@item
Fixed problem with @code{t1 LEFT_JOIN t2 ... WHERE t2.date_column IS NULL} when
Fixed problem with @code{t1 LEFT_JOIN t2 ... WHERE t2.date_column IS NULL} when
date_column was declared as @code{NOT NULL}.
date_column was declared as @code{NOT NULL}.
@item
@item
configure.in
View file @
fb1f8c4f
...
@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
...
@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT
(
sql/mysqld.cc
)
AC_INIT
(
sql/mysqld.cc
)
AC_CANONICAL_SYSTEM
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
# The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE
(
mysql, 3.23.4
4
)
AM_INIT_AUTOMAKE
(
mysql, 3.23.4
5
)
AM_CONFIG_HEADER
(
config.h
)
AM_CONFIG_HEADER
(
config.h
)
PROTOCOL_VERSION
=
10
PROTOCOL_VERSION
=
10
...
...
mysql-test/r/myisam.result
View file @
fb1f8c4f
...
@@ -10,3 +10,13 @@ Table Op Msg_type Msg_text
...
@@ -10,3 +10,13 @@ Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair status OK
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check status OK
Table Op Msg_type Msg_text
test.t1 optimize status OK
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 0 PRIMARY 1 a A 5 NULL NULL
t1 1 b 1 b A 1 NULL NULL
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 0 PRIMARY 1 a A 5 NULL NULL
t1 1 b 1 b A 1 NULL NULL
mysql-test/t/myisam.test
View file @
fb1f8c4f
...
@@ -36,3 +36,15 @@ check table t1;
...
@@ -36,3 +36,15 @@ check table t1;
repair
table
t1
;
repair
table
t1
;
check
table
t1
;
check
table
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Test bug: Two optimize in a row reset index cardinality
#
create
table
t1
(
a
int
not
null
auto_increment
,
b
int
not
null
,
primary
key
(
a
),
index
(
b
));
insert
into
t1
(
b
)
values
(
1
),(
2
),(
2
),(
2
),(
2
);
optimize
table
t1
;
show
index
from
t1
;
optimize
table
t1
;
show
index
from
t1
;
drop
table
t1
;
sql/ha_myisam.cc
View file @
fb1f8c4f
...
@@ -535,7 +535,7 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt)
...
@@ -535,7 +535,7 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt)
int
ha_myisam
::
repair
(
THD
*
thd
,
MI_CHECK
&
param
,
bool
optimize
)
int
ha_myisam
::
repair
(
THD
*
thd
,
MI_CHECK
&
param
,
bool
optimize
)
{
{
int
error
=
0
;
int
error
=
0
;
uint
extra_testflag
=
0
;
uint
local_testflag
=
param
.
testflag
;
bool
optimize_done
=
!
optimize
,
statistics_done
=
0
;
bool
optimize_done
=
!
optimize
,
statistics_done
=
0
;
char
fixed_name
[
FN_REFLEN
];
char
fixed_name
[
FN_REFLEN
];
const
char
*
old_proc_info
=
thd
->
proc_info
;
const
char
*
old_proc_info
=
thd
->
proc_info
;
...
@@ -565,19 +565,18 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
...
@@ -565,19 +565,18 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
(
!
param
.
opt_rep_quick
||
(
!
param
.
opt_rep_quick
||
!
(
share
->
state
.
changed
&
STATE_NOT_OPTIMIZED_KEYS
))))
!
(
share
->
state
.
changed
&
STATE_NOT_OPTIMIZED_KEYS
))))
{
{
ulonglong
key_map
=
((
param
.
testflag
&
T_CREATE_MISSING_KEYS
)
?
ulonglong
key_map
=
((
local_
testflag
&
T_CREATE_MISSING_KEYS
)
?
((
ulonglong
)
1L
<<
share
->
base
.
keys
)
-
1
:
((
ulonglong
)
1L
<<
share
->
base
.
keys
)
-
1
:
share
->
state
.
key_map
);
share
->
state
.
key_map
);
uint
testflag
=
param
.
testflag
;
if
(
mi_test_if_sort_rep
(
file
,
file
->
state
->
records
,
key_map
,
0
)
&&
if
(
mi_test_if_sort_rep
(
file
,
file
->
state
->
records
,
key_map
,
0
)
&&
(
param
.
testflag
&
T_REP_BY_SORT
))
(
local_
testflag
&
T_REP_BY_SORT
))
{
{
uint
testflag
=
param
.
testflag
;
local_testflag
|=
T_STATISTICS
;
extra_testflag
=
T_STATISTICS
;
param
.
testflag
|=
T_STATISTICS
;
// We get this for free
param
.
testflag
|=
T_STATISTICS
;
// We get this for free
thd
->
proc_info
=
"Repair by sorting"
;
thd
->
proc_info
=
"Repair by sorting"
;
statistics_done
=
1
;
statistics_done
=
1
;
error
=
mi_repair_by_sort
(
&
param
,
file
,
fixed_name
,
param
.
opt_rep_quick
);
error
=
mi_repair_by_sort
(
&
param
,
file
,
fixed_name
,
param
.
opt_rep_quick
);
param
.
testflag
=
testflag
;
}
}
else
else
{
{
...
@@ -585,23 +584,29 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
...
@@ -585,23 +584,29 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
param
.
testflag
&=
~
T_REP_BY_SORT
;
param
.
testflag
&=
~
T_REP_BY_SORT
;
error
=
mi_repair
(
&
param
,
file
,
fixed_name
,
param
.
opt_rep_quick
);
error
=
mi_repair
(
&
param
,
file
,
fixed_name
,
param
.
opt_rep_quick
);
}
}
param
.
testflag
=
testflag
;
optimize_done
=
1
;
}
}
if
(
!
error
)
if
(
!
error
)
{
{
if
((
param
.
testflag
&
T_SORT_INDEX
)
&&
if
((
local_
testflag
&
T_SORT_INDEX
)
&&
(
share
->
state
.
changed
&
STATE_NOT_SORTED_PAGES
))
(
share
->
state
.
changed
&
STATE_NOT_SORTED_PAGES
))
{
{
optimize_done
=
1
;
optimize_done
=
1
;
thd
->
proc_info
=
"Sorting index"
;
thd
->
proc_info
=
"Sorting index"
;
error
=
mi_sort_index
(
&
param
,
file
,
fixed_name
);
error
=
mi_sort_index
(
&
param
,
file
,
fixed_name
);
}
}
if
(
!
statistics_done
&&
(
param
.
testflag
&
T_STATISTICS
)
&&
if
(
!
statistics_done
&&
(
local_testflag
&
T_STATISTICS
))
(
share
->
state
.
changed
&
STATE_NOT_ANALYZED
))
{
if
(
share
->
state
.
changed
&
STATE_NOT_ANALYZED
)
{
{
optimize_done
=
1
;
optimize_done
=
1
;
thd
->
proc_info
=
"Analyzing"
;
thd
->
proc_info
=
"Analyzing"
;
error
=
chk_key
(
&
param
,
file
);
error
=
chk_key
(
&
param
,
file
);
}
}
else
local_testflag
&=
~
T_STATISTICS
;
// Don't update statistics
}
}
}
thd
->
proc_info
=
"Saving state"
;
thd
->
proc_info
=
"Saving state"
;
if
(
!
error
)
if
(
!
error
)
...
@@ -615,9 +620,10 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
...
@@ -615,9 +620,10 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
file
->
save_state
=
file
->
s
->
state
.
state
;
file
->
save_state
=
file
->
s
->
state
.
state
;
if
(
file
->
s
->
base
.
auto_key
)
if
(
file
->
s
->
base
.
auto_key
)
update_auto_increment_key
(
&
param
,
file
,
1
);
update_auto_increment_key
(
&
param
,
file
,
1
);
if
(
optimize_done
)
error
=
update_state_info
(
&
param
,
file
,
error
=
update_state_info
(
&
param
,
file
,
UPDATE_TIME
|
UPDATE_OPEN_COUNT
|
UPDATE_TIME
|
UPDATE_OPEN_COUNT
|
((
param
.
testflag
|
extra_testflag
)
&
(
local_testflag
&
T_STATISTICS
?
UPDATE_STAT
:
0
));
T_STATISTICS
?
UPDATE_STAT
:
0
));
info
(
HA_STATUS_NO_LOCK
|
HA_STATUS_TIME
|
HA_STATUS_VARIABLE
|
info
(
HA_STATUS_NO_LOCK
|
HA_STATUS_TIME
|
HA_STATUS_VARIABLE
|
HA_STATUS_CONST
);
HA_STATUS_CONST
);
...
...
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