summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Winstead <jimw@mysql.com>2009-09-21 15:20:14 -0700
committerJim Winstead <jimw@mysql.com>2009-09-21 15:20:14 -0700
commit8f4d1026de4fdac693da5639e5c6f3f6753075fa (patch)
tree349dbd6d8fb52bdd13c9df724c2b902367d355b8
parentd6ca0cbb23544e2e033f512f400a91ce6245a9a4 (diff)
downloadmariadb-git-8f4d1026de4fdac693da5639e5c6f3f6753075fa.tar.gz
The mysql command line client ignored the --skip-column-names option
when used in conjunction with --vertical. (Bug #47147, patch by Harrison Fisk)
-rw-r--r--client/mysql.cc3
-rw-r--r--mysql-test/r/mysql.result11
-rw-r--r--mysql-test/t/mysql.test5
3 files changed, 15 insertions, 4 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index bafd173343e..c579d0ccaaa 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -3510,7 +3510,8 @@ print_table_data_vertically(MYSQL_RES *result)
for (uint off=0; off < mysql_num_fields(result); off++)
{
field= mysql_fetch_field(result);
- tee_fprintf(PAGER, "%*s: ",(int) max_length,field->name);
+ if (column_names)
+ tee_fprintf(PAGER, "%*s: ",(int) max_length,field->name);
if (cur[off])
{
unsigned int i;
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index c02073df677..32917888b81 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -162,8 +162,8 @@ ERROR 1049 (42000) at line 1: Unknown database 'invalid'
ERROR 1049 (42000) at line 1: Unknown database 'invalid'
Test connect with dbname + hostname
Test connect with dbname + _invalid_ hostname
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
+ERROR 2003 (HY000) at line 1: Can't connect to MySQL server on 'invalid_hostname' (errno)
+ERROR 2003 (HY000) at line 1: Can't connect to MySQL server on 'invalid_hostname' (errno)
The commands reported in the bug report
ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyril has found a bug :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (errno)
Too long dbname
@@ -198,7 +198,7 @@ COUNT (*)
1
COUNT (*)
1
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
+ERROR 2003 (HY000) at line 1: Can't connect to MySQL server on 'invalid_hostname' (errno)
End of 5.0 tests
WARNING: --server-arg option not supported in this configuration.
Warning (Code 1286): Unknown table engine 'nonexistent'
@@ -230,4 +230,9 @@ a: b
</resultset>
drop table t1;
+Bug #47147: mysql client option --skip-column-names does not apply to vertical output
+
+*************************** 1. row ***************************
+1
+
End of tests
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index cffa6392fa3..7b87ae10e59 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -402,4 +402,9 @@ insert into t1 values ('\0b\0');
drop table t1;
--echo
+--echo Bug #47147: mysql client option --skip-column-names does not apply to vertical output
+--echo
+--exec $MYSQL --skip-column-names --vertical test -e "select 1 as a"
+
+--echo
--echo End of tests