mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merged some functions and removed some unused client functions.
Remember UNION for ALTER TABLE Added test for if we are supporting transactions. Don't allow REPLACE to replace a row when we have generated an auto_increment key Fixed bug when using BLOB keys Fixed bug in SET @variable=user.
This commit is contained in:
@ -483,3 +483,10 @@ i j
|
||||
1 2
|
||||
build_path
|
||||
current
|
||||
a b
|
||||
a 2
|
||||
a b
|
||||
a 2
|
||||
a b
|
||||
a 1
|
||||
a 2
|
||||
|
@ -120,14 +120,14 @@ UserId
|
||||
b
|
||||
1
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t3 index a a 4 NULL 6 Using index; Using temporary
|
||||
t3 index a a 5 NULL 6 Using index; Using temporary
|
||||
t2 index a a 4 NULL 5 Using index; Distinct
|
||||
t1 eq_ref PRIMARY PRIMARY 4 t2.a 1 where used; Distinct
|
||||
a
|
||||
1
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 index PRIMARY PRIMARY 4 NULL 2 Using index; Using temporary
|
||||
t3 ref a a 5 t1.a 12 Using index; Distinct
|
||||
t3 ref a a 5 t1.a 10 Using index; Distinct
|
||||
a
|
||||
1
|
||||
2
|
||||
|
@ -10,3 +10,10 @@ name_id name
|
||||
name_id name
|
||||
name_id name
|
||||
2 [T,U]_axpby
|
||||
a b
|
||||
a 2
|
||||
a b
|
||||
a 2
|
||||
a b
|
||||
a 1
|
||||
a 2
|
||||
|
@ -103,9 +103,6 @@ test2
|
||||
test2
|
||||
c
|
||||
c
|
||||
test1
|
||||
test1
|
||||
test1
|
||||
incr othr
|
||||
incr othr
|
||||
1 10
|
||||
@ -118,4 +115,15 @@ count(*)
|
||||
20
|
||||
count(*)
|
||||
20
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`incr` int(11) NOT NULL default '0',
|
||||
`othr` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`incr`)
|
||||
) TYPE=MRG_MyISAM UNION=(t1,t2)
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`incr` int(11) NOT NULL default '0',
|
||||
`othr` int(11) NOT NULL default '0'
|
||||
) TYPE=MRG_MyISAM UNION=(t1,t2)
|
||||
a
|
||||
|
@ -0,0 +1,3 @@
|
||||
a b
|
||||
126 first updated
|
||||
127 last
|
||||
|
@ -728,3 +728,18 @@ where
|
||||
t3.platform_id = 2;
|
||||
|
||||
drop table t1, t2, t3, t4, t5, t6,t7;
|
||||
|
||||
#
|
||||
# Test with blob + tinyint key
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a tinytext NOT NULL,
|
||||
b tinyint(3) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (a(32),b)
|
||||
) TYPE=BDB;
|
||||
INSERT INTO t1 VALUES ('a',1),('a',2);
|
||||
SELECT * FROM t1 WHERE a='a' AND b=2;
|
||||
SELECT * FROM t1 WHERE a='a' AND b in (2);
|
||||
SELECT * FROM t1 WHERE a='a' AND b in (1,2);
|
||||
drop table t1;
|
||||
|
@ -144,3 +144,19 @@ INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
|
||||
INSERT INTO t1 VALUES (1, 1, 1, 1, 'b');
|
||||
!$1062 INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test with blob + tinyint key
|
||||
# (Failed for Greg Valure)
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a tinytext NOT NULL,
|
||||
b tinyint(3) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (a(32),b)
|
||||
) TYPE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('a',1),('a',2);
|
||||
SELECT * FROM t1 WHERE a='a' AND b=2;
|
||||
SELECT * FROM t1 WHERE a='a' AND b in (2);
|
||||
SELECT * FROM t1 WHERE a='a' AND b in (1,2);
|
||||
drop table t1;
|
||||
|
@ -50,7 +50,7 @@ insert into t2 (c) values ('test2');
|
||||
insert into t2 (c) values ('test2');
|
||||
select * from t3;
|
||||
select * from t3;
|
||||
delete from t3;
|
||||
delete from t3 where 1=1;
|
||||
select * from t3;
|
||||
select * from t1;
|
||||
drop table t3,t2,t1;
|
||||
@ -78,6 +78,16 @@ alter table t3 UNION=(t1,t2);
|
||||
select count(*) from t3;
|
||||
alter table t3 TYPE=MYISAM;
|
||||
select count(*) from t3;
|
||||
|
||||
# Test that ALTER TABLE rembers the old UNION
|
||||
|
||||
drop table t3;
|
||||
CREATE TABLE t3 (incr int not null, othr int not null, primary key(incr))
|
||||
TYPE=MERGE UNION=(t1,t2);
|
||||
show create table t3;
|
||||
alter table t3 drop primary key;
|
||||
show create table t3;
|
||||
|
||||
drop table t3,t2,t1;
|
||||
|
||||
#
|
||||
|
@ -20,3 +20,17 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||
alter table t1 type=heap;
|
||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test when using replace on a key that has used up it's whole range
|
||||
#
|
||||
|
||||
create table t1 (a tinyint not null auto_increment primary key, b char(20));
|
||||
insert into t1 values (126,"first"),(0,"last");
|
||||
--error 1062
|
||||
insert into t1 values (0,"error");
|
||||
--error 1062
|
||||
replace into t1 values (0,"error");
|
||||
replace into t1 values (126,"first updated");
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user