summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <ibabaev@bk-internal.mysql.com>2007-02-13 21:25:22 +0100
committerunknown <ibabaev@bk-internal.mysql.com>2007-02-13 21:25:22 +0100
commitaf1f49b77eed1039e3116d91b70f102894db941b (patch)
treec496b56845514ac58e3a497ad0699a7d4d1a1593 /mysql-test
parent38fa86a12e9e6967a08bf94af06709b3b3fc055a (diff)
parent82e677b9479e1152028c242ade16a0a374c6abc7 (diff)
downloadmariadb-git-af1f49b77eed1039e3116d91b70f102894db941b.tar.gz
Merge bk-internal.mysql.com:/data0/bk/mysql-4.1
into bk-internal.mysql.com:/data0/bk/mysql-4.1-opt
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/lib/mtr_cases.pl5
-rwxr-xr-xmysql-test/mysql-test-run.pl8
-rw-r--r--mysql-test/r/cast.result4
-rw-r--r--mysql-test/r/range.result4
-rw-r--r--mysql-test/r/select.result17
-rw-r--r--mysql-test/r/type_enum.result25
-rw-r--r--mysql-test/r/type_float.result71
-rw-r--r--mysql-test/t/cast.test8
-rw-r--r--mysql-test/t/range.test4
-rw-r--r--mysql-test/t/select.test13
-rw-r--r--mysql-test/t/type_enum.test22
-rw-r--r--mysql-test/t/type_float.test25
12 files changed, 197 insertions, 9 deletions
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index a00d06d2e60..8c2dbdec804 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -537,6 +537,8 @@ sub collect_one_test_case($$$$$$$) {
$tinfo->{'comment'}= "No ndbcluster tests(--skip-ndbcluster)";
return;
}
+ # Ndb tests run with two mysqld masters
+ $tinfo->{'master_num'}= 2;
}
else
{
@@ -552,7 +554,7 @@ sub collect_one_test_case($$$$$$$) {
if ( $tinfo->{'innodb_test'} )
{
- # This is a test that need inndob
+ # This is a test that need innodb
if ( $::mysqld_variables{'innodb'} eq "FALSE" )
{
# innodb is not supported, skip it
@@ -578,7 +580,6 @@ our @tags=
["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1],
["include/have_ndb_extra.inc", "ndb_extra", 1],
- ["include/have_multi_ndb.inc", "master_num", 2],
["require_manager", "require_manager", 1],
);
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 436030383e1..f53b470aaf4 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -301,6 +301,8 @@ our %mysqld_variables;
my $source_dist= 0;
+our $opt_max_save_core= 5;
+my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far.
######################################################################
#
@@ -589,6 +591,7 @@ sub command_line_setup () {
'strace-client' => \$opt_strace_client,
'master-binary=s' => \$exe_master_mysqld,
'slave-binary=s' => \$exe_slave_mysqld,
+ 'max-save-core=i' => \$opt_max_save_core,
# Coverage, profiling etc
'gcov' => \$opt_gcov,
@@ -3301,10 +3304,12 @@ sub save_files_before_restore($$) {
# Look for core files
foreach my $core_file ( glob("$data_dir/core*") )
{
+ last if $opt_max_save_core > 0 && $num_saved_cores >= $opt_max_save_core;
my $core_name= basename($core_file);
mtr_report("Saving $core_name");
mkdir($save_name) if ! -d $save_name;
rename("$core_file", "$save_name/$core_name");
+ ++$num_saved_cores;
}
}
@@ -4897,6 +4902,9 @@ Options for debugging the product
master-binary=PATH Specify the master "mysqld" to use
slave-binary=PATH Specify the slave "mysqld" to use
strace-client Create strace output for mysqltest client
+ max-save-core Limit the number of core files saved (to avoid filling
+ up disks for heavily crashing server). Defaults to
+ $opt_max_save_core, set to 0 for no limit.
Options for coverage, profiling etc
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index 101b9ac3f7e..23c38bb792c 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -278,3 +278,7 @@ double_val cast_val
-1e+30 -9223372036854775808
1e+30 9223372036854775807
DROP TABLE t1;
+select isnull(date(NULL)), isnull(cast(NULL as DATE));
+isnull(date(NULL)) isnull(cast(NULL as DATE))
+1 1
+End of 4.1 tests
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 2125f237d0e..4d6cafb61d1 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -504,8 +504,8 @@ select count(*) from t1 where x = 18446744073709551601;
count(*)
1
create table t2 (x bigint not null);
-insert into t2(x) values (0xfffffffffffffff0);
-insert into t2(x) values (0xfffffffffffffff1);
+insert into t2(x) values (-16);
+insert into t2(x) values (-15);
select * from t2;
x
-16
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index f09143fcaa6..6dc971a953c 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2819,3 +2819,20 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
min(key1)
0.37619999051094
DROP TABLE t1,t2;
+create table t1(a bigint unsigned, b bigint);
+insert into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff),
+(0x10000000000000000, 0x10000000000000000),
+(0x8fffffffffffffff, 0x8fffffffffffffff);
+Warnings:
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'b' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'b' at row 2
+Warning 1264 Data truncated; out of range for column 'b' at row 3
+select hex(a), hex(b) from t1;
+hex(a) hex(b)
+FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
+FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
+8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
+drop table t1;
+End of 4.1 tests
diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result
index 0fe3f674fba..b5ec72ffe5a 100644
--- a/mysql-test/r/type_enum.result
+++ b/mysql-test/r/type_enum.result
@@ -1754,3 +1754,28 @@ t1 CREATE TABLE `t1` (
`f2` enum('') default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+create table t1(russian enum('E','F','EF','FE') NOT NULL DEFAULT'E');
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `russian` enum('E','F','EF','FE') NOT NULL default 'E'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `denormal` enum('E','F','E,F','F,E') NOT NULL default 'E'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1(russian_deviant enum('E','F','EF','F,E') NOT NULL DEFAULT'E');
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `russian_deviant` enum('E','F','EF','F,E') NOT NULL default 'E'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
+  !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz'));
+ERROR 42000: Field separator argument is not what is expected; check the manual
+End of 4.1 tests
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index f157bbc602d..3e66fa70dc1 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -278,4 +278,75 @@ select 1e-308, 1.00000001e-300, 100000000e-300;
select 10e307;
10e307
1e+308
+create table t1(a int, b double(8, 2));
+insert into t1 values
+(1, 28.50), (1, 121.85), (1, 157.23), (1, 1351.00), (1, -1965.35), (1, 81.75),
+(1, 217.08), (1, 7.94), (4, 96.07), (4, 6404.65), (4, -6500.72), (2, 100.00),
+(5, 5.00), (5, -2104.80), (5, 2033.80), (5, 0.07), (5, 65.93),
+(3, -4986.24), (3, 5.00), (3, 4857.34), (3, 123.74), (3, 0.16),
+(6, -1695.31), (6, 1003.77), (6, 499.72), (6, 191.82);
+explain select sum(b) s from t1 group by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using temporary; Using filesort
+select sum(b) s from t1 group by a;
+s
+0.00
+100.00
+0.00
+-0.00
+-0.00
+0.00
+select sum(b) s from t1 group by a having s <> 0;
+s
+100.00
+select sum(b) s from t1 group by a having s <> 0 order by s;
+s
+100.00
+select sum(b) s from t1 group by a having s <=> 0;
+s
+0.00
+0.00
+-0.00
+-0.00
+0.00
+select sum(b) s from t1 group by a having s <=> 0 order by s;
+s
+-0.00
+-0.00
+0.00
+0.00
+0.00
+alter table t1 add key (a, b);
+explain select sum(b) s from t1 group by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 14 NULL 26 Using index
+select sum(b) s from t1 group by a;
+s
+0.00
+100.00
+0.00
+-0.00
+0.00
+0.00
+select sum(b) s from t1 group by a having s <> 0;
+s
+100.00
+select sum(b) s from t1 group by a having s <> 0 order by s;
+s
+100.00
+select sum(b) s from t1 group by a having s <=> 0;
+s
+0.00
+0.00
+-0.00
+0.00
+0.00
+select sum(b) s from t1 group by a having s <=> 0 order by s;
+s
+-0.00
+0.00
+0.00
+0.00
+0.00
+drop table t1;
End of 4.1 tests
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index b214cef10fa..7e8ef031e6b 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -167,4 +167,10 @@ INSERT INTO t1 SET f1 = +1.0e+30 ;
SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
DROP TABLE t1;
-# End of 4.1 tests
+#
+# Bug #23938: cast(NULL as DATE)
+#
+
+select isnull(date(NULL)), isnull(cast(NULL as DATE));
+
+--echo End of 4.1 tests
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 16cbcd754f6..68ba43a8ba9 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -400,8 +400,8 @@ select count(*) from t1 where x = 18446744073709551601;
create table t2 (x bigint not null);
-insert into t2(x) values (0xfffffffffffffff0);
-insert into t2(x) values (0xfffffffffffffff1);
+insert into t2(x) values (-16);
+insert into t2(x) values (-15);
select * from t2;
select count(*) from t2 where x>0;
select count(*) from t2 where x=0;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 3f9fb59d26f..0dc179e9b4b 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2342,4 +2342,15 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
DROP TABLE t1,t2;
--enable_ps_protocol
-# End of 4.1 tests
+#
+# Bug #22533: storing large hex strings
+#
+
+create table t1(a bigint unsigned, b bigint);
+insert into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff),
+ (0x10000000000000000, 0x10000000000000000),
+ (0x8fffffffffffffff, 0x8fffffffffffffff);
+select hex(a), hex(b) from t1;
+drop table t1;
+
+--echo End of 4.1 tests
diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test
index 68f5664c36d..4b3429d9ea0 100644
--- a/mysql-test/t/type_enum.test
+++ b/mysql-test/t/type_enum.test
@@ -136,4 +136,24 @@ alter table t1 add f2 enum(0xFFFF);
show create table t1;
drop table t1;
-# End of 4.1 tests
+#
+# Bug#24660 "enum" field type definition problem
+#
+create table t1(russian enum('E','F','EF','FE') NOT NULL DEFAULT'E');
+show create table t1;
+drop table t1;
+
+create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
+show create table t1;
+drop table t1;
+
+create table t1(russian_deviant enum('E','F','EF','F,E') NOT NULL DEFAULT'E');
+show create table t1;
+drop table t1;
+
+# ER_WRONG_FIELD_TERMINATORS
+--error 1083
+create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
+  !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz'));
+
+--echo End of 4.1 tests
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index 8a484f7bcd0..8c22d22ca66 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -188,4 +188,29 @@ select 1e-308, 1.00000001e-300, 100000000e-300;
# check if overflows are detected correctly
select 10e307;
+#
+# Bug #19690: ORDER BY eliminates rows from the result
+#
+create table t1(a int, b double(8, 2));
+insert into t1 values
+(1, 28.50), (1, 121.85), (1, 157.23), (1, 1351.00), (1, -1965.35), (1, 81.75),
+(1, 217.08), (1, 7.94), (4, 96.07), (4, 6404.65), (4, -6500.72), (2, 100.00),
+(5, 5.00), (5, -2104.80), (5, 2033.80), (5, 0.07), (5, 65.93),
+(3, -4986.24), (3, 5.00), (3, 4857.34), (3, 123.74), (3, 0.16),
+(6, -1695.31), (6, 1003.77), (6, 499.72), (6, 191.82);
+explain select sum(b) s from t1 group by a;
+select sum(b) s from t1 group by a;
+select sum(b) s from t1 group by a having s <> 0;
+select sum(b) s from t1 group by a having s <> 0 order by s;
+select sum(b) s from t1 group by a having s <=> 0;
+select sum(b) s from t1 group by a having s <=> 0 order by s;
+alter table t1 add key (a, b);
+explain select sum(b) s from t1 group by a;
+select sum(b) s from t1 group by a;
+select sum(b) s from t1 group by a having s <> 0;
+select sum(b) s from t1 group by a having s <> 0 order by s;
+select sum(b) s from t1 group by a having s <=> 0;
+select sum(b) s from t1 group by a having s <=> 0 order by s;
+drop table t1;
+
--echo End of 4.1 tests