Commit c8d917c7 authored by unknown's avatar unknown

Merge bk-internal:/home/bk/mysql-5.0

into serg.mylan:/usr/home/serg/Abk/mysql-5.0


ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Auto merged
ndb/test/ndbapi/testBlobs.cpp:
  Auto merged
sql/sql_select.cc:
  Auto merged
parents 8410df62 56eba304
......@@ -164,7 +164,12 @@ private:
// openSSL bignum
struct BIGNUM {
Integer int_;
/*
gcc 2.96 fix: because of two Integer classes (yaSSL::Integer and
TaoCrypt::Integer), we need to explicitly state the namespace
here to let gcc 2.96 deduce the correct type.
*/
yaSSL::Integer int_;
void assign(const byte* b, uint s) { int_.assign(b,s); }
};
......
......@@ -445,6 +445,15 @@ const opaque master_label[MASTER_LABEL_SZ + 1] = "master secret";
const opaque key_label [KEY_LABEL_SZ + 1] = "key expansion";
} // naemspace
} // namespace
#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
/*
gcc 2.96 bails out because of two declarations of byte: yaSSL::byte and
TaoCrypt::byte. TODO: define global types.hpp and move the declaration of
'byte' there.
*/
using yaSSL::byte;
#endif
#endif // yaSSL_TYPES_HPP
......@@ -4,6 +4,12 @@
# the $variables is extreme sensitive.
#
###############################################################
# Debug options : To debug this test script
###############################################################
let $showbinlog= 0;
let $manipulate= 1;
######## The typical test sequence
# 1. INSERT without commit
# check table content of master and slave
......@@ -52,9 +58,12 @@ let $MAX= `SELECT MAX(f1) FROM t1` ;
eval INSERT INTO t1 SET f1= $MAX + 1;
# results before DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
}
sync_slave_with_master;
connection slave;
......@@ -63,9 +72,12 @@ SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results before DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
}
###############################################################
# command to be tested
......@@ -79,9 +91,12 @@ eval $my_stmt;
let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT;
# results after DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
}
sync_slave_with_master;
connection slave;
......@@ -90,9 +105,12 @@ SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results after DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
}
###############################################################
# ROLLBACK
......@@ -114,9 +132,12 @@ eval SELECT CONCAT(CONCAT('TEST-INFO: MASTER: The INSERT is ',
' (Failed)')) AS ""
FROM mysqltest1.t1;
--enable_query_log
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
}
sync_slave_with_master;
connection slave;
......@@ -133,16 +154,17 @@ eval SELECT CONCAT(CONCAT('TEST-INFO: SLAVE: The INSERT is ',
' (Failed)')) AS ""
FROM mysqltest1.t1;
--enable_query_log
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
}
###############################################################
# Manipulate binlog
###############################################################
#let $manipulate= 0;
let $manipulate= 1;
while ($manipulate)
if ($manipulate)
{
#### Manipulate the binary logs,
# so that the output of SHOW BINLOG EVENTS IN <current log>
......@@ -171,7 +193,6 @@ flush logs;
# sleep 1;
# eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
inc $_log_num_n;
let $manipulate= 0;
}
connection master;
......
......@@ -171,8 +171,8 @@ sub collect_one_test_case($$$$$) {
my $slave_sh= "$testdir/$tname-slave.sh";
my $disabled= "$testdir/$tname.disabled";
$tinfo->{'master_opt'}= [];
$tinfo->{'slave_opt'}= [];
$tinfo->{'master_opt'}= ["--default-time-zone=+3:00"];
$tinfo->{'slave_opt'}= ["--default-time-zone=+3:00"];
$tinfo->{'slave_mi'}= [];
if ( -f $master_opt_file )
......@@ -180,9 +180,9 @@ sub collect_one_test_case($$$$$) {
$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
my $extra_master_opt= mtr_get_opts_from_file($master_opt_file);
$tinfo->{'master_opt'}= mtr_get_opts_from_file($master_opt_file);
foreach my $opt (@$extra_master_opt)
foreach my $opt (@{$tinfo->{'master_opt'}})
{
my $value;
......@@ -191,7 +191,7 @@ sub collect_one_test_case($$$$$) {
if ( defined $value )
{
$tinfo->{'timezone'}= $value;
$extra_master_opt= [];
$tinfo->{'master_opt'}= [];
$tinfo->{'master_restart'}= 0;
last;
}
......@@ -206,13 +206,11 @@ sub collect_one_test_case($$$$$) {
{
$tinfo->{'result_file'}.= $::opt_result_ext;
}
$extra_master_opt= [];
$tinfo->{'master_opt'}= [];
$tinfo->{'master_restart'}= 0;
last;
}
}
$tinfo->{'master_opt'}= $extra_master_opt;
}
if ( -f $slave_opt_file )
......
......@@ -669,6 +669,8 @@ sub mtr_mysqladmin_shutdown () {
last; # If we got here, we are done
}
sleep(5) if $::glob_win32; # FIXME next startup fails if no sleep
return $res;
}
......
......@@ -204,7 +204,7 @@ our $opt_bench= 0;
our $opt_small_bench= 0;
our $opt_big_test= 0; # Send --big-test to mysqltest
our $opt_extra_mysqld_opt; # FIXME not handled
our @opt_extra_mysqld_opt;
our $opt_compress;
our $opt_current_test;
......@@ -500,7 +500,7 @@ sub command_line_setup () {
'record' => \$opt_record,
# ???
'mysqld=s' => \$opt_extra_mysqld_opt,
'mysqld=s' => \@opt_extra_mysqld_opt,
# Run test on running server
'extern' => \$opt_extern,
......@@ -953,13 +953,25 @@ sub environment_setup () {
$ENV{'LC_COLLATE'}= "C";
$ENV{'USE_RUNNING_SERVER'}= $glob_use_running_server;
$ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir;
$ENV{'MYSQL_TEST_WINDIR'}= $glob_mysql_test_dir;
$ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_mysock'};
$ENV{'MASTER_WINMYSOCK'}= $master->[0]->{'path_mysock'};
$ENV{'MASTER_MYSOCK1'}= $master->[1]->{'path_mysock'};
$ENV{'MASTER_MYPORT'}= $master->[0]->{'path_myport'};
$ENV{'MASTER_MYPORT1'}= $master->[1]->{'path_myport'};
$ENV{'SLAVE_MYPORT'}= $slave->[0]->{'path_myport'};
# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME
$ENV{'MYSQL_TCP_PORT'}= 3306;
if ( $glob_cygwin_perl )
{
foreach my $key ('MYSQL_TEST_WINDIR','MASTER_MYSOCK')
{
$ENV{$key}= `cygpath -w $ENV{$key}`;
$ENV{$key} =~ s,\\,\\\\,g;
chomp($ENV{$key});
}
}
}
......@@ -1850,7 +1862,7 @@ sub mysqld_arguments ($$$$$) {
}
}
foreach my $arg ( @$extra_opt )
foreach my $arg ( @opt_extra_mysqld_opt, @$extra_opt )
{
mtr_add_arg($args, "%s%s", $prefix, $arg);
}
......
......@@ -170,7 +170,8 @@ cd ..
BASEDIR=`pwd`
cd $CWD
MYSQL_TEST_DIR=$BASEDIR/mysql-test
export MYSQL_TEST_DIR
MYSQL_TEST_WINDIR=$MYSQL_TEST_DIR
export MYSQL_TEST_DIR MYSQL_TEST_WINDIR
STD_DATA=$MYSQL_TEST_DIR/std_data
hostname=`hostname` # Installed in the mysql privilege table
......
......@@ -722,9 +722,7 @@ WHERE hostname LIKE '%aol%'
GROUP BY hostname;
hostname no
cache-dtc-af05.proxy.aol.com 1
drop table if exists t1, t2;
Warnings:
Note 1051 Unknown table 't2'
DROP TABLE t1;
create table t1 (c1 char(3), c2 char(3));
create table t2 (c3 char(3), c4 char(3));
insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2');
......@@ -746,3 +744,12 @@ aaa
show warnings;
Level Code Message
drop table t1, t2;
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (1,2), (1,3);
SELECT a, b FROM t1 GROUP BY 'const';
a b
1 2
SELECT DISTINCT a, b FROM t1 GROUP BY 'const';
a b
1 2
DROP TABLE t1;
# Initialise
--disable_warnings
drop table if exists t1,t2,t3;
......@@ -524,7 +525,7 @@ select min(b) from t1;
drop table t1;
#
# Test for bug #11088: GROUP BY a BLOB colimn with COUNT(DISTINCT column1)
# Test for bug #11088: GROUP BY a BLOB column with COUNT(DISTINCT column1)
#
CREATE TABLE t1 (id int PRIMARY KEY, user_id int, hostname longtext);
......@@ -539,11 +540,12 @@ SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
WHERE hostname LIKE '%aol%'
GROUP BY hostname;
DROP TABLE t1;
#
# Bug#11211: Ambiguous column reference in GROUP BY.
#
drop table if exists t1, t2;
create table t1 (c1 char(3), c2 char(3));
create table t2 (c3 char(3), c4 char(3));
insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2');
......@@ -563,3 +565,14 @@ group by t1.c1;
show warnings;
drop table t1, t2;
#
# Test for bug #8614: GROUP BY 'const with DISTINCT
#
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (1,2), (1,3);
SELECT a, b FROM t1 GROUP BY 'const';
SELECT DISTINCT a, b FROM t1 GROUP BY 'const';
DROP TABLE t1;
......@@ -812,9 +812,14 @@ JOIN::optimize()
DBUG_RETURN(1);
}
simple_group= 0;
group_list= remove_const(this, group_list, conds,
rollup.state == ROLLUP::STATE_NONE,
&simple_group);
{
ORDER *old_group_list;
group_list= remove_const(this, (old_group_list= group_list), conds,
rollup.state == ROLLUP::STATE_NONE,
&simple_group);
if (old_group_list && !group_list)
select_distinct= 0;
}
if (!group_list && group)
{
order=0; // The output has only one row
......
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