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
665d17c6
Commit
665d17c6
authored
Jun 14, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/kgeorge/mysql/5.0/teamclean
into mysql.com:/home/kgeorge/mysql/5.0/B20195
parents
86334edf
01c9fd31
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
0 deletions
+87
-0
mysql-test/r/delayed.result
mysql-test/r/delayed.result
+30
-0
mysql-test/t/delayed.test
mysql-test/t/delayed.test
+49
-0
sql/sql_insert.cc
sql/sql_insert.cc
+8
-0
No files found.
mysql-test/r/delayed.result
View file @
665d17c6
...
...
@@ -39,3 +39,33 @@ select * from t1;
a
1
drop table t1;
CREATE TABLE t1 ( a int(10) NOT NULL auto_increment, PRIMARY KEY (a));
insert delayed into t1 values(null);
insert into t1 values(null);
insert into t1 values(null);
insert delayed into t1 values(null);
insert delayed into t1 values(null);
insert delayed into t1 values(null);
insert into t1 values(null);
insert into t1 values(null);
insert into t1 values(null);
delete from t1 where a=6;
insert delayed into t1 values(null);
insert delayed into t1 values(null);
insert delayed into t1 values(null);
insert delayed into t1 values(null);
select * from t1 order by a;
a
1
2
3
4
5
7
8
9
10
11
12
13
DROP TABLE t1;
mysql-test/t/delayed.test
View file @
665d17c6
...
...
@@ -50,3 +50,52 @@ insert into t1 values (1);
insert
delayed
into
t1
values
(
1
);
select
*
from
t1
;
drop
table
t1
;
#
# Bug #20195: INSERT DELAYED with auto_increment is assigned wrong values
#
CREATE
TABLE
t1
(
a
int
(
10
)
NOT
NULL
auto_increment
,
PRIMARY
KEY
(
a
));
# Make one delayed insert to start the separate thread
insert
delayed
into
t1
values
(
null
);
# Do some normal inserts
insert
into
t1
values
(
null
);
insert
into
t1
values
(
null
);
# Discarded, since the delayed-counter is 2, which is already used
insert
delayed
into
t1
values
(
null
);
# Discarded, since the delayed-counter is 3, which is already used
insert
delayed
into
t1
values
(
null
);
# Works, since the delayed-counter is 4, which is unused
insert
delayed
into
t1
values
(
null
);
# Do some more inserts
insert
into
t1
values
(
null
);
insert
into
t1
values
(
null
);
insert
into
t1
values
(
null
);
# Delete one of the above to make a hole
delete
from
t1
where
a
=
6
;
# Discarded, since the delayed-counter is 5, which is already used
insert
delayed
into
t1
values
(
null
);
# Works, since the delayed-counter is 6, which is unused (the row we deleted)
insert
delayed
into
t1
values
(
null
);
# Discarded, since the delayed-counter is 7, which is already used
insert
delayed
into
t1
values
(
null
);
# Works, since the delayed-counter is 8, which is unused
insert
delayed
into
t1
values
(
null
);
# Check what we have now
# must wait so that the delayed thread finishes
# Note: this must be increased if the test fails
--
sleep
1
select
*
from
t1
order
by
a
;
DROP
TABLE
t1
;
sql/sql_insert.cc
View file @
665d17c6
...
...
@@ -1938,6 +1938,14 @@ bool delayed_insert::handle_inserts(void)
if
(
!
using_bin_log
)
table
->
file
->
extra
(
HA_EXTRA_WRITE_CACHE
);
pthread_mutex_lock
(
&
mutex
);
/* Reset auto-increment cacheing */
if
(
thd
.
clear_next_insert_id
)
{
thd
.
next_insert_id
=
0
;
thd
.
clear_next_insert_id
=
0
;
}
while
((
row
=
rows
.
get
()))
{
stacked_inserts
--
;
...
...
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