diff options
author | unknown <monty@donna.mysql.fi> | 2001-03-06 15:24:08 +0200 |
---|---|---|
committer | unknown <monty@donna.mysql.fi> | 2001-03-06 15:24:08 +0200 |
commit | 869c89feaaf82d0f44b2a48db0099aae87b4732f (patch) | |
tree | 54c7bf220f9e21e9f04e2ff2e8a018cf4e33e837 /mysql-test | |
parent | ec5e2f589f09e9c261487a577dcddef3cdb994a5 (diff) | |
download | mariadb-git-869c89feaaf82d0f44b2a48db0099aae87b4732f.tar.gz |
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.
Docs/manual.texi:
Added some examples and moved the Error access denied section to the
error section.
client/mysqltest.c:
Changed to use the new mysql_send_query()
include/mysql.h:
Changed mysql_reap_query() to mysql_send_query().
libmysql/libmysql.c:
Changed mysql_reap_query() to mysql_send_query()
Merged some functions and removed some unused functions.
mysql-test/r/bdb.result:
New test case
mysql-test/r/distinct.result:
New test case
mysql-test/r/key.result:
New test case
mysql-test/r/merge.result:
New test case
mysql-test/r/replace.result:
New test case
mysql-test/t/bdb.test:
New test case
mysql-test/t/key.test:
New test case
mysql-test/t/merge.test:
New test case
mysql-test/t/replace.test:
New test case
mysys/my_lock.c:
Moved global lock variable to static
sql-bench/test-insert.sh:
Added test case for index-read only
sql/field.h:
Fixed that one can optimize ORDER BY with ISAM and GEMINI
sql/ha_berkeley.cc:
Added type casts needed for Windows
sql/ha_innobase.cc:
Removed reference to manual from comment.
sql/ha_myisammrg.cc:
Remember UNION for ALTER TABLE
sql/ha_myisammrg.h:
Remember UNION for ALTER TABLE
sql/handler.cc:
Added test for if we are supporting transactions.
Don't allow REPLACE to replace a row when we have generated an auto_increment key.
sql/handler.h:
Remember UNION for ALTER TABLE
sql/key.cc:
Fixed bug when using BLOB keys
sql/mysql_priv.h:
Added new variables
sql/mysqld.cc:
Added new variables
sql/opt_range.cc:
Fixed problem with BLOB keys
sql/opt_sum.cc:
Fix for BLOB keys
sql/sql_class.cc:
Added test if we need to init/clean transaction variables
sql/sql_insert.cc:
Fix for REPLACE and auto_increment keys
sql/sql_parse.cc:
Fixed bug in max_user_connections
sql/sql_select.cc:
Fixed problem with key on BLOB
sql/sql_yacc.yy:
Fixed bug in SET @variable=user.
sql/table.cc:
Fixed problem with keys on BLOB
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/bdb.result | 7 | ||||
-rw-r--r-- | mysql-test/r/distinct.result | 4 | ||||
-rw-r--r-- | mysql-test/r/key.result | 7 | ||||
-rw-r--r-- | mysql-test/r/merge.result | 14 | ||||
-rw-r--r-- | mysql-test/r/replace.result | 3 | ||||
-rw-r--r-- | mysql-test/t/bdb.test | 15 | ||||
-rw-r--r-- | mysql-test/t/key.test | 16 | ||||
-rw-r--r-- | mysql-test/t/merge.test | 12 | ||||
-rw-r--r-- | mysql-test/t/replace.test | 14 |
9 files changed, 86 insertions, 6 deletions
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 4e7aab9594b..42d14e1c34f 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -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 diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 1199cd07e2e..309ed5dff4e 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -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 diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index 22c30c975f0..dbdec824d3b 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -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 diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index e741a309c9f..9e8e1b81687 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -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 diff --git a/mysql-test/r/replace.result b/mysql-test/r/replace.result index e69de29bb2d..25a6a17da35 100644 --- a/mysql-test/r/replace.result +++ b/mysql-test/r/replace.result @@ -0,0 +1,3 @@ +a b +126 first updated +127 last diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 8b9c1511840..3fa35be5027 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -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; diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 4be459b0bb7..a8417fad876 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -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; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index fb1da4e3739..0b14ba388ce 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -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; # diff --git a/mysql-test/t/replace.test b/mysql-test/t/replace.test index 100941108c8..e9e01615a62 100644 --- a/mysql-test/t/replace.test +++ b/mysql-test/t/replace.test @@ -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; |