Commit 668d09cc authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi
Browse files

Fixed bug in DATE_FORMAT when used with GROUP BY

parent c1ab560c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ $opt_tmp=$opt_version_suffix="";
$opt_help=$opt_Information=$opt_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_no_mysqltest=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=0;
$opt_innodb=$opt_bdb=0;

GetOptions("Information","help","distribution=s","user=s","result=s","delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip","version-suffix=s", "with-other-libc=s) || usage();
GetOptions("Information","help","distribution=s","user=s","result=s","delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip","version-suffix=s", "with-other-libc=s") || usage();

usage() if ($opt_help || $opt_Information);
usage() if (!$opt_distribution);
+3 −0
Original line number Diff line number Diff line
@@ -46898,6 +46898,9 @@ Fixed binary builds to use @code{--enable-local-infile}.
Update source to work with new @code{bison} version.
@item
Updated shell scripts to new agree with new POSIX standard.
@item
Fixed bug where @code{DATE_FORMAT()} returned empty string when used
with @code{GROUP BY}.
@end itemize
@node News-3.23.49, News-3.23.48, News-3.23.50, News-3.23.x
+4 −0
Original line number Diff line number Diff line
@@ -18,3 +18,7 @@ s
date_add(date,INTERVAL 1 DAY)	date_add(date,INTERVAL 1 SECOND)
2000-08-11	2000-08-10 00:00:01
2000-08-12	2000-08-11 00:00:01
DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' ,  t2.GMT))
Wed, 06 March 2002 10:11:12 GMT-0800
DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' ,  t2.GMT))	DATE_FORMAT("2002-03-06 10:11:12",  CONCAT('%a, %d %M %Y %H:%i:%s ' ,  t2.GMT))
Wed, 06 March 2002 10:11:12 GMT-0800	Wed, 06 March 2002 10:11:12 GMT-0800
+13 −0
Original line number Diff line number Diff line
@@ -62,3 +62,16 @@ create table t1 (date date);
insert into t1 values ("2000-08-10"),("2000-08-11");
select date_add(date,INTERVAL 1 DAY),date_add(date,INTERVAL 1 SECOND) from t1;
drop table t1;

#
# Test problem with DATE_FORMAT
#

CREATE TABLE t1(AFIELD INT);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(GMT  VARCHAR(32));
INSERT INTO t2 VALUES('GMT-0800');
SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' ,  t2.GMT)) FROM t1, t2 GROUP BY t1.AFIELD;
INSERT INTO t1 VALUES(1);
SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' ,  t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12",  CONCAT('%a, %d %M %Y %H:%i:%s ' ,  t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD;
drop table t1,t2;
+2 −2
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome.

# Documentation continued at end of file

my $VERSION = "1.14";
my $VERSION = "1.15";

my $opt_tmpdir = $ENV{TMPDIR} || "/tmp";

@@ -562,7 +562,7 @@ sub copy_files {
	# add recursive option for scp
	push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd)$/ && $method =~ /^scp\b/;

	my @non_raid = grep { $_ !~ m:\d\d/: } @$files;
	my @non_raid = grep { ! m:/\d{2}/[^/]+$: } @$files;

	# add files to copy and the destination directory
	safe_system( @cp, @non_raid, $target );
Loading