mirror of
https://github.com/MariaDB/server.git
synced 2025-11-12 10:22:39 +03:00
Merge bk-internal:/home/bk/mysql-5.1-new
into neptunus.(none):/home/msvensson/mysql/mysql-5.1 mysql-test/mysql-test-run.pl: Auto merged
This commit is contained in:
@@ -512,3 +512,24 @@ id IFNULL(dsc, '-')
|
||||
2 line number two
|
||||
3 line number three
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
x varchar(20) default NULL,
|
||||
y decimal(10,0) default NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY (y)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
INSERT INTO t1 VALUES
|
||||
(1,'ba','-1'),
|
||||
(2,'ba','1150'),
|
||||
(306,'ba','-1'),
|
||||
(307,'ba','1150'),
|
||||
(611,'ba','-1'),
|
||||
(612,'ba','1150');
|
||||
select count(distinct x,y) from t1;
|
||||
count(distinct x,y)
|
||||
2
|
||||
select count(distinct concat(x,y)) from t1;
|
||||
count(distinct concat(x,y))
|
||||
2
|
||||
drop table t1;
|
||||
|
||||
@@ -63,3 +63,14 @@ pk u o
|
||||
5 5 5
|
||||
insert into t1 values (1,1,1);
|
||||
drop table t1;
|
||||
create table t3 (id2 int) engine=ndb;
|
||||
lock tables t3 write;
|
||||
unlock tables;
|
||||
drop table t3;
|
||||
create table t2 (id int, j int) engine=ndb;
|
||||
insert into t2 values (2, 2);
|
||||
create table t3 (id int) engine=ndb;
|
||||
lock tables t3 read;
|
||||
delete t2 from t2, t3 where t2.id = t3.id;
|
||||
unlock tables;
|
||||
drop table t2, t3;
|
||||
|
||||
22
mysql-test/r/rpl_trunc_temp.result
Normal file
22
mysql-test/r/rpl_trunc_temp.result
Normal file
@@ -0,0 +1,22 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create temporary table t1 (n int);
|
||||
insert into t1 values(1);
|
||||
show status like 'Slave_open_temp_tables';
|
||||
Variable_name Value
|
||||
Slave_open_temp_tables 1
|
||||
delete from t1;
|
||||
show status like 'Slave_open_temp_tables';
|
||||
Variable_name Value
|
||||
Slave_open_temp_tables 1
|
||||
truncate t1;
|
||||
show status like 'Slave_open_temp_tables';
|
||||
Variable_name Value
|
||||
Slave_open_temp_tables 1
|
||||
show status like 'Slave_open_temp_tables';
|
||||
Variable_name Value
|
||||
Slave_open_temp_tables 0
|
||||
@@ -561,6 +561,42 @@ A B C
|
||||
select extractvalue('<A_B>A</A_B>','/A_B');
|
||||
extractvalue('<A_B>A</A_B>','/A_B')
|
||||
A
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[position()]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[position()]')
|
||||
B1 B2
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=last()]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=last()]')
|
||||
B1 B2
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()]')
|
||||
B2
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()-1]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()-1]')
|
||||
B1
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=1]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=1]')
|
||||
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=2]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=2]')
|
||||
B1 B2
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=position()]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=position()]')
|
||||
B2
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)]')
|
||||
B2
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)-1]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)-1]')
|
||||
B1
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=1]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=1]')
|
||||
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=2]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=2]')
|
||||
B1 B2
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=position()]');
|
||||
extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=position()]')
|
||||
B2
|
||||
select extractvalue('<a>Jack</a>','/a[contains(../a,"J")]');
|
||||
extractvalue('<a>Jack</a>','/a[contains(../a,"J")]')
|
||||
Jack
|
||||
|
||||
@@ -358,3 +358,27 @@ select distinct id, IFNULL(dsc, '-') from t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
|
||||
#
|
||||
# Bug #15745 ( COUNT(DISTINCT CONCAT(x,y)) returns wrong result)
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
x varchar(20) default NULL,
|
||||
y decimal(10,0) default NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY (y)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
INSERT INTO t1 VALUES
|
||||
(1,'ba','-1'),
|
||||
(2,'ba','1150'),
|
||||
(306,'ba','-1'),
|
||||
(307,'ba','1150'),
|
||||
(611,'ba','-1'),
|
||||
(612,'ba','1150');
|
||||
|
||||
select count(distinct x,y) from t1;
|
||||
select count(distinct concat(x,y)) from t1;
|
||||
drop table t1;
|
||||
|
||||
@@ -70,3 +70,39 @@ insert into t1 values (1,1,1);
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
# Bug #17812 Previous lock table for write causes "stray" lock
|
||||
# although table is recreated
|
||||
#
|
||||
# this creating, locking, and dropping causes a subsequent hang
|
||||
# on the delete below waiting for table t2 the locking in the
|
||||
# "other" connection is relevant, as without it there is no problem
|
||||
#
|
||||
connection con1;
|
||||
create table t3 (id2 int) engine=ndb;
|
||||
|
||||
connection con2;
|
||||
lock tables t3 write;
|
||||
unlock tables;
|
||||
|
||||
connection con1;
|
||||
drop table t3;
|
||||
|
||||
connection con1;
|
||||
create table t2 (id int, j int) engine=ndb;
|
||||
insert into t2 values (2, 2);
|
||||
create table t3 (id int) engine=ndb;
|
||||
|
||||
connection con2;
|
||||
lock tables t3 read;
|
||||
|
||||
connection con1;
|
||||
# here we get a hang before bugfix although we shouldn't
|
||||
delete t2 from t2, t3 where t2.id = t3.id;
|
||||
|
||||
connection con2;
|
||||
unlock tables;
|
||||
|
||||
connection con1;
|
||||
drop table t2, t3;
|
||||
|
||||
35
mysql-test/t/rpl_trunc_temp.test
Normal file
35
mysql-test/t/rpl_trunc_temp.test
Normal file
@@ -0,0 +1,35 @@
|
||||
# Requires statement logging
|
||||
-- source include/have_binlog_format_statement.inc
|
||||
|
||||
source include/master-slave.inc;
|
||||
|
||||
#
|
||||
# Bug#17137 Running "truncate table" on temporary table
|
||||
# leaves the table open on a slave
|
||||
#
|
||||
|
||||
create temporary table t1 (n int);
|
||||
insert into t1 values(1);
|
||||
sync_slave_with_master;
|
||||
show status like 'Slave_open_temp_tables';
|
||||
|
||||
# Perform a delete from temp table
|
||||
connection master;
|
||||
delete from t1;
|
||||
sync_slave_with_master;
|
||||
show status like 'Slave_open_temp_tables';
|
||||
|
||||
# Perform truncate on temp table
|
||||
connection master;
|
||||
truncate t1;
|
||||
sync_slave_with_master;
|
||||
show status like 'Slave_open_temp_tables';
|
||||
|
||||
# Disconnect the master, temp table on slave should dissapear
|
||||
disconnect master;
|
||||
--real_sleep 3 # time for DROP to be read by slave
|
||||
connection slave;
|
||||
show status like 'Slave_open_temp_tables';
|
||||
|
||||
|
||||
# End of 4.1 tests
|
||||
@@ -255,6 +255,21 @@ select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant-or-self::*');
|
||||
#
|
||||
select extractvalue('<A_B>A</A_B>','/A_B');
|
||||
|
||||
#
|
||||
# Bug#16318: XML: extractvalue() incorrectly returns last() = 1
|
||||
#
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[position()]');
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=last()]');
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()]');
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()-1]');
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=1]');
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=2]');
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=position()]');
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)]');
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)-1]');
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=1]');
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=2]');
|
||||
select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=position()]');
|
||||
#
|
||||
# Bug#16316: XML: extractvalue() is case-sensitive with contains()
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user