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
Hide 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){
void
run_query
(
struct
st_connection
*
cn
,
struct
st_command
*
command
,
int
flags
)
{
MYSQL
*
mysql
=
cn
->
mysql
;
DYNAMIC_STRING
*
ds
;
DYNAMIC_STRING
*
save_ds
=
NULL
;
DYNAMIC_STRING
ds_result
;
DYNAMIC_STRING
ds_sorted
;
DYNAMIC_STRING
ds_warnings
;
DYNAMIC_STRING
*
rs_output
;
/* where to put results */
DYNAMIC_STRING
rs_cmp_result
;
/* here we put results to compare with
pre-recrded file */
DYNAMIC_STRING
rs_unsorted
;
/* if we need sorted results, here we store
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
;
size_t
query_len
;
my_bool
view_created
=
0
,
sp_created
=
0
;
...
...
@@ -9008,10 +9011,10 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
if
(
!
(
flags
&
QUERY_SEND_FLAG
)
&&
!
cn
->
pending
)
die
(
"Cannot reap on a connection without pending send"
);
init_dynamic_string
(
&
d
s_warnings
,
NULL
,
0
,
256
);
ds_warn
=
&
d
s_warnings
;
init_dynamic_string
(
&
r
s_warnings
,
NULL
,
0
,
256
);
ds_warn
=
&
r
s_warnings
;
/*
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)
*/
if
(
command
->
require_file
)
{
init_dynamic_string
(
&
ds
_result
,
""
,
1024
,
1024
);
ds
=
&
ds
_result
;
init_dynamic_string
(
&
rs_cmp
_result
,
""
,
1024
,
1024
);
rs_output
=
&
rs_cmp
_result
;
}
else
ds
=
&
ds_res
;
rs_output
=
&
ds_res
;
// will be shown to colsole
/*
Log the query into the output buffer
...
...
@@ -9059,9 +9062,9 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
print_query
=
command
->
query
;
print_len
=
(
int
)(
command
->
end
-
command
->
query
);
}
replace_dynstr_append_mem
(
ds
,
print_query
,
print_len
);
dynstr_append_mem
(
ds
,
delimiter
,
delimiter_length
);
dynstr_append_mem
(
ds
,
"
\n
"
,
1
);
replace_dynstr_append_mem
(
rs_output
,
print_query
,
print_len
);
dynstr_append_mem
(
rs_output
,
delimiter
,
delimiter_length
);
dynstr_append_mem
(
rs_output
,
"
\n
"
,
1
);
}
/* We're done with this flag */
...
...
@@ -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
have been produced when the SELECT was executed
*/
append_warnings
(
&
d
s_warnings
,
append_warnings
(
&
r
s_warnings
,
service_connection_enabled
?
cur_con
->
util_mysql
:
mysql
);
...
...
@@ -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
global result string
*/
init_dynamic_string
(
&
ds_
sorted
,
""
,
1024
,
1024
);
save_ds
=
ds
;
/* Remember original ds */
ds
=
&
ds_
sorted
;
init_dynamic_string
(
&
rs_un
sorted
,
""
,
1024
,
1024
);
rs_sorted_save
=
rs_output
;
/* Remember original ds */
rs_output
=
&
rs_un
sorted
;
}
/*
...
...
@@ -9189,20 +9192,20 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
if
(
ps_protocol_enabled
&&
complete_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
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
;
if
(
display_result_sorted
)
{
/* Sort the result set and append it to result */
dynstr_append_sorted
(
save_ds
,
&
ds_
sorted
,
1
);
ds
=
save_ds
;
dynstr_free
(
&
ds_
sorted
);
dynstr_append_sorted
(
rs_sorted_save
,
&
rs_un
sorted
,
1
);
rs_output
=
rs_sorted_save
;
dynstr_free
(
&
rs_un
sorted
);
}
if
(
sp_created
)
...
...
@@ -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
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
)
dynstr_free
(
&
ds
_result
);
if
(
rs_output
==
&
rs_cmp
_result
)
dynstr_free
(
&
rs_cmp
_result
);
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