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
83449d9f
Commit
83449d9f
authored
May 10, 2007
by
kostja@vajra.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge vajra.(none):/opt/local/work/mysql-5.0-21483
into vajra.(none):/opt/local/work/mysql-5.1-runtime
parents
5a4a26ef
0d6e93e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
sql/sql_class.h
sql/sql_class.h
+2
-2
sql/sql_insert.cc
sql/sql_insert.cc
+23
-23
No files found.
sql/sql_class.h
View file @
83449d9f
...
...
@@ -172,7 +172,7 @@ public:
#include "sql_lex.h"
/* Must be here */
class
d
elayed_insert
;
class
D
elayed_insert
;
class
select_result
;
class
Time_zone
;
...
...
@@ -1002,7 +1002,7 @@ public:
time_t
start_time
,
time_after_lock
,
user_time
;
time_t
connect_time
,
thr_create_time
;
// track down slow pthread_create
thr_lock_type
update_lock_default
;
d
elayed_insert
*
di
;
D
elayed_insert
*
di
;
/* <> 0 if we are inside of trigger or stored function. */
uint
in_sub_stmt
;
...
...
sql/sql_insert.cc
View file @
83449d9f
...
...
@@ -29,7 +29,7 @@
waited for to open and lock the table.
If accessing the thread succeeded, in
d
elayed_insert::get_local_table() the table of the thread is copied
D
elayed_insert::get_local_table() the table of the thread is copied
for local use. A copy is required because the normal insert logic
works on a target table, but the other threads table object must not
be used. The insert logic uses the record buffer to create a record.
...
...
@@ -1549,13 +1549,13 @@ public:
};
/**
d
elayed_insert - context of a thread responsible for delayed insert
D
elayed_insert - context of a thread responsible for delayed insert
into one table. When processing delayed inserts, we create an own
thread for every distinct table. Later on all delayed inserts directed
into that table are handled by a dedicated thread.
*/
class
d
elayed_insert
:
public
ilink
{
class
D
elayed_insert
:
public
ilink
{
uint
locks_in_memory
;
public:
THD
thd
;
...
...
@@ -1569,7 +1569,7 @@ public:
ulong
group_count
;
TABLE_LIST
table_list
;
// Argument
d
elayed_insert
()
D
elayed_insert
()
:
locks_in_memory
(
0
),
table
(
0
),
tables_in_use
(
0
),
stacked_inserts
(
0
),
status
(
0
),
dead
(
0
),
group_count
(
0
)
...
...
@@ -1599,7 +1599,7 @@ public:
delayed_insert_threads
++
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
}
~
d
elayed_insert
()
~
D
elayed_insert
()
{
/* The following is not really needed, but just for safety */
delayed_row
*
row
;
...
...
@@ -1647,7 +1647,7 @@ public:
};
I_List
<
d
elayed_insert
>
delayed_threads
;
I_List
<
D
elayed_insert
>
delayed_threads
;
/**
...
...
@@ -1656,12 +1656,12 @@ I_List<delayed_insert> delayed_threads;
*/
static
d
elayed_insert
*
find_handler
(
THD
*
thd
,
TABLE_LIST
*
table_list
)
D
elayed_insert
*
find_handler
(
THD
*
thd
,
TABLE_LIST
*
table_list
)
{
thd
->
proc_info
=
"waiting for delay_list"
;
pthread_mutex_lock
(
&
LOCK_delayed_insert
);
// Protect master list
I_List_iterator
<
d
elayed_insert
>
it
(
delayed_threads
);
d
elayed_insert
*
tmp
;
I_List_iterator
<
D
elayed_insert
>
it
(
delayed_threads
);
D
elayed_insert
*
tmp
;
while
((
tmp
=
it
++
))
{
if
(
!
strcmp
(
tmp
->
thd
.
db
,
table_list
->
db
)
&&
...
...
@@ -1680,7 +1680,7 @@ delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
Attempt to find or create a delayed insert thread to handle inserts
into this table.
@return Return a
n instance
of the table in the delayed thread
@return Return a
local copy
of the table in the delayed thread
@retval NULL too many delayed threads OR
this thread ran out of resources OR
a newly created delayed insert thread ran out of resources OR
...
...
@@ -1691,7 +1691,7 @@ delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
static
TABLE
*
delayed_get_table
(
THD
*
thd
,
TABLE_LIST
*
table_list
)
{
int
error
;
d
elayed_insert
*
tmp
;
D
elayed_insert
*
tmp
;
TABLE
*
table
;
DBUG_ENTER
(
"delayed_get_table"
);
...
...
@@ -1715,9 +1715,9 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
*/
if
(
!
(
tmp
=
find_handler
(
thd
,
table_list
)))
{
if
(
!
(
tmp
=
new
d
elayed_insert
()))
if
(
!
(
tmp
=
new
D
elayed_insert
()))
{
my_error
(
ER_OUTOFMEMORY
,
MYF
(
0
),
sizeof
(
d
elayed_insert
));
my_error
(
ER_OUTOFMEMORY
,
MYF
(
0
),
sizeof
(
D
elayed_insert
));
goto
err1
;
}
pthread_mutex_lock
(
&
LOCK_thread_count
);
...
...
@@ -1809,14 +1809,14 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
function.
*/
TABLE
*
d
elayed_insert
::
get_local_table
(
THD
*
client_thd
)
TABLE
*
D
elayed_insert
::
get_local_table
(
THD
*
client_thd
)
{
my_ptrdiff_t
adjust_ptrs
;
Field
**
field
,
**
org_field
,
*
found_next_number_field
;
TABLE
*
copy
;
TABLE_SHARE
*
share
=
table
->
s
;
byte
*
bitmap
;
DBUG_ENTER
(
"
d
elayed_insert::get_local_table"
);
DBUG_ENTER
(
"
D
elayed_insert::get_local_table"
);
/* First request insert thread to get a lock */
status
=
1
;
...
...
@@ -1926,7 +1926,7 @@ write_delayed(THD *thd,TABLE *table, enum_duplicates duplic,
LEX_STRING
query
,
bool
ignore
,
bool
log_on
)
{
delayed_row
*
row
=
0
;
d
elayed_insert
*
di
=
thd
->
di
;
D
elayed_insert
*
di
=
thd
->
di
;
const
Discrete_interval
*
forced_auto_inc
;
DBUG_ENTER
(
"write_delayed"
);
DBUG_PRINT
(
"enter"
,
(
"query = '%s' length %u"
,
query
.
str
,
query
.
length
));
...
...
@@ -2009,7 +2009,7 @@ write_delayed(THD *thd,TABLE *table, enum_duplicates duplic,
static
void
end_delayed_insert
(
THD
*
thd
)
{
DBUG_ENTER
(
"end_delayed_insert"
);
d
elayed_insert
*
di
=
thd
->
di
;
D
elayed_insert
*
di
=
thd
->
di
;
pthread_mutex_lock
(
&
di
->
mutex
);
DBUG_PRINT
(
"info"
,(
"tables in use: %d"
,
di
->
tables_in_use
));
if
(
!--
di
->
tables_in_use
||
di
->
thd
.
killed
)
...
...
@@ -2028,8 +2028,8 @@ void kill_delayed_threads(void)
{
VOID
(
pthread_mutex_lock
(
&
LOCK_delayed_insert
));
// For unlink from list
I_List_iterator
<
d
elayed_insert
>
it
(
delayed_threads
);
d
elayed_insert
*
tmp
;
I_List_iterator
<
D
elayed_insert
>
it
(
delayed_threads
);
D
elayed_insert
*
tmp
;
while
((
tmp
=
it
++
))
{
tmp
->
thd
.
killed
=
THD
::
KILL_CONNECTION
;
...
...
@@ -2061,7 +2061,7 @@ void kill_delayed_threads(void)
pthread_handler_t
handle_delayed_insert
(
void
*
arg
)
{
delayed_insert
*
di
=
(
d
elayed_insert
*
)
arg
;
Delayed_insert
*
di
=
(
D
elayed_insert
*
)
arg
;
THD
*
thd
=
&
di
->
thd
;
pthread_detach_this_thread
();
...
...
@@ -2312,7 +2312,7 @@ static void free_delayed_insert_blobs(register TABLE *table)
}
bool
d
elayed_insert
::
handle_inserts
(
void
)
bool
D
elayed_insert
::
handle_inserts
(
void
)
{
int
error
;
ulong
max_rows
;
...
...
@@ -3469,8 +3469,8 @@ void select_create::abort()
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
template
class
List_iterator_fast
<
List_item
>;
#ifndef EMBEDDED_LIBRARY
template
class
I_List
<
d
elayed_insert
>;
template
class
I_List_iterator
<
d
elayed_insert
>;
template
class
I_List
<
D
elayed_insert
>;
template
class
I_List_iterator
<
D
elayed_insert
>;
template
class
I_List
<
delayed_row
>;
#endif
/* EMBEDDED_LIBRARY */
#endif
/* HAVE_EXPLICIT_TEMPLATE_INSTANTIATION */
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