Commit 39de961b authored by unknown's avatar unknown

Merge


mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/group_by.result:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/field.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
parents c0c6f98b 2611f981
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# and is part of the translation of the Bourne shell script with the # and is part of the translation of the Bourne shell script with the
# same name. # same name.
use File::Basename;
use strict; use strict;
sub collect_test_cases ($); sub collect_test_cases ($);
...@@ -39,6 +40,7 @@ sub collect_test_cases ($) { ...@@ -39,6 +40,7 @@ sub collect_test_cases ($) {
if ( @::opt_cases ) if ( @::opt_cases )
{ {
foreach my $tname ( @::opt_cases ) { # Run in specified order, no sort foreach my $tname ( @::opt_cases ) { # Run in specified order, no sort
$tname= basename($tname, ".test");
my $elem= "$tname.test"; my $elem= "$tname.test";
if ( ! -f "$testdir/$elem") if ( ! -f "$testdir/$elem")
{ {
...@@ -161,33 +163,35 @@ sub collect_one_test_case($$$$$) { ...@@ -161,33 +163,35 @@ sub collect_one_test_case($$$$$) {
my $slave_sh= "$testdir/$tname-slave.sh"; my $slave_sh= "$testdir/$tname-slave.sh";
my $disabled= "$testdir/$tname.disabled"; my $disabled= "$testdir/$tname.disabled";
$tinfo->{'master_opt'}= ["--default-time-zone=+3:00"]; $tinfo->{'master_opt'}= $::glob_win32 ? ["--default-time-zone=+3:00"] : [];
$tinfo->{'slave_opt'}= ["--default-time-zone=+3:00"]; $tinfo->{'slave_opt'}= $::glob_win32 ? ["--default-time-zone=+3:00"] : [];
$tinfo->{'slave_mi'}= []; $tinfo->{'slave_mi'}= [];
if ( -f $master_opt_file ) if ( -f $master_opt_file )
{ {
$tinfo->{'master_restart'}= 1; # We think so for now $tinfo->{'master_restart'}= 1; # We think so for now
# This is a dirty hack from old mysql-test-run, we use the opt file
# to flag other things as well, it is not a opt list at all
$tinfo->{'master_opt'}= mtr_get_opts_from_file($master_opt_file);
foreach my $opt (@{$tinfo->{'master_opt'}}) MASTER_OPT:
{
my $master_opt= mtr_get_opts_from_file($master_opt_file);
foreach my $opt ( @$master_opt )
{ {
my $value; my $value;
$value= mtr_match_prefix($opt, "--timezone="); # This is a dirty hack from old mysql-test-run, we use the opt
# file to flag other things as well, it is not a opt list at
# all
$value= mtr_match_prefix($opt, "--timezone=");
if ( defined $value ) if ( defined $value )
{ {
$tinfo->{'timezone'}= $value; $tinfo->{'timezone'}= $value;
$tinfo->{'master_opt'}= []; $tinfo->{'skip'}= 1 if $::glob_win32; # FIXME server unsets TZ
$tinfo->{'master_restart'}= 0; last MASTER_OPT;
last;
} }
$value= mtr_match_prefix($opt, "--result-file="); $value= mtr_match_prefix($opt, "--result-file=");
if ( defined $value ) if ( defined $value )
{ {
$tinfo->{'result_file'}= "r/$value.result"; $tinfo->{'result_file'}= "r/$value.result";
...@@ -196,17 +200,36 @@ sub collect_one_test_case($$$$$) { ...@@ -196,17 +200,36 @@ sub collect_one_test_case($$$$$) {
{ {
$tinfo->{'result_file'}.= $::opt_result_ext; $tinfo->{'result_file'}.= $::opt_result_ext;
} }
$tinfo->{'master_opt'}= [];
$tinfo->{'master_restart'}= 0; $tinfo->{'master_restart'}= 0;
last; last MASTER_OPT;
} }
# If we set default time zone, remove the one we have
$value= mtr_match_prefix($opt, "--default-time-zone=");
if ( defined $value )
{
$tinfo->{'master_opt'}= [];
}
}
# Ok, this was a real option list, add it
push(@{$tinfo->{'master_opt'}}, @$master_opt);
} }
} }
if ( -f $slave_opt_file ) if ( -f $slave_opt_file )
{ {
$tinfo->{'slave_opt'}= mtr_get_opts_from_file($slave_opt_file);
$tinfo->{'slave_restart'}= 1; $tinfo->{'slave_restart'}= 1;
my $slave_opt= mtr_get_opts_from_file($slave_opt_file);
foreach my $opt ( @$slave_opt )
{
# If we set default time zone, remove the one we have
my $value= mtr_match_prefix($opt, "--default-time-zone=");
$tinfo->{'slave_opt'}= [] if defined $value;
}
push(@{$tinfo->{'slave_opt'}}, @$slave_opt);
} }
if ( -f $slave_mi_file ) if ( -f $slave_mi_file )
......
...@@ -264,6 +264,7 @@ our $opt_warnings; ...@@ -264,6 +264,7 @@ our $opt_warnings;
our $opt_udiff; our $opt_udiff;
our $opt_skip_ndbcluster;
our $opt_with_ndbcluster; our $opt_with_ndbcluster;
our $opt_with_openssl; our $opt_with_openssl;
...@@ -463,6 +464,7 @@ sub command_line_setup () { ...@@ -463,6 +464,7 @@ sub command_line_setup () {
# Control what test suites or cases to run # Control what test suites or cases to run
'force' => \$opt_force, 'force' => \$opt_force,
'with-ndbcluster' => \$opt_with_ndbcluster, 'with-ndbcluster' => \$opt_with_ndbcluster,
'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
'do-test=s' => \$opt_do_test, 'do-test=s' => \$opt_do_test,
'suite=s' => \$opt_suite, 'suite=s' => \$opt_suite,
'skip-rpl' => \$opt_skip_rpl, 'skip-rpl' => \$opt_skip_rpl,
...@@ -662,6 +664,11 @@ sub command_line_setup () { ...@@ -662,6 +664,11 @@ sub command_line_setup () {
$opt_ndbconnectstring= "host=localhost:$opt_ndbcluster_port"; $opt_ndbconnectstring= "host=localhost:$opt_ndbcluster_port";
} }
if ( $opt_skip_ndbcluster )
{
$opt_with_ndbcluster= 0;
}
# FIXME # FIXME
#if ( $opt_valgrind or $opt_valgrind_all ) #if ( $opt_valgrind or $opt_valgrind_all )
...@@ -1020,11 +1027,6 @@ sub kill_and_cleanup () { ...@@ -1020,11 +1027,6 @@ sub kill_and_cleanup () {
mtr_report("Removing Stale Files"); mtr_report("Removing Stale Files");
if ( -l $opt_vardir and ! unlink($opt_vardir) )
{
mtr_error("Can't remove soft link \"$opt_vardir\"");
}
rmtree("$opt_vardir/log"); rmtree("$opt_vardir/log");
rmtree("$opt_vardir/ndbcluster-$opt_ndbcluster_port"); rmtree("$opt_vardir/ndbcluster-$opt_ndbcluster_port");
rmtree("$opt_vardir/run"); rmtree("$opt_vardir/run");
...@@ -1719,6 +1721,11 @@ sub mysqld_arguments ($$$$$) { ...@@ -1719,6 +1721,11 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--local-infile", $prefix); mtr_add_arg($args, "%s--local-infile", $prefix);
mtr_add_arg($args, "%s--datadir=%s", $prefix, mtr_add_arg($args, "%s--datadir=%s", $prefix,
$master->[$idx]->{'path_myddir'}); $master->[$idx]->{'path_myddir'});
if ( $opt_skip_ndbcluster )
{
mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
}
} }
if ( $type eq 'slave' ) if ( $type eq 'slave' )
...@@ -1860,20 +1867,12 @@ sub mysqld_arguments ($$$$$) { ...@@ -1860,20 +1867,12 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix); mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix);
mtr_add_arg($args, "%s--init-rpl-role=master", $prefix); mtr_add_arg($args, "%s--init-rpl-role=master", $prefix);
} }
else elsif ( $type eq 'master' )
{ {
mtr_add_arg($args, "%s--exit-info=256", $prefix); mtr_add_arg($args, "%s--exit-info=256", $prefix);
mtr_add_arg($args, "%s--open-files-limit=1024", $prefix); mtr_add_arg($args, "%s--open-files-limit=1024", $prefix);
if ( $type eq 'master' )
{
mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'}); mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'});
} }
if ( $type eq 'slave' )
{
mtr_add_arg($args, "%s--log=%s", $prefix, $slave->[0]->{'path_mylog'});
}
}
return $args; return $args;
} }
......
...@@ -753,3 +753,12 @@ SELECT DISTINCT a, b FROM t1 GROUP BY 'const'; ...@@ -753,3 +753,12 @@ SELECT DISTINCT a, b FROM t1 GROUP BY 'const';
a b a b
1 2 1 2
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (id INT, dt DATETIME);
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
SELECT dt DIV 1 AS f, id FROM t1 GROUP BY f;
f id
20050501123000 1
DROP TABLE t1;
...@@ -567,7 +567,7 @@ show warnings; ...@@ -567,7 +567,7 @@ show warnings;
drop table t1, t2; drop table t1, t2;
# #
# Test for bug #8614: GROUP BY 'const with DISTINCT # Test for bug #8614: GROUP BY 'const' with DISTINCT
# #
CREATE TABLE t1 (a int, b int); CREATE TABLE t1 (a int, b int);
...@@ -576,3 +576,16 @@ SELECT a, b FROM t1 GROUP BY 'const'; ...@@ -576,3 +576,16 @@ SELECT a, b FROM t1 GROUP BY 'const';
SELECT DISTINCT a, b FROM t1 GROUP BY 'const'; SELECT DISTINCT a, b FROM t1 GROUP BY 'const';
DROP TABLE t1; DROP TABLE t1;
#
# Test for bug #11385: GROUP BY for datetime converted to decimals
#
CREATE TABLE t1 (id INT, dt DATETIME);
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
SELECT dt DIV 1 AS f, id FROM t1 GROUP BY f;
DROP TABLE t1;
...@@ -111,8 +111,8 @@ DEFS = -DMYSQL_SERVER \ ...@@ -111,8 +111,8 @@ DEFS = -DMYSQL_SERVER \
-DDATADIR="\"$(MYSQLDATAdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
@DEFS@ @DEFS@
# Don't put lex_hash.h in BUILT_SOURCES as this will give infinite recursion
BUILT_SOURCES = sql_yacc.cc sql_yacc.h BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h
EXTRA_DIST = udf_example.cc $(BUILT_SOURCES) EXTRA_DIST = udf_example.cc $(BUILT_SOURCES)
DISTCLEANFILES = lex_hash.h DISTCLEANFILES = lex_hash.h
AM_YFLAGS = -d AM_YFLAGS = -d
...@@ -131,9 +131,6 @@ link_sources: mysql_tzinfo_to_sql.cc ...@@ -131,9 +131,6 @@ link_sources: mysql_tzinfo_to_sql.cc
rm -f my_time.c rm -f my_time.c
@LN_CP_F@ ../sql-common/my_time.c my_time.c @LN_CP_F@ ../sql-common/my_time.c my_time.c
gen_lex_hash.o: gen_lex_hash.cc lex.h
$(CXXCOMPILE) -c $(INCLUDES) $<
mysql_tzinfo_to_sql.o: $(mysql_tzinfo_to_sql_SOURCES) mysql_tzinfo_to_sql.o: $(mysql_tzinfo_to_sql_SOURCES)
$(CXXCOMPILE) -c $(INCLUDES) -DTZINFO2SQL $< $(CXXCOMPILE) -c $(INCLUDES) -DTZINFO2SQL $<
...@@ -148,13 +145,9 @@ sql_yacc.o: sql_yacc.cc sql_yacc.h $(HEADERS) ...@@ -148,13 +145,9 @@ sql_yacc.o: sql_yacc.cc sql_yacc.h $(HEADERS)
@echo "If it fails, re-run configure with --with-low-memory" @echo "If it fails, re-run configure with --with-low-memory"
$(CXXCOMPILE) $(LM_CFLAGS) -c $< $(CXXCOMPILE) $(LM_CFLAGS) -c $<
lex_hash.h: lex.h gen_lex_hash.cc sql_yacc.h lex_hash.h: gen_lex_hash$(EXEEXT)
$(MAKE) gen_lex_hash$(EXEEXT)
./gen_lex_hash$(EXEEXT) > $@ ./gen_lex_hash$(EXEEXT) > $@
# Hack to ensure that lex_hash.h is built early
sql_lex.o: lex_hash.h
# For testing of udf_example.so; Works on platforms with gcc # For testing of udf_example.so; Works on platforms with gcc
# (This is not part of our build process but only provided as an example) # (This is not part of our build process but only provided as an example)
udf_example.so: udf_example.cc udf_example.so: udf_example.cc
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#endif #endif
#define NOT_FIXED_DEC 31 #define NOT_FIXED_DEC 31
#define DATETIME_DEC 6
class Send_field; class Send_field;
class Protocol; class Protocol;
...@@ -941,6 +942,7 @@ class Field_datetime :public Field_str { ...@@ -941,6 +942,7 @@ class Field_datetime :public Field_str {
enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; } enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; }
#endif #endif
enum Item_result cmp_type () const { return INT_RESULT; } enum Item_result cmp_type () const { return INT_RESULT; }
uint decimals() const { return DATETIME_DEC; }
int store(const char *to,uint length,CHARSET_INFO *charset); int store(const char *to,uint length,CHARSET_INFO *charset);
int store(double nr); int store(double nr);
int store(longlong nr); int store(longlong nr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment