List:Commits« Previous MessageNext Message »
From:ingo Date:September 14 2006 11:39am
Subject:bk commit into 5.1 tree (istruewing:1.2315)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of istruewing. When istruewing does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-09-14 11:39:49+02:00, istruewing@stripped +11 -0
  Merge chilla.local:/home/mydev/mysql-5.1
  into  chilla.local:/home/mydev/mysql-5.1-amerge
  MERGE: 1.2255.35.5

  BitKeeper/deleted/.del-index_merge_innodb.result@stripped, 2006-09-14 11:34:02+02:00,
istruewing@stripped +0 -0
    Auto merged
    MERGE: 1.18.1.2

  BitKeeper/deleted/.del-index_merge_innodb.result@stripped, 2006-09-14 11:34:02+02:00,
istruewing@stripped +0 -0
    Merge rename: mysql-test/r/index_merge_innodb.result ->
BitKeeper/deleted/.del-index_merge_innodb.result

  mysql-test/include/handler.inc@stripped, 2006-09-14 11:39:46+02:00, istruewing@stripped
+1 -1
    Manual merge from 5.1-engines
    MERGE: 1.30.1.3

  mysql-test/include/handler.inc@stripped, 2006-09-14 11:34:02+02:00,
istruewing@stripped +0 -0
    Merge rename: mysql-test/t/handler.test -> mysql-test/include/handler.inc

  mysql-test/include/index_merge2.inc@stripped, 2006-09-14 11:34:02+02:00,
istruewing@stripped +0 -0
    Auto merged
    MERGE: 1.12.1.2

  mysql-test/include/index_merge2.inc@stripped, 2006-09-14 11:34:02+02:00,
istruewing@stripped +0 -0
    Merge rename: mysql-test/t/index_merge_innodb.test ->
mysql-test/include/index_merge2.inc

  mysql-test/include/mix1.inc@stripped, 2006-09-14 11:34:02+02:00, istruewing@stripped +0
-1
    Auto merged
    MERGE: 1.7.1.4

  mysql-test/include/mix1.inc@stripped, 2006-09-14 11:34:02+02:00, istruewing@stripped
+0 -0
    Merge rename: mysql-test/t/innodb_mysql.test -> mysql-test/include/mix1.inc

  mysql-test/r/innodb_mysql.result@stripped, 2006-09-14 11:39:46+02:00,
istruewing@stripped +0 -19
    Manual merge from 5.1-engines
    MERGE: 1.7.1.3

  mysql-test/t/disabled.def@stripped, 2006-09-14 11:34:02+02:00, istruewing@stripped +0
-0
    Auto merged
    MERGE: 1.184.3.1

  sql/handler.cc@stripped, 2006-09-14 11:34:02+02:00, istruewing@stripped +0 -0
    Auto merged
    MERGE: 1.254.2.2

  sql/handler.h@stripped, 2006-09-14 11:34:02+02:00, istruewing@stripped +0 -0
    Auto merged
    MERGE: 1.232.2.1

  sql/opt_range.cc@stripped, 2006-09-14 11:34:03+02:00, istruewing@stripped +0 -0
    Auto merged
    MERGE: 1.228.1.1

  storage/myisam/ha_myisam.cc@stripped, 2006-09-14 11:34:03+02:00, istruewing@stripped +0
-0
    Auto merged
    MERGE: 1.187.1.2

  storage/myisam/ha_myisam.cc@stripped, 2006-09-14 11:34:02+02:00,
istruewing@stripped +0 -0
    Merge rename: sql/ha_myisam.cc -> storage/myisam/ha_myisam.cc

  storage/myisam/ha_myisam.h@stripped, 2006-09-14 11:34:03+02:00, istruewing@stripped +0
-0
    Auto merged
    MERGE: 1.74.1.2

  storage/myisam/ha_myisam.h@stripped, 2006-09-14 11:34:02+02:00, istruewing@stripped
+0 -0
    Merge rename: sql/ha_myisam.h -> storage/myisam/ha_myisam.h

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	istruewing
# Host:	chilla.local
# Root:	/home/mydev/mysql-5.1-amerge/RESYNC

--- 1.187.1.1/sql/ha_myisam.cc	2006-09-14 11:39:56 +02:00
+++ 1.192/storage/myisam/ha_myisam.cc	2006-09-14 11:39:56 +02:00
@@ -19,19 +19,15 @@
 #pragma implementation				// gcc: Class implementation
 #endif
 
