mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mysql.com:/home/jimw/my/mysql-4.1-8471
into mysql.com:/home/jimw/my/mysql-4.1-clean sql/sql_acl.cc: Auto merged
This commit is contained in:
@ -141,3 +141,14 @@ delete t1 from t1 where a = 3;
|
||||
check table t1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #8392: delete with ORDER BY containing a direct reference to the table
|
||||
#
|
||||
|
||||
CREATE TABLE t1 ( a int PRIMARY KEY );
|
||||
DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
|
||||
INSERT INTO t1 VALUES (0),(1),(2);
|
||||
DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
@ -309,6 +309,14 @@ REPAIR TABLE t1;
|
||||
select count(*) from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# testing out of bounds memory access in ft_nlq_find_relevance()
|
||||
# (bug#8522); visible in valgrind.
|
||||
#
|
||||
CREATE TABLE t1 ( a TEXT, FULLTEXT (a) );
|
||||
INSERT INTO t1 VALUES ('testing ft_nlq_find_relevance');
|
||||
SELECT MATCH(a) AGAINST ('nosuchword') FROM t1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# bug#6784
|
||||
# mi_flush_bulk_insert (on dup key error in mi_write)
|
||||
@ -322,3 +330,11 @@ insert t2 values (10, "aaaa"), (2, "cccc");
|
||||
replace t1 select * from t2;
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# bug#8351
|
||||
#
|
||||
CREATE TABLE t1 (t VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci, FULLTEXT (t));
|
||||
SET NAMES latin1;
|
||||
INSERT INTO t1 VALUES('Mit freundlichem Gr<47><72> aus Osnabr<62>ck');
|
||||
SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabr<62>ck"' IN BOOLEAN MODE);
|
||||
DROP TABLE t1;
|
||||
|
@ -29,13 +29,13 @@ INSERT INTO t2 VALUES (6,2,'um chocolate Snickers');
|
||||
INSERT INTO t2 VALUES (7,1,'Bife');
|
||||
INSERT INTO t2 VALUES (8,1,'Pizza de Salmao');
|
||||
|
||||
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8)
|
||||
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6)
|
||||
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
|
||||
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
|
||||
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8)
|
||||
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6)
|
||||
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
|
||||
|
@ -111,3 +111,20 @@ select * from T1;
|
||||
alter table T1 add index (a);
|
||||
select * from T1;
|
||||
drop table T1;
|
||||
|
||||
#
|
||||
# Bug #8355: Tables not dropped from table cache on drop db
|
||||
#
|
||||
create database mysqltest_LC2;
|
||||
use mysqltest_LC2;
|
||||
create table myUC (i int);
|
||||
insert into myUC values (1),(2),(3);
|
||||
select * from myUC;
|
||||
use test;
|
||||
drop database mysqltest_LC2;
|
||||
create database mysqltest_LC2;
|
||||
use mysqltest_LC2;
|
||||
create table myUC (i int);
|
||||
select * from myUC;
|
||||
use test;
|
||||
drop database mysqltest_LC2;
|
||||
|
1
mysql-test/t/lowercase_table_grant-master.opt
Normal file
1
mysql-test/t/lowercase_table_grant-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--lower_case_table_names
|
25
mysql-test/t/lowercase_table_grant.test
Normal file
25
mysql-test/t/lowercase_table_grant.test
Normal file
@ -0,0 +1,25 @@
|
||||
# Test of grants when lower_case_table_names is on
|
||||
use mysql;
|
||||
|
||||
# mixed-case database name for testing
|
||||
create database MYSQLtest;
|
||||
|
||||
# check that database name gets forced to lowercase
|
||||
grant all on MySQLtest.* to mysqltest_1@localhost;
|
||||
show grants for mysqltest_1@localhost;
|
||||
|
||||
# now force it to mixed case, but see that it is lowercased in the acl cache
|
||||
select * from db where user = 'mysqltest_1';
|
||||
update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost';
|
||||
flush privileges;
|
||||
show grants for mysqltest_1@localhost;
|
||||
select * from db where user = 'mysqltest_1';
|
||||
|
||||
# clear out the user we created
|
||||
#
|
||||
# can't use REVOKE because of the mixed-case database name
|
||||
delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost';
|
||||
flush privileges;
|
||||
drop user mysqltest_1@localhost;
|
||||
|
||||
drop database MYSQLtest;
|
@ -249,6 +249,58 @@ select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59';
|
||||
|
||||
drop table t1;
|
||||
|
||||
# decimal (not the new 5.0 thing)
|
||||
|
||||
create table t1 (
|
||||
a int primary key,
|
||||
s decimal(12),
|
||||
t decimal(12, 5),
|
||||
u decimal(12) unsigned,
|
||||
v decimal(12, 5) unsigned,
|
||||
key (s),
|
||||
key (t),
|
||||
key (u),
|
||||
key (v)
|
||||
) engine=ndb;
|
||||
#
|
||||
insert into t1 values
|
||||
( 0, -000000000007, -0000061.00003, 000000000061, 0000965.00042),
|
||||
( 1, -000000000007, -0000061.00042, 000000000061, 0000965.00003),
|
||||
( 2, -071006035767, 4210253.00024, 000000000001, 0000001.84488),
|
||||
( 3, 000000007115, 0000000.77607, 000077350625, 0000018.00013),
|
||||
( 4, -000000068391, -0346486.00000, 000000005071, 0005334.00002),
|
||||
( 5, -521579890459, -1936874.00001, 000000000154, 0000003.00018),
|
||||
( 6, -521579890459, -1936874.00018, 000000000154, 0000003.00001),
|
||||
( 7, 000000000333, 0000051.39140, 000000907958, 0788643.08374),
|
||||
( 8, 000042731229, 0000009.00000, 000000000009, 6428667.00000),
|
||||
( 9, -000008159769, 0000918.00004, 000096951421, 7607730.00008);
|
||||
#
|
||||
select count(*)- 5 from t1 use index (s) where s < -000000000007;
|
||||
select count(*)- 7 from t1 use index (s) where s <= -000000000007;
|
||||
select count(*)- 2 from t1 use index (s) where s = -000000000007;
|
||||
select count(*)- 5 from t1 use index (s) where s >= -000000000007;
|
||||
select count(*)- 3 from t1 use index (s) where s > -000000000007;
|
||||
#
|
||||
select count(*)- 4 from t1 use index (t) where t < -0000061.00003;
|
||||
select count(*)- 5 from t1 use index (t) where t <= -0000061.00003;
|
||||
select count(*)- 1 from t1 use index (t) where t = -0000061.00003;
|
||||
select count(*)- 6 from t1 use index (t) where t >= -0000061.00003;
|
||||
select count(*)- 5 from t1 use index (t) where t > -0000061.00003;
|
||||
#
|
||||
select count(*)- 2 from t1 use index (u) where u < 000000000061;
|
||||
select count(*)- 4 from t1 use index (u) where u <= 000000000061;
|
||||
select count(*)- 2 from t1 use index (u) where u = 000000000061;
|
||||
select count(*)- 8 from t1 use index (u) where u >= 000000000061;
|
||||
select count(*)- 6 from t1 use index (u) where u > 000000000061;
|
||||
#
|
||||
select count(*)- 5 from t1 use index (v) where v < 0000965.00042;
|
||||
select count(*)- 6 from t1 use index (v) where v <= 0000965.00042;
|
||||
select count(*)- 1 from t1 use index (v) where v = 0000965.00042;
|
||||
select count(*)- 5 from t1 use index (v) where v >= 0000965.00042;
|
||||
select count(*)- 4 from t1 use index (v) where v > 0000965.00042;
|
||||
|
||||
drop table t1;
|
||||
|
||||
# bug#7798
|
||||
create table t1(a int primary key, b int not null, index(b));
|
||||
insert into t1 values (1,1), (2,2);
|
||||
|
@ -599,6 +599,7 @@ drop table t2;
|
||||
prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ;
|
||||
create table t5 (a int) ;
|
||||
# rename must fail, t7 does not exist
|
||||
--replace_result \\ /
|
||||
--error 1017
|
||||
execute stmt1 ;
|
||||
create table t7 (a int) ;
|
||||
|
@ -6,7 +6,7 @@ connection master;
|
||||
drop database if exists mysqltest;
|
||||
sync_slave_with_master;
|
||||
# can't read dir
|
||||
--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X"
|
||||
--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" \\ /
|
||||
--error 12
|
||||
show tables from mysqltest;
|
||||
|
||||
|
2
mysql-test/t/rpl_drop_temp-slave.opt
Normal file
2
mysql-test/t/rpl_drop_temp-slave.opt
Normal file
@ -0,0 +1,2 @@
|
||||
--replicate-ignore-table=mysqltest.t2
|
||||
|
13
mysql-test/t/rpl_drop_temp.test
Normal file
13
mysql-test/t/rpl_drop_temp.test
Normal file
@ -0,0 +1,13 @@
|
||||
source include/master-slave.inc;
|
||||
--disable_warnings
|
||||
create database if not exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
create temporary table mysqltest.t1 (n int);
|
||||
create temporary table mysqltest.t2 (n int);
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
disconnect master;
|
||||
connection slave;
|
||||
--real_sleep 3; # time for DROP to be written
|
||||
show status like 'Slave_open_temp_tables';
|
29
mysql-test/t/rpl_multi_query.test
Normal file
29
mysql-test/t/rpl_multi_query.test
Normal file
@ -0,0 +1,29 @@
|
||||
# Test for BUG#8436: verify that a multi-query (i.e. one query
|
||||
# containing several queries (assuming client has
|
||||
# CLIENT_MULTI_STATEMENTS) will be binlogged ONE-query-per-event (not
|
||||
# one binlog event containing all queries)
|
||||
|
||||
# PS doesn't support multi-statements
|
||||
--disable_ps_protocol
|
||||
|
||||
source include/master-slave.inc;
|
||||
--disable_warnings
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
create database mysqltest;
|
||||
|
||||
delimiter /;
|
||||
create table mysqltest.t1 ( n int);
|
||||
insert into mysqltest.t1 values(1)/
|
||||
insert into mysqltest.t1 values(2);
|
||||
insert into mysqltest.t1 values(3);
|
||||
insert into mysqltest.t1 values(4);
|
||||
insert into mysqltest.t1 values(5)/
|
||||
delimiter ;/
|
||||
sync_slave_with_master;
|
||||
select * from mysqltest.t1;
|
||||
connection master;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 79;
|
||||
drop database mysqltest;
|
||||
sync_slave_with_master;
|
@ -1945,3 +1945,22 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
|
||||
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
||||
#
|
||||
# Test case for bug 7098: substitution of a constant for a string field
|
||||
#
|
||||
|
||||
CREATE TABLE t1 ( city char(30) );
|
||||
INSERT INTO t1 VALUES ('London');
|
||||
INSERT INTO t1 VALUES ('Paris');
|
||||
|
||||
SELECT * FROM t1 WHERE city='London';
|
||||
SELECT * FROM t1 WHERE city='london';
|
||||
EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london';
|
||||
SELECT * FROM t1 WHERE city='London' AND city='london';
|
||||
EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
|
||||
SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
@ -1437,3 +1437,104 @@ select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx;
|
||||
-- error 1247
|
||||
select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL;
|
||||
drop table t1;
|
||||
|
||||
# Test for BUG#8218
|
||||
|
||||
CREATE TABLE t1 (
|
||||
categoryId int(11) NOT NULL,
|
||||
courseId int(11) NOT NULL,
|
||||
startDate datetime NOT NULL,
|
||||
endDate datetime NOT NULL,
|
||||
createDate datetime NOT NULL,
|
||||
modifyDate timestamp NOT NULL,
|
||||
attributes text NOT NULL
|
||||
);
|
||||
INSERT INTO t1 VALUES (1,41,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''),
|
||||
(1,86,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''),
|
||||
(1,87,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''),
|
||||
(2,52,'2004-03-15','2004-10-01','2004-03-15','2004-09-17',''),
|
||||
(2,53,'2004-03-16','2004-10-01','2004-03-16','2004-09-17',''),
|
||||
(2,88,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''),
|
||||
(2,89,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''),
|
||||
(3,51,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''),
|
||||
(5,12,'2004-02-18','2010-01-01','2004-02-18','2004-02-18','');
|
||||
|
||||
CREATE TABLE t2 (
|
||||
userId int(11) NOT NULL,
|
||||
courseId int(11) NOT NULL,
|
||||
date datetime NOT NULL
|
||||
);
|
||||
INSERT INTO t2 VALUES (5141,71,'2003-11-18'),
|
||||
(5141,72,'2003-11-25'),(5141,41,'2004-08-06'),
|
||||
(5141,52,'2004-08-06'),(5141,53,'2004-08-06'),
|
||||
(5141,12,'2004-08-06'),(5141,86,'2004-10-21'),
|
||||
(5141,87,'2004-10-21'),(5141,88,'2004-10-21'),
|
||||
(5141,89,'2004-10-22'),(5141,51,'2004-10-26');
|
||||
|
||||
|
||||
CREATE TABLE t3 (
|
||||
groupId int(11) NOT NULL,
|
||||
parentId int(11) NOT NULL,
|
||||
startDate datetime NOT NULL,
|
||||
endDate datetime NOT NULL,
|
||||
createDate datetime NOT NULL,
|
||||
modifyDate timestamp NOT NULL,
|
||||
ordering int(11)
|
||||
);
|
||||
INSERT INTO t3 VALUES (12,9,'1000-01-01','3999-12-31','2004-01-29','2004-01-29',NULL);
|
||||
|
||||
CREATE TABLE t4 (
|
||||
id int(11) NOT NULL,
|
||||
groupTypeId int(11) NOT NULL,
|
||||
groupKey varchar(50) NOT NULL,
|
||||
name text,
|
||||
ordering int(11),
|
||||
description text,
|
||||
createDate datetime NOT NULL,
|
||||
modifyDate timestamp NOT NULL
|
||||
);
|
||||
INSERT INTO t4 VALUES (9,5,'stationer','stationer',0,'Stationer','2004-01-29','2004-01-29'),
|
||||
(12,5,'group2','group2',0,'group2','2004-01-29','2004-01-29');
|
||||
|
||||
CREATE TABLE t5 (
|
||||
userId int(11) NOT NULL,
|
||||
groupId int(11) NOT NULL,
|
||||
createDate datetime NOT NULL,
|
||||
modifyDate timestamp NOT NULL
|
||||
);
|
||||
INSERT INTO t5 VALUES (5141,12,'2004-08-06','2004-08-06');
|
||||
|
||||
select
|
||||
count(distinct t2.userid) pass,
|
||||
groupstuff.*,
|
||||
count(t2.courseid) crse,
|
||||
t1.categoryid,
|
||||
t2.courseid,
|
||||
date_format(date, '%b%y') as colhead
|
||||
from t2
|
||||
join t1 on t2.courseid=t1.courseid
|
||||
join
|
||||
(
|
||||
select
|
||||
t5.userid,
|
||||
parentid,
|
||||
parentgroup,
|
||||
childid,
|
||||
groupname,
|
||||
grouptypeid
|
||||
from t5
|
||||
join
|
||||
(
|
||||
select t4.id as parentid,
|
||||
t4.name as parentgroup,
|
||||
t4.id as childid,
|
||||
t4.name as groupname,
|
||||
t4.grouptypeid
|
||||
from t4
|
||||
) as gin on t5.groupid=gin.childid
|
||||
) as groupstuff on t2.userid = groupstuff.userid
|
||||
group by
|
||||
groupstuff.groupname, colhead , t2.courseid;
|
||||
|
||||
drop table if exists t1, t2, t3, t4, t5;
|
||||
|
||||
|
@ -362,3 +362,11 @@ drop table t1;
|
||||
|
||||
SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8;
|
||||
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
|
||||
|
||||
#
|
||||
# Bug #6958: negative arguments to integer options wrap around
|
||||
#
|
||||
|
||||
SET GLOBAL table_cache=-1;
|
||||
SHOW VARIABLES LIKE 'table_cache';
|
||||
SET GLOBAL table_cache=DEFAULT;
|
||||
|
Reference in New Issue
Block a user