summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Winstead <jimw@mysql.com>2009-05-13 08:48:00 -0700
committerJim Winstead <jimw@mysql.com>2009-05-13 08:48:00 -0700
commit4161dc49b3a8e0281f70e0362098c16fe291720d (patch)
treec861b8090364d511ed5eec125964d3df9123cedd
parent10611fe61bbfafbeee96915a8ddaaf555ff36e28 (diff)
parentc65ebb5d137431b7b42636c3d7aa55132a42255e (diff)
downloadmariadb-git-4161dc49b3a8e0281f70e0362098c16fe291720d.tar.gz
Merge from 5.0-bugteam
-rw-r--r--client/mysql.cc12
-rw-r--r--mysql-test/r/mysql.result6
-rw-r--r--mysql-test/t/mysql.test7
-rw-r--r--mysys/mf_getdate.c8
4 files changed, 26 insertions, 7 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 8de3cfee041..860fc3a5f6e 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -143,7 +143,8 @@ static my_bool ignore_errors=0,wait_flag=0,quick=0,
tty_password= 0, opt_nobeep=0, opt_reconnect=1,
default_charset_used= 0, opt_secure_auth= 0,
default_pager_set= 0, opt_sigint_ignore= 0,
- show_warnings= 0, executing_query= 0, interrupted_query= 0;
+ show_warnings= 0, executing_query= 0, interrupted_query= 0,
+ ignore_spaces= 0;
static my_bool debug_info_flag, debug_check_flag;
static my_bool column_types_flag;
static my_bool preserve_comments= 0;
@@ -1378,8 +1379,9 @@ static struct my_option my_long_options[] =
{"no-named-commands", 'g',
"Named commands are disabled. Use \\* form only, or use named commands only in the beginning of a line ending with a semicolon (;) Since version 10.9 the client now starts with this option ENABLED by default! Disable with '-G'. Long format commands still work from the first line. WARNING: option deprecated; use --disable-named-commands instead.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"ignore-spaces", 'i', "Ignore space after function names.", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"ignore-spaces", 'i', "Ignore space after function names.",
+ (uchar**) &ignore_spaces, (uchar**) &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
+ 0, 0, 0, 0},
{"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
(uchar**) &opt_local_infile,
(uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -1800,6 +1802,10 @@ static int get_options(int argc, char **argv)
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
if (debug_check_flag)
my_end_arg= MY_CHECK_ERROR;
+
+ if (ignore_spaces)
+ connect_flag|= CLIENT_IGNORE_SPACE;
+
return(0);
}
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index c53a2243811..a04eb1ca1aa 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -192,6 +192,12 @@ delimiter
1
1
1
+COUNT (*)
+1
+COUNT (*)
+1
+COUNT (*)
+1
End of 5.0 tests
WARNING: --server-arg option not supported in this configuration.
Warning (Code 1286): Unknown table engine 'nonexistent'
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 91679c8c2ff..1054d1cbe0a 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -342,6 +342,13 @@ EOF
remove_file $MYSQLTEST_VARDIR/tmp/bug31060.sql;
+#
+# Bug #39101: client -i (--ignore-spaces) option does not seem to work
+#
+--exec $MYSQL -i -e "SELECT COUNT (*)"
+--exec $MYSQL --ignore-spaces -e "SELECT COUNT (*)"
+--exec $MYSQL -b -i -e "SELECT COUNT (*)"
+
--echo End of 5.0 tests
#
diff --git a/mysys/mf_getdate.c b/mysys/mf_getdate.c
index 3a8e1be6a0b..9475bebd107 100644
--- a/mysys/mf_getdate.c
+++ b/mysys/mf_getdate.c
@@ -45,15 +45,15 @@ void get_date(register char * to, int flag, time_t date)
skr=date ? (time_t) date : my_time(0);
#if defined(HAVE_LOCALTIME_R) && defined(_REENTRANT)
if (flag & GETDATE_GMT)
- localtime_r(&skr,&tm_tmp);
- else
gmtime_r(&skr,&tm_tmp);
+ else
+ localtime_r(&skr,&tm_tmp);
start_time= &tm_tmp;
#else
if (flag & GETDATE_GMT)
- start_time= localtime(&skr);
- else
start_time= gmtime(&skr);
+ else
+ start_time= localtime(&skr);
#endif
if (flag & GETDATE_SHORT_DATE)
sprintf(to,"%02d%02d%02d",