List:Commits« Previous MessageNext Message »
From:antony Date:April 24 2006 8:36pm
Subject:bk commit into 5.1 tree (acurtis:1.2361)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of antony. When antony 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
  1.2361 06/04/24 13:36:15 acurtis@stripped +22 -0
  Merge xiphis.org:/home/antony/work2/wl3201.3
  into  xiphis.org:/home/antony/work2/wl3201.merge

  storage/innobase/Makefile.am
    1.12 06/04/24 13:36:08 acurtis@stripped +0 -0
    Merge for WL#3201

  plugin/Makefile.am
    1.3 06/04/24 13:36:08 acurtis@stripped +1 -6
    Merge for WL#3201

  configure.in
    1.341 06/04/24 13:36:08 acurtis@stripped +3 -3
    Merge for WL#3201

  Makefile.am
    1.91 06/04/24 13:36:08 acurtis@stripped +0 -1
    Merge for WL#3201, some post-merge fixes will be required.

  storage/example/ha_example.cc
    1.36 06/04/24 13:28:19 acurtis@stripped +0 -0
    Auto merged

  storage/archive/ha_archive.h
    1.45 06/04/24 13:28:19 acurtis@stripped +0 -0
    Auto merged

  storage/archive/ha_archive.cc
    1.88 06/04/24 13:28:19 acurtis@stripped +0 -0
    Auto merged

  sql/sql_yacc.yy
    1.471 06/04/24 13:28:18 acurtis@stripped +0 -0
    Auto merged

  sql/sql_plugin.cc
    1.19 06/04/24 13:28:18 acurtis@stripped +0 -0
    Auto merged

  sql/partition_info.cc
    1.11 06/04/24 13:28:18 acurtis@stripped +0 -0
    Auto merged

  sql/mysqld.cc
    1.549 06/04/24 13:28:18 acurtis@stripped +0 -0
    Auto merged

  sql/log.cc
    1.203 06/04/24 13:28:18 acurtis@stripped +0 -0
    Auto merged

  sql/handler.h
    1.205 06/04/24 13:28:18 acurtis@stripped +0 -0
    Auto merged

  sql/handler.cc
    1.229 06/04/24 13:28:18 acurtis@stripped +0 -0
    Auto merged

  sql/ha_partition.cc
    1.46 06/04/24 13:28:18 acurtis@stripped +0 -0
    Auto merged

  sql/ha_ndbcluster_binlog.cc
    1.48 06/04/24 13:28:18 acurtis@stripped +0 -0
    Auto merged

  storage/archive/ha_archive.h
    1.42.1.2 06/04/24 13:28:17 acurtis@stripped +0 -0
    Merge rename: sql/ha_archive.h -> storage/archive/ha_archive.h

  storage/archive/ha_archive.cc
    1.85.1.2 06/04/24 13:28:17 acurtis@stripped +0 -0
    Merge rename: sql/ha_archive.cc -> storage/archive/ha_archive.cc

  sql/ha_ndbcluster.cc
    1.296 06/04/24 13:28:17 acurtis@stripped +0 -0
    Auto merged

  sql/ha_myisammrg.cc
    1.84 06/04/24 13:28:17 acurtis@stripped +0 -0
    Auto merged

  sql/ha_innodb.cc
    1.270 06/04/24 13:28:17 acurtis@stripped +0 -0
    Auto merged

  sql/ha_heap.cc
    1.87 06/04/24 13:28:17 acurtis@stripped +0 -0
    Auto merged

  libmysqld/Makefile.am
    1.86 06/04/24 13:28:17 acurtis@stripped +0 -0
    Auto merged

  BUILD/SETUP.sh
    1.58 06/04/24 13:28:17 acurtis@stripped +0 -0
    Auto merged

# 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:	acurtis
# Host:	localhost.(none)
# Root:	/home/antony/work2/wl3201.merge/RESYNC

--- 1.90/Makefile.am	2006-04-13 10:37:53 -07:00
+++ 1.91/Makefile.am	2006-04-24 13:36:08 -07:00
@@ -26,7 +26,6 @@ SUBDIRS =		. include @docs_dirs@ @zlib_d
 			@thread_dirs@ pstack \
 			@sql_union_dirs@ storage \
 			@sql_server@ scripts @man_dirs@ tests \
-			@mysql_se_plugins@ \
 			netware @libmysqld_dirs@ \
 			mysql-test support-files @tools_dirs@ \
 			plugin unittest win

--- 1.340/configure.in	2006-04-24 03:29:04 -07:00
+++ 1.341/configure.in	2006-04-24 13:36:08 -07:00
@@ -31,7 +31,7 @@ sinclude(config/ac-macros/alloca.m4)
 sinclude(config/ac-macros/check_cpu.m4)
 sinclude(config/ac-macros/character_sets.m4)
 sinclude(config/ac-macros/compiler_flag.m4)
-sinclude(config/ac-macros/storage.m4)
+sinclude(config/ac-macros/plugins.m4)
 sinclude(config/ac-macros/ha_berkeley.m4)
 sinclude(config/ac-macros/ha_ndbcluster.m4)
 sinclude(config/ac-macros/large_file.m4)
@@ -48,6 +48,92 @@ czech danish dutch english estonian fren
 italian japanese korean norwegian norwegian-ny polish portuguese \
 romanian russian serbian slovak spanish swedish ukrainian"
 
