Fixed compiler warnings in a lot of files
Added IMPOSSIBLE_RESULT to avoid compiler warnings when using (Item_result) -1 as a dummy value Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined client/get_password.c: Fixed compiler warning cmd-line-utils/readline/bind.c: Fixed compiler warning cmd-line-utils/readline/chardefs.h: Fixed compiler warning by adding marco to be used when largest_char is 255 cmd-line-utils/readline/display.c: Fixed compiler warnings by removing not accessed variables cmd-line-utils/readline/histexpand.c: Fixed compiler warnings by removing not accessed variables cmd-line-utils/readline/history.c: Fixed compiler warnings by adding cast cmd-line-utils/readline/text.c: Fixed compiler warnings by removing not accessed variables and adding casts dbug/dbug.c: Fixed compiler warnings by changing types include/mysql_com.h: Added IMPOSSIBLE_RESULT to avoid compiler warnings when using (Item_result) -1 as a dummy value libmysql/libmysql.c: Fixed compiler warning mysql-test/t/query_cache_debug.test: Mark test as BIG as it uses a lot of memory mysys/mf_iocache2.c: Fixed compiler warnings by adding cast sql/event_data_objects.cc: Fixed compiler warnings by removing not used code sql/events.cc: Fixed compiler warnings by removing not used code sql/field.cc: Fixed compiler warnings by adding cast and removed not accessed variables sql/ha_partition.cc: Fixed compiler warnings by removing not used code sql/item.cc: Fixed compiler warnings by removing not accessed variables Use IMPOSSIBLE_RESULT instead of (Item_result)-1 sql/item_cmpfunc.cc: Fixed compiler warnings by removing not accessed variables sql/item_func.cc: Fixed compiler warnings by removing not used code and not accessed variables Added IMPOSSIBLE_RESULT sql/item_subselect.cc: Fixed compiler warnings by removing not accessed variables sql/item_xmlfunc.cc: Fixed forgotten setting of xpath->error sql/log.cc: Fixed compiler warnings by removing not accessed variables sql/log_event.cc: Added IMPOSSIBLE_RESULT into switch Fixed wrong usage of DBUG_ASSERT(1) Removed always true DBUG_ASSERT() sql/mysqld.cc: Fixed compiler warnings by adding casts for ULONG_MAX sql/opt_sum.cc: Fixed compiler warnings by removing not used code Removed wrong DBUG_ASSERT() sql/partition_info.cc: Fixed compiler warnings by removing not accessed variables sql/rpl_injector.h: Removed always true part from DBUG_ASSERT() to remove compiler warning sql/spatial.cc: Fixed compiler warnings by removing not accessed variables sql/sql_acl.cc: Fixed compiler warnings by removing not accessed variables sql/sql_base.cc: Fixed compiler warnings by removing not accessed variables sql/sql_cache.cc: Fixed compiler warnings by removing not accessed variables sql/sql_class.cc: Fixed compiler warnings by: - Removing always true part from DBUG_ASSERT() - Removing not used code - Added IMPOSSIBLE_RESULT into switch sql/sql_load.cc: Fixed compiler warnings by removing not accessed variables sql/sql_parse.cc: Fixed compiler warnings by: - Removing not accessed variables - Removing always true part from DBUG_ASSERT() - Removing not used code sql/sql_plugin.cc: Added comment sql/sql_prepare.cc: Fixed compiler warnings by removing not accessed variables sql/sql_show.cc: Fixed compiler warnings by using correct cast sql/sql_table.cc: Fixed compiler warnings by removing not used code and removing not accessed variables sql/table.cc: Fixed compiler warnings by removing not accessed variables sql/time.cc: Fixed wrong DBUG_ASSERT(1) storage/maria/unittest/Makefile.am: Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined storage/maria/unittest/ma_pagecache_consist.c: Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined storage/maria/unittest/ma_pagecache_single.c: Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined tests/mysql_client_test.c: Fixed compiler warnings by removing not accessed variables and changing types
This commit is contained in:
parent
3056d07a86
commit
8170b22b5c
@ -113,7 +113,7 @@ static void get_password(char *to,uint length,int fd,bool echo)
|
|||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
char tmp;
|
uchar tmp;
|
||||||
if (my_read(fd,&tmp,1,MYF(0)) != 1)
|
if (my_read(fd,&tmp,1,MYF(0)) != 1)
|
||||||
break;
|
break;
|
||||||
if (tmp == '\b' || (int) tmp == 127)
|
if (tmp == '\b' || (int) tmp == 127)
|
||||||
@ -138,7 +138,7 @@ static void get_password(char *to,uint length,int fd,bool echo)
|
|||||||
fputc('*',stderr);
|
fputc('*',stderr);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
}
|
}
|
||||||
*(pos++) = tmp;
|
*(pos++)= (char) tmp;
|
||||||
}
|
}
|
||||||
while (pos != to && isspace(pos[-1]) == ' ')
|
while (pos != to && isspace(pos[-1]) == ' ')
|
||||||
pos--; /* Allow dummy space at end */
|
pos--; /* Allow dummy space at end */
|
||||||
|
@ -701,7 +701,7 @@ rl_function_of_keyseq (keyseq, map, type)
|
|||||||
{
|
{
|
||||||
unsigned char ic = keyseq[i];
|
unsigned char ic = keyseq[i];
|
||||||
|
|
||||||
if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii)
|
if (META_CHAR_FOR_UCHAR(ic) && _rl_convert_meta_chars_to_ascii)
|
||||||
{
|
{
|
||||||
if (map[ESC].type == ISKMAP)
|
if (map[ESC].type == ISKMAP)
|
||||||
{
|
{
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
|
|
||||||
#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
|
#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
|
||||||
#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
|
#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
|
||||||
|
#define META_CHAR_FOR_UCHAR(c) ((c) > meta_character_threshold)
|
||||||
|
|
||||||
#define CTRL(c) ((c) & control_character_mask)
|
#define CTRL(c) ((c) & control_character_mask)
|
||||||
#define META(c) ((c) | meta_character_bit)
|
#define META(c) ((c) | meta_character_bit)
|
||||||
|
@ -191,8 +191,6 @@ static int visible_first_line_len;
|
|||||||
(or is equal to) _rl_screenwidth. */
|
(or is equal to) _rl_screenwidth. */
|
||||||
static int prompt_invis_chars_first_line;
|
static int prompt_invis_chars_first_line;
|
||||||
|
|
||||||
static int prompt_last_screen_line;
|
|
||||||
|
|
||||||
static int prompt_physical_chars;
|
static int prompt_physical_chars;
|
||||||
|
|
||||||
/* Variables to save and restore prompt and display information. */
|
/* Variables to save and restore prompt and display information. */
|
||||||
@ -458,7 +456,7 @@ rl_redisplay ()
|
|||||||
{
|
{
|
||||||
register int in, out, c, linenum, cursor_linenum;
|
register int in, out, c, linenum, cursor_linenum;
|
||||||
register char *line;
|
register char *line;
|
||||||
int inv_botlin, lb_botlin, lb_linenum, o_cpos;
|
int inv_botlin, lb_linenum, o_cpos;
|
||||||
int newlines, lpos, temp, modmark, n0, num;
|
int newlines, lpos, temp, modmark, n0, num;
|
||||||
char *prompt_this_line;
|
char *prompt_this_line;
|
||||||
#if defined (HANDLE_MULTIBYTE)
|
#if defined (HANDLE_MULTIBYTE)
|
||||||
@ -671,11 +669,9 @@ rl_redisplay ()
|
|||||||
lpos -= _rl_screenwidth;
|
lpos -= _rl_screenwidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt_last_screen_line = newlines;
|
|
||||||
|
|
||||||
/* Draw the rest of the line (after the prompt) into invisible_line, keeping
|
/* Draw the rest of the line (after the prompt) into invisible_line, keeping
|
||||||
track of where the cursor is (cpos_buffer_position), the number of the line containing
|
track of where the cursor is (cpos_buffer_position), the number of the line containing
|
||||||
the cursor (lb_linenum), the last line number (lb_botlin and inv_botlin).
|
the cursor (lb_linenum), the last line number (inv_botlin).
|
||||||
It maintains an array of line breaks for display (inv_lbreaks).
|
It maintains an array of line breaks for display (inv_lbreaks).
|
||||||
This handles expanding tabs for display and displaying meta characters. */
|
This handles expanding tabs for display and displaying meta characters. */
|
||||||
lb_linenum = 0;
|
lb_linenum = 0;
|
||||||
@ -858,7 +854,7 @@ rl_redisplay ()
|
|||||||
lb_linenum = newlines;
|
lb_linenum = newlines;
|
||||||
}
|
}
|
||||||
|
|
||||||
inv_botlin = lb_botlin = newlines;
|
inv_botlin = newlines;
|
||||||
CHECK_INV_LBREAKS ();
|
CHECK_INV_LBREAKS ();
|
||||||
inv_lbreaks[newlines+1] = out;
|
inv_lbreaks[newlines+1] = out;
|
||||||
cursor_linenum = lb_linenum;
|
cursor_linenum = lb_linenum;
|
||||||
@ -1888,7 +1884,7 @@ rl_character_len (c, pos)
|
|||||||
|
|
||||||
uc = (unsigned char)c;
|
uc = (unsigned char)c;
|
||||||
|
|
||||||
if (META_CHAR (uc))
|
if (META_CHAR_FOR_UCHAR(uc))
|
||||||
return ((_rl_output_meta_chars == 0) ? 4 : 1);
|
return ((_rl_output_meta_chars == 0) ? 4 : 1);
|
||||||
|
|
||||||
if (uc == '\t')
|
if (uc == '\t')
|
||||||
|
@ -693,7 +693,7 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
|
|||||||
case 's':
|
case 's':
|
||||||
{
|
{
|
||||||
char *new_event;
|
char *new_event;
|
||||||
int delimiter, failed, si, l_temp, ws, we;
|
int delimiter, failed, si, l_temp, we;
|
||||||
|
|
||||||
if (c == 's')
|
if (c == 's')
|
||||||
{
|
{
|
||||||
@ -792,7 +792,6 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
|
|||||||
{
|
{
|
||||||
for (; temp[si] && whitespace (temp[si]); si++)
|
for (; temp[si] && whitespace (temp[si]); si++)
|
||||||
;
|
;
|
||||||
ws = si;
|
|
||||||
we = history_tokenize_word (temp, si);
|
we = history_tokenize_word (temp, si);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ add_history (string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
temp = alloc_history_entry (string, hist_inittime ());
|
temp = alloc_history_entry ((char*) string, hist_inittime ());
|
||||||
|
|
||||||
the_history[history_length] = (HIST_ENTRY *)NULL;
|
the_history[history_length] = (HIST_ENTRY *)NULL;
|
||||||
the_history[history_length - 1] = temp;
|
the_history[history_length - 1] = temp;
|
||||||
|
@ -1169,7 +1169,7 @@ rl_insert_comment (count, key)
|
|||||||
int rl_comment_len;
|
int rl_comment_len;
|
||||||
|
|
||||||
rl_beg_of_line (1, key);
|
rl_beg_of_line (1, key);
|
||||||
rl_comment_text = _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT;
|
rl_comment_text = _rl_comment_begin ? _rl_comment_begin : (char*) RL_COMMENT_BEGIN_DEFAULT;
|
||||||
|
|
||||||
if (rl_explicit_arg == 0)
|
if (rl_explicit_arg == 0)
|
||||||
rl_insert_text (rl_comment_text);
|
rl_insert_text (rl_comment_text);
|
||||||
@ -1386,10 +1386,11 @@ rl_transpose_chars (count, key)
|
|||||||
#if defined (HANDLE_MULTIBYTE)
|
#if defined (HANDLE_MULTIBYTE)
|
||||||
char *dummy;
|
char *dummy;
|
||||||
int i;
|
int i;
|
||||||
|
int prev_point;
|
||||||
#else
|
#else
|
||||||
char dummy[2];
|
char dummy[2];
|
||||||
#endif
|
#endif
|
||||||
int char_length, prev_point;
|
int char_length;
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
return 0;
|
return 0;
|
||||||
@ -1408,7 +1409,9 @@ rl_transpose_chars (count, key)
|
|||||||
count = 1;
|
count = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined (HANDLE_MULTIBYTE)
|
||||||
prev_point = rl_point;
|
prev_point = rl_point;
|
||||||
|
#endif
|
||||||
rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO);
|
rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO);
|
||||||
|
|
||||||
#if defined (HANDLE_MULTIBYTE)
|
#if defined (HANDLE_MULTIBYTE)
|
||||||
|
10
dbug/dbug.c
10
dbug/dbug.c
@ -210,10 +210,10 @@ struct link {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct settings {
|
struct settings {
|
||||||
int flags; /* Current settings flags */
|
uint flags; /* Current settings flags */
|
||||||
int maxdepth; /* Current maximum trace depth */
|
uint maxdepth; /* Current maximum trace depth */
|
||||||
uint delay; /* Delay after each output line */
|
uint delay; /* Delay after each output line */
|
||||||
int sub_level; /* Sub this from code_state->level */
|
uint sub_level; /* Sub this from code_state->level */
|
||||||
FILE *out_file; /* Current output stream */
|
FILE *out_file; /* Current output stream */
|
||||||
FILE *prof_file; /* Current profiling stream */
|
FILE *prof_file; /* Current profiling stream */
|
||||||
char name[FN_REFLEN]; /* Name of output file */
|
char name[FN_REFLEN]; /* Name of output file */
|
||||||
@ -245,7 +245,7 @@ typedef struct _db_code_state_ {
|
|||||||
const char *jmpfunc; /* Remember current function for setjmp */
|
const char *jmpfunc; /* Remember current function for setjmp */
|
||||||
const char *jmpfile; /* Remember current file for setjmp */
|
const char *jmpfile; /* Remember current file for setjmp */
|
||||||
int lineno; /* Current debugger output line number */
|
int lineno; /* Current debugger output line number */
|
||||||
int level; /* Current function nesting level */
|
uint level; /* Current function nesting level */
|
||||||
int jmplevel; /* Remember nesting level at setjmp() */
|
int jmplevel; /* Remember nesting level at setjmp() */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1204,7 +1204,7 @@ void _db_enter_(const char *_func_, const char *_file_,
|
|||||||
void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_)
|
void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_)
|
||||||
{
|
{
|
||||||
int save_errno=errno;
|
int save_errno=errno;
|
||||||
int _slevel_=_stack_frame_->level & ~TRACE_ON;
|
uint _slevel_= _stack_frame_->level & ~TRACE_ON;
|
||||||
CODE_STATE *cs;
|
CODE_STATE *cs;
|
||||||
get_code_state_or_return;
|
get_code_state_or_return;
|
||||||
|
|
||||||
|
@ -373,8 +373,13 @@ struct my_rnd_struct;
|
|||||||
|
|
||||||
/* The following is for user defined functions */
|
/* The following is for user defined functions */
|
||||||
|
|
||||||
enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT,
|
enum Item_result
|
||||||
DECIMAL_RESULT};
|
{
|
||||||
|
STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT
|
||||||
|
#ifdef MYSQL_SERVER
|
||||||
|
,IMPOSSIBLE_RESULT /* Yes, we know this is ugly, don't tell us */
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct st_udf_args
|
typedef struct st_udf_args
|
||||||
{
|
{
|
||||||
|
@ -4375,7 +4375,6 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
|
|||||||
field->max_length= 10; /* 2003-11-11 */
|
field->max_length= 10; /* 2003-11-11 */
|
||||||
param->skip_result= skip_result_with_length;
|
param->skip_result= skip_result_with_length;
|
||||||
break;
|
break;
|
||||||
break;
|
|
||||||
case MYSQL_TYPE_DATETIME:
|
case MYSQL_TYPE_DATETIME:
|
||||||
case MYSQL_TYPE_TIMESTAMP:
|
case MYSQL_TYPE_TIMESTAMP:
|
||||||
param->skip_result= skip_result_with_length;
|
param->skip_result= skip_result_with_length;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
--source include/not_embedded.inc
|
--source include/not_embedded.inc
|
||||||
|
--source include/big_test.inc
|
||||||
--source include/have_query_cache.inc
|
--source include/have_query_cache.inc
|
||||||
--source include/have_debug.inc
|
--source include/have_debug.inc
|
||||||
|
|
||||||
|
@ -420,9 +420,9 @@ process_flags:
|
|||||||
/* minimum width padding */
|
/* minimum width padding */
|
||||||
if (minimum_width > length2)
|
if (minimum_width > length2)
|
||||||
{
|
{
|
||||||
char *buffz;
|
uchar *buffz;
|
||||||
|
|
||||||
buffz= my_alloca(minimum_width - length2);
|
buffz= (uchar*) my_alloca(minimum_width - length2);
|
||||||
if (is_zero_padded)
|
if (is_zero_padded)
|
||||||
memset(buffz, '0', minimum_width - length2);
|
memset(buffz, '0', minimum_width - length2);
|
||||||
else
|
else
|
||||||
|
@ -1246,7 +1246,6 @@ bool get_next_time(const Time_zone *time_zone, my_time_t *next,
|
|||||||
would give an error then.
|
would give an error then.
|
||||||
*/
|
*/
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
break;
|
|
||||||
case INTERVAL_LAST:
|
case INTERVAL_LAST:
|
||||||
DBUG_ASSERT(0);
|
DBUG_ASSERT(0);
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,6 @@ common_1_lev_code:
|
|||||||
case INTERVAL_MICROSECOND:
|
case INTERVAL_MICROSECOND:
|
||||||
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "MICROSECOND");
|
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "MICROSECOND");
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
|
||||||
case INTERVAL_QUARTER:
|
case INTERVAL_QUARTER:
|
||||||
expr/= 3;
|
expr/= 3;
|
||||||
close_quote= FALSE;
|
close_quote= FALSE;
|
||||||
|
10
sql/field.cc
10
sql/field.cc
@ -2951,18 +2951,18 @@ int Field_tiny::store(double nr)
|
|||||||
}
|
}
|
||||||
else if (nr > 255.0)
|
else if (nr > 255.0)
|
||||||
{
|
{
|
||||||
*ptr=(char) 255;
|
*ptr= (uchar) 255;
|
||||||
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
|
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
|
||||||
error= 1;
|
error= 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*ptr=(char) nr;
|
*ptr= (uchar) nr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (nr < -128.0)
|
if (nr < -128.0)
|
||||||
{
|
{
|
||||||
*ptr= (char) -128;
|
*ptr= (uchar) -128;
|
||||||
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
|
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
|
||||||
error= 1;
|
error= 1;
|
||||||
}
|
}
|
||||||
@ -2973,7 +2973,7 @@ int Field_tiny::store(double nr)
|
|||||||
error= 1;
|
error= 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*ptr=(char) (int) nr;
|
*ptr=(uchar) (int) nr;
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@ -5514,7 +5514,6 @@ int Field_date::store(const char *from, uint len,CHARSET_INFO *cs)
|
|||||||
int Field_date::store(double nr)
|
int Field_date::store(double nr)
|
||||||
{
|
{
|
||||||
longlong tmp;
|
longlong tmp;
|
||||||
int error= 0;
|
|
||||||
if (nr >= 19000000000000.0 && nr <= 99991231235959.0)
|
if (nr >= 19000000000000.0 && nr <= 99991231235959.0)
|
||||||
nr=floor(nr/1000000.0); // Timestamp to date
|
nr=floor(nr/1000000.0); // Timestamp to date
|
||||||
if (nr < 0.0 || nr > 99991231.0)
|
if (nr < 0.0 || nr > 99991231.0)
|
||||||
@ -5523,7 +5522,6 @@ int Field_date::store(double nr)
|
|||||||
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
|
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||||
ER_WARN_DATA_OUT_OF_RANGE,
|
ER_WARN_DATA_OUT_OF_RANGE,
|
||||||
nr, MYSQL_TIMESTAMP_DATE);
|
nr, MYSQL_TIMESTAMP_DATE);
|
||||||
error= 1;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
tmp= (longlong) rint(nr);
|
tmp= (longlong) rint(nr);
|
||||||
|
@ -4923,7 +4923,6 @@ int ha_partition::extra(enum ha_extra_function operation)
|
|||||||
/* Category 3), used by MyISAM handlers */
|
/* Category 3), used by MyISAM handlers */
|
||||||
case HA_EXTRA_PREPARE_FOR_RENAME:
|
case HA_EXTRA_PREPARE_FOR_RENAME:
|
||||||
DBUG_RETURN(prepare_for_rename());
|
DBUG_RETURN(prepare_for_rename());
|
||||||
break;
|
|
||||||
case HA_EXTRA_NORMAL:
|
case HA_EXTRA_NORMAL:
|
||||||
case HA_EXTRA_QUICK:
|
case HA_EXTRA_QUICK:
|
||||||
case HA_EXTRA_NO_READCHECK:
|
case HA_EXTRA_NO_READCHECK:
|
||||||
|
@ -254,11 +254,9 @@ my_decimal *Item::val_decimal_from_int(my_decimal *decimal_value)
|
|||||||
my_decimal *Item::val_decimal_from_string(my_decimal *decimal_value)
|
my_decimal *Item::val_decimal_from_string(my_decimal *decimal_value)
|
||||||
{
|
{
|
||||||
String *res;
|
String *res;
|
||||||
char *end_ptr;
|
|
||||||
if (!(res= val_str(&str_value)))
|
if (!(res= val_str(&str_value)))
|
||||||
return 0; // NULL or EOM
|
return 0; // NULL or EOM
|
||||||
|
|
||||||
end_ptr= (char*) res->ptr()+ res->length();
|
|
||||||
if (str2my_decimal(E_DEC_FATAL_ERROR & ~E_DEC_BAD_NUM,
|
if (str2my_decimal(E_DEC_FATAL_ERROR & ~E_DEC_BAD_NUM,
|
||||||
res->ptr(), res->length(), res->charset(),
|
res->ptr(), res->length(), res->charset(),
|
||||||
decimal_value) & E_DEC_BAD_NUM)
|
decimal_value) & E_DEC_BAD_NUM)
|
||||||
@ -382,7 +380,7 @@ Item::Item():
|
|||||||
maybe_null=null_value=with_sum_func=unsigned_flag=0;
|
maybe_null=null_value=with_sum_func=unsigned_flag=0;
|
||||||
decimals= 0; max_length= 0;
|
decimals= 0; max_length= 0;
|
||||||
with_subselect= 0;
|
with_subselect= 0;
|
||||||
cmp_context= (Item_result)-1;
|
cmp_context= IMPOSSIBLE_RESULT;
|
||||||
|
|
||||||
/* Put item in free list so that we can free all items at end */
|
/* Put item in free list so that we can free all items at end */
|
||||||
THD *thd= current_thd;
|
THD *thd= current_thd;
|
||||||
@ -4188,7 +4186,7 @@ Item *Item_field::equal_fields_propagator(uchar *arg)
|
|||||||
DATE/TIME represented as an int and as a string.
|
DATE/TIME represented as an int and as a string.
|
||||||
*/
|
*/
|
||||||
if (!item ||
|
if (!item ||
|
||||||
(cmp_context != (Item_result)-1 && item->cmp_context != cmp_context))
|
(cmp_context != IMPOSSIBLE_RESULT && item->cmp_context != cmp_context))
|
||||||
item= this;
|
item= this;
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
@ -4240,7 +4238,7 @@ Item *Item_field::replace_equal_field(uchar *arg)
|
|||||||
Item *const_item= item_equal->get_const();
|
Item *const_item= item_equal->get_const();
|
||||||
if (const_item)
|
if (const_item)
|
||||||
{
|
{
|
||||||
if (cmp_context != (Item_result)-1 &&
|
if (cmp_context != IMPOSSIBLE_RESULT &&
|
||||||
const_item->cmp_context != cmp_context)
|
const_item->cmp_context != cmp_context)
|
||||||
return this;
|
return this;
|
||||||
return const_item;
|
return const_item;
|
||||||
|
@ -845,12 +845,11 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
|
|||||||
Item **a1, Item **a2,
|
Item **a1, Item **a2,
|
||||||
Item_result type)
|
Item_result type)
|
||||||
{
|
{
|
||||||
enum enum_date_cmp_type cmp_type;
|
|
||||||
ulonglong const_value= (ulonglong)-1;
|
ulonglong const_value= (ulonglong)-1;
|
||||||
a= a1;
|
a= a1;
|
||||||
b= a2;
|
b= a2;
|
||||||
|
|
||||||
if ((cmp_type= can_compare_as_dates(*a, *b, &const_value)))
|
if (can_compare_as_dates(*a, *b, &const_value))
|
||||||
{
|
{
|
||||||
thd= current_thd;
|
thd= current_thd;
|
||||||
owner= owner_arg;
|
owner= owner_arg;
|
||||||
|
@ -450,7 +450,6 @@ Field *Item_func::tmp_table_field(TABLE *table)
|
|||||||
break;
|
break;
|
||||||
case STRING_RESULT:
|
case STRING_RESULT:
|
||||||
return make_string_field(table);
|
return make_string_field(table);
|
||||||
break;
|
|
||||||
case DECIMAL_RESULT:
|
case DECIMAL_RESULT:
|
||||||
field= new Field_new_decimal(my_decimal_precision_to_length(decimal_precision(),
|
field= new Field_new_decimal(my_decimal_precision_to_length(decimal_precision(),
|
||||||
decimals,
|
decimals,
|
||||||
@ -2710,8 +2709,7 @@ longlong Item_func_find_in_set::val_int()
|
|||||||
}
|
}
|
||||||
null_value=0;
|
null_value=0;
|
||||||
|
|
||||||
int diff;
|
if ((int) (buffer->length() - find->length()) >= 0)
|
||||||
if ((diff=buffer->length() - find->length()) >= 0)
|
|
||||||
{
|
{
|
||||||
my_wc_t wc;
|
my_wc_t wc;
|
||||||
CHARSET_INFO *cs= cmp_collation.collation;
|
CHARSET_INFO *cs= cmp_collation.collation;
|
||||||
@ -3973,7 +3971,8 @@ double user_var_entry::val_real(my_bool *null_value)
|
|||||||
case STRING_RESULT:
|
case STRING_RESULT:
|
||||||
return my_atof(value); // This is null terminated
|
return my_atof(value); // This is null terminated
|
||||||
case ROW_RESULT:
|
case ROW_RESULT:
|
||||||
DBUG_ASSERT(1); // Impossible
|
case IMPOSSIBLE_RESULT:
|
||||||
|
DBUG_ASSERT(0); // Impossible
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0.0; // Impossible
|
return 0.0; // Impossible
|
||||||
@ -4004,7 +4003,8 @@ longlong user_var_entry::val_int(my_bool *null_value)
|
|||||||
return my_strtoll10(value, (char**) 0, &error);// String is null terminated
|
return my_strtoll10(value, (char**) 0, &error);// String is null terminated
|
||||||
}
|
}
|
||||||
case ROW_RESULT:
|
case ROW_RESULT:
|
||||||
DBUG_ASSERT(1); // Impossible
|
case IMPOSSIBLE_RESULT:
|
||||||
|
DBUG_ASSERT(0); // Impossible
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return LL(0); // Impossible
|
return LL(0); // Impossible
|
||||||
@ -4035,8 +4035,10 @@ String *user_var_entry::val_str(my_bool *null_value, String *str,
|
|||||||
case STRING_RESULT:
|
case STRING_RESULT:
|
||||||
if (str->copy(value, length, collation.collation))
|
if (str->copy(value, length, collation.collation))
|
||||||
str= 0; // EOM error
|
str= 0; // EOM error
|
||||||
|
break;
|
||||||
case ROW_RESULT:
|
case ROW_RESULT:
|
||||||
DBUG_ASSERT(1); // Impossible
|
case IMPOSSIBLE_RESULT:
|
||||||
|
DBUG_ASSERT(0); // Impossible
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return(str);
|
return(str);
|
||||||
@ -4063,7 +4065,8 @@ my_decimal *user_var_entry::val_decimal(my_bool *null_value, my_decimal *val)
|
|||||||
str2my_decimal(E_DEC_FATAL_ERROR, value, length, collation.collation, val);
|
str2my_decimal(E_DEC_FATAL_ERROR, value, length, collation.collation, val);
|
||||||
break;
|
break;
|
||||||
case ROW_RESULT:
|
case ROW_RESULT:
|
||||||
DBUG_ASSERT(1); // Impossible
|
case IMPOSSIBLE_RESULT:
|
||||||
|
DBUG_ASSERT(0); // Impossible
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return(val);
|
return(val);
|
||||||
|
@ -1021,9 +1021,9 @@ Item_in_subselect::single_value_transformer(JOIN *join,
|
|||||||
SELECT_LEX_UNIT *master_unit= select_lex->master_unit();
|
SELECT_LEX_UNIT *master_unit= select_lex->master_unit();
|
||||||
substitution= optimizer;
|
substitution= optimizer;
|
||||||
|
|
||||||
SELECT_LEX *current= thd->lex->current_select, *up;
|
SELECT_LEX *current= thd->lex->current_select;
|
||||||
|
|
||||||
thd->lex->current_select= up= current->return_after_parsing();
|
thd->lex->current_select= current->return_after_parsing();
|
||||||
//optimizer never use Item **ref => we can pass 0 as parameter
|
//optimizer never use Item **ref => we can pass 0 as parameter
|
||||||
if (!optimizer || optimizer->fix_left(thd, 0))
|
if (!optimizer || optimizer->fix_left(thd, 0))
|
||||||
{
|
{
|
||||||
@ -1244,8 +1244,8 @@ Item_in_subselect::row_value_transformer(JOIN *join)
|
|||||||
SELECT_LEX_UNIT *master_unit= select_lex->master_unit();
|
SELECT_LEX_UNIT *master_unit= select_lex->master_unit();
|
||||||
substitution= optimizer;
|
substitution= optimizer;
|
||||||
|
|
||||||
SELECT_LEX *current= thd->lex->current_select, *up;
|
SELECT_LEX *current= thd->lex->current_select;
|
||||||
thd->lex->current_select= up= current->return_after_parsing();
|
thd->lex->current_select= current->return_after_parsing();
|
||||||
//optimizer never use Item **ref => we can pass 0 as parameter
|
//optimizer never use Item **ref => we can pass 0 as parameter
|
||||||
if (!optimizer || optimizer->fix_left(thd, 0))
|
if (!optimizer || optimizer->fix_left(thd, 0))
|
||||||
{
|
{
|
||||||
@ -1483,7 +1483,7 @@ Item_subselect::trans_res
|
|||||||
Item_in_subselect::select_in_like_transformer(JOIN *join, Comp_creator *func)
|
Item_in_subselect::select_in_like_transformer(JOIN *join, Comp_creator *func)
|
||||||
{
|
{
|
||||||
Query_arena *arena, backup;
|
Query_arena *arena, backup;
|
||||||
SELECT_LEX *current= thd->lex->current_select, *up;
|
SELECT_LEX *current= thd->lex->current_select;
|
||||||
const char *save_where= thd->where;
|
const char *save_where= thd->where;
|
||||||
Item_subselect::trans_res res= RES_ERROR;
|
Item_subselect::trans_res res= RES_ERROR;
|
||||||
bool result;
|
bool result;
|
||||||
@ -1512,7 +1512,7 @@ Item_in_subselect::select_in_like_transformer(JOIN *join, Comp_creator *func)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
thd->lex->current_select= up= current->return_after_parsing();
|
thd->lex->current_select= current->return_after_parsing();
|
||||||
result= (!left_expr->fixed &&
|
result= (!left_expr->fixed &&
|
||||||
left_expr->fix_fields(thd, optimizer->arguments()));
|
left_expr->fix_fields(thd, optimizer->arguments()));
|
||||||
/* fix_fields can change reference to left_expr, we need reassign it */
|
/* fix_fields can change reference to left_expr, we need reassign it */
|
||||||
|
@ -2024,8 +2024,8 @@ static int my_xpath_parse_OrExpr(MY_XPATH *xpath)
|
|||||||
Item *prev= xpath->item;
|
Item *prev= xpath->item;
|
||||||
if (!my_xpath_parse_AndExpr(xpath))
|
if (!my_xpath_parse_AndExpr(xpath))
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
xpath->error= 1;
|
xpath->error= 1;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
xpath->item= new Item_cond_or(nodeset2bool(xpath, prev),
|
xpath->item= new Item_cond_or(nodeset2bool(xpath, prev),
|
||||||
nodeset2bool(xpath, xpath->item));
|
nodeset2bool(xpath, xpath->item));
|
||||||
|
@ -4476,10 +4476,12 @@ static void print_buffer_to_file(enum loglevel level, const char *buffer)
|
|||||||
int vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
|
int vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
|
||||||
{
|
{
|
||||||
char buff[1024];
|
char buff[1024];
|
||||||
size_t length;
|
|
||||||
DBUG_ENTER("vprint_msg_to_log");
|
DBUG_ENTER("vprint_msg_to_log");
|
||||||
|
|
||||||
length= my_vsnprintf(buff, sizeof(buff), format, args);
|
#ifdef __NT__
|
||||||
|
size_t length=
|
||||||
|
#endif
|
||||||
|
my_vsnprintf(buff, sizeof(buff), format, args);
|
||||||
print_buffer_to_file(level, buff);
|
print_buffer_to_file(level, buff);
|
||||||
|
|
||||||
#ifdef __NT__
|
#ifdef __NT__
|
||||||
|
@ -4602,8 +4602,9 @@ void User_var_log_event::pack_info(Protocol* protocol)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ROW_RESULT:
|
case ROW_RESULT:
|
||||||
|
case IMPOSSIBLE_RESULT:
|
||||||
default:
|
default:
|
||||||
DBUG_ASSERT(1);
|
DBUG_ASSERT(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4690,8 +4691,9 @@ bool User_var_log_event::write(IO_CACHE* file)
|
|||||||
pos= (uchar*) val;
|
pos= (uchar*) val;
|
||||||
break;
|
break;
|
||||||
case ROW_RESULT:
|
case ROW_RESULT:
|
||||||
|
case IMPOSSIBLE_RESULT:
|
||||||
default:
|
default:
|
||||||
DBUG_ASSERT(1);
|
DBUG_ASSERT(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int4store(buf1 + 2 + UV_CHARSET_NUMBER_SIZE, val_len);
|
int4store(buf1 + 2 + UV_CHARSET_NUMBER_SIZE, val_len);
|
||||||
@ -4809,7 +4811,7 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
|
|||||||
break;
|
break;
|
||||||
case ROW_RESULT:
|
case ROW_RESULT:
|
||||||
default:
|
default:
|
||||||
DBUG_ASSERT(1);
|
DBUG_ASSERT(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4871,8 +4873,9 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli)
|
|||||||
it= new Item_string(val, val_len, charset);
|
it= new Item_string(val, val_len, charset);
|
||||||
break;
|
break;
|
||||||
case ROW_RESULT:
|
case ROW_RESULT:
|
||||||
|
case IMPOSSIBLE_RESULT:
|
||||||
default:
|
default:
|
||||||
DBUG_ASSERT(1);
|
DBUG_ASSERT(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8566,7 +8569,6 @@ Incident_log_event::description() const
|
|||||||
|
|
||||||
DBUG_PRINT("info", ("m_incident: %d", m_incident));
|
DBUG_PRINT("info", ("m_incident: %d", m_incident));
|
||||||
|
|
||||||
DBUG_ASSERT(0 <= m_incident);
|
|
||||||
DBUG_ASSERT((size_t) m_incident <= sizeof(description)/sizeof(*description));
|
DBUG_ASSERT((size_t) m_incident <= sizeof(description)/sizeof(*description));
|
||||||
|
|
||||||
return description[m_incident];
|
return description[m_incident];
|
||||||
|
@ -5418,7 +5418,8 @@ struct my_option my_long_options[] =
|
|||||||
(uchar**) &opt_binlog_rows_event_max_size,
|
(uchar**) &opt_binlog_rows_event_max_size,
|
||||||
(uchar**) &opt_binlog_rows_event_max_size, 0,
|
(uchar**) &opt_binlog_rows_event_max_size, 0,
|
||||||
GET_ULONG, REQUIRED_ARG,
|
GET_ULONG, REQUIRED_ARG,
|
||||||
/* def_value */ 1024, /* min_value */ 256, /* max_value */ ULONG_MAX,
|
/* def_value */ 1024, /* min_value */ 256,
|
||||||
|
/* max_value */ (longlong) ULONG_MAX,
|
||||||
/* sub_size */ 0, /* block_size */ 256,
|
/* sub_size */ 0, /* block_size */ 256,
|
||||||
/* app_type */ 0
|
/* app_type */ 0
|
||||||
},
|
},
|
||||||
@ -5665,7 +5666,7 @@ Disable with --skip-large-pages.",
|
|||||||
#ifdef HAVE_MMAP
|
#ifdef HAVE_MMAP
|
||||||
{"log-tc-size", OPT_LOG_TC_SIZE, "Size of transaction coordinator log.",
|
{"log-tc-size", OPT_LOG_TC_SIZE, "Size of transaction coordinator log.",
|
||||||
(uchar**) &opt_tc_log_size, (uchar**) &opt_tc_log_size, 0, GET_ULONG,
|
(uchar**) &opt_tc_log_size, (uchar**) &opt_tc_log_size, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, TC_LOG_MIN_SIZE, TC_LOG_MIN_SIZE, ULONG_MAX, 0,
|
REQUIRED_ARG, TC_LOG_MIN_SIZE, TC_LOG_MIN_SIZE, (longlong) ULONG_MAX, 0,
|
||||||
TC_LOG_PAGE_SIZE, 0},
|
TC_LOG_PAGE_SIZE, 0},
|
||||||
#endif
|
#endif
|
||||||
{"log-update", OPT_UPDATE_LOG,
|
{"log-update", OPT_UPDATE_LOG,
|
||||||
@ -6132,7 +6133,7 @@ log and this option does nothing anymore.",
|
|||||||
{"warnings", 'W', "Deprecated; use --log-warnings instead.",
|
{"warnings", 'W', "Deprecated; use --log-warnings instead.",
|
||||||
(uchar**) &global_system_variables.log_warnings,
|
(uchar**) &global_system_variables.log_warnings,
|
||||||
(uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG,
|
(uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG,
|
||||||
1, 0, ULONG_MAX, 0, 0, 0},
|
1, 0, (longlong) ULONG_MAX, 0, 0, 0},
|
||||||
{ "back_log", OPT_BACK_LOG,
|
{ "back_log", OPT_BACK_LOG,
|
||||||
"The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.",
|
"The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.",
|
||||||
(uchar**) &back_log, (uchar**) &back_log, 0, GET_ULONG,
|
(uchar**) &back_log, (uchar**) &back_log, 0, GET_ULONG,
|
||||||
@ -6140,12 +6141,12 @@ log and this option does nothing anymore.",
|
|||||||
{"binlog_cache_size", OPT_BINLOG_CACHE_SIZE,
|
{"binlog_cache_size", OPT_BINLOG_CACHE_SIZE,
|
||||||
"The size of the cache to hold the SQL statements for the binary log during a transaction. If you often use big, multi-statement transactions you can increase this to get more performance.",
|
"The size of the cache to hold the SQL statements for the binary log during a transaction. If you often use big, multi-statement transactions you can increase this to get more performance.",
|
||||||
(uchar**) &binlog_cache_size, (uchar**) &binlog_cache_size, 0, GET_ULONG,
|
(uchar**) &binlog_cache_size, (uchar**) &binlog_cache_size, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, 32*1024L, IO_SIZE, ULONG_MAX, 0, IO_SIZE, 0},
|
REQUIRED_ARG, 32*1024L, IO_SIZE, (longlong) ULONG_MAX, 0, IO_SIZE, 0},
|
||||||
{"bulk_insert_buffer_size", OPT_BULK_INSERT_BUFFER_SIZE,
|
{"bulk_insert_buffer_size", OPT_BULK_INSERT_BUFFER_SIZE,
|
||||||
"Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!",
|
"Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!",
|
||||||
(uchar**) &global_system_variables.bulk_insert_buff_size,
|
(uchar**) &global_system_variables.bulk_insert_buff_size,
|
||||||
(uchar**) &max_system_variables.bulk_insert_buff_size,
|
(uchar**) &max_system_variables.bulk_insert_buff_size,
|
||||||
0, GET_ULONG, REQUIRED_ARG, 8192*1024, 0, ULONG_MAX, 0, 1, 0},
|
0, GET_ULONG, REQUIRED_ARG, 8192*1024, 0, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
{"connect_timeout", OPT_CONNECT_TIMEOUT,
|
{"connect_timeout", OPT_CONNECT_TIMEOUT,
|
||||||
"The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'.",
|
"The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'.",
|
||||||
(uchar**) &connect_timeout, (uchar**) &connect_timeout,
|
(uchar**) &connect_timeout, (uchar**) &connect_timeout,
|
||||||
@ -6168,7 +6169,7 @@ log and this option does nothing anymore.",
|
|||||||
{"delayed_insert_limit", OPT_DELAYED_INSERT_LIMIT,
|
{"delayed_insert_limit", OPT_DELAYED_INSERT_LIMIT,
|
||||||
"After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.",
|
"After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.",
|
||||||
(uchar**) &delayed_insert_limit, (uchar**) &delayed_insert_limit, 0, GET_ULONG,
|
(uchar**) &delayed_insert_limit, (uchar**) &delayed_insert_limit, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, DELAYED_LIMIT, 1, ULONG_MAX, 0, 1, 0},
|
REQUIRED_ARG, DELAYED_LIMIT, 1, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
{"delayed_insert_timeout", OPT_DELAYED_INSERT_TIMEOUT,
|
{"delayed_insert_timeout", OPT_DELAYED_INSERT_TIMEOUT,
|
||||||
"How long a INSERT DELAYED thread should wait for INSERT statements before terminating.",
|
"How long a INSERT DELAYED thread should wait for INSERT statements before terminating.",
|
||||||
(uchar**) &delayed_insert_timeout, (uchar**) &delayed_insert_timeout, 0,
|
(uchar**) &delayed_insert_timeout, (uchar**) &delayed_insert_timeout, 0,
|
||||||
@ -6176,7 +6177,7 @@ log and this option does nothing anymore.",
|
|||||||
{ "delayed_queue_size", OPT_DELAYED_QUEUE_SIZE,
|
{ "delayed_queue_size", OPT_DELAYED_QUEUE_SIZE,
|
||||||
"What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again.",
|
"What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again.",
|
||||||
(uchar**) &delayed_queue_size, (uchar**) &delayed_queue_size, 0, GET_ULONG,
|
(uchar**) &delayed_queue_size, (uchar**) &delayed_queue_size, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, DELAYED_QUEUE_SIZE, 1, ULONG_MAX, 0, 1, 0},
|
REQUIRED_ARG, DELAYED_QUEUE_SIZE, 1, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
{"div_precision_increment", OPT_DIV_PRECINCREMENT,
|
{"div_precision_increment", OPT_DIV_PRECINCREMENT,
|
||||||
"Precision of the result of '/' operator will be increased on that value.",
|
"Precision of the result of '/' operator will be increased on that value.",
|
||||||
(uchar**) &global_system_variables.div_precincrement,
|
(uchar**) &global_system_variables.div_precincrement,
|
||||||
@ -6216,7 +6217,7 @@ log and this option does nothing anymore.",
|
|||||||
"The maximum length of the result of function group_concat.",
|
"The maximum length of the result of function group_concat.",
|
||||||
(uchar**) &global_system_variables.group_concat_max_len,
|
(uchar**) &global_system_variables.group_concat_max_len,
|
||||||
(uchar**) &max_system_variables.group_concat_max_len, 0, GET_ULONG,
|
(uchar**) &max_system_variables.group_concat_max_len, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, 1024, 4, ULONG_MAX, 0, 1, 0},
|
REQUIRED_ARG, 1024, 4, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
{"interactive_timeout", OPT_INTERACTIVE_TIMEOUT,
|
{"interactive_timeout", OPT_INTERACTIVE_TIMEOUT,
|
||||||
"The number of seconds the server waits for activity on an interactive connection before closing it.",
|
"The number of seconds the server waits for activity on an interactive connection before closing it.",
|
||||||
(uchar**) &global_system_variables.net_interactive_timeout,
|
(uchar**) &global_system_variables.net_interactive_timeout,
|
||||||
@ -6226,7 +6227,7 @@ log and this option does nothing anymore.",
|
|||||||
"The size of the buffer that is used for full joins.",
|
"The size of the buffer that is used for full joins.",
|
||||||
(uchar**) &global_system_variables.join_buff_size,
|
(uchar**) &global_system_variables.join_buff_size,
|
||||||
(uchar**) &max_system_variables.join_buff_size, 0, GET_ULONG,
|
(uchar**) &max_system_variables.join_buff_size, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ULONG_MAX,
|
REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, (longlong) ULONG_MAX,
|
||||||
MALLOC_OVERHEAD, IO_SIZE, 0},
|
MALLOC_OVERHEAD, IO_SIZE, 0},
|
||||||
{"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE,
|
{"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE,
|
||||||
"Don't overwrite stale .MYD and .MYI even if no directory is specified.",
|
"Don't overwrite stale .MYD and .MYI even if no directory is specified.",
|
||||||
@ -6245,7 +6246,7 @@ log and this option does nothing anymore.",
|
|||||||
(uchar**) &dflt_key_cache_var.param_age_threshold,
|
(uchar**) &dflt_key_cache_var.param_age_threshold,
|
||||||
(uchar**) 0,
|
(uchar**) 0,
|
||||||
0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
|
0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
|
||||||
300, 100, ULONG_MAX, 0, 100, 0},
|
300, 100, (longlong) ULONG_MAX, 0, 100, 0},
|
||||||
{"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,
|
{"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,
|
||||||
"The default size of key cache blocks",
|
"The default size of key cache blocks",
|
||||||
(uchar**) &dflt_key_cache_var.param_block_size,
|
(uchar**) &dflt_key_cache_var.param_block_size,
|
||||||
@ -6281,7 +6282,8 @@ log and this option does nothing anymore.",
|
|||||||
{"max_binlog_cache_size", OPT_MAX_BINLOG_CACHE_SIZE,
|
{"max_binlog_cache_size", OPT_MAX_BINLOG_CACHE_SIZE,
|
||||||
"Can be used to restrict the total size used to cache a multi-transaction query.",
|
"Can be used to restrict the total size used to cache a multi-transaction query.",
|
||||||
(uchar**) &max_binlog_cache_size, (uchar**) &max_binlog_cache_size, 0,
|
(uchar**) &max_binlog_cache_size, (uchar**) &max_binlog_cache_size, 0,
|
||||||
GET_ULONG, REQUIRED_ARG, ULONG_MAX, IO_SIZE, ULONG_MAX, 0, IO_SIZE, 0},
|
GET_ULONG, REQUIRED_ARG, (longlong) ULONG_MAX, IO_SIZE,
|
||||||
|
(longlong) ULONG_MAX, 0, IO_SIZE, 0},
|
||||||
{"max_binlog_size", OPT_MAX_BINLOG_SIZE,
|
{"max_binlog_size", OPT_MAX_BINLOG_SIZE,
|
||||||
"Binary log will be rotated automatically when the size exceeds this \
|
"Binary log will be rotated automatically when the size exceeds this \
|
||||||
value. Will also apply to relay logs if max_relay_log_size is 0. \
|
value. Will also apply to relay logs if max_relay_log_size is 0. \
|
||||||
@ -6291,7 +6293,7 @@ The minimum value for this variable is 4096.",
|
|||||||
{"max_connect_errors", OPT_MAX_CONNECT_ERRORS,
|
{"max_connect_errors", OPT_MAX_CONNECT_ERRORS,
|
||||||
"If there is more than this number of interrupted connections from a host this host will be blocked from further connections.",
|
"If there is more than this number of interrupted connections from a host this host will be blocked from further connections.",
|
||||||
(uchar**) &max_connect_errors, (uchar**) &max_connect_errors, 0, GET_ULONG,
|
(uchar**) &max_connect_errors, (uchar**) &max_connect_errors, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ULONG_MAX, 0, 1, 0},
|
REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
// Default max_connections of 151 is larger than Apache's default max
|
// Default max_connections of 151 is larger than Apache's default max
|
||||||
// children, to avoid "too many connections" error in a common setup
|
// children, to avoid "too many connections" error in a common setup
|
||||||
{"max_connections", OPT_MAX_CONNECTIONS,
|
{"max_connections", OPT_MAX_CONNECTIONS,
|
||||||
@ -6336,7 +6338,7 @@ The minimum value for this variable is 4096.",
|
|||||||
"Limit assumed max number of seeks when looking up rows based on a key",
|
"Limit assumed max number of seeks when looking up rows based on a key",
|
||||||
(uchar**) &global_system_variables.max_seeks_for_key,
|
(uchar**) &global_system_variables.max_seeks_for_key,
|
||||||
(uchar**) &max_system_variables.max_seeks_for_key, 0, GET_ULONG,
|
(uchar**) &max_system_variables.max_seeks_for_key, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0 },
|
REQUIRED_ARG, (longlong) ULONG_MAX, 1, (longlong) ULONG_MAX, 0, 1, 0 },
|
||||||
{"max_sort_length", OPT_MAX_SORT_LENGTH,
|
{"max_sort_length", OPT_MAX_SORT_LENGTH,
|
||||||
"The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).",
|
"The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).",
|
||||||
(uchar**) &global_system_variables.max_sort_length,
|
(uchar**) &global_system_variables.max_sort_length,
|
||||||
@ -6351,7 +6353,7 @@ The minimum value for this variable is 4096.",
|
|||||||
"Maximum number of temporary tables a client can keep open at a time.",
|
"Maximum number of temporary tables a client can keep open at a time.",
|
||||||
(uchar**) &global_system_variables.max_tmp_tables,
|
(uchar**) &global_system_variables.max_tmp_tables,
|
||||||
(uchar**) &max_system_variables.max_tmp_tables, 0, GET_ULONG,
|
(uchar**) &max_system_variables.max_tmp_tables, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, 32, 1, ULONG_MAX, 0, 1, 0},
|
REQUIRED_ARG, 32, 1, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
{"max_user_connections", OPT_MAX_USER_CONNECTIONS,
|
{"max_user_connections", OPT_MAX_USER_CONNECTIONS,
|
||||||
"The maximum number of active connections for a single user (0 = no limit).",
|
"The maximum number of active connections for a single user (0 = no limit).",
|
||||||
(uchar**) &max_user_connections, (uchar**) &max_user_connections, 0, GET_UINT,
|
(uchar**) &max_user_connections, (uchar**) &max_user_connections, 0, GET_UINT,
|
||||||
@ -6359,17 +6361,17 @@ The minimum value for this variable is 4096.",
|
|||||||
{"max_write_lock_count", OPT_MAX_WRITE_LOCK_COUNT,
|
{"max_write_lock_count", OPT_MAX_WRITE_LOCK_COUNT,
|
||||||
"After this many write locks, allow some read locks to run in between.",
|
"After this many write locks, allow some read locks to run in between.",
|
||||||
(uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG,
|
(uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0},
|
REQUIRED_ARG, (longlong) ULONG_MAX, 1, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
{"min_examined_row_limit", OPT_MIN_EXAMINED_ROW_LIMIT,
|
{"min_examined_row_limit", OPT_MIN_EXAMINED_ROW_LIMIT,
|
||||||
"Don't log queries which examine less than min_examined_row_limit rows to file.",
|
"Don't log queries which examine less than min_examined_row_limit rows to file.",
|
||||||
(uchar**) &global_system_variables.min_examined_row_limit,
|
(uchar**) &global_system_variables.min_examined_row_limit,
|
||||||
(uchar**) &max_system_variables.min_examined_row_limit, 0, GET_ULONG,
|
(uchar**) &max_system_variables.min_examined_row_limit, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1L, 0},
|
REQUIRED_ARG, 0, 0, (longlong) ULONG_MAX, 0, 1L, 0},
|
||||||
{"multi_range_count", OPT_MULTI_RANGE_COUNT,
|
{"multi_range_count", OPT_MULTI_RANGE_COUNT,
|
||||||
"Number of key ranges to request at once.",
|
"Number of key ranges to request at once.",
|
||||||
(uchar**) &global_system_variables.multi_range_count,
|
(uchar**) &global_system_variables.multi_range_count,
|
||||||
(uchar**) &max_system_variables.multi_range_count, 0,
|
(uchar**) &max_system_variables.multi_range_count, 0,
|
||||||
GET_ULONG, REQUIRED_ARG, 256, 1, ULONG_MAX, 0, 1, 0},
|
GET_ULONG, REQUIRED_ARG, 256, 1, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
{"myisam_block_size", OPT_MYISAM_BLOCK_SIZE,
|
{"myisam_block_size", OPT_MYISAM_BLOCK_SIZE,
|
||||||
"Block size to be used for MyISAM index pages.",
|
"Block size to be used for MyISAM index pages.",
|
||||||
(uchar**) &opt_myisam_block_size,
|
(uchar**) &opt_myisam_block_size,
|
||||||
@ -6391,12 +6393,12 @@ The minimum value for this variable is 4096.",
|
|||||||
"Number of threads to use when repairing MyISAM tables. The value of 1 disables parallel repair.",
|
"Number of threads to use when repairing MyISAM tables. The value of 1 disables parallel repair.",
|
||||||
(uchar**) &global_system_variables.myisam_repair_threads,
|
(uchar**) &global_system_variables.myisam_repair_threads,
|
||||||
(uchar**) &max_system_variables.myisam_repair_threads, 0,
|
(uchar**) &max_system_variables.myisam_repair_threads, 0,
|
||||||
GET_ULONG, REQUIRED_ARG, 1, 1, ULONG_MAX, 0, 1, 0},
|
GET_ULONG, REQUIRED_ARG, 1, 1, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
{"myisam_sort_buffer_size", OPT_MYISAM_SORT_BUFFER_SIZE,
|
{"myisam_sort_buffer_size", OPT_MYISAM_SORT_BUFFER_SIZE,
|
||||||
"The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.",
|
"The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.",
|
||||||
(uchar**) &global_system_variables.myisam_sort_buff_size,
|
(uchar**) &global_system_variables.myisam_sort_buff_size,
|
||||||
(uchar**) &max_system_variables.myisam_sort_buff_size, 0,
|
(uchar**) &max_system_variables.myisam_sort_buff_size, 0,
|
||||||
GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ULONG_MAX, 0, 1, 0},
|
GET_ULONG, REQUIRED_ARG, 8192*1024, 4, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
{"myisam_use_mmap", OPT_MYISAM_USE_MMAP,
|
{"myisam_use_mmap", OPT_MYISAM_USE_MMAP,
|
||||||
"Use memory mapping for reading and writing MyISAM tables",
|
"Use memory mapping for reading and writing MyISAM tables",
|
||||||
(uchar**) &opt_myisam_use_mmap,
|
(uchar**) &opt_myisam_use_mmap,
|
||||||
@ -6422,7 +6424,8 @@ The minimum value for this variable is 4096.",
|
|||||||
"If a read on a communication port is interrupted, retry this many times before giving up.",
|
"If a read on a communication port is interrupted, retry this many times before giving up.",
|
||||||
(uchar**) &global_system_variables.net_retry_count,
|
(uchar**) &global_system_variables.net_retry_count,
|
||||||
(uchar**) &max_system_variables.net_retry_count,0,
|
(uchar**) &max_system_variables.net_retry_count,0,
|
||||||
GET_ULONG, REQUIRED_ARG, MYSQLD_NET_RETRY_COUNT, 1, ULONG_MAX, 0, 1, 0},
|
GET_ULONG, REQUIRED_ARG, MYSQLD_NET_RETRY_COUNT, 1, (longlong) ULONG_MAX,
|
||||||
|
0, 1, 0},
|
||||||
{"net_write_timeout", OPT_NET_WRITE_TIMEOUT,
|
{"net_write_timeout", OPT_NET_WRITE_TIMEOUT,
|
||||||
"Number of seconds to wait for a block to be written to a connection before aborting the write.",
|
"Number of seconds to wait for a block to be written to a connection before aborting the write.",
|
||||||
(uchar**) &global_system_variables.net_write_timeout,
|
(uchar**) &global_system_variables.net_write_timeout,
|
||||||
@ -6464,17 +6467,18 @@ The minimum value for this variable is 4096.",
|
|||||||
"Allocation block size for query parsing and execution",
|
"Allocation block size for query parsing and execution",
|
||||||
(uchar**) &global_system_variables.query_alloc_block_size,
|
(uchar**) &global_system_variables.query_alloc_block_size,
|
||||||
(uchar**) &max_system_variables.query_alloc_block_size, 0, GET_ULONG,
|
(uchar**) &max_system_variables.query_alloc_block_size, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0},
|
REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, (longlong) ULONG_MAX, 0, 1024,
|
||||||
|
0},
|
||||||
#ifdef HAVE_QUERY_CACHE
|
#ifdef HAVE_QUERY_CACHE
|
||||||
{"query_cache_limit", OPT_QUERY_CACHE_LIMIT,
|
{"query_cache_limit", OPT_QUERY_CACHE_LIMIT,
|
||||||
"Don't cache results that are bigger than this.",
|
"Don't cache results that are bigger than this.",
|
||||||
(uchar**) &query_cache_limit, (uchar**) &query_cache_limit, 0, GET_ULONG,
|
(uchar**) &query_cache_limit, (uchar**) &query_cache_limit, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, 1024*1024L, 0, ULONG_MAX, 0, 1, 0},
|
REQUIRED_ARG, 1024*1024L, 0, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
{"query_cache_min_res_unit", OPT_QUERY_CACHE_MIN_RES_UNIT,
|
{"query_cache_min_res_unit", OPT_QUERY_CACHE_MIN_RES_UNIT,
|
||||||
"minimal size of unit in wich space for results is allocated (last unit will be trimed after writing all result data.",
|
"minimal size of unit in wich space for results is allocated (last unit will be trimed after writing all result data.",
|
||||||
(uchar**) &query_cache_min_res_unit, (uchar**) &query_cache_min_res_unit,
|
(uchar**) &query_cache_min_res_unit, (uchar**) &query_cache_min_res_unit,
|
||||||
0, GET_ULONG, REQUIRED_ARG, QUERY_CACHE_MIN_RESULT_DATA_SIZE,
|
0, GET_ULONG, REQUIRED_ARG, QUERY_CACHE_MIN_RESULT_DATA_SIZE,
|
||||||
0, ULONG_MAX, 0, 1, 0},
|
0, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
#endif /*HAVE_QUERY_CACHE*/
|
#endif /*HAVE_QUERY_CACHE*/
|
||||||
{"query_cache_size", OPT_QUERY_CACHE_SIZE,
|
{"query_cache_size", OPT_QUERY_CACHE_SIZE,
|
||||||
"The memory allocated to store results from old queries.",
|
"The memory allocated to store results from old queries.",
|
||||||
@ -6497,13 +6501,13 @@ The minimum value for this variable is 4096.",
|
|||||||
(uchar**) &global_system_variables.query_prealloc_size,
|
(uchar**) &global_system_variables.query_prealloc_size,
|
||||||
(uchar**) &max_system_variables.query_prealloc_size, 0, GET_ULONG,
|
(uchar**) &max_system_variables.query_prealloc_size, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, QUERY_ALLOC_PREALLOC_SIZE,
|
REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, QUERY_ALLOC_PREALLOC_SIZE,
|
||||||
ULONG_MAX, 0, 1024, 0},
|
(longlong) ULONG_MAX, 0, 1024, 0},
|
||||||
{"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE,
|
{"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE,
|
||||||
"Allocation block size for storing ranges during optimization",
|
"Allocation block size for storing ranges during optimization",
|
||||||
(uchar**) &global_system_variables.range_alloc_block_size,
|
(uchar**) &global_system_variables.range_alloc_block_size,
|
||||||
(uchar**) &max_system_variables.range_alloc_block_size, 0, GET_ULONG,
|
(uchar**) &max_system_variables.range_alloc_block_size, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, RANGE_ALLOC_BLOCK_SIZE, ULONG_MAX,
|
REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, RANGE_ALLOC_BLOCK_SIZE,
|
||||||
0, 1024, 0},
|
(longlong) ULONG_MAX, 0, 1024, 0},
|
||||||
{"read_buffer_size", OPT_RECORD_BUFFER,
|
{"read_buffer_size", OPT_RECORD_BUFFER,
|
||||||
"Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.",
|
"Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.",
|
||||||
(uchar**) &global_system_variables.read_buff_size,
|
(uchar**) &global_system_variables.read_buff_size,
|
||||||
@ -6561,13 +6565,13 @@ The minimum value for this variable is 4096.",
|
|||||||
"Each thread that needs to do a sort allocates a buffer of this size.",
|
"Each thread that needs to do a sort allocates a buffer of this size.",
|
||||||
(uchar**) &global_system_variables.sortbuff_size,
|
(uchar**) &global_system_variables.sortbuff_size,
|
||||||
(uchar**) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG,
|
(uchar**) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG,
|
||||||
MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, ULONG_MAX, MALLOC_OVERHEAD,
|
MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, (longlong) ULONG_MAX,
|
||||||
1, 0},
|
MALLOC_OVERHEAD, 1, 0},
|
||||||
{"sync-binlog", OPT_SYNC_BINLOG,
|
{"sync-binlog", OPT_SYNC_BINLOG,
|
||||||
"Synchronously flush binary log to disk after every #th event. "
|
"Synchronously flush binary log to disk after every #th event. "
|
||||||
"Use 0 (default) to disable synchronous flushing.",
|
"Use 0 (default) to disable synchronous flushing.",
|
||||||
(uchar**) &sync_binlog_period, (uchar**) &sync_binlog_period, 0, GET_ULONG,
|
(uchar**) &sync_binlog_period, (uchar**) &sync_binlog_period, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1, 0},
|
REQUIRED_ARG, 0, 0, (longlong) ULONG_MAX, 0, 1, 0},
|
||||||
{"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.",
|
{"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.",
|
||||||
(uchar**) &opt_sync_frm, (uchar**) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
|
(uchar**) &opt_sync_frm, (uchar**) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
|
||||||
0, 0, 0, 0},
|
0, 0, 0, 0},
|
||||||
@ -6605,7 +6609,7 @@ The minimum value for this variable is 4096.",
|
|||||||
{"thread_stack", OPT_THREAD_STACK,
|
{"thread_stack", OPT_THREAD_STACK,
|
||||||
"The stack size for each thread.", (uchar**) &my_thread_stack_size,
|
"The stack size for each thread.", (uchar**) &my_thread_stack_size,
|
||||||
(uchar**) &my_thread_stack_size, 0, GET_ULONG, REQUIRED_ARG,DEFAULT_THREAD_STACK,
|
(uchar**) &my_thread_stack_size, 0, GET_ULONG, REQUIRED_ARG,DEFAULT_THREAD_STACK,
|
||||||
1024L*128L, ULONG_MAX, 0, 1024, 0},
|
1024L*128L, (longlong) ULONG_MAX, 0, 1024, 0},
|
||||||
{ "time_format", OPT_TIME_FORMAT,
|
{ "time_format", OPT_TIME_FORMAT,
|
||||||
"The TIME format (for future).",
|
"The TIME format (for future).",
|
||||||
(uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
|
(uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
|
||||||
@ -6621,12 +6625,14 @@ The minimum value for this variable is 4096.",
|
|||||||
"Allocation block size for transactions to be stored in binary log",
|
"Allocation block size for transactions to be stored in binary log",
|
||||||
(uchar**) &global_system_variables.trans_alloc_block_size,
|
(uchar**) &global_system_variables.trans_alloc_block_size,
|
||||||
(uchar**) &max_system_variables.trans_alloc_block_size, 0, GET_ULONG,
|
(uchar**) &max_system_variables.trans_alloc_block_size, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0},
|
REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, (longlong) ULONG_MAX, 0, 1024,
|
||||||
|
0},
|
||||||
{"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE,
|
{"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE,
|
||||||
"Persistent buffer for transactions to be stored in binary log",
|
"Persistent buffer for transactions to be stored in binary log",
|
||||||
(uchar**) &global_system_variables.trans_prealloc_size,
|
(uchar**) &global_system_variables.trans_prealloc_size,
|
||||||
(uchar**) &max_system_variables.trans_prealloc_size, 0, GET_ULONG,
|
(uchar**) &max_system_variables.trans_prealloc_size, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, ULONG_MAX, 0, 1024, 0},
|
REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, (longlong) ULONG_MAX, 0,
|
||||||
|
1024, 0},
|
||||||
{"thread_handling", OPT_THREAD_HANDLING,
|
{"thread_handling", OPT_THREAD_HANDLING,
|
||||||
"Define threads usage for handling queries: "
|
"Define threads usage for handling queries: "
|
||||||
"one-thread-per-connection or no-threads", 0, 0,
|
"one-thread-per-connection or no-threads", 0, 0,
|
||||||
|
@ -969,12 +969,8 @@ static int maxmin_in_range(bool max_fl, Field* field, COND *cond)
|
|||||||
return cond->val_int() == 0; // Return 1 if WHERE is false
|
return cond->val_int() == 0; // Return 1 if WHERE is false
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case Item_func::EQ_FUNC:
|
default:
|
||||||
case Item_func::EQUAL_FUNC:
|
break; // Ignore
|
||||||
break;
|
|
||||||
default: // Keep compiler happy
|
|
||||||
DBUG_ASSERT(1); // Impossible
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -987,13 +987,11 @@ bool partition_info::set_up_charset_field_preps()
|
|||||||
i= 0;
|
i= 0;
|
||||||
while ((field= *(ptr++)))
|
while ((field= *(ptr++)))
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs;
|
|
||||||
uchar *field_buf;
|
uchar *field_buf;
|
||||||
LINT_INIT(field_buf);
|
LINT_INIT(field_buf);
|
||||||
|
|
||||||
if (!field_is_partition_charset(field))
|
if (!field_is_partition_charset(field))
|
||||||
continue;
|
continue;
|
||||||
cs= ((Field_str*)field)->charset();
|
|
||||||
size= field->pack_length();
|
size= field->pack_length();
|
||||||
if (!(field_buf= (uchar*) sql_calloc(size)))
|
if (!(field_buf= (uchar*) sql_calloc(size)))
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -290,7 +290,7 @@ public:
|
|||||||
"START_STATE", "TABLE_STATE", "ROW_STATE", "STATE_COUNT"
|
"START_STATE", "TABLE_STATE", "ROW_STATE", "STATE_COUNT"
|
||||||
};
|
};
|
||||||
|
|
||||||
DBUG_ASSERT(0 <= target_state && target_state <= STATE_COUNT);
|
DBUG_ASSERT(target_state <= STATE_COUNT);
|
||||||
DBUG_PRINT("info", ("In state %s", state_name[m_state]));
|
DBUG_PRINT("info", ("In state %s", state_name[m_state]));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -150,11 +150,9 @@ Geometry *Geometry::construct(Geometry_buffer *buffer,
|
|||||||
{
|
{
|
||||||
uint32 geom_type;
|
uint32 geom_type;
|
||||||
Geometry *result;
|
Geometry *result;
|
||||||
char byte_order;
|
|
||||||
|
|
||||||
if (data_len < SRID_SIZE + WKB_HEADER_SIZE) // < 4 + (1 + 4)
|
if (data_len < SRID_SIZE + WKB_HEADER_SIZE) // < 4 + (1 + 4)
|
||||||
return NULL;
|
return NULL;
|
||||||
byte_order= data[SRID_SIZE];
|
|
||||||
geom_type= uint4korr(data + SRID_SIZE + 1);
|
geom_type= uint4korr(data + SRID_SIZE + 1);
|
||||||
if (!(result= create_by_typeid(buffer, (int) geom_type)))
|
if (!(result= create_by_typeid(buffer, (int) geom_type)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -5575,7 +5575,6 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
String wrong_users;
|
String wrong_users;
|
||||||
ulong sql_mode;
|
|
||||||
LEX_USER *user_name, *tmp_user_name;
|
LEX_USER *user_name, *tmp_user_name;
|
||||||
List_iterator <LEX_USER> user_list(list);
|
List_iterator <LEX_USER> user_list(list);
|
||||||
TABLE_LIST tables[GRANT_TABLES];
|
TABLE_LIST tables[GRANT_TABLES];
|
||||||
@ -5616,7 +5615,6 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
some_users_created= TRUE;
|
some_users_created= TRUE;
|
||||||
sql_mode= thd->variables.sql_mode;
|
|
||||||
if (replace_user_table(thd, tables[0].table, *user_name, 0, 0, 1, 0))
|
if (replace_user_table(thd, tables[0].table, *user_name, 0, 0, 1, 0))
|
||||||
{
|
{
|
||||||
append_user(&wrong_users, user_name);
|
append_user(&wrong_users, user_name);
|
||||||
|
@ -5431,7 +5431,7 @@ static void update_field_dependencies(THD *thd, Field *field, TABLE *table)
|
|||||||
DBUG_ENTER("update_field_dependencies");
|
DBUG_ENTER("update_field_dependencies");
|
||||||
if (thd->mark_used_columns != MARK_COLUMNS_NONE)
|
if (thd->mark_used_columns != MARK_COLUMNS_NONE)
|
||||||
{
|
{
|
||||||
MY_BITMAP *current_bitmap, *other_bitmap;
|
MY_BITMAP *current_bitmap;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We always want to register the used keys, as the column bitmap may have
|
We always want to register the used keys, as the column bitmap may have
|
||||||
@ -5442,15 +5442,9 @@ static void update_field_dependencies(THD *thd, Field *field, TABLE *table)
|
|||||||
table->merge_keys.merge(field->part_of_key);
|
table->merge_keys.merge(field->part_of_key);
|
||||||
|
|
||||||
if (thd->mark_used_columns == MARK_COLUMNS_READ)
|
if (thd->mark_used_columns == MARK_COLUMNS_READ)
|
||||||
{
|
|
||||||
current_bitmap= table->read_set;
|
current_bitmap= table->read_set;
|
||||||
other_bitmap= table->write_set;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
current_bitmap= table->write_set;
|
current_bitmap= table->write_set;
|
||||||
other_bitmap= table->read_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bitmap_fast_test_and_set(current_bitmap, field->field_index))
|
if (bitmap_fast_test_and_set(current_bitmap, field->field_index))
|
||||||
{
|
{
|
||||||
|
@ -1177,7 +1177,10 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
|
|||||||
{
|
{
|
||||||
ulonglong engine_data;
|
ulonglong engine_data;
|
||||||
Query_cache_query *query;
|
Query_cache_query *query;
|
||||||
Query_cache_block *first_result_block, *result_block;
|
#ifndef EMBEDDED_LIBRARY
|
||||||
|
Query_cache_block *first_result_block;
|
||||||
|
#endif
|
||||||
|
Query_cache_block *result_block;
|
||||||
Query_cache_block_table *block_table, *block_table_end;
|
Query_cache_block_table *block_table, *block_table_end;
|
||||||
ulong tot_length;
|
ulong tot_length;
|
||||||
Query_cache_query_flags flags;
|
Query_cache_query_flags flags;
|
||||||
@ -1322,7 +1325,10 @@ def_week_frmt: %lu",
|
|||||||
BLOCK_LOCK_RD(query_block);
|
BLOCK_LOCK_RD(query_block);
|
||||||
|
|
||||||
query = query_block->query();
|
query = query_block->query();
|
||||||
result_block= first_result_block= query->result();
|
result_block= query->result();
|
||||||
|
#ifndef EMBEDDED_LIBRARY
|
||||||
|
first_result_block= result_block;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (result_block == 0 || result_block->type != Query_cache_block::RESULT)
|
if (result_block == 0 || result_block->type != Query_cache_block::RESULT)
|
||||||
{
|
{
|
||||||
|
@ -2046,8 +2046,7 @@ bool select_max_min_finder_subselect::send_data(List<Item> &items)
|
|||||||
if (!cache)
|
if (!cache)
|
||||||
{
|
{
|
||||||
cache= Item_cache::get_cache(val_item);
|
cache= Item_cache::get_cache(val_item);
|
||||||
switch (val_item->result_type())
|
switch (val_item->result_type()) {
|
||||||
{
|
|
||||||
case REAL_RESULT:
|
case REAL_RESULT:
|
||||||
op= &select_max_min_finder_subselect::cmp_real;
|
op= &select_max_min_finder_subselect::cmp_real;
|
||||||
break;
|
break;
|
||||||
@ -2061,6 +2060,7 @@ bool select_max_min_finder_subselect::send_data(List<Item> &items)
|
|||||||
op= &select_max_min_finder_subselect::cmp_decimal;
|
op= &select_max_min_finder_subselect::cmp_decimal;
|
||||||
break;
|
break;
|
||||||
case ROW_RESULT:
|
case ROW_RESULT:
|
||||||
|
case IMPOSSIBLE_RESULT:
|
||||||
// This case should never be choosen
|
// This case should never be choosen
|
||||||
DBUG_ASSERT(0);
|
DBUG_ASSERT(0);
|
||||||
op= 0;
|
op= 0;
|
||||||
@ -3544,11 +3544,10 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg,
|
|||||||
binlog_table_maps= 0;
|
binlog_table_maps= 0;
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case THD::QUERY_TYPE_COUNT:
|
case THD::QUERY_TYPE_COUNT:
|
||||||
default:
|
default:
|
||||||
DBUG_ASSERT(0 <= qtype && qtype < QUERY_TYPE_COUNT);
|
DBUG_ASSERT(qtype < QUERY_TYPE_COUNT);
|
||||||
}
|
}
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
@ -564,12 +564,9 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
|
|||||||
List_iterator_fast<Item> it(fields_vars);
|
List_iterator_fast<Item> it(fields_vars);
|
||||||
Item_field *sql_field;
|
Item_field *sql_field;
|
||||||
TABLE *table= table_list->table;
|
TABLE *table= table_list->table;
|
||||||
ulonglong id;
|
|
||||||
bool err;
|
bool err;
|
||||||
DBUG_ENTER("read_fixed_length");
|
DBUG_ENTER("read_fixed_length");
|
||||||
|
|
||||||
id= 0;
|
|
||||||
|
|
||||||
while (!read_info.read_fixed_length())
|
while (!read_info.read_fixed_length())
|
||||||
{
|
{
|
||||||
if (thd->killed)
|
if (thd->killed)
|
||||||
@ -695,12 +692,10 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
|
|||||||
Item *item;
|
Item *item;
|
||||||
TABLE *table= table_list->table;
|
TABLE *table= table_list->table;
|
||||||
uint enclosed_length;
|
uint enclosed_length;
|
||||||
ulonglong id;
|
|
||||||
bool err;
|
bool err;
|
||||||
DBUG_ENTER("read_sep_field");
|
DBUG_ENTER("read_sep_field");
|
||||||
|
|
||||||
enclosed_length=enclosed.length();
|
enclosed_length=enclosed.length();
|
||||||
id= 0;
|
|
||||||
|
|
||||||
for (;;it.rewind())
|
for (;;it.rewind())
|
||||||
{
|
{
|
||||||
|
@ -302,7 +302,7 @@ void init_update_queries(void)
|
|||||||
|
|
||||||
bool is_update_query(enum enum_sql_command command)
|
bool is_update_query(enum enum_sql_command command)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(command >= 0 && command <= SQLCOM_END);
|
DBUG_ASSERT(command <= SQLCOM_END);
|
||||||
return (sql_command_flags[command] & CF_CHANGES_DATA) != 0;
|
return (sql_command_flags[command] & CF_CHANGES_DATA) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ bool is_update_query(enum enum_sql_command command)
|
|||||||
*/
|
*/
|
||||||
bool is_log_table_write_query(enum enum_sql_command command)
|
bool is_log_table_write_query(enum enum_sql_command command)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(command >= 0 && command <= SQLCOM_END);
|
DBUG_ASSERT(command <= SQLCOM_END);
|
||||||
return (sql_command_flags[command] & CF_WRITE_LOGS_COMMAND) != 0;
|
return (sql_command_flags[command] & CF_WRITE_LOGS_COMMAND) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1367,7 +1367,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||||||
{
|
{
|
||||||
STATUS_VAR current_global_status_var;
|
STATUS_VAR current_global_status_var;
|
||||||
ulong uptime;
|
ulong uptime;
|
||||||
|
#if defined(SAFEMALLOC) || !defined(EMBEDDED_LIBRARY)
|
||||||
uint length;
|
uint length;
|
||||||
|
#endif
|
||||||
ulonglong queries_per_second1000;
|
ulonglong queries_per_second1000;
|
||||||
char buff[250];
|
char buff[250];
|
||||||
uint buff_len= sizeof(buff);
|
uint buff_len= sizeof(buff);
|
||||||
@ -1380,7 +1382,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||||||
else
|
else
|
||||||
queries_per_second1000= thd->query_id * LL(1000) / uptime;
|
queries_per_second1000= thd->query_id * LL(1000) / uptime;
|
||||||
|
|
||||||
length= my_snprintf((char*) buff, buff_len - 1,
|
#if defined(SAFEMALLOC) || !defined(EMBEDDED_LIBRARY)
|
||||||
|
length=
|
||||||
|
#endif
|
||||||
|
my_snprintf((char*) buff, buff_len - 1,
|
||||||
"Uptime: %lu Threads: %d Questions: %lu "
|
"Uptime: %lu Threads: %d Questions: %lu "
|
||||||
"Slow queries: %lu Opens: %lu Flush tables: %lu "
|
"Slow queries: %lu Opens: %lu Flush tables: %lu "
|
||||||
"Open tables: %u Queries per second avg: %u.%u",
|
"Open tables: %u Queries per second avg: %u.%u",
|
||||||
@ -1392,10 +1397,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||||||
cached_open_tables(),
|
cached_open_tables(),
|
||||||
(uint) (queries_per_second1000 / 1000),
|
(uint) (queries_per_second1000 / 1000),
|
||||||
(uint) (queries_per_second1000 % 1000));
|
(uint) (queries_per_second1000 % 1000));
|
||||||
#ifdef EMBEDDED_LIBRARY
|
|
||||||
/* Store the buffer in permanent memory */
|
|
||||||
send_ok(thd, 0, 0, buff);
|
|
||||||
#endif
|
|
||||||
#ifdef SAFEMALLOC
|
#ifdef SAFEMALLOC
|
||||||
if (sf_malloc_cur_memory) // Using SAFEMALLOC
|
if (sf_malloc_cur_memory) // Using SAFEMALLOC
|
||||||
{
|
{
|
||||||
@ -1406,7 +1407,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||||||
(sf_malloc_max_memory+1023L)/1024L);
|
(sf_malloc_max_memory+1023L)/1024L);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifdef EMBEDDED_LIBRARY
|
||||||
|
/* Store the buffer in permanent memory */
|
||||||
|
send_ok(thd, 0, 0, buff);
|
||||||
|
#else
|
||||||
VOID(my_net_write(net, (uchar*) buff, length));
|
VOID(my_net_write(net, (uchar*) buff, length));
|
||||||
VOID(net_flush(net));
|
VOID(net_flush(net));
|
||||||
thd->main_da.disable_status();
|
thd->main_da.disable_status();
|
||||||
@ -2153,7 +2157,6 @@ mysql_execute_command(THD *thd)
|
|||||||
my_error(ER_FEATURE_DISABLED, MYF(0), "SHOW PROFILES", "enable-profiling");
|
my_error(ER_FEATURE_DISABLED, MYF(0), "SHOW PROFILES", "enable-profiling");
|
||||||
goto error;
|
goto error;
|
||||||
#endif
|
#endif
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case SQLCOM_SHOW_NEW_MASTER:
|
case SQLCOM_SHOW_NEW_MASTER:
|
||||||
{
|
{
|
||||||
|
@ -2597,7 +2597,7 @@ TYPELIB* sys_var_pluginvar::plugin_var_typelib(void)
|
|||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL; /* Keep compiler happy */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2273,7 +2273,6 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
|
|||||||
uchar *packet_end= packet + packet_length;
|
uchar *packet_end= packet + packet_length;
|
||||||
#endif
|
#endif
|
||||||
Prepared_statement *stmt;
|
Prepared_statement *stmt;
|
||||||
bool error;
|
|
||||||
DBUG_ENTER("mysql_stmt_execute");
|
DBUG_ENTER("mysql_stmt_execute");
|
||||||
|
|
||||||
packet+= 9; /* stmt_id + 5 bytes of flags */
|
packet+= 9; /* stmt_id + 5 bytes of flags */
|
||||||
@ -2321,7 +2320,7 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
|
|||||||
*/
|
*/
|
||||||
DBUG_ASSERT(thd->free_list == NULL);
|
DBUG_ASSERT(thd->free_list == NULL);
|
||||||
|
|
||||||
error= stmt->execute(&expanded_query,
|
(void) stmt->execute(&expanded_query,
|
||||||
test(flags & (ulong) CURSOR_TYPE_READ_ONLY));
|
test(flags & (ulong) CURSOR_TYPE_READ_ONLY));
|
||||||
if (!(specialflag & SPECIAL_NO_PRIOR))
|
if (!(specialflag & SPECIAL_NO_PRIOR))
|
||||||
my_pthread_setprio(pthread_self(), WAIT_PRIOR);
|
my_pthread_setprio(pthread_self(), WAIT_PRIOR);
|
||||||
|
@ -2113,20 +2113,20 @@ static bool show_status_array(THD *thd, const char *wild,
|
|||||||
*/
|
*/
|
||||||
switch (show_type) {
|
switch (show_type) {
|
||||||
case SHOW_DOUBLE_STATUS:
|
case SHOW_DOUBLE_STATUS:
|
||||||
value= ((char *) status_var + (ulong) value);
|
value= ((char *) status_var + (intptr) value);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case SHOW_DOUBLE:
|
case SHOW_DOUBLE:
|
||||||
end= buff + my_sprintf(buff, (buff, "%f", *(double*) value));
|
end= buff + my_sprintf(buff, (buff, "%f", *(double*) value));
|
||||||
break;
|
break;
|
||||||
case SHOW_LONG_STATUS:
|
case SHOW_LONG_STATUS:
|
||||||
value= ((char *) status_var + (ulong) value);
|
value= ((char *) status_var + (intptr) value);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case SHOW_LONG:
|
case SHOW_LONG:
|
||||||
case SHOW_LONG_NOFLUSH: // the difference lies in refresh_status()
|
case SHOW_LONG_NOFLUSH: // the difference lies in refresh_status()
|
||||||
end= int10_to_str(*(long*) value, buff, 10);
|
end= int10_to_str(*(long*) value, buff, 10);
|
||||||
break;
|
break;
|
||||||
case SHOW_LONGLONG_STATUS:
|
case SHOW_LONGLONG_STATUS:
|
||||||
value= ((char *) status_var + (ulonglong) value);
|
value= ((char *) status_var + (intptr) value);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case SHOW_LONGLONG:
|
case SHOW_LONGLONG:
|
||||||
end= longlong10_to_str(*(longlong*) value, buff, 10);
|
end= longlong10_to_str(*(longlong*) value, buff, 10);
|
||||||
|
@ -3478,7 +3478,6 @@ bool mysql_create_table_no_lock(THD *thd,
|
|||||||
goto warn;
|
goto warn;
|
||||||
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
|
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
|
||||||
goto unlock_and_end;
|
goto unlock_and_end;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
DBUG_PRINT("info", ("error: %u from storage engine", retcode));
|
DBUG_PRINT("info", ("error: %u from storage engine", retcode));
|
||||||
my_error(retcode, MYF(0),table_name);
|
my_error(retcode, MYF(0),table_name);
|
||||||
@ -5865,7 +5864,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
|||||||
uint *index_drop_buffer;
|
uint *index_drop_buffer;
|
||||||
uint index_add_count;
|
uint index_add_count;
|
||||||
uint *index_add_buffer;
|
uint *index_add_buffer;
|
||||||
bool committed= 0;
|
|
||||||
DBUG_ENTER("mysql_alter_table");
|
DBUG_ENTER("mysql_alter_table");
|
||||||
|
|
||||||
LINT_INIT(index_add_count);
|
LINT_INIT(index_add_count);
|
||||||
@ -6631,7 +6629,6 @@ view_err:
|
|||||||
DBUG_PRINT("info", ("Committing before unlocking table"));
|
DBUG_PRINT("info", ("Committing before unlocking table"));
|
||||||
if (ha_commit_stmt(thd) || ha_commit(thd))
|
if (ha_commit_stmt(thd) || ha_commit(thd))
|
||||||
goto err1;
|
goto err1;
|
||||||
committed= 1;
|
|
||||||
}
|
}
|
||||||
/*end of if (! new_table) for add/drop index*/
|
/*end of if (! new_table) for add/drop index*/
|
||||||
|
|
||||||
|
@ -514,7 +514,7 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags)
|
|||||||
int error, table_type;
|
int error, table_type;
|
||||||
bool error_given;
|
bool error_given;
|
||||||
File file;
|
File file;
|
||||||
uchar head[288], *disk_buff;
|
uchar head[288];
|
||||||
char path[FN_REFLEN];
|
char path[FN_REFLEN];
|
||||||
MEM_ROOT **root_ptr, *old_root;
|
MEM_ROOT **root_ptr, *old_root;
|
||||||
DBUG_ENTER("open_table_def");
|
DBUG_ENTER("open_table_def");
|
||||||
@ -523,7 +523,6 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags)
|
|||||||
|
|
||||||
error= 1;
|
error= 1;
|
||||||
error_given= 0;
|
error_given= 0;
|
||||||
disk_buff= NULL;
|
|
||||||
|
|
||||||
strxmov(path, share->normalized_path.str, reg_ext, NullS);
|
strxmov(path, share->normalized_path.str, reg_ext, NullS);
|
||||||
if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0)
|
if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0)
|
||||||
|
@ -561,7 +561,7 @@ bool parse_date_time_format(timestamp_type format_type,
|
|||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DBUG_ASSERT(1);
|
DBUG_ASSERT(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 1; // Error
|
return 1; // Error
|
||||||
|
@ -71,29 +71,29 @@ ma_pagecache_common_cppflags = -DEXTRA_DEBUG -DPAGECACHE_DEBUG -DMAIN
|
|||||||
ma_pagecache_single_1k_t_SOURCES = $(ma_pagecache_single_src)
|
ma_pagecache_single_1k_t_SOURCES = $(ma_pagecache_single_src)
|
||||||
ma_pagecache_single_8k_t_SOURCES = $(ma_pagecache_single_src)
|
ma_pagecache_single_8k_t_SOURCES = $(ma_pagecache_single_src)
|
||||||
ma_pagecache_single_64k_t_SOURCES = $(ma_pagecache_single_src)
|
ma_pagecache_single_64k_t_SOURCES = $(ma_pagecache_single_src)
|
||||||
ma_pagecache_single_1k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024
|
ma_pagecache_single_1k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DTEST_PAGE_SIZE=1024
|
||||||
ma_pagecache_single_8k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=8192
|
ma_pagecache_single_8k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DTEST_PAGE_SIZE=8192
|
||||||
ma_pagecache_single_64k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DBIG
|
ma_pagecache_single_64k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DTEST_PAGE_SIZE=65536 -DBIG
|
||||||
|
|
||||||
ma_pagecache_consist_1k_t_SOURCES = $(ma_pagecache_consist_src)
|
ma_pagecache_consist_1k_t_SOURCES = $(ma_pagecache_consist_src)
|
||||||
ma_pagecache_consist_1k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024
|
ma_pagecache_consist_1k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DTEST_PAGE_SIZE=1024
|
||||||
ma_pagecache_consist_64k_t_SOURCES = $(ma_pagecache_consist_src)
|
ma_pagecache_consist_64k_t_SOURCES = $(ma_pagecache_consist_src)
|
||||||
ma_pagecache_consist_64k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536
|
ma_pagecache_consist_64k_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DTEST_PAGE_SIZE=65536
|
||||||
|
|
||||||
ma_pagecache_consist_1kHC_t_SOURCES = $(ma_pagecache_consist_src)
|
ma_pagecache_consist_1kHC_t_SOURCES = $(ma_pagecache_consist_src)
|
||||||
ma_pagecache_consist_1kHC_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024 -DTEST_HIGH_CONCURENCY
|
ma_pagecache_consist_1kHC_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DTEST_PAGE_SIZE=1024 -DTEST_HIGH_CONCURENCY
|
||||||
ma_pagecache_consist_64kHC_t_SOURCES = $(ma_pagecache_consist_src)
|
ma_pagecache_consist_64kHC_t_SOURCES = $(ma_pagecache_consist_src)
|
||||||
ma_pagecache_consist_64kHC_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DTEST_HIGH_CONCURENCY
|
ma_pagecache_consist_64kHC_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DTEST_PAGE_SIZE=65536 -DTEST_HIGH_CONCURENCY
|
||||||
|
|
||||||
ma_pagecache_consist_1kRD_t_SOURCES = $(ma_pagecache_consist_src)
|
ma_pagecache_consist_1kRD_t_SOURCES = $(ma_pagecache_consist_src)
|
||||||
ma_pagecache_consist_1kRD_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024 -DTEST_READERS
|
ma_pagecache_consist_1kRD_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DTEST_PAGE_SIZE=1024 -DTEST_READERS
|
||||||
ma_pagecache_consist_64kRD_t_SOURCES = $(ma_pagecache_consist_src)
|
ma_pagecache_consist_64kRD_t_SOURCES = $(ma_pagecache_consist_src)
|
||||||
ma_pagecache_consist_64kRD_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DTEST_READERS
|
ma_pagecache_consist_64kRD_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DTEST_PAGE_SIZE=65536 -DTEST_READERS
|
||||||
|
|
||||||
ma_pagecache_consist_1kWR_t_SOURCES = $(ma_pagecache_consist_src)
|
ma_pagecache_consist_1kWR_t_SOURCES = $(ma_pagecache_consist_src)
|
||||||
ma_pagecache_consist_1kWR_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=1024 -DTEST_WRITERS
|
ma_pagecache_consist_1kWR_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DTEST_PAGE_SIZE=1024 -DTEST_WRITERS
|
||||||
ma_pagecache_consist_64kWR_t_SOURCES = $(ma_pagecache_consist_src)
|
ma_pagecache_consist_64kWR_t_SOURCES = $(ma_pagecache_consist_src)
|
||||||
ma_pagecache_consist_64kWR_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPAGE_SIZE=65536 -DTEST_WRITERS
|
ma_pagecache_consist_64kWR_t_CPPFLAGS = $(ma_pagecache_common_cppflags) -DTEST_PAGE_SIZE=65536 -DTEST_WRITERS
|
||||||
|
|
||||||
# the generic lock manager may not be used in the end and lockman1-t crashes,
|
# the generic lock manager may not be used in the end and lockman1-t crashes,
|
||||||
# so we don't build lockman-t and lockman1-t
|
# so we don't build lockman-t and lockman1-t
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "test_file.h"
|
#include "test_file.h"
|
||||||
#include <tap.h>
|
#include <tap.h>
|
||||||
|
|
||||||
#define PCACHE_SIZE (PAGE_SIZE*1024*8)
|
#define PCACHE_SIZE (TEST_PAGE_SIZE*1024*8)
|
||||||
|
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
static const char* default_dbug_option;
|
static const char* default_dbug_option;
|
||||||
@ -26,7 +26,7 @@ static PAGECACHE pagecache;
|
|||||||
static uint number_of_readers= 10;
|
static uint number_of_readers= 10;
|
||||||
static uint number_of_writers= 20;
|
static uint number_of_writers= 20;
|
||||||
static uint number_of_tests= 30000;
|
static uint number_of_tests= 30000;
|
||||||
static uint record_length_limit= PAGE_SIZE/200;
|
static uint record_length_limit= TEST_PAGE_SIZE/200;
|
||||||
static uint number_of_pages= 20;
|
static uint number_of_pages= 20;
|
||||||
static uint flush_divider= 1000;
|
static uint flush_divider= 1000;
|
||||||
#else /*TEST_HIGH_CONCURENCY*/
|
#else /*TEST_HIGH_CONCURENCY*/
|
||||||
@ -34,7 +34,7 @@ static uint flush_divider= 1000;
|
|||||||
static uint number_of_readers= 10;
|
static uint number_of_readers= 10;
|
||||||
static uint number_of_writers= 1;
|
static uint number_of_writers= 1;
|
||||||
static uint number_of_tests= 30000;
|
static uint number_of_tests= 30000;
|
||||||
static uint record_length_limit= PAGE_SIZE/200;
|
static uint record_length_limit= TEST_PAGE_SIZE/200;
|
||||||
static uint number_of_pages= 20;
|
static uint number_of_pages= 20;
|
||||||
static uint flush_divider= 1000;
|
static uint flush_divider= 1000;
|
||||||
#undef SKIP_BIG_TESTS
|
#undef SKIP_BIG_TESTS
|
||||||
@ -44,7 +44,7 @@ static uint flush_divider= 1000;
|
|||||||
static uint number_of_readers= 0;
|
static uint number_of_readers= 0;
|
||||||
static uint number_of_writers= 10;
|
static uint number_of_writers= 10;
|
||||||
static uint number_of_tests= 30000;
|
static uint number_of_tests= 30000;
|
||||||
static uint record_length_limit= PAGE_SIZE/200;
|
static uint record_length_limit= TEST_PAGE_SIZE/200;
|
||||||
static uint number_of_pages= 20;
|
static uint number_of_pages= 20;
|
||||||
static uint flush_divider= 1000;
|
static uint flush_divider= 1000;
|
||||||
#undef SKIP_BIG_TESTS
|
#undef SKIP_BIG_TESTS
|
||||||
@ -53,7 +53,7 @@ static uint flush_divider= 1000;
|
|||||||
static uint number_of_readers= 10;
|
static uint number_of_readers= 10;
|
||||||
static uint number_of_writers= 10;
|
static uint number_of_writers= 10;
|
||||||
static uint number_of_tests= 50000;
|
static uint number_of_tests= 50000;
|
||||||
static uint record_length_limit= PAGE_SIZE/200;
|
static uint record_length_limit= TEST_PAGE_SIZE/200;
|
||||||
static uint number_of_pages= 20000;
|
static uint number_of_pages= 20000;
|
||||||
static uint flush_divider= 1000;
|
static uint flush_divider= 1000;
|
||||||
#endif /*TEST_WRITERS*/
|
#endif /*TEST_WRITERS*/
|
||||||
@ -116,7 +116,7 @@ uint check_page(uchar *buff, ulong offset, int page_locked, int page_no,
|
|||||||
uint len= *((uint *)(buff + end));
|
uint len= *((uint *)(buff + end));
|
||||||
uint j;
|
uint j;
|
||||||
end+= sizeof(uint) + sizeof(uint);
|
end+= sizeof(uint) + sizeof(uint);
|
||||||
if (len + end > PAGE_SIZE)
|
if (len + end > TEST_PAGE_SIZE)
|
||||||
{
|
{
|
||||||
diag("incorrect field header #%u by offset %lu\n", i, offset + end);
|
diag("incorrect field header #%u by offset %lu\n", i, offset + end);
|
||||||
goto err;
|
goto err;
|
||||||
@ -131,7 +131,7 @@ uint check_page(uchar *buff, ulong offset, int page_locked, int page_no,
|
|||||||
}
|
}
|
||||||
end+= len;
|
end+= len;
|
||||||
}
|
}
|
||||||
for(i= end; i < PAGE_SIZE; i++)
|
for(i= end; i < TEST_PAGE_SIZE; i++)
|
||||||
{
|
{
|
||||||
if (buff[i] != 0)
|
if (buff[i] != 0)
|
||||||
{
|
{
|
||||||
@ -146,7 +146,7 @@ uint check_page(uchar *buff, ulong offset, int page_locked, int page_no,
|
|||||||
(page_locked ? "locked" : "unlocked"),
|
(page_locked ? "locked" : "unlocked"),
|
||||||
end, num, tag);
|
end, num, tag);
|
||||||
h= my_open("wrong_page", O_CREAT | O_TRUNC | O_RDWR, MYF(0));
|
h= my_open("wrong_page", O_CREAT | O_TRUNC | O_RDWR, MYF(0));
|
||||||
my_pwrite(h, (uchar*) buff, PAGE_SIZE, 0, MYF(0));
|
my_pwrite(h, (uchar*) buff, TEST_PAGE_SIZE, 0, MYF(0));
|
||||||
my_close(h, MYF(0));
|
my_close(h, MYF(0));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ void put_rec(uchar *buff, uint end, uint len, uint tag)
|
|||||||
uint num= *((uint *)buff);
|
uint num= *((uint *)buff);
|
||||||
if (!len)
|
if (!len)
|
||||||
len= 1;
|
len= 1;
|
||||||
if (end + sizeof(uint)*2 + len > PAGE_SIZE)
|
if (end + sizeof(uint)*2 + len > TEST_PAGE_SIZE)
|
||||||
return;
|
return;
|
||||||
*((uint *)(buff + end))= len;
|
*((uint *)(buff + end))= len;
|
||||||
end+= sizeof(uint);
|
end+= sizeof(uint);
|
||||||
@ -217,7 +217,7 @@ void reset_file(PAGECACHE_FILE file, char *file_name)
|
|||||||
|
|
||||||
void reader(int num)
|
void reader(int num)
|
||||||
{
|
{
|
||||||
unsigned char *buffr= malloc(PAGE_SIZE);
|
unsigned char *buffr= malloc(TEST_PAGE_SIZE);
|
||||||
uint i;
|
uint i;
|
||||||
|
|
||||||
for (i= 0; i < number_of_tests; i++)
|
for (i= 0; i < number_of_tests; i++)
|
||||||
@ -227,7 +227,7 @@ void reader(int num)
|
|||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
0);
|
0);
|
||||||
check_page(buffr, page * PAGE_SIZE, 0, page, -num);
|
check_page(buffr, page * TEST_PAGE_SIZE, 0, page, -num);
|
||||||
|
|
||||||
}
|
}
|
||||||
free(buffr);
|
free(buffr);
|
||||||
@ -236,7 +236,7 @@ void reader(int num)
|
|||||||
|
|
||||||
void writer(int num)
|
void writer(int num)
|
||||||
{
|
{
|
||||||
unsigned char *buffr= malloc(PAGE_SIZE);
|
unsigned char *buffr= malloc(TEST_PAGE_SIZE);
|
||||||
uint i;
|
uint i;
|
||||||
|
|
||||||
for (i= 0; i < number_of_tests; i++)
|
for (i= 0; i < number_of_tests; i++)
|
||||||
@ -247,7 +247,7 @@ void writer(int num)
|
|||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_WRITE,
|
PAGECACHE_LOCK_WRITE,
|
||||||
0);
|
0);
|
||||||
end= check_page(buffr, page * PAGE_SIZE, 1, page, num);
|
end= check_page(buffr, page * TEST_PAGE_SIZE, 1, page, num);
|
||||||
put_rec(buffr, end, get_len(record_length_limit), num);
|
put_rec(buffr, end, get_len(record_length_limit), num);
|
||||||
pagecache_write(&pagecache, &file1, page, 3, buffr,
|
pagecache_write(&pagecache, &file1, page, 3, buffr,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
@ -381,7 +381,7 @@ int main(int argc __attribute__((unused)),
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
|
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
|
||||||
PAGE_SIZE, 0)) == 0)
|
TEST_PAGE_SIZE, 0)) == 0)
|
||||||
{
|
{
|
||||||
diag("Got error: init_pagecache() (errno: %d)\n",
|
diag("Got error: init_pagecache() (errno: %d)\n",
|
||||||
errno);
|
errno);
|
||||||
@ -389,9 +389,9 @@ int main(int argc __attribute__((unused)),
|
|||||||
}
|
}
|
||||||
DBUG_PRINT("info", ("Page cache %d pages", pagen));
|
DBUG_PRINT("info", ("Page cache %d pages", pagen));
|
||||||
{
|
{
|
||||||
unsigned char *buffr= malloc(PAGE_SIZE);
|
unsigned char *buffr= malloc(TEST_PAGE_SIZE);
|
||||||
uint i;
|
uint i;
|
||||||
memset(buffr, '\0', PAGE_SIZE);
|
memset(buffr, '\0', TEST_PAGE_SIZE);
|
||||||
for (i= 0; i < number_of_pages; i++)
|
for (i= 0; i < number_of_pages; i++)
|
||||||
{
|
{
|
||||||
pagecache_write(&pagecache, &file1, i, 3, buffr,
|
pagecache_write(&pagecache, &file1, i, 3, buffr,
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "test_file.h"
|
#include "test_file.h"
|
||||||
#include <tap.h>
|
#include <tap.h>
|
||||||
|
|
||||||
#define PCACHE_SIZE (PAGE_SIZE*1024*10)
|
#define PCACHE_SIZE (TEST_PAGE_SIZE*1024*10)
|
||||||
|
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
static const char* default_dbug_option;
|
static const char* default_dbug_option;
|
||||||
@ -33,50 +33,50 @@ static PAGECACHE pagecache;
|
|||||||
*/
|
*/
|
||||||
static struct file_desc simple_read_write_test_file[]=
|
static struct file_desc simple_read_write_test_file[]=
|
||||||
{
|
{
|
||||||
{PAGE_SIZE, '\1'},
|
{ TEST_PAGE_SIZE, '\1'},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
static struct file_desc simple_read_change_write_read_test_file[]=
|
static struct file_desc simple_read_change_write_read_test_file[]=
|
||||||
{
|
{
|
||||||
{PAGE_SIZE/2, '\65'},
|
{ TEST_PAGE_SIZE/2, '\65'},
|
||||||
{PAGE_SIZE/2, '\1'},
|
{ TEST_PAGE_SIZE/2, '\1'},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
static struct file_desc simple_pin_test_file1[]=
|
static struct file_desc simple_pin_test_file1[]=
|
||||||
{
|
{
|
||||||
{PAGE_SIZE*2, '\1'},
|
{ TEST_PAGE_SIZE*2, '\1'},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
static struct file_desc simple_pin_test_file2[]=
|
static struct file_desc simple_pin_test_file2[]=
|
||||||
{
|
{
|
||||||
{PAGE_SIZE/2, '\1'},
|
{ TEST_PAGE_SIZE/2, '\1'},
|
||||||
{PAGE_SIZE/2, (unsigned char)129},
|
{ TEST_PAGE_SIZE/2, (unsigned char)129},
|
||||||
{PAGE_SIZE, '\1'},
|
{ TEST_PAGE_SIZE, '\1'},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
static struct file_desc simple_pin_no_lock_test_file1[]=
|
static struct file_desc simple_pin_no_lock_test_file1[]=
|
||||||
{
|
{
|
||||||
{PAGE_SIZE, '\4'},
|
{ TEST_PAGE_SIZE, '\4'},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
static struct file_desc simple_pin_no_lock_test_file2[]=
|
static struct file_desc simple_pin_no_lock_test_file2[]=
|
||||||
{
|
{
|
||||||
{PAGE_SIZE, '\5'},
|
{ TEST_PAGE_SIZE, '\5'},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
static struct file_desc simple_pin_no_lock_test_file3[]=
|
static struct file_desc simple_pin_no_lock_test_file3[]=
|
||||||
{
|
{
|
||||||
{PAGE_SIZE, '\6'},
|
{ TEST_PAGE_SIZE, '\6'},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
static struct file_desc simple_delete_forget_test_file[]=
|
static struct file_desc simple_delete_forget_test_file[]=
|
||||||
{
|
{
|
||||||
{PAGE_SIZE, '\1'},
|
{ TEST_PAGE_SIZE, '\1'},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
static struct file_desc simple_delete_flush_test_file[]=
|
static struct file_desc simple_delete_flush_test_file[]=
|
||||||
{
|
{
|
||||||
{PAGE_SIZE, '\2'},
|
{ TEST_PAGE_SIZE, '\2'},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -135,11 +135,11 @@ void reset_file(PAGECACHE_FILE *file, const char *file_name)
|
|||||||
|
|
||||||
int simple_read_write_test()
|
int simple_read_write_test()
|
||||||
{
|
{
|
||||||
unsigned char *buffw= malloc(PAGE_SIZE);
|
unsigned char *buffw= malloc(TEST_PAGE_SIZE);
|
||||||
unsigned char *buffr= malloc(PAGE_SIZE);
|
unsigned char *buffr= malloc(TEST_PAGE_SIZE);
|
||||||
int res;
|
int res;
|
||||||
DBUG_ENTER("simple_read_write_test");
|
DBUG_ENTER("simple_read_write_test");
|
||||||
bfill(buffw, PAGE_SIZE, '\1');
|
bfill(buffw, TEST_PAGE_SIZE, '\1');
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
@ -150,14 +150,14 @@ int simple_read_write_test()
|
|||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
0);
|
0);
|
||||||
ok((res= test(memcmp(buffr, buffw, PAGE_SIZE) == 0)),
|
ok((res= test(memcmp(buffr, buffw, TEST_PAGE_SIZE) == 0)),
|
||||||
"Simple write-read page ");
|
"Simple write-read page ");
|
||||||
if (flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE))
|
if (flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE))
|
||||||
{
|
{
|
||||||
diag("Got error during flushing pagecache\n");
|
diag("Got error during flushing pagecache\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
ok((res&= test(test_file(file1, file1_name, PAGE_SIZE, PAGE_SIZE,
|
ok((res&= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
|
||||||
simple_read_write_test_file))),
|
simple_read_write_test_file))),
|
||||||
"Simple write-read page file");
|
"Simple write-read page file");
|
||||||
if (res)
|
if (res)
|
||||||
@ -174,13 +174,13 @@ int simple_read_write_test()
|
|||||||
*/
|
*/
|
||||||
int simple_read_change_write_read_test()
|
int simple_read_change_write_read_test()
|
||||||
{
|
{
|
||||||
unsigned char *buffw= malloc(PAGE_SIZE);
|
unsigned char *buffw= malloc(TEST_PAGE_SIZE);
|
||||||
unsigned char *buffr= malloc(PAGE_SIZE);
|
unsigned char *buffr= malloc(TEST_PAGE_SIZE);
|
||||||
int res, res2;
|
int res, res2;
|
||||||
DBUG_ENTER("simple_read_change_write_read_test");
|
DBUG_ENTER("simple_read_change_write_read_test");
|
||||||
|
|
||||||
/* prepare the file */
|
/* prepare the file */
|
||||||
bfill(buffw, PAGE_SIZE, '\1');
|
bfill(buffw, TEST_PAGE_SIZE, '\1');
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
@ -197,7 +197,7 @@ int simple_read_change_write_read_test()
|
|||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_WRITE,
|
PAGECACHE_LOCK_WRITE,
|
||||||
0);
|
0);
|
||||||
bfill(buffw, PAGE_SIZE/2, '\65');
|
bfill(buffw, TEST_PAGE_SIZE/2, '\65');
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_WRITE_UNLOCK,
|
PAGECACHE_LOCK_WRITE_UNLOCK,
|
||||||
@ -209,7 +209,7 @@ int simple_read_change_write_read_test()
|
|||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
0);
|
0);
|
||||||
ok((res= test(memcmp(buffr, buffw, PAGE_SIZE) == 0)),
|
ok((res= test(memcmp(buffr, buffw, TEST_PAGE_SIZE) == 0)),
|
||||||
"Simple read-change-write-read page ");
|
"Simple read-change-write-read page ");
|
||||||
DBUG_ASSERT(pagecache.blocks_changed == 1);
|
DBUG_ASSERT(pagecache.blocks_changed == 1);
|
||||||
if (flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE))
|
if (flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE))
|
||||||
@ -218,7 +218,7 @@ int simple_read_change_write_read_test()
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
DBUG_ASSERT(pagecache.blocks_changed == 0);
|
DBUG_ASSERT(pagecache.blocks_changed == 0);
|
||||||
ok((res2= test(test_file(file1, file1_name, PAGE_SIZE, PAGE_SIZE,
|
ok((res2= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
|
||||||
simple_read_change_write_read_test_file))),
|
simple_read_change_write_read_test_file))),
|
||||||
"Simple read-change-write-read page file");
|
"Simple read-change-write-read page file");
|
||||||
if (res && res2)
|
if (res && res2)
|
||||||
@ -239,11 +239,11 @@ int simple_read_change_write_read_test()
|
|||||||
*/
|
*/
|
||||||
int simple_pin_test()
|
int simple_pin_test()
|
||||||
{
|
{
|
||||||
unsigned char *buffw= malloc(PAGE_SIZE);
|
unsigned char *buffw= malloc(TEST_PAGE_SIZE);
|
||||||
int res;
|
int res;
|
||||||
DBUG_ENTER("simple_pin_test");
|
DBUG_ENTER("simple_pin_test");
|
||||||
/* prepare the file */
|
/* prepare the file */
|
||||||
bfill(buffw, PAGE_SIZE, '\1');
|
bfill(buffw, TEST_PAGE_SIZE, '\1');
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
@ -266,7 +266,7 @@ int simple_pin_test()
|
|||||||
PAGECACHE_PIN_LEFT_UNPINNED,
|
PAGECACHE_PIN_LEFT_UNPINNED,
|
||||||
PAGECACHE_WRITE_DELAY,
|
PAGECACHE_WRITE_DELAY,
|
||||||
0, LSN_IMPOSSIBLE);
|
0, LSN_IMPOSSIBLE);
|
||||||
bfill(buffw + PAGE_SIZE/2, PAGE_SIZE/2, ((unsigned char) 129));
|
bfill(buffw + TEST_PAGE_SIZE/2, TEST_PAGE_SIZE/2, ((unsigned char) 129));
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_WRITE_TO_READ,
|
PAGECACHE_LOCK_WRITE_TO_READ,
|
||||||
@ -283,7 +283,7 @@ int simple_pin_test()
|
|||||||
res= 0;
|
res= 0;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
ok((res= test(test_file(file1, file1_name, PAGE_SIZE*2, PAGE_SIZE*2,
|
ok((res= test(test_file(file1, file1_name, TEST_PAGE_SIZE*2, TEST_PAGE_SIZE*2,
|
||||||
simple_pin_test_file1))),
|
simple_pin_test_file1))),
|
||||||
"Simple pin page file with pin");
|
"Simple pin page file with pin");
|
||||||
pagecache_unlock(&pagecache,
|
pagecache_unlock(&pagecache,
|
||||||
@ -298,7 +298,7 @@ int simple_pin_test()
|
|||||||
res= 0;
|
res= 0;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
ok((res&= test(test_file(file1, file1_name, PAGE_SIZE*2, PAGE_SIZE,
|
ok((res&= test(test_file(file1, file1_name, TEST_PAGE_SIZE*2, TEST_PAGE_SIZE,
|
||||||
simple_pin_test_file2))),
|
simple_pin_test_file2))),
|
||||||
"Simple pin page result file");
|
"Simple pin page result file");
|
||||||
if (res)
|
if (res)
|
||||||
@ -313,12 +313,12 @@ err:
|
|||||||
*/
|
*/
|
||||||
int simple_pin_no_lock_test()
|
int simple_pin_no_lock_test()
|
||||||
{
|
{
|
||||||
unsigned char *buffw= malloc(PAGE_SIZE);
|
unsigned char *buffw= malloc(TEST_PAGE_SIZE);
|
||||||
PAGECACHE_BLOCK_LINK *link;
|
PAGECACHE_BLOCK_LINK *link;
|
||||||
int res;
|
int res;
|
||||||
DBUG_ENTER("simple_pin_no_lock_test");
|
DBUG_ENTER("simple_pin_no_lock_test");
|
||||||
/* prepare the file */
|
/* prepare the file */
|
||||||
bfill(buffw, PAGE_SIZE, '\4');
|
bfill(buffw, TEST_PAGE_SIZE, '\4');
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
@ -331,7 +331,7 @@ int simple_pin_no_lock_test()
|
|||||||
diag("Got error during flushing pagecache 2\n");
|
diag("Got error during flushing pagecache 2\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
bfill(buffw, PAGE_SIZE, '\5');
|
bfill(buffw, TEST_PAGE_SIZE, '\5');
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
@ -348,7 +348,7 @@ int simple_pin_no_lock_test()
|
|||||||
res= 0;
|
res= 0;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
ok((res= test(test_file(file1, file1_name, PAGE_SIZE, PAGE_SIZE,
|
ok((res= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
|
||||||
simple_pin_no_lock_test_file1))),
|
simple_pin_no_lock_test_file1))),
|
||||||
"Simple pin (no lock) page file with pin 2");
|
"Simple pin (no lock) page file with pin 2");
|
||||||
pagecache_unlock(&pagecache,
|
pagecache_unlock(&pagecache,
|
||||||
@ -363,11 +363,11 @@ int simple_pin_no_lock_test()
|
|||||||
res= 0;
|
res= 0;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
ok((res&= test(test_file(file1, file1_name, PAGE_SIZE, PAGE_SIZE,
|
ok((res&= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
|
||||||
simple_pin_no_lock_test_file2))),
|
simple_pin_no_lock_test_file2))),
|
||||||
"Simple pin (no lock) page result file 2");
|
"Simple pin (no lock) page result file 2");
|
||||||
|
|
||||||
bfill(buffw, PAGE_SIZE, '\6');
|
bfill(buffw, TEST_PAGE_SIZE, '\6');
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_WRITE,
|
PAGECACHE_LOCK_WRITE,
|
||||||
@ -383,7 +383,7 @@ int simple_pin_no_lock_test()
|
|||||||
res= 0;
|
res= 0;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
ok((res= test(test_file(file1, file1_name, PAGE_SIZE, PAGE_SIZE,
|
ok((res= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
|
||||||
simple_pin_no_lock_test_file2))),
|
simple_pin_no_lock_test_file2))),
|
||||||
"Simple pin (no lock) page file with pin 3");
|
"Simple pin (no lock) page file with pin 3");
|
||||||
pagecache_unpin_by_link(&pagecache, link, 0);
|
pagecache_unpin_by_link(&pagecache, link, 0);
|
||||||
@ -393,7 +393,7 @@ int simple_pin_no_lock_test()
|
|||||||
res= 0;
|
res= 0;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
ok((res&= test(test_file(file1, file1_name, PAGE_SIZE, PAGE_SIZE,
|
ok((res&= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
|
||||||
simple_pin_no_lock_test_file3))),
|
simple_pin_no_lock_test_file3))),
|
||||||
"Simple pin (no lock) page result file 3");
|
"Simple pin (no lock) page result file 3");
|
||||||
if (res)
|
if (res)
|
||||||
@ -409,12 +409,12 @@ err:
|
|||||||
|
|
||||||
int simple_delete_forget_test()
|
int simple_delete_forget_test()
|
||||||
{
|
{
|
||||||
unsigned char *buffw= malloc(PAGE_SIZE);
|
unsigned char *buffw= malloc(TEST_PAGE_SIZE);
|
||||||
unsigned char *buffr= malloc(PAGE_SIZE);
|
unsigned char *buffr= malloc(TEST_PAGE_SIZE);
|
||||||
int res;
|
int res;
|
||||||
DBUG_ENTER("simple_delete_forget_test");
|
DBUG_ENTER("simple_delete_forget_test");
|
||||||
/* prepare the file */
|
/* prepare the file */
|
||||||
bfill(buffw, PAGE_SIZE, '\1');
|
bfill(buffw, TEST_PAGE_SIZE, '\1');
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
@ -423,7 +423,7 @@ int simple_delete_forget_test()
|
|||||||
0, LSN_IMPOSSIBLE);
|
0, LSN_IMPOSSIBLE);
|
||||||
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
|
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
|
||||||
/* test */
|
/* test */
|
||||||
bfill(buffw, PAGE_SIZE, '\2');
|
bfill(buffw, TEST_PAGE_SIZE, '\2');
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
@ -433,7 +433,7 @@ int simple_delete_forget_test()
|
|||||||
pagecache_delete(&pagecache, &file1, 0,
|
pagecache_delete(&pagecache, &file1, 0,
|
||||||
PAGECACHE_LOCK_WRITE, 0);
|
PAGECACHE_LOCK_WRITE, 0);
|
||||||
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
|
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
|
||||||
ok((res= test(test_file(file1, file1_name, PAGE_SIZE, PAGE_SIZE,
|
ok((res= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
|
||||||
simple_delete_forget_test_file))),
|
simple_delete_forget_test_file))),
|
||||||
"Simple delete-forget page file");
|
"Simple delete-forget page file");
|
||||||
if (res)
|
if (res)
|
||||||
@ -451,13 +451,13 @@ int simple_delete_forget_test()
|
|||||||
|
|
||||||
int simple_delete_flush_test()
|
int simple_delete_flush_test()
|
||||||
{
|
{
|
||||||
unsigned char *buffw= malloc(PAGE_SIZE);
|
unsigned char *buffw= malloc(TEST_PAGE_SIZE);
|
||||||
unsigned char *buffr= malloc(PAGE_SIZE);
|
unsigned char *buffr= malloc(TEST_PAGE_SIZE);
|
||||||
PAGECACHE_BLOCK_LINK *link;
|
PAGECACHE_BLOCK_LINK *link;
|
||||||
int res;
|
int res;
|
||||||
DBUG_ENTER("simple_delete_flush_test");
|
DBUG_ENTER("simple_delete_flush_test");
|
||||||
/* prepare the file */
|
/* prepare the file */
|
||||||
bfill(buffw, PAGE_SIZE, '\1');
|
bfill(buffw, TEST_PAGE_SIZE, '\1');
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_WRITE,
|
PAGECACHE_LOCK_WRITE,
|
||||||
@ -466,7 +466,7 @@ int simple_delete_flush_test()
|
|||||||
&link, LSN_IMPOSSIBLE);
|
&link, LSN_IMPOSSIBLE);
|
||||||
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
|
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
|
||||||
/* test */
|
/* test */
|
||||||
bfill(buffw, PAGE_SIZE, '\2');
|
bfill(buffw, TEST_PAGE_SIZE, '\2');
|
||||||
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
pagecache_write(&pagecache, &file1, 0, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_WRITELOCKED,
|
PAGECACHE_LOCK_LEFT_WRITELOCKED,
|
||||||
@ -480,7 +480,7 @@ int simple_delete_flush_test()
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
|
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
|
||||||
ok((res= test(test_file(file1, file1_name, PAGE_SIZE, PAGE_SIZE,
|
ok((res= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
|
||||||
simple_delete_flush_test_file))),
|
simple_delete_flush_test_file))),
|
||||||
"Simple delete flush (link) page file");
|
"Simple delete flush (link) page file");
|
||||||
if (res)
|
if (res)
|
||||||
@ -497,19 +497,19 @@ int simple_delete_flush_test()
|
|||||||
|
|
||||||
int simple_big_test()
|
int simple_big_test()
|
||||||
{
|
{
|
||||||
unsigned char *buffw= (unsigned char *) my_malloc(PAGE_SIZE, MYF(MY_WME));
|
unsigned char *buffw= (unsigned char *) my_malloc(TEST_PAGE_SIZE, MYF(MY_WME));
|
||||||
unsigned char *buffr= (unsigned char *) my_malloc(PAGE_SIZE, MYF(MY_WME));
|
unsigned char *buffr= (unsigned char *) my_malloc(TEST_PAGE_SIZE, MYF(MY_WME));
|
||||||
struct file_desc *desc= ((struct file_desc *)
|
struct file_desc *desc= ((struct file_desc *)
|
||||||
my_malloc((PCACHE_SIZE/(PAGE_SIZE/2) + 1) *
|
my_malloc((PCACHE_SIZE/(TEST_PAGE_SIZE/2) + 1) *
|
||||||
sizeof(struct file_desc), MYF(MY_WME)));
|
sizeof(struct file_desc), MYF(MY_WME)));
|
||||||
int res, i;
|
int res, i;
|
||||||
DBUG_ENTER("simple_big_test");
|
DBUG_ENTER("simple_big_test");
|
||||||
|
|
||||||
/* prepare the file twice larger then cache */
|
/* prepare the file twice larger then cache */
|
||||||
for (i= 0; i < PCACHE_SIZE/(PAGE_SIZE/2); i++)
|
for (i= 0; i < PCACHE_SIZE/(TEST_PAGE_SIZE/2); i++)
|
||||||
{
|
{
|
||||||
bfill(buffw, PAGE_SIZE, (unsigned char) (i & 0xff));
|
bfill(buffw, TEST_PAGE_SIZE, (unsigned char) (i & 0xff));
|
||||||
desc[i].length= PAGE_SIZE;
|
desc[i].length= TEST_PAGE_SIZE;
|
||||||
desc[i].content= (i & 0xff);
|
desc[i].content= (i & 0xff);
|
||||||
pagecache_write(&pagecache, &file1, i, 3, buffw,
|
pagecache_write(&pagecache, &file1, i, 3, buffw,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
@ -522,14 +522,14 @@ int simple_big_test()
|
|||||||
desc[i].content= '\0';
|
desc[i].content= '\0';
|
||||||
ok(1, "Simple big file write");
|
ok(1, "Simple big file write");
|
||||||
/* check written pages sequentally read */
|
/* check written pages sequentally read */
|
||||||
for (i= 0; i < PCACHE_SIZE/(PAGE_SIZE/2); i++)
|
for (i= 0; i < PCACHE_SIZE/(TEST_PAGE_SIZE/2); i++)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
pagecache_read(&pagecache, &file1, i, 3, buffr,
|
pagecache_read(&pagecache, &file1, i, 3, buffr,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
0);
|
0);
|
||||||
for(j= 0; j < PAGE_SIZE; j++)
|
for(j= 0; j < TEST_PAGE_SIZE; j++)
|
||||||
{
|
{
|
||||||
if (buffr[j] != (i & 0xff))
|
if (buffr[j] != (i & 0xff))
|
||||||
{
|
{
|
||||||
@ -541,15 +541,15 @@ int simple_big_test()
|
|||||||
}
|
}
|
||||||
ok(1, "Simple big file sequential read");
|
ok(1, "Simple big file sequential read");
|
||||||
/* chack random reads */
|
/* chack random reads */
|
||||||
for (i= 0; i < PCACHE_SIZE/(PAGE_SIZE); i++)
|
for (i= 0; i < PCACHE_SIZE/(TEST_PAGE_SIZE); i++)
|
||||||
{
|
{
|
||||||
int j, page;
|
int j, page;
|
||||||
page= rand() % (PCACHE_SIZE/(PAGE_SIZE/2));
|
page= rand() % (PCACHE_SIZE/(TEST_PAGE_SIZE/2));
|
||||||
pagecache_read(&pagecache, &file1, page, 3, buffr,
|
pagecache_read(&pagecache, &file1, page, 3, buffr,
|
||||||
PAGECACHE_PLAIN_PAGE,
|
PAGECACHE_PLAIN_PAGE,
|
||||||
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
PAGECACHE_LOCK_LEFT_UNLOCKED,
|
||||||
0);
|
0);
|
||||||
for(j= 0; j < PAGE_SIZE; j++)
|
for(j= 0; j < TEST_PAGE_SIZE; j++)
|
||||||
{
|
{
|
||||||
if (buffr[j] != (page & 0xff))
|
if (buffr[j] != (page & 0xff))
|
||||||
{
|
{
|
||||||
@ -562,7 +562,7 @@ int simple_big_test()
|
|||||||
ok(1, "Simple big file random read");
|
ok(1, "Simple big file random read");
|
||||||
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
|
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
|
||||||
|
|
||||||
ok((res= test(test_file(file1, file1_name, PCACHE_SIZE*2, PAGE_SIZE,
|
ok((res= test(test_file(file1, file1_name, PCACHE_SIZE*2, TEST_PAGE_SIZE,
|
||||||
desc))),
|
desc))),
|
||||||
"Simple big file");
|
"Simple big file");
|
||||||
if (res)
|
if (res)
|
||||||
@ -699,7 +699,7 @@ int main(int argc __attribute__((unused)),
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
|
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
|
||||||
PAGE_SIZE, MYF(MY_WME))) == 0)
|
TEST_PAGE_SIZE, MYF(MY_WME))) == 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"Got error: init_pagecache() (errno: %d)\n",
|
fprintf(stderr,"Got error: init_pagecache() (errno: %d)\n",
|
||||||
errno);
|
errno);
|
||||||
|
@ -40,7 +40,9 @@
|
|||||||
#define MAX_SERVER_ARGS 64
|
#define MAX_SERVER_ARGS 64
|
||||||
|
|
||||||
/* set default options */
|
/* set default options */
|
||||||
|
#ifdef NOT_USED
|
||||||
static int opt_testcase = 0;
|
static int opt_testcase = 0;
|
||||||
|
#endif
|
||||||
static char *opt_db= 0;
|
static char *opt_db= 0;
|
||||||
static char *opt_user= 0;
|
static char *opt_user= 0;
|
||||||
static char *opt_password= 0;
|
static char *opt_password= 0;
|
||||||
@ -12643,7 +12645,7 @@ static void test_conversion()
|
|||||||
const char *stmt_text;
|
const char *stmt_text;
|
||||||
int rc;
|
int rc;
|
||||||
MYSQL_BIND my_bind[1];
|
MYSQL_BIND my_bind[1];
|
||||||
char buff[4];
|
uchar buff[4];
|
||||||
ulong length;
|
ulong length;
|
||||||
|
|
||||||
myheader("test_conversion");
|
myheader("test_conversion");
|
||||||
@ -12666,7 +12668,7 @@ static void test_conversion()
|
|||||||
check_execute(stmt, rc);
|
check_execute(stmt, rc);
|
||||||
|
|
||||||
bzero((char*) my_bind, sizeof(my_bind));
|
bzero((char*) my_bind, sizeof(my_bind));
|
||||||
my_bind[0].buffer= buff;
|
my_bind[0].buffer= (char*) buff;
|
||||||
my_bind[0].length= &length;
|
my_bind[0].length= &length;
|
||||||
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
|
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
|
||||||
|
|
||||||
@ -12691,7 +12693,7 @@ static void test_conversion()
|
|||||||
rc= mysql_stmt_fetch(stmt);
|
rc= mysql_stmt_fetch(stmt);
|
||||||
DIE_UNLESS(rc == 0);
|
DIE_UNLESS(rc == 0);
|
||||||
DIE_UNLESS(length == 1);
|
DIE_UNLESS(length == 1);
|
||||||
DIE_UNLESS((uchar) buff[0] == 0xE0);
|
DIE_UNLESS(buff[0] == 0xE0);
|
||||||
rc= mysql_stmt_fetch(stmt);
|
rc= mysql_stmt_fetch(stmt);
|
||||||
DIE_UNLESS(rc == MYSQL_NO_DATA);
|
DIE_UNLESS(rc == MYSQL_NO_DATA);
|
||||||
|
|
||||||
@ -15865,11 +15867,10 @@ static void test_bug21206()
|
|||||||
|
|
||||||
static void test_status()
|
static void test_status()
|
||||||
{
|
{
|
||||||
const char *status;
|
|
||||||
DBUG_ENTER("test_status");
|
DBUG_ENTER("test_status");
|
||||||
myheader("test_status");
|
myheader("test_status");
|
||||||
|
|
||||||
if (!(status= mysql_stat(mysql)))
|
if (!mysql_stat(mysql))
|
||||||
{
|
{
|
||||||
myerror("mysql_stat failed"); /* purecov: inspected */
|
myerror("mysql_stat failed"); /* purecov: inspected */
|
||||||
die(__FILE__, __LINE__, "mysql_stat failed"); /* purecov: inspected */
|
die(__FILE__, __LINE__, "mysql_stat failed"); /* purecov: inspected */
|
||||||
@ -17548,7 +17549,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
DBUG_PUSH(argument ? argument : default_dbug_option);
|
DBUG_PUSH(argument ? argument : default_dbug_option);
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
|
#ifdef NOT_USED
|
||||||
opt_testcase = 1;
|
opt_testcase = 1;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
if (argument)
|
if (argument)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user