+#define MYSQL_SERVER 1
 #include "mysql_priv.h"
+#include <mysql/plugin.h>
 #include <m_ctype.h>
 #include <myisampack.h>
 #include "ha_myisam.h"
 #include <stdarg.h>
-#ifndef MASTER
-#include "../srclib/myisam/myisamdef.h"
-#else
-#include "../storage/myisam/myisamdef.h"
-#include "../storage/myisam/rt_index.h"
-#endif
-
-#include <mysql/plugin.h>
+#include "myisamdef.h"
+#include "rt_index.h"
 
 ulong myisam_recover_options= HA_RECOVER_NONE;
 
@@ -1812,7 +1808,9 @@ mysql_declare_plugin(myisam)
   myisam_init, /* Plugin Init */
   NULL, /* Plugin Deinit */
   0x0100, /* 1.0 */
-  0
+  NULL,                       /* status variables                */
+  NULL,                       /* system variables                */
+  NULL                        /* config options                  */
 }
 mysql_declare_plugin_end;
 

--- 1.265/sql/handler.cc	2006-09-14 11:39:56 +02:00
+++ 1.266/sql/handler.cc	2006-09-14 11:39:56 +02:00
@@ -1403,6 +1403,17 @@ int ha_delete_table(THD *thd, handlerton
 /****************************************************************************
 ** General handler functions
 ****************************************************************************/
+handler *handler::clone(MEM_ROOT *mem_root)
+{
+  handler *new_handler= get_new_handler(table->s, mem_root, table->s->db_type);
+  if (new_handler && !new_handler->ha_open(table,
+                                           table->s->normalized_path.str,
+                                           table->db_stat,
+                                           HA_OPEN_IGNORE_IF_LOCKED))
+    return new_handler;
+  return NULL;
+}
+
 
 
 void handler::ha_statistic_increment(ulong SSV::*offset) const

--- 1.238/sql/handler.h	2006-09-14 11:39:56 +02:00
+++ 1.239/sql/handler.h	2006-09-14 11:39:56 +02:00
@@ -953,6 +953,7 @@ public:
   {
     /* TODO: DBUG_ASSERT(inited == NONE); */
   }
+  virtual handler *clone(MEM_ROOT *mem_root);
   /* This is called after create to allow us to set up cached variables */
   void init()
   {

--- 1.231/sql/opt_range.cc	2006-09-14 11:39:56 +02:00
+++ 1.232/sql/opt_range.cc	2006-09-14 11:39:56 +02:00
@@ -1165,11 +1165,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_
   }
 
   thd= head->in_use;
-  if (!(file= get_new_handler(head->s, thd->mem_root, head->s->db_type)))
-    goto failure;
-  DBUG_PRINT("info", ("Allocated new handler 0x%lx", (long) file));
-  if (file->ha_open(head, head->s->normalized_path.str, head->db_stat,
-                    HA_OPEN_IGNORE_IF_LOCKED))
+  if (!(file= head->file->clone(thd->mem_root)))
   {
     /* Caller will free the memory */
     goto failure;

--- 1.9/mysql-test/r/innodb_mysql.result	2006-09-14 11:39:56 +02:00
+++ 1.10/mysql-test/r/innodb_mysql.result	2006-09-14 11:39:56 +02:00
@@ -90,6 +90,27 @@ b	a
 3	3
 3	3
 DROP TABLE t1, t2, t3;
+CREATE TABLE `t1` (`id1` INT) ;
+INSERT INTO `t1` (`id1`) VALUES (1),(5),(2);
+CREATE TABLE `t2` (
+`id1` INT,
+`id2` INT NOT NULL,
+`id3` INT,
+`id4` INT NOT NULL,
+UNIQUE (`id2`,`id4`),
+KEY (`id1`)
+) ENGINE=InnoDB;
+INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES 
+(1,1,1,0),
+(1,1,2,1),
+(5,1,2,2),
+(6,1,2,3),
+(1,2,2,2),
+(1,2,1,1);
+SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = 1 AND
`id3` = 2);
+id1
+2
+DROP TABLE t1, t2;
 create table t1m (a int) engine = MEMORY;
 create table t1i (a int);
 create table t2m (a int) engine = MEMORY;
@@ -313,3 +334,71 @@ Warnings:
 Warning	1071	Specified key was too long; max key length is 765 bytes
 insert into t1 values('aaa');
 drop table t1;
+CREATE TABLE `t2` (
+`k` int(11) NOT NULL auto_increment,
+`a` int(11) default NULL,
+`c` int(11) default NULL,
+PRIMARY KEY  (`k`),
+UNIQUE KEY `idx_1` (`a`)
+) ENGINE=InnoDB;
+insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+insert into t2 ( a ) values ( 7 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+select last_insert_id();
+last_insert_id()
+2
+select * from t2;
+k	a	c
+1	6	NULL
+2	7	NULL
+insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+select last_insert_id();
+last_insert_id()
+2
+select last_insert_id(0);
+last_insert_id(0)
+0
+insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+select last_insert_id();
+last_insert_id()
+0
+select * from t2;
+k	a	c
+1	6	2
+2	7	NULL
+insert ignore into t2 values (null,6,1),(10,8,1);
+select last_insert_id();
+last_insert_id()
+0
+insert ignore into t2 values (null,6,1),(null,8,1),(null,15,1),(null,20,1);
+select last_insert_id();
+last_insert_id()
+11
+select * from t2;
+k	a	c
+1	6	2
+2	7	NULL
+10	8	1
+11	15	1
+12	20	1
+insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1, k=last_insert_id(k);
+select last_insert_id();
+last_insert_id()
+1
+select * from t2;
+k	a	c
+1	6	3
+2	7	NULL
+10	8	1
+11	15	1
+12	20	1
+drop table t2;

--- 1.7.1.3/mysql-test/t/innodb_mysql.test	2006-09-14 11:39:56 +02:00
+++ 1.11/mysql-test/include/mix1.inc	2006-09-14 11:39:56 +02:00
@@ -1,4 +1,29 @@
--- source include/have_innodb.inc
+# include/mix1.inc
+#
+# The variables
+#     $engine_type       -- storage engine to be tested
+#     $other_engine_type -- storage engine <> $engine_type
+#                           $other_engine_type must point to an all
+#                           time available storage engine
+#                              2006-08 MySQL 5.1 MyISAM and MEMORY only
+# have to be set before sourcing this script.
+#
+# Note: The comments/expectations refer to InnoDB.
+#       They might be not valid for other storage engines.
+#
+# Last update:
+# 2006-08-15 ML refactoring of t/innodb_mysql.test
+#               - shift main code of t/innodb_mysql.test to include/mix1.inc
+#               - replace hardcoded assignment of storage engine by
+#                 use of $engine_type and $other_engine_type variables
+#               - remove redundant replay testcase of
+#                 Bug#12882 min/max inconsistent on empty table
+#               - corrected analyze table t1; to analyze table t4;
+#                 Much older versions of this test show that the table
+#                 where just some indexes have been created must be used.
+#
+
+eval SET SESSION STORAGE_ENGINE = $engine_type;
 
 --disable_warnings
 drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
@@ -7,7 +32,7 @@ drop table if exists t1,t2,t1m,t1i,t2m,t
 #
 # Bug#17530: Incorrect key truncation on table creation caused server crash.
 #
-create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb 
+create table t1(f1 varchar(800) binary not null, key(f1))
   character set utf8 collate utf8_general_ci;
 insert into t1 values('aaa');
 drop table t1;
@@ -19,8 +44,8 @@ create table t1 (
   org_id int(11) default null,
   unique key contacts$c_id (c_id),
   key contacts$org_id (org_id)
-) engine=innodb;
-insert into t1 values 
+);
+insert into t1 values
   (2,null),(120,null),(141,null),(218,7), (128,1),
   (151,2),(234,2),(236,2),(243,2),(255,2),(259,2),(232,3),(235,3),(238,3),
   (246,3),(253,3),(269,3),(285,3),(291,3),(293,3),(131,4),(230,4),(231,4);
@@ -43,7 +68,7 @@ create table t2 (
   unique key t2$slai_id (slai_id),
   key t2$owner_id (owner_id),
   key t2$sla_id (sla_id)
-) engine=innodb;
+);
 insert into t2(slai_id, owner_tbl, owner_id, sla_id) values
   (1,3,1,1), (3,3,10,2), (4,3,3,6), (5,3,2,5), (6,3,8,3), (7,3,9,7),
   (8,3,6,8), (9,3,4,9), (10,3,5,10), (11,3,11,11), (12,3,7,12);
