Commit dc6e3cf5 authored by gluh@gluh.mysql.r18.ru's avatar gluh@gluh.mysql.r18.ru

Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0

into gluh.mysql.r18.ru:/home/gluh/MySQL/mysql-5.0
parents 15273035 72edcd51
......@@ -3,7 +3,7 @@
# Script to create Solaris packages
#
$INTERACTIVE= 0;
$hostname= `hostname`;
chomp ($hostname= `hostname`);
$find = "/usr/bin/find";
$pkgproto = "/usr/bin/pkgproto";
$pkgmk = "/usr/bin/pkgmk -o";
......@@ -75,7 +75,7 @@ $os =~ '\.';
$os = "sol$'";
chomp $os;
$default{"basedir"}= "/usr/local";
$default{"packagename"}= $fullname . '.pkg';
$default{"packagename"}= "${fullname}.pkg";
# Check for correctness of guessed values by userinput
......@@ -136,6 +136,8 @@ system ("gzip /tmp/$packagename");
# Clean-up the spool area
system ("(cd /var/spool/pkg; rm -rf $pkg)");
# Clean-up the ~/packaging/ area
system ("(rm -rf mysql*)");
unlink $pkginfo;
unlink $prototype;
system ("mv /tmp/${packagename}.gz $pkgdir");
......
......@@ -81,6 +81,7 @@ dtype_get_at_most_n_mbchars(
ulint data_len,
const char* str)
{
#ifndef UNIV_HOTBACKUP
ut_a(data_len != UNIV_SQL_NULL);
if (dtype_str_needs_mysql_cmp(dtype)) {
......@@ -99,6 +100,12 @@ dtype_get_at_most_n_mbchars(
}
return(data_len);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
/*************************************************************************
......
......@@ -53,6 +53,7 @@ rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve
/* Identifies generated InnoDB foreign key names */
static char dict_ibfk[] = "_ibfk_";
#ifndef UNIV_HOTBACKUP
/**********************************************************************
Compares NUL-terminated UTF-8 strings case insensitively.
......@@ -76,6 +77,7 @@ void
innobase_casedn_str(
/*================*/
char* a); /* in/out: string to put in lower case */
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Adds a column to the data dictionary hash table. */
......@@ -2095,6 +2097,7 @@ dict_foreign_find_index(
dict_index_t* types_idx)/* in: NULL or an index to whose types the
column types must match */
{
#ifndef UNIV_HOTBACKUP
dict_index_t* index;
const char* col_name;
ulint i;
......@@ -2139,6 +2142,12 @@ dict_foreign_find_index(
}
return(NULL);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
/**************************************************************************
......@@ -2492,6 +2501,7 @@ dict_scan_col(
const char** name) /* out,own: the column name; NULL if no name
was scannable */
{
#ifndef UNIV_HOTBACKUP
dict_col_t* col;
ulint i;
......@@ -2525,6 +2535,12 @@ dict_scan_col(
}
return(ptr);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
/*************************************************************************
......@@ -2542,6 +2558,7 @@ dict_scan_table_name(
const char** ref_name)/* out,own: the table name;
NULL if no name was scannable */
{
#ifndef UNIV_HOTBACKUP
const char* database_name = NULL;
ulint database_name_len = 0;
const char* table_name = NULL;
......@@ -2623,6 +2640,12 @@ dict_scan_table_name(
*table = dict_table_get_low(ref);
return(ptr);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
/*************************************************************************
......
......@@ -8,7 +8,9 @@ Created 4/24/1996 Heikki Tuuri
*******************************************************/
#include "dict0load.h"
#ifndef UNIV_HOTBACKUP
#include "mysql_version.h"
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_NONINL
#include "dict0load.ic"
......@@ -792,6 +794,7 @@ dict_load_table(
name, (ulong)mix_len);
}
#ifndef UNIV_HOTBACKUP
#if MYSQL_VERSION_ID < 50003
/* Starting from MySQL 5.0.3, the high-order bit of MIX_LEN is the
"compact format" flag. */
......@@ -807,6 +810,7 @@ dict_load_table(
return(NULL);
}
#endif /* MYSQL_VERSION_ID < 50300 */
#endif /* !UNIV_HOTBACKUP */
ut_a(0 == ut_strcmp("SPACE",
dict_field_get_col(
......
......@@ -273,6 +273,7 @@ dtype_get_fixed_size(
/* out: fixed size, or 0 */
dtype_t* type) /* in: type */
{
#ifndef UNIV_HOTBACKUP
ulint mtype;
mtype = dtype_get_mtype(type);
......@@ -321,6 +322,12 @@ dtype_get_fixed_size(
}
return(0);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
/***************************************************************************
......
......@@ -294,6 +294,12 @@ srv_boot(void);
/*==========*/
/* out: DB_SUCCESS or error code */
/*************************************************************************
Initializes the server. */
void
srv_init(void);
/*==========*/
/*************************************************************************
Frees the OS fast mutex created in srv_boot(). */
void
......
......@@ -53,6 +53,16 @@ srv_parse_log_group_home_dirs(
error */
char* str, /* in: character string */
char*** log_group_home_dirs); /* out, own: log group home dirs */
/*************************************************************************
Adds a slash or a backslash to the end of a string if it is missing
and the string is not empty. */
char*
srv_add_path_separator_if_needed(
/*=============================*/
/* out: string which has the separator if the
string is not empty */
char* str); /* in: null-terminated character string */
/********************************************************************
Starts Innobase and creates a new database if database files
are not found and the user wants. Server parameters are
......
......@@ -17,7 +17,9 @@ Created 9/5/1995 Heikki Tuuri
#include "os0sync.h"
#include "sync0arr.h"
#ifndef UNIV_HOTBACKUP
extern my_bool timed_mutexes;
#endif /* UNIV_HOTBACKUP */
/**********************************************************************
Initializes the synchronization data structures. */
......@@ -475,6 +477,7 @@ struct mutex_struct {
const char* cfile_name;/* File name where mutex created */
ulint cline; /* Line where created */
ulint magic_n;
#ifndef UNIV_HOTBACKUP
ulong count_using; /* count of times mutex used */
ulong count_spin_loop; /* count of spin loops */
ulong count_spin_rounds; /* count of spin rounds */
......@@ -484,6 +487,7 @@ struct mutex_struct {
ulonglong lmax_spent_time; /* mutex os_wait timer msec */
const char* cmutex_name;/* mutex name */
ulint mutex_type;/* 0 - usual mutex 1 - rw_lock mutex */
#endif /* !UNIV_HOTBACKUP */
};
#define MUTEX_MAGIC_N (ulint)979585
......
......@@ -250,7 +250,9 @@ mutex_enter_func(
/* Note that we do not peek at the value of lock_word before trying
the atomic test_and_set; we could peek, and possibly save time. */
#ifndef UNIV_HOTBACKUP
mutex->count_using++;
#endif /* UNIV_HOTBACKUP */
if (!mutex_test_and_set(mutex))
{
......
......@@ -173,10 +173,10 @@ their transaction objects for a recovery. */
int
trx_recover_for_mysql(
/*=================*/
/*==================*/
/* out: number of prepared transactions */
XID* xid_list, /* in/out: prepared transactions */
uint len); /* in: number of slots in xid_list */
ulint len); /* in: number of slots in xid_list */
/***********************************************************************
This function is used to commit one X/Open XA distributed transaction
......
......@@ -694,7 +694,7 @@ lock_is_table_exclusive(
trx_t* trx) /* in: transaction */
{
lock_t* lock;
bool ok = FALSE;
ibool ok = FALSE;
ut_ad(table && trx);
......@@ -4219,7 +4219,8 @@ lock_get_n_rec_locks(void)
return(n_locks);
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Prints info of locks for all transactions. */
......@@ -4743,7 +4744,7 @@ lock_validate(void)
return(TRUE);
}
#endif /* !UNIV_HOTBACKUP */
/*============ RECORD LOCK CHECKS FOR ROW OPERATIONS ====================*/
/*************************************************************************
......
......@@ -1546,6 +1546,7 @@ row_ins_scan_sec_index_for_duplicate(
dtuple_t* entry, /* in: index entry */
que_thr_t* thr) /* in: query thread */
{
#ifndef UNIV_HOTBACKUP
ulint n_unique;
ulint i;
int cmp;
......@@ -1662,6 +1663,12 @@ next_rec:
dtuple_set_n_fields_cmp(entry, n_fields_cmp);
return(err);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
/*******************************************************************
......@@ -1681,6 +1688,7 @@ row_ins_duplicate_error_in_clust(
que_thr_t* thr, /* in: query thread */
mtr_t* mtr) /* in: mtr */
{
#ifndef UNIV_HOTBACKUP
ulint err;
rec_t* rec;
page_t* page;
......@@ -1801,6 +1809,12 @@ row_ins_duplicate_error_in_clust(
err = DB_SUCCESS;
func_exit:
return(err);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
/*******************************************************************
......
......@@ -260,6 +260,7 @@ row_mysql_handle_errors(
que_thr_t* thr, /* in: query thread */
trx_savept_t* savept) /* in: savepoint or NULL */
{
#ifndef UNIV_HOTBACKUP
ulint err;
handle_new_error:
......@@ -359,6 +360,12 @@ handle_new_error:
trx->error_state = DB_SUCCESS;
return(FALSE);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
/************************************************************************
......@@ -2072,6 +2079,7 @@ row_add_table_to_background_drop_list(
return(TRUE);
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Discards the tablespace of a table which stored in an .ibd file. Discarding
means that this function deletes the .ibd file and assigns a new table id for
......@@ -2692,6 +2700,7 @@ funct_exit:
return((int) err);
}
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Drops a table for MySQL. If the name of the table to be dropped is equal
......@@ -3088,7 +3097,9 @@ funct_exit:
trx->op_info = "";
#ifndef UNIV_HOTBACKUP
srv_wake_master_thread();
#endif /* !UNIV_HOTBACKUP */
return((int) err);
}
......
......@@ -848,7 +848,7 @@ srv_get_thread_type(void)
/*************************************************************************
Initializes the server. */
static
void
srv_init(void)
/*==========*/
......@@ -1310,6 +1310,7 @@ srv_boot(void)
return(DB_SUCCESS);
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Reserves a slot in the thread table for the current MySQL OS thread.
NOTE! The kernel mutex has to be reserved by the caller! */
......@@ -1368,6 +1369,7 @@ srv_table_reserve_slot_for_mysql(void)
return(slot);
}
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
Puts a MySQL OS thread to wait for a lock to be released. If an error
......@@ -1382,6 +1384,7 @@ srv_suspend_mysql_thread(
que_thr_t* thr) /* in: query thread associated with the MySQL
OS thread */
{
#ifndef UNIV_HOTBACKUP
srv_slot_t* slot;
os_event_t event;
double wait_time;
......@@ -1520,6 +1523,12 @@ srv_suspend_mysql_thread(
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
}
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
/************************************************************************
......@@ -1532,6 +1541,7 @@ srv_release_mysql_thread_if_suspended(
que_thr_t* thr) /* in: query thread associated with the
MySQL OS thread */
{
#ifndef UNIV_HOTBACKUP
srv_slot_t* slot;
ulint i;
......@@ -1553,8 +1563,15 @@ srv_release_mysql_thread_if_suspended(
}
/* not found */
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
#ifndef UNIV_HOTBACKUP
/**********************************************************************
Refreshes the values used to calculate per-second averages. */
static
......@@ -2576,3 +2593,4 @@ suspend_thread:
return(0);
#endif
}
#endif /* !UNIV_HOTBACKUP */
......@@ -479,7 +479,6 @@ srv_normalize_path_for_win(
Adds a slash or a backslash to the end of a string if it is missing
and the string is not empty. */
static
char*
srv_add_path_separator_if_needed(
/*=============================*/
......@@ -531,6 +530,7 @@ srv_calc_high32(
return(file_size >> (32 - UNIV_PAGE_SIZE_SHIFT));
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Creates or opens the log files and closes them. */
static
......@@ -1834,4 +1834,5 @@ void set_panic_flag_for_netware()
extern ibool panic_shutdown;
panic_shutdown = TRUE;
}
#endif
#endif /* __NETWARE__ */
#endif /* !UNIV_HOTBACKUP */
......@@ -102,8 +102,10 @@ rw_lock_create_func(
lock->mutex.cfile_name = cfile_name;
lock->mutex.cline = cline;
#ifndef UNIV_HOTBACKUP
lock->mutex.cmutex_name = cmutex_name;
lock->mutex.mutex_type = 1;
#endif /* !UNIV_HOTBACKUP */
rw_lock_set_waiters(lock, 0);
rw_lock_set_writer(lock, RW_LOCK_NOT_LOCKED);
......
......@@ -215,6 +215,7 @@ mutex_create_func(
mutex->level = SYNC_LEVEL_NONE;
mutex->cfile_name = cfile_name;
mutex->cline = cline;
#ifndef UNIV_HOTBACKUP
mutex->cmutex_name= cmutex_name;
mutex->count_using= 0;
mutex->mutex_type= 0;
......@@ -224,7 +225,7 @@ mutex_create_func(
mutex->count_spin_rounds= 0;
mutex->count_os_wait= 0;
mutex->count_os_yield= 0;
#endif /* !UNIV_HOTBACKUP */
/* Check that lock_word is aligned; this is important on Intel */
ut_ad(((ulint)(&(mutex->lock_word))) % 4 == 0);
......@@ -372,9 +373,9 @@ mutex_spin_wait(
ulint ltime_diff;
ulint sec;
ulint ms;
#ifndef UNIV_HOTBACKUP
uint timer_started = 0;
#endif /* !UNIV_HOTBACKUP */
ut_ad(mutex);
mutex_loop:
......@@ -388,8 +389,10 @@ mutex_loop:
memory word. */
spin_loop:
#ifndef UNIV_HOTBACKUP
mutex_spin_wait_count++;
mutex->count_spin_loop++;
#endif /* !UNIV_HOTBACKUP */
while (mutex_get_lock_word(mutex) != 0 && i < SYNC_SPIN_ROUNDS)
{
......@@ -403,6 +406,7 @@ spin_loop:
if (i == SYNC_SPIN_ROUNDS)
{
#ifndef UNIV_HOTBACKUP
mutex->count_os_yield++;
if (timed_mutexes == 1 && timer_started==0)
{
......@@ -410,6 +414,7 @@ spin_loop:
lstart_time= (ib_longlong)sec * 1000000 + ms;
timer_started = 1;
}
#endif /* !UNIV_HOTBACKUP */
os_thread_yield();
}
......@@ -422,7 +427,9 @@ spin_loop:
mutex_spin_round_count += i;
#ifndef UNIV_HOTBACKUP
mutex->count_spin_rounds += i;
#endif /* !UNIV_HOTBACKUP */
if (mutex_test_and_set(mutex) == 0)
{
......@@ -504,8 +511,8 @@ Now there is no risk of infinite wait on the event. */
mutex_system_call_count++;
mutex_os_wait_count++;
#ifndef UNIV_HOTBACKUP
mutex->count_os_wait++;
/*
!!!!! Sometimes os_wait can be called without os_thread_yield
*/
......@@ -516,12 +523,13 @@ Now there is no risk of infinite wait on the event. */
lstart_time= (ib_longlong)sec * 1000000 + ms;
timer_started = 1;
}
#endif /* !UNIV_HOTBACKUP */
sync_array_wait_event(sync_primary_wait_array, index);
goto mutex_loop;
finish_timing:
#ifndef UNIV_HOTBACKUP
if (timed_mutexes == 1 && timer_started==1)
{
ut_usectime(&sec, &ms);
......@@ -534,6 +542,7 @@ finish_timing:
mutex->lmax_spent_time= ltime_diff;
}
}
#endif /* !UNIV_HOTBACKUP */
return;
}
......
......@@ -52,6 +52,7 @@ trx_general_rollback_for_mysql(
trx_savept_t* savept) /* in: pointer to savepoint undo number, if
partial rollback requested */
{
#ifndef UNIV_HOTBACKUP
mem_heap_t* heap;
que_thr_t* thr;
roll_node_t* roll_node;
......@@ -103,6 +104,12 @@ trx_general_rollback_for_mysql(
srv_active_wake_master_thread();
return((int) trx->error_state);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
/***********************************************************************
......@@ -322,7 +329,7 @@ were set after this savepoint are deleted. */
ulint
trx_release_savepoint_for_mysql(
/*================================*/
/*============================*/
/* out: if no savepoint
of the name found then
DB_NO_SAVEPOINT,
......
......@@ -1844,7 +1844,7 @@ trx_recover_for_mysql(
/* out: number of prepared transactions
stored in xid_list */
XID* xid_list, /* in/out: prepared transactions */
uint len) /* in: number of slots in xid_list */
ulint len) /* in: number of slots in xid_list */
{
trx_t* trx;
int num_of_transactions = 0;
......
......@@ -416,7 +416,11 @@ ut_print_namel(
{
const char* s = name;
const char* e = s + namelen;
#ifdef UNIV_HOTBACKUP
int q = '"';
#else
int q = mysql_get_identifier_quote_char(trx, name, namelen);
#endif
if (q == EOF) {
fwrite(name, 1, namelen, f);
return;
......
......@@ -3669,18 +3669,23 @@ static void ndb_set_fragmentation(NDBTAB &tab, TABLE *form, uint pk_length)
uint no_fragments;
{
#if MYSQL_VERSION_ID >= 50000
uint acc_row_size= 25+2;
uint acc_row_size= 25 + /*safety margin*/ 2;
#else
uint acc_row_size= pk_length*4;
/* add acc overhead */
if (pk_length <= 8)
acc_row_size+= 25+2; /* main page will set the limit */
else
acc_row_size+= 4+4; /* overflow page will set the limit */
if (pk_length <= 8) /* main page will set the limit */
acc_row_size+= 25 + /*safety margin*/ 2;
else /* overflow page will set the limit */
acc_row_size+= 4 + /*safety margin*/ 4;
#endif
ulonglong acc_fragment_size= 512*1024*1024;
ulonglong max_rows= form->s->max_rows;
#if MYSQL_VERSION_ID >= 50100
no_fragments= (max_rows*acc_row_size)/acc_fragment_size+1;
#else
no_fragments= ((max_rows*acc_row_size)/acc_fragment_size+1
+1/*correct rounding*/)/2;
#endif
}
{
uint no_nodes= g_ndb_cluster_connection->no_db_nodes();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment