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
543691ab
Commit
543691ab
authored
Jun 07, 2005
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/my/mysql-4.0 into mysql.com:/home/my/mysql-4.1
parents
47c32613
6a376bec
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
0 deletions
+79
-0
myisam/mi_check.c
myisam/mi_check.c
+8
-0
mysql-test/r/analyze.result
mysql-test/r/analyze.result
+32
-0
mysql-test/t/analyze.test
mysql-test/t/analyze.test
+39
-0
No files found.
myisam/mi_check.c
View file @
543691ab
...
@@ -3870,6 +3870,14 @@ int update_state_info(MI_CHECK *param, MI_INFO *info,uint update)
...
@@ -3870,6 +3870,14 @@ int update_state_info(MI_CHECK *param, MI_INFO *info,uint update)
if
(
!
share
->
state
.
create_time
)
if
(
!
share
->
state
.
create_time
)
share
->
state
.
create_time
=
share
->
state
.
check_time
;
share
->
state
.
create_time
=
share
->
state
.
check_time
;
}
}
/*
When tables are locked we haven't synched the share state and the
real state for a while so we better do it here before synching
the share state to disk. Only when table is write locked is it
necessary to perform this synch.
*/
if
(
info
->
lock_type
==
F_WRLCK
)
share
->
state
.
state
=
*
info
->
state
;
if
(
mi_state_info_write
(
share
->
kfile
,
&
share
->
state
,
1
+
2
))
if
(
mi_state_info_write
(
share
->
kfile
,
&
share
->
state
,
1
+
2
))
goto
err
;
goto
err
;
share
->
changed
=
0
;
share
->
changed
=
0
;
...
...
mysql-test/r/analyze.result
0 → 100644
View file @
543691ab
create table t1 (a bigint);
lock tables t1 write;
insert into t1 values(0);
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
unlock tables;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
create table t1 (a bigint);
insert into t1 values(0);
lock tables t1 write;
delete from t1;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
unlock tables;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
create table t1 (a bigint);
insert into t1 values(0);
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
mysql-test/t/analyze.test
0 → 100644
View file @
543691ab
#
# Bug #10901 Analyze Table on new table destroys table
# This is minimal test case to get error
# The problem was that analyze table wrote the shared state to the file and this
# didn't include the inserts while locked. A check was needed to ensure that
# state information was not updated when executing analyze table for a locked table.
# The analyze table had to be within locks and check table had to be after unlocking
# since then it brings the wrong state from disk rather than from the currently
# correct internal state. The insert is needed since it changes the file state,
# number of records.
# The fix is to synchronise the state of the shared state and the current state before
# calling mi_state_info_write
#
create
table
t1
(
a
bigint
);
lock
tables
t1
write
;
insert
into
t1
values
(
0
);
analyze
table
t1
;
unlock
tables
;
check
table
t1
;
drop
table
t1
;
create
table
t1
(
a
bigint
);
insert
into
t1
values
(
0
);
lock
tables
t1
write
;
delete
from
t1
;
analyze
table
t1
;
unlock
tables
;
check
table
t1
;
drop
table
t1
;
create
table
t1
(
a
bigint
);
insert
into
t1
values
(
0
);
analyze
table
t1
;
check
table
t1
;
drop
table
t1
;
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