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
ab71bd7e
Commit
ab71bd7e
authored
Feb 20, 2006
by
ingo@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/mydev/mysql-4.1-bug5390
into mysql.com:/home/mydev/mysql-5.0-bug5390
parents
73907f53
fdcac814
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
sql/lock.cc
sql/lock.cc
+18
-4
No files found.
sql/lock.cc
View file @
ab71bd7e
...
...
@@ -155,7 +155,14 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
}
thd
->
proc_info
=
"Table lock"
;
thd
->
locked
=
1
;
rc
=
thr_lock_errno_to_mysql
[(
int
)
thr_multi_lock
(
sql_lock
->
locks
,
/* Copy the lock data array. thr_multi_lock() reorders its contens. */
memcpy
(
sql_lock
->
locks
+
sql_lock
->
lock_count
,
sql_lock
->
locks
,
sql_lock
->
lock_count
*
sizeof
(
*
sql_lock
->
locks
));
/* Lock on the copied half of the lock data array. */
if
(
thr_multi_lock
(
sql_lock
->
locks
+
sql_lock
->
lock_count
,
sql_lock
->
lock_count
))
rc
=
thr_lock_errno_to_mysql
[(
int
)
thr_multi_lock
(
sql_lock
->
locks
+
sql_lock
->
lock_count
,
sql_lock
->
lock_count
,
thd
->
lock_id
)];
if
(
rc
>
1
)
/* a timeout or a deadlock */
...
...
@@ -659,13 +666,20 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
}
}
/*
Allocating twice the number of pointers for lock data for use in
thr_mulit_lock(). This function reorders the lock data, but cannot
update the table values. So the second part of the array is copied
from the first part immediately before calling thr_multi_lock().
*/
if
(
!
(
sql_lock
=
(
MYSQL_LOCK
*
)
my_malloc
(
sizeof
(
*
sql_lock
)
+
sizeof
(
THR_LOCK_DATA
*
)
*
tables
+
sizeof
(
table_ptr
)
*
lock_count
,
my_malloc
(
sizeof
(
*
sql_lock
)
+
sizeof
(
THR_LOCK_DATA
*
)
*
tables
*
2
+
sizeof
(
table_ptr
)
*
lock_count
,
MYF
(
0
))))
DBUG_RETURN
(
0
);
locks
=
locks_buf
=
sql_lock
->
locks
=
(
THR_LOCK_DATA
**
)
(
sql_lock
+
1
);
to
=
table_buf
=
sql_lock
->
table
=
(
TABLE
**
)
(
locks
+
tables
);
to
=
table_buf
=
sql_lock
->
table
=
(
TABLE
**
)
(
locks
+
tables
*
2
);
sql_lock
->
table_count
=
lock_count
;
sql_lock
->
lock_count
=
tables
;
...
...
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