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
bacdcb05
Commit
bacdcb05
authored
Aug 15, 2006
by
mskold/marty@mysql.com/linux.site
Browse files
Options
Browse Files
Download
Plain Diff
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/windows/Linux_space/MySQL/mysql-4.1
parents
e2875620
6a3143e2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
6 deletions
+64
-6
mysql-test/r/ndb_lock.result
mysql-test/r/ndb_lock.result
+12
-3
mysql-test/t/ndb_lock.test
mysql-test/t/ndb_lock.test
+13
-2
ndb/include/ndbapi/NdbConnection.hpp
ndb/include/ndbapi/NdbConnection.hpp
+3
-1
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+34
-0
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+2
-0
No files found.
mysql-test/r/ndb_lock.result
View file @
bacdcb05
...
...
@@ -64,17 +64,26 @@ pk u o
insert into t1 values (1,1,1);
drop table t1;
create table t1 (x integer not null primary key, y varchar(32), z integer, key(z)) engine = ndb;
insert into t1 values (1,'one',1)
, (2,'two',2),(3,"three",3)
;
insert into t1 values (1,'one',1);
begin;
select * from t1 where x = 1 for update;
x y z
1 one 1
begin;
select * from t1 where x = 2 for update;
select * from t1 where x = 1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
rollback;
insert into t1 values (2,'two',2),(3,"three",3);
begin;
select * from t1 where x = 1 for update;
x y z
2 two 2
1 one 1
select * from t1 where x = 1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1 where x = 2 for update;
x y z
2 two 2
rollback;
commit;
begin;
...
...
mysql-test/t/ndb_lock.test
View file @
bacdcb05
...
...
@@ -73,7 +73,7 @@ drop table t1;
create
table
t1
(
x
integer
not
null
primary
key
,
y
varchar
(
32
),
z
integer
,
key
(
z
))
engine
=
ndb
;
insert
into
t1
values
(
1
,
'one'
,
1
)
,
(
2
,
'two'
,
2
),(
3
,
"three"
,
3
);
insert
into
t1
values
(
1
,
'one'
,
1
)
;
# PK access
connection
con1
;
...
...
@@ -82,11 +82,22 @@ select * from t1 where x = 1 for update;
connection
con2
;
begin
;
select
*
from
t1
where
x
=
2
for
update
;
--
error
1205
select
*
from
t1
where
x
=
1
for
update
;
rollback
;
connection
con1
;
rollback
;
insert
into
t1
values
(
2
,
'two'
,
2
),(
3
,
"three"
,
3
);
begin
;
select
*
from
t1
where
x
=
1
for
update
;
connection
con2
;
--
error
1205
select
*
from
t1
where
x
=
1
for
update
;
select
*
from
t1
where
x
=
2
for
update
;
rollback
;
connection
con1
;
commit
;
...
...
ndb/include/ndbapi/NdbConnection.hpp
View file @
bacdcb05
...
...
@@ -163,6 +163,7 @@ class NdbConnection
friend
class
NdbIndexOperation
;
friend
class
NdbIndexScanOperation
;
friend
class
NdbBlob
;
friend
class
ha_ndbcluster
;
public:
...
...
@@ -675,6 +676,7 @@ private:
// optim: any blobs
bool
theBlobFlag
;
Uint8
thePendingBlobOps
;
inline
bool
hasBlobOperation
()
{
return
theBlobFlag
;
}
static
void
sendTC_COMMIT_ACK
(
NdbApiSignal
*
,
Uint32
transId1
,
Uint32
transId2
,
...
...
sql/ha_ndbcluster.cc
View file @
bacdcb05
...
...
@@ -161,6 +161,7 @@ int execute_no_commit(ha_ndbcluster *h, NdbConnection *trans)
if
(
m_batch_execute
)
return
0
;
#endif
h
->
release_completed_operations
(
trans
);
return
trans
->
execute
(
NoCommit
,
AbortOnError
,
h
->
m_force_send
);
}
...
...
@@ -194,6 +195,7 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbConnection *trans)
if
(
m_batch_execute
)
return
0
;
#endif
h
->
release_completed_operations
(
trans
);
return
trans
->
execute
(
NoCommit
,
AO_IgnoreError
,
h
->
m_force_send
);
}
...
...
@@ -2747,6 +2749,25 @@ int ha_ndbcluster::close_scan()
if
(
!
cursor
)
DBUG_RETURN
(
1
);
if
(
m_lock_tuple
)
{
/*
Lock level m_lock.type either TL_WRITE_ALLOW_WRITE
(SELECT FOR UPDATE) or TL_READ_WITH_SHARED_LOCKS (SELECT
LOCK WITH SHARE MODE) and row was not explictly unlocked
with unlock_row() call
*/
NdbOperation
*
op
;
// Lock row
DBUG_PRINT
(
"info"
,
(
"Keeping lock on scanned row"
));
if
(
!
(
op
=
m_active_cursor
->
lockTuple
()))
{
m_lock_tuple
=
false
;
ERR_RETURN
(
trans
->
getNdbError
());
}
m_ops_pending
++
;
}
m_lock_tuple
=
false
;
if
(
m_ops_pending
)
{
...
...
@@ -5350,6 +5371,19 @@ int ha_ndbcluster::write_ndb_file()
DBUG_RETURN
(
error
);
}
void
ha_ndbcluster
::
release_completed_operations
(
NdbConnection
*
trans
)
{
if
(
trans
->
hasBlobOperation
())
{
/* We are reading/writing BLOB fields,
releasing operation records is unsafe
*/
return
;
}
trans
->
releaseCompletedOperations
();
}
int
ndbcluster_show_status
(
THD
*
thd
)
{
...
...
sql/ha_ndbcluster.h
View file @
bacdcb05
...
...
@@ -262,6 +262,8 @@ class ha_ndbcluster: public handler
void
no_uncommitted_rows_init
(
THD
*
);
void
no_uncommitted_rows_reset
(
THD
*
);
void
release_completed_operations
(
NdbConnection
*
);
friend
int
execute_no_commit
(
ha_ndbcluster
*
,
NdbConnection
*
);
friend
int
execute_commit
(
ha_ndbcluster
*
,
NdbConnection
*
);
friend
int
execute_no_commit_ie
(
ha_ndbcluster
*
,
NdbConnection
*
);
...
...
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