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
0ad48394
Commit
0ad48394
authored
Nov 22, 2023
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename variables to make operation comprehansive
parent
ff0bade2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
28 deletions
+31
-28
client/mysqltest.cc
client/mysqltest.cc
+31
-28
No files found.
client/mysqltest.cc
View file @
0ad48394
...
@@ -8991,11 +8991,14 @@ int util_query(MYSQL* org_mysql, const char* query){
...
@@ -8991,11 +8991,14 @@ int util_query(MYSQL* org_mysql, const char* query){
void
run_query
(
struct
st_connection
*
cn
,
struct
st_command
*
command
,
int
flags
)
void
run_query
(
struct
st_connection
*
cn
,
struct
st_command
*
command
,
int
flags
)
{
{
MYSQL
*
mysql
=
cn
->
mysql
;
MYSQL
*
mysql
=
cn
->
mysql
;
DYNAMIC_STRING
*
ds
;
DYNAMIC_STRING
*
rs_output
;
/* where to put results */
DYNAMIC_STRING
*
save_ds
=
NULL
;
DYNAMIC_STRING
rs_cmp_result
;
/* here we put results to compare with
DYNAMIC_STRING
ds_result
;
pre-recrded file */
DYNAMIC_STRING
ds_sorted
;
DYNAMIC_STRING
rs_unsorted
;
/* if we need sorted results, here we store
DYNAMIC_STRING
ds_warnings
;
results before sorting them */
DYNAMIC_STRING
*
rs_sorted_save
=
NULL
;
/* here we store where to put sorted
result if needed */
DYNAMIC_STRING
rs_warnings
;
char
*
query
;
char
*
query
;
size_t
query_len
;
size_t
query_len
;
my_bool
view_created
=
0
,
sp_created
=
0
;
my_bool
view_created
=
0
,
sp_created
=
0
;
...
@@ -9009,8 +9012,8 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
...
@@ -9009,8 +9012,8 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
if
(
!
(
flags
&
QUERY_SEND_FLAG
)
&&
!
cn
->
pending
)
if
(
!
(
flags
&
QUERY_SEND_FLAG
)
&&
!
cn
->
pending
)
die
(
"Cannot reap on a connection without pending send"
);
die
(
"Cannot reap on a connection without pending send"
);
init_dynamic_string
(
&
d
s_warnings
,
NULL
,
0
,
256
);
init_dynamic_string
(
&
r
s_warnings
,
NULL
,
0
,
256
);
ds_warn
=
&
d
s_warnings
;
ds_warn
=
&
r
s_warnings
;
/*
/*
Evaluate query if this is an eval command
Evaluate query if this is an eval command
...
@@ -9041,11 +9044,11 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
...
@@ -9041,11 +9044,11 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
*/
*/
if
(
command
->
require_file
)
if
(
command
->
require_file
)
{
{
init_dynamic_string
(
&
ds
_result
,
""
,
1024
,
1024
);
init_dynamic_string
(
&
rs_cmp
_result
,
""
,
1024
,
1024
);
ds
=
&
ds
_result
;
rs_output
=
&
rs_cmp
_result
;
}
}
else
else
ds
=
&
ds_res
;
rs_output
=
&
ds_res
;
// will be shown to colsole
/*
/*
Log the query into the output buffer
Log the query into the output buffer
...
@@ -9059,9 +9062,9 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
...
@@ -9059,9 +9062,9 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
print_query
=
command
->
query
;
print_query
=
command
->
query
;
print_len
=
(
int
)(
command
->
end
-
command
->
query
);
print_len
=
(
int
)(
command
->
end
-
command
->
query
);
}
}
replace_dynstr_append_mem
(
ds
,
print_query
,
print_len
);
replace_dynstr_append_mem
(
rs_output
,
print_query
,
print_len
);
dynstr_append_mem
(
ds
,
delimiter
,
delimiter_length
);
dynstr_append_mem
(
rs_output
,
delimiter
,
delimiter_length
);
dynstr_append_mem
(
ds
,
"
\n
"
,
1
);
dynstr_append_mem
(
rs_output
,
"
\n
"
,
1
);
}
}
/* We're done with this flag */
/* We're done with this flag */
...
@@ -9116,7 +9119,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
...
@@ -9116,7 +9119,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
Collect warnings from create of the view that should otherwise
Collect warnings from create of the view that should otherwise
have been produced when the SELECT was executed
have been produced when the SELECT was executed
*/
*/
append_warnings
(
&
d
s_warnings
,
append_warnings
(
&
r
s_warnings
,
service_connection_enabled
?
service_connection_enabled
?
cur_con
->
util_mysql
:
cur_con
->
util_mysql
:
mysql
);
mysql
);
...
@@ -9172,9 +9175,9 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
...
@@ -9172,9 +9175,9 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
that can be sorted before it's added to the
that can be sorted before it's added to the
global result string
global result string
*/
*/
init_dynamic_string
(
&
ds_
sorted
,
""
,
1024
,
1024
);
init_dynamic_string
(
&
rs_un
sorted
,
""
,
1024
,
1024
);
save_ds
=
ds
;
/* Remember original ds */
rs_sorted_save
=
rs_output
;
/* Remember original ds */
ds
=
&
ds_
sorted
;
rs_output
=
&
rs_un
sorted
;
}
}
/*
/*
...
@@ -9189,20 +9192,20 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
...
@@ -9189,20 +9192,20 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
if
(
ps_protocol_enabled
&&
if
(
ps_protocol_enabled
&&
complete_query
&&
complete_query
&&
match_re
(
&
ps_re
,
query
))
match_re
(
&
ps_re
,
query
))
run_query_stmt
(
cn
,
command
,
query
,
query_len
,
ds
,
&
d
s_warnings
);
run_query_stmt
(
cn
,
command
,
query
,
query_len
,
rs_output
,
&
r
s_warnings
);
else
else
run_query_normal
(
cn
,
command
,
flags
,
query
,
query_len
,
run_query_normal
(
cn
,
command
,
flags
,
query
,
query_len
,
ds
,
&
d
s_warnings
);
rs_output
,
&
r
s_warnings
);
dynstr_free
(
&
d
s_warnings
);
dynstr_free
(
&
r
s_warnings
);
ds_warn
=
0
;
ds_warn
=
0
;
if
(
display_result_sorted
)
if
(
display_result_sorted
)
{
{
/* Sort the result set and append it to result */
/* Sort the result set and append it to result */
dynstr_append_sorted
(
save_ds
,
&
ds_
sorted
,
1
);
dynstr_append_sorted
(
rs_sorted_save
,
&
rs_un
sorted
,
1
);
ds
=
save_ds
;
rs_output
=
rs_sorted_save
;
dynstr_free
(
&
ds_
sorted
);
dynstr_free
(
&
rs_un
sorted
);
}
}
if
(
sp_created
)
if
(
sp_created
)
...
@@ -9225,11 +9228,11 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
...
@@ -9225,11 +9228,11 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
and the output should be checked against an already
and the output should be checked against an already
existing file which has been specified using --require or --result
existing file which has been specified using --require or --result
*/
*/
check_require
(
ds
,
command
->
require_file
);
check_require
(
rs_output
,
command
->
require_file
);
}
}
if
(
ds
==
&
ds
_result
)
if
(
rs_output
==
&
rs_cmp
_result
)
dynstr_free
(
&
ds
_result
);
dynstr_free
(
&
rs_cmp
_result
);
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
...
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