Commit edfeedb6 authored by unknown's avatar unknown
Browse files

Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-5.1-ndb

into  orca.ndb.mysql.com:/export/home/space/pekka/ndb/version/my51-ndb

parents fe4192c4 7f63e8f2
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -167,9 +167,17 @@ File my_register_filename(File fd, const char *FileName, enum file_type
  else
    my_errno=errno;
  DBUG_PRINT("error",("Got error %d on open",my_errno));
  if (MyFlags & (MY_FFNF | MY_FAE | MY_WME))
  if (MyFlags & (MY_FFNF | MY_FAE | MY_WME)) {
    if (my_errno == EMFILE) {
      DBUG_PRINT("error",("print err: %d",EE_OUT_OF_FILERESOURCES));
      my_error(EE_OUT_OF_FILERESOURCES, MYF(ME_BELL+ME_WAITTANG),
	     FileName, my_errno);
    } else {
      DBUG_PRINT("error",("print err: %d",error_message_number));
      my_error(error_message_number, MYF(ME_BELL+ME_WAITTANG),
	     FileName, my_errno);
    }
  }
  return(fd);
}

+25 −0
Original line number Diff line number Diff line
@@ -4825,10 +4825,18 @@ int ha_ndbcluster::create(const char *name,
  }

  if (info->store_on_disk)
  { 
    if (info->tablespace)
      tab.setTablespace(info->tablespace);
    else
      tab.setTablespace("DEFAULT-TS");
  }
  else if (info->tablespace)
  {
    tab.setTablespace(info->tablespace);
    info->store_on_disk = true;  //if use tablespace, that also means store on disk
  }

  // No primary key, create shadow key as 64 bit, auto increment  
  if (form->s->primary_key == MAX_KEY) 
  {
@@ -6537,6 +6545,23 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
  
  hash_free(&ok_tables);
  hash_free(&ndb_tables);

  // Delete schema file from files
  if (!strcmp(db, NDB_REP_DB))
  {
    uint count = 0;
    while (count++ < files->elements)
    {
      file_name = (char *)files->pop();
      if (!strcmp(file_name, NDB_SCHEMA_TABLE))
      {
        DBUG_PRINT("info", ("skip %s.%s table, it should be hidden to user",
                   NDB_REP_DB, NDB_SCHEMA_TABLE));
        continue;
      }
      files->push_back(file_name); 
    }
  }
  } // extra bracket to avoid gcc 2.95.3 warning
  DBUG_RETURN(0);    
}
+12 −0
Original line number Diff line number Diff line
@@ -2973,6 +2973,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
                          ulonglong *decrease_log_space)
{
  int error;
  int ret = 0;
  bool exit_loop= 0;
  LOG_INFO log_info;
  DBUG_ENTER("purge_logs");
@@ -3017,6 +3018,14 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
      *decrease_log_space-= file_size;

    ha_binlog_index_purge_file(current_thd, log_info.log_file_name);
    if (current_thd->query_error) {
      DBUG_PRINT("info",("query error: %d", current_thd->query_error));
      if (my_errno == EMFILE) {
        DBUG_PRINT("info",("my_errno: %d, set ret = LOG_INFO_EMFILE", my_errno));
        ret = LOG_INFO_EMFILE;
        break;
      }
    }

    if (find_next_log(&log_info, 0) || exit_loop)
      break;
@@ -3027,6 +3036,9 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
    the log index file after restart - otherwise, this should be safe
  */
  error= update_log_index(&log_info, need_update_threads);
  if (error == 0) {
    error = ret;
  }

err:
  if (need_mutex)
+2 −0
Original line number Diff line number Diff line
@@ -114,6 +114,8 @@ extern TC_LOG_DUMMY tc_log_dummy;
#define LOG_INFO_MEM -6
#define LOG_INFO_FATAL -7
#define LOG_INFO_IN_USE -8
#define LOG_INFO_EMFILE -9


/* bitmap to SQL_LOG::close() */
#define LOG_CLOSE_INDEX		1
+2 −1
Original line number Diff line number Diff line
@@ -6012,4 +6012,5 @@ ER_WRONG_PARAMETERS_TO_NATIVE_FCT 42000
        eng "Incorrect parameters in the call to native function '%-.64s'"
ER_NATIVE_FCT_NAME_COLLISION
        eng "This function '%-.64s' has the same name as a native function."
ER_BINLOG_PURGE_EMFILE
        eng "Too many files opened, please execute the command again"
Loading