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
6e9877c6
Commit
6e9877c6
authored
Oct 17, 2012
by
Krunal Bauskar krunal.bauskar@oracle.com
Browse files
Options
Browse Files
Download
Plain Diff
merge from mysql-5.1 -> mysql-5.5
parents
11a51707
c2ab8441
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
148 additions
and
0 deletions
+148
-0
mysql-test/suite/innodb/r/innodb_bug14704286.result
mysql-test/suite/innodb/r/innodb_bug14704286.result
+53
-0
mysql-test/suite/innodb/t/innodb_bug14704286.test
mysql-test/suite/innodb/t/innodb_bug14704286.test
+95
-0
No files found.
mysql-test/suite/innodb/r/innodb_bug14704286.result
0 → 100644
View file @
6e9877c6
use test;
drop table if exists t1;
create table t1 (id int primary key, value int, value2 int,
value3 int, index(value,value2)) engine=innodb;
insert into t1 values
(10,10,10,10),(11,11,11,11),(12,12,12,12),(13,13,13,13),(14,14,14,14),
(15,15,15,15),(16,16,16,16),(17,17,17,17),(18,18,18,18),(19,19,19,19),
(20,20,20,20);
use test;
start transaction with consistent snapshot;
use test;
CREATE PROCEDURE update_t1()
BEGIN
DECLARE i INT DEFAULT 1;
while (i <= 5000) DO
update test.t1 set value2=value2+1, value3=value3+1 where id=12;
SET i = i + 1;
END WHILE;
END|
set autocommit=0;
CALL update_t1();
select * from t1;
id value value2 value3
10 10 10 10
11 11 11 11
12 12 5012 5012
13 13 13 13
14 14 14 14
15 15 15 15
16 16 16 16
17 17 17 17
18 18 18 18
19 19 19 19
20 20 20 20
set autocommit=1;
select * from t1;
id value value2 value3
10 10 10 10
11 11 11 11
12 12 5012 5012
13 13 13 13
14 14 14 14
15 15 15 15
16 16 16 16
17 17 17 17
18 18 18 18
19 19 19 19
20 20 20 20
select * from t1 force index(value) where value=12;
kill query @id;
ERROR 70100: Query execution was interrupted
drop procedure if exists update_t1;
drop table if exists t1;
mysql-test/suite/innodb/t/innodb_bug14704286.test
0 → 100644
View file @
6e9877c6
--
source
include
/
have_innodb
.
inc
#
# create test-bed to run test
#
use
test
;
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
create
table
t1
(
id
int
primary
key
,
value
int
,
value2
int
,
value3
int
,
index
(
value
,
value2
))
engine
=
innodb
;
insert
into
t1
values
(
10
,
10
,
10
,
10
),(
11
,
11
,
11
,
11
),(
12
,
12
,
12
,
12
),(
13
,
13
,
13
,
13
),(
14
,
14
,
14
,
14
),
(
15
,
15
,
15
,
15
),(
16
,
16
,
16
,
16
),(
17
,
17
,
17
,
17
),(
18
,
18
,
18
,
18
),(
19
,
19
,
19
,
19
),
(
20
,
20
,
20
,
20
);
let
$ID
=
`SELECT @id := CONNECTION_ID()`
;
#
# we need multiple connections as we need to keep one connection
# active with trx requesting consistent read.
#
connect
(
conn1
,
localhost
,
root
,,);
connect
(
conn2
,
localhost
,
root
,,);
connect
(
conn3
,
localhost
,
root
,,);
#
# start trx with consistent read
#
connection
conn1
;
use
test
;
start
transaction
with
consistent
snapshot
;
#
# update table such that secondary index is updated.
#
connection
conn2
;
use
test
;
delimiter
|
;
CREATE
PROCEDURE
update_t1
()
BEGIN
DECLARE
i
INT
DEFAULT
1
;
while
(
i
<=
5000
)
DO
update
test
.
t1
set
value2
=
value2
+
1
,
value3
=
value3
+
1
where
id
=
12
;
SET
i
=
i
+
1
;
END
WHILE
;
END
|
delimiter
;
|
set
autocommit
=
0
;
CALL
update_t1
();
select
*
from
t1
;
set
autocommit
=
1
;
select
*
from
t1
;
#
# Now try to fire select query from connection-1 enforcing
# use of secondary index.
#
connection
conn1
;
let
$ID
=
`SELECT @id := CONNECTION_ID()`
;
#--error ER_QUERY_INTERRUPTED
--
send
select
*
from
t1
force
index
(
value
)
where
value
=
12
;
#
# select is going to take good time so let's kill query.
#
connection
conn3
;
let
$wait_condition
=
select
*
from
information_schema
.
processlist
where
state
=
'Sending data'
and
info
=
'select * from t1 force index(value) where value=12'
;
--
source
include
/
wait_condition
.
inc
let
$ignore
=
`SELECT @id := $ID`
;
kill
query
@
id
;
#
# reap the value of connection-1
#
connection
conn1
;
--
error
ER_QUERY_INTERRUPTED
reap
;
#
# clean test-bed.
#
connection
default
;
disconnect
conn1
;
disconnect
conn2
;
disconnect
conn3
;
drop
procedure
if
exists
update_t1
;
drop
table
if
exists
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