Skip to content

Commit 6535309

Browse files
author
Tor Didriksen
committed
Fix broken build for gcc 7 in MySQL 5.6
Even with -DMYSQL_MAINTAINER_MODE=0 the build is broken with gcc 7 sql/sql_acl.cc:2732:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] DBUG_ASSERT(host != '\0'); Fix: compare with 0 rather than '\0'
1 parent d1dc6fa commit 6535309

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sql/sql_acl.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -2729,7 +2729,7 @@ bool change_password(THD *thd, const char *host, const char *user,
27292729
}
27302730
mysql_mutex_assert_owner(&acl_cache->lock);
27312731
table->use_all_columns();
2732-
DBUG_ASSERT(host != '\0');
2732+
DBUG_ASSERT(host != 0);
27332733
table->field[MYSQL_USER_FIELD_HOST]->store(host, strlen(host),
27342734
system_charset_info);
27352735
table->field[MYSQL_USER_FIELD_USER]->store(user, strlen(user),
@@ -3166,7 +3166,7 @@ update_user_table(THD *thd, TABLE *table,
31663166
if (!is_user_table_positioned)
31673167
{
31683168
table->use_all_columns();
3169-
DBUG_ASSERT(host != '\0');
3169+
DBUG_ASSERT(host != 0);
31703170
table->field[MYSQL_USER_FIELD_HOST]->store(host, (uint) strlen(host),
31713171
system_charset_info);
31723172
table->field[MYSQL_USER_FIELD_USER]->store(user, (uint) strlen(user),
@@ -3302,7 +3302,7 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
33023302
goto end;
33033303

33043304
table->use_all_columns();
3305-
DBUG_ASSERT(combo->host.str != '\0');
3305+
DBUG_ASSERT(combo->host.str != 0);
33063306
table->field[MYSQL_USER_FIELD_HOST]->store(combo->host.str,combo->host.length,
33073307
system_charset_info);
33083308
table->field[MYSQL_USER_FIELD_USER]->store(combo->user.str,combo->user.length,
@@ -3393,7 +3393,7 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
33933393

33943394
old_row_exists = 0;
33953395
restore_record(table,s->default_values);
3396-
DBUG_ASSERT(combo->host.str != '\0');
3396+
DBUG_ASSERT(combo->host.str != 0);
33973397
table->field[MYSQL_USER_FIELD_HOST]->store(combo->host.str,combo->host.length,
33983398
system_charset_info);
33993399
table->field[MYSQL_USER_FIELD_USER]->store(combo->user.str,combo->user.length,

0 commit comments

Comments
 (0)