@@ -51,17 +76,17 @@ insert into t2(slai_id, owner_tbl, owner
 flush tables;
 select si.slai_id
 from t1 c join t2 si on
-  ((si.owner_tbl = 3 and si.owner_id = c.org_id) or 
-   ( si.owner_tbl = 2 and si.owner_id = c.c_id)) 
-where 
+  ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
+   ( si.owner_tbl = 2 and si.owner_id = c.c_id))
+where
   c.c_id = 218 and expiredate is null;
-  
+
 select * from t1 where org_id is null;
 select si.slai_id
 from t1 c join t2 si on
-  ((si.owner_tbl = 3 and si.owner_id = c.org_id) or 
-   ( si.owner_tbl = 2 and si.owner_id = c.c_id)) 
-where 
+  ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
+   ( si.owner_tbl = 2 and si.owner_id = c.c_id))
+where
   c.c_id = 218 and expiredate is null;
 
 drop table t1, t2;
@@ -70,14 +95,14 @@ drop table t1, t2;
 # Bug#17212: results not sorted correctly by ORDER BY when using index
 # (repeatable only w/innodb because of index props)
 #
-CREATE TABLE t1 (a int, b int, KEY b (b)) Engine=InnoDB;
-CREATE TABLE t2 (a int, b int, PRIMARY KEY  (a,b)) Engine=InnoDB;
-CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY  (a), 
-  UNIQUE KEY b (b,c), KEY a (a,b,c)) Engine=InnoDB;
+CREATE TABLE t1 (a int, b int, KEY b (b));
+CREATE TABLE t2 (a int, b int, PRIMARY KEY  (a,b));
+CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY  (a),
+  UNIQUE KEY b (b,c), KEY a (a,b,c));
 
 INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 SELECT a + 1, b + 1 FROM t1; 
