diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-07-01 09:48:36 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-07-01 09:48:36 +0300 |
commit | 045771c05099cf75fea036fdc89308eb3c06549a (patch) | |
tree | 181142185d3a7a612ab0ad238c938ae1e6111131 /client/mysql.cc | |
parent | 6dc1bc3a5822007cdb2d5b79f0a37b4d6b9b65c7 (diff) | |
download | mariadb-git-045771c05099cf75fea036fdc89308eb3c06549a.tar.gz |
Fix most clang-15 -Wunused-but-set-variable
Also, refactor trx_i_s_common_fill_table() to remove dead code.
Warnings about yynerrs in Bison-generated yyparse() will remain for now.
Diffstat (limited to 'client/mysql.cc')
-rw-r--r-- | client/mysql.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index ea92c84e1d1..28311defc81 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2018, Oracle and/or its affiliates. - Copyright (c) 2009, 2021, MariaDB Corporation. + Copyright (c) 2009, 2022, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3591,7 +3591,6 @@ print_table_data(MYSQL_RES *result) { String separator(256); MYSQL_ROW cur; - MYSQL_FIELD *field; bool *num_flag; num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result)); @@ -3603,7 +3602,7 @@ print_table_data(MYSQL_RES *result) mysql_field_seek(result,0); } separator.copy("+",1,charset_info); - while ((field = mysql_fetch_field(result))) + while (MYSQL_FIELD *field= mysql_fetch_field(result)) { uint length= column_names ? field->name_length : 0; if (quick) @@ -3625,7 +3624,7 @@ print_table_data(MYSQL_RES *result) { mysql_field_seek(result,0); (void) tee_fputs("|", PAGER); - for (uint off=0; (field = mysql_fetch_field(result)) ; off++) + while (MYSQL_FIELD *field= mysql_fetch_field(result)) { size_t name_length= (uint) strlen(field->name); size_t numcells= charset_info->cset->numcells(charset_info, @@ -3668,7 +3667,7 @@ print_table_data(MYSQL_RES *result) data_length= (uint) lengths[off]; } - field= mysql_fetch_field(result); + MYSQL_FIELD *field= mysql_fetch_field(result); field_max_length= field->max_length; /* |