mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Optimize thai character handling
Remove sel000xxxx tests After merge fixes
This commit is contained in:
@ -427,3 +427,40 @@ name
|
||||
a
|
||||
e
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(75) DEFAULT '' NOT NULL,
|
||||
LINK_ID int(11) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME),
|
||||
KEY LINK_ID (LINK_ID)
|
||||
);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0);
|
||||
CREATE TABLE t2 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(150) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME)
|
||||
);
|
||||
SELECT DISTINCT
|
||||
t2.id AS key_link_id,
|
||||
t2.name AS link
|
||||
FROM t1
|
||||
LEFT JOIN t2 ON t1.link_id=t2.id
|
||||
GROUP BY t1.id
|
||||
ORDER BY link;
|
||||
key_link_id link
|
||||
NULL NULL
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
html varchar(5) default NULL,
|
||||
rin int(11) default '0',
|
||||
out int(11) default '0'
|
||||
) TYPE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('1',1,0);
|
||||
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
|
||||
html prod
|
||||
1 0.00
|
||||
drop table t1;
|
||||
|
@ -145,7 +145,7 @@ show grants for drop_user@localhost;
|
||||
Grants for drop_user@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION
|
||||
GRANT USAGE ON `test`.`t1` TO 'drop_user'@'localhost'
|
||||
GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost'
|
||||
revoke all privileges, grant from drop_user@localhost;
|
||||
show grants for drop_user@localhost;
|
||||
Grants for drop_user@localhost
|
||||
|
@ -265,11 +265,24 @@ INSERT INTO t1 VALUES (0),(0),(1),(1);
|
||||
CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
|
||||
INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
|
||||
explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t2 ref j1 j1 4 const 1 Using where; Using index
|
||||
t1 ALL i1,i2 NULL NULL NULL 4 Range checked for each record (index map: 3)
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using where; Using index
|
||||
1 SIMPLE t1 ALL i1,i2 NULL NULL NULL 4 Range checked for each record (index map: 3)
|
||||
explain select * from t1 force index(i2), t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t2 ref j1 j1 4 const 1 Using where; Using index
|
||||
t1 ALL i2 NULL NULL NULL 4 Range checked for each record (index map: 2)
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using where; Using index
|
||||
1 SIMPLE t1 ALL i2 NULL NULL NULL 4 Range checked for each record (index map: 2)
|
||||
DROP TABLE t1,t2;
|
||||
create table t1 (id int(10) primary key);
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
select id from t1 where id in (2,5,9) ;
|
||||
id
|
||||
2
|
||||
5
|
||||
9
|
||||
select id from t1 where id=2 or id=5 or id=9 ;
|
||||
id
|
||||
2
|
||||
5
|
||||
9
|
||||
drop table t1;
|
||||
|
@ -1,14 +0,0 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (id int(10) primary key);
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
select id from t1 where id in (2,5,9) ;
|
||||
id
|
||||
2
|
||||
5
|
||||
9
|
||||
select id from t1 where id=2 or id=5 or id=9 ;
|
||||
id
|
||||
2
|
||||
5
|
||||
9
|
||||
drop table t1;
|
@ -1,38 +0,0 @@
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(75) DEFAULT '' NOT NULL,
|
||||
LINK_ID int(11) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME),
|
||||
KEY LINK_ID (LINK_ID)
|
||||
);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0);
|
||||
CREATE TABLE t2 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(150) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME)
|
||||
);
|
||||
SELECT DISTINCT
|
||||
t2.id AS key_link_id,
|
||||
t2.name AS link
|
||||
FROM t1
|
||||
LEFT JOIN t2 ON t1.link_id=t2.id
|
||||
GROUP BY t1.id
|
||||
ORDER BY link;
|
||||
key_link_id link
|
||||
NULL NULL
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
html varchar(5) default NULL,
|
||||
rin int(11) default '0',
|
||||
out int(11) default '0'
|
||||
) TYPE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('1',1,0);
|
||||
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
|
||||
html prod
|
||||
1 0.00
|
||||
drop table t1;
|
@ -285,3 +285,50 @@ INSERT INTO t1 VALUES (3, 'aaaaa');
|
||||
INSERT INTO t1 VALUES (2, 'eeeeeee');
|
||||
select distinct left(name,1) as name from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test case from sel000100
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(75) DEFAULT '' NOT NULL,
|
||||
LINK_ID int(11) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME),
|
||||
KEY LINK_ID (LINK_ID)
|
||||
);
|
||||
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0);
|
||||
|
||||
CREATE TABLE t2 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(150) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME)
|
||||
);
|
||||
|
||||
SELECT DISTINCT
|
||||
t2.id AS key_link_id,
|
||||
t2.name AS link
|
||||
FROM t1
|
||||
LEFT JOIN t2 ON t1.link_id=t2.id
|
||||
GROUP BY t1.id
|
||||
ORDER BY link;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# test case for #674
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
html varchar(5) default NULL,
|
||||
rin int(11) default '0',
|
||||
out int(11) default '0'
|
||||
) TYPE=MyISAM;
|
||||
|
||||
INSERT INTO t1 VALUES ('1',1,0);
|
||||
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
|
||||
drop table t1;
|
||||
|
@ -217,3 +217,11 @@ explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||
explain select * from t1 force index(i2), t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
# test for a bug with in() and unique key
|
||||
|
||||
create table t1 (id int(10) primary key);
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
|
||||
select id from t1 where id in (2,5,9) ;
|
||||
select id from t1 where id=2 or id=5 or id=9 ;
|
||||
drop table t1;
|
||||
|
@ -1,20 +0,0 @@
|
||||
# sel000033
|
||||
#
|
||||
# Versions
|
||||
# --------
|
||||
# 3.22
|
||||
# 3.23
|
||||
#
|
||||
# Description
|
||||
# -----------
|
||||
# test for a bug with in() and unique key
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
create table t1 (id int(10) primary key);
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
|
||||
select id from t1 where id in (2,5,9) ;
|
||||
select id from t1 where id=2 or id=5 or id=9 ;
|
||||
drop table t1;
|
@ -1,48 +0,0 @@
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(75) DEFAULT '' NOT NULL,
|
||||
LINK_ID int(11) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME),
|
||||
KEY LINK_ID (LINK_ID)
|
||||
);
|
||||
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0);
|
||||
|
||||
CREATE TABLE t2 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(150) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME)
|
||||
);
|
||||
|
||||
SELECT DISTINCT
|
||||
t2.id AS key_link_id,
|
||||
t2.name AS link
|
||||
FROM t1
|
||||
LEFT JOIN t2 ON t1.link_id=t2.id
|
||||
GROUP BY t1.id
|
||||
ORDER BY link;
|
||||
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# test case for #674
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
html varchar(5) default NULL,
|
||||
rin int(11) default '0',
|
||||
out int(11) default '0'
|
||||
) TYPE=MyISAM;
|
||||
|
||||
INSERT INTO t1 VALUES ('1',1,0);
|
||||
|
||||
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
|
||||
|
||||
drop table t1;
|
Reference in New Issue
Block a user