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
45ec2059
Commit
45ec2059
authored
Sep 14, 2010
by
Bjorn Munch
Browse files
Options
Browse Files
Download
Plain Diff
upmerge 55426(55546), 56647
parents
4698ed2b
4e23534b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
client/mysqltest.cc
client/mysqltest.cc
+11
-5
No files found.
client/mysqltest.cc
View file @
45ec2059
...
...
@@ -252,7 +252,9 @@ struct st_connection
int
cur_query_len
;
pthread_mutex_t
mutex
;
pthread_cond_t
cond
;
pthread_t
tid
;
int
query_done
;
my_bool
has_thread
;
#endif
/*EMBEDDED_LIBRARY*/
};
...
...
@@ -732,8 +734,6 @@ pthread_handler_t send_one_query(void *arg)
static
int
do_send_query
(
struct
st_connection
*
cn
,
const
char
*
q
,
int
q_len
,
int
flags
)
{
pthread_t
tid
;
if
(
flags
&
QUERY_REAP_FLAG
)
return
mysql_send_query
(
&
cn
->
mysql
,
q
,
q_len
);
...
...
@@ -744,9 +744,10 @@ static int do_send_query(struct st_connection *cn, const char *q, int q_len,
cn
->
cur_query
=
q
;
cn
->
cur_query_len
=
q_len
;
cn
->
query_done
=
0
;
if
(
pthread_create
(
&
tid
,
&
cn_thd_attrib
,
send_one_query
,
(
void
*
)
cn
))
if
(
pthread_create
(
&
cn
->
tid
,
&
cn_thd_attrib
,
send_one_query
,
(
void
*
)
cn
))
die
(
"Cannot start new thread for query"
);
cn
->
has_thread
=
TRUE
;
return
0
;
}
...
...
@@ -759,6 +760,11 @@ static void wait_query_thread_end(struct st_connection *con)
pthread_cond_wait
(
&
con
->
cond
,
&
con
->
mutex
);
pthread_mutex_unlock
(
&
con
->
mutex
);
}
if
(
con
->
has_thread
)
{
pthread_join
(
con
->
tid
,
NULL
);
con
->
has_thread
=
FALSE
;
}
}
#else
/*EMBEDDED_LIBRARY*/
...
...
@@ -5217,6 +5223,7 @@ void do_connect(struct st_command *command)
#ifdef EMBEDDED_LIBRARY
con_slot
->
query_done
=
1
;
con_slot
->
has_thread
=
FALSE
;
#endif
if
(
!
mysql_init
(
&
con_slot
->
mysql
))
die
(
"Failed on mysql_init()"
);
...
...
@@ -7353,11 +7360,10 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
(
flags
&
QUERY_REAP_FLAG
));
DBUG_ENTER
(
"run_query"
);
init_dynamic_string
(
&
ds_warnings
,
NULL
,
0
,
256
);
if
(
cn
->
pending
&&
(
flags
&
QUERY_SEND_FLAG
))
die
(
"Cannot run query on connection between send and reap"
);
init_dynamic_string
(
&
ds_warnings
,
NULL
,
0
,
256
);
/*
Evaluate query if this is an eval command
*/
...
...
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