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
c7891ea3
Commit
c7891ea3
authored
Nov 15, 2008
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
accbf3b2
e68be532
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
1 deletion
+101
-1
mysql-test/r/partition_innodb.result
mysql-test/r/partition_innodb.result
+22
-0
mysql-test/t/partition_innodb.test
mysql-test/t/partition_innodb.test
+40
-0
sql/ha_partition.cc
sql/ha_partition.cc
+35
-1
sql/ha_partition.h
sql/ha_partition.h
+4
-0
No files found.
mysql-test/r/partition_innodb.result
View file @
c7891ea3
drop table if exists t1;
CREATE TABLE t1 (id INT PRIMARY KEY, data INT) ENGINE = InnoDB
PARTITION BY RANGE(id) (
PARTITION p0 VALUES LESS THAN (5),
PARTITION p1 VALUES LESS THAN (10),
PARTITION p2 VALUES LESS THAN MAXVALUE
);
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8),
(9,9), (10,10), (11,11);
SET @old_tx_isolation := @@session.tx_isolation;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET autocommit = 0;
UPDATE t1 SET DATA = data*2 WHERE id = 3;
SHOW ENGINE InnoDB STATUS;
Type Name Status
InnoDB 2 lock struct(s) 1 row lock(s)
UPDATE t1 SET data = data*2 WHERE data = 2;
SHOW ENGINE InnoDB STATUS;
Type Name Status
InnoDB 6 lock struct(s) 2 row lock(s)
SET @@session.tx_isolation = @old_tx_isolation;
DROP TABLE t1;
# Bug#37721, test of ORDER BY on PK and WHERE on INDEX
CREATE TABLE t1 (
a INT,
...
...
mysql-test/t/partition_innodb.test
View file @
c7891ea3
--
source
include
/
have_partition
.
inc
--
source
include
/
have_innodb
.
inc
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
#
# Bug#40595: Non-matching rows not released with READ-COMMITTED on tables
# with partitions
CREATE
TABLE
t1
(
id
INT
PRIMARY
KEY
,
data
INT
)
ENGINE
=
InnoDB
PARTITION
BY
RANGE
(
id
)
(
PARTITION
p0
VALUES
LESS
THAN
(
5
),
PARTITION
p1
VALUES
LESS
THAN
(
10
),
PARTITION
p2
VALUES
LESS
THAN
MAXVALUE
);
INSERT
INTO
t1
VALUES
(
1
,
1
),
(
2
,
2
),
(
3
,
3
),
(
4
,
4
),
(
5
,
5
),
(
6
,
6
),
(
7
,
7
),
(
8
,
8
),
(
9
,
9
),
(
10
,
10
),
(
11
,
11
);
SET
@
old_tx_isolation
:=
@@
session
.
tx_isolation
;
SET
SESSION
TRANSACTION
ISOLATION
LEVEL
READ
COMMITTED
;
SET
autocommit
=
0
;
UPDATE
t1
SET
DATA
=
data
*
2
WHERE
id
=
3
;
# grouping/referencing in replace_regex is very slow on long strings,
# removing all before/after the interesting row before grouping/referencing
--
replace_regex
/.*---
TRANSACTION
[
0
-
9
]
+
[
0
-
9
]
+
,
.*
,
OS
thread
id
[
0
-
9
]
+//
/
MySQL
thread
id
[
0
-
9
]
+
,
query
id
[
0
-
9
]
+
.*//
/.*
([
0
-
9
]
+
lock
struct
\
(
s
\
)),
heap
size
[
0
-
9
]
+
,
([
0
-
9
]
+
row
lock
\
(
s
\
))
.*/
\
1
\
2
/
SHOW
ENGINE
InnoDB
STATUS
;
UPDATE
t1
SET
data
=
data
*
2
WHERE
data
=
2
;
# grouping/referencing in replace_regex is very slow on long strings,
# removing all before/after the interesting row before grouping/referencing
--
replace_regex
/.*---
TRANSACTION
[
0
-
9
]
+
[
0
-
9
]
+
,
.*
,
OS
thread
id
[
0
-
9
]
+//
/
MySQL
thread
id
[
0
-
9
]
+
,
query
id
[
0
-
9
]
+
.*//
/.*
([
0
-
9
]
+
lock
struct
\
(
s
\
)),
heap
size
[
0
-
9
]
+
,
([
0
-
9
]
+
row
lock
\
(
s
\
))
.*/
\
1
\
2
/
SHOW
ENGINE
InnoDB
STATUS
;
SET
@@
session
.
tx_isolation
=
@
old_tx_isolation
;
DROP
TABLE
t1
;
#
# Bug37721: ORDER BY when WHERE contains non-partitioned index column
# wrong order since it did not use pk as second compare
...
...
sql/ha_partition.cc
View file @
c7891ea3
...
...
@@ -2813,8 +2813,42 @@ uint ha_partition::lock_count() const
void
ha_partition
::
unlock_row
()
{
DBUG_ENTER
(
"ha_partition::unlock_row"
);
m_file
[
m_last_part
]
->
unlock_row
();
return
;
DBUG_VOID_RETURN
;
}
/**
Use semi consistent read if possible
SYNOPSIS
try_semi_consistent_read()
yes Turn on semi consistent read
RETURN VALUE
NONE
DESCRIPTION
See handler.h:
Tell the engine whether it should avoid unnecessary lock waits.
If yes, in an UPDATE or DELETE, if the row under the cursor was locked
by another transaction, the engine may try an optimistic read of
the last committed row value under the cursor.
Note: prune_partitions are already called before this call, so using
pruning is OK.
*/
void
ha_partition
::
try_semi_consistent_read
(
bool
yes
)
{
handler
**
file
;
DBUG_ENTER
(
"ha_partition::try_semi_consistent_read"
);
for
(
file
=
m_file
;
*
file
;
file
++
)
{
if
(
bitmap_is_set
(
&
(
m_part_info
->
used_partitions
),
(
file
-
m_file
)))
(
*
file
)
->
try_semi_consistent_read
(
yes
);
}
DBUG_VOID_RETURN
;
}
...
...
sql/ha_partition.h
View file @
c7891ea3
...
...
@@ -325,6 +325,10 @@ class ha_partition :public handler
Call to unlock rows not to be updated in transaction
*/
virtual
void
unlock_row
();
/*
Call to hint about semi consistent read
*/
virtual
void
try_semi_consistent_read
(
bool
);
/*
-------------------------------------------------------------------------
...
...
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