+#--------------------------------------------------------------------
+# Declare our plugin modules
+#--------------------------------------------------------------------
+
+MYSQL_STORAGE_ENGINE(archive,,  [Archive Storage Engine],
+        [Archive Storage Engine], [max,max-no-ndb])
+MYSQL_MODULE_DIRECTORY(archive, [storage/archive])
+MYSQL_MODULE_STATIC(archive,    [libarchive.a])
+MYSQL_MODULE_DYNAMIC(archive,   [ha_archive.la])
+
+MYSQL_STORAGE_ENGINE(berkeley,  berkeley-db, [BerkeleyDB Storage Engine],
+        [Transactional Tables using BerkeleyDB], [max,max-no-ndb])
+MYSQL_MODULE_DIRECTORY(berkeley,[storage/bdb])
+MYSQL_MODULE_STATIC(berkeley,   [[\$(bdb_libs_with_path)]])
+MYSQL_MODULE_ACTIONS(berkeley,  [MYSQL_SETUP_BERKELEY_DB])
+
+MYSQL_STORAGE_ENGINE(blackhole,,[Blackhole Storage Engine],
+        [Basic Write-only Read-never tables], [max,max-no-ndb])
+MYSQL_MODULE_DIRECTORY(blackhole, [storage/blackhole])
+MYSQL_MODULE_STATIC(blackhole,  [libblackhole.a])
+MYSQL_MODULE_DYNAMIC(blackhole, [ha_blackhole.la])
+
+MYSQL_STORAGE_ENGINE(csv,,      [CSV Storage Engine],
+        [Stores tables in text CSV format])
+MYSQL_MODULE_DIRECTORY(csv,     [storage/csv])
+MYSQL_MODULE_STATIC(csv,        [libcsv.a])
+
+MYSQL_STORAGE_ENGINE(example,,  [Example Storage Engine],
+        [Skeleton for Storage Engines for developers], [max,max-no-ndb])
+MYSQL_MODULE_DIRECTORY(example, [storage/example])
+MYSQL_MODULE_STATIC(example,    [libexample.a])
+MYSQL_MODULE_DYNAMIC(example,   [ha_example.la])
+
+MYSQL_STORAGE_ENGINE(federated,,[Federated Storage Engine],
+        [Connects to tables on remote MySQL servers], [max,max-no-ndb])
+
+MYSQL_MODULE(ftexample,         [Simple Parser],
+        [Simple full-text parser plugin])
+MYSQL_MODULE_DIRECTORY(ftexample, [plugin/fulltext])
+MYSQL_MODULE_STATIC(ftexample,  [libftexample.a])
+MYSQL_MODULE_DYNAMIC(ftexample, [ft_example.la])
+
+MYSQL_STORAGE_ENGINE(heap,no,   [Memory Storage Engine],
+        [In memory hashed tables])
+MYSQL_MODULE_DIRECTORY(heap,    [storage/heap])
+MYSQL_MODULE_STATIC(heap,       [libheap.a])
+
+MYSQL_STORAGE_ENGINE(innobase,  innodb, [InnoDB Storage Engine],
+        [Transactional Tables using InnoDB], [max,max-no-ndb])
+MYSQL_MODULE_DIRECTORY(innobase, [storage/innobase])
+MYSQL_MODULE_STATIC(innobase,   [libinnobase.a])
+MYSQL_MODULE_ACTIONS(innobase,  [
+  AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
+  AC_SUBST(innodb_includes)
+  AC_SUBST(innodb_libs)
+  AC_SUBST(innodb_system_libs)
+  other_configures="$other_configures storage/innobase/configure"
+])
+
+MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine],
+        [Traditional non-transactional MySQL tables])
+MYSQL_MODULE_DIRECTORY(myisam,  [storage/myisam])
+MYSQL_MODULE_STATIC(myisam,     [libmyisam.a])
+
+MYSQL_STORAGE_ENGINE(myisammrg,no,[MyISAM MERGE Engine],
+        [Merge multiple MySQL tables into one])
+MYSQL_MODULE_DIRECTORY(myisammrg,[storage/myisammrg])
+MYSQL_MODULE_STATIC(myisammrg,  [libmyisammrg.a])
+
+MYSQL_STORAGE_ENGINE(ndbcluster, ndbcluster, [Cluster Storage Engine],
+        [High Availability Clustered tables], [max])
+MYSQL_MODULE_DIRECTORY(ndbcluster,[storage/ndb])
+MYSQL_MODULE_STATIC(ndbcluster, [[\$(ndbcluster_libs) \$(ndbcluster_system_libs) \$(NDB_SCI_LIBS)]])
+MYSQL_MODULE_ACTIONS(ndbcluster,[MYSQL_SETUP_NDBCLUSTER])
+
+MYSQL_STORAGE_ENGINE(partition, partition, [Partition Support],
+        [MySQL Partitioning Support], [max,max-no-ndb])
+
+MYSQL_MODULE_MANDATORY(csv)     dnl Used for logging
+MYSQL_MODULE_MANDATORY(heap)    dnl Memory tables
+MYSQL_MODULE_MANDATORY(myisam)  dnl Default
+MYSQL_MODULE_MANDATORY(myisammrg)
+
+dnl -- ndbcluster requires partition to be enabled
+MYSQL_MODULE_DEPENDS(ndbcluster, partition)
+
 #####
 #####
 
@@ -673,6 +759,16 @@ MYSQL_SYS_LARGEFILE
 AC_TYPE_SIZE_T
 
 #--------------------------------------------------------------------
+# Check for requested features
+#--------------------------------------------------------------------
+
+MYSQL_CHECK_BIG_TABLES
+MYSQL_CHECK_MAX_INDEXES
+MYSQL_CHECK_REPLICATION
+
+MYSQL_CONFIGURE_PLUGINS([none])
+
+#--------------------------------------------------------------------
 # Check for system header files
 #--------------------------------------------------------------------
 
@@ -2421,73 +2517,6 @@ AC_SUBST(readline_basedir)
 AC_SUBST(readline_link)
 AC_SUBST(readline_h_ln_cmd)
 
-MYSQL_CHECK_BIG_TABLES
-MYSQL_CHECK_MAX_INDEXES
-MYSQL_CHECK_REPLICATION
-
-MYSQL_STORAGE_ENGINE(innobase,,innodb,,,,innobase,ha_innodb.o,[ dnl
-  \$(top_builddir)/storage/innobase/usr/libusr.a dnl
-  \$(top_builddir)/storage/innobase/srv/libsrv.a dnl
-  \$(top_builddir)/storage/innobase/dict/libdict.a dnl
-  \$(top_builddir)/storage/innobase/que/libque.a dnl
-  \$(top_builddir)/storage/innobase/srv/libsrv.a dnl
-  \$(top_builddir)/storage/innobase/ibuf/libibuf.a dnl
-  \$(top_builddir)/storage/innobase/row/librow.a dnl
-  \$(top_builddir)/storage/innobase/pars/libpars.a dnl
-  \$(top_builddir)/storage/innobase/btr/libbtr.a dnl
-  \$(top_builddir)/storage/innobase/trx/libtrx.a dnl
-  \$(top_builddir)/storage/innobase/read/libread.a dnl
-  \$(top_builddir)/storage/innobase/usr/libusr.a dnl
-  \$(top_builddir)/storage/innobase/buf/libbuf.a dnl
-  \$(top_builddir)/storage/innobase/ibuf/libibuf.a dnl
-  \$(top_builddir)/storage/innobase/eval/libeval.a dnl
-  \$(top_builddir)/storage/innobase/log/liblog.a dnl
-  \$(top_builddir)/storage/innobase/fsp/libfsp.a dnl
-  \$(top_builddir)/storage/innobase/fut/libfut.a dnl
-  \$(top_builddir)/storage/innobase/fil/libfil.a dnl
-  \$(top_builddir)/storage/innobase/lock/liblock.a dnl
-  \$(top_builddir)/storage/innobase/mtr/libmtr.a dnl
-  \$(top_builddir)/storage/innobase/page/libpage.a dnl
-  \$(top_builddir)/storage/innobase/rem/librem.a dnl
-  \$(top_builddir)/storage/innobase/thr/libthr.a dnl
-  \$(top_builddir)/storage/innobase/sync/libsync.a dnl
-  \$(top_builddir)/storage/innobase/data/libdata.a dnl
-  \$(top_builddir)/storage/innobase/mach/libmach.a dnl
-  \$(top_builddir)/storage/innobase/ha/libha.a dnl
-  \$(top_builddir)/storage/innobase/dyn/libdyn.a dnl
-  \$(top_builddir)/storage/innobase/mem/libmem.a dnl
-  \$(top_builddir)/storage/innobase/sync/libsync.a dnl
-  \$(top_builddir)/storage/innobase/ut/libut.a dnl
-  \$(top_builddir)/storage/innobase/os/libos.a dnl
-  \$(top_builddir)/storage/innobase/ut/libut.a],[
-  AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
-  AC_SUBST(innodb_includes)
-  AC_SUBST(innodb_libs)
-  AC_SUBST(innodb_system_libs)
-  other_configures="$other_configures storage/innobase/configure"
-])
-
-MYSQL_STORAGE_ENGINE(berkeley,,berkeley-db,,,,bdb,,,[
-  MYSQL_SETUP_BERKELEY_DB
-])
-MYSQL_STORAGE_ENGINE(example,,,,,,example,no,
- \$(top_builddir)/storage/example/libexample.a,[
-  AC_CONFIG_FILES(storage/example/Makefile)
-])
-MYSQL_STORAGE_ENGINE(archive,,,,,,archive,,
- \$(top_builddir)/storage/archive/libarchive.a, [
-  AC_CONFIG_FILES(storage/archive/Makefile)
-])
-MYSQL_STORAGE_ENGINE(csv,,,"yes",,tina_hton,csv,no,
-  \$(top_builddir)/storage/csv/libcsv.a,[
-  AC_CONFIG_FILES(storage/csv/Makefile)
-])
-MYSQL_STORAGE_ENGINE(blackhole)
-MYSQL_STORAGE_ENGINE(federated)
-MYSQL_STORAGE_ENGINE(ndbcluster,,ndbcluster,,,,ndb,,,[
-  MYSQL_SETUP_NDBCLUSTER
-])
-MYSQL_STORAGE_ENGINE(partition,,partition)
 
 # If we have threads generate some library functions and test programs
 sql_server_dirs=