-INSERT INTO t1 SELECT a + 2, b + 2 FROM t1; 
+INSERT INTO t1 SELECT a + 1, b + 1 FROM t1;
+INSERT INTO t1 SELECT a + 2, b + 2 FROM t1;
 
 INSERT INTO t2 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8);
 INSERT INTO t2 SELECT a + 1, b FROM t2;
@@ -89,13 +114,13 @@ INSERT INTO t3 SELECT a + 4, a + 4, 3 FR
 
 # demonstrate a problem when a must-use-sort table flag
 # (sort_by_table=1) is being neglected.
-SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE 
-  t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2) 
+SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
+  t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
   ORDER BY t1.b LIMIT 2;
 
 # demonstrate the problem described in the bug report
-SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE 
-  t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2) 
+SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
+  t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
   ORDER BY t1.b LIMIT 5;
 DROP TABLE t1, t2, t3;
 
@@ -130,38 +155,15 @@ DROP TABLE t1, t2;
 #
 
 --disable_warnings
-create table t1m (a int) engine=myisam;
-create table t1i (a int) engine=innodb;
-create table t2m (a int) engine=myisam;
-create table t2i (a int) engine=innodb;
+eval create table t1m (a int) engine = $other_engine_type;
+create table t1i (a int);
+eval create table t2m (a int) engine = $other_engine_type;
+create table t2i (a int);
 --enable_warnings
 insert into t2m values (5);
 insert into t2i values (5);
 
-# test with MyISAM
-select min(a) from t1m;
-select min(7) from t1m;
-select min(7) from DUAL;
-explain select min(7) from t2m join t1m;
-select min(7) from t2m join t1m;
-
-select max(a) from t1m;
-select max(7) from t1m;
-select max(7) from DUAL;
-explain select max(7) from t2m join t1m;
-select max(7) from t2m join t1m;
-
-select 1, min(a) from t1m where a=99;
-select 1, min(a) from t1m where 1=99;
-select 1, min(1) from t1m where a=99;
-select 1, min(1) from t1m where 1=99;
-
-select 1, max(a) from t1m where a=99;
-select 1, max(a) from t1m where 1=99;
-select 1, max(1) from t1m where a=99;
-select 1, max(1) from t1m where 1=99;
-
-# test with InnoDB
+# test with $engine_type
 select min(a) from t1i;
 select min(7) from t1i;
 select min(7) from DUAL;
@@ -184,7 +186,7 @@ select 1, max(a) from t1i where 1=99;
 select 1, max(1) from t1i where a=99;
 select 1, max(1) from t1i where 1=99;
 
