Commit 80915cdf authored by marko's avatar marko

branches/zip: Merge revisions 560:583 from trunk.

parent 927ed2fd
......@@ -4136,11 +4136,6 @@ btr_copy_externally_stored_field(
d_stream.next_in = page + offset;
d_stream.avail_in = zip_size - offset;
/* On other BLOB pages except the first
the BLOB header always is at the page header: */
offset = FIL_PAGE_NEXT;
err = inflate(&d_stream, Z_NO_FLUSH);
switch (err) {
case Z_OK:
......@@ -4181,6 +4176,11 @@ end_of_blob:
}
mtr_commit(&mtr);
/* On other BLOB pages except the first
the BLOB header always is at the page header: */
offset = FIL_PAGE_NEXT;
} else {
byte* blob_header = page + offset;
ulint part_len = btr_blob_get_part_len(
......@@ -4192,11 +4192,6 @@ end_of_blob:
page_no = btr_blob_get_next_page_no(blob_header);
/* On other BLOB pages except the first the BLOB header
always is at the page data start: */
offset = FIL_PAGE_DATA;
mtr_commit(&mtr);
if (page_no == FIL_NULL) {
......@@ -4207,6 +4202,11 @@ end_of_blob:
return(buf);
}
/* On other BLOB pages except the first the BLOB header
always is at the page data start: */
offset = FIL_PAGE_DATA;
ut_a(copied_len < local_len + extern_len);
}
}
......
......@@ -41,12 +41,21 @@ void ut_dbg_panic(void);
/* Stop threads in ut_a(). */
# define UT_DBG_STOP while (0) /* We do not do this on NetWare */
#else /* __NETWARE__ */
/* Flag for indicating that all threads should stop. This will be set
by ut_dbg_assertion_failed(). */
extern ibool ut_dbg_stop_threads;
# if defined(__WIN__) || defined(__INTEL_COMPILER)
# undef UT_DBG_USE_ABORT
# elif defined(__GNUC__) && (__GNUC__ > 2)
# define UT_DBG_USE_ABORT
# endif
# ifndef UT_DBG_USE_ABORT
/* A null pointer that will be dereferenced to trigger a memory trap */
extern ulint* ut_dbg_null_ptr;
# endif
# if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
/* Flag for indicating that all threads should stop. This will be set
by ut_dbg_assertion_failed(). */
extern ibool ut_dbg_stop_threads;
/*****************************************************************
Stop a thread after assertion failure. */
......@@ -56,7 +65,14 @@ ut_dbg_stop_thread(
/*===============*/
const char* file,
ulint line);
# endif
# ifdef UT_DBG_USE_ABORT
/* Abort the execution. */
# define UT_DBG_PANIC abort()
/* Stop threads (null operation) */
# define UT_DBG_STOP while (0)
# else /* UT_DBG_USE_ABORT */
/* Abort the execution. */
# define UT_DBG_PANIC \
if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL
......@@ -65,6 +81,7 @@ ut_dbg_stop_thread(
if (UNIV_UNLIKELY(ut_dbg_stop_threads)) { \
ut_dbg_stop_thread(__FILE__, (ulint) __LINE__); \
} while (0)
# endif /* UT_DBG_USE_ABORT */
#endif /* __NETWARE__ */
/* Abort execution if EXPR does not evaluate to nonzero. */
......
......@@ -29,13 +29,25 @@ typedef struct ib_list_node_struct ib_list_node_t;
typedef struct ib_list_helper_struct ib_list_helper_t;
/********************************************************************
Create a new list. */
Create a new list using mem_alloc. Lists created with this function must be
freed with ib_list_free. */
ib_list_t*
ib_list_create(void);
/*=================*/
/* out: list */
/********************************************************************
Create a new list using the given heap. ib_list_free MUST NOT BE CALLED for
lists created with this function. */
ib_list_t*
ib_list_create_heap(
/*================*/
/* out: list */
mem_heap_t* heap); /* in: memory heap to use */
/********************************************************************
Free a list. */
......@@ -110,6 +122,8 @@ ib_list_get_last(
struct ib_list_struct {
ib_list_node_t* first; /* first node */
ib_list_node_t* last; /* last node */
ibool is_heap_list; /* TRUE if this list was
allocated through a heap */
};
/* A list node. */
......
......@@ -2540,10 +2540,10 @@ do not allow the discard. We also reserve the data dictionary latch. */
}
funct_exit:
row_mysql_unlock_data_dictionary(trx);
trx_commit_for_mysql(trx);
row_mysql_unlock_data_dictionary(trx);
trx->op_info = "";
return((int) err);
......@@ -2673,10 +2673,10 @@ row_import_tablespace_for_mysql(
}
funct_exit:
row_mysql_unlock_data_dictionary(trx);
trx_commit_for_mysql(trx);
row_mysql_unlock_data_dictionary(trx);
trx->op_info = "";
return((int) err);
......@@ -3304,6 +3304,8 @@ fputs(" InnoDB: You are trying to drop table ", stderr);
}
funct_exit:
trx_commit_for_mysql(trx);
if (locked_dictionary) {
row_mysql_unlock_data_dictionary(trx);
}
......@@ -3312,8 +3314,6 @@ funct_exit:
mem_free(dir_path_of_temp_table);
}
trx_commit_for_mysql(trx);
trx->op_info = "";
#ifndef UNIV_HOTBACKUP
......@@ -3392,10 +3392,10 @@ loop:
}
}
row_mysql_unlock_data_dictionary(trx);
trx_commit_for_mysql(trx);
row_mysql_unlock_data_dictionary(trx);
trx->op_info = "";
return(err);
......@@ -3788,6 +3788,8 @@ end:
}
funct_exit:
trx_commit_for_mysql(trx);
if (!recovering_temp_table) {
row_mysql_unlock_data_dictionary(trx);
}
......@@ -3796,8 +3798,6 @@ funct_exit:
mem_heap_free(heap);
}
trx_commit_for_mysql(trx);
trx->op_info = "";
return((int) err);
......
......@@ -2562,9 +2562,6 @@ row_sel_store_mysql_rec(
templ = prebuilt->mysql_template + i;
data = rec_get_nth_field(rec, offsets,
templ->rec_field_no, &len);
if (UNIV_UNLIKELY(rec_offs_nth_extern(offsets,
templ->rec_field_no))) {
......@@ -2584,6 +2581,11 @@ row_sel_store_mysql_rec(
extern_field_heap);
ut_a(len != UNIV_SQL_NULL);
} else {
/* Field is stored in the row. */
data = rec_get_nth_field(rec, offsets,
templ->rec_field_no, &len);
}
if (len != UNIV_SQL_NULL) {
......
......@@ -116,6 +116,37 @@ static int inno_bcmp(register const char *s1, register const char *s2,
#define memcmp(A,B,C) inno_bcmp((A),(B),(C))
#endif
static
char*
srv_parse_megabytes(
/*================*/
/* out: next character in string */
char* str, /* in: string containing a quantity in bytes */
ulint* megs) /* out: the number in megabytes */
{
char* endp;
ulint size;
size = strtoul(str, &endp, 10);
str = endp;
switch (*str) {
case 'G': case 'g':
size *= 1024;
/* fall through */
case 'M': case 'm':
str++;
break;
default:
size /= 1024 * 1024;
break;
}
*megs = size;
return(str);
}
/*************************************************************************
Reads the data files and their sizes from a character string given in
the .cnf file. */
......@@ -140,7 +171,6 @@ srv_parse_data_file_paths_and_sizes(
last file if specified, 0 if not */
{
char* input_str;
char* endp;
char* path;
ulint size;
ulint i = 0;
......@@ -170,18 +200,7 @@ srv_parse_data_file_paths_and_sizes(
str++;
size = strtoul(str, &endp, 10);
str = endp;
if (*str != 'M' && *str != 'G') {
size = size / (1024 * 1024);
} else if (*str == 'G') {
size = size * 1024;
str++;
} else {
str++;
}
str = srv_parse_megabytes(str, &size);
if (0 == memcmp(str, ":autoextend", (sizeof ":autoextend") - 1)) {
......@@ -191,18 +210,7 @@ srv_parse_data_file_paths_and_sizes(
str += (sizeof ":max:") - 1;
size = strtoul(str, &endp, 10);
str = endp;
if (*str != 'M' && *str != 'G') {
size = size / (1024 * 1024);
} else if (*str == 'G') {
size = size * 1024;
str++;
} else {
str++;
}
str = srv_parse_megabytes(str, &size);
}
if (*str != '\0') {
......@@ -275,18 +283,7 @@ srv_parse_data_file_paths_and_sizes(
str++;
}
size = strtoul(str, &endp, 10);
str = endp;
if ((*str != 'M') && (*str != 'G')) {
size = size / (1024 * 1024);
} else if (*str == 'G') {
size = size * 1024;
str++;
} else {
str++;
}
str = srv_parse_megabytes(str, &size);
(*data_file_names)[i] = path;
(*data_file_sizes)[i] = size;
......@@ -301,20 +298,8 @@ srv_parse_data_file_paths_and_sizes(
str += (sizeof ":max:") - 1;
size = strtoul(str, &endp, 10);
str = endp;
if (*str != 'M' && *str != 'G') {
size = size / (1024 * 1024);
} else if (*str == 'G') {
size = size * 1024;
str++;
} else {
str++;
}
*max_auto_extend_size = size;
str = srv_parse_megabytes(str,
max_auto_extend_size);
}
if (*str != '\0') {
......
......@@ -14,19 +14,21 @@ Created 1/30/1994 Heikki Tuuri
ulint ut_dbg_zero = 0;
#endif
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
/* If this is set to TRUE all threads will stop into the next assertion
and assert */
ibool ut_dbg_stop_threads = FALSE;
#endif
#ifdef __NETWARE__
ibool panic_shutdown = FALSE; /* This is set to TRUE when on NetWare there
happens an InnoDB assertion failure or other
fatal error condition that requires an
immediate shutdown. */
#else /* __NETWARE__ */
#elif !defined(UT_DBG_USE_ABORT)
/* Null pointer used to generate memory trap */
ulint* ut_dbg_null_ptr = NULL;
#endif /* __NETWARE__ */
#endif
/*****************************************************************
Report a failed assertion. */
......@@ -56,7 +58,9 @@ ut_dbg_assertion_failed(
"InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
ut_dbg_stop_threads = TRUE;
#endif
}
#ifdef __NETWARE__
......@@ -74,6 +78,7 @@ ut_dbg_panic(void)
exit(1);
}
#else /* __NETWARE__ */
# if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
/*****************************************************************
Stop a thread after assertion failure. */
......@@ -87,4 +92,5 @@ ut_dbg_stop_thread(
os_thread_pf(os_thread_get_curr_id()), file, line);
os_thread_sleep(1000000000);
}
# endif
#endif /* __NETWARE__ */
......@@ -15,6 +15,26 @@ ib_list_create(void)
list->first = NULL;
list->last = NULL;
list->is_heap_list = FALSE;
return(list);
}
/********************************************************************
Create a new list using the given heap. ib_list_free MUST NOT BE CALLED for
lists created with this function. */
ib_list_t*
ib_list_create_heap(
/*================*/
/* out: list */
mem_heap_t* heap) /* in: memory heap to use */
{
ib_list_t* list = mem_heap_alloc(heap, sizeof(ib_list_t));
list->first = NULL;
list->last = NULL;
list->is_heap_list = TRUE;
return(list);
}
......@@ -27,6 +47,8 @@ ib_list_free(
/*=========*/
ib_list_t* list) /* in: list */
{
ut_a(!list->is_heap_list);
/* We don't check that the list is empty because it's entirely valid
to e.g. have all the nodes allocated from a single heap that is then
freed after the list itself is freed. */
......
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