@@ -2544,7 +2573,7 @@ then
   AC_SUBST(THREAD_LOBJECTS)
   server_scripts="mysqld_safe mysql_install_db"
   sql_server_dirs="strings mysys dbug extra regex"
-  mysql_se_dirs="myisam myisammrg heap $mysql_se_dirs"
+
   sql_server="$sql_server vio sql"
 fi
 
@@ -2560,12 +2589,9 @@ AC_SUBST(sql_server)
 AC_SUBST(thread_dirs)
 AC_SUBST(server_scripts)
 
-AC_SUBST(mysql_se_dirs)
-AC_SUBST(mysql_se_libs)
-AC_SUBST(mysql_se_objs)
-AC_SUBST(mysql_se_htons)
-AC_SUBST(mysql_se_decls)
-AC_SUBST(mysql_se_plugins)
+AC_SUBST(mysql_plugin_dirs)
+AC_SUBST(mysql_plugin_libs)
+AC_SUBST(mysql_plugin_defs)
 
 
 # Now that sql_client_dirs and sql_server_dirs are stable, determine the union.
@@ -2610,12 +2636,15 @@ AC_CONFIG_FILES(Makefile extra/Makefile 
  unittest/Makefile dnl
  unittest/mytap/Makefile unittest/mytap/t/Makefile dnl
  unittest/mysys/Makefile unittest/examples/Makefile dnl
- strings/Makefile regex/Makefile storage/Makefile storage/heap/Makefile dnl
+ strings/Makefile regex/Makefile dnl
+ storage/Makefile dnl
+ storage/archive/Makefile storage/bdb/Makefile storage/blackhole/Makefile dnl
+ storage/csv/Makefile storage/example/Makefile storage/heap/Makefile dnl
  storage/myisam/Makefile storage/myisammrg/Makefile dnl
  man/Makefile BUILD/Makefile vio/Makefile dnl
  libmysql/Makefile client/Makefile dnl
  pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile dnl
- sql/handlerton.cc sql-common/Makefile dnl
+ sql/sql_builtin.cc sql-common/Makefile dnl
  dbug/Makefile scripts/Makefile dnl
  include/Makefile dnl
  server-tools/Makefile server-tools/instance-manager/Makefile dnl

--- 1.86/sql/ha_heap.cc	2006-04-19 18:05:36 -07:00
+++ 1.87/sql/ha_heap.cc	2006-04-24 13:28:17 -07:00
@@ -706,3 +706,16 @@ bool ha_heap::check_if_incompatible_data
     return COMPATIBLE_DATA_NO;
   return COMPATIBLE_DATA_YES;
 }
+
+mysql_declare_plugin(heap)
+{
+  MYSQL_STORAGE_ENGINE_PLUGIN,
+  &heap_hton,
+  heap_hton.name,
+  NULL,
+  heap_hton.comment,
+  NULL,
+  NULL,
+  0
+}
+mysql_declare_plugin_end;

--- 1.83/sql/ha_myisammrg.cc	2006-04-01 13:29:44 -08:00
+++ 1.84/sql/ha_myisammrg.cc	2006-04-24 13:28:17 -07:00
@@ -28,6 +28,8 @@
 #include "../storage/myisammrg/myrg_def.h"
 #endif
 
+#include <mysql/plugin.h>
+
 /*****************************************************************************
 ** MyISAM MERGE tables
 *****************************************************************************/
@@ -573,3 +575,16 @@ bool ha_myisammrg::check_if_incompatible
   */
   return COMPATIBLE_DATA_NO;
 }
+
+mysql_declare_plugin(myisammrg)
+{
+  MYSQL_STORAGE_ENGINE_PLUGIN,
+  &myisammrg_hton,
+  myisammrg_hton.name,
+  "MySQL AB",
+  "MyISAMMRG Storage Engine",
+  NULL, /* Plugin Init */
+  NULL, /* Plugin Deinit */
+  0x0100 /* 1.0 */,
+}
+mysql_declare_plugin_end;

--- 1.204/sql/handler.h	2006-04-21 12:49:06 -07:00
+++ 1.205/sql/handler.h	2006-04-24 13:28:18 -07:00
@@ -233,6 +233,7 @@ enum legacy_db_type
   DB_TYPE_BLACKHOLE_DB,
   DB_TYPE_PARTITION_DB,
   DB_TYPE_BINLOG,
+  DB_TYPE_FIRST_DYNAMIC=32,
   DB_TYPE_DEFAULT=127 // Must be last
 };
 
@@ -1552,8 +1553,8 @@ static inline bool ha_storage_engine_is_
 
 /* basic stuff */
 int ha_init(void);
-int ha_register_builtin_plugins();
-int ha_initialize_handlerton(handlerton *hton);
+int ha_initialize_handlerton(st_plugin_int *plugin);
+int ha_finalize_handlerton(st_plugin_int *plugin);
 
 TYPELIB *ha_known_exts(void);
 int ha_panic(enum ha_panic_function flag);

--- 1.202/sql/log.cc	2006-04-19 18:05:36 -07:00
+++ 1.203/sql/log.cc	2006-04-24 13:28:18 -07:00
@@ -30,6 +30,8 @@
 #include "message.h"
 #endif
 
+#include <mysql/plugin.h>
+
 /* max size of the log message */
 #define MAX_LOG_BUFFER_SIZE 1024
 #define MAX_USER_HOST_SIZE 512
@@ -4343,3 +4345,16 @@ err1:
   return 1;
 }
 
+
+mysql_declare_plugin(binlog)
+{
+  MYSQL_STORAGE_ENGINE_PLUGIN,
+  &binlog_hton,
+  binlog_hton.name,
+  "MySQL AB",
+  "Binlog Engine",
+  NULL, /* Plugin Init */
+  NULL, /* Plugin Deinit */
+  0x0100 /* 1.0 */,
+}
+mysql_declare_plugin_end;

--- 1.548/sql/mysqld.cc	2006-04-24 07:51:16 -07:00
+++ 1.549/sql/mysqld.cc	2006-04-24 13:28:18 -07:00
@@ -2637,12 +2637,6 @@ static int init_common_variables(const c
     return 1;
   }
 
-  if (ha_register_builtin_plugins())
-  {
-    sql_print_error("Failed to register built-in storage engines.");
-    return 1;
-  }
-
   load_defaults(conf_file_name, groups, &argc, &argv);
   defaults_argv=argv;
   get_options(argc,argv);
@@ -3012,6 +3006,19 @@ static int init_server_components()
     }
   }
 
+  if (xid_cache_init())
+  {
+    sql_print_error("Out of memory");
+    unireg_abort(1);
+  }
+
+  /* We have to initialize the storage engines before CSV logging */
+  if (ha_init())
+  {
+    sql_print_error("Can't init databases");
+    unireg_abort(1);
+  }
+
 #ifdef WITH_CSV_STORAGE_ENGINE
   if (opt_bootstrap)
     log_output_options= LOG_FILE;
@@ -3173,17 +3180,6 @@ server.");
       INSERT ... SELECT. This will change when we have row level logging.
     */
     using_update_log=1;
