List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:May 5 2010 1:14pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3504)
Bug#32902 Bug#43356 Bug#44118 WL#4775
View as plain text  
#At file:///home/msvensson/mysql/7.0-starboard/ based on revid:magnus.blaudd@stripped454-x1l7jgcpyrkw6twt

 3504 Magnus Blåudd	2010-05-05
      WL#4775 SEAGULL: Move ndb_* system variables to ha_ndbcluster
       - Move all ndb specific options and variables out of the
         MySQL Server source code and put them in ha_ndbcluster_* using
         the dynamic plugin variable interface.
       - Backward compatibility fix that will install system variables
         and options for "ndbcluster" in "ndb" namespace(already in 5.5)
       - Show all the ndb_report_thresh* variable also when compiled without
         NDB_BINLOG to keep a consistent "GUI"
       - --ndb-extra-logging used to ++ the value if given more than once,
          ignore that undocmented feature since it's not supported by
          dynamic variables.
       - Reintroduce the documented option --ndb-distribution, it has
          been "lost"
       - Fix Bug#44118 ndb-cluster-connection-pool does not show in
         variable list
       - ndb_basic.test, lists all variables as we now have more(i.e all
          is visible)
       - ndb_optimized_node_selection.test, the error/warning message
         does not contain the plugin name anymore when using pluggable
         variables. Filed as BUG#43356 which was duplicate of BUG#32902
         and it fixed in 5.5.3

    modified:
      mysql-test/suite/ndb/r/ndb_basic.result
      mysql-test/suite/ndb/r/ndb_optimized_node_selection.result
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster.h
      sql/ha_ndbcluster_binlog.cc
      sql/ha_ndbcluster_binlog.h
      sql/ha_ndbcluster_connection.cc
      sql/ha_ndbcluster_connection.h
      sql/mysql_priv.h
      sql/mysqld.cc
      sql/set_var.cc
      sql/slave.cc
      sql/sql_plugin.cc
=== modified file 'mysql-test/suite/ndb/r/ndb_basic.result'
--- a/mysql-test/suite/ndb/r/ndb_basic.result	2010-03-23 08:41:15 +0000
+++ b/mysql-test/suite/ndb/r/ndb_basic.result	2010-05-05 13:14:04 +0000
@@ -26,16 +26,22 @@ Variable_name	Value
 ndb_autoincrement_prefetch_sz	#
 ndb_batch_size	#
 ndb_cache_check_time	#
+ndb_cluster_connection_pool	#
 ndb_connectstring	#
+ndb_distribution	#
 ndb_extra_logging	#
 ndb_force_send	#
 ndb_index_stat_cache_entries	#
 ndb_index_stat_enable	#
 ndb_index_stat_update_freq	#
+ndb_log_bin	#
 ndb_log_binlog_index	#
 ndb_log_empty_epochs	#
+ndb_log_orig	#
 ndb_log_update_as_write	#
 ndb_log_updated_only	#
+ndb_mgmd_host	#
+ndb_nodeid	#
 ndb_optimization_delay	#
 ndb_optimized_node_selection	#
 ndb_report_thresh_binlog_epoch_slip	#
@@ -45,6 +51,8 @@ ndb_table_temporary	#
 ndb_use_copying_alter_table	#
 ndb_use_exact_count	#
 ndb_use_transactions	#