-# mixed MyISAM/InnoDB test
+# mixed $engine_type/$other_engine_type test
 explain select count(*), min(7), max(7) from t1m, t1i;
 select count(*), min(7), max(7) from t1m, t1i;
 
@@ -197,13 +199,13 @@ select count(*), min(7), max(7) from t2m
 drop table t1m, t1i, t2m, t2i;
 
 #
-# Bug #12672: primary key implcitly included in every innodb index 
+# Bug #12882: primary key implcitly included in every innodb index
 # (was part of group_min_max.test)
 #
 
-create table t1 (
+eval create table t1 (
   a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64)
default ' '
-);
+) ENGINE = $other_engine_type;
 
 insert into t1 (a1, a2, b, c, d) values
 ('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
@@ -241,49 +243,49 @@ insert into t1 (a1, a2, b, c, d) values
 --disable_warnings
 create table t4 (
   pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16)
not null, d char(16), dummy char(64) default ' '
-) engine=innodb;
+);
 --enable_warnings
 insert into t4 (a1, a2, b, c, d, dummy) select * from t1;
 
 create index idx12672_0 on t4 (a1);
 create index idx12672_1 on t4 (a1,a2,b,c);
 create index idx12672_2 on t4 (a1,a2,b);
-analyze table t1;
+analyze table t4;
 
 select distinct a1 from t4 where pk_col not in (1,2,3,4);
 
 drop table t1,t4;
 
 #
-# Bug #6142: a problem with the empty innodb table 
+# Bug #6142: a problem with the empty innodb table
 # (was part of group_min_max.test)
 #
 
 --disable_warnings
 create table t1 (
   a varchar(30), b varchar(30), primary key(a), key(b)
-) engine=innodb;
+);
 --enable_warnings
 select distinct a from t1;
 drop table t1;
 
 #
-# Bug #9798: group by with rollup 
+# Bug #9798: group by with rollup
 # (was part of group_min_max.test)
 #
 
 --disable_warnings
-create table t1(a int, key(a)) engine=innodb;
+create table t1(a int, key(a));
 --enable_warnings
 insert into t1 values(1);
 select a, count(a) from t1 group by a with rollup;
 drop table t1;
 
 #
-# Bug #13293 Wrongly used index results in endless loop.  
+# Bug #13293 Wrongly used index results in endless loop.
 # (was part of group_min_max.test)
 #
-create table t1 (f1 int, f2 char(1), primary key(f1,f2)) engine=innodb;
+create table t1 (f1 int, f2 char(1), primary key(f1,f2));
 insert into t1 values ( 1,"e"),(2,"a"),( 3,"c"),(4,"d");
 alter table t1 drop primary key, add primary key (f2, f1);
 explain select distinct f1 a, f1 b from t1;
@@ -315,7 +317,6 @@ DROP TABLE t1,t2;
 # Test of behaviour with CREATE ... SELECT
 #
 
-set storage_engine=innodb;
 CREATE TABLE t1 (a int, b int);
 insert into t1 values (1,1),(1,2);
 --error 1062
@@ -363,7 +364,7 @@ drop table t1,t2;
 #
 # Bug#17530: Incorrect key truncation on table creation caused server crash.
 #
-create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb 
+create table t1(f1 varchar(800) binary not null, key(f1))
   character set utf8 collate utf8_general_ci;
 insert into t1 values('aaa');
 drop table t1;

--- 1.196/mysql-test/t/disabled.def	2006-09-14 11:39:56 +02:00
+++ 1.197/mysql-test/t/disabled.def	2006-09-14 11:39:56 +02:00
@@ -15,6 +15,7 @@
 #events_scheduling        : BUG#19170 2006-04-26 andrey  Test case of 19170 fails on some
platforms. Has to be checked.
 im_options                : Bug#20294 2006-07-24 stewart   Instance manager test
im_options fails randomly
 #im_life_cycle             : Bug#20368 2006-06-10 alik    im_life_cycle test fails
+concurrent_innodb        : BUG#21579 2006-08-11 mleich innodb_concurrent random failures
with varying differences
 ndb_autodiscover         : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
 ndb_autodiscover2        : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
 #ndb_binlog_ignore_db     : BUG#21279 2006-07-25 ingo    Randomly throws a warning

--- 1.30.1.2/mysql-test/t/handler.test	2006-09-14 11:39:56 +02:00
+++ 1.34/mysql-test/include/handler.inc	2006-09-14 11:39:56 +02:00
@@ -1,10 +1,25 @@
 -- source include/not_embedded.inc