-  }
-
-  if (xid_cache_init())
-  {
-    sql_print_error("Out of memory");
-    unireg_abort(1);
-  }
-  if (ha_init())
-  {
-    sql_print_error("Can't init databases");
-    unireg_abort(1);
   }
 
   /*

--- 1.470/sql/sql_yacc.yy	2006-04-22 17:00:05 -07:00
+++ 1.471/sql/sql_yacc.yy	2006-04-24 13:28:18 -07:00
@@ -8119,7 +8119,7 @@ show_param:
             if (prepare_schema_table(YYTHD, lex, 0, SCH_OPEN_TABLES))
               YYABORT;
 	  }
-        | PLUGIN_SYM
+        | opt_full PLUGIN_SYM
 	  {
 	    LEX *lex= Lex;
 	    WARN_DEPRECATED(yythd, "5.2", "SHOW PLUGIN", "'SHOW PLUGINS'");

--- 1.85.1.1/sql/ha_archive.cc	2006-04-16 21:54:57 -07:00
+++ 1.88/storage/archive/ha_archive.cc	2006-04-24 13:28:19 -07:00
@@ -19,10 +19,13 @@
 #endif
 
 #include "mysql_priv.h"
+#include <myisam.h>
 
 #include "ha_archive.h"
 #include <my_dir.h>
 
+#include <mysql/plugin.h>
+
 /*
   First, if you want to understand storage engines you should look at 
   ha_example.cc and ha_example.h. 
@@ -214,6 +217,8 @@ static byte* archive_get_key(ARCHIVE_SHA
 bool archive_db_init()
 {
   DBUG_ENTER("archive_db_init");
+  if (archive_inited)
+    DBUG_RETURN(FALSE);
   if (pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST))
     goto error;
   if (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0,
@@ -227,7 +232,6 @@ bool archive_db_init()
     DBUG_RETURN(FALSE);
   }
 error:
-  have_archive_db= SHOW_OPTION_DISABLED;	// If we couldn't use handler
   DBUG_RETURN(TRUE);
 }
 
@@ -235,14 +239,14 @@ error:
   Release the archive handler.
 
   SYNOPSIS
-    archive_db_end()
+    archive_db_done()
     void
 
   RETURN
     FALSE       OK
 */
 
