diff --git a/client/mysql.cc b/client/mysql.cc
index 624e97236aa..e035d15d809 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -3754,9 +3754,10 @@ print_table_data_html(MYSQL_RES *result)
MYSQL_FIELD *field;
mysql_field_seek(result,0);
- (void) tee_fputs("
", PAGER);
+ (void) tee_fputs("", PAGER);
if (column_names)
{
+ (void) tee_fputs("", PAGER);
while((field = mysql_fetch_field(result)))
{
tee_fputs("", PAGER);
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index ffa5d020153..d23c7965af4 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -613,3 +613,7 @@ count(*)
0
truncate table t1;
drop table t1;
+#
+# MDEV-15538 '-N' Produce html output wrong
+#
+
\ No newline at end of file
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index f526a3fea91..54033606b53 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -678,3 +678,9 @@ select count(*) from t1; truncate table t1;
--exec $MYSQL --disable-local-infile -e "/*q*/$ldli"
select count(*) from t1; truncate table t1;
drop table t1;
+
+
+--echo #
+--echo # MDEV-15538 '-N' Produce html output wrong
+--echo #
+--exec $MYSQL -NHe "select 1 as a"
|