Commit 2be63528 authored by unknown's avatar unknown
Browse files

Merge with 4.1


scripts/mysql_create_system_tables.sh:
  Auto merged
scripts/mysql_fix_privilege_tables.sql:
  Auto merged
sql/set_var.cc:
  Auto merged
support-files/mysql.server.sh:
  Auto merged
sql/ha_ndbcluster.cc:
  Merge
sql/handler.cc:
  Merge
sql/handler.h:
  Merge
sql/mysqld.cc:
  Merge
parents 88538066 9b224e91
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -722,6 +722,7 @@ fi

cat << END_OF_DATA
use mysql;
set table_type=myisam;
$c_d
$i_d

+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@
-- this sql script.
-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'

set table_type=MyISAM;

CREATE TABLE IF NOT EXISTS func (
  name char(64) binary DEFAULT '' NOT NULL,
  ret tinyint(1) DEFAULT '0' NOT NULL,
+23 −5
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@ static handlerton ndbcluster_hton = {

#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8

#define NDB_FAILED_AUTO_INCREMENT ~(Uint64)0
#define NDB_AUTO_INCREMENT_RETRIES 10

#define ERR_PRINT(err) \
  DBUG_PRINT("error", ("%d  message: %s", err.code, err.message))
@@ -1928,7 +1930,15 @@ int ha_ndbcluster::write_row(byte *record)
  {
    // Table has hidden primary key
    Ndb *ndb= get_ndb();
    Uint64 auto_value= ndb->getAutoIncrementValue((const NDBTAB *) m_table);
    Uint64 auto_value= NDB_FAILED_AUTO_INCREMENT;
    uint retries= NDB_AUTO_INCREMENT_RETRIES;
    do {
      auto_value= ndb->getAutoIncrementValue((const NDBTAB *) m_table);
    } while (auto_value == NDB_FAILED_AUTO_INCREMENT && 
             --retries &&
             ndb->getNdbError().status == NdbError::TemporaryError);
    if (auto_value == NDB_FAILED_AUTO_INCREMENT)
      ERR_RETURN(ndb->getNdbError());
    if (set_hidden_key(op, table->s->fields, (const byte*)&auto_value))
      ERR_RETURN(op->getNdbError());
  } 
@@ -4119,10 +4129,18 @@ ulonglong ha_ndbcluster::get_auto_increment()
    : (m_rows_to_insert > m_autoincrement_prefetch) ? 
    m_rows_to_insert 
    : m_autoincrement_prefetch;
  auto_value= NDB_FAILED_AUTO_INCREMENT;
  uint retries= NDB_AUTO_INCREMENT_RETRIES;
  do {
    auto_value=
      (m_skip_auto_increment) ? 
      ndb->readAutoIncrementValue((const NDBTAB *) m_table)
      : ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size);
  } while (auto_value == NDB_FAILED_AUTO_INCREMENT && 
           --retries &&
           ndb->getNdbError().status == NdbError::TemporaryError);
  if (auto_value == NDB_FAILED_AUTO_INCREMENT)
    ERR_RETURN(ndb->getNdbError());
  DBUG_RETURN((longlong)auto_value);
}

+15 −5
Original line number Diff line number Diff line
@@ -149,18 +149,27 @@ const char *ha_get_storage_engine(enum db_type db_type)
  return "none";
}

	/* Use other database handler if databasehandler is not incompiled */

enum db_type ha_checktype(enum db_type database_type)
my_bool ha_storage_engine_is_enabled(enum db_type database_type)
{
  show_table_type_st *types;
  THD *thd= current_thd;
  for (types= sys_table_types; types->type; types++)
  {
    if ((database_type == types->db_type) &&
	(*types->value == SHOW_OPTION_YES))
      return database_type;
      return TRUE;
  }
  return FALSE;
}


	/* Use other database handler if databasehandler is not incompiled */

enum db_type ha_checktype(enum db_type database_type)
{
  THD *thd;
  if (ha_storage_engine_is_enabled(database_type))
    return database_type;

  switch (database_type) {
#ifndef NO_HASH
@@ -173,6 +182,7 @@ enum db_type ha_checktype(enum db_type database_type)
    break;
  }
  
  thd= current_thd;
  return ((enum db_type) thd->variables.table_type != DB_TYPE_UNKNOWN ?
          (enum db_type) thd->variables.table_type :
          (enum db_type) global_system_variables.table_type !=
+1 −0
Original line number Diff line number Diff line
@@ -819,6 +819,7 @@ TYPELIB *ha_known_exts(void);
int ha_panic(enum ha_panic_function flag);
int ha_update_statistics();
void ha_close_connection(THD* thd);
my_bool ha_storage_engine_is_enabled(enum db_type database_type);
bool ha_flush_logs(void);
void ha_drop_database(char* path);
int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
Loading