diff options
author | Bjorn Munch <Bjorn.Munch@sun.com> | 2010-01-06 09:42:21 +0100 |
---|---|---|
committer | Bjorn Munch <Bjorn.Munch@sun.com> | 2010-01-06 09:42:21 +0100 |
commit | 5b66dab00f9f7456632911a41c2b8f701cb21264 (patch) | |
tree | 5554a3567f6bd878f3e529bccafcca493f04b0cd /client | |
parent | 4d8b228c8dd9ac6da7e895373bf029826d754279 (diff) | |
download | mariadb-git-5b66dab00f9f7456632911a41c2b8f701cb21264.tar.gz |
Bug #48863 mysql test: enable and disable case insensitive compare mode
Implemented --lowercase_result which lower cases next result
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.cc | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index e2a9a2a5349..f516415f15d 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -97,7 +97,7 @@ static my_bool sp_protocol= 0, sp_protocol_enabled= 0; static my_bool view_protocol= 0, view_protocol_enabled= 0; static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0; static my_bool parsing_disabled= 0; -static my_bool display_result_vertically= FALSE, +static my_bool display_result_vertically= FALSE, display_result_lower= FALSE, display_metadata= FALSE, display_result_sorted= FALSE; static my_bool disable_query_log= 0, disable_result_log= 0; static my_bool disable_warnings= 0; @@ -272,6 +272,7 @@ enum enum_commands { Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR, Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS, Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_SORTED_RESULT, + Q_LOWERCASE, Q_START_TIMER, Q_END_TIMER, Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL, Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT, @@ -346,6 +347,7 @@ const char *command_names[]= "query_vertical", "query_horizontal", "sorted_result", + "lowercase_result", "start_timer", "end_timer", "character_set", @@ -7876,6 +7878,13 @@ int main(int argc, char **argv) */ display_result_sorted= TRUE; break; + case Q_LOWERCASE: + /* + Turn on lowercasing of result, will be reset after next + command + */ + display_result_lower= TRUE; + break; case Q_LET: do_let(command); break; case Q_EVAL_RESULT: die("'eval_result' command is deprecated"); @@ -8091,8 +8100,9 @@ int main(int argc, char **argv) */ free_all_replace(); - /* Also reset "sorted_result" */ + /* Also reset "sorted_result" and "lowercase"*/ display_result_sorted= FALSE; + display_result_lower= FALSE; } last_command_executed= command_executed; @@ -9496,6 +9506,18 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds, fix_win_paths(val, len); #endif + if (display_result_lower) + { + /* Convert to lower case, and do this first */ + char lower[512]; + char *c= lower; + for (const char *v= val; *v; v++) + *c++= my_tolower(charset_info, *v); + *c= '\0'; + /* Copy from this buffer instead */ + val= lower; + } + if (glob_replace_regex) { /* Regex replace */ |