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
83a7bbf7
Commit
83a7bbf7
authored
Nov 16, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merging
parent
17c238a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
client/mysqltest.c
client/mysqltest.c
+14
-19
No files found.
client/mysqltest.c
View file @
83a7bbf7
...
...
@@ -183,18 +183,6 @@ DYNAMIC_ARRAY q_lines;
#include "sslopt-vars.h"
struct
connection
{
MYSQL
mysql
;
char
*
name
;
const
char
*
cur_query
;
int
cur_query_len
;
pthread_mutex_t
mutex
;
pthread_cond_t
cond
;
int
query_done
;
};
struct
{
int
read_lines
,
current_line
;
...
...
@@ -234,6 +222,12 @@ struct st_connection
MYSQL
*
util_mysql
;
char
*
name
;
MYSQL_STMT
*
stmt
;
const
char
*
cur_query
;
int
cur_query_len
;
pthread_mutex_t
mutex
;
pthread_cond_t
cond
;
int
query_done
;
};
struct
st_connection
connections
[
128
];
struct
st_connection
*
cur_con
,
*
next_con
,
*
connections_end
;
...
...
@@ -493,7 +487,7 @@ void handle_no_error(struct st_command*);
*/
pthread_handler_decl
(
send_one_query
,
arg
)
{
struct
connection
*
cn
=
(
struct
connection
*
)
arg
;
struct
st_connection
*
cn
=
(
struct
st_
connection
*
)
arg
;
mysql_thread_init
();
VOID
(
mysql_send_query
(
&
cn
->
mysql
,
cn
->
cur_query
,
cn
->
cur_query_len
));
...
...
@@ -507,7 +501,7 @@ pthread_handler_decl(send_one_query, arg)
return
0
;
}
static
int
do_send_query
(
struct
connection
*
cn
,
const
char
*
q
,
int
q_len
,
static
int
do_send_query
(
struct
st_
connection
*
cn
,
const
char
*
q
,
int
q_len
,
int
flags
)
{
pthread_t
tid
;
...
...
@@ -4570,7 +4564,7 @@ int append_warnings(DYNAMIC_STRING *ds, MYSQL* mysql)
error - function will not return
*/
void
run_query_normal
(
struct
connection
*
cn
,
*
mysql
,
struct
st_command
*
command
,
void
run_query_normal
(
struct
st_connection
*
cn
,
struct
st_command
*
command
,
int
flags
,
char
*
query
,
int
query_len
,
DYNAMIC_STRING
*
ds
,
DYNAMIC_STRING
*
ds_warnings
)
{
...
...
@@ -4598,7 +4592,7 @@ void run_query_normal(struct connection *cn, *mysql, struct st_command *command,
Here we handle 'reap' command, so we need to check if the
query's thread was finished and probably wait
*/
else
if
(
flags
&
QUERY_REAP
)
else
if
(
flags
&
QUERY_REAP
_FLAG
)
{
pthread_mutex_lock
(
&
cn
->
mutex
);
while
(
!
cn
->
query_done
)
...
...
@@ -5096,8 +5090,9 @@ int util_query(MYSQL* org_mysql, const char* query){
*/
void
run_query
(
MYSQL
*
mysql
,
struct
st_command
*
command
,
int
flags
)
void
run_query
(
struct
st_connection
*
cn
,
struct
st_command
*
command
,
int
flags
)
{
MYSQL
*
mysql
=
&
cn
->
mysql
;
DYNAMIC_STRING
*
ds
;
DYNAMIC_STRING
ds_result
;
DYNAMIC_STRING
ds_warnings
;
...
...
@@ -5254,7 +5249,7 @@ void run_query(MYSQL *mysql, struct st_command *command, int flags)
match_re
(
&
ps_re
,
query
))
run_query_stmt
(
mysql
,
command
,
query
,
query_len
,
ds
,
&
ds_warnings
);
else
run_query_normal
(
mysql
,
command
,
flags
,
query
,
query_len
,
run_query_normal
(
cn
,
command
,
flags
,
query
,
query_len
,
ds
,
&
ds_warnings
);
if
(
sp_created
)
...
...
@@ -5746,7 +5741,7 @@ int main(int argc, char **argv)
strmake
(
command
->
require_file
,
save_file
,
sizeof
(
save_file
));
save_file
[
0
]
=
0
;
}
run_query
(
cur
,
command
,
flags
);
run_query
(
cur
_con
,
command
,
flags
);
command_executed
++
;
command
->
last_argument
=
command
->
end
;
break
;
...
...
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