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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f883e5eb
Commit
f883e5eb
authored
Aug 30, 2002
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A nasty fix when all rows are deleted with a write lock
parent
5ec7991d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
6 deletions
+27
-6
myisam/mi_delete_all.c
myisam/mi_delete_all.c
+2
-2
mysql-test/r/delete.result
mysql-test/r/delete.result
+13
-0
mysql-test/t/delete.test
mysql-test/t/delete.test
+8
-0
sql/mysqld.cc
sql/mysqld.cc
+4
-4
No files found.
myisam/mi_delete_all.c
View file @
f883e5eb
...
...
@@ -35,11 +35,11 @@ int mi_delete_all_rows(MI_INFO *info)
if
(
_mi_mark_file_changed
(
info
))
goto
err
;
info
->
state
->
records
=
info
->
state
->
del
=
state
->
split
=
0
;
state
->
state
.
records
=
info
->
state
->
records
=
info
->
state
->
del
=
state
->
split
=
0
;
state
->
dellink
=
HA_OFFSET_ERROR
;
state
->
sortkey
=
(
ushort
)
~
0
;
info
->
state
->
key_file_length
=
share
->
base
.
keystart
;
info
->
state
->
data_file_length
=
0
;
state
->
state
.
data_file_length
=
info
->
state
->
data_file_length
=
0
;
info
->
state
->
empty
=
info
->
state
->
key_empty
=
0
;
state
->
checksum
=
0
;
...
...
mysql-test/r/delete.result
View file @
f883e5eb
...
...
@@ -24,3 +24,16 @@ 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);
delete from t1 where a=27;
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/t/delete.test
View file @
f883e5eb
...
...
@@ -35,3 +35,11 @@ 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
);
delete
from
t1
where
a
=
27
;
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
;
sql/mysqld.cc
View file @
f883e5eb
...
...
@@ -3004,10 +3004,10 @@ struct my_option my_long_options[] =
{
"delay-key-write"
,
OPT_DELAY_KEY_WRITE
,
"Type of DELAY_KEY_WRITE"
,
0
,
0
,
0
,
GET_STR
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"delay-key-write-for-all-tables"
,
OPT_DELAY_KEY_WRITE_ALL
,
"Don't flush key buffers between writes for any MyISAM table (Depr
i
cated option, use --delay-key-write=all instead)"
,
"Don't flush key buffers between writes for any MyISAM table (Depr
e
cated option, use --delay-key-write=all instead)"
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"enable-locking"
,
OPT_ENABLE_LOCK
,
"Depr
i
cated option, use --external-locking instead"
,
"Depr
e
cated option, use --external-locking instead"
,
(
gptr
*
)
&
opt_external_locking
,
(
gptr
*
)
&
opt_external_locking
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#ifdef __NT__
...
...
@@ -3244,7 +3244,7 @@ struct my_option my_long_options[] =
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#ifndef TO_BE_DELETED
{
"safe-show-database"
,
OPT_SAFE_SHOW_DB
,
"Depr
i
cated option; One should use GRANT SHOW DATABASES instead..."
,
"Depr
e
cated option; One should use GRANT SHOW DATABASES instead..."
,
(
gptr
*
)
&
opt_safe_show_db
,
(
gptr
*
)
&
opt_safe_show_db
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#endif
...
...
@@ -3274,7 +3274,7 @@ struct my_option my_long_options[] =
{
"skip-innodb"
,
OPT_INNODB_SKIP
,
"Don't use Innodb (will save memory)"
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"skip-locking"
,
OPT_SKIP_LOCK
,
"Depr
i
cated option, use --skip-external-locking instead"
,
"Depr
e
cated option, use --skip-external-locking instead"
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"skip-external-locking"
,
OPT_SKIP_LOCK
,
"Do not use system (external) locking"
,
(
gptr
*
)
&
opt_external_locking
,
(
gptr
*
)
&
opt_external_locking
,
...
...
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