+# include/handler.inc
+#
+# The variables
+#     $engine_type       -- storage engine to be tested
+#     $other_engine_type -- storage engine <> $engine_type
+#     $other_handler_engine_type -- storage engine <> $engine_type, if possible
+#                           1. $other_handler_engine_type must support handler
+#                           2. $other_handler_engine_type must point to an all
+#                              time available storage engine
+#                              2006-08 MySQL 5.1 MyISAM and MEMORY only
+# have to be set before sourcing this script.
 #
 # test of HANDLER ...
 #
+# Last update:
+# 2006-07-31 ML test refactored (MySQL 5.1)
+#               code of t/handler.test and t/innodb_handler.test united
+#               main testing code put into include/handler.inc
+#
 
-# should work in embedded server after mysqltest is fixed
--- source include/not_embedded.inc
+eval SET SESSION STORAGE_ENGINE = $engine_type;
 
 --disable_warnings
 drop table if exists t1,t3,t4,t5;
@@ -74,6 +89,22 @@ handler t2 read next;
 handler t2 read last;
 handler t2 close;
 
+handler t1 open;
+handler t1 read a next; # this used to crash as a bug#5373
+handler t1 read a next;
+handler t1 close;
+
+handler t1 open;
+handler t1 read a prev; # this used to crash as a bug#5373
+handler t1 read a prev;
+handler t1 close;
+
+handler t1 open as t2;
+handler t2 read first;
+eval alter table t1 engine = $engine_type;
+--error 1109
+handler t2 read first;
+
 #
 # DROP TABLE / ALTER TABLE
 #
@@ -84,7 +115,7 @@ insert into t1 values (17);
 --error 1109
 handler t2 read first;
 handler t1 open as t2;
-alter table t1 engine=MyISAM;
+eval alter table t1 engine=$other_engine_type;
 --error 1109
 handler t2 read first;
 drop table t1;
@@ -303,7 +334,7 @@ insert into t5 values ("t5");
 handler t5 open as h5;
 handler h5 read first limit 9;
 # close first
-alter table t1 engine=MyISAM;
+eval alter table t1 engine=$other_handler_engine_type;
 --error 1109
 handler h1 read first limit 9;
 handler h2 read first limit 9;
@@ -311,7 +342,7 @@ handler h3 read first limit 9;
 handler h4 read first limit 9;
 handler h5 read first limit 9;
 # close last
-alter table t5 engine=MyISAM;
+eval alter table t5 engine=$other_handler_engine_type;
 --error 1109
 handler h1 read first limit 9;
 handler h2 read first limit 9;
@@ -320,7 +351,7 @@ handler h4 read first limit 9;
 --error 1109
 handler h5 read first limit 9;
 # close middle
-alter table t3 engine=MyISAM;
+eval alter table t3 engine=$other_handler_engine_type;
 --error 1109
 handler h1 read first limit 9;
 handler h2 read first limit 9;
@@ -338,7 +369,7 @@ handler t1 open as h1_3;
 handler h1_1 read first limit 9;
 handler h1_2 read first limit 9;
 handler h1_3 read first limit 9;
-alter table t1 engine=MyISAM;
+eval alter table t1 engine=$engine_type;
 --error 1109
 handler h1_1 read first limit 9;
 --error 1109
@@ -378,6 +409,13 @@ reap;
 --exec echo proceed with the normal connection
 connection default;
 drop table t1;
+
+CREATE TABLE t1 (  no1 smallint(5) NOT NULL default '0',  no2 int(10) NOT NULL default
'0',  PRIMARY KEY  (no1,no2));
+INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
+HANDLER t1 OPEN;
+HANDLER t1 READ `primary` = (1, 1000);
+HANDLER t1 READ `primary` PREV;
+DROP TABLE t1;
 
 # End of 4.1 tests
 

--- 1.12.1.1/mysql-test/t/index_merge_innodb.test	2006-09-14 11:39:57 +02:00
+++ 1.15/mysql-test/include/index_merge2.inc	2006-09-14 11:39:57 +02:00
@@ -1,7 +1,23 @@
+# include/index_merge2.inc
 #
 # Index merge tests
 #
