List:Commits« Previous MessageNext Message »
From:Ignacio Galarza Date:June 29 2006 11:06pm
Subject:bk commit into 4.1 tree (iggy:1.2522) BUG#20328
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of iggy. When iggy does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2522 06/06/29 17:06:28 iggy@stripped +3 -0
  Bug#20328 mysql client: dumb about trailing spaces on help command.

  mysql-test/t/mysql_client.test
    1.1 06/06/29 17:06:25 iggy@stripped +9 -0
    Result trailing spaces on the help command.

  mysql-test/r/mysql_client.result
    1.1 06/06/29 17:06:25 iggy@stripped +44 -0
    Test trailing spaces on the help command.

  mysql-test/t/mysql_client.test
    1.0 06/06/29 17:06:25 iggy@stripped +0 -0
    BitKeeper file /mnt/storeage/mysql-4.1_bug20328/mysql-test/t/mysql_client.test

  mysql-test/r/mysql_client.result
    1.0 06/06/29 17:06:25 iggy@stripped +0 -0
    BitKeeper file /mnt/storeage/mysql-4.1_bug20328/mysql-test/r/mysql_client.result

  client/mysql.cc
    1.219 06/06/29 17:06:25 iggy@stripped +14 -3
    Remove trailing spaces from help arguments in com_server_help. 
    Disregard trailing spaces from command in com_help.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	iggy
# Host:	rolltop.ignatz42.dyndns.org
# Root:	/mnt/storeage/mysql-4.1_bug20328

--- 1.218/client/mysql.cc	2006-02-10 08:12:20 -05:00
+++ 1.219/client/mysql.cc	2006-06-29 17:06:25 -04:00
@@ -1725,7 +1725,14 @@ static int com_server_help(String *buffe
   
   if (help_arg[0] != '\'')
   {
-    (void) strxnmov(cmd_buf, sizeof(cmd_buf), "help '", help_arg, "'", NullS);
+	char *end_arg= strend(help_arg);
+	if(--end_arg)
+	{
+		while (my_isspace(charset_info,*end_arg))
+          end_arg--;
+		*++end_arg= '\0';
+	}
+	(void) strxnmov(cmd_buf, sizeof(cmd_buf), "help '", help_arg, "'", NullS);
     server_cmd= cmd_buf;
   }
   
@@ -1811,9 +1818,13 @@ com_help(String *buffer __attribute__((u
 {
   reg1 int i, j;
   char * help_arg= strchr(line,' '), buff[32], *end;
-
   if (help_arg)
-    return com_server_help(buffer,line,help_arg+1);
+  {
+    while (my_isspace(charset_info,*help_arg))
+      help_arg++;
+	if (*help_arg)	  
+	  return com_server_help(buffer,line,help_arg);
+  }
 
   put_info("\nFor information about MySQL products and services, visit:\n"
            "   http://www.mysql.com/\n"
--- New file ---
+++ mysql-test/r/mysql_client.result	06/06/29 17:06:25
?         (\?) Synonym for `help'.
clear     (\c) Clear command.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set query delimiter. 
edit      (\e) Edit command with $EDITOR.
ego       (\G) Send command to mysql server, display result vertically.
exit      (\q) Exit mysql. Same as quit.
go        (\g) Send command to mysql server.
help      (\h) Display this help.
nopager   (\n) Disable pager, print to stdout.
notee     (\t) Don't write into outfile.
pager     (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute an SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
system    (\!) Execute a system shell command.
tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
use       (\u) Use another database. Takes database name as argument.
charset_name(\C) Switch to another charset. Might be needed for processing binlog.
?         (\?) Synonym for `help'.
clear     (\c) Clear command.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set query delimiter. 
edit      (\e) Edit command with $EDITOR.
ego       (\G) Send command to mysql server, display result vertically.
exit      (\q) Exit mysql. Same as quit.
go        (\g) Send command to mysql server.
help      (\h) Display this help.
nopager   (\n) Disable pager, print to stdout.
notee     (\t) Don't write into outfile.
pager     (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute an SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
system    (\!) Execute a system shell command.
tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
use       (\u) Use another database. Takes database name as argument.
charset_name(\C) Switch to another charset. Might be needed for processing binlog.

--- New file ---
+++ mysql-test/t/mysql_client.test	06/06/29 17:06:25
# This test should work in embedded server after we fix mysqltest
-- source include/not_embedded.inc

#
# Bug #20328: mysql client interprets commands in comments
#
--exec echo 'help' | $MYSQL
--exec echo 'help ' | $MYSQL


Thread
bk commit into 4.1 tree (iggy:1.2522) BUG#20328Ignacio Galarza29 Jun