+ndb_wait_connected	#
+ndb_wait_setup	#
 CREATE TABLE t1 (
 pk1 INT NOT NULL PRIMARY KEY,
 attr1 INT NOT NULL,

=== modified file 'mysql-test/suite/ndb/r/ndb_optimized_node_selection.result'
--- a/mysql-test/suite/ndb/r/ndb_optimized_node_selection.result	2008-10-31 14:22:11 +0000
+++ b/mysql-test/suite/ndb/r/ndb_optimized_node_selection.result	2010-05-05 13:14:04 +0000
@@ -12,7 +12,7 @@ Variable_name	Value
 ndb_optimized_node_selection	0
 set session ndb_optimized_node_selection=4;
 Warnings:
-Warning	1292	Truncated incorrect ndb_optimized_node_selection value: '4'
+Warning	1292	Truncated incorrect optimized_node_selection value: '4'
 show variables like 'ndb_optimized_node_selection';
 Variable_name	Value
 ndb_optimized_node_selection	3

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2010-03-10 07:43:06 +0000
+++ b/sql/ha_ndbcluster.cc	2010-05-05 13:14:04 +0000
@@ -51,23 +51,175 @@
 #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)
 #endif
 
-// options from from mysqld.cc
-extern ulong opt_ndb_cache_check_time;
-
 // ndb interface initialization/cleanup
 extern "C" void ndb_init_internal();
 extern "C" void ndb_end_internal();
 
+static const int DEFAULT_PARALLELISM= 0;
 static const ha_rows DEFAULT_AUTO_PREFETCH= 32;
+static const ulong ONE_YEAR_IN_SECONDS= (ulong) 3600L*24L*365L;
 
-const char *ndb_distribution_names[]= {"KEYHASH", "LINHASH", NullS};
-TYPELIB ndb_distribution_typelib= { array_elements(ndb_distribution_names)-1,
-                                    "", ndb_distribution_names, NULL };
-const char *opt_ndb_distribution= ndb_distribution_names[ND_KEYHASH];
-enum ndb_distribution opt_ndb_distribution_id= ND_KEYHASH;
+ulong ndb_extra_logging;
+static ulong opt_ndb_wait_connected;
+extern ulong opt_ndb_wait_setup;
+static ulong ndb_cache_check_time;
+static uint opt_ndb_cluster_connection_pool;
+static char* opt_ndb_connectstring;
+static uint opt_ndb_nodeid;
+
+
+static MYSQL_THDVAR_UINT(
+  autoincrement_prefetch_sz,         /* name */
+  PLUGIN_VAR_RQCMDARG,
+  "Specify number of autoincrement values that are prefetched.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  1,                                 /* default */
+  1,                                 /* min */
+  256,                               /* max */
+  0                                  /* block */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+  force_send,                        /* name */
+  PLUGIN_VAR_OPCMDARG,
+  "Force send of buffers to ndb immediately without waiting for "
+  "other threads.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  1                                  /* default */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+  use_exact_count,                   /* name */
+  PLUGIN_VAR_OPCMDARG,
+  "Use exact records count during query planning and for fast "
+  "select count(*), disable for faster queries.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  0                                  /* default */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+  use_transactions,                  /* name */
+  PLUGIN_VAR_OPCMDARG,
+  "Use transactions for large inserts, if enabled then large "
+  "inserts will be split into several smaller transactions",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  1                                  /* default */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+  use_copying_alter_table,           /* name */
+  PLUGIN_VAR_OPCMDARG,
+  "Force ndbcluster to always copy tables at alter table (should "
+  "only be used if on-line alter table fails).",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  0                                  /* default */
+);
+
+
+static MYSQL_THDVAR_UINT(
+  optimized_node_selection,          /* name */
+  PLUGIN_VAR_OPCMDARG,
+  "Select nodes for transactions in a more optimal way.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  3,                                 /* default */
+  0,                                 /* min */
+  3,                                 /* max */
+  0                                  /* block */
+);
+
+
+static MYSQL_THDVAR_ULONG(
+  batch_size,                        /* name */
+  PLUGIN_VAR_RQCMDARG,
+  "Batch size in bytes.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  32768,                             /* default */
+  0,                                 /* min */
+  ONE_YEAR_IN_SECONDS,               /* max */
+  0                                  /* block */
+);
+
+
+static MYSQL_THDVAR_ULONG(
+  optimization_delay,                /* name */
+  PLUGIN_VAR_RQCMDARG,
+  "For optimize table, specifies the delay in milliseconds "
+  "for each batch of rows sent.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  10,                                /* default */
+  0,                                 /* min */
+  100000,                            /* max */
+  0                                  /* block */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+  index_stat_enable,                 /* name */
+  PLUGIN_VAR_OPCMDARG,
+  "Use ndb index statistics in query optimization.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  FALSE                              /* default */
+);
+
+
+static MYSQL_THDVAR_ULONG(
+  index_stat_cache_entries,          /* name */
+  PLUGIN_VAR_NOCMDARG,
+  "",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  32,                                /* default */
+  0,                                 /* min */
+  ULONG_MAX,                         /* max */
+  0                                  /* block */
+);
+
+
+static MYSQL_THDVAR_ULONG(
+  index_stat_update_freq,            /* name */
+  PLUGIN_VAR_NOCMDARG,
+  "",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  20,                                /* default */
+  0,                                 /* min */
+  ULONG_MAX,                         /* max */
+  0                                  /* block */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+  table_no_logging,                  /* name */
+  PLUGIN_VAR_NOCMDARG,
+  "",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  FALSE                              /* default */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+  table_temporary,                   /* name */
+  PLUGIN_VAR_NOCMDARG,
+  "",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  FALSE                              /* default */
+);
 
-// Default value for parallelism
-static const int parallelism= 0;
 
 /*
   Default value for max number of transactions createable against NDB from
@@ -177,7 +329,6 @@ pthread_mutex_t LOCK_ndb_util_thread;
 pthread_cond_t COND_ndb_util_thread;
 pthread_cond_t COND_ndb_util_ready;
 pthread_handler_t ndb_util_thread_func(void *arg);
-ulong ndb_cache_check_time;
 
 /* Status variables shown with 'show status like 'Ndb%' */
 
@@ -1675,11 +1826,11 @@ int ha_ndbcluster::add_index_handle(THD 
     NDB_INDEX_DATA& d=m_index[index_no];
     delete d.index_stat;
     d.index_stat=NULL;
-    if (thd->variables.ndb_index_stat_enable)
+    if (THDVAR(thd, index_stat_enable))
     {
       d.index_stat=new NdbIndexStat(index);
-      d.index_stat_cache_entries=thd->variables.ndb_index_stat_cache_entries;
-      d.index_stat_update_freq=thd->variables.ndb_index_stat_update_freq;
+      d.index_stat_cache_entries= THDVAR(thd, index_stat_cache_entries);
+      d.index_stat_update_freq= THDVAR(thd, index_stat_update_freq);
       d.index_stat_query_count=0;
       d.index_stat->alloc_cache(d.index_stat_cache_entries);
       DBUG_PRINT("info", ("index %s stat=on cache_entries=%u update_freq=%u",
@@ -3139,7 +3290,7 @@ int ha_ndbcluster::full_table_scan(const
   options.optionsPresent = (NdbScanOperation::ScanOptions::SO_SCANFLAGS |
                             NdbScanOperation::ScanOptions::SO_PARALLEL);
   options.scan_flags = guess_scan_flags(lm, m_table, table->read_set);
-  options.parallel = parallelism;
+  options.parallel= DEFAULT_PARALLELISM;
 
   if (use_set_part_id) {
     assert(m_user_defined_partitioning);
@@ -5195,7 +5346,7 @@ int ha_ndbcluster::info(uint flag)
       thd= current_thd;
     DBUG_PRINT("info", ("HA_STATUS_VARIABLE"));
     if ((flag & HA_STATUS_NO_LOCK) &&
-        !thd->variables.ndb_use_exact_count)
+        !THDVAR(thd, use_exact_count))
     {
       if (thd->lex->sql_command != SQLCOM_SHOW_TABLE_STATUS &&
           thd->lex->sql_command != SQLCOM_SHOW_KEYS)
@@ -5691,17 +5842,17 @@ static void transaction_checks(THD *thd,
     thd_ndb->trans_options|= TNTO_TRANSACTIONS_OFF;
   else if (!thd->transaction.on)
     thd_ndb->trans_options|= TNTO_TRANSACTIONS_OFF;
-  else if (!thd->variables.ndb_use_transactions)
+  else if (!THDVAR(thd, use_transactions))
     thd_ndb->trans_options|= TNTO_TRANSACTIONS_OFF;
-  thd_ndb->m_force_send= thd->variables.ndb_force_send;
+  thd_ndb->m_force_send= THDVAR(thd, force_send);
   if (!thd->slave_thread)
-    thd_ndb->m_batch_size= thd->variables.ndb_batch_size;
+    thd_ndb->m_batch_size= THDVAR(thd, batch_size);
   else
   {
-    thd_ndb->m_batch_size= global_system_variables.ndb_batch_size;
+    thd_ndb->m_batch_size= THDVAR(NULL, batch_size); /* using global value */
     /* Do not use hinted TC selection in slave thread */
-    thd->variables.ndb_optimized_node_selection=
-      global_system_variables.ndb_optimized_node_selection & 1;
+    THDVAR(thd, optimized_node_selection)=
+      THDVAR(NULL, optimized_node_selection) & 1; /* using global value */
   }
 }
 
@@ -5750,9 +5901,9 @@ int ha_ndbcluster::start_statement(THD *
     thd_ndb->trans_options= 0;
 
     DBUG_PRINT("trans",("Possibly starting transaction"));
-    DBUG_PRINT("enter", ("optimized_node_selection: %lu",
-                         thd->variables.ndb_optimized_node_selection));
-    if (!(thd->variables.ndb_optimized_node_selection & 2) ||
+    const uint opti_node_select = THDVAR(thd, optimized_node_selection);
+    DBUG_PRINT("enter", ("optimized_node_selection: %u", opti_node_select));
+    if (!(opti_node_select & 2) ||
         thd->lex->sql_command == SQLCOM_LOAD)
       if (unlikely(!start_transaction(error)))
         DBUG_RETURN(error);
@@ -5808,7 +5959,7 @@ int ha_ndbcluster::init_handler_for_stat
   DBUG_ASSERT(thd_ndb);
 
   // store thread specific data first to set the right context
-  m_autoincrement_prefetch= thd->variables.ndb_autoincrement_prefetch_sz;
+  m_autoincrement_prefetch= THDVAR(thd, autoincrement_prefetch_sz);
   // Start of transaction
   m_rows_changed= 0;
   m_blobs_pending= FALSE;
@@ -6114,8 +6265,8 @@ ha_ndbcluster::start_transaction(int &er
   DBUG_ASSERT(m_thd_ndb->trans == NULL);
 
   transaction_checks(table->in_use, m_thd_ndb);
-  m_thd_ndb->connection->set_optimized_node_selection
-    (table->in_use->variables.ndb_optimized_node_selection & 1);
+  const uint opti_node_select= THDVAR(table->in_use, optimized_node_selection);
+  m_thd_ndb->connection->set_optimized_node_selection(opti_node_select & 1);
   if ((trans= m_thd_ndb->ndb->startTransaction()))
   {
     m_thd_ndb->m_transaction_no_hint_count[trans->getConnectedNodeId()]++;
@@ -6217,7 +6368,7 @@ int ndbcluster_commit(handlerton *hton, 
        * This saves a single roundtrip in the autocommit case
        */
       uint ignore_count= 0;
-      res= execute_commit(thd_ndb, trans, thd->variables.ndb_force_send,
+      res= execute_commit(thd_ndb, trans, THDVAR(thd, force_send),
                           TRUE, &ignore_count);
       if (!res && ignore_count)
       {
@@ -6254,7 +6405,7 @@ int ndbcluster_commit(handlerton *hton, 
       }
     }
     else
-      res= execute_commit(thd_ndb, trans, thd->variables.ndb_force_send, FALSE);
+      res= execute_commit(thd_ndb, trans, THDVAR(thd, force_send), FALSE);
   }
 
   if (res != 0)
@@ -6964,12 +7115,12 @@ int ha_ndbcluster::create(const char *na
   }
   if (!ndb_sys_table)
   {
-    if (thd->variables.ndb_table_temporary)
+    if (THDVAR(thd, table_temporary))
     {
       tab.setTemporary(TRUE);
       tab.setLogging(FALSE);
     }
-    else if (thd->variables.ndb_table_no_logging)
+    else if (THDVAR(thd, table_no_logging))
     {
       tab.setLogging(FALSE);
     }
@@ -8415,7 +8566,7 @@ int ha_ndbcluster::open(const char *name
 int ha_ndbcluster::optimize(THD* thd, HA_CHECK_OPT* check_opt)
 {
   ulong error, stats_error= 0;
-  uint delay= (uint) thd->variables.ndb_optimization_delay;
+  const uint delay= (uint)THDVAR(thd, optimization_delay);
 
   error= ndb_optimize_table(thd, delay);
   stats_error= update_stats(thd, 1);
@@ -9472,7 +9623,7 @@ static int ndb_wait_setup_func_impl(ulon
   DBUG_RETURN((ndb_setup_complete == 1)? 0 : 1);
 }
 
-extern wait_cond_timed_func ndb_wait_setup_func;
+extern int(*ndb_wait_setup_func)(ulong);
 
 extern int ndb_dictionary_is_mysqld;
 extern pthread_mutex_t LOCK_plugin;
@@ -9530,7 +9681,12 @@ static int ndbcluster_init(void *p)
   ndb_init_internal();
 
   /* allocate connection resources and connect to cluster */
-  if (ndbcluster_connect(connect_callback))
+  const uint global_opti_node_select= THDVAR(NULL, optimized_node_selection);
+  if (ndbcluster_connect(connect_callback, opt_ndb_wait_connected,
+                         opt_ndb_cluster_connection_pool,
+                         (global_opti_node_select & 1),
+                         opt_ndb_connectstring,
+                         opt_ndb_nodeid))
   {
     DBUG_PRINT("error", ("Could not initiate connection to cluster"));
     goto ndbcluster_init_error;
@@ -9545,7 +9701,6 @@ static int ndbcluster_init(void *p)
     goto ndbcluster_init_error;
   }
 
-  ndb_cache_check_time = opt_ndb_cache_check_time;
   // Create utility thread
   pthread_t tmp;
   if (pthread_create(&tmp, &connection_attrib, ndb_util_thread_func, 0))
@@ -11198,7 +11353,7 @@ ha_ndbcluster::read_multi_range_first(KE
         if (sorted)
           options.scan_flags|= NdbScanOperation::SF_OrderByFull;
 
-        options.parallel=parallelism;
+        options.parallel= DEFAULT_PARALLELISM;
 
         NdbOperation::GetValueSpec gets[2];
         if (table_share->primary_key == MAX_KEY)
@@ -12148,6 +12303,7 @@ uint32 ha_ndbcluster::calculate_key_hash
   DBUG_RETURN(hash_value);
 }
 
+
 /*
   Set-up auto-partitioning for NDB Cluster
 
@@ -12165,19 +12321,46 @@ uint32 ha_ndbcluster::calculate_key_hash
     and partition by hidden key otherwise.
 */
 
+enum ndb_distribution_enum {
+  NDB_DISTRIBUTION_KEYHASH= 0,
+  NDB_DISTRIBUTION_LINHASH= 1
+};
+static const char* distribution_names[]= { "KEYHASH", "LINHASH", NullS };
+static ulong opt_ndb_distribution;
+static TYPELIB distribution_typelib= {
+  array_elements(distribution_names) - 1,
+  "",
+  distribution_names,
+  NULL
+};
+static MYSQL_SYSVAR_ENUM(
+  distribution,                      /* name */
+  opt_ndb_distribution,              /* var */
+  PLUGIN_VAR_RQCMDARG,
+  "Default distribution for new tables in ndb",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  NDB_DISTRIBUTION_KEYHASH,          /* default */
+  &distribution_typelib              /* typelib */
+);
+
+
 void ha_ndbcluster::set_auto_partitions(partition_info *part_info)
 {
   DBUG_ENTER("ha_ndbcluster::set_auto_partitions");
   part_info->list_of_part_fields= TRUE;
   part_info->part_type= HASH_PARTITION;
-  switch (opt_ndb_distribution_id)
+  switch (opt_ndb_distribution)
   {
-  case ND_KEYHASH:
+  case NDB_DISTRIBUTION_KEYHASH:
     part_info->linear_hash_ind= FALSE;
     break;
-  case ND_LINHASH:
+  case NDB_DISTRIBUTION_LINHASH:
     part_info->linear_hash_ind= TRUE;
     break;
+  default:
+    DBUG_ASSERT(false);
+    break;
   }
   DBUG_VOID_RETURN;
 }
@@ -12430,7 +12613,7 @@ int ha_ndbcluster::check_if_supported_al
   partition_info *part_info= table->part_info;
   const NDBTAB *old_tab= m_table;
 
-  if (thd->variables.ndb_use_copying_alter_table)
+  if (THDVAR(thd, use_copying_alter_table))
   {
     DBUG_PRINT("info", ("On-line alter table disabled"));
     DBUG_RETURN(HA_ALTER_NOT_SUPPORTED);
@@ -13681,6 +13864,272 @@ SHOW_VAR ndb_status_variables_export[]= 
   {NullS, NullS, SHOW_LONG}
 };
 
+
+static MYSQL_SYSVAR_ULONG(
+  cache_check_time,                  /* name */
+  ndb_cache_check_time,              /* var */
+  PLUGIN_VAR_RQCMDARG,
+  "A dedicated thread is created to, at the given "
+  "millisecond interval, invalidate the query cache "
+  "if another MySQL server in the cluster has changed "
+  "the data in the database.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  0,                                 /* default */
+  0,                                 /* min */
+  ONE_YEAR_IN_SECONDS,               /* max */
+  0                                  /* block */
+);
+
+
+static MYSQL_SYSVAR_ULONG(
+  extra_logging,                     /* name */
+  ndb_extra_logging,                 /* var */
+  PLUGIN_VAR_OPCMDARG,
+  "Turn on more logging in the error log.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  1,                                 /* default */
+  0,                                 /* min */
+  0,                                 /* max */
+  0                                  /* block */
+);
+
+
+static MYSQL_SYSVAR_ULONG(
+  wait_connected,                    /* name */
+  opt_ndb_wait_connected,            /* var */
+  PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+  "Time (in seconds) for mysqld to wait for connection "
+  "to cluster management and data nodes.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  0,                                 /* default */
+  0,                                 /* min */
+  ONE_YEAR_IN_SECONDS,               /* max */
+  0                                  /* block */
+);
+
+
+static MYSQL_SYSVAR_ULONG(
+  wait_setup,                        /* name */
+  opt_ndb_wait_setup,                /* var */
+  PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+  "Time (in seconds) for mysqld to wait for setup to "
+  "complete (0 = no wait)",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  15,                                /* default */
+  0,                                 /* min */
+  ONE_YEAR_IN_SECONDS,               /* max */
+  0                                  /* block */
+);
+
+
+static MYSQL_SYSVAR_UINT(
+  cluster_connection_pool,           /* name */
+  opt_ndb_cluster_connection_pool,   /* var */
+  PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+  "Pool of cluster connections to be used by mysql server.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  1,                                 /* default */
+  1,                                 /* min */
+  63,                                /* max */
+  0                                  /* block */
+);
+
+
+ulong opt_ndb_report_thresh_binlog_epoch_slip;
+static MYSQL_SYSVAR_ULONG(
+  report_thresh_binlog_epoch_slip,   /* name */
+  opt_ndb_report_thresh_binlog_epoch_slip,/* var */
+  PLUGIN_VAR_RQCMDARG,
+  "Threshold on number of epochs to be behind before reporting binlog "
+  "status. E.g. 3 means that if the difference between what epoch has "
+  "been received from the storage nodes and what has been applied to "
+  "the binlog is 3 or more, a status message will be sent to the cluster "
+  "log.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  3,                                 /* default */
+  0,                                 /* min */
+  256,                               /* max */
+  0                                  /* block */
+);
+
+
+ulong opt_ndb_report_thresh_binlog_mem_usage;
+static MYSQL_SYSVAR_ULONG(
+  report_thresh_binlog_mem_usage,    /* name */
+  opt_ndb_report_thresh_binlog_mem_usage,/* var */
+  PLUGIN_VAR_RQCMDARG,
+  "Threshold on percentage of free memory before reporting binlog "
+  "status. E.g. 10 means that if amount of available memory for "
+  "receiving binlog data from the storage nodes goes below 10%, "
+  "a status message will be sent to the cluster log.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  10,                                /* default */
+  0,                                 /* min */
+  100,                               /* max */
+  0                                  /* block */
+);
+
+
+my_bool opt_ndb_log_update_as_write;
+static MYSQL_SYSVAR_BOOL(
+  log_update_as_write,               /* name */
+  opt_ndb_log_update_as_write,       /* var */
+  PLUGIN_VAR_OPCMDARG,
+  "For efficiency log only after image as a write event. "
+  "Ignore before image. This may cause compatability problems if "
+  "replicating to other storage engines than ndbcluster.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  1                                  /* default */
+);
+
+
+my_bool opt_ndb_log_updated_only;
+static MYSQL_SYSVAR_BOOL(
+  log_updated_only,                  /* name */
+  opt_ndb_log_updated_only,          /* var */
+  PLUGIN_VAR_OPCMDARG,
+  "For efficiency log only updated columns. Columns are considered "
+  "as \"updated\" even if they are updated with the same value. "
+  "This may cause compatability problems if "
+  "replicating to other storage engines than ndbcluster.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  1                                  /* default */
+);
+
+
+my_bool opt_ndb_log_orig;
+static MYSQL_SYSVAR_BOOL(
+  log_orig,                          /* name */
+  opt_ndb_log_orig,                  /* var */
+  PLUGIN_VAR_OPCMDARG,
+  "Log originating server id and epoch in ndb_binlog_index. Each epoch "
+  "may in this case have multiple rows in ndb_binlog_index, one for "
+  "each originating epoch.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  0                                  /* default */
+);
+
+
+my_bool opt_ndb_log_bin;
+static MYSQL_SYSVAR_BOOL(
+  log_bin,                           /* name */
+  opt_ndb_log_bin,                   /* var */
+  PLUGIN_VAR_OPCMDARG,
+  "Log ndb tables in the binary log. Option only has meaning if "
+  "the binary log has been turned on for the server.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  1                                  /* default */
+);
+
+
+my_bool opt_ndb_log_binlog_index;
+static MYSQL_SYSVAR_BOOL(
+  log_binlog_index,                  /* name */
+  opt_ndb_log_binlog_index,          /* var */
+  PLUGIN_VAR_OPCMDARG,
+  "Insert mapping between epochs and binlog positions into the "
+  "ndb_binlog_index table.",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  1                                  /* default */
+);
+
+
+my_bool opt_ndb_log_empty_epochs;
+static MYSQL_SYSVAR_BOOL(
+  log_empty_epochs,                  /* name */
+  opt_ndb_log_empty_epochs,          /* var */
+  PLUGIN_VAR_OPCMDARG,
+  "",
+  NULL,                              /* check func. */
+  NULL,                              /* update func. */
+  0                                  /* default */
+);
+
+
+static MYSQL_SYSVAR_STR(
+  connectstring,                    /* name */
+  opt_ndb_connectstring,            /* var */
+  PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+  "Connect string for ndbcluster.",
+  NULL,                             /* check func. */
+  NULL,                             /* update func. */
+  NULL                              /* default */
+);
+
+
+static MYSQL_SYSVAR_STR(
+  mgmd_host,                        /* name */
+  opt_ndb_connectstring,                /* var */
+  PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+  "Alias for ndb-connectstring",
+  NULL,                             /* check func. */
+  NULL,                             /* update func. */
+  NULL                              /* default */
+);
+
+
+static MYSQL_SYSVAR_UINT(
+  nodeid,                           /* name */
+  opt_ndb_nodeid,                   /* var */
+  PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+  "Nodeid for this mysqld in the cluster.",
+  NULL,                             /* check func. */
+  NULL,                             /* update func. */
+  0,                                /* default */
+  0,                                /* min */
+  MAX_NODES_ID,                     /* max */
+  0                                 /* block */
+);
+
+
+static struct st_mysql_sys_var* system_variables[]= {
+  MYSQL_SYSVAR(cache_check_time),
+  MYSQL_SYSVAR(extra_logging),
+  MYSQL_SYSVAR(wait_connected),
+  MYSQL_SYSVAR(wait_setup),
+  MYSQL_SYSVAR(cluster_connection_pool),
+  MYSQL_SYSVAR(report_thresh_binlog_mem_usage),
+  MYSQL_SYSVAR(report_thresh_binlog_epoch_slip),
+  MYSQL_SYSVAR(log_update_as_write),
+  MYSQL_SYSVAR(log_updated_only),
+  MYSQL_SYSVAR(log_orig),
+  MYSQL_SYSVAR(distribution),
+  MYSQL_SYSVAR(autoincrement_prefetch_sz),
+  MYSQL_SYSVAR(force_send),
+  MYSQL_SYSVAR(use_exact_count),
+  MYSQL_SYSVAR(use_transactions),
+  MYSQL_SYSVAR(use_copying_alter_table),
+  MYSQL_SYSVAR(optimized_node_selection),
+  MYSQL_SYSVAR(batch_size),
+  MYSQL_SYSVAR(optimization_delay),
+  MYSQL_SYSVAR(index_stat_enable),
+  MYSQL_SYSVAR(index_stat_cache_entries),
+  MYSQL_SYSVAR(index_stat_update_freq),
+  MYSQL_SYSVAR(table_no_logging),
+  MYSQL_SYSVAR(table_temporary),
+  MYSQL_SYSVAR(log_bin),
+  MYSQL_SYSVAR(log_binlog_index),
+  MYSQL_SYSVAR(log_empty_epochs),
+  MYSQL_SYSVAR(connectstring),
+  MYSQL_SYSVAR(mgmd_host),
+  MYSQL_SYSVAR(nodeid),
+
+  NULL
+};
+
+
 struct st_mysql_storage_engine ndbcluster_storage_engine=
 { MYSQL_HANDLERTON_INTERFACE_VERSION };
 
@@ -13704,7 +14153,7 @@ mysql_declare_plugin(ndbcluster)
   NULL,                       /* plugin deinit */
   0x0100,                     /* plugin version */
   ndb_status_variables_export,/* status variables                */
-  NULL,                       /* system variables                */
+  system_variables,           /* system variables */
   NULL                        /* config options                  */
 },
 {

=== modified file 'sql/ha_ndbcluster.h'
--- a/sql/ha_ndbcluster.h	2010-03-01 20:10:49 +0000
+++ b/sql/ha_ndbcluster.h	2010-05-05 13:14:04 +0000
@@ -870,8 +870,6 @@ private:
   int update_stats(THD *thd, bool do_read_stat, bool have_lock= FALSE);
 };
 
-extern SHOW_VAR ndb_status_variables[];
-
 int ndbcluster_discover(THD* thd, const char* dbname, const char* name,
                         const void** frmblob, uint* frmlen);
 int ndbcluster_find_files(THD *thd,const char *db,const char *path,

=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2010-03-24 15:28:16 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2010-05-05 13:14:04 +0000
@@ -39,11 +39,10 @@
 extern my_bool opt_ndb_log_orig;
 extern my_bool opt_ndb_log_bin;
 extern my_bool opt_ndb_log_empty_epochs;
-
 extern my_bool opt_ndb_log_update_as_write;
 extern my_bool opt_ndb_log_updated_only;
-
-extern my_bool ndb_log_binlog_index;
+extern my_bool opt_ndb_log_binlog_index;
+extern ulong ndb_extra_logging;
 
 /*
   defines for cluster replication table names
@@ -58,14 +57,14 @@ static char reptable[]= NDB_REP_TABLE;
   Timeout for syncing schema events between
   mysql servers, and between mysql server and the binlog
 */
-const int opt_ndb_sync_timeout= 120;
+static const int DEFAULT_SYNC_TIMEOUT= 120;
 
 /*
   Flag showing if the ndb injector thread is running, if so == 1
   -1 if it was started but later stopped for some reason
    0 if never started
 */
-int ndb_binlog_thread_running= 0;
+static int ndb_binlog_thread_running= 0;
 /*
   Flag showing if the ndb binlog should be created, if so == TRUE
   FALSE if not
@@ -2111,7 +2110,7 @@ end:
       if (bitmap_is_set(&schema_subscribers, node_id))
         ndbcluster_update_slock(thd, db, table_name);
     }
-    int max_timeout= opt_ndb_sync_timeout;
+    int max_timeout= DEFAULT_SYNC_TIMEOUT;
     (void) pthread_mutex_lock(&ndb_schema_object->mutex);
     if (have_lock_open)
     {
@@ -4667,7 +4666,7 @@ ndbcluster_handle_alter_table(THD *thd, 
   const char *save_proc_info= thd->proc_info;
   thd->proc_info= "Syncing ndb table schema operation and binlog";
   (void) pthread_mutex_lock(&share->mutex);
-  int max_timeout= opt_ndb_sync_timeout;
+  int max_timeout= DEFAULT_SYNC_TIMEOUT;
   while (share->state == NSS_ALTERED)
   {
     struct timespec abstime;
@@ -4737,7 +4736,7 @@ ndbcluster_handle_drop_table(THD *thd, N
   (void) pthread_mutex_lock(&share->mutex);
   safe_mutex_assert_owner(&LOCK_open);
   (void) pthread_mutex_unlock(&LOCK_open);
-  int max_timeout= opt_ndb_sync_timeout;
+  int max_timeout= DEFAULT_SYNC_TIMEOUT;
   while (share->op)
   {
     struct timespec abstime;
@@ -5489,8 +5488,8 @@ enum Binlog_thread_state
   BCCC_restart= 2
 };
 
-extern ulong ndb_report_thresh_binlog_epoch_slip;
-extern ulong ndb_report_thresh_binlog_mem_usage;
+extern ulong opt_ndb_report_thresh_binlog_epoch_slip;
+extern ulong opt_ndb_report_thresh_binlog_mem_usage;
 
 pthread_handler_t ndb_binlog_thread_func(void *arg)
 {
@@ -5874,9 +5873,9 @@ restart_cluster_failure:
       thd->proc_info= "Processing events from schema table";
       g_ndb_log_slave_updates= opt_log_slave_updates;
       s_ndb->
-        setReportThreshEventGCISlip(ndb_report_thresh_binlog_epoch_slip);
+        setReportThreshEventGCISlip(opt_ndb_report_thresh_binlog_epoch_slip);
       s_ndb->
-        setReportThreshEventFreeMem(ndb_report_thresh_binlog_mem_usage);
+        setReportThreshEventFreeMem(opt_ndb_report_thresh_binlog_mem_usage);
       NdbEventOperation *pOp= s_ndb->nextEvent();
       while (pOp != NULL)
       {
@@ -6032,8 +6031,8 @@ restart_cluster_failure:
         /* initialize some variables for this epoch */
         g_ndb_log_slave_updates= opt_log_slave_updates;
         i_ndb->
-          setReportThreshEventGCISlip(ndb_report_thresh_binlog_epoch_slip);
-        i_ndb->setReportThreshEventFreeMem(ndb_report_thresh_binlog_mem_usage);
+          setReportThreshEventGCISlip(opt_ndb_report_thresh_binlog_epoch_slip);
+        i_ndb->setReportThreshEventFreeMem(opt_ndb_report_thresh_binlog_mem_usage);
 
         bzero((char*)&_row, sizeof(_row));
         thd->variables.character_set_client= &my_charset_latin1;
@@ -6259,7 +6258,7 @@ restart_cluster_failure:
           rows->master_log_pos= start.file_pos();
 
           DBUG_PRINT("info", ("COMMIT gci: %lu", (ulong) gci));
-          if (ndb_log_binlog_index)
+          if (opt_ndb_log_binlog_index)
           {
             ndb_add_ndb_binlog_index(thd, rows);
           }

=== modified file 'sql/ha_ndbcluster_binlog.h'
--- a/sql/ha_ndbcluster_binlog.h	2009-10-28 19:11:53 +0000
+++ b/sql/ha_ndbcluster_binlog.h	2010-05-05 13:14:04 +0000
@@ -26,8 +26,6 @@ typedef NdbDictionary::Event  NDBEVENT;
 
 #define IS_TMP_PREFIX(A) (is_prefix(A, tmp_file_prefix))
 
-extern ulong ndb_extra_logging;
-
 #define INJECTOR_EVENT_LEN 200
 
 #define NDB_INVALID_SCHEMA_OBJECT 241

=== modified file 'sql/ha_ndbcluster_connection.cc'
--- a/sql/ha_ndbcluster_connection.cc	2010-05-04 14:34:54 +0000
+++ b/sql/ha_ndbcluster_connection.cc	2010-05-05 13:14:04 +0000
@@ -27,16 +27,11 @@
 #include <portlib/NdbTick.h>
 #include "ha_ndbcluster_connection.h"
 
-/* options from from mysqld.cc */
-extern "C" const char *opt_ndb_connectstring;
-extern "C" int opt_ndb_nodeid;
-extern ulong opt_ndb_wait_connected;
-
 Ndb* g_ndb= NULL;
 Ndb_cluster_connection* g_ndb_cluster_connection= NULL;
 static Ndb_cluster_connection **g_pool= NULL;
-static ulong g_pool_alloc= 0;
-static ulong g_pool_pos= 0;
+static uint g_pool_alloc= 0;
+static uint g_pool_pos= 0;
 static pthread_mutex_t g_pool_mutex;
 
 /*
@@ -48,7 +43,13 @@ static pthread_mutex_t g_pool_mutex;
 */
 extern int global_flag_skip_waiting_for_clean_cache;
 
-int ndbcluster_connect(int (*connect_callback)(void))
+int
+ndbcluster_connect(int (*connect_callback)(void),
+                   ulong wait_connected,
+                   uint connection_pool_size,
+                   bool optimized_node_select,
+                   const char* connect_string,
+                   uint force_nodeid)
 {
   NDB_TICKS end_time;
 
@@ -59,19 +60,17 @@ int ndbcluster_connect(int (*connect_cal
 #endif
   int res;
   DBUG_ENTER("ndbcluster_connect");
+  DBUG_PRINT("enter", ("connect_string: %s, force_nodeid: %d",
+                       connect_string, force_nodeid));
 
   global_flag_skip_waiting_for_clean_cache= 1;
 
-  // Set connectstring if specified
-  if (opt_ndb_connectstring != 0)
-    DBUG_PRINT("connectstring", ("%s", opt_ndb_connectstring));
-  if ((g_ndb_cluster_connection=
-       new Ndb_cluster_connection(opt_ndb_connectstring, opt_ndb_nodeid)) == 0)
-  {
-    sql_print_error("NDB: failed to allocate global "
-                    "ndb cluster connection object");
-    DBUG_PRINT("error",("Ndb_cluster_connection(%s)",
-                        opt_ndb_connectstring));
+  g_ndb_cluster_connection=
+    new Ndb_cluster_connection(connect_string, force_nodeid);
+  if (!g_ndb_cluster_connection)
+  {
+    sql_print_error("NDB: failed to allocate global ndb cluster connection");
+    DBUG_PRINT("error", ("Ndb_cluster_connection(%s)", connect_string));
     my_errno= HA_ERR_OUT_OF_MEM;
     DBUG_RETURN(-1);
   }
@@ -81,8 +80,7 @@ int ndbcluster_connect(int (*connect_cal
                 mysqld_name, server_id);
     g_ndb_cluster_connection->set_name(buf);
   }
-  g_ndb_cluster_connection->set_optimized_node_selection
-    (global_system_variables.ndb_optimized_node_selection & 1);
+  g_ndb_cluster_connection->set_optimized_node_selection(optimized_node_select);
 
   // Create a Ndb object to open the connection  to NDB
   if ( (g_ndb= new Ndb(g_ndb_cluster_connection, "sys")) == 0 )
@@ -103,7 +101,7 @@ int ndbcluster_connect(int (*connect_cal
   /* Connect to management server */
 
   end_time= NdbTick_CurrentMillisecond();
-  end_time+= 1000 * opt_ndb_wait_connected;
+  end_time+= 1000 * wait_connected;
 
   while ((res= g_ndb_cluster_connection->connect(0,0,0)) == 1)
   {
@@ -115,23 +113,23 @@ int ndbcluster_connect(int (*connect_cal
   }
 
   {
-    g_pool_alloc= opt_ndb_cluster_connection_pool;
+    g_pool_alloc= connection_pool_size;
     g_pool= (Ndb_cluster_connection**)
       my_malloc(g_pool_alloc * sizeof(Ndb_cluster_connection*),
                 MYF(MY_WME | MY_ZEROFILL));
     pthread_mutex_init(&g_pool_mutex,
                        MY_MUTEX_INIT_FAST);
     g_pool[0]= g_ndb_cluster_connection;
-    for (unsigned i= 1; i < g_pool_alloc; i++)
+    for (uint i= 1; i < g_pool_alloc; i++)
     {
       if ((g_pool[i]=
-           new Ndb_cluster_connection(opt_ndb_connectstring,
+           new Ndb_cluster_connection(connect_string,
                                       g_ndb_cluster_connection)) == 0)
       {
         sql_print_error("NDB[%u]: failed to allocate cluster connect object",
                         i);
         DBUG_PRINT("error",("Ndb_cluster_connection[%u](%s)",
-                            i, opt_ndb_connectstring));
+                            i, connect_string));
         DBUG_RETURN(-1);
       }
       {
@@ -140,15 +138,14 @@ int ndbcluster_connect(int (*connect_cal
                     mysqld_name, server_id, i+1);
         g_pool[i]->set_name(buf);
       }
-      g_pool[i]->set_optimized_node_selection
-        (global_system_variables.ndb_optimized_node_selection & 1);
+      g_pool[i]->set_optimized_node_selection(optimized_node_select);
     }
   }
 
   if (res == 0)
   {
     connect_callback();
-    for (unsigned i= 0; i < g_pool_alloc; i++)
+    for (uint i= 0; i < g_pool_alloc; i++)
     {
       int node_id= g_pool[i]->node_id();
       if (node_id == 0)
@@ -194,7 +191,7 @@ int ndbcluster_connect(int (*connect_cal
   }
   else if (res == 1)
   {
-    for (unsigned i= 0; i < g_pool_alloc; i++)
+    for (uint i= 0; i < g_pool_alloc; i++)
     {
       if (g_pool[i]->
           start_connect_thread(i == 0 ? connect_callback :  NULL))
@@ -237,7 +234,7 @@ void ndbcluster_disconnect(void)
     if (g_pool)
     {
       /* first in pool is the main one, wait with release */
-      for (unsigned i= 1; i < g_pool_alloc; i++)
+      for (uint i= 1; i < g_pool_alloc; i++)
       {
         if (g_pool[i])
           delete g_pool[i];
@@ -268,9 +265,8 @@ Ndb_cluster_connection *ndb_get_cluster_
 
 ulonglong ndb_get_latest_trans_gci()
 {
-  unsigned i;
   ulonglong val= *g_ndb_cluster_connection->get_latest_trans_gci();
-  for (i= 1; i < g_pool_alloc; i++)
+  for (uint i= 1; i < g_pool_alloc; i++)
   {
     ulonglong tmp= *g_pool[i]->get_latest_trans_gci();
     if (tmp > val)
@@ -281,8 +277,7 @@ ulonglong ndb_get_latest_trans_gci()
 
 void ndb_set_latest_trans_gci(ulonglong val)
 {
-  unsigned i;
-  for (i= 0; i < g_pool_alloc; i++)
+  for (uint i= 0; i < g_pool_alloc; i++)
   {
     *g_pool[i]->get_latest_trans_gci()= val;
   }
@@ -290,8 +285,7 @@ void ndb_set_latest_trans_gci(ulonglong 
 
 int ndb_has_node_id(uint id)
 {
-  unsigned i;
-  for (i= 0; i < g_pool_alloc; i++)
+  for (uint i= 0; i < g_pool_alloc; i++)
   {
     if (id == g_pool[i]->node_id())
       return 1;

=== modified file 'sql/ha_ndbcluster_connection.h'
--- a/sql/ha_ndbcluster_connection.h	2009-11-08 18:23:30 +0000
+++ b/sql/ha_ndbcluster_connection.h	2010-05-05 13:14:04 +0000
@@ -15,7 +15,11 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 */
-int ndbcluster_connect(int (*connect_callback)(void));
+int ndbcluster_connect(int (*connect_callback)(void),
+                       ulong wait_connected,
+                       uint connection_pool_size,
+                       bool optimized_node_select,
+                       const char* connect_string, uint force_nodeid);
 void ndbcluster_disconnect(void);
 
 Ndb_cluster_connection *ndb_get_cluster_connection();
@@ -23,9 +27,6 @@ ulonglong ndb_get_latest_trans_gci();
 void ndb_set_latest_trans_gci(ulonglong val);
 int ndb_has_node_id(uint id);
 
-/* options from from mysqld.cc */
-extern ulong opt_ndb_cluster_connection_pool;
-
 /* perform random sleep in the range milli_sleep to 2*milli_sleep */
 inline void do_retry_sleep(unsigned milli_sleep)
 {

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2010-03-12 11:56:09 +0000
+++ b/sql/mysql_priv.h	2010-05-05 13:14:04 +0000
@@ -2505,18 +2505,6 @@ inline bool is_user_table(TABLE * table)
   return strncmp(name, tmp_file_prefix, tmp_file_prefix_length);
 }
 
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-/*
-   function type for timed wait on some condition
-   max_seconds
-     0 == no wait
-   returns
-     0  condition true within timeout
-     >0 timeout occurred
-*/ 
-typedef int (*wait_cond_timed_func)(ulong max_seconds);
-#endif
-
 /*
   Some functions that are different in the embedded library and the normal
   server

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-05-04 14:34:54 +0000
+++ b/sql/mysqld.cc	2010-05-05 13:14:04 +0000
@@ -451,27 +451,8 @@ handlerton *myisam_hton;
 handlerton *partition_hton;
 
 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-ulong opt_ndb_cache_check_time, opt_ndb_wait_connected;
-ulong opt_ndb_cluster_connection_pool;
-ulong ndb_extra_logging;
 ulong opt_ndb_wait_setup;
-wait_cond_timed_func ndb_wait_setup_func= 0;
-ulong ndb_report_thresh_binlog_epoch_slip= 0;
-ulong ndb_report_thresh_binlog_mem_usage= 0;
-my_bool ndb_log_binlog_index= FALSE;
-my_bool opt_ndb_log_update_as_write= FALSE;
-my_bool opt_ndb_log_updated_only= FALSE;
-my_bool opt_ndb_log_orig= FALSE;
-my_bool opt_ndb_log_bin= FALSE;
-my_bool opt_ndb_log_empty_epochs= FALSE;
-
-
-extern "C" const char *opt_ndb_connectstring;
-extern "C" ulong opt_ndb_nodeid;
-extern const char *ndb_distribution_names[];
-extern TYPELIB ndb_distribution_typelib;
-extern const char *opt_ndb_distribution;
-extern enum ndb_distribution opt_ndb_distribution_id;
+int(*ndb_wait_setup_func)(ulong)= 0;
 #endif
 my_bool opt_readonly, use_temp_pool, relay_log_purge;
 my_bool opt_sync_frm, opt_allow_suspicious_udfs;
@@ -5660,26 +5641,7 @@ enum options_mysqld
   OPT_ABORT_SLAVE_EVENT_COUNT,
   OPT_LOG_BIN_TRUST_FUNCTION_CREATORS,
   OPT_LOG_BIN_TRUST_FUNCTION_CREATORS_OLD,
-  OPT_ENGINE_CONDITION_PUSHDOWN, OPT_NDB_CONNECTSTRING, 
-  OPT_NDB_USE_EXACT_COUNT, OPT_NDB_USE_TRANSACTIONS,
-  OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
-  OPT_NDB_OPTIMIZED_NODE_SELECTION, OPT_NDB_CACHE_CHECK_TIME,
-  OPT_NDB_BATCH_SIZE,
-  OPT_NDB_OPTIMIZATION_DELAY,
-  OPT_NDB_TABLE_TEMPORARY,
-  OPT_NDB_WAIT_CONNECTED,
-  OPT_NDB_CLUSTER_CONNECTION_POOL,
-  OPT_NDB_WAIT_SETUP,
-  OPT_NDB_MGMD, OPT_NDB_NODEID,
-  OPT_NDB_DISTRIBUTION,
-  OPT_NDB_INDEX_STAT_ENABLE,
-  OPT_NDB_EXTRA_LOGGING,
-  OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
-  OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
-  OPT_NDB_USE_COPYING_ALTER_TABLE,
-  OPT_NDB_LOG_UPDATE_AS_WRITE, OPT_NDB_LOG_UPDATED_ONLY,
-  OPT_NDB_LOG_ORIG, OPT_NDB_LOG_BIN, OPT_NDB_LOG_BINLOG_INDEX,
-  OPT_NDB_LOG_EMPTY_EPOCHS,
+  OPT_ENGINE_CONDITION_PUSHDOWN,
   OPT_SKIP_SAFEMALLOC,
   OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_COMPLETION_TYPE,
   OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
@@ -6219,164 +6181,6 @@ master-ssl",
    "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.",
    (uchar**) &myisam_recover_options_str, (uchar**) &myisam_recover_options_str, 0,
    GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-  {"ndb-connectstring", OPT_NDB_CONNECTSTRING,
-   "Connect string for ndbcluster.",
-   (uchar**) &opt_ndb_connectstring,
-   (uchar**) &opt_ndb_connectstring,
-   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"ndb-mgmd-host", OPT_NDB_MGMD,
-   "same as --ndb-connectstring.",
-   (uchar**) &opt_ndb_connectstring,
-   (uchar**) &opt_ndb_connectstring,
-   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"ndb-nodeid", OPT_NDB_NODEID,
-   "Set node id for this node. Overrides node id specified "
-   "in --ndb-connectstring.",
-   (uchar**) &opt_ndb_nodeid,
-   (uchar**) &opt_ndb_nodeid,
-   0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"ndb-autoincrement-prefetch-sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
-   "Specify number of autoincrement values that are prefetched.",
-   (uchar**) &global_system_variables.ndb_autoincrement_prefetch_sz,
-   (uchar**) &max_system_variables.ndb_autoincrement_prefetch_sz,
-   0, GET_ULONG, REQUIRED_ARG, 1, 1, 65536, 0, 0, 0},
-  {"ndb-force-send", OPT_NDB_FORCE_SEND,
-   "Force send of buffers to ndb immediately without waiting for "
-   "other threads.",
-   (uchar**) &global_system_variables.ndb_force_send,
-   (uchar**) &global_system_variables.ndb_force_send,
-   0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
-  {"ndb_force_send", OPT_NDB_FORCE_SEND,
-   "same as --ndb-force-send.",
-   (uchar**) &global_system_variables.ndb_force_send,
-   (uchar**) &global_system_variables.ndb_force_send,
-   0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
-  {"ndb-extra-logging", OPT_NDB_EXTRA_LOGGING,
-   "Turn on more logging in the error log.",
-   (uchar**) &ndb_extra_logging,
-   (uchar**) &ndb_extra_logging,
-   0, GET_ULONG, OPT_ARG, 1, 0, 0, 0, 0, 0},
-#ifdef HAVE_NDB_BINLOG
-  {"ndb-report-thresh-binlog-epoch-slip", OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
-   "Threshold on number of epochs to be behind before reporting binlog status. "
-   "E.g. 3 means that if the difference between what epoch has been received "
-   "from the storage nodes and what has been applied to the binlog is 3 or more, "
-   "a status message will be sent to the cluster log.",
-   (uchar**) &ndb_report_thresh_binlog_epoch_slip,
-   (uchar**) &ndb_report_thresh_binlog_epoch_slip,
-   0, GET_ULONG, REQUIRED_ARG, 3, 0, 256, 0, 0, 0},
-  {"ndb-report-thresh-binlog-mem-usage", OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
-   "Threshold on percentage of free memory before reporting binlog status. E.g. "
-   "10 means that if amount of available memory for receiving binlog data from "
-   "the storage nodes goes below 10%, "
-   "a status message will be sent to the cluster log.",
-   (uchar**) &ndb_report_thresh_binlog_mem_usage,
-   (uchar**) &ndb_report_thresh_binlog_mem_usage,
-   0, GET_ULONG, REQUIRED_ARG, 10, 0, 100, 0, 0, 0},
-  {"ndb-log-update-as-write", OPT_NDB_LOG_UPDATE_AS_WRITE,
-   "For efficiency log only after image as a write event."
-   "Ignore before image.  This may cause compatability problems if"
-   "replicating to other storage engines than ndbcluster",
-   (uchar**) &opt_ndb_log_update_as_write,
-   (uchar**) &opt_ndb_log_update_as_write,
-   0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
-  {"ndb-log-updated-only", OPT_NDB_LOG_UPDATED_ONLY,
-   "For efficiency log only updated columns. Columns are considered "
-   "as \"updated\" even if they are updated with the same value. "
-   "This may cause compatability problems if"
-   "replicating to other storage engines than ndbcluster",
-   (uchar**) &opt_ndb_log_updated_only,
-   (uchar**) &opt_ndb_log_updated_only,
-   0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
-  {"ndb-log-orig", OPT_NDB_LOG_ORIG,
-   "Log originating server id and epoch in ndb_binlog_index.  Each epoch may in this case have "
-   "multiple rows in ndb_binlog_index, one for each originating epoch.",
-   (uchar**) &opt_ndb_log_orig,
-   (uchar**) &opt_ndb_log_orig,
-   0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
-  {"ndb-log-bin", OPT_NDB_LOG_BIN,
-   "Log ndb tables in the binary log. Option only has meaning if "
-   "the binary log has been turned on for the server.",
-   (uchar**) &opt_ndb_log_bin, (uchar**) &opt_ndb_log_bin,
-   0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
-  {"ndb-log-binlog-index", OPT_NDB_LOG_BINLOG_INDEX,
-   "Insert mapping between epochs and binlog positions into the "
-   "ndb_binlog_index table.",
-   (uchar**) &ndb_log_binlog_index, (uchar**) &ndb_log_binlog_index,
-   0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
-  {"ndb-log-empty-epochs", OPT_NDB_LOG_EMPTY_EPOCHS,
-   "",
-   (uchar**) &opt_ndb_log_empty_epochs,
-   (uchar**) &opt_ndb_log_empty_epochs,
-   0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
-#endif
-  { "ndb-wait-setup", OPT_NDB_WAIT_SETUP,
-    "Time (in seconds) for mysqld to wait for Ndb engine setup to complete",
-    (uchar**) &opt_ndb_wait_setup, (uchar**) &opt_ndb_wait_setup,
-    0, GET_ULONG, REQUIRED_ARG, 15, 0, LONG_TIMEOUT, 0, 0, 0},
-  {"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT,
-   "Use exact records count during query planning and for fast "
-   "select count(*), disable for faster queries.",
-   (uchar**) &global_system_variables.ndb_use_exact_count,
-   (uchar**) &global_system_variables.ndb_use_exact_count,
-   0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
-  {"ndb-use-transactions", OPT_NDB_USE_TRANSACTIONS,
-   "Use transactions for large inserts, if enabled then large "
-   "inserts will be split into several smaller transactions",
-   (uchar**) &global_system_variables.ndb_use_transactions,
-   (uchar**) &global_system_variables.ndb_use_transactions,
-   0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
-  {"ndb_use_transactions", OPT_NDB_USE_TRANSACTIONS,
-   "same as --ndb-use-transactions.",
-   (uchar**) &global_system_variables.ndb_use_transactions,
-   (uchar**) &global_system_variables.ndb_use_transactions,
-   0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
-  {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,
-   "Select nodes for transactions in a more optimal way.",
-   (uchar**) &global_system_variables.ndb_optimized_node_selection,
-   (uchar**) &max_system_variables.ndb_optimized_node_selection,
-   0, GET_ULONG, OPT_ARG, 3, 0, 3, 0, 0, 0},
-  {"ndb-cache-check-time", OPT_NDB_CACHE_CHECK_TIME,
-   "A dedicated thread is created to, at the given millisecons interval, invalidate the query cache if another MySQL server in the cluster has changed the data in the database.",
-   (uchar**) &opt_ndb_cache_check_time, (uchar**) &opt_ndb_cache_check_time, 0, GET_ULONG, REQUIRED_ARG,
-    0, 0, LONG_TIMEOUT, 0, 1, 0},
-  {"ndb-batch-size", OPT_NDB_BATCH_SIZE,
-   "Batch size in bytes.",
-   (uchar**) &global_system_variables.ndb_batch_size,
-   (uchar**) &global_system_variables.ndb_batch_size,
-    0, GET_ULONG, REQUIRED_ARG, 32768, 0, LONG_TIMEOUT, 0, 1, 0},
-  {"ndb-optimization-delay", OPT_NDB_OPTIMIZATION_DELAY,
-   "For optimize table, specifies the delay in milliseconds for each batch of rows sent",
-   (uchar**) &global_system_variables.ndb_optimization_delay,
-   (uchar**) &max_system_variables.ndb_optimization_delay,
-   0, GET_ULONG, REQUIRED_ARG, 10, 0, 100000, 0, 0, 0},
-  {"ndb-table-temporary", OPT_NDB_TABLE_TEMPORARY,
-   "Create tables without persistence to disk",
-   (uchar**) &global_system_variables.ndb_table_temporary,
-   (uchar**) &global_system_variables.ndb_table_temporary,
-   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"ndb-index-stat-enable", OPT_NDB_INDEX_STAT_ENABLE,
-   "Use ndb index statistics in query optimization.",
-   (uchar**) &global_system_variables.ndb_index_stat_enable,
-   (uchar**) &max_system_variables.ndb_index_stat_enable,
-   0, GET_BOOL, OPT_ARG, 0, 0, 1, 0, 0, 0},
-  {"ndb-use-copying-alter-table",
-   OPT_NDB_USE_COPYING_ALTER_TABLE,
-   "Force ndbcluster to always copy tables at alter table (should only be used if on-line alter table fails).",
-   (uchar**) &global_system_variables.ndb_use_copying_alter_table,
-   (uchar**) &global_system_variables.ndb_use_copying_alter_table,
-   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},  
-  { "ndb-wait-connected", OPT_NDB_WAIT_CONNECTED,
-    "Time (in seconds) for mysqld to wait for connection to cluster management and data nodes.",
-    (uchar**) &opt_ndb_wait_connected, (uchar**) &opt_ndb_wait_connected,
-    0, GET_ULONG, REQUIRED_ARG, 0, 0, LONG_TIMEOUT, 0, 0, 0},
-  { "ndb-cluster-connection-pool", OPT_NDB_CLUSTER_CONNECTION_POOL,
-    "Pool of cluster connections to cluster to be used by mysql server.",
-    (uchar**) &opt_ndb_cluster_connection_pool,
-    (uchar**) &opt_ndb_cluster_connection_pool,
-    0, GET_ULONG, REQUIRED_ARG, 1, 1, 63, 0, 0, 0},
-#endif
   {"new", 'n', "Use very new possible 'unsafe' functions.",
    (uchar**) &global_system_variables.new_mode,
    (uchar**) &max_system_variables.new_mode,
@@ -8509,21 +8313,6 @@ mysqld_get_one_option(int optid,
     global_system_variables.tx_isolation= (type-1);
     break;
   }
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-  case OPT_NDB_DISTRIBUTION:
-    int id;
-    id= find_type_or_exit(argument, &ndb_distribution_typelib, opt->name);
-    opt_ndb_distribution_id= (enum ndb_distribution)(id-1);
-    break;
-  case OPT_NDB_EXTRA_LOGGING:
-    if (!argument)
-      ndb_extra_logging++;
-    else if (argument == disabled_my_option)
-      ndb_extra_logging= 0L;
-    else
-      ndb_extra_logging= atoi(argument);
-    break;
-#endif
   case OPT_MYISAM_RECOVER:
   {
     if (!argument)
@@ -9147,17 +8936,6 @@ void refresh_status(THD *thd)
   pthread_mutex_unlock(&LOCK_thread_count);
 }
 
-
-/*****************************************************************************
-  Instantiate variables for missing storage engines
-  This section should go away soon
-*****************************************************************************/
-
-#ifndef WITH_NDBCLUSTER_STORAGE_ENGINE
-ulong ndb_cache_check_time;
-ulong ndb_extra_logging;
-#endif
-
 /*****************************************************************************
   Instantiate templates
 *****************************************************************************/

=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc	2010-05-04 14:34:54 +0000
+++ b/sql/set_var.cc	2010-05-05 13:14:04 +0000
@@ -65,19 +65,6 @@
 
 #include "events.h"
 
-/* WITH_NDBCLUSTER_STORAGE_ENGINE */
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-extern ulong ndb_cache_check_time;
-extern "C" char *opt_ndb_connectstring;
-extern ulong ndb_extra_logging;
-extern ulong ndb_report_thresh_binlog_epoch_slip;
-extern ulong ndb_report_thresh_binlog_mem_usage;
-extern my_bool ndb_log_binlog_index;
-extern my_bool opt_ndb_log_update_as_write;
-extern my_bool opt_ndb_log_updated_only;
-extern my_bool opt_ndb_log_empty_epochs;
-#endif
-
 extern CHARSET_INFO *character_set_filesystem;
 
 
@@ -705,61 +692,6 @@ static sys_var_thd_bool
 sys_engine_condition_pushdown(&vars, "engine_condition_pushdown",
 			      &SV::engine_condition_pushdown);
 
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-/* ndb thread specific variable settings */
-static sys_var_thd_ulong
-sys_ndb_autoincrement_prefetch_sz(&vars, "ndb_autoincrement_prefetch_sz",
-				  &SV::ndb_autoincrement_prefetch_sz);
-static sys_var_thd_bool
-sys_ndb_force_send(&vars, "ndb_force_send", &SV::ndb_force_send);
-static sys_var_long_ptr
-sys_ndb_report_thresh_binlog_epoch_slip(&vars, "ndb_report_thresh_binlog_epoch_slip",
-                                        &ndb_report_thresh_binlog_epoch_slip);
-static sys_var_long_ptr
-sys_ndb_report_thresh_binlog_mem_usage(&vars, "ndb_report_thresh_binlog_mem_usage",
-                                       &ndb_report_thresh_binlog_mem_usage);
-static sys_var_bool_ptr
-sys_ndb_log_binlog_index(&vars, "ndb_log_binlog_index", &ndb_log_binlog_index);
-static sys_var_bool_ptr
-sys_ndb_log_update_as_write(&vars, "ndb_log_update_as_write", &opt_ndb_log_update_as_write);
-static sys_var_bool_ptr
-sys_ndb_log_updated_only(&vars, "ndb_log_updated_only", &opt_ndb_log_updated_only);
-static sys_var_bool_ptr
-sys_ndb_log_empty_epochs(&vars, "ndb_log_empty_epochs", &opt_ndb_log_empty_epochs);
-static sys_var_thd_bool
-sys_ndb_use_exact_count(&vars, "ndb_use_exact_count", &SV::ndb_use_exact_count);
-static sys_var_thd_bool
-sys_ndb_use_transactions(&vars, "ndb_use_transactions", &SV::ndb_use_transactions);
-static sys_var_thd_ulong
-sys_ndb_optimize_level(&vars, "ndb_optimization_delay", &SV::ndb_optimization_delay);
-static sys_var_thd_bool
-sys_ndb_table_no_logging(&vars, "ndb_table_no_logging", &SV::ndb_table_no_logging);
-static sys_var_thd_bool
-sys_ndb_table_temporary(&vars, "ndb_table_temporary", &SV::ndb_table_temporary);
-static sys_var_thd_ulong
-sys_ndb_batch_size(&vars, "ndb_batch_size", &SV::ndb_batch_size);
-static sys_var_long_ptr
-sys_ndb_cache_check_time(&vars, "ndb_cache_check_time", &ndb_cache_check_time);
-static sys_var_const_str
-sys_ndb_connectstring(&vars, "ndb_connectstring", opt_ndb_connectstring);
-static sys_var_thd_bool
-sys_ndb_index_stat_enable(&vars, "ndb_index_stat_enable",
-                          &SV::ndb_index_stat_enable);
-static sys_var_thd_ulong
-sys_ndb_index_stat_cache_entries(&vars, "ndb_index_stat_cache_entries",
-                                 &SV::ndb_index_stat_cache_entries);
-static sys_var_thd_ulong
-sys_ndb_index_stat_update_freq(&vars, "ndb_index_stat_update_freq",
-                               &SV::ndb_index_stat_update_freq);
-static sys_var_long_ptr
-sys_ndb_extra_logging(&vars, "ndb_extra_logging", &ndb_extra_logging);
-static sys_var_thd_bool
-sys_ndb_use_copying_alter_table(&vars, "ndb_use_copying_alter_table", &SV::ndb_use_copying_alter_table);
-static sys_var_thd_ulong
-sys_ndb_optimized_node_selection(&vars, "ndb_optimized_node_selection",
-                                 &SV::ndb_optimized_node_selection);
-#endif //WITH_NDBCLUSTER_STORAGE_ENGINE
-
 /* Time/date/datetime formats */
 
 static sys_var_thd_date_time_format sys_time_format(&vars, "time_format",

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2010-03-12 10:36:52 +0000
+++ b/sql/slave.cc	2010-05-05 13:14:04 +0000
@@ -3026,7 +3026,7 @@ int check_temp_dir(char* tmp_file)
 }
 
 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-extern wait_cond_timed_func ndb_wait_setup_func;
+extern int(*ndb_wait_setup_func)(ulong);
 extern ulong opt_ndb_wait_setup;
 #endif
 

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2010-03-12 06:06:23 +0000
+++ b/sql/sql_plugin.cc	2010-05-05 13:14:04 +0000
@@ -2986,6 +2986,12 @@ static int construct_options(MEM_ROOT *m
 
   options+= 2;
 
+  if (!my_strcasecmp(&my_charset_latin1, plugin_name_ptr, "NDBCLUSTER"))
+  {
+    plugin_name_ptr= const_cast<char*>("ndb"); // Use legacy "ndb" prefix
+    plugin_name_len= 3;
+  }
+
   /*
     Two passes as the 2nd pass will take pointer addresses for use
     by my_getopt and register_var() in the first pass uses realloc
@@ -3298,18 +3304,27 @@ static int test_plugin_options(MEM_ROOT 
     DBUG_RETURN(1);
   }
 
+  LEX_STRING plugin_name;
+  if (!my_strcasecmp(&my_charset_latin1, tmp->name.str, "NDBCLUSTER"))
+  {
+    plugin_name.str= const_cast<char*>("ndb"); // Use legacy "ndb" prefix
+    plugin_name.length= 3;
+  }
+  else
+    plugin_name= tmp->name;
+
   error= 1;
   for (opt= tmp->plugin->system_vars; opt && *opt; opt++)
   {
     if (((o= *opt)->flags & PLUGIN_VAR_NOSYSVAR))
       continue;
-    if ((var= find_bookmark(tmp->name.str, o->name, o->flags)))
+    if ((var= find_bookmark(plugin_name.str, o->name, o->flags)))
       v= new (mem_root) sys_var_pluginvar(var->key + 1, o);
     else
     {
-      len= tmp->name.length + strlen(o->name) + 2;
+      len= plugin_name.length + strlen(o->name) + 2;
       varname= (char*) alloc_root(mem_root, len);
-      strxmov(varname, tmp->name.str, "-", o->name, NullS);
+      strxmov(varname, plugin_name.str, "-", o->name, NullS);
       my_casedn_str(&my_charset_latin1, varname);
       convert_dash_to_underscore(varname, len-1);
       v= new (mem_root) sys_var_pluginvar(varname, o);

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20100505131404-dc1plqd6dz0pmfpe.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3504)Bug#32902 Bug#43356 Bug#44118 WL#4775Magnus Blåudd5 May