--- source include/have_innodb.inc
+# The variable
+#     $engine_type       -- storage engine to be tested
+# has to be set before sourcing this script.
+#
+# Note: The comments/expectations refer to InnoDB.
+#       They might be not valid for other storage engines.
+#
+# Last update:
+# 2006-08-02 ML test refactored
+#               old name was t/index_merge_innodb.test
+#               main code went into include/index_merge2.inc
+#
+
+--echo #---------------- Index merge test 2 -------------------------------------------
+
+eval SET SESSION STORAGE_ENGINE = $engine_type;
 
 --disable_warnings
 drop table if exists t1,t2;
@@ -9,12 +25,12 @@ drop table if exists t1,t2;
 
 create table t1
 (
-  key1 int not null, 
-  key2 int not null, 
-  
+  key1 int not null,
+  key2 int not null,
+
   INDEX i1(key1),
   INDEX i2(key2)
-) engine=innodb;
+);
 
 --disable_query_log
 let $1=200;
@@ -35,7 +51,7 @@ select * from t1 where key1 < 3 or key2 
 
 # Primary key as case-sensitive string with \0s.
 # also make primary key be longer then max. index length of MyISAM.
-alter table t1 add str1 char (255) not null, 
+alter table t1 add str1 char (255) not null,
                 add zeroval int not null default 0,
                 add str2 char (255) not null,
                 add str3 char (255) not null;
@@ -43,7 +59,7 @@ alter table t1 add str1 char (255) not n
 update t1 set str1='aaa', str2='bbb', str3=concat(key2, '-', key1 div 2, '_' ,if(key1 mod
2 = 0, 'a', 'A'));
 
 alter table t1 add primary key (str1, zeroval, str2, str3);
-                
+
 explain select * from t1 where key1 < 5 or key2 > 197;
 
 select * from t1 where key1 < 5 or key2 > 197;
@@ -60,7 +76,7 @@ create table t1 (
   filler char  (200),
   index (key1),
   index (key2)
-) engine=innodb;
+);
 show warnings;
 --disable_query_log
 let $1=30;
@@ -74,7 +90,7 @@ explain select pk from t1 where key1 = 1
 select pk from t1 where key2 = 1 and key1 = 1;
 select pk from t1 ignore index(key1,key2) where key2 = 1 and key1 = 1;
 
-# More tests for BUG#5401. 
+# More tests for BUG#5401.
 drop table t1;
 create table t1 (
   pk int primary key auto_increment,
@@ -92,30 +108,30 @@ create table t1 (
   index i1(key1a, key1b),
   index i2(key2a, key2b),
   index i3(key3a, key3b)
-) engine=innodb;
+);
 
 create table t2 (a int);
 insert into t2 values (0),(1),(2),(3),(4),(NULL);
 
-insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) 
+insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b)
   select A.a, B.a, C.a, D.a, C.a, D.a from t2 A,t2 B,t2 C, t2 D;
-insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) 
+insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b)
   select key1a, key1b, key2a, key2b, key3a, key3b from t1;
-insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) 
+insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b)
   select key1a, key1b, key2a, key2b, key3a, key3b from t1;
 analyze table t1;
 select count(*) from t1;
 
-explain select count(*) from t1 where 
+explain select count(*) from t1 where
   key1a = 2 and key1b is null and  key2a = 2 and key2b is null;
 
-select count(*) from t1 where 
+select count(*) from t1 where
   key1a = 2 and key1b is null and key2a = 2 and key2b is null;
 
-explain select count(*) from t1 where 
+explain select count(*) from t1 where
   key1a = 2 and key1b is null and key3a = 2 and key3b is null;
 
-select count(*) from t1 where 
+select count(*) from t1 where
   key1a = 2 and key1b is null and key3a = 2 and key3b is null;
 
 drop table t1,t2;
@@ -125,10 +141,10 @@ create table t1 (
   id1 int,
   id2 date ,
   index idx2 (id1,id2),
-  index idx1 (id2)  
-) engine = innodb;
+  index idx1 (id2)
+);
 insert into t1 values(1,'20040101'), (2,'20040102');
-select * from t1  where id1 = 1  and id2= '20040101'; 
+select * from t1  where id1 = 1  and id2= '20040101';
 drop table t1;
 
 # Test for BUG#12720