-int archive_db_end(ha_panic_function type)
+int archive_db_done()
 {
   if (archive_inited)
   {
@@ -253,6 +257,12 @@ int archive_db_end(ha_panic_function typ
   return 0;
 }
 
+
+int archive_db_end(ha_panic_function type)
+{
+  return archive_db_done();
+}
+
 ha_archive::ha_archive(TABLE_SHARE *table_arg)
   :handler(&archive_hton, table_arg), delayed_insert(0), bulk_insert(0)
 {
@@ -830,7 +840,7 @@ int ha_archive::write_row(byte *buf)
   if (share->crashed)
       DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
 
-  statistic_increment(table->in_use->status_var.ha_write_count, &LOCK_status);
+  ha_statistic_increment(&SSV::ha_write_count);
   if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
     table->timestamp_field->set_time();
   pthread_mutex_lock(&share->mutex);
@@ -1147,8 +1157,7 @@ int ha_archive::rnd_next(byte *buf)
     DBUG_RETURN(HA_ERR_END_OF_FILE);
   scan_rows--;
 
-  statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
-		      &LOCK_status);
+  ha_statistic_increment(&SSV::ha_read_rnd_next_count);
   current_position= aztell(&archive);
   rc= get_row(&archive, buf);
 
@@ -1184,8 +1193,7 @@ void ha_archive::position(const byte *re
 int ha_archive::rnd_pos(byte * buf, byte *pos)
 {
   DBUG_ENTER("ha_archive::rnd_pos");
-  statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
-		      &LOCK_status);
+  ha_statistic_increment(&SSV::ha_read_rnd_next_count);
   current_position= (my_off_t)my_get_ptr(pos, ref_length);
   (void)azseek(&archive, current_position, SEEK_SET);
 
@@ -1369,8 +1377,8 @@ THR_LOCK_DATA **ha_archive::store_lock(T
     */
 
     if ((lock_type >= TL_WRITE_CONCURRENT_INSERT &&
-         lock_type <= TL_WRITE) && !thd->in_lock_tables
-        && !thd->tablespace_op)
+         lock_type <= TL_WRITE) && !thd_in_lock_tables(thd)
+        && !thd_tablespace_op(thd))
       lock_type = TL_WRITE_ALLOW_WRITE;
 
     /* 
@@ -1381,7 +1389,7 @@ THR_LOCK_DATA **ha_archive::store_lock(T
       concurrent inserts to t2. 
     */
 
-    if (lock_type == TL_READ_NO_INSERT && !thd->in_lock_tables) 
+    if (lock_type == TL_READ_NO_INSERT && !thd_in_lock_tables(thd)) 
       lock_type = TL_READ;
 
     lock.type=lock_type;
@@ -1494,11 +1502,11 @@ int ha_archive::check(THD* thd, HA_CHECK
 {
   int rc= 0;
   byte *buf; 
-  const char *old_proc_info=thd->proc_info;
+  const char *old_proc_info;
   ha_rows count= share->rows_recorded;
   DBUG_ENTER("ha_archive::check");
 
-  thd->proc_info= "Checking table";
+  old_proc_info= thd_proc_info(thd, "Checking table");
   /* Flush any waiting data */
   azflush(&(share->archive_write), Z_SYNC_FLUSH);
   share->forced_flushes++;
@@ -1523,7 +1531,7 @@ int ha_archive::check(THD* thd, HA_CHECK
 
   my_free((char*)buf, MYF(0));
 
-  thd->proc_info= old_proc_info;
+  thd_proc_info(thd, old_proc_info);
 
   if ((rc && rc != HA_ERR_END_OF_FILE) || count)  
   {
@@ -1548,3 +1556,17 @@ bool ha_archive::check_and_repair(THD *t
 
   DBUG_RETURN(repair(thd, &check_opt));
 }
+
+
+mysql_declare_plugin(archive)
+{
+  MYSQL_STORAGE_ENGINE_PLUGIN,
+  &archive_hton,
+  archive_hton.name,
+  "Brian Aker, MySQL AB",
+  "Archive Storage Engine",
+  NULL, /* Plugin Init */
+  archive_db_done, /* Plugin Deinit */
+  0x0100 /* 1.0 */,
+}
+mysql_declare_plugin_end;

--- 1.42.1.1/sql/ha_archive.h	2006-04-16 21:54:57 -07:00
+++ 1.45/storage/archive/ha_archive.h	2006-04-24 13:28:19 -07:00
@@ -19,7 +19,7 @@
 #endif
 
 #include <zlib.h>
-#include "../storage/archive/azlib.h"
+#include "azlib.h"
 
 /*
   Please read ha_archive.cc first. If you are looking for more general

--- 1.35/storage/example/ha_example.cc	2006-04-13 13:49:24 -07:00
+++ 1.36/storage/example/ha_example.cc	2006-04-24 13:28:19 -07:00
@@ -74,6 +74,8 @@
 
 static handler* example_create_handler(TABLE_SHARE *table);
 static int example_init_func();
+static bool example_init_func_for_handlerton();
+static int example_panic(enum ha_panic_function flag);
 
 handlerton example_hton= {
   MYSQL_HANDLERTON_INTERFACE_VERSION,
@@ -81,7 +83,7 @@ handlerton example_hton= {
   SHOW_OPTION_YES,
   "Example storage engine", 
   DB_TYPE_EXAMPLE_DB,
-  (bool (*)()) example_init_func,
+  example_init_func_for_handlerton,
   0,       /* slot */
   0,       /* savepoint size. */
   NULL,    /* close_connection */
@@ -99,7 +101,7 @@ handlerton example_hton= {
   NULL,    /* close_cursor_read_view */
   example_create_handler,    /* Create a new handler */
   NULL,    /* Drop a database */
-  NULL,    /* Panic call */
+  example_panic,    /* Panic call */
   NULL,    /* Start Consistent Snapshot */
   NULL,    /* Flush logs */
   NULL,    /* Show status */
@@ -107,7 +109,10 @@ handlerton example_hton= {
   NULL,    /* Alter table flags */
   NULL,    /* Alter tablespace */
   NULL,    /* Fill Files table */
-  HTON_CAN_RECREATE
+  HTON_CAN_RECREATE,
+  NULL,
+  NULL,
+  NULL,
 };
 
 /* Variables for example share methods */
@@ -126,32 +131,43 @@ static byte* example_get_key(EXAMPLE_SHA
   return (byte*) share->table_name;
 }
 
-
 static int example_init_func()
 {
+  DBUG_ENTER("example_init_func");
   if (!example_init)
   {
-    example_init++;
+    example_init= 1;
     VOID(pthread_mutex_init(&example_mutex,MY_MUTEX_INIT_FAST));
     (void) hash_init(&example_open_tables,system_charset_info,32,0,0,
                      (hash_get_key) example_get_key,0,0);
   }
-  return 0;
+  DBUG_RETURN(0);
 }
 
 static int example_done_func()
 {
+  int error= 0;
+  DBUG_ENTER("example_done_func");
+
   if (example_init)
   {
+    example_init= 0;
     if (example_open_tables.records)
-    {
-      return 1;
-    }
+      error= 1;
     hash_free(&example_open_tables);
     pthread_mutex_destroy(&example_mutex);
-    example_init--;
   }
-  return 0;
+  DBUG_RETURN(0);
+}
+
+static bool example_init_func_for_handlerton()
+{
+  return example_init_func();
+}
+
+static int example_panic(enum ha_panic_function flag)
+{
+  return example_done_func();
 }
 
 

--- 1.295/sql/ha_ndbcluster.cc	2006-04-21 13:26:28 -07:00
+++ 1.296/sql/ha_ndbcluster.cc	2006-04-24 13:28:17 -07:00
@@ -27,6 +27,7 @@
 #include "mysql_priv.h"
 
 #include <my_dir.h>
+#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
 #include "ha_ndbcluster.h"
 #include <ndbapi/NdbApi.hpp>
 #include <ndbapi/NdbScanFilter.hpp>
@@ -36,6 +37,8 @@
 #include "ha_ndbcluster_binlog.h"
 #include "ha_ndbcluster_tables.h"
 
+#include <mysql/plugin.h>
+
 #ifdef ndb_dynamite
 #undef assert
 #define assert(x) do { if(x) break; ::printf("%s %d: assert failed: %s\n", __FILE__, __LINE__, #x); ::fflush(stdout); ::signal(SIGABRT,SIG_DFL); ::abort(); ::kill(::getpid(),6); ::kill(::getpid(),9); } while (0)
@@ -10253,3 +10256,19 @@ static int ndbcluster_fill_files_table(T
   }
   DBUG_RETURN(0);
 }
+
+
+mysql_declare_plugin(ndbcluster)
+{
+  MYSQL_STORAGE_ENGINE_PLUGIN,
+  &ndbcluster_hton,
+  ndbcluster_hton.name,
+  "MySQL AB",
+  "NDB Storage Engine",
+  NULL, /* Plugin Init */
+  NULL, /* Plugin Deinit */
+  0x0100 /* 1.0 */,
+}
+mysql_declare_plugin_end;
+
+#endif

--- 1.11/storage/innobase/Makefile.am	2006-04-13 13:49:24 -07:00
+++ 1.12/storage/innobase/Makefile.am	2006-04-24 13:36:08 -07:00
@@ -76,7 +76,7 @@ EXTRA_DIST = 	include/btr0btr.h include/
 		include/univ.i include/usr0sess.h include/usr0sess.ic include/usr0types.h \
 		include/ut0byte.h include/ut0byte.ic include/ut0dbg.h include/ut0lst.h \
 		include/ut0mem.h include/ut0mem.ic include/ut0rnd.h include/ut0rnd.ic \
-		include/ut0sort.h include/ut0ut.h include/ut0ut.ic \
+		include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic \
 		cmakelists.txt
 
 noinst_LIBRARIES =	libinnobase.a

--- 1.269/sql/ha_innodb.cc	2006-04-13 13:49:23 -07:00
+++ 1.270/sql/ha_innodb.cc	2006-04-24 13:28:17 -07:00
@@ -133,6 +133,7 @@ extern "C" {
 #include "../storage/innobase/include/sync0sync.h"
 #include "../storage/innobase/include/fil0fil.h"
 #include "../storage/innobase/include/trx0xa.h"
+#include "../storage/innobase/include/thr0loc.h"
 }
 
 #define HA_INNOBASE_ROWS_IN_TABLE 10000 /* to get optimization right */
@@ -238,7 +239,7 @@ handlerton innobase_hton = {
   NULL,                         /* Fill FILES table */
   HTON_NO_FLAGS,
   NULL,                         /* binlog_func */
-  NULL,                          /* binlog_log_query */
+  NULL,                         /* binlog_log_query */
   innobase_release_temporary_latches
 };
 
@@ -536,18 +537,18 @@ convert_error_code_to_mysql(
 
 	} else if (error == (int) DB_CORRUPTION) {
 
-    		return(HA_ERR_CRASHED);
-  	} else if (error == (int) DB_NO_SAVEPOINT) {
+		return(HA_ERR_CRASHED);
+	} else if (error == (int) DB_NO_SAVEPOINT) {
 
-    		return(HA_ERR_NO_SAVEPOINT);
-  	} else if (error == (int) DB_LOCK_TABLE_FULL) {
-          /* Since we rolled back the whole transaction, we must
-          tell it also to MySQL so that MySQL knows to empty the
-          cached binlog for this transaction */
-
-          if (thd) {
-                  ha_rollback(thd);
-          }
+		return(HA_ERR_NO_SAVEPOINT);
+	} else if (error == (int) DB_LOCK_TABLE_FULL) {
+ 		/* Since we rolled back the whole transaction, we must
+ 		tell it also to MySQL so that MySQL knows to empty the
+ 		cached binlog for this transaction */
+
+ 		if (thd) {
+ 			ha_rollback(thd);
+ 		}
 
     		return(HA_ERR_LOCK_TABLE_FULL);
     	} else {
@@ -1015,7 +1016,6 @@ innobase_query_caching_of_table_permitte
 		mutex_enter_noninline(&kernel_mutex);
 		trx_print(stderr, trx, 1024);
 		mutex_exit_noninline(&kernel_mutex);
-		ut_error;
 	}
 
 	innobase_release_stat_resources(trx);
@@ -1770,25 +1770,6 @@ innobase_report_binlog_offset_and_commit
 	trx->mysql_log_file_name = log_file_name;
 	trx->mysql_log_offset = (ib_longlong)end_offset;
 
-#ifdef HAVE_REPLICATION
-	if (thd->variables.sync_replication) {
-		/* Let us store the binlog file name and the position, so that
-		we know how long to wait for the binlog to the replicated to
-		the slave in synchronous replication. */
-
-		if (trx->repl_wait_binlog_name == NULL) {
-
-			trx->repl_wait_binlog_name =
-				  (char*)mem_alloc_noninline(FN_REFLEN + 100);
-		}
-
-		ut_a(strlen(log_file_name) < FN_REFLEN + 100);
-
-		strcpy(trx->repl_wait_binlog_name, log_file_name);
-
-		trx->repl_wait_binlog_pos = (ib_longlong)end_offset;
-	}
-#endif /* HAVE_REPLICATION */
 	trx->flush_log_later = TRUE;
 
 	innobase_commit(thd, TRUE);
@@ -1857,121 +1838,9 @@ innobase_commit_complete(
 		trx_commit_complete_for_mysql(trx);
 	}
 
-#ifdef HAVE_REPLICATION
-	if (thd->variables.sync_replication
-		&& trx->repl_wait_binlog_name
-		&& innobase_repl_state != 0) {
-
-		struct timespec abstime;
-		int	cmp;
-		int	ret;
-
-		/* In synchronous replication, let us wait until the MySQL
-		replication has sent the relevant binlog segment to the
-		replication slave. */
-
-		pthread_mutex_lock(&innobase_repl_cond_mutex);
-try_again:
-		if (innobase_repl_state == 0) {
-
-			pthread_mutex_unlock(&innobase_repl_cond_mutex);
-
-			return(0);
-		}
-
-		cmp = strcmp(innobase_repl_file_name,
-					trx->repl_wait_binlog_name);
-		if (cmp > 0
-			|| (cmp == 0 && innobase_repl_pos
-				>= (my_off_t)trx->repl_wait_binlog_pos)) {
-			/* We have already sent the relevant binlog to the
-			slave: no need to wait here */
-
-			pthread_mutex_unlock(&innobase_repl_cond_mutex);
-
-/*			printf("Binlog now sent\n"); */
-
-			return(0);
-		}
-
-		/* Let us update the info about the minimum binlog position
-		of waiting threads in the innobase_repl_... variables */
-
-		if (innobase_repl_wait_file_name_inited != 0) {
-			cmp = strcmp(trx->repl_wait_binlog_name,
-					innobase_repl_wait_file_name);
-			if (cmp < 0
-				|| (cmp == 0
-					&& (my_off_t)trx->repl_wait_binlog_pos
-					<= innobase_repl_wait_pos)) {
-				/* This thd has an even lower position, let
-				us update the minimum info */
-
-				strcpy(innobase_repl_wait_file_name,
-					trx->repl_wait_binlog_name);
-
-				innobase_repl_wait_pos =
-					trx->repl_wait_binlog_pos;
-			}
-		} else {
-			strcpy(innobase_repl_wait_file_name,
-						trx->repl_wait_binlog_name);
-
-			innobase_repl_wait_pos = trx->repl_wait_binlog_pos;
-
-			innobase_repl_wait_file_name_inited = 1;
-		}
-		set_timespec(abstime, thd->variables.sync_replication_timeout);
-
-		/* Let us suspend this thread to wait on the condition;
-		when replication has progressed far enough, we will release
-		these waiting threads. The following call
-		pthread_cond_timedwait also atomically unlocks
-		innobase_repl_cond_mutex. */
-
-		innobase_repl_n_wait_threads++;
-
-/*		printf("Waiting for binlog to be sent\n"); */
-
-		ret = pthread_cond_timedwait(&innobase_repl_cond,
-					&innobase_repl_cond_mutex, &abstime);
-		innobase_repl_n_wait_threads--;
-
-		if (ret != 0) {
-			ut_print_timestamp(stderr);
-
-			sql_print_error("MySQL synchronous replication was "
-					"not able to send the binlog to the "
-					"slave within the timeout %lu. We "
-					"assume that the slave has become "
-					"inaccessible, and switch off "
-					"synchronous replication until the "
-					"communication to the slave works "
-					"again. MySQL synchronous replication "
-					"has sent binlog to the slave up to "
-					"file %s, position %lu. This "
-					"transaction needs it to be sent up "
-					"to file %s, position %lu.",
-					thd->variables.sync_replication_timeout,
-					innobase_repl_file_name,
-					(ulong) innobase_repl_pos,
-					trx->repl_wait_binlog_name,
-					(ulong) trx->repl_wait_binlog_pos);
-
-			innobase_repl_state = 0;
-
-			pthread_mutex_unlock(&innobase_repl_cond_mutex);
-
-			return(0);
-		}
-
-		goto try_again;
-	}
-#endif // HAVE_REPLICATION
 	return(0);
 }
 
-
 /*********************************************************************
 Rolls back a transaction or the latest SQL statement. */
 
@@ -2197,6 +2066,7 @@ innobase_close_connection(
 
 	innobase_rollback_trx(trx);
 
+	thr_local_free(trx->mysql_thread_id);
 	trx_free_for_mysql(trx);
 
 	return(0);
@@ -2217,7 +2087,7 @@ ha_innobase::get_row_type() const
 	row_prebuilt_t*	prebuilt = (row_prebuilt_t*) innobase_prebuilt;
 
 	if (prebuilt && prebuilt->table) {
-		if (innodb_dict_table_is_comp(prebuilt->table)) {
+		if (dict_table_is_comp_noninline(prebuilt->table)) {
 			return(ROW_TYPE_COMPACT);
 		} else {
 			return(ROW_TYPE_REDUNDANT);
@@ -3610,7 +3480,8 @@ calc_row_difference(
 					TRUE,
 					new_mysql_row_col,
 					col_pack_len,
-					innodb_dict_table_is_comp(prebuilt->table));
+					dict_table_is_comp_noninline(
+							prebuilt->table));
 				ufield->new_val.data = dfield.data;
 				ufield->new_val.len = dfield.len;
 			} else {
@@ -3770,9 +3641,17 @@ ha_innobase::unlock_row(void)
 		ut_error;
 	}
 
+	/* Consistent read does not take any locks, thus there is
+	nothing to unlock. */
+
+	if (prebuilt->select_lock_type == LOCK_NONE) {
+		DBUG_VOID_RETURN;
+	}
+
 	switch (prebuilt->row_read_type) {
 	case ROW_READ_WITH_LOCKS:
-		if (!srv_locks_unsafe_for_binlog) {
+		if (!srv_locks_unsafe_for_binlog
+		|| prebuilt->trx->isolation_level == TRX_ISO_READ_COMMITTED) {
 			break;
 		}
 		/* fall through */
@@ -3804,7 +3683,13 @@ ha_innobase::try_semi_consistent_read(bo
 {
 	row_prebuilt_t*	prebuilt = (row_prebuilt_t*) innobase_prebuilt;
 
-	if (yes && srv_locks_unsafe_for_binlog) {
+	/* Row read type is set to semi consistent read if this was
+	requested by the MySQL and either innodb_locks_unsafe_for_binlog
+	option is used or this session is using READ COMMITTED isolation
+	level. */
+
+	if (yes &&  (srv_locks_unsafe_for_binlog
+		|| prebuilt->trx->isolation_level == TRX_ISO_READ_COMMITTED)) {
 		prebuilt->row_read_type = ROW_READ_TRY_SEMI_CONSISTENT;
 	} else {
 		prebuilt->row_read_type = ROW_READ_WITH_LOCKS;
@@ -6287,12 +6172,6 @@ ha_innobase::external_lock(
 		trx->n_mysql_tables_in_use++;
 		prebuilt->mysql_has_locked = TRUE;
 
-		if (trx->n_mysql_tables_in_use == 1) {
-			trx->isolation_level = innobase_map_isolation_level(
-						(enum_tx_isolation)
-						thd->variables.tx_isolation);
-		}
-
 		if (trx->isolation_level == TRX_ISO_SERIALIZABLE
 			&& prebuilt->select_lock_type == LOCK_NONE
 			&& (thd->options
@@ -6766,11 +6645,22 @@ ha_innobase::store_lock(
 						TL_IGNORE */
 {
 	row_prebuilt_t* prebuilt	= (row_prebuilt_t*) innobase_prebuilt;
+	trx_t*		trx		= prebuilt->trx;
 
 	/* NOTE: MySQL	can call this function with lock 'type' TL_IGNORE!
 	Be careful to ignore TL_IGNORE if we are going to do something with
 	only 'real' locks! */
 
+	/* If no MySQL tables is use we need to set isolation level
+	of the transaction. */
+
+	if (lock_type != TL_IGNORE
+	&& trx->n_mysql_tables_in_use == 0) {
+		trx->isolation_level = innobase_map_isolation_level(
+						(enum_tx_isolation)
+						thd->variables.tx_isolation);
+	}
+
 	if ((lock_type == TL_READ && thd->in_lock_tables) ||
 		(lock_type == TL_READ_HIGH_PRIORITY && thd->in_lock_tables) ||
 		lock_type == TL_READ_WITH_SHARED_LOCKS ||
@@ -6795,18 +6685,26 @@ ha_innobase::store_lock(
 		unexpected if an obsolete consistent read view would be
 		used. */
 
-		if (srv_locks_unsafe_for_binlog &&
-			prebuilt->trx->isolation_level != TRX_ISO_SERIALIZABLE &&
-			(lock_type == TL_READ || lock_type == TL_READ_NO_INSERT) &&
-			(thd->lex->sql_command == SQLCOM_INSERT_SELECT ||
-				thd->lex->sql_command == SQLCOM_UPDATE)) {
+		ulint	isolation_level;
+
+		isolation_level = trx->isolation_level;
 
-			/* In case we have innobase_locks_unsafe_for_binlog
-			option set and isolation level of the transaction
+		if ((srv_locks_unsafe_for_binlog
+			|| isolation_level == TRX_ISO_READ_COMMITTED)
+		&& isolation_level != TRX_ISO_SERIALIZABLE
+		&& (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT)
+		&& (thd->lex->sql_command == SQLCOM_INSERT_SELECT
+			|| thd->lex->sql_command == SQLCOM_UPDATE
+			|| thd->lex->sql_command == SQLCOM_CREATE_TABLE)) {
+
+			/* If we either have innobase_locks_unsafe_for_binlog
+			option set or this session is using READ COMMITTED
+			isolation level and isolation level of the transaction
 			is not set to serializable and MySQL is doing
-			INSERT INTO...SELECT or UPDATE ... = (SELECT ...)
-			without FOR UPDATE or IN SHARE MODE in select, then
-			we use consistent read for select. */
+			INSERT INTO...SELECT or UPDATE ... = (SELECT ...) or
+			CREATE  ... SELECT... without FOR UPDATE or
+			IN SHARE MODE in select, then we use consistent
+			read for select. */
 
 			prebuilt->select_lock_type = LOCK_NONE;
 			prebuilt->stored_select_lock_type = LOCK_NONE;
@@ -6855,25 +6753,26 @@ ha_innobase::store_lock(
 		}
 
 		/* If we are not doing a LOCK TABLE, DISCARD/IMPORT
-		TABLESPACE or TRUNCATE TABLE then allow multiple 
+		TABLESPACE or TRUNCATE TABLE then allow multiple
 		writers. Note that ALTER TABLE uses a TL_WRITE_ALLOW_READ
 		< TL_WRITE_CONCURRENT_INSERT.
 
-		We especially allow multiple writers if MySQL is at the 
-		start of a stored procedure call (SQLCOM_CALL) 
-		(MySQL does have thd->in_lock_tables TRUE there). */
-
-    		if ((lock_type >= TL_WRITE_CONCURRENT_INSERT 
-		    && lock_type <= TL_WRITE)
-		    && !(thd->in_lock_tables
-                         && thd->lex->sql_command == SQLCOM_LOCK_TABLES)
-		    && !thd->tablespace_op
-		    && thd->lex->sql_command != SQLCOM_TRUNCATE
-		    && thd->lex->sql_command != SQLCOM_OPTIMIZE
-		    && thd->lex->sql_command != SQLCOM_CREATE_TABLE) {
+		We especially allow multiple writers if MySQL is at the
+		start of a stored procedure call (SQLCOM_CALL) or a
+		stored function call (MySQL does have thd->in_lock_tables
+		TRUE there). */
+
+		if ((lock_type >= TL_WRITE_CONCURRENT_INSERT
+		&& lock_type <= TL_WRITE)
+		&& !(thd->in_lock_tables
+			&& thd->lex->sql_command == SQLCOM_LOCK_TABLES)
+		&& !thd->tablespace_op
+		&& thd->lex->sql_command != SQLCOM_TRUNCATE
+		&& thd->lex->sql_command != SQLCOM_OPTIMIZE
+		&& thd->lex->sql_command != SQLCOM_CREATE_TABLE) {
 
 			lock_type = TL_WRITE_ALLOW_WRITE;
-      		}
+		}
 
 		/* In queries of type INSERT INTO t1 SELECT ... FROM t2 ...
 		MySQL would use the lock TL_READ_NO_INSERT on t2, and that

--- 1.18/sql/sql_plugin.cc	2006-04-13 13:49:23 -07:00
+++ 1.19/sql/sql_plugin.cc	2006-04-24 13:28:18 -07:00
@@ -531,8 +531,16 @@ static int plugin_initialize(struct st_p
   switch (plugin->plugin->type)
   {
   case MYSQL_STORAGE_ENGINE_PLUGIN:
-    sql_print_error("Storage Engine plugins are unsupported in this version.");
-    goto err;
+    if (ha_initialize_handlerton((handlerton*) plugin->plugin->info))
+    {
+      sql_print_error("Plugin '%s' handlerton init returned error.",
+                      plugin->name.str);
+      DBUG_PRINT("warning", ("Plugin '%s' handlerton init returned error.",
+                             plugin->name.str));
+      goto err;
+    }
+    break;
+
   default:
     break;
   }

--- 1.85/libmysqld/Makefile.am	2006-04-19 00:39:53 -07:00
+++ 1.86/libmysqld/Makefile.am	2006-04-24 13:28:17 -07:00
@@ -44,7 +44,10 @@ libmysqlsources =	errmsg.c get_password.
 noinst_HEADERS =	embedded_priv.h emb_qcache.h
 
 sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
-	ha_heap.cc ha_myisam.cc ha_myisammrg.cc handler.cc sql_handler.cc \
+	ha_heap.cc ha_myisam.cc ha_myisammrg.cc \
+	ha_innodb.cc ha_berkeley.cc ha_federated.cc ha_ndbcluster.cc \
+	ha_ndbcluster_binlog.cc ha_partition.cc \
+	handler.cc sql_handler.cc \
 	hostname.cc init.cc password.c \
 	item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
 	item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
@@ -65,17 +68,12 @@ sqlsources = derror.cc field.cc field_co
 	spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
 	sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
 	parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
-        event_executor.cc event.cc event_timed.cc \
-        rpl_filter.cc sql_partition.cc handlerton.cc sql_plugin.cc \
-        sql_tablespace.cc \
-        rpl_injector.cc my_user.c partition_info.cc
+	event_executor.cc event.cc event_timed.cc \
+	rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
+	sql_tablespace.cc \
+	rpl_injector.cc my_user.c partition_info.cc
 
 libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
-EXTRA_libmysqld_a_SOURCES =	ha_innodb.cc ha_berkeley.cc ha_archive.cc \
-			ha_blackhole.cc ha_federated.cc ha_ndbcluster.cc \
-			ha_ndbcluster_binlog.cc \
-			ha_partition.cc
-libmysqld_a_DEPENDENCIES= @mysql_se_objs@
 libmysqld_a_SOURCES=
 
 sqlstoragesources =	$(EXTRA_libmysqld_a_SOURCES)
@@ -85,15 +83,11 @@ sql_yacc.cc sql_yacc.h: $(top_srcdir)/sq
 
 # The following libraries should be included in libmysqld.a
 INC_LIB=	$(top_builddir)/regex/libregex.a \
-		$(top_builddir)/storage/myisam/libmyisam.a \
-		$(top_builddir)/storage/myisammrg/libmyisammrg.a \
-		$(top_builddir)/storage/archive/libarchive.a \
-		$(top_builddir)/storage/heap/libheap.a \
 		$(top_builddir)/mysys/libmysys.a \
 		$(top_builddir)/strings/libmystrings.a \
 		$(top_builddir)/dbug/libdbug.a \
 		$(top_builddir)/vio/libvio.a \
-		@mysql_se_libs@ \
+		@mysql_plugin_libs@ \
 		$(yassl_las)
 
 if HAVE_YASSL

--- 1.45/sql/ha_partition.cc	2006-04-19 18:43:25 -07:00
+++ 1.46/sql/ha_partition.cc	2006-04-24 13:28:18 -07:00
@@ -54,8 +54,11 @@
 
 #include "mysql_priv.h"
 
+#ifdef WITH_PARTITION_STORAGE_ENGINE
 #include "ha_partition.h"
 
+#include <mysql/plugin.h>
+
 static const char *ha_par_ext= ".par";
 #ifdef NOT_USED
 static int free_share(PARTITION_SHARE * share);
@@ -5438,3 +5441,19 @@ static int free_share(PARTITION_SHARE *s
   return 0;
 }
 #endif /* NOT_USED */
+
+
+mysql_declare_plugin(partition)
+{
+  MYSQL_STORAGE_ENGINE_PLUGIN,
+  &partition_hton,
+  partition_hton.name,
+  "Mikael Ronstrom, MySQL AB",
+  "Partitioning Support",
+  NULL, /* Plugin Init */
+  NULL, /* Plugin Deinit */
+  0x0100 /* 1.0 */,
+}
+mysql_declare_plugin_end;
+
+#endif

--- 1.10/sql/partition_info.cc	2006-04-13 13:49:23 -07:00
+++ 1.11/sql/partition_info.cc	2006-04-24 13:28:18 -07:00
@@ -89,10 +89,10 @@ partition_info *partition_info::get_clon
     The external routine needing this code is check_partition_info
 */
 
-#define MAX_PART_NAME_SIZE 16
+#define MAX_PART_NAME_SIZE 8
 
 char *partition_info::create_default_partition_names(uint part_no, uint no_parts, 
-                                                     uint start_no, bool is_subpart)
+                                                     uint start_no)
 {
   char *ptr= sql_calloc(no_parts*MAX_PART_NAME_SIZE);
   char *move_ptr= ptr;
@@ -103,10 +103,7 @@ char *partition_info::create_default_par
   {
     do
     {
-      if (is_subpart)
-        my_sprintf(move_ptr, (move_ptr,"p%usp%u", part_no, (start_no + i)));
-      else
-        my_sprintf(move_ptr, (move_ptr,"p%u", (start_no + i)));
+      my_sprintf(move_ptr, (move_ptr,"p%u", (start_no + i)));
       move_ptr+=MAX_PART_NAME_SIZE;
     } while (++i < no_parts);
   }
@@ -119,6 +116,36 @@ char *partition_info::create_default_par
 
 
 /*
+  Create a unique name for the subpartition as part_name'sp''subpart_no'
+  SYNOPSIS
+    create_subpartition_name()
+    subpart_no                  Number of subpartition
+    part_name                   Name of partition
+  RETURN VALUES
+    >0                          A reference to the created name string
+    0                           Memory allocation error
+*/
+
+char *partition_info::create_subpartition_name(uint subpart_no,
+                                               const char *part_name)
+{
+  uint size_alloc= strlen(part_name) + MAX_PART_NAME_SIZE;
+  char *ptr= sql_calloc(size_alloc);
+  DBUG_ENTER("create_subpartition_name");
+
+  if (likely(ptr != NULL))
+  {
+    my_sprintf(ptr, (ptr, "%ssp%u", part_name, subpart_no));
+  }
+  else
+  {
+    mem_alloc_error(size_alloc);
+  }
+  DBUG_RETURN(ptr);
+}
+
+
+/*
   Set up all the default partitions not set-up by the user in the SQL
   statement. Also perform a number of checks that the user hasn't tried
   to use default values where no defaults exists.
@@ -168,8 +195,7 @@ bool partition_info::set_up_default_part
     goto end;
   }
   if (unlikely((!(default_name= create_default_partition_names(0, no_parts,
-                                                               start_no,
-                                                               FALSE)))))
+                                                               start_no)))))
     goto end;
   i= 0;
   do
@@ -239,18 +265,17 @@ bool partition_info::set_up_default_subp
   {
     part_elem= part_it++;
     j= 0;
-    name_ptr= create_default_partition_names(i, no_subparts, (uint)0, TRUE);
-    if (unlikely(!name_ptr))
-      goto end;
     do
     {
       partition_element *subpart_elem= new partition_element();
       if (likely(subpart_elem != 0 &&
           (!part_elem->subpartitions.push_back(subpart_elem))))
       {
+        char *ptr= create_subpartition_name(j, part_elem->partition_name);
+        if (!ptr)
+          goto end;
         subpart_elem->engine_type= default_engine_type;
-        subpart_elem->partition_name= name_ptr;
-        name_ptr+= MAX_PART_NAME_SIZE;
+        subpart_elem->partition_name= ptr;
       }
       else
       {

--- 1.2/plugin/Makefile.am	2006-04-12 05:08:11 -07:00
+++ 1.3/plugin/Makefile.am	2006-04-24 13:36:08 -07:00
@@ -1,6 +1,27 @@
-SUBDIRS= fulltext
+# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-# extra plugin example files are listed here, to
-# keep its Makefile.am cleaner as a template
-EXTRA_DIST= fulltext/configure.in
+# Process this file with automake to create Makefile.in
 
+AUTOMAKE_OPTIONS =	foreign
+
+# These are built from source in the Docs directory
+EXTRA_DIST =	fulltext/configure.in	
+SUBDIRS =	
+DIST_SUBDIRS = . fulltext
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%

--- 1.57/BUILD/SETUP.sh	2006-04-19 18:22:28 -07:00
+++ 1.58/BUILD/SETUP.sh	2006-04-24 13:28:17 -07:00
@@ -147,18 +147,9 @@ static_link="$static_link --with-client-
 local_infile_configs="--enable-local-infile"
 
 
-max_configs="--with-innodb --with-berkeley-db"
-max_configs="$max_configs --with-archive-storage-engine"
-max_configs="$max_configs --with-big-tables"
-max_configs="$max_configs --with-blackhole-storage-engine"
-max_configs="$max_configs --with-federated-storage-engine"
-max_configs="$max_configs --with-csv-storage-engine"
-max_configs="$max_configs --with-example-storage-engine"
-max_configs="$max_configs --with-partition $SSL_LIBRARY"
-
-max_no_embedded_configs="$max_configs --with-ndbcluster"
-max_no_ndb_configs="$max_configs --without-ndbcluster --with-embedded-server"
-max_configs="$max_configs --with-ndbcluster --with-embedded-server"
+max_no_embedded_configs="$SSL_LIBRARY --with-modules=max"
+max_no_ndb_configs="$SSL_LIBRARY --with-modules=max-no-ndb --with-embedded-server"
+max_configs="$SSL_LIBRARY --with-modules=max --with-embedded-server"
 
 #
 # CPU and platform specific compilation flags.

--- 1.47/sql/ha_ndbcluster_binlog.cc	2006-04-21 09:27:53 -07:00
+++ 1.48/sql/ha_ndbcluster_binlog.cc	2006-04-24 13:28:18 -07:00
@@ -16,6 +16,7 @@
 */
 
 #include "mysql_priv.h"
+#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
 #include "ha_ndbcluster.h"
 
 #ifdef HAVE_NDB_BINLOG
@@ -3648,3 +3649,4 @@ ndbcluster_show_status_binlog(THD* thd, 
 }
 
 #endif /* HAVE_NDB_BINLOG */
+#endif
Thread
bk commit into 5.1 tree (acurtis:1.2361)antony24 Apr