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
babfc48c
Commit
babfc48c
authored
Oct 04, 2010
by
Vasil Dimov
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql-5.1-innodb -> mysql-5.1-bugteam
parents
d1fb8a86
fe0b6694
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
105 additions
and
72 deletions
+105
-72
mysql-test/suite/innodb/r/innodb_bug56716.result
mysql-test/suite/innodb/r/innodb_bug56716.result
+4
-0
mysql-test/suite/innodb/t/innodb_bug56716.test
mysql-test/suite/innodb/t/innodb_bug56716.test
+10
-0
mysql-test/suite/innodb_plugin/r/innodb_bug56716.result
mysql-test/suite/innodb_plugin/r/innodb_bug56716.result
+4
-0
mysql-test/suite/innodb_plugin/t/innodb_bug56716.test
mysql-test/suite/innodb_plugin/t/innodb_bug56716.test
+10
-0
storage/innobase/row/row0sel.c
storage/innobase/row/row0sel.c
+36
-36
storage/innodb_plugin/ChangeLog
storage/innodb_plugin/ChangeLog
+5
-0
storage/innodb_plugin/row/row0sel.c
storage/innodb_plugin/row/row0sel.c
+36
-36
No files found.
mysql-test/suite/innodb/r/innodb_bug56716.result
0 → 100644
View file @
babfc48c
CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB;
SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE;
a b c
DROP TABLE bug56716;
mysql-test/suite/innodb/t/innodb_bug56716.test
0 → 100644
View file @
babfc48c
#
# Bug #56716 InnoDB locks a record gap without locking the table
#
--
source
include
/
have_innodb
.
inc
CREATE
TABLE
bug56716
(
a
INT
PRIMARY
KEY
,
b
INT
,
c
INT
,
INDEX
(
b
))
ENGINE
=
InnoDB
;
SELECT
*
FROM
bug56716
WHERE
b
<=
42
ORDER
BY
b
DESC
FOR
UPDATE
;
DROP
TABLE
bug56716
;
mysql-test/suite/innodb_plugin/r/innodb_bug56716.result
0 → 100644
View file @
babfc48c
CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB;
SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE;
a b c
DROP TABLE bug56716;
mysql-test/suite/innodb_plugin/t/innodb_bug56716.test
0 → 100644
View file @
babfc48c
#
# Bug #56716 InnoDB locks a record gap without locking the table
#
--
source
include
/
have_innodb_plugin
.
inc
CREATE
TABLE
bug56716
(
a
INT
PRIMARY
KEY
,
b
INT
,
c
INT
,
INDEX
(
b
))
ENGINE
=
InnoDB
;
SELECT
*
FROM
bug56716
WHERE
b
<=
42
ORDER
BY
b
DESC
FOR
UPDATE
;
DROP
TABLE
bug56716
;
storage/innobase/row/row0sel.c
View file @
babfc48c
...
...
@@ -3599,6 +3599,42 @@ row_search_for_mysql(
clust_index
=
dict_table_get_first_index
(
index
->
table
);
/* Do some start-of-statement preparations */
if
(
!
prebuilt
->
sql_stat_start
)
{
/* No need to set an intention lock or assign a read view */
if
(
trx
->
read_view
==
NULL
&&
prebuilt
->
select_lock_type
==
LOCK_NONE
)
{
fputs
(
"InnoDB: Error: MySQL is trying to"
" perform a consistent read
\n
"
"InnoDB: but the read view is not assigned!
\n
"
,
stderr
);
trx_print
(
stderr
,
trx
,
600
);
fputc
(
'\n'
,
stderr
);
ut_error
;
}
}
else
if
(
prebuilt
->
select_lock_type
==
LOCK_NONE
)
{
/* This is a consistent read */
/* Assign a read view for the query */
trx_assign_read_view
(
trx
);
prebuilt
->
sql_stat_start
=
FALSE
;
}
else
{
err
=
lock_table
(
0
,
index
->
table
,
prebuilt
->
select_lock_type
==
LOCK_S
?
LOCK_IS
:
LOCK_IX
,
thr
);
if
(
err
!=
DB_SUCCESS
)
{
goto
lock_wait_or_error
;
}
prebuilt
->
sql_stat_start
=
FALSE
;
}
/* Open or restore index cursor position */
if
(
UNIV_LIKELY
(
direction
!=
0
))
{
ibool
need_to_process
=
sel_restore_position_for_mysql
(
&
same_user_rec
,
BTR_SEARCH_LEAF
,
...
...
@@ -3674,42 +3710,6 @@ row_search_for_mysql(
}
}
if
(
!
prebuilt
->
sql_stat_start
)
{
/* No need to set an intention lock or assign a read view */
if
(
trx
->
read_view
==
NULL
&&
prebuilt
->
select_lock_type
==
LOCK_NONE
)
{
fputs
(
"InnoDB: Error: MySQL is trying to"
" perform a consistent read
\n
"
"InnoDB: but the read view is not assigned!
\n
"
,
stderr
);
trx_print
(
stderr
,
trx
,
600
);
fputc
(
'\n'
,
stderr
);
ut_a
(
0
);
}
}
else
if
(
prebuilt
->
select_lock_type
==
LOCK_NONE
)
{
/* This is a consistent read */
/* Assign a read view for the query */
trx_assign_read_view
(
trx
);
prebuilt
->
sql_stat_start
=
FALSE
;
}
else
{
ulint
lock_mode
;
if
(
prebuilt
->
select_lock_type
==
LOCK_S
)
{
lock_mode
=
LOCK_IS
;
}
else
{
lock_mode
=
LOCK_IX
;
}
err
=
lock_table
(
0
,
index
->
table
,
lock_mode
,
thr
);
if
(
err
!=
DB_SUCCESS
)
{
goto
lock_wait_or_error
;
}
prebuilt
->
sql_stat_start
=
FALSE
;
}
rec_loop:
/*-------------------------------------------------------------*/
/* PHASE 4: Look for matching records in a loop */
...
...
storage/innodb_plugin/ChangeLog
View file @
babfc48c
2010-09-27 The InnoDB Team
* row/row0sel.c, innodb_bug56716.result, innodb_bug56716.test:
Fix Bug #56716 InnoDB locks a record gap without locking the table
2010-09-06 The InnoDB Team
* dict/dict0load.c, innodb_bug53756.test innodb_bug53756.result
Fix Bug #53756 ALTER TABLE ADD PRIMARY KEY affects crash recovery
...
...
storage/innodb_plugin/row/row0sel.c
View file @
babfc48c
...
...
@@ -3719,6 +3719,42 @@ row_search_for_mysql(
clust_index
=
dict_table_get_first_index
(
index
->
table
);
/* Do some start-of-statement preparations */
if
(
!
prebuilt
->
sql_stat_start
)
{
/* No need to set an intention lock or assign a read view */
if
(
trx
->
read_view
==
NULL
&&
prebuilt
->
select_lock_type
==
LOCK_NONE
)
{
fputs
(
"InnoDB: Error: MySQL is trying to"
" perform a consistent read
\n
"
"InnoDB: but the read view is not assigned!
\n
"
,
stderr
);
trx_print
(
stderr
,
trx
,
600
);
fputc
(
'\n'
,
stderr
);
ut_error
;
}
}
else
if
(
prebuilt
->
select_lock_type
==
LOCK_NONE
)
{
/* This is a consistent read */
/* Assign a read view for the query */
trx_assign_read_view
(
trx
);
prebuilt
->
sql_stat_start
=
FALSE
;
}
else
{
err
=
lock_table
(
0
,
index
->
table
,
prebuilt
->
select_lock_type
==
LOCK_S
?
LOCK_IS
:
LOCK_IX
,
thr
);
if
(
err
!=
DB_SUCCESS
)
{
goto
lock_wait_or_error
;
}
prebuilt
->
sql_stat_start
=
FALSE
;
}
/* Open or restore index cursor position */
if
(
UNIV_LIKELY
(
direction
!=
0
))
{
ibool
need_to_process
=
sel_restore_position_for_mysql
(
&
same_user_rec
,
BTR_SEARCH_LEAF
,
...
...
@@ -3794,42 +3830,6 @@ row_search_for_mysql(
}
}
if
(
!
prebuilt
->
sql_stat_start
)
{
/* No need to set an intention lock or assign a read view */
if
(
trx
->
read_view
==
NULL
&&
prebuilt
->
select_lock_type
==
LOCK_NONE
)
{
fputs
(
"InnoDB: Error: MySQL is trying to"
" perform a consistent read
\n
"
"InnoDB: but the read view is not assigned!
\n
"
,
stderr
);
trx_print
(
stderr
,
trx
,
600
);
fputc
(
'\n'
,
stderr
);
ut_a
(
0
);
}
}
else
if
(
prebuilt
->
select_lock_type
==
LOCK_NONE
)
{
/* This is a consistent read */
/* Assign a read view for the query */
trx_assign_read_view
(
trx
);
prebuilt
->
sql_stat_start
=
FALSE
;
}
else
{
ulint
lock_mode
;
if
(
prebuilt
->
select_lock_type
==
LOCK_S
)
{
lock_mode
=
LOCK_IS
;
}
else
{
lock_mode
=
LOCK_IX
;
}
err
=
lock_table
(
0
,
index
->
table
,
lock_mode
,
thr
);
if
(
err
!=
DB_SUCCESS
)
{
goto
lock_wait_or_error
;
}
prebuilt
->
sql_stat_start
=
FALSE
;
}
rec_loop:
/*-------------------------------------------------------------*/
/* PHASE 4: Look for matching records in a loop */
...
...
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