@@ -147,9 +163,9 @@ CREATE TABLE t1 (
   KEY `fk_bbk_niederlassung` (`fk_bbk_niederlassung`),
   KEY `fk_wochentag` (`fk_wochentag`),
   KEY `ix_version` (`version`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+) DEFAULT CHARSET=latin1;
 
-insert  into t1 values 
+insert  into t1 values
 (1, 38, 1, '08:00:00', '13:00:00', 0, 1),
 (2, 38, 2, '08:00:00', '13:00:00', 0, 1),
 (3, 38, 3, '08:00:00', '13:00:00', 0, 1),
@@ -176,25 +192,25 @@ insert  into t1 values 
 (24, 7, 4, '08:00:00', '13:00:00', 0, 1),
 (25, 7, 5, '08:00:00', '13:00:00', 0, 1);
 
-create view v1 as 
-select 
-  zeit1.oid AS oid, 
+create view v1 as
+select
+  zeit1.oid AS oid,
   zeit1.fk_bbk_niederlassung AS fk_bbk_niederlassung,
   zeit1.fk_wochentag AS fk_wochentag,
-  zeit1.uhrzeit_von AS uhrzeit_von, 
-  zeit1.uhrzeit_bis AS uhrzeit_bis, 
+  zeit1.uhrzeit_von AS uhrzeit_von,
+  zeit1.uhrzeit_bis AS uhrzeit_bis,
   zeit1.geloescht AS geloescht,
   zeit1.version AS version
-from 
+from
   t1 zeit1
-where 
-(zeit1.version = 
+where
+(zeit1.version =
   (select max(zeit2.version) AS `max(version)`
-   from t1 zeit2 
-   where 
-     ((zeit1.fk_bbk_niederlassung = zeit2.fk_bbk_niederlassung) and 
-      (zeit1.fk_wochentag = zeit2.fk_wochentag) and 
-      (zeit1.uhrzeit_von = zeit2.uhrzeit_von) and 
+   from t1 zeit2
+   where
+     ((zeit1.fk_bbk_niederlassung = zeit2.fk_bbk_niederlassung) and
+      (zeit1.fk_wochentag = zeit2.fk_wochentag) and
+      (zeit1.uhrzeit_von = zeit2.uhrzeit_von) and
       (zeit1.uhrzeit_bis = zeit2.uhrzeit_bis)
      )
   )
@@ -215,7 +231,7 @@ CREATE TABLE t1(
   PRIMARY KEY (t_cpac,t_vers,t_rele,t_cust),
   UNIQUE KEY IX_4 (t_cust,t_cpac,t_vers,t_rele),
   KEY IX_5 (t_vers,t_rele,t_cust)
-) ENGINE=InnoDB;
+);
 
 insert into t1 values
 ('tm','2.5 ','a ','    ','',''), ('tm','2.5U','a ','stnd','',''),
@@ -258,7 +274,7 @@ create table t1 (
 
   filler1 datetime, filler2 varchar(15),
   filler3 longtext,
-  
+
   kp1 varchar(4), kp2 varchar(7),
   kp3 varchar(2), kp4 varchar(4),
   kp5 varchar(7),
@@ -268,7 +284,7 @@ create table t1 (
   key idx1(a,b,c),
   key idx2(c),
   key idx3(kp1,kp2,kp3,kp4,kp5)
-) engine=innodb default charset=latin1;
+) default charset=latin1;
 --disable_query_log
 set @fill= uncompress(unhex(concat(
 'F91D0000789CDD993D6FDB301086F7FE0A6D4E0105B8E3F1335D5BA028DA0EEDE28E1D320408',
@@ -289,12 +305,12 @@ set @fill= uncompress(unhex(concat(
 '45ED028EB3616AC93C46E775FEA9FA6DA7CFCEC6DEBA5FCD1F915EED4D983BDDB881528AD9AB',
 '43C1576F29AAB35BDFBC21D422F52B307D350589D45225A887AC46C8EDD72D99EC3ED2E1BCEF',
 '7AF26FC4C74097B6768A5EDAFA660CC64278F7E63F99AC954B')));
-prepare x from @fill; 
+prepare x from @fill;
 execute x;
 deallocate prepare x;
 --enable_query_log
 set @fill=NULL;
-SELECT COUNT(*) FROM t1 WHERE b = 0 AND a = 0 AND c = 13286427 AND 
+SELECT COUNT(*) FROM t1 WHERE b = 0 AND a = 0 AND c = 13286427 AND
  kp1='279' AND kp2='ELM0678' AND kp3='6' AND kp4='10' AND  kp5 = 'R        ';
 
 drop table t1;
Thread
bk commit into 5.1 tree (istruewing:1.2315)ingo14 Sep