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
66145361
Commit
66145361
authored
Apr 02, 2007
by
tomas@whalegate.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-telco-gca
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-telco-gca
parents
af78c954
dd6073f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+25
-9
No files found.
sql/ha_ndbcluster.cc
View file @
66145361
...
@@ -8499,6 +8499,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
...
@@ -8499,6 +8499,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
ndbcluster_find_all_files
(
thd
);
ndbcluster_find_all_files
(
thd
);
#endif
#endif
uint
share_list_size
=
0
;
NDB_SHARE
**
share_list
=
NULL
;
set_timespec
(
abstime
,
0
);
set_timespec
(
abstime
,
0
);
for
(;;)
for
(;;)
{
{
...
@@ -8535,7 +8537,22 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
...
@@ -8535,7 +8537,22 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
/* Lock mutex and fill list with pointers to all open tables */
/* Lock mutex and fill list with pointers to all open tables */
NDB_SHARE
*
share
;
NDB_SHARE
*
share
;
pthread_mutex_lock
(
&
ndbcluster_mutex
);
pthread_mutex_lock
(
&
ndbcluster_mutex
);
for
(
uint
i
=
0
;
i
<
ndbcluster_open_tables
.
records
;
i
++
)
uint
i
,
record_count
=
ndbcluster_open_tables
.
records
;
if
(
share_list_size
<
record_count
)
{
NDB_SHARE
**
new_share_list
=
new
NDB_SHARE
*
[
record_count
];
if
(
!
new_share_list
)
{
sql_print_warning
(
"ndb util thread: malloc failure, "
"query cache not maintained properly"
);
pthread_mutex_unlock
(
&
ndbcluster_mutex
);
goto
next
;
// At least do not crash
}
delete
[]
share_list
;
share_list_size
=
record_count
;
share_list
=
new_share_list
;
}
for
(
i
=
0
;
i
<
record_count
;
i
++
)
{
{
share
=
(
NDB_SHARE
*
)
hash_element
(
&
ndbcluster_open_tables
,
i
);
share
=
(
NDB_SHARE
*
)
hash_element
(
&
ndbcluster_open_tables
,
i
);
#ifdef HAVE_NDB_BINLOG
#ifdef HAVE_NDB_BINLOG
...
@@ -8550,14 +8567,14 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
...
@@ -8550,14 +8567,14 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
i
,
share
->
table_name
,
share
->
use_count
));
i
,
share
->
table_name
,
share
->
use_count
));
/* Store pointer to table */
/* Store pointer to table */
util_open_tables
.
push_back
(
share
)
;
share_list
[
i
]
=
share
;
}
}
pthread_mutex_unlock
(
&
ndbcluster_mutex
);
pthread_mutex_unlock
(
&
ndbcluster_mutex
);
/* Iterate through the open files list */
/* Iterate through the open files list */
List_iterator_fast
<
NDB_SHARE
>
it
(
util_open_tables
);
for
(
i
=
0
;
i
<
record_count
;
i
++
)
while
((
share
=
it
++
))
{
{
share
=
share_list
[
i
];
#ifdef HAVE_NDB_BINLOG
#ifdef HAVE_NDB_BINLOG
if
((
share
->
use_count
-
(
int
)
(
share
->
op
!=
0
)
-
(
int
)
(
share
->
op
!=
0
))
if
((
share
->
use_count
-
(
int
)
(
share
->
op
!=
0
)
-
(
int
)
(
share
->
op
!=
0
))
<=
1
)
<=
1
)
...
@@ -8611,10 +8628,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
...
@@ -8611,10 +8628,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
/* Decrease the use count and possibly free share */
/* Decrease the use count and possibly free share */
free_share
(
&
share
);
free_share
(
&
share
);
}
}
next:
/* Clear the list of open tables */
util_open_tables
.
empty
();
/* Calculate new time to wake up */
/* Calculate new time to wake up */
int
secs
=
0
;
int
secs
=
0
;
int
msecs
=
ndb_cache_check_time
;
int
msecs
=
ndb_cache_check_time
;
...
@@ -8642,6 +8656,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
...
@@ -8642,6 +8656,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
ndb_util_thread_end:
ndb_util_thread_end:
net_end
(
&
thd
->
net
);
net_end
(
&
thd
->
net
);
ndb_util_thread_fail:
ndb_util_thread_fail:
if
(
share_list
)
delete
[]
share_list
;
thd
->
cleanup
();
thd
->
cleanup
();
delete
thd
;
delete
thd
;
...
...
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