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
29c270c1
Commit
29c270c1
authored
Oct 13, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#6020, any lock >= write_allow_write is a write lock
parent
b4026126
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
2 deletions
+69
-2
mysql-test/r/ndb_lock.result
mysql-test/r/ndb_lock.result
+35
-0
mysql-test/t/ndb_lock.test
mysql-test/t/ndb_lock.test
+29
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+5
-2
No files found.
mysql-test/r/ndb_lock.result
View file @
29c270c1
...
@@ -28,3 +28,38 @@ x y
...
@@ -28,3 +28,38 @@ x y
2 two
2 two
3 three
3 three
commit;
commit;
drop table t1;
create table t1 (pk integer not null primary key, u int not null, o int not null,
unique(u), key(o)) engine = ndb;
insert into t1 values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
lock tables t1 write;
delete from t1 where pk = 1;
unlock tables;
select * from t1 order by pk;
pk u o
2 2 2
3 3 3
4 4 4
5 5 5
insert into t1 values (1,1,1);
lock tables t1 write;
delete from t1 where u = 1;
unlock tables;
select * from t1 order by pk;
pk u o
2 2 2
3 3 3
4 4 4
5 5 5
insert into t1 values (1,1,1);
lock tables t1 write;
delete from t1 where o = 1;
unlock tables;
select * from t1 order by pk;
pk u o
2 2 2
3 3 3
4 4 4
5 5 5
insert into t1 values (1,1,1);
drop table t1;
mysql-test/t/ndb_lock.test
View file @
29c270c1
...
@@ -39,3 +39,32 @@ commit;
...
@@ -39,3 +39,32 @@ commit;
connection
con2
;
connection
con2
;
select
*
from
t1
order
by
x
;
select
*
from
t1
order
by
x
;
commit
;
commit
;
drop
table
t1
;
###
# Bug#6020
create
table
t1
(
pk
integer
not
null
primary
key
,
u
int
not
null
,
o
int
not
null
,
unique
(
u
),
key
(
o
))
engine
=
ndb
;
insert
into
t1
values
(
1
,
1
,
1
),
(
2
,
2
,
2
),
(
3
,
3
,
3
),
(
4
,
4
,
4
),
(
5
,
5
,
5
);
lock
tables
t1
write
;
delete
from
t1
where
pk
=
1
;
unlock
tables
;
select
*
from
t1
order
by
pk
;
insert
into
t1
values
(
1
,
1
,
1
);
lock
tables
t1
write
;
delete
from
t1
where
u
=
1
;
unlock
tables
;
select
*
from
t1
order
by
pk
;
insert
into
t1
values
(
1
,
1
,
1
);
lock
tables
t1
write
;
delete
from
t1
where
o
=
1
;
unlock
tables
;
select
*
from
t1
order
by
pk
;
insert
into
t1
values
(
1
,
1
,
1
);
drop
table
t1
;
sql/ha_ndbcluster.cc
View file @
29c270c1
...
@@ -824,7 +824,7 @@ void ha_ndbcluster::release_metadata()
...
@@ -824,7 +824,7 @@ void ha_ndbcluster::release_metadata()
int
ha_ndbcluster
::
get_ndb_lock_type
(
enum
thr_lock_type
type
)
int
ha_ndbcluster
::
get_ndb_lock_type
(
enum
thr_lock_type
type
)
{
{
if
(
type
=
=
TL_WRITE_ALLOW_WRITE
)
if
(
type
>
=
TL_WRITE_ALLOW_WRITE
)
return
NdbOperation
::
LM_Exclusive
;
return
NdbOperation
::
LM_Exclusive
;
else
if
(
uses_blob_value
(
retrieve_all_fields
))
else
if
(
uses_blob_value
(
retrieve_all_fields
))
/*
/*
...
@@ -1161,7 +1161,7 @@ inline int ha_ndbcluster::next_result(byte *buf)
...
@@ -1161,7 +1161,7 @@ inline int ha_ndbcluster::next_result(byte *buf)
If this an update or delete, call nextResult with false
If this an update or delete, call nextResult with false
to process any records already cached in NdbApi
to process any records already cached in NdbApi
*/
*/
bool
contact_ndb
=
m_lock
.
type
!=
TL_WRITE_ALLOW_WRITE
;
bool
contact_ndb
=
m_lock
.
type
<
TL_WRITE_ALLOW_WRITE
;
do
{
do
{
DBUG_PRINT
(
"info"
,
(
"Call nextResult, contact_ndb: %d"
,
contact_ndb
));
DBUG_PRINT
(
"info"
,
(
"Call nextResult, contact_ndb: %d"
,
contact_ndb
));
/*
/*
...
@@ -2731,6 +2731,9 @@ THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd,
...
@@ -2731,6 +2731,9 @@ THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd,
/* If we are not doing a LOCK TABLE, then allow multiple
/* If we are not doing a LOCK TABLE, then allow multiple
writers */
writers */
/* Since NDB does not currently have table locks
this is treated as a ordinary lock */
if
((
lock_type
>=
TL_WRITE_ALLOW_WRITE
&&
if
((
lock_type
>=
TL_WRITE_ALLOW_WRITE
&&
lock_type
<=
TL_WRITE
)
&&
!
thd
->
in_lock_tables
)
lock_type
<=
TL_WRITE
)
&&
!
thd
->
in_lock_tables
)
lock_type
=
TL_WRITE_ALLOW_WRITE
;
lock_type
=
TL_WRITE_ALLOW_WRITE
;
...
...
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