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
2e15d13f
Commit
2e15d13f
authored
Aug 31, 2002
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LOCK+change+OPTIMIZE MyISAM bug
parent
05f57e20
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
24 deletions
+23
-24
myisam/mi_delete_all.c
myisam/mi_delete_all.c
+2
-2
mysql-test/r/delete.result
mysql-test/r/delete.result
+0
-13
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+8
-0
mysql-test/t/delete.test
mysql-test/t/delete.test
+0
-8
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+11
-0
sql/ha_myisam.cc
sql/ha_myisam.cc
+2
-1
No files found.
myisam/mi_delete_all.c
View file @
2e15d13f
...
@@ -35,11 +35,11 @@ int mi_delete_all_rows(MI_INFO *info)
...
@@ -35,11 +35,11 @@ int mi_delete_all_rows(MI_INFO *info)
if
(
_mi_mark_file_changed
(
info
))
if
(
_mi_mark_file_changed
(
info
))
goto
err
;
goto
err
;
state
->
state
.
records
=
info
->
state
->
records
=
info
->
state
->
del
=
state
->
split
=
0
;
info
->
state
->
records
=
info
->
state
->
del
=
state
->
split
=
0
;
state
->
dellink
=
HA_OFFSET_ERROR
;
state
->
dellink
=
HA_OFFSET_ERROR
;
state
->
sortkey
=
(
ushort
)
~
0
;
state
->
sortkey
=
(
ushort
)
~
0
;
info
->
state
->
key_file_length
=
share
->
base
.
keystart
;
info
->
state
->
key_file_length
=
share
->
base
.
keystart
;
state
->
state
.
data_file_length
=
info
->
state
->
data_file_length
=
0
;
info
->
state
->
data_file_length
=
0
;
info
->
state
->
empty
=
info
->
state
->
key_empty
=
0
;
info
->
state
->
empty
=
info
->
state
->
key_empty
=
0
;
state
->
checksum
=
0
;
state
->
checksum
=
0
;
...
...
mysql-test/r/delete.result
View file @
2e15d13f
...
@@ -24,16 +24,3 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
...
@@ -24,16 +24,3 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
delete from t1 where a=27;
delete from t1 where a=27;
drop table t1;
drop table t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2), (3);
LOCK TABLES t1 WRITE;
DELETE FROM t1;
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
SELECT * FROM t1;
a
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table if exists t1;
mysql-test/r/myisam.result
View file @
2e15d13f
...
@@ -100,3 +100,11 @@ CHECK TABLE t1;
...
@@ -100,3 +100,11 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check status OK
drop table t1;
drop table t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2), (3);
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (1), (2), (3);
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
DROP TABLE t1;
mysql-test/t/delete.test
View file @
2e15d13f
...
@@ -35,11 +35,3 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
...
@@ -35,11 +35,3 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
insert
into
t1
values
(
2
),(
4
),(
6
),(
8
),(
10
),(
12
),(
14
),(
16
),(
18
),(
20
),(
22
),(
24
),(
26
),(
23
),(
27
);
insert
into
t1
values
(
2
),(
4
),(
6
),(
8
),(
10
),(
12
),(
14
),(
16
),(
18
),(
20
),(
22
),(
24
),(
26
),(
23
),(
27
);
delete
from
t1
where
a
=
27
;
delete
from
t1
where
a
=
27
;
drop
table
t1
;
drop
table
t1
;
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
),
(
3
);
LOCK
TABLES
t1
WRITE
;
DELETE
FROM
t1
;
OPTIMIZE
TABLE
t1
;
SELECT
*
FROM
t1
;
CHECK
TABLE
t1
;
drop
table
if
exists
t1
;
mysql-test/t/myisam.test
View file @
2e15d13f
...
@@ -93,3 +93,14 @@ INSERT INTO t1 (post_text) VALUES ('ceci est un test'),('ceci est un test'),('ce
...
@@ -93,3 +93,14 @@ INSERT INTO t1 (post_text) VALUES ('ceci est un test'),('ceci est un test'),('ce
REPAIR
TABLE
t1
;
REPAIR
TABLE
t1
;
CHECK
TABLE
t1
;
CHECK
TABLE
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Test of OPTIMIZE of locked and modified tables
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
),
(
3
);
LOCK
TABLES
t1
WRITE
;
INSERT
INTO
t1
VALUES
(
1
),
(
2
),
(
3
);
OPTIMIZE
TABLE
t1
;
DROP
TABLE
t1
;
sql/ha_myisam.cc
View file @
2e15d13f
...
@@ -566,11 +566,12 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
...
@@ -566,11 +566,12 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
}
}
if
(
!
optimize
||
if
(
!
optimize
||
memcmp
(
file
->
state
,
&
share
->
state
.
state
,
sizeof
(
MI_STATUS_INFO
))
||
((
file
->
state
->
del
||
share
->
state
.
split
!=
file
->
state
->
records
)
&&
((
file
->
state
->
del
||
share
->
state
.
split
!=
file
->
state
->
records
)
&&
(
!
(
param
.
testflag
&
T_QUICK
)
||
(
!
(
param
.
testflag
&
T_QUICK
)
||
!
(
share
->
state
.
changed
&
STATE_NOT_OPTIMIZED_KEYS
))))
!
(
share
->
state
.
changed
&
STATE_NOT_OPTIMIZED_KEYS
))))
{
{
ulonglong
key_map
=
((
local_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
;
uint
testflag
=
param
.
testflag
;
...
...
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