mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-tmp
This commit is contained in:
@@ -473,6 +473,13 @@ sub command_line_setup () {
|
||||
my $im_mysqld1_port= 9312;
|
||||
my $im_mysqld2_port= 9314;
|
||||
|
||||
if ( $ENV{'MTR_BUILD_THREAD'} )
|
||||
{
|
||||
$opt_master_myport= $ENV{'MTR_BUILD_THREAD'} * 40 + 8120;
|
||||
$opt_slave_myport= $opt_master_myport + 16;
|
||||
$opt_ndbcluster_port= $opt_master_myport + 24;
|
||||
}
|
||||
|
||||
# Read the command line
|
||||
# Note: Keep list, and the order, in sync with usage at end of this file
|
||||
|
||||
@@ -882,7 +889,9 @@ sub executable_setup () {
|
||||
{
|
||||
$path_client_bindir= mtr_path_exists("$glob_basedir/client_release",
|
||||
"$glob_basedir/bin");
|
||||
$exe_mysqld= mtr_exe_exists ("$path_client_bindir/mysqld-nt");
|
||||
$exe_mysqld= mtr_exe_exists ("$path_client_bindir/mysqld-nt",
|
||||
"$path_client_bindir/mysqld",
|
||||
"$path_client_bindir/mysqld-debug",);
|
||||
$path_language= mtr_path_exists("$glob_basedir/share/english/");
|
||||
$path_charsetsdir= mtr_path_exists("$glob_basedir/share/charsets");
|
||||
}
|
||||
@@ -944,9 +953,18 @@ sub executable_setup () {
|
||||
"$glob_basedir/share/english/");
|
||||
$path_charsetsdir= mtr_path_exists("$glob_basedir/share/mysql/charsets",
|
||||
"$glob_basedir/share/charsets");
|
||||
$exe_mysqld= mtr_exe_exists ("$glob_basedir/libexec/mysqld",
|
||||
"$glob_basedir/bin/mysqld");
|
||||
|
||||
if ( $glob_win32 )
|
||||
{
|
||||
$exe_mysqld= mtr_exe_exists ("$glob_basedir/bin/mysqld-nt",
|
||||
"$glob_basedir/bin/mysqld",
|
||||
"$glob_basedir/bin/mysqld-debug",);
|
||||
}
|
||||
else
|
||||
{
|
||||
$exe_mysqld= mtr_exe_exists ("$glob_basedir/libexec/mysqld",
|
||||
"$glob_basedir/bin/mysqld");
|
||||
}
|
||||
$exe_im= mtr_exe_exists("$glob_basedir/libexec/mysqlmanager",
|
||||
"$glob_basedir/bin/mysqlmanager");
|
||||
if ( $glob_use_embedded_server )
|
||||
@@ -1040,6 +1058,13 @@ sub environment_setup () {
|
||||
chomp($ENV{$key});
|
||||
}
|
||||
}
|
||||
|
||||
# We are nice and report a bit about our settings
|
||||
print "Using MTR_BUILD_THREAD = ",$ENV{MTR_BUILD_THREAD} || 0,"\n";
|
||||
print "Using MASTER_MYPORT = $ENV{MASTER_MYPORT}\n";
|
||||
print "Using MASTER_MYPORT1 = $ENV{MASTER_MYPORT1}\n";
|
||||
print "Using SLAVE_MYPORT = $ENV{SLAVE_MYPORT}\n";
|
||||
print "Using NDBCLUSTER_PORT = $opt_ndbcluster_port\n";
|
||||
}
|
||||
|
||||
|
||||
|
@@ -19,3 +19,26 @@ SELECT * FROM t1 WHERE popisek LIKE '2005-01-1';
|
||||
popisek
|
||||
2005-01-1
|
||||
drop table t1;
|
||||
set names cp1250;
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
str VARCHAR(32) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL default '',
|
||||
UNIQUE KEY (str)
|
||||
);
|
||||
INSERT INTO t1 VALUES (NULL, 'a');
|
||||
INSERT INTO t1 VALUES (NULL, 'aa');
|
||||
INSERT INTO t1 VALUES (NULL, 'aaa');
|
||||
INSERT INTO t1 VALUES (NULL, 'aaaa');
|
||||
INSERT INTO t1 VALUES (NULL, 'aaaaa');
|
||||
INSERT INTO t1 VALUES (NULL, 'aaaaaa');
|
||||
INSERT INTO t1 VALUES (NULL, 'aaaaaaa');
|
||||
select * from t1 where str like 'aa%';
|
||||
id str
|
||||
2 aa
|
||||
3 aaa
|
||||
4 aaaa
|
||||
5 aaaaa
|
||||
6 aaaaaa
|
||||
7 aaaaaaa
|
||||
drop table t1;
|
||||
|
@@ -495,3 +495,11 @@ f1 f2
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect date value: '2003-04-05 g'
|
||||
Warning 1292 Truncated incorrect datetime value: '2003-04-05 10:11:12.101010234567'
|
||||
create table t1 (f1 datetime);
|
||||
insert into t1 (f1) values ("2005-01-01");
|
||||
insert into t1 (f1) values ("2005-02-01");
|
||||
select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M");
|
||||
d1 d2
|
||||
02 February
|
||||
01 January
|
||||
drop table t1;
|
||||
|
@@ -668,3 +668,21 @@ ERROR 42S22: Unknown column 't2.a' in 'field list'
|
||||
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
|
||||
ERROR 42S22: Unknown column 't2.b' in 'field list'
|
||||
drop table t1,t2,t3;
|
||||
create table t1(f1 varchar(5) key);
|
||||
insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
|
||||
insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
|
||||
insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
|
||||
select * from t1;
|
||||
f1
|
||||
2000
|
||||
2001
|
||||
2002
|
||||
drop table t1;
|
||||
create table t1(x int, y int);
|
||||
create table t2(x int, z int);
|
||||
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(x);
|
||||
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z);
|
||||
ERROR 42S22: Unknown column 'z' in 'field list'
|
||||
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
|
||||
ERROR 42S22: Unknown column 't2.x' in 'field list'
|
||||
drop table t1,t2;
|
||||
|
@@ -669,6 +669,38 @@ show index from t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 a 1 a A 10 NULL NULL YES BTREE
|
||||
drop table t1;
|
||||
set myisam_stats_method=nulls_ignored;
|
||||
show variables like 'myisam_stats_method';
|
||||
Variable_name Value
|
||||
myisam_stats_method nulls_ignored
|
||||
create table t1 (
|
||||
a char(3), b char(4), c char(5), d char(6),
|
||||
key(a,b,c,d)
|
||||
);
|
||||
insert into t1 values ('bcd','def1', NULL, 'zz');
|
||||
insert into t1 values ('bcd','def2', NULL, 'zz');
|
||||
insert into t1 values ('bce','def1', 'yuu', NULL);
|
||||
insert into t1 values ('bce','def2', NULL, 'quux');
|
||||
analyze table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
show index from t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 a 1 a A 2 NULL NULL YES BTREE
|
||||
t1 1 a 2 b A 4 NULL NULL YES BTREE
|
||||
t1 1 a 3 c A 4 NULL NULL YES BTREE
|
||||
t1 1 a 4 d A 4 NULL NULL YES BTREE
|
||||
delete from t1;
|
||||
analyze table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
show index from t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 a 1 a A 0 NULL NULL YES BTREE
|
||||
t1 1 a 2 b A 0 NULL NULL YES BTREE
|
||||
t1 1 a 3 c A 0 NULL NULL YES BTREE
|
||||
t1 1 a 4 d A 0 NULL NULL YES BTREE
|
||||
set myisam_stats_method=DEFAULT;
|
||||
set storage_engine=MyISAM;
|
||||
drop table if exists t1,t2,t3;
|
||||
--- Testing varchar ---
|
||||
|
@@ -2700,6 +2700,14 @@ a b c d
|
||||
1 2 2 1
|
||||
1 2 3 1
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
create table t1 (f1 int primary key, f2 int);
|
||||
create table t2 (f3 int, f4 int, primary key(f3,f4));
|
||||
insert into t1 values (1,1);
|
||||
insert into t2 values (1,1),(1,2);
|
||||
select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1;
|
||||
count(f2) >0
|
||||
1
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 ( city char(30) );
|
||||
INSERT INTO t1 VALUES ('London');
|
||||
INSERT INTO t1 VALUES ('Paris');
|
||||
|
@@ -263,8 +263,8 @@ test
|
||||
delete from t1 where count(*)=1;
|
||||
ERROR HY000: Invalid use of group function
|
||||
drop table t1;
|
||||
create table t1 ( a int, index (a) );
|
||||
insert into t1 values (0),(0),(0),(0),(0),(0),(0),(0);
|
||||
create table t1 ( a int, b int default 0, index (a) );
|
||||
insert into t1 (a) values (0),(0),(0),(0),(0),(0),(0),(0);
|
||||
flush status;
|
||||
select a from t1 order by a limit 1;
|
||||
a
|
||||
@@ -278,15 +278,16 @@ Handler_read_prev 0
|
||||
Handler_read_rnd 0
|
||||
Handler_read_rnd_next 0
|
||||
flush status;
|
||||
update t1 set a=unix_timestamp() order by a limit 1;
|
||||
update t1 set a=9999 order by a limit 1;
|
||||
update t1 set b=9999 order by a limit 1;
|
||||
show status like 'handler_read%';
|
||||
Variable_name Value
|
||||
Handler_read_first 1
|
||||
Handler_read_key 0
|
||||
Handler_read_next 0
|
||||
Handler_read_prev 0
|
||||
Handler_read_rnd 1
|
||||
Handler_read_rnd_next 0
|
||||
Handler_read_rnd 2
|
||||
Handler_read_rnd_next 9
|
||||
flush status;
|
||||
delete from t1 order by a limit 1;
|
||||
show status like 'handler_read%';
|
||||
@@ -318,7 +319,21 @@ Handler_read_next 0
|
||||
Handler_read_prev 0
|
||||
Handler_read_rnd 1
|
||||
Handler_read_rnd_next 9
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
5
|
||||
select * from t1;
|
||||
a b
|
||||
0 0
|
||||
0 0
|
||||
0 0
|
||||
0 0
|
||||
0 0
|
||||
update t1 set a=a+10,b=1 order by a limit 3;
|
||||
update t1 set a=a+11,b=2 order by a limit 3;
|
||||
update t1 set a=a+12,b=3 order by a limit 3;
|
||||
select * from t1 order by a;
|
||||
a b
|
||||
11 2
|
||||
21 2
|
||||
22 3
|
||||
22 3
|
||||
23 3
|
||||
drop table t1;
|
||||
|
@@ -23,4 +23,25 @@ SELECT * FROM t1 WHERE popisek = '2005-01-1';
|
||||
SELECT * FROM t1 WHERE popisek LIKE '2005-01-1';
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#13347: empty result from query with like and cp1250 charset
|
||||
#
|
||||
set names cp1250;
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
str VARCHAR(32) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL default '',
|
||||
UNIQUE KEY (str)
|
||||
);
|
||||
|
||||
INSERT INTO t1 VALUES (NULL, 'a');
|
||||
INSERT INTO t1 VALUES (NULL, 'aa');
|
||||
INSERT INTO t1 VALUES (NULL, 'aaa');
|
||||
INSERT INTO t1 VALUES (NULL, 'aaaa');
|
||||
INSERT INTO t1 VALUES (NULL, 'aaaaa');
|
||||
INSERT INTO t1 VALUES (NULL, 'aaaaaa');
|
||||
INSERT INTO t1 VALUES (NULL, 'aaaaaaa');
|
||||
select * from t1 where str like 'aa%';
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
@@ -261,4 +261,12 @@ select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1,
|
||||
str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2;
|
||||
--enable_ps_protocol
|
||||
|
||||
#
|
||||
# Bug #14016
|
||||
#
|
||||
create table t1 (f1 datetime);
|
||||
insert into t1 (f1) values ("2005-01-01");
|
||||
insert into t1 (f1) values ("2005-02-01");
|
||||
select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M");
|
||||
drop table t1;
|
||||
# End of 4.1 tests
|
||||
|
@@ -202,4 +202,26 @@ insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b;
|
||||
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
#
|
||||
# Bug #12695 Item_func_isnull::update_used_tables() did not update
|
||||
# const_item_cache
|
||||
create table t1(f1 varchar(5) key);
|
||||
insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
|
||||
insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
|
||||
insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #13392 values() fails with 'ambiguous' or returns NULL
|
||||
# with ON DUPLICATE and SELECT
|
||||
create table t1(x int, y int);
|
||||
create table t2(x int, z int);
|
||||
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(x);
|
||||
--error 1054
|
||||
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z);
|
||||
--error 1054
|
||||
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
|
||||
drop table t1,t2;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
@@ -629,6 +629,25 @@ show index from t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
# WL#2609, CSC#XXXX: MyISAM
|
||||
set myisam_stats_method=nulls_ignored;
|
||||
show variables like 'myisam_stats_method';
|
||||
|
||||
create table t1 (
|
||||
a char(3), b char(4), c char(5), d char(6),
|
||||
key(a,b,c,d)
|
||||
);
|
||||
insert into t1 values ('bcd','def1', NULL, 'zz');
|
||||
insert into t1 values ('bcd','def2', NULL, 'zz');
|
||||
insert into t1 values ('bce','def1', 'yuu', NULL);
|
||||
insert into t1 values ('bce','def2', NULL, 'quux');
|
||||
analyze table t1;
|
||||
show index from t1;
|
||||
delete from t1;
|
||||
analyze table t1;
|
||||
show index from t1;
|
||||
|
||||
set myisam_stats_method=DEFAULT;
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
|
@@ -6,7 +6,7 @@
|
||||
# var/log/mysql_client_test.trace
|
||||
|
||||
--disable_result_log
|
||||
--exec echo $MYSQL_CLIENT_TEST
|
||||
--exec $MYSQL_CLIENT_TEST
|
||||
--exec echo $MYSQL_CLIENT_TEST --getopt-ll-test=25600M
|
||||
--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M
|
||||
|
||||
# End of 4.1 tests
|
||||
|
@@ -2244,6 +2244,15 @@ SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1
|
||||
WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
|
||||
#
|
||||
# Bug #13855 select distinct with group by caused server crash
|
||||
#
|
||||
create table t1 (f1 int primary key, f2 int);
|
||||
create table t2 (f3 int, f4 int, primary key(f3,f4));
|
||||
insert into t1 values (1,1);
|
||||
insert into t2 values (1,1),(1,2);
|
||||
select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1;
|
||||
drop table t1,t2;
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
|
@@ -228,15 +228,16 @@ delete from t1 where count(*)=1;
|
||||
drop table t1;
|
||||
|
||||
# BUG#12915: Optimize "DELETE|UPDATE ... ORDER BY ... LIMIT n" to use an index
|
||||
create table t1 ( a int, index (a) );
|
||||
insert into t1 values (0),(0),(0),(0),(0),(0),(0),(0);
|
||||
create table t1 ( a int, b int default 0, index (a) );
|
||||
insert into t1 (a) values (0),(0),(0),(0),(0),(0),(0),(0);
|
||||
|
||||
flush status;
|
||||
select a from t1 order by a limit 1;
|
||||
show status like 'handler_read%';
|
||||
|
||||
flush status;
|
||||
update t1 set a=unix_timestamp() order by a limit 1;
|
||||
update t1 set a=9999 order by a limit 1;
|
||||
update t1 set b=9999 order by a limit 1;
|
||||
show status like 'handler_read%';
|
||||
|
||||
flush status;
|
||||
@@ -253,7 +254,11 @@ flush status;
|
||||
delete from t1 order by a limit 1;
|
||||
show status like 'handler_read%';
|
||||
|
||||
select count(*) from t1;
|
||||
select * from t1;
|
||||
update t1 set a=a+10,b=1 order by a limit 3;
|
||||
update t1 set a=a+11,b=2 order by a limit 3;
|
||||
update t1 set a=a+12,b=3 order by a limit 3;
|
||||
select * from t1 order by a;
|
||||
|
||||
drop table t1;
|
||||
# End of 4.1 tests
|
||||
|
Reference in New Issue
Block a user