Skip to content

Commit 6768f80

Browse files
Bug#21973610
Post push fix : Fixing i_main.mysqlshow failure.
1 parent 3b6f9aa commit 6768f80

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

client/mysqlshow.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ list_table_status(MYSQL *mysql,const char *db,const char *wild)
655655
len= sizeof(query);
656656
len-= my_snprintf(query, len, "show table status from `%s`", db);
657657
if (wild && wild[0] && len)
658-
strxnmov(query + strlen(query), len, " like '", wild, "'", NullS);
658+
strxnmov(query + strlen(query), len - 1, " like '", wild, "'", NullS);
659659
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
660660
{
661661
fprintf(stderr,"%s: Cannot get status for db: %s, table: %s: %s\n",
@@ -688,7 +688,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
688688
const char *wild)
689689
{
690690
char query[NAME_LEN + 100];
691-
int len;
691+
size_t len;
692692
MYSQL_RES *result;
693693
MYSQL_ROW row;
694694
ulong UNINIT_VAR(rows);
@@ -718,7 +718,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
718718
len-= my_snprintf(query, len, "show /*!32332 FULL */ columns from `%s`",
719719
table);
720720
if (wild && wild[0] && len)
721-
strxnmov(query + strlen(query), len, " like '", wild, "'", NullS);
721+
strxnmov(query + strlen(query), len - 1, " like '", wild, "'", NullS);
722722
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
723723
{
724724
fprintf(stderr,"%s: Cannot list columns in db: %s, table: %s: %s\n",

0 commit comments

Comments
 (0)