mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
auto-merge
This commit is contained in:
@ -114,7 +114,13 @@ IF(MSVC)
|
|||||||
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||||
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT})
|
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT})
|
||||||
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
|
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
|
||||||
|
|
||||||
|
# Mark 32 bit executables large address aware so they can
|
||||||
|
# use > 2GB address space
|
||||||
|
IF(CMAKE_SIZEOF_VOID_P MATCHES 4)
|
||||||
|
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
|
||||||
|
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 4)
|
||||||
|
|
||||||
# Disable automatic manifest generation.
|
# Disable automatic manifest generation.
|
||||||
STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
|
STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
|
||||||
${CMAKE_EXE_LINKER_FLAGS})
|
${CMAKE_EXE_LINKER_FLAGS})
|
||||||
|
@ -29,5 +29,5 @@ typedef struct st_line_buffer
|
|||||||
|
|
||||||
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
|
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
|
||||||
extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, my_string str);
|
extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, my_string str);
|
||||||
extern char *batch_readline(LINE_BUFFER *buffer);
|
extern char *batch_readline(LINE_BUFFER *buffer, bool *truncated);
|
||||||
extern void batch_readline_end(LINE_BUFFER *buffer);
|
extern void batch_readline_end(LINE_BUFFER *buffer);
|
||||||
|
@ -112,6 +112,8 @@ extern "C" {
|
|||||||
#define PROMPT_CHAR '\\'
|
#define PROMPT_CHAR '\\'
|
||||||
#define DEFAULT_DELIMITER ";"
|
#define DEFAULT_DELIMITER ";"
|
||||||
|
|
||||||
|
#define MAX_BATCH_BUFFER_SIZE (1024L * 1024L)
|
||||||
|
|
||||||
typedef struct st_status
|
typedef struct st_status
|
||||||
{
|
{
|
||||||
int exit_status;
|
int exit_status;
|
||||||
@ -243,7 +245,7 @@ static COMMANDS commands[] = {
|
|||||||
{ "connect",'r', com_connect,1,
|
{ "connect",'r', com_connect,1,
|
||||||
"Reconnect to the server. Optional arguments are db and host." },
|
"Reconnect to the server. Optional arguments are db and host." },
|
||||||
{ "delimiter", 'd', com_delimiter, 1,
|
{ "delimiter", 'd', com_delimiter, 1,
|
||||||
"Set statement delimiter. NOTE: Takes the rest of the line as new delimiter." },
|
"Set statement delimiter." },
|
||||||
#ifdef USE_POPEN
|
#ifdef USE_POPEN
|
||||||
{ "edit", 'e', com_edit, 0, "Edit command with $EDITOR."},
|
{ "edit", 'e', com_edit, 0, "Edit command with $EDITOR."},
|
||||||
#endif
|
#endif
|
||||||
@ -1035,7 +1037,7 @@ static void fix_history(String *final_command);
|
|||||||
|
|
||||||
static COMMANDS *find_command(char *name,char cmd_name);
|
static COMMANDS *find_command(char *name,char cmd_name);
|
||||||
static bool add_line(String &buffer,char *line,char *in_string,
|
static bool add_line(String &buffer,char *line,char *in_string,
|
||||||
bool *ml_comment);
|
bool *ml_comment, bool truncated);
|
||||||
static void remove_cntrl(String &buffer);
|
static void remove_cntrl(String &buffer);
|
||||||
static void print_table_data(MYSQL_RES *result);
|
static void print_table_data(MYSQL_RES *result);
|
||||||
static void print_table_data_html(MYSQL_RES *result);
|
static void print_table_data_html(MYSQL_RES *result);
|
||||||
@ -1117,7 +1119,7 @@ int main(int argc,char *argv[])
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (status.batch && !status.line_buff &&
|
if (status.batch && !status.line_buff &&
|
||||||
!(status.line_buff=batch_readline_init(opt_max_allowed_packet+512,stdin)))
|
!(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, stdin)))
|
||||||
{
|
{
|
||||||
free_defaults(defaults_argv);
|
free_defaults(defaults_argv);
|
||||||
my_end(0);
|
my_end(0);
|
||||||
@ -1197,7 +1199,7 @@ int main(int argc,char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
sprintf(buff, "%s",
|
sprintf(buff, "%s",
|
||||||
#ifndef NOT_YET
|
#ifndef NOT_YET
|
||||||
"Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer.\n");
|
"Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n");
|
||||||
#else
|
#else
|
||||||
"Type 'help [[%]function name[%]]' to get help on usage of function.\n");
|
"Type 'help [[%]function name[%]]' to get help on usage of function.\n");
|
||||||
#endif
|
#endif
|
||||||
@ -1226,7 +1228,7 @@ sig_handler mysql_sigint(int sig)
|
|||||||
goto err;
|
goto err;
|
||||||
/* kill_buffer is always big enough because max length of %lu is 15 */
|
/* kill_buffer is always big enough because max length of %lu is 15 */
|
||||||
sprintf(kill_buffer, "KILL /*!50000 QUERY */ %lu", mysql_thread_id(&mysql));
|
sprintf(kill_buffer, "KILL /*!50000 QUERY */ %lu", mysql_thread_id(&mysql));
|
||||||
mysql_real_query(kill_mysql, kill_buffer, strlen(kill_buffer));
|
mysql_real_query(kill_mysql, kill_buffer, (uint) strlen(kill_buffer));
|
||||||
mysql_close(kill_mysql);
|
mysql_close(kill_mysql);
|
||||||
tee_fprintf(stdout, "Query aborted by Ctrl+C\n");
|
tee_fprintf(stdout, "Query aborted by Ctrl+C\n");
|
||||||
|
|
||||||
@ -1766,13 +1768,14 @@ static int read_and_execute(bool interactive)
|
|||||||
ulong line_number=0;
|
ulong line_number=0;
|
||||||
bool ml_comment= 0;
|
bool ml_comment= 0;
|
||||||
COMMANDS *com;
|
COMMANDS *com;
|
||||||
|
bool truncated= 0;
|
||||||
status.exit_status=1;
|
status.exit_status=1;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (!interactive)
|
if (!interactive)
|
||||||
{
|
{
|
||||||
line=batch_readline(status.line_buff);
|
line=batch_readline(status.line_buff, &truncated);
|
||||||
/*
|
/*
|
||||||
Skip UTF8 Byte Order Marker (BOM) 0xEFBBBF.
|
Skip UTF8 Byte Order Marker (BOM) 0xEFBBBF.
|
||||||
Editors like "notepad" put this marker in
|
Editors like "notepad" put this marker in
|
||||||
@ -1891,7 +1894,7 @@ static int read_and_execute(bool interactive)
|
|||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (add_line(glob_buffer,line,&in_string,&ml_comment))
|
if (add_line(glob_buffer,line,&in_string,&ml_comment, truncated))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* if in batch mode, send last query even if it doesn't end with \g or go */
|
/* if in batch mode, send last query even if it doesn't end with \g or go */
|
||||||
@ -1977,7 +1980,7 @@ static COMMANDS *find_command(char *name,char cmd_char)
|
|||||||
|
|
||||||
|
|
||||||
static bool add_line(String &buffer,char *line,char *in_string,
|
static bool add_line(String &buffer,char *line,char *in_string,
|
||||||
bool *ml_comment)
|
bool *ml_comment, bool truncated)
|
||||||
{
|
{
|
||||||
uchar inchar;
|
uchar inchar;
|
||||||
char buff[80], *pos, *out;
|
char buff[80], *pos, *out;
|
||||||
@ -2222,8 +2225,23 @@ static bool add_line(String &buffer,char *line,char *in_string,
|
|||||||
}
|
}
|
||||||
if (out != line || !buffer.is_empty())
|
if (out != line || !buffer.is_empty())
|
||||||
{
|
{
|
||||||
*out++='\n';
|
|
||||||
uint length=(uint) (out-line);
|
uint length=(uint) (out-line);
|
||||||
|
|
||||||
|
if (!truncated &&
|
||||||
|
(length < 9 ||
|
||||||
|
my_strnncoll (charset_info,
|
||||||
|
(uchar *)line, 9, (const uchar *) "delimiter", 9)))
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Don't add a new line in case there's a DELIMITER command to be
|
||||||
|
added to the glob buffer (e.g. on processing a line like
|
||||||
|
"<command>;DELIMITER <non-eof>") : similar to how a new line is
|
||||||
|
not added in the case when the DELIMITER is the first command
|
||||||
|
entered with an empty glob buffer.
|
||||||
|
*/
|
||||||
|
*out++='\n';
|
||||||
|
length++;
|
||||||
|
}
|
||||||
if (buffer.length() + length >= buffer.alloced_length())
|
if (buffer.length() + length >= buffer.alloced_length())
|
||||||
buffer.realloc(buffer.length()+length+IO_SIZE);
|
buffer.realloc(buffer.length()+length+IO_SIZE);
|
||||||
if ((!*ml_comment || preserve_comments) && buffer.append(line, length))
|
if ((!*ml_comment || preserve_comments) && buffer.append(line, length))
|
||||||
@ -2832,7 +2850,7 @@ com_charset(String *buffer __attribute__((unused)), char *line)
|
|||||||
param= get_arg(buff, 0);
|
param= get_arg(buff, 0);
|
||||||
if (!param || !*param)
|
if (!param || !*param)
|
||||||
{
|
{
|
||||||
return put_info("Usage: \\C char_setname | charset charset_name",
|
return put_info("Usage: \\C charset_name | charset charset_name",
|
||||||
INFO_ERROR, 0);
|
INFO_ERROR, 0);
|
||||||
}
|
}
|
||||||
new_cs= get_charset_by_csname(param, MY_CS_PRIMARY, MYF(MY_WME));
|
new_cs= get_charset_by_csname(param, MY_CS_PRIMARY, MYF(MY_WME));
|
||||||
@ -3449,7 +3467,7 @@ static void print_warnings()
|
|||||||
|
|
||||||
/* Get the warnings */
|
/* Get the warnings */
|
||||||
query= "show warnings";
|
query= "show warnings";
|
||||||
mysql_real_query_for_lazy(query, strlen(query));
|
mysql_real_query_for_lazy(query, (uint) strlen(query));
|
||||||
mysql_store_result_for_lazy(&result);
|
mysql_store_result_for_lazy(&result);
|
||||||
|
|
||||||
/* Bail out when no warnings */
|
/* Bail out when no warnings */
|
||||||
@ -3872,7 +3890,7 @@ static int com_source(String *buffer, char *line)
|
|||||||
return put_info(buff, INFO_ERROR, 0);
|
return put_info(buff, INFO_ERROR, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(line_buff=batch_readline_init(opt_max_allowed_packet+512,sql_file)))
|
if (!(line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, sql_file)))
|
||||||
{
|
{
|
||||||
my_fclose(sql_file,MYF(0));
|
my_fclose(sql_file,MYF(0));
|
||||||
return put_info("Can't initialize batch_readline", INFO_ERROR, 0);
|
return put_info("Can't initialize batch_readline", INFO_ERROR, 0);
|
||||||
@ -4329,7 +4347,8 @@ server_version_string(MYSQL *con)
|
|||||||
MYSQL_ROW cur = mysql_fetch_row(result);
|
MYSQL_ROW cur = mysql_fetch_row(result);
|
||||||
if (cur && cur[0])
|
if (cur && cur[0])
|
||||||
{
|
{
|
||||||
bufp = strxnmov(bufp, sizeof buf - (bufp - buf), " ", cur[0], NullS);
|
bufp = strxnmov(bufp, (uint) (sizeof buf - (bufp - buf)), " ", cur[0],
|
||||||
|
NullS);
|
||||||
}
|
}
|
||||||
mysql_free_result(result);
|
mysql_free_result(result);
|
||||||
}
|
}
|
||||||
|
@ -429,7 +429,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
|
|||||||
MYF(MY_WME))) < 0)
|
MYF(MY_WME))) < 0)
|
||||||
die("Failed to create temporary file for defaults");
|
die("Failed to create temporary file for defaults");
|
||||||
|
|
||||||
if (my_write(fd, query, strlen(query),
|
if (my_write(fd, query, (uint) strlen(query),
|
||||||
MYF(MY_FNABP | MY_WME)))
|
MYF(MY_FNABP | MY_WME)))
|
||||||
{
|
{
|
||||||
my_close(fd, MYF(0));
|
my_close(fd, MYF(0));
|
||||||
|
@ -844,7 +844,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||||||
bool old= (find_type(argv[0], &command_typelib, 2) ==
|
bool old= (find_type(argv[0], &command_typelib, 2) ==
|
||||||
ADMIN_OLD_PASSWORD);
|
ADMIN_OLD_PASSWORD);
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
uint pw_len= strlen(pw);
|
uint pw_len= (uint) strlen(pw);
|
||||||
if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'')
|
if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'')
|
||||||
printf("Warning: single quotes were not trimmed from the password by"
|
printf("Warning: single quotes were not trimmed from the password by"
|
||||||
" your command\nline client, as you might have expected.\n");
|
" your command\nline client, as you might have expected.\n");
|
||||||
|
@ -105,7 +105,7 @@ static MYSQL* safe_connect();
|
|||||||
class Load_log_processor
|
class Load_log_processor
|
||||||
{
|
{
|
||||||
char target_dir_name[FN_REFLEN];
|
char target_dir_name[FN_REFLEN];
|
||||||
int target_dir_name_len;
|
size_t target_dir_name_len;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
When we see first event corresponding to some LOAD DATA statement in
|
When we see first event corresponding to some LOAD DATA statement in
|
||||||
@ -275,7 +275,7 @@ File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
|
|||||||
File file;
|
File file;
|
||||||
|
|
||||||
fn_format(filename, le->fname, target_dir_name, "", 1);
|
fn_format(filename, le->fname, target_dir_name, "", 1);
|
||||||
len= strlen(filename);
|
len= (uint) strlen(filename);
|
||||||
tail= filename + len;
|
tail= filename + len;
|
||||||
|
|
||||||
if ((file= create_unique_file(filename,tail)) < 0)
|
if ((file= create_unique_file(filename,tail)) < 0)
|
||||||
@ -284,7 +284,7 @@ File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
le->set_fname_outside_temp_buf(filename,len+strlen(tail));
|
le->set_fname_outside_temp_buf(filename,len+(uint) strlen(tail));
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
@ -369,7 +369,7 @@ int Load_log_processor::process_first_event(const char *bname, uint blen,
|
|||||||
uint file_id,
|
uint file_id,
|
||||||
Create_file_log_event *ce)
|
Create_file_log_event *ce)
|
||||||
{
|
{
|
||||||
uint full_len= target_dir_name_len + blen + 9 + 9 + 1;
|
size_t full_len= target_dir_name_len + blen + 9 + 9 + 1;
|
||||||
int error= 0;
|
int error= 0;
|
||||||
char *fname, *ptr;
|
char *fname, *ptr;
|
||||||
File file;
|
File file;
|
||||||
@ -403,7 +403,7 @@ int Load_log_processor::process_first_event(const char *bname, uint blen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ce)
|
if (ce)
|
||||||
ce->set_fname_outside_temp_buf(fname, strlen(fname));
|
ce->set_fname_outside_temp_buf(fname, (uint) strlen(fname));
|
||||||
|
|
||||||
if (my_write(file, (byte*)block, block_len, MYF(MY_WME|MY_NABP)))
|
if (my_write(file, (byte*)block, block_len, MYF(MY_WME|MY_NABP)))
|
||||||
error= -1;
|
error= -1;
|
||||||
@ -416,7 +416,7 @@ int Load_log_processor::process_first_event(const char *bname, uint blen,
|
|||||||
int Load_log_processor::process(Create_file_log_event *ce)
|
int Load_log_processor::process(Create_file_log_event *ce)
|
||||||
{
|
{
|
||||||
const char *bname= ce->fname + dirname_length(ce->fname);
|
const char *bname= ce->fname + dirname_length(ce->fname);
|
||||||
uint blen= ce->fname_len - (bname-ce->fname);
|
uint blen= (uint) (ce->fname_len - (bname-ce->fname));
|
||||||
|
|
||||||
return process_first_event(bname, blen, ce->block, ce->block_len,
|
return process_first_event(bname, blen, ce->block, ce->block_len,
|
||||||
ce->file_id, ce);
|
ce->file_id, ce);
|
||||||
@ -864,7 +864,7 @@ static my_time_t convert_str_to_timestamp(const char* str)
|
|||||||
long dummy_my_timezone;
|
long dummy_my_timezone;
|
||||||
my_bool dummy_in_dst_time_gap;
|
my_bool dummy_in_dst_time_gap;
|
||||||
/* We require a total specification (date AND time) */
|
/* We require a total specification (date AND time) */
|
||||||
if (str_to_datetime(str, strlen(str), &l_time, 0, &was_cut) !=
|
if (str_to_datetime(str, (uint) strlen(str), &l_time, 0, &was_cut) !=
|
||||||
MYSQL_TIMESTAMP_DATETIME || was_cut)
|
MYSQL_TIMESTAMP_DATETIME || was_cut)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Incorrect date and time argument: %s\n", str);
|
fprintf(stderr, "Incorrect date and time argument: %s\n", str);
|
||||||
@ -1109,7 +1109,7 @@ could be out of memory");
|
|||||||
int4store(buf, (uint32)start_position);
|
int4store(buf, (uint32)start_position);
|
||||||
int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);
|
int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);
|
||||||
|
|
||||||
size_s tlen = strlen(logname);
|
size_t tlen= strlen(logname);
|
||||||
if (tlen > UINT_MAX)
|
if (tlen > UINT_MAX)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"Log name too long\n");
|
fprintf(stderr,"Log name too long\n");
|
||||||
|
@ -328,7 +328,7 @@ static int get_options(int *argc, char ***argv)
|
|||||||
|
|
||||||
if (!what_to_do)
|
if (!what_to_do)
|
||||||
{
|
{
|
||||||
int pnlen = strlen(my_progname);
|
size_t pnlen= strlen(my_progname);
|
||||||
|
|
||||||
if (pnlen < 6) /* name too short */
|
if (pnlen < 6) /* name too short */
|
||||||
what_to_do = DO_CHECK;
|
what_to_do = DO_CHECK;
|
||||||
@ -414,7 +414,8 @@ static int process_selected_tables(char *db, char **table_names, int tables)
|
|||||||
space is for more readable output in logs and in case of error
|
space is for more readable output in logs and in case of error
|
||||||
*/
|
*/
|
||||||
char *table_names_comma_sep, *end;
|
char *table_names_comma_sep, *end;
|
||||||
int i, tot_length = 0;
|
size_t tot_length= 0;
|
||||||
|
int i= 0;
|
||||||
|
|
||||||
for (i = 0; i < tables; i++)
|
for (i = 0; i < tables; i++)
|
||||||
tot_length+= fixed_name_length(*(table_names + i)) + 2;
|
tot_length+= fixed_name_length(*(table_names + i)) + 2;
|
||||||
@ -430,7 +431,7 @@ static int process_selected_tables(char *db, char **table_names, int tables)
|
|||||||
*end++= ',';
|
*end++= ',';
|
||||||
}
|
}
|
||||||
*--end = 0;
|
*--end = 0;
|
||||||
handle_request_for_tables(table_names_comma_sep + 1, tot_length - 1);
|
handle_request_for_tables(table_names_comma_sep + 1, (uint) (tot_length - 1));
|
||||||
my_free(table_names_comma_sep, MYF(0));
|
my_free(table_names_comma_sep, MYF(0));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -452,7 +453,7 @@ static uint fixed_name_length(const char *name)
|
|||||||
else if (*p == '.')
|
else if (*p == '.')
|
||||||
extra_length+= 2;
|
extra_length+= 2;
|
||||||
}
|
}
|
||||||
return (p - name) + extra_length;
|
return (uint) ((p - name) + extra_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2000 MySQL AB
|
/* Copyright 2000-2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -662,7 +662,7 @@ static void free_table_ent(char *key)
|
|||||||
byte* get_table_key(const char *entry, uint *length,
|
byte* get_table_key(const char *entry, uint *length,
|
||||||
my_bool not_used __attribute__((unused)))
|
my_bool not_used __attribute__((unused)))
|
||||||
{
|
{
|
||||||
*length= strlen(entry);
|
*length= (uint) strlen(entry);
|
||||||
return (byte*) entry;
|
return (byte*) entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -778,7 +778,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
opt_set_charset= 0;
|
opt_set_charset= 0;
|
||||||
opt_compatible_mode_str= argument;
|
opt_compatible_mode_str= argument;
|
||||||
opt_compatible_mode= find_set(&compatible_mode_typelib,
|
opt_compatible_mode= find_set(&compatible_mode_typelib,
|
||||||
argument, strlen(argument),
|
argument, (uint) strlen(argument),
|
||||||
&err_ptr, &err_len);
|
&err_ptr, &err_len);
|
||||||
if (err_len)
|
if (err_len)
|
||||||
{
|
{
|
||||||
@ -791,7 +791,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
uint size_for_sql_mode= 0;
|
uint size_for_sql_mode= 0;
|
||||||
const char **ptr;
|
const char **ptr;
|
||||||
for (ptr= compatible_mode_names; *ptr; ptr++)
|
for (ptr= compatible_mode_names; *ptr; ptr++)
|
||||||
size_for_sql_mode+= strlen(*ptr);
|
size_for_sql_mode+= (uint) strlen(*ptr);
|
||||||
size_for_sql_mode+= sizeof(compatible_mode_names)-1;
|
size_for_sql_mode+= sizeof(compatible_mode_names)-1;
|
||||||
DBUG_ASSERT(sizeof(compatible_mode_normal_str)>=size_for_sql_mode);
|
DBUG_ASSERT(sizeof(compatible_mode_normal_str)>=size_for_sql_mode);
|
||||||
}
|
}
|
||||||
@ -1039,7 +1039,7 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
|
|||||||
"SET SESSION character_set_results = '%s'",
|
"SET SESSION character_set_results = '%s'",
|
||||||
(const char *) cs_name);
|
(const char *) cs_name);
|
||||||
|
|
||||||
return mysql_real_query(mysql, query_buffer, query_length);
|
return mysql_real_query(mysql, query_buffer, (uint) query_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1129,7 +1129,8 @@ static int connect_to_db(char *host, char *user,char *passwd)
|
|||||||
DB_error(&mysql_connection, "when trying to connect");
|
DB_error(&mysql_connection, "when trying to connect");
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
if (mysql_get_server_version(&mysql_connection) < 40100)
|
if ((mysql_get_server_version(&mysql_connection) < 40100) ||
|
||||||
|
(opt_compatible_mode & 3))
|
||||||
{
|
{
|
||||||
/* Don't dump SET NAMES with a pre-4.1 server (bug#7997). */
|
/* Don't dump SET NAMES with a pre-4.1 server (bug#7997). */
|
||||||
opt_set_charset= 0;
|
opt_set_charset= 0;
|
||||||
@ -1371,7 +1372,8 @@ static void print_xml_tag(FILE * xml_file, const char* sbeg,
|
|||||||
fputs(attribute_name, xml_file);
|
fputs(attribute_name, xml_file);
|
||||||
fputc('\"', xml_file);
|
fputc('\"', xml_file);
|
||||||
|
|
||||||
print_quoted_xml(xml_file, attribute_value, strlen(attribute_value));
|
print_quoted_xml(xml_file, attribute_value,
|
||||||
|
(uint) strlen(attribute_value));
|
||||||
fputc('\"', xml_file);
|
fputc('\"', xml_file);
|
||||||
|
|
||||||
attribute_name= va_arg(arg_list, char *);
|
attribute_name= va_arg(arg_list, char *);
|
||||||
@ -1411,7 +1413,7 @@ static void print_xml_null_tag(FILE * xml_file, const char* sbeg,
|
|||||||
fputs("<", xml_file);
|
fputs("<", xml_file);
|
||||||
fputs(stag_atr, xml_file);
|
fputs(stag_atr, xml_file);
|
||||||
fputs("\"", xml_file);
|
fputs("\"", xml_file);
|
||||||
print_quoted_xml(xml_file, sval, strlen(sval));
|
print_quoted_xml(xml_file, sval, (uint) strlen(sval));
|
||||||
fputs("\" xsi:nil=\"true\" />", xml_file);
|
fputs("\" xsi:nil=\"true\" />", xml_file);
|
||||||
fputs(line_end, xml_file);
|
fputs(line_end, xml_file);
|
||||||
check_io(xml_file);
|
check_io(xml_file);
|
||||||
@ -1509,7 +1511,7 @@ static uint dump_routines_for_db(char *db)
|
|||||||
DBUG_ENTER("dump_routines_for_db");
|
DBUG_ENTER("dump_routines_for_db");
|
||||||
DBUG_PRINT("enter", ("db: '%s'", db));
|
DBUG_PRINT("enter", ("db: '%s'", db));
|
||||||
|
|
||||||
mysql_real_escape_string(mysql, db_name_buff, db, strlen(db));
|
mysql_real_escape_string(mysql, db_name_buff, db, (uint) strlen(db));
|
||||||
|
|
||||||
/* nice comments */
|
/* nice comments */
|
||||||
if (opt_comments)
|
if (opt_comments)
|
||||||
@ -1601,13 +1603,13 @@ static uint dump_routines_for_db(char *db)
|
|||||||
Allocate memory for new query string: original string
|
Allocate memory for new query string: original string
|
||||||
from SHOW statement and version-specific comments.
|
from SHOW statement and version-specific comments.
|
||||||
*/
|
*/
|
||||||
query_str= alloc_query_str(strlen(row[2]) + 23);
|
query_str= alloc_query_str((uint) strlen(row[2]) + 23);
|
||||||
|
|
||||||
query_str_tail= strnmov(query_str, row[2],
|
query_str_tail= strnmov(query_str, row[2],
|
||||||
definer_begin - row[2]);
|
(uint) (definer_begin - row[2]));
|
||||||
query_str_tail= strmov(query_str_tail, "*/ /*!50020");
|
query_str_tail= strmov(query_str_tail, "*/ /*!50020");
|
||||||
query_str_tail= strnmov(query_str_tail, definer_begin,
|
query_str_tail= strnmov(query_str_tail, definer_begin,
|
||||||
definer_end - definer_begin);
|
(uint) (definer_end - definer_begin));
|
||||||
query_str_tail= strxmov(query_str_tail, "*/ /*!50003",
|
query_str_tail= strxmov(query_str_tail, "*/ /*!50003",
|
||||||
definer_end, NullS);
|
definer_end, NullS);
|
||||||
}
|
}
|
||||||
@ -1857,11 +1859,11 @@ static uint get_table_structure(char *table, char *db, char *table_type,
|
|||||||
|
|
||||||
row= mysql_fetch_row(result);
|
row= mysql_fetch_row(result);
|
||||||
|
|
||||||
fprintf(sql_file,
|
fprintf(sql_file, (opt_compatible_mode & 3) ? "%s;\n" :
|
||||||
"SET @saved_cs_client = @@character_set_client;\n"
|
"/*!40101 SET @saved_cs_client = @@character_set_client */;\n"
|
||||||
"SET character_set_client = utf8;\n"
|
"/*!40101 SET character_set_client = utf8 */;\n"
|
||||||
"%s;\n"
|
"%s;\n"
|
||||||
"SET character_set_client = @saved_cs_client;\n",
|
"/*!40101 SET character_set_client = @saved_cs_client */;\n",
|
||||||
row[1]);
|
row[1]);
|
||||||
|
|
||||||
check_io(sql_file);
|
check_io(sql_file);
|
||||||
@ -2216,7 +2218,7 @@ static void dump_triggers_for_table(char *table,
|
|||||||
char host_name_str[HOSTNAME_LENGTH + 1];
|
char host_name_str[HOSTNAME_LENGTH + 1];
|
||||||
char quoted_host_name_str[HOSTNAME_LENGTH * 2 + 3];
|
char quoted_host_name_str[HOSTNAME_LENGTH * 2 + 3];
|
||||||
|
|
||||||
parse_user(row[7], strlen(row[7]), user_name_str, &user_name_len,
|
parse_user(row[7], (uint) strlen(row[7]), user_name_str, &user_name_len,
|
||||||
host_name_str, &host_name_len);
|
host_name_str, &host_name_len);
|
||||||
|
|
||||||
fprintf(sql_file,
|
fprintf(sql_file,
|
||||||
@ -3054,7 +3056,7 @@ static int dump_all_tables_in_db(char *database)
|
|||||||
while ((table= getTableName(0)))
|
while ((table= getTableName(0)))
|
||||||
{
|
{
|
||||||
char *end= strmov(afterdot, table);
|
char *end= strmov(afterdot, table);
|
||||||
if (include_table(hash_key, end - hash_key))
|
if (include_table(hash_key, (uint) (end - hash_key)))
|
||||||
{
|
{
|
||||||
dump_table(table,database);
|
dump_table(table,database);
|
||||||
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
|
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
|
||||||
@ -3103,6 +3105,11 @@ static my_bool dump_all_views_in_db(char *database)
|
|||||||
char *table;
|
char *table;
|
||||||
uint numrows;
|
uint numrows;
|
||||||
char table_buff[NAME_LEN*2+3];
|
char table_buff[NAME_LEN*2+3];
|
||||||
|
char hash_key[2*NAME_LEN+2]; /* "db.tablename" */
|
||||||
|
char *afterdot;
|
||||||
|
|
||||||
|
afterdot= strmov(hash_key, database);
|
||||||
|
*afterdot++= '.';
|
||||||
|
|
||||||
if (init_dumping(database, init_dumping_views))
|
if (init_dumping(database, init_dumping_views))
|
||||||
return 1;
|
return 1;
|
||||||
@ -3112,10 +3119,15 @@ static my_bool dump_all_views_in_db(char *database)
|
|||||||
{
|
{
|
||||||
DYNAMIC_STRING query;
|
DYNAMIC_STRING query;
|
||||||
init_dynamic_string_checked(&query, "LOCK TABLES ", 256, 1024);
|
init_dynamic_string_checked(&query, "LOCK TABLES ", 256, 1024);
|
||||||
for (numrows= 0 ; (table= getTableName(1)); numrows++)
|
for (numrows= 0 ; (table= getTableName(1)); )
|
||||||
{
|
{
|
||||||
dynstr_append_checked(&query, quote_name(table, table_buff, 1));
|
char *end= strmov(afterdot, table);
|
||||||
dynstr_append_checked(&query, " READ /*!32311 LOCAL */,");
|
if (include_table((uchar*) hash_key,end - hash_key))
|
||||||
|
{
|
||||||
|
numrows++;
|
||||||
|
dynstr_append_checked(&query, quote_name(table, table_buff, 1));
|
||||||
|
dynstr_append_checked(&query, " READ /*!32311 LOCAL */,");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (numrows && mysql_real_query(mysql, query.str, query.length-1))
|
if (numrows && mysql_real_query(mysql, query.str, query.length-1))
|
||||||
DB_error(mysql, "when using LOCK TABLES");
|
DB_error(mysql, "when using LOCK TABLES");
|
||||||
@ -3129,7 +3141,11 @@ static my_bool dump_all_views_in_db(char *database)
|
|||||||
/* We shall continue here, if --force was given */
|
/* We shall continue here, if --force was given */
|
||||||
}
|
}
|
||||||
while ((table= getTableName(0)))
|
while ((table= getTableName(0)))
|
||||||
get_view_structure(table, database);
|
{
|
||||||
|
char *end= strmov(afterdot, table);
|
||||||
|
if (include_table((uchar*) hash_key, end - hash_key))
|
||||||
|
get_view_structure(table, database);
|
||||||
|
}
|
||||||
if (opt_xml)
|
if (opt_xml)
|
||||||
{
|
{
|
||||||
fputs("</database>\n", md_result_file);
|
fputs("</database>\n", md_result_file);
|
||||||
@ -3199,7 +3215,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
|||||||
DBUG_ENTER("dump_selected_tables");
|
DBUG_ENTER("dump_selected_tables");
|
||||||
|
|
||||||
if (init_dumping(db, init_dumping_tables))
|
if (init_dumping(db, init_dumping_tables))
|
||||||
return 1;
|
DBUG_RETURN(1);
|
||||||
|
|
||||||
init_alloc_root(&root, 8192, 0);
|
init_alloc_root(&root, 8192, 0);
|
||||||
if (!(dump_tables= pos= (char**) alloc_root(&root, tables * sizeof(char *))))
|
if (!(dump_tables= pos= (char**) alloc_root(&root, tables * sizeof(char *))))
|
||||||
@ -3561,7 +3577,8 @@ char check_if_ignore_table(const char *table_name, char *table_type)
|
|||||||
If these two types, we do want to skip dumping the table
|
If these two types, we do want to skip dumping the table
|
||||||
*/
|
*/
|
||||||
if (!opt_no_data &&
|
if (!opt_no_data &&
|
||||||
(!strcmp(table_type,"MRG_MyISAM") || !strcmp(table_type,"MRG_ISAM")))
|
(!strcmp(table_type,"MRG_MyISAM") || !strcmp(table_type,"MRG_ISAM") ||
|
||||||
|
!strcmp(table_type,"FEDERATED")))
|
||||||
result= IGNORE_DATA;
|
result= IGNORE_DATA;
|
||||||
}
|
}
|
||||||
mysql_free_result(res);
|
mysql_free_result(res);
|
||||||
@ -3622,7 +3639,7 @@ static char *primary_key_fields(const char *table_name)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
quoted_field= quote_name(row[4], buff, 0);
|
quoted_field= quote_name(row[4], buff, 0);
|
||||||
result_length+= strlen(quoted_field) + 1; /* + 1 for ',' or \0 */
|
result_length+= (uint) strlen(quoted_field) + 1; /* + 1 for ',' or \0 */
|
||||||
} while ((row= mysql_fetch_row(res)) && atoi(row[3]) > 1);
|
} while ((row= mysql_fetch_row(res)) && atoi(row[3]) > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3682,7 +3699,8 @@ static int replace(DYNAMIC_STRING *ds_str,
|
|||||||
return 1;
|
return 1;
|
||||||
init_dynamic_string_checked(&ds_tmp, "",
|
init_dynamic_string_checked(&ds_tmp, "",
|
||||||
ds_str->length + replace_len, 256);
|
ds_str->length + replace_len, 256);
|
||||||
dynstr_append_mem_checked(&ds_tmp, ds_str->str, start - ds_str->str);
|
dynstr_append_mem_checked(&ds_tmp, ds_str->str,
|
||||||
|
(uint) (start - ds_str->str));
|
||||||
dynstr_append_mem_checked(&ds_tmp, replace_str, replace_len);
|
dynstr_append_mem_checked(&ds_tmp, replace_str, replace_len);
|
||||||
dynstr_append_checked(&ds_tmp, start + search_len);
|
dynstr_append_checked(&ds_tmp, start + search_len);
|
||||||
dynstr_set_checked(ds_str, ds_tmp.str);
|
dynstr_set_checked(ds_str, ds_tmp.str);
|
||||||
|
@ -134,7 +134,6 @@ void get_pass(char* pw, int len)
|
|||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FILE* fp;
|
FILE* fp;
|
||||||
my_MD5_CTX context;
|
|
||||||
uchar digest[16];
|
uchar digest[16];
|
||||||
char pw[17];
|
char pw[17];
|
||||||
uint i;
|
uint i;
|
||||||
@ -147,9 +146,7 @@ int main(int argc, char** argv)
|
|||||||
if (!(fp=fopen(outfile,"w")))
|
if (!(fp=fopen(outfile,"w")))
|
||||||
die("Could not open '%s'(errno=%d)",outfile,errno);
|
die("Could not open '%s'(errno=%d)",outfile,errno);
|
||||||
get_pass(pw,sizeof(pw)-1);
|
get_pass(pw,sizeof(pw)-1);
|
||||||
my_MD5Init(&context);
|
MY_MD5_HASH(digest,(uchar*) pw,sizeof(pw)-1);
|
||||||
my_MD5Update(&context,(uchar*) pw,sizeof(pw)-1);
|
|
||||||
my_MD5Final(digest,&context);
|
|
||||||
fprintf(fp,"%s:",user);
|
fprintf(fp,"%s:",user);
|
||||||
for (i=0;i<sizeof(digest);i++)
|
for (i=0;i<sizeof(digest);i++)
|
||||||
fprintf(fp,"%02x",digest[i]);
|
fprintf(fp,"%02x",digest[i]);
|
||||||
|
@ -801,7 +801,7 @@ void check_command_args(struct st_command *command,
|
|||||||
ptr++;
|
ptr++;
|
||||||
if (ptr > start)
|
if (ptr > start)
|
||||||
{
|
{
|
||||||
init_dynamic_string(arg->ds, 0, ptr-start, 32);
|
init_dynamic_string(arg->ds, 0, (uint) (ptr - start), 32);
|
||||||
do_eval(arg->ds, start, ptr, FALSE);
|
do_eval(arg->ds, start, ptr, FALSE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1156,16 +1156,16 @@ void warning_msg(const char *fmt, ...)
|
|||||||
len= my_snprintf(buff, sizeof(buff), "in included file %s ",
|
len= my_snprintf(buff, sizeof(buff), "in included file %s ",
|
||||||
cur_file->file_name);
|
cur_file->file_name);
|
||||||
dynstr_append_mem(&ds_warning_messages,
|
dynstr_append_mem(&ds_warning_messages,
|
||||||
buff, len);
|
buff, (uint) len);
|
||||||
}
|
}
|
||||||
len= my_snprintf(buff, sizeof(buff), "at line %d: ",
|
len= my_snprintf(buff, sizeof(buff), "at line %d: ",
|
||||||
start_lineno);
|
start_lineno);
|
||||||
dynstr_append_mem(&ds_warning_messages,
|
dynstr_append_mem(&ds_warning_messages,
|
||||||
buff, len);
|
buff, (uint) len);
|
||||||
}
|
}
|
||||||
|
|
||||||
len= my_vsnprintf(buff, sizeof(buff), fmt, args);
|
len= my_vsnprintf(buff, sizeof(buff), fmt, args);
|
||||||
dynstr_append_mem(&ds_warning_messages, buff, len);
|
dynstr_append_mem(&ds_warning_messages, buff, (uint) len);
|
||||||
|
|
||||||
dynstr_append(&ds_warning_messages, "\n");
|
dynstr_append(&ds_warning_messages, "\n");
|
||||||
va_end(args);
|
va_end(args);
|
||||||
@ -1185,7 +1185,7 @@ void log_msg(const char *fmt, ...)
|
|||||||
len= my_vsnprintf(buff, sizeof(buff)-1, fmt, args);
|
len= my_vsnprintf(buff, sizeof(buff)-1, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
dynstr_append_mem(&ds_res, buff, len);
|
dynstr_append_mem(&ds_res, buff, (uint) len);
|
||||||
dynstr_append(&ds_res, "\n");
|
dynstr_append(&ds_res, "\n");
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
@ -1222,7 +1222,7 @@ void cat_file(DYNAMIC_STRING* ds, const char* filename)
|
|||||||
/* Add fake newline instead of cr and output the line */
|
/* Add fake newline instead of cr and output the line */
|
||||||
*p= '\n';
|
*p= '\n';
|
||||||
p++; /* Step past the "fake" newline */
|
p++; /* Step past the "fake" newline */
|
||||||
dynstr_append_mem(ds, start, p-start);
|
dynstr_append_mem(ds, start, (uint) (p - start));
|
||||||
p++; /* Step past the "fake" newline */
|
p++; /* Step past the "fake" newline */
|
||||||
start= p;
|
start= p;
|
||||||
}
|
}
|
||||||
@ -1230,7 +1230,7 @@ void cat_file(DYNAMIC_STRING* ds, const char* filename)
|
|||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
/* Output any chars that migh be left */
|
/* Output any chars that migh be left */
|
||||||
dynstr_append_mem(ds, start, p-start);
|
dynstr_append_mem(ds, start, (uint) (p - start));
|
||||||
}
|
}
|
||||||
my_close(fd, MYF(0));
|
my_close(fd, MYF(0));
|
||||||
}
|
}
|
||||||
@ -1770,9 +1770,9 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
|
|||||||
int val_alloc_len;
|
int val_alloc_len;
|
||||||
VAR *tmp_var;
|
VAR *tmp_var;
|
||||||
if (!name_len && name)
|
if (!name_len && name)
|
||||||
name_len = strlen(name);
|
name_len = (uint) strlen(name);
|
||||||
if (!val_len && val)
|
if (!val_len && val)
|
||||||
val_len = strlen(val) ;
|
val_len = (uint) strlen(val) ;
|
||||||
val_alloc_len = val_len + 16; /* room to grow */
|
val_alloc_len = val_len + 16; /* room to grow */
|
||||||
if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var)
|
if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var)
|
||||||
+ name_len+1, MYF(MY_WME))))
|
+ name_len+1, MYF(MY_WME))))
|
||||||
@ -1815,7 +1815,7 @@ VAR* var_from_env(const char *name, const char *def_val)
|
|||||||
if (!(tmp = getenv(name)))
|
if (!(tmp = getenv(name)))
|
||||||
tmp = def_val;
|
tmp = def_val;
|
||||||
|
|
||||||
v = var_init(0, name, strlen(name), tmp, strlen(tmp));
|
v = var_init(0, name, (uint) strlen(name), tmp, (uint) strlen(tmp));
|
||||||
my_hash_insert(&var_hash, (byte*)v);
|
my_hash_insert(&var_hash, (byte*)v);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
@ -1864,7 +1864,7 @@ VAR* var_get(const char *var_name, const char **var_name_end, my_bool raw,
|
|||||||
{
|
{
|
||||||
sprintf(v->str_val, "%d", v->int_val);
|
sprintf(v->str_val, "%d", v->int_val);
|
||||||
v->int_dirty = 0;
|
v->int_dirty = 0;
|
||||||
v->str_val_len = strlen(v->str_val);
|
v->str_val_len = (uint) strlen(v->str_val);
|
||||||
}
|
}
|
||||||
if (var_name_end)
|
if (var_name_end)
|
||||||
*var_name_end = var_name ;
|
*var_name_end = var_name ;
|
||||||
@ -1927,7 +1927,7 @@ void var_set(const char *var_name, const char *var_name_end,
|
|||||||
{
|
{
|
||||||
sprintf(v->str_val, "%d", v->int_val);
|
sprintf(v->str_val, "%d", v->int_val);
|
||||||
v->int_dirty= 0;
|
v->int_dirty= 0;
|
||||||
v->str_val_len= strlen(v->str_val);
|
v->str_val_len= (uint) strlen(v->str_val);
|
||||||
}
|
}
|
||||||
my_snprintf(buf, sizeof(buf), "%.*s=%.*s",
|
my_snprintf(buf, sizeof(buf), "%.*s=%.*s",
|
||||||
v->name_len, v->name,
|
v->name_len, v->name,
|
||||||
@ -2006,7 +2006,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
|
|||||||
++query;
|
++query;
|
||||||
|
|
||||||
/* Eval the query, thus replacing all environment variables */
|
/* Eval the query, thus replacing all environment variables */
|
||||||
init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
|
init_dynamic_string(&ds_query, 0, (uint) ((end - query) + 32), 256);
|
||||||
do_eval(&ds_query, query, end, FALSE);
|
do_eval(&ds_query, query, end, FALSE);
|
||||||
|
|
||||||
if (mysql_real_query(mysql, ds_query.str, ds_query.length))
|
if (mysql_real_query(mysql, ds_query.str, ds_query.length))
|
||||||
@ -2223,7 +2223,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
|
|||||||
struct st_command command;
|
struct st_command command;
|
||||||
memset(&command, 0, sizeof(command));
|
memset(&command, 0, sizeof(command));
|
||||||
command.query= (char*)p;
|
command.query= (char*)p;
|
||||||
command.first_word_len= len;
|
command.first_word_len= (uint) len;
|
||||||
command.first_argument= command.query + len;
|
command.first_argument= command.query + len;
|
||||||
command.end= (char*)*p_end;
|
command.end= (char*)*p_end;
|
||||||
var_set_query_get_value(&command, v);
|
var_set_query_get_value(&command, v);
|
||||||
@ -2413,7 +2413,7 @@ static int replace(DYNAMIC_STRING *ds_str,
|
|||||||
return 1;
|
return 1;
|
||||||
init_dynamic_string(&ds_tmp, "",
|
init_dynamic_string(&ds_tmp, "",
|
||||||
ds_str->length + replace_len, 256);
|
ds_str->length + replace_len, 256);
|
||||||
dynstr_append_mem(&ds_tmp, ds_str->str, start - ds_str->str);
|
dynstr_append_mem(&ds_tmp, ds_str->str, (uint) (start - ds_str->str));
|
||||||
dynstr_append_mem(&ds_tmp, replace_str, replace_len);
|
dynstr_append_mem(&ds_tmp, replace_str, replace_len);
|
||||||
dynstr_append(&ds_tmp, start + search_len);
|
dynstr_append(&ds_tmp, start + search_len);
|
||||||
dynstr_set(ds_str, ds_tmp.str);
|
dynstr_set(ds_str, ds_tmp.str);
|
||||||
@ -2468,7 +2468,7 @@ void do_exec(struct st_command *command)
|
|||||||
if (builtin_echo[0] && strncmp(cmd, "echo", 4) == 0)
|
if (builtin_echo[0] && strncmp(cmd, "echo", 4) == 0)
|
||||||
{
|
{
|
||||||
/* Replace echo with our "builtin" echo */
|
/* Replace echo with our "builtin" echo */
|
||||||
replace(&ds_cmd, "echo", 4, builtin_echo, strlen(builtin_echo));
|
replace(&ds_cmd, "echo", 4, builtin_echo, (uint) strlen(builtin_echo));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
@ -4627,7 +4627,7 @@ void do_delimiter(struct st_command* command)
|
|||||||
die("Can't set empty delimiter");
|
die("Can't set empty delimiter");
|
||||||
|
|
||||||
strmake(delimiter, p, sizeof(delimiter) - 1);
|
strmake(delimiter, p, sizeof(delimiter) - 1);
|
||||||
delimiter_length= strlen(delimiter);
|
delimiter_length= (uint) strlen(delimiter);
|
||||||
|
|
||||||
DBUG_PRINT("exit", ("delimiter: %s", delimiter));
|
DBUG_PRINT("exit", ("delimiter: %s", delimiter));
|
||||||
command->last_argument= p + delimiter_length;
|
command->last_argument= p + delimiter_length;
|
||||||
@ -4753,9 +4753,11 @@ int read_line(char *buf, int size)
|
|||||||
}
|
}
|
||||||
else if ((c == '{' &&
|
else if ((c == '{' &&
|
||||||
(!my_strnncoll_simple(charset_info, (const uchar*) "while", 5,
|
(!my_strnncoll_simple(charset_info, (const uchar*) "while", 5,
|
||||||
(uchar*) buf, min(5, p - buf), 0) ||
|
(uchar*) buf, min(5, (uint) (p - buf)),
|
||||||
|
0) ||
|
||||||
!my_strnncoll_simple(charset_info, (const uchar*) "if", 2,
|
!my_strnncoll_simple(charset_info, (const uchar*) "if", 2,
|
||||||
(uchar*) buf, min(2, p - buf), 0))))
|
(uchar*) buf, min(2, (uint) (p - buf)),
|
||||||
|
0))))
|
||||||
{
|
{
|
||||||
/* Only if and while commands can be terminated by { */
|
/* Only if and while commands can be terminated by { */
|
||||||
*p++= c;
|
*p++= c;
|
||||||
@ -5117,7 +5119,7 @@ int read_command(struct st_command** command_ptr)
|
|||||||
command->first_argument= p;
|
command->first_argument= p;
|
||||||
|
|
||||||
command->end= strend(command->query);
|
command->end= strend(command->query);
|
||||||
command->query_len= (command->end - command->query);
|
command->query_len= (uint) (command->end - command->query);
|
||||||
parser.read_lines++;
|
parser.read_lines++;
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
@ -6459,7 +6461,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
query = command->query;
|
query = command->query;
|
||||||
query_len = strlen(query);
|
query_len = (uint) strlen(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -6520,7 +6522,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||||||
*/
|
*/
|
||||||
view_created= 1;
|
view_created= 1;
|
||||||
query= (char*)"SELECT * FROM mysqltest_tmp_v";
|
query= (char*)"SELECT * FROM mysqltest_tmp_v";
|
||||||
query_len = strlen(query);
|
query_len = (uint) strlen(query);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Collect warnings from create of the view that should otherwise
|
Collect warnings from create of the view that should otherwise
|
||||||
@ -6568,7 +6570,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||||||
sp_created= 1;
|
sp_created= 1;
|
||||||
|
|
||||||
query= (char*)"CALL mysqltest_tmp_sp()";
|
query= (char*)"CALL mysqltest_tmp_sp()";
|
||||||
query_len = strlen(query);
|
query_len = (uint) strlen(query);
|
||||||
}
|
}
|
||||||
dynstr_free(&query_str);
|
dynstr_free(&query_str);
|
||||||
}
|
}
|
||||||
@ -6661,7 +6663,7 @@ void init_re_comp(my_regex_t *re, const char* str)
|
|||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
char erbuf[100];
|
char erbuf[100];
|
||||||
int len= my_regerror(err, re, erbuf, sizeof(erbuf));
|
size_t len= my_regerror(err, re, erbuf, sizeof(erbuf));
|
||||||
die("error %s, %d/%d `%s'\n",
|
die("error %s, %d/%d `%s'\n",
|
||||||
re_eprint(err), len, (int)sizeof(erbuf), erbuf);
|
re_eprint(err), len, (int)sizeof(erbuf), erbuf);
|
||||||
}
|
}
|
||||||
@ -6717,7 +6719,7 @@ int match_re(my_regex_t *re, char *str)
|
|||||||
|
|
||||||
{
|
{
|
||||||
char erbuf[100];
|
char erbuf[100];
|
||||||
int len= my_regerror(err, re, erbuf, sizeof(erbuf));
|
size_t len= my_regerror(err, re, erbuf, sizeof(erbuf));
|
||||||
die("error %s, %d/%d `%s'\n",
|
die("error %s, %d/%d `%s'\n",
|
||||||
re_eprint(err), len, (int)sizeof(erbuf), erbuf);
|
re_eprint(err), len, (int)sizeof(erbuf), erbuf);
|
||||||
}
|
}
|
||||||
@ -7579,7 +7581,7 @@ void replace_strings_append(REPLACE *rep, DYNAMIC_STRING* ds,
|
|||||||
if (!(rep_str = ((REPLACE_STRING*) rep_pos))->replace_string)
|
if (!(rep_str = ((REPLACE_STRING*) rep_pos))->replace_string)
|
||||||
{
|
{
|
||||||
/* No match found */
|
/* No match found */
|
||||||
dynstr_append_mem(ds, start, from - start - 1);
|
dynstr_append_mem(ds, start, (uint) (from - start - 1));
|
||||||
DBUG_PRINT("exit", ("Found no more string to replace, appended: %s", start));
|
DBUG_PRINT("exit", ("Found no more string to replace, appended: %s", start));
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
@ -7590,11 +7592,11 @@ void replace_strings_append(REPLACE *rep, DYNAMIC_STRING* ds,
|
|||||||
rep_str->from_offset, rep_str->replace_string));
|
rep_str->from_offset, rep_str->replace_string));
|
||||||
|
|
||||||
/* Append part of original string before replace string */
|
/* Append part of original string before replace string */
|
||||||
dynstr_append_mem(ds, start, (from - rep_str->to_offset) - start);
|
dynstr_append_mem(ds, start, (uint) ((from - rep_str->to_offset) - start));
|
||||||
|
|
||||||
/* Append replace string */
|
/* Append replace string */
|
||||||
dynstr_append_mem(ds, rep_str->replace_string,
|
dynstr_append_mem(ds, rep_str->replace_string,
|
||||||
strlen(rep_str->replace_string));
|
(uint) strlen(rep_str->replace_string));
|
||||||
|
|
||||||
if (!*(from-=rep_str->from_offset) && rep_pos->found != 2)
|
if (!*(from-=rep_str->from_offset) && rep_pos->found != 2)
|
||||||
{
|
{
|
||||||
@ -7689,7 +7691,7 @@ struct st_replace_regex* init_replace_regex(char* expr)
|
|||||||
char* buf,*expr_end;
|
char* buf,*expr_end;
|
||||||
char* p;
|
char* p;
|
||||||
char* buf_p;
|
char* buf_p;
|
||||||
uint expr_len= strlen(expr);
|
size_t expr_len= strlen(expr);
|
||||||
char last_c = 0;
|
char last_c = 0;
|
||||||
struct st_regex reg;
|
struct st_regex reg;
|
||||||
|
|
||||||
@ -7866,7 +7868,7 @@ void free_replace_regex()
|
|||||||
*/
|
*/
|
||||||
#define SECURE_REG_BUF if (buf_len < need_buf_len) \
|
#define SECURE_REG_BUF if (buf_len < need_buf_len) \
|
||||||
{ \
|
{ \
|
||||||
int off= res_p - buf; \
|
size_t off= res_p - buf; \
|
||||||
buf= (char*)my_realloc(buf,need_buf_len,MYF(MY_WME+MY_FAE)); \
|
buf= (char*)my_realloc(buf,need_buf_len,MYF(MY_WME+MY_FAE)); \
|
||||||
res_p= buf + off; \
|
res_p= buf + off; \
|
||||||
buf_len= need_buf_len; \
|
buf_len= need_buf_len; \
|
||||||
@ -7898,7 +7900,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
|
|||||||
char *res_p,*str_p,*str_end;
|
char *res_p,*str_p,*str_end;
|
||||||
|
|
||||||
buf_len= *buf_len_p;
|
buf_len= *buf_len_p;
|
||||||
len= strlen(string);
|
len= (uint) strlen(string);
|
||||||
str_end= string + len;
|
str_end= string + len;
|
||||||
|
|
||||||
/* start with a buffer of a reasonable size that hopefully will not
|
/* start with a buffer of a reasonable size that hopefully will not
|
||||||
@ -7950,7 +7952,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
|
|||||||
we need at least what we have so far in the buffer + the part
|
we need at least what we have so far in the buffer + the part
|
||||||
before this match
|
before this match
|
||||||
*/
|
*/
|
||||||
need_buf_len= (res_p - buf) + (int) subs[0].rm_so;
|
need_buf_len= (uint) (res_p - buf) + (int) subs[0].rm_so;
|
||||||
|
|
||||||
/* on this pass, calculate the memory for the result buffer */
|
/* on this pass, calculate the memory for the result buffer */
|
||||||
while (expr_p < replace_end)
|
while (expr_p < replace_end)
|
||||||
@ -8040,8 +8042,8 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
|
|||||||
}
|
}
|
||||||
else /* no match this time, just copy the string as is */
|
else /* no match this time, just copy the string as is */
|
||||||
{
|
{
|
||||||
int left_in_str= str_end-str_p;
|
size_t left_in_str= str_end-str_p;
|
||||||
need_buf_len= (res_p-buf) + left_in_str;
|
need_buf_len= (uint) ((res_p-buf) + left_in_str);
|
||||||
SECURE_REG_BUF
|
SECURE_REG_BUF
|
||||||
memcpy(res_p,str_p,left_in_str);
|
memcpy(res_p,str_p,left_in_str);
|
||||||
res_p += left_in_str;
|
res_p += left_in_str;
|
||||||
@ -8708,7 +8710,7 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
|
|||||||
if (!multi_reg_replace(glob_replace_regex, (char*)val))
|
if (!multi_reg_replace(glob_replace_regex, (char*)val))
|
||||||
{
|
{
|
||||||
val= glob_replace_regex->buf;
|
val= glob_replace_regex->buf;
|
||||||
len= strlen(val);
|
len= (uint) strlen(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8725,7 +8727,7 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
|
|||||||
/* Append zero-terminated string to ds, with optional replace */
|
/* Append zero-terminated string to ds, with optional replace */
|
||||||
void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val)
|
void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val)
|
||||||
{
|
{
|
||||||
replace_dynstr_append_mem(ds, val, strlen(val));
|
replace_dynstr_append_mem(ds, val, (uint) strlen(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Append uint to ds, with optional replace */
|
/* Append uint to ds, with optional replace */
|
||||||
@ -8733,7 +8735,7 @@ void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val)
|
|||||||
{
|
{
|
||||||
char buff[22]; /* This should be enough for any int */
|
char buff[22]; /* This should be enough for any int */
|
||||||
char *end= longlong10_to_str(val, buff, 10);
|
char *end= longlong10_to_str(val, buff, 10);
|
||||||
replace_dynstr_append_mem(ds, buff, end - buff);
|
replace_dynstr_append_mem(ds, buff, (uint) (end - buff));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -8771,7 +8773,7 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input)
|
|||||||
while (*start && *start != '\n')
|
while (*start && *start != '\n')
|
||||||
start++;
|
start++;
|
||||||
start++; /* Skip past \n */
|
start++; /* Skip past \n */
|
||||||
dynstr_append_mem(ds, ds_input->str, start - ds_input->str);
|
dynstr_append_mem(ds, ds_input->str, (uint) (start - ds_input->str));
|
||||||
|
|
||||||
/* Insert line(s) in array */
|
/* Insert line(s) in array */
|
||||||
while (*start)
|
while (*start)
|
||||||
|
@ -24,7 +24,7 @@ static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,
|
|||||||
ulong max_size);
|
ulong max_size);
|
||||||
static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str);
|
static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str);
|
||||||
static uint fill_buffer(LINE_BUFFER *buffer);
|
static uint fill_buffer(LINE_BUFFER *buffer);
|
||||||
static char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length);
|
static char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated);
|
||||||
|
|
||||||
|
|
||||||
LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
|
LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
|
||||||
@ -42,12 +42,13 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *batch_readline(LINE_BUFFER *line_buff)
|
char *batch_readline(LINE_BUFFER *line_buff, bool *truncated)
|
||||||
{
|
{
|
||||||
char *pos;
|
char *pos;
|
||||||
ulong out_length;
|
ulong out_length;
|
||||||
|
DBUG_ASSERT(truncated != NULL);
|
||||||
|
|
||||||
if (!(pos=intern_read_line(line_buff,&out_length)))
|
if (!(pos=intern_read_line(line_buff,&out_length, truncated)))
|
||||||
return 0;
|
return 0;
|
||||||
if (out_length && pos[out_length-1] == '\n')
|
if (out_length && pos[out_length-1] == '\n')
|
||||||
if (--out_length && pos[out_length-1] == '\r') /* Remove '\n' */
|
if (--out_length && pos[out_length-1] == '\r') /* Remove '\n' */
|
||||||
@ -149,6 +150,14 @@ static uint fill_buffer(LINE_BUFFER *buffer)
|
|||||||
read_count=(buffer->bufread - bufbytes)/IO_SIZE;
|
read_count=(buffer->bufread - bufbytes)/IO_SIZE;
|
||||||
if ((read_count*=IO_SIZE))
|
if ((read_count*=IO_SIZE))
|
||||||
break;
|
break;
|
||||||
|
if (buffer->bufread * 2 > buffer->max_size)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
So we must grow the buffer but we cannot due to the max_size limit.
|
||||||
|
Return 0 w/o setting buffer->eof to signal this condition.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
buffer->bufread *= 2;
|
buffer->bufread *= 2;
|
||||||
if (!(buffer->buffer = (char*) my_realloc(buffer->buffer,
|
if (!(buffer->buffer = (char*) my_realloc(buffer->buffer,
|
||||||
buffer->bufread+1,
|
buffer->bufread+1,
|
||||||
@ -172,11 +181,15 @@ static uint fill_buffer(LINE_BUFFER *buffer)
|
|||||||
|
|
||||||
DBUG_PRINT("fill_buff", ("Got %d bytes", read_count));
|
DBUG_PRINT("fill_buff", ("Got %d bytes", read_count));
|
||||||
|
|
||||||
/* Kludge to pretend every nonempty file ends with a newline. */
|
if (!read_count)
|
||||||
if (!read_count && bufbytes && buffer->end[-1] != '\n')
|
|
||||||
{
|
{
|
||||||
buffer->eof = read_count = 1;
|
buffer->eof = 1;
|
||||||
*buffer->end = '\n';
|
/* Kludge to pretend every nonempty file ends with a newline. */
|
||||||
|
if (bufbytes && buffer->end[-1] != '\n')
|
||||||
|
{
|
||||||
|
read_count = 1;
|
||||||
|
*buffer->end = '\n';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
buffer->end_of_line=(buffer->start_of_line=buffer->buffer)+bufbytes;
|
buffer->end_of_line=(buffer->start_of_line=buffer->buffer)+bufbytes;
|
||||||
buffer->end+=read_count;
|
buffer->end+=read_count;
|
||||||
@ -186,7 +199,7 @@ static uint fill_buffer(LINE_BUFFER *buffer)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length)
|
char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated)
|
||||||
{
|
{
|
||||||
char *pos;
|
char *pos;
|
||||||
uint length;
|
uint length;
|
||||||
@ -200,14 +213,23 @@ char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length)
|
|||||||
pos++;
|
pos++;
|
||||||
if (pos == buffer->end)
|
if (pos == buffer->end)
|
||||||
{
|
{
|
||||||
if ((uint) (pos - buffer->start_of_line) < buffer->max_size)
|
/*
|
||||||
|
fill_buffer() can return 0 either on EOF in which case we abort
|
||||||
|
or when the internal buffer has hit the size limit. In the latter case
|
||||||
|
return what we have read so far and signal string truncation.
|
||||||
|
*/
|
||||||
|
if (!(length=fill_buffer(buffer)) || length == (uint) -1)
|
||||||
{
|
{
|
||||||
if (!(length=fill_buffer(buffer)) || length == (uint) -1)
|
if (buffer->eof)
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
continue;
|
||||||
pos--; /* break line here */
|
pos--; /* break line here */
|
||||||
|
*truncated= 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
*truncated= 0;
|
||||||
buffer->end_of_line=pos+1;
|
buffer->end_of_line=pos+1;
|
||||||
*out_length=(ulong) (pos + 1 - buffer->eof - buffer->start_of_line);
|
*out_length=(ulong) (pos + 1 - buffer->eof - buffer->start_of_line);
|
||||||
DBUG_RETURN(buffer->start_of_line);
|
DBUG_RETURN(buffer->start_of_line);
|
||||||
|
@ -71,25 +71,22 @@ bool String::realloc(uint32 alloc_length)
|
|||||||
char *new_ptr;
|
char *new_ptr;
|
||||||
if (alloced)
|
if (alloced)
|
||||||
{
|
{
|
||||||
if ((new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME))))
|
if (!(new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME))))
|
||||||
{
|
return TRUE; // Signal error
|
||||||
Ptr=new_ptr;
|
|
||||||
Alloced_length=len;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return TRUE; // Signal error
|
|
||||||
}
|
}
|
||||||
else if ((new_ptr= (char*) my_malloc(len,MYF(MY_WME))))
|
else if ((new_ptr= (char*) my_malloc(len,MYF(MY_WME))))
|
||||||
{
|
{
|
||||||
|
if (str_length > len - 1)
|
||||||
|
str_length= 0;
|
||||||
if (str_length) // Avoid bugs in memcpy on AIX
|
if (str_length) // Avoid bugs in memcpy on AIX
|
||||||
memcpy(new_ptr,Ptr,str_length);
|
memcpy(new_ptr,Ptr,str_length);
|
||||||
new_ptr[str_length]=0;
|
new_ptr[str_length]=0;
|
||||||
Ptr=new_ptr;
|
|
||||||
Alloced_length=len;
|
|
||||||
alloced=1;
|
alloced=1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return TRUE; // Signal error
|
return TRUE; // Signal error
|
||||||
|
Ptr= new_ptr;
|
||||||
|
Alloced_length= len;
|
||||||
}
|
}
|
||||||
Ptr[alloc_length]=0; // This make other funcs shorter
|
Ptr[alloc_length]=0; // This make other funcs shorter
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -125,7 +122,7 @@ bool String::set(double num,uint decimals, CHARSET_INFO *cs)
|
|||||||
str_charset=cs;
|
str_charset=cs;
|
||||||
if (decimals >= NOT_FIXED_DEC)
|
if (decimals >= NOT_FIXED_DEC)
|
||||||
{
|
{
|
||||||
uint32 len= my_sprintf(buff,(buff, "%.14g",num));// Enough for a DATETIME
|
uint32 len= my_sprintf(buff,(buff, "%.15g",num));// Enough for a DATETIME
|
||||||
return copy(buff, len, &my_charset_latin1, cs, &dummy_errors);
|
return copy(buff, len, &my_charset_latin1, cs, &dummy_errors);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_FCONVERT
|
#ifdef HAVE_FCONVERT
|
||||||
@ -468,7 +465,7 @@ bool String::append(const char *s,uint32 arg_length)
|
|||||||
|
|
||||||
bool String::append(const char *s)
|
bool String::append(const char *s)
|
||||||
{
|
{
|
||||||
return append(s, strlen(s));
|
return append(s, (uint) strlen(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -677,7 +674,7 @@ void String::qs_append(const char *str, uint32 len)
|
|||||||
void String::qs_append(double d)
|
void String::qs_append(double d)
|
||||||
{
|
{
|
||||||
char *buff = Ptr + str_length;
|
char *buff = Ptr + str_length;
|
||||||
str_length+= my_sprintf(buff, (buff, "%.14g", d));
|
str_length+= my_sprintf(buff, (buff, "%.15g", d));
|
||||||
}
|
}
|
||||||
|
|
||||||
void String::qs_append(double *d)
|
void String::qs_append(double *d)
|
||||||
|
@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
|
|||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
||||||
# The Docs Makefile.am parses this line!
|
# The Docs Makefile.am parses this line!
|
||||||
# remember to also change ndb version below and update version.c in ndb
|
# remember to also change ndb version below and update version.c in ndb
|
||||||
AM_INIT_AUTOMAKE(mysql, 5.0.79)
|
AM_INIT_AUTOMAKE(mysql, 5.0.80)
|
||||||
AM_CONFIG_HEADER([include/config.h:config.h.in])
|
AM_CONFIG_HEADER([include/config.h:config.h.in])
|
||||||
|
|
||||||
PROTOCOL_VERSION=10
|
PROTOCOL_VERSION=10
|
||||||
@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
|
|||||||
# ndb version
|
# ndb version
|
||||||
NDB_VERSION_MAJOR=5
|
NDB_VERSION_MAJOR=5
|
||||||
NDB_VERSION_MINOR=0
|
NDB_VERSION_MINOR=0
|
||||||
NDB_VERSION_BUILD=79
|
NDB_VERSION_BUILD=80
|
||||||
NDB_VERSION_STATUS=""
|
NDB_VERSION_STATUS=""
|
||||||
|
|
||||||
# Set all version vars based on $VERSION. How do we do this more elegant ?
|
# Set all version vars based on $VERSION. How do we do this more elegant ?
|
||||||
@ -825,7 +825,7 @@ AC_TYPE_SIZE_T
|
|||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
|
AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h ieeefp.h limits.h \
|
||||||
memory.h pwd.h select.h \
|
memory.h pwd.h select.h \
|
||||||
stdlib.h stddef.h \
|
stdlib.h stddef.h \
|
||||||
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
|
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
|
||||||
@ -2060,7 +2060,7 @@ AC_FUNC_UTIME_NULL
|
|||||||
AC_FUNC_VPRINTF
|
AC_FUNC_VPRINTF
|
||||||
|
|
||||||
AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
|
AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
|
||||||
fconvert fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
|
fconvert fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \
|
||||||
getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
|
getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
|
||||||
getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \
|
getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \
|
||||||
localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \
|
localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \
|
||||||
|
@ -660,7 +660,7 @@ static ha_checksum checksum_format_specifier(const char* msg)
|
|||||||
case 'u':
|
case 'u':
|
||||||
case 'x':
|
case 'x':
|
||||||
case 's':
|
case 's':
|
||||||
chksum= my_checksum(chksum, start, p-start);
|
chksum= my_checksum(chksum, start, (uint) (p - start));
|
||||||
start= 0; /* Not in format specifier anymore */
|
start= 0; /* Not in format specifier anymore */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -97,6 +97,17 @@ static HA_ERRORS ha_errlist[]=
|
|||||||
{ 150,"Foreign key constraint is incorrectly formed"},
|
{ 150,"Foreign key constraint is incorrectly formed"},
|
||||||
{ 151,"Cannot add a child row"},
|
{ 151,"Cannot add a child row"},
|
||||||
{ 152,"Cannot delete a parent row"},
|
{ 152,"Cannot delete a parent row"},
|
||||||
|
{ 153,"No savepoint with that name"},
|
||||||
|
{ 154,"Non unique key block size"},
|
||||||
|
{ 155,"The table does not exist in engine"},
|
||||||
|
{ 156,"The table existed in storage engine"},
|
||||||
|
{ 157,"Could not connect to storage engine"},
|
||||||
|
{ 158,"NULLs are not supported in spatial index"},
|
||||||
|
{ 159,"The table changed in storage engine"},
|
||||||
|
{ 160,"The table changed in storage engine"},
|
||||||
|
{ 161,"The table is not writable"},
|
||||||
|
{ 162,"Failed to get the next autoinc value"},
|
||||||
|
{ 163,"Failed to set the row autoinc value"},
|
||||||
{ -30999, "DB_INCOMPLETE: Sync didn't finish"},
|
{ -30999, "DB_INCOMPLETE: Sync didn't finish"},
|
||||||
{ -30998, "DB_KEYEMPTY: Key/data deleted or never created"},
|
{ -30998, "DB_KEYEMPTY: Key/data deleted or never created"},
|
||||||
{ -30997, "DB_KEYEXIST: The key/data pair already exists"},
|
{ -30997, "DB_KEYEXIST: The key/data pair already exists"},
|
||||||
|
@ -106,7 +106,7 @@ void input_buffer::add_size(uint i)
|
|||||||
|
|
||||||
uint input_buffer::get_capacity() const
|
uint input_buffer::get_capacity() const
|
||||||
{
|
{
|
||||||
return end_ - buffer_;
|
return (uint) (end_ - buffer_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ uint output_buffer::get_size() const
|
|||||||
|
|
||||||
uint output_buffer::get_capacity() const
|
uint output_buffer::get_capacity() const
|
||||||
{
|
{
|
||||||
return end_ - buffer_;
|
return (uint) (end_ - buffer_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ uint CertManager::get_privateKeyLength() const
|
|||||||
int CertManager::Validate()
|
int CertManager::Validate()
|
||||||
{
|
{
|
||||||
CertList::reverse_iterator last = peerList_.rbegin();
|
CertList::reverse_iterator last = peerList_.rbegin();
|
||||||
int count = peerList_.size();
|
size_t count= peerList_.size();
|
||||||
|
|
||||||
while ( count > 1 ) {
|
while ( count > 1 ) {
|
||||||
TaoCrypt::Source source((*last)->get_buffer(), (*last)->get_length());
|
TaoCrypt::Source source((*last)->get_buffer(), (*last)->get_length());
|
||||||
@ -269,13 +269,13 @@ int CertManager::Validate()
|
|||||||
else
|
else
|
||||||
peerKeyType_ = dsa_sa_algo;
|
peerKeyType_ = dsa_sa_algo;
|
||||||
|
|
||||||
int iSz = strlen(cert.GetIssuer()) + 1;
|
size_t iSz= strlen(cert.GetIssuer()) + 1;
|
||||||
int sSz = strlen(cert.GetCommonName()) + 1;
|
size_t sSz= strlen(cert.GetCommonName()) + 1;
|
||||||
int bSz = strlen(cert.GetBeforeDate()) + 1;
|
size_t bSz= strlen(cert.GetBeforeDate()) + 1;
|
||||||
int aSz = strlen(cert.GetAfterDate()) + 1;
|
size_t aSz= strlen(cert.GetAfterDate()) + 1;
|
||||||
peerX509_ = NEW_YS X509(cert.GetIssuer(), iSz, cert.GetCommonName(),
|
peerX509_ = NEW_YS X509(cert.GetIssuer(), iSz, cert.GetCommonName(),
|
||||||
sSz, cert.GetBeforeDate(), bSz,
|
sSz, cert.GetBeforeDate(), (int) bSz,
|
||||||
cert.GetAfterDate(), aSz);
|
cert.GetAfterDate(), (int) aSz);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -604,13 +604,13 @@ char* X509_NAME_oneline(X509_NAME* name, char* buffer, int sz)
|
|||||||
{
|
{
|
||||||
if (!name->GetName()) return buffer;
|
if (!name->GetName()) return buffer;
|
||||||
|
|
||||||
int len = strlen(name->GetName()) + 1;
|
size_t len= strlen(name->GetName()) + 1;
|
||||||
int copySz = min(len, sz);
|
int copySz = min((int) len, sz);
|
||||||
|
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
buffer = (char*)malloc(len);
|
buffer = (char*)malloc(len);
|
||||||
if (!buffer) return buffer;
|
if (!buffer) return buffer;
|
||||||
copySz = len;
|
copySz = (int) len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copySz == 0)
|
if (copySz == 0)
|
||||||
|
@ -532,7 +532,7 @@ void Parameters::SetCipherNames()
|
|||||||
|
|
||||||
for (int j = 0; j < suites; j++) {
|
for (int j = 0; j < suites; j++) {
|
||||||
int index = suites_[j*2 + 1]; // every other suite is suite id
|
int index = suites_[j*2 + 1]; // every other suite is suite id
|
||||||
int len = strlen(cipher_names[index]) + 1;
|
size_t len = strlen(cipher_names[index]) + 1;
|
||||||
strncpy(cipher_list_[pos++], cipher_names[index], len);
|
strncpy(cipher_list_[pos++], cipher_names[index], len);
|
||||||
}
|
}
|
||||||
cipher_list_[pos][0] = 0;
|
cipher_list_[pos][0] = 0;
|
||||||
|
@ -1034,7 +1034,7 @@ void SSL::fillData(Data& data)
|
|||||||
{
|
{
|
||||||
if (GetError()) return;
|
if (GetError()) return;
|
||||||
uint dataSz = data.get_length(); // input, data size to fill
|
uint dataSz = data.get_length(); // input, data size to fill
|
||||||
uint elements = buffers_.getData().size();
|
size_t elements = buffers_.getData().size();
|
||||||
|
|
||||||
data.set_length(0); // output, actual data filled
|
data.set_length(0); // output, actual data filled
|
||||||
dataSz = min(dataSz, bufferedData());
|
dataSz = min(dataSz, bufferedData());
|
||||||
@ -1064,7 +1064,7 @@ void SSL::PeekData(Data& data)
|
|||||||
{
|
{
|
||||||
if (GetError()) return;
|
if (GetError()) return;
|
||||||
uint dataSz = data.get_length(); // input, data size to fill
|
uint dataSz = data.get_length(); // input, data size to fill
|
||||||
uint elements = buffers_.getData().size();
|
size_t elements = buffers_.getData().size();
|
||||||
|
|
||||||
data.set_length(0); // output, actual data filled
|
data.set_length(0); // output, actual data filled
|
||||||
dataSz = min(dataSz, bufferedData());
|
dataSz = min(dataSz, bufferedData());
|
||||||
@ -1098,7 +1098,7 @@ void SSL::flushBuffer()
|
|||||||
buffers_.getHandShake().end(),
|
buffers_.getHandShake().end(),
|
||||||
SumBuffer()).total_;
|
SumBuffer()).total_;
|
||||||
output_buffer out(sz);
|
output_buffer out(sz);
|
||||||
uint elements = buffers_.getHandShake().size();
|
size_t elements = buffers_.getHandShake().size();
|
||||||
|
|
||||||
for (uint i = 0; i < elements; i++) {
|
for (uint i = 0; i < elements; i++) {
|
||||||
output_buffer* front = buffers_.getHandShake().front();
|
output_buffer* front = buffers_.getHandShake().front();
|
||||||
@ -1906,7 +1906,7 @@ bool SSL_CTX::SetCipherList(const char* list)
|
|||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
int len;
|
size_t len;
|
||||||
prev = haystack;
|
prev = haystack;
|
||||||
haystack = strstr(haystack, needle);
|
haystack = strstr(haystack, needle);
|
||||||
|
|
||||||
@ -2354,10 +2354,10 @@ ASN1_STRING* X509_NAME::GetEntry(int i)
|
|||||||
memcpy(entry_.data, &name_[i], sz_ - i);
|
memcpy(entry_.data, &name_[i], sz_ - i);
|
||||||
if (entry_.data[sz_ -i - 1]) {
|
if (entry_.data[sz_ -i - 1]) {
|
||||||
entry_.data[sz_ - i] = 0;
|
entry_.data[sz_ - i] = 0;
|
||||||
entry_.length = sz_ - i;
|
entry_.length = (int) (sz_ - i);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
entry_.length = sz_ - i - 1;
|
entry_.length = (int) (sz_ - i - 1);
|
||||||
entry_.type = 0;
|
entry_.type = 0;
|
||||||
|
|
||||||
return &entry_;
|
return &entry_;
|
||||||
|
@ -78,7 +78,7 @@ typename A::pointer StdReallocate(A& a, T* p, typename A::size_type oldSize,
|
|||||||
if (preserve) {
|
if (preserve) {
|
||||||
A b = A();
|
A b = A();
|
||||||
typename A::pointer newPointer = b.allocate(newSize, 0);
|
typename A::pointer newPointer = b.allocate(newSize, 0);
|
||||||
memcpy(newPointer, p, sizeof(T) * min(oldSize, newSize));
|
memcpy(newPointer, p, sizeof(T) * min((word32) oldSize, (word32) newSize));
|
||||||
a.deallocate(p, oldSize);
|
a.deallocate(p, oldSize);
|
||||||
STL::swap(a, b);
|
STL::swap(a, b);
|
||||||
return newPointer;
|
return newPointer;
|
||||||
|
@ -288,7 +288,7 @@ void AbstractGroup::SimultaneousMultiply(Integer *results, const Integer &base,
|
|||||||
r = buckets[i][buckets[i].size()-1];
|
r = buckets[i][buckets[i].size()-1];
|
||||||
if (buckets[i].size() > 1)
|
if (buckets[i].size() > 1)
|
||||||
{
|
{
|
||||||
for (int j = buckets[i].size()-2; j >= 1; j--)
|
for (int j= (unsigned int) (buckets[i].size()) - 2; j >= 1; j--)
|
||||||
{
|
{
|
||||||
Accumulate(buckets[i][j], buckets[i][j+1]);
|
Accumulate(buckets[i][j], buckets[i][j+1]);
|
||||||
Accumulate(r, buckets[i][j]);
|
Accumulate(r, buckets[i][j]);
|
||||||
|
@ -213,7 +213,7 @@ void PublicKey::AddToEnd(const byte* data, word32 len)
|
|||||||
Signer::Signer(const byte* k, word32 kSz, const char* n, const byte* h)
|
Signer::Signer(const byte* k, word32 kSz, const char* n, const byte* h)
|
||||||
: key_(k, kSz)
|
: key_(k, kSz)
|
||||||
{
|
{
|
||||||
int sz = strlen(n);
|
size_t sz = strlen(n);
|
||||||
memcpy(name_, n, sz);
|
memcpy(name_, n, sz);
|
||||||
name_[sz] = 0;
|
name_[sz] = 0;
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ int heap_write(HP_INFO *info, const byte *record)
|
|||||||
err:
|
err:
|
||||||
if (my_errno == HA_ERR_FOUND_DUPP_KEY)
|
if (my_errno == HA_ERR_FOUND_DUPP_KEY)
|
||||||
DBUG_PRINT("info",("Duplicate key: %d", (int) (keydef - share->keydef)));
|
DBUG_PRINT("info",("Duplicate key: %d", (int) (keydef - share->keydef)));
|
||||||
info->errkey= keydef - share->keydef;
|
info->errkey= (int) (keydef - share->keydef);
|
||||||
/*
|
/*
|
||||||
We don't need to delete non-inserted key from rb-tree. Also, if
|
We don't need to delete non-inserted key from rb-tree. Also, if
|
||||||
we got ENOMEM, the key wasn't inserted, so don't try to delete it
|
we got ENOMEM, the key wasn't inserted, so don't try to delete it
|
||||||
|
@ -31,7 +31,6 @@ functions */
|
|||||||
|
|
||||||
#include <sys/locking.h>
|
#include <sys/locking.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <math.h> /* Because of rint() */
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
@ -223,13 +222,6 @@ typedef uint rf_SetTimer;
|
|||||||
#define inline __inline
|
#define inline __inline
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
inline double rint(double nr)
|
|
||||||
{
|
|
||||||
double f = floor(nr);
|
|
||||||
double c = ceil(nr);
|
|
||||||
return (((c-nr) >= (nr-f)) ? f :c);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
#define ulonglong2double(A) ((double) (ulonglong) (A))
|
#define ulonglong2double(A) ((double) (ulonglong) (A))
|
||||||
#define my_off_t2double(A) ((double) (my_off_t) (A))
|
#define my_off_t2double(A) ((double) (my_off_t) (A))
|
||||||
@ -281,7 +273,6 @@ inline ulonglong double2ulonglong(double d)
|
|||||||
#define HAVE_FLOAT_H
|
#define HAVE_FLOAT_H
|
||||||
#define HAVE_LIMITS_H
|
#define HAVE_LIMITS_H
|
||||||
#define HAVE_STDDEF_H
|
#define HAVE_STDDEF_H
|
||||||
#define HAVE_RINT /* defined in this file */
|
|
||||||
#define NO_FCNTL_NONBLOCK /* No FCNTL */
|
#define NO_FCNTL_NONBLOCK /* No FCNTL */
|
||||||
#define HAVE_ALLOCA
|
#define HAVE_ALLOCA
|
||||||
#define HAVE_STRPBRK
|
#define HAVE_STRPBRK
|
||||||
|
@ -377,6 +377,7 @@ enum ha_base_keytype {
|
|||||||
#define HA_ERR_TABLE_READONLY 161 /* The table is not writable */
|
#define HA_ERR_TABLE_READONLY 161 /* The table is not writable */
|
||||||
#define HA_ERR_AUTOINC_READ_FAILED 162/* Failed to get the next autoinc value */
|
#define HA_ERR_AUTOINC_READ_FAILED 162/* Failed to get the next autoinc value */
|
||||||
#define HA_ERR_AUTOINC_ERANGE 163 /* Failed to set the row autoinc value */
|
#define HA_ERR_AUTOINC_ERANGE 163 /* Failed to set the row autoinc value */
|
||||||
|
/* You must also add numbers and description to extra/perror.c ! */
|
||||||
|
|
||||||
#define HA_ERR_LAST 163 /*Copy last error nr.*/
|
#define HA_ERR_LAST 163 /*Copy last error nr.*/
|
||||||
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
|
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
|
||||||
|
@ -324,6 +324,9 @@ C_MODE_END
|
|||||||
#ifdef HAVE_FLOAT_H
|
#ifdef HAVE_FLOAT_H
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_FENV_H
|
||||||
|
#include <fenv.h> /* For fesetround() */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -484,8 +487,39 @@ typedef unsigned short ushort;
|
|||||||
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
|
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
|
||||||
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
|
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
|
||||||
#ifndef HAVE_RINT
|
#ifndef HAVE_RINT
|
||||||
#define rint(A) floor((A)+(((A) < 0)? -0.5 : 0.5))
|
/**
|
||||||
#endif
|
All integers up to this number can be represented exactly as double precision
|
||||||
|
values (DBL_MANT_DIG == 53 for IEEE 754 hardware).
|
||||||
|
*/
|
||||||
|
#define MAX_EXACT_INTEGER ((1LL << DBL_MANT_DIG) - 1)
|
||||||
|
|
||||||
|
/**
|
||||||
|
rint(3) implementation for platforms that do not have it.
|
||||||
|
Always rounds to the nearest integer with ties being rounded to the nearest
|
||||||
|
even integer to mimic glibc's rint() behavior in the "round-to-nearest"
|
||||||
|
FPU mode. Hardware-specific optimizations are possible (frndint on x86).
|
||||||
|
Unlike this implementation, hardware will also honor the FPU rounding mode.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static inline double rint(double x)
|
||||||
|
{
|
||||||
|
double f, i;
|
||||||
|
f = modf(x, &i);
|
||||||
|
/*
|
||||||
|
All doubles with absolute values > MAX_EXACT_INTEGER are even anyway,
|
||||||
|
no need to check it.
|
||||||
|
*/
|
||||||
|
if (x > 0.0)
|
||||||
|
i += (double) ((f > 0.5) || (f == 0.5 &&
|
||||||
|
i <= (double) MAX_EXACT_INTEGER &&
|
||||||
|
(longlong) i % 2));
|
||||||
|
else
|
||||||
|
i -= (double) ((f < -0.5) || (f == -0.5 &&
|
||||||
|
i >= (double) -MAX_EXACT_INTEGER &&
|
||||||
|
(longlong) i % 2));
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_RINT */
|
||||||
|
|
||||||
/* Define some general constants */
|
/* Define some general constants */
|
||||||
#ifndef TRUE
|
#ifndef TRUE
|
||||||
|
@ -13,80 +13,42 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
/* See md5.c for explanation and copyright information. */
|
||||||
|
|
||||||
/* MD5.H - header file for MD5C.C
|
/*
|
||||||
|
* $FreeBSD: src/contrib/cvs/lib/md5.h,v 1.2 1999/12/11 15:10:02 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
/* Unlike previous versions of this code, uint32 need not be exactly
|
||||||
rights reserved.
|
32 bits, merely 32 bits or more. Choosing a data type which is 32
|
||||||
|
bits instead of 64 is not important; speed is considerably more
|
||||||
|
important. ANSI guarantees that "unsigned long" will be big enough,
|
||||||
|
and always using it seems to have few disadvantages. */
|
||||||
|
typedef uint32 cvs_uint32;
|
||||||
|
|
||||||
License to copy and use this software is granted provided that it
|
|
||||||
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
|
|
||||||
Algorithm" in all material mentioning or referencing this software
|
|
||||||
or this function.
|
|
||||||
|
|
||||||
License is also granted to make and use derivative works provided
|
|
||||||
that such works are identified as "derived from the RSA Data
|
|
||||||
Security, Inc. MD5 Message-Digest Algorithm" in all material
|
|
||||||
mentioning or referencing the derived work.
|
|
||||||
|
|
||||||
RSA Data Security, Inc. makes no representations concerning either
|
|
||||||
the merchantability of this software or the suitability of this
|
|
||||||
software for any particular purpose. It is provided "as is"
|
|
||||||
without express or implied warranty of any kind.
|
|
||||||
|
|
||||||
These notices must be retained in any copies of any part of this
|
|
||||||
documentation and/or software.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* GLOBAL.H - RSAREF types and constants
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* PROTOTYPES should be set to one if and only if the compiler supports
|
|
||||||
function argument prototyping.
|
|
||||||
The following makes PROTOTYPES default to 0 if it has not already
|
|
||||||
been defined with C compiler flags.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* egcs 1.1.2 under linux didn't defined it.... :( */
|
|
||||||
|
|
||||||
#ifndef PROTOTYPES
|
|
||||||
#define PROTOTYPES 1 /* Assume prototypes */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* POINTER defines a generic pointer type */
|
|
||||||
typedef unsigned char *POINTER;
|
|
||||||
|
|
||||||
/* UINT2 defines a two byte word */
|
|
||||||
typedef uint16 UINT2; /* Fix for MySQL / Alpha */
|
|
||||||
|
|
||||||
/* UINT4 defines a four byte word */
|
|
||||||
typedef uint32 UINT4; /* Fix for MySQL / Alpha */
|
|
||||||
|
|
||||||
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
|
|
||||||
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
|
|
||||||
returns an empty list.
|
|
||||||
*/
|
|
||||||
#if PROTOTYPES
|
|
||||||
#define PROTO_LIST(list) list
|
|
||||||
#else
|
|
||||||
#define PROTO_LIST(list) ()
|
|
||||||
#endif
|
|
||||||
/* MD5 context. */
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT4 state[4]; /* state (ABCD) */
|
cvs_uint32 buf[4];
|
||||||
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
cvs_uint32 bits[2];
|
||||||
unsigned char buffer[64]; /* input buffer */
|
unsigned char in[64];
|
||||||
} my_MD5_CTX;
|
} my_MD5Context;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
void my_MD5Init PROTO_LIST ((my_MD5_CTX *));
|
void my_MD5Init (my_MD5Context *context);
|
||||||
void my_MD5Update PROTO_LIST
|
void my_MD5Update (my_MD5Context *context,
|
||||||
((my_MD5_CTX *, unsigned char *, unsigned int));
|
unsigned char const *buf, unsigned len);
|
||||||
void my_MD5Final PROTO_LIST ((unsigned char [16], my_MD5_CTX *));
|
void my_MD5Final (unsigned char digest[16],
|
||||||
|
my_MD5Context *context);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MY_MD5_HASH(digest,buf,len) \
|
||||||
|
do { \
|
||||||
|
my_MD5Context ctx; \
|
||||||
|
my_MD5Init (&ctx); \
|
||||||
|
my_MD5Update (&ctx, buf, len); \
|
||||||
|
my_MD5Final (digest, &ctx); \
|
||||||
|
} while (0)
|
||||||
|
@ -250,7 +250,7 @@ extern int NEAR my_umask, /* Default creation mask */
|
|||||||
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
|
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
|
||||||
NEAR my_dont_interrupt; /* call remember_intr when set */
|
NEAR my_dont_interrupt; /* call remember_intr when set */
|
||||||
extern my_bool NEAR mysys_uses_curses, my_use_symdir;
|
extern my_bool NEAR mysys_uses_curses, my_use_symdir;
|
||||||
extern ulong sf_malloc_cur_memory, sf_malloc_max_memory;
|
extern size_t sf_malloc_cur_memory, sf_malloc_max_memory;
|
||||||
|
|
||||||
extern ulong my_default_record_cache_size;
|
extern ulong my_default_record_cache_size;
|
||||||
extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io,
|
extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io,
|
||||||
@ -636,6 +636,7 @@ extern int nt_share_delete(const char *name,myf MyFlags);
|
|||||||
extern void TERMINATE(FILE *file);
|
extern void TERMINATE(FILE *file);
|
||||||
#endif
|
#endif
|
||||||
extern void init_glob_errs(void);
|
extern void init_glob_errs(void);
|
||||||
|
extern void wait_for_free_space(const char *filename, int errors);
|
||||||
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
|
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
|
||||||
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
|
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
|
||||||
extern int my_fclose(FILE *fd,myf MyFlags);
|
extern int my_fclose(FILE *fd,myf MyFlags);
|
||||||
|
@ -42,6 +42,11 @@ initial segment in buf_LRU_get_recent_limit */
|
|||||||
|
|
||||||
#define BUF_LRU_INITIAL_RATIO 8
|
#define BUF_LRU_INITIAL_RATIO 8
|
||||||
|
|
||||||
|
/* When dropping the search hash index entries before deleting an ibd
|
||||||
|
file, we build a local array of pages belonging to that tablespace
|
||||||
|
in the buffer pool. Following is the size of that array. */
|
||||||
|
#define BUF_LRU_DROP_SEARCH_HASH_SIZE 1024
|
||||||
|
|
||||||
/* If we switch on the InnoDB monitor because there are too few available
|
/* If we switch on the InnoDB monitor because there are too few available
|
||||||
frames in the buffer pool, we set this to TRUE */
|
frames in the buffer pool, we set this to TRUE */
|
||||||
ibool buf_lru_switched_on_innodb_mon = FALSE;
|
ibool buf_lru_switched_on_innodb_mon = FALSE;
|
||||||
@ -65,6 +70,120 @@ buf_LRU_block_free_hashed_page(
|
|||||||
buf_block_t* block); /* in: block, must contain a file page and
|
buf_block_t* block); /* in: block, must contain a file page and
|
||||||
be in a state where it can be freed */
|
be in a state where it can be freed */
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
Attempts to drop page hash index on a batch of pages belonging to a
|
||||||
|
particular space id. */
|
||||||
|
static
|
||||||
|
void
|
||||||
|
buf_LRU_drop_page_hash_batch(
|
||||||
|
/*=========================*/
|
||||||
|
ulint id, /* in: space id */
|
||||||
|
const ulint* arr, /* in: array of page_no */
|
||||||
|
ulint count) /* in: number of entries in array */
|
||||||
|
{
|
||||||
|
ulint i;
|
||||||
|
|
||||||
|
ut_ad(arr != NULL);
|
||||||
|
ut_ad(count <= BUF_LRU_DROP_SEARCH_HASH_SIZE);
|
||||||
|
|
||||||
|
for (i = 0; i < count; ++i) {
|
||||||
|
btr_search_drop_page_hash_when_freed(id, arr[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
When doing a DROP TABLE/DISCARD TABLESPACE we have to drop all page
|
||||||
|
hash index entries belonging to that table. This function tries to
|
||||||
|
do that in batch. Note that this is a 'best effort' attempt and does
|
||||||
|
not guarantee that ALL hash entries will be removed. */
|
||||||
|
static
|
||||||
|
void
|
||||||
|
buf_LRU_drop_page_hash_for_tablespace(
|
||||||
|
/*==================================*/
|
||||||
|
ulint id) /* in: space id */
|
||||||
|
{
|
||||||
|
buf_block_t* block;
|
||||||
|
ulint* page_arr;
|
||||||
|
ulint num_entries;
|
||||||
|
|
||||||
|
page_arr = ut_malloc(sizeof(ulint)
|
||||||
|
* BUF_LRU_DROP_SEARCH_HASH_SIZE);
|
||||||
|
mutex_enter(&buf_pool->mutex);
|
||||||
|
|
||||||
|
scan_again:
|
||||||
|
num_entries = 0;
|
||||||
|
block = UT_LIST_GET_LAST(buf_pool->LRU);
|
||||||
|
|
||||||
|
while (block != NULL) {
|
||||||
|
buf_block_t* prev_block;
|
||||||
|
|
||||||
|
mutex_enter(&block->mutex);
|
||||||
|
prev_block = UT_LIST_GET_PREV(LRU, block);
|
||||||
|
|
||||||
|
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
|
||||||
|
|
||||||
|
if (block->space != id
|
||||||
|
|| block->buf_fix_count > 0
|
||||||
|
|| block->io_fix != 0) {
|
||||||
|
/* We leave the fixed pages as is in this scan.
|
||||||
|
To be dealt with later in the final scan. */
|
||||||
|
mutex_exit(&block->mutex);
|
||||||
|
goto next_page;
|
||||||
|
}
|
||||||
|
|
||||||
|
ut_ad(block->space == id);
|
||||||
|
if (block->is_hashed) {
|
||||||
|
|
||||||
|
/* Store the offset(i.e.: page_no) in the array
|
||||||
|
so that we can drop hash index in a batch
|
||||||
|
later. */
|
||||||
|
page_arr[num_entries] = block->offset;
|
||||||
|
mutex_exit(&block->mutex);
|
||||||
|
ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE);
|
||||||
|
++num_entries;
|
||||||
|
|
||||||
|
if (num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE) {
|
||||||
|
goto next_page;
|
||||||
|
}
|
||||||
|
/* Array full. We release the buf_pool->mutex to
|
||||||
|
obey the latching order. */
|
||||||
|
mutex_exit(&buf_pool->mutex);
|
||||||
|
|
||||||
|
buf_LRU_drop_page_hash_batch(id, page_arr,
|
||||||
|
num_entries);
|
||||||
|
num_entries = 0;
|
||||||
|
mutex_enter(&buf_pool->mutex);
|
||||||
|
} else {
|
||||||
|
mutex_exit(&block->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
next_page:
|
||||||
|
/* Note that we may have released the buf_pool->mutex
|
||||||
|
above after reading the prev_block during processing
|
||||||
|
of a page_hash_batch (i.e.: when the array was full).
|
||||||
|
This means that prev_block can change in LRU list.
|
||||||
|
This is OK because this function is a 'best effort'
|
||||||
|
to drop as many search hash entries as possible and
|
||||||
|
it does not guarantee that ALL such entries will be
|
||||||
|
dropped. */
|
||||||
|
block = prev_block;
|
||||||
|
|
||||||
|
/* If, however, block has been removed from LRU list
|
||||||
|
to the free list then we should restart the scan.
|
||||||
|
block->state is protected by buf_pool->mutex. */
|
||||||
|
if (block && block->state != BUF_BLOCK_FILE_PAGE) {
|
||||||
|
ut_a(num_entries == 0);
|
||||||
|
goto scan_again;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mutex_exit(&buf_pool->mutex);
|
||||||
|
|
||||||
|
/* Drop any remaining batch of search hashed pages. */
|
||||||
|
buf_LRU_drop_page_hash_batch(id, page_arr, num_entries);
|
||||||
|
ut_free(page_arr);
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
Invalidates all pages belonging to a given tablespace when we are deleting
|
Invalidates all pages belonging to a given tablespace when we are deleting
|
||||||
the data file(s) of that tablespace. */
|
the data file(s) of that tablespace. */
|
||||||
@ -78,6 +197,14 @@ buf_LRU_invalidate_tablespace(
|
|||||||
ulint page_no;
|
ulint page_no;
|
||||||
ibool all_freed;
|
ibool all_freed;
|
||||||
|
|
||||||
|
/* Before we attempt to drop pages one by one we first
|
||||||
|
attempt to drop page hash index entries in batches to make
|
||||||
|
it more efficient. The batching attempt is a best effort
|
||||||
|
attempt and does not guarantee that all pages hash entries
|
||||||
|
will be dropped. We get rid of remaining page hash entries
|
||||||
|
one by one below. */
|
||||||
|
buf_LRU_drop_page_hash_for_tablespace(id);
|
||||||
|
|
||||||
scan_again:
|
scan_again:
|
||||||
mutex_enter(&(buf_pool->mutex));
|
mutex_enter(&(buf_pool->mutex));
|
||||||
|
|
||||||
|
@ -1249,7 +1249,8 @@ dict_create_or_check_foreign_constraint_tables(void)
|
|||||||
fprintf(stderr, "InnoDB: error %lu in creation\n",
|
fprintf(stderr, "InnoDB: error %lu in creation\n",
|
||||||
(ulong) error);
|
(ulong) error);
|
||||||
|
|
||||||
ut_a(error == DB_OUT_OF_FILE_SPACE);
|
ut_a(error == DB_OUT_OF_FILE_SPACE
|
||||||
|
|| error == DB_TOO_MANY_CONCURRENT_TRXS);
|
||||||
|
|
||||||
fprintf(stderr, "InnoDB: creation failed\n");
|
fprintf(stderr, "InnoDB: creation failed\n");
|
||||||
fprintf(stderr, "InnoDB: tablespace is full\n");
|
fprintf(stderr, "InnoDB: tablespace is full\n");
|
||||||
|
@ -70,6 +70,11 @@ Created 5/24/1996 Heikki Tuuri
|
|||||||
work with e.g., FT indexes created by
|
work with e.g., FT indexes created by
|
||||||
a later version of the engine. */
|
a later version of the engine. */
|
||||||
|
|
||||||
|
#define DB_TOO_MANY_CONCURRENT_TRXS 47 /* when InnoDB runs out of the
|
||||||
|
preconfigured undo slots, this can
|
||||||
|
only happen when there are too many
|
||||||
|
concurrent transactions */
|
||||||
|
|
||||||
/* The following are partial failure codes */
|
/* The following are partial failure codes */
|
||||||
#define DB_FAIL 1000
|
#define DB_FAIL 1000
|
||||||
#define DB_OVERFLOW 1001
|
#define DB_OVERFLOW 1001
|
||||||
|
@ -484,7 +484,7 @@ struct for_node_struct{
|
|||||||
definition */
|
definition */
|
||||||
que_node_t* loop_start_limit;/* initial value of loop variable */
|
que_node_t* loop_start_limit;/* initial value of loop variable */
|
||||||
que_node_t* loop_end_limit; /* end value of loop variable */
|
que_node_t* loop_end_limit; /* end value of loop variable */
|
||||||
int loop_end_value; /* evaluated value for the end value:
|
lint loop_end_value; /* evaluated value for the end value:
|
||||||
it is calculated only when the loop
|
it is calculated only when the loop
|
||||||
is entered, and will not change within
|
is entered, and will not change within
|
||||||
the loop */
|
the loop */
|
||||||
|
@ -368,8 +368,9 @@ rec_set_field_extern_bits(
|
|||||||
/***************************************************************
|
/***************************************************************
|
||||||
This is used to modify the value of an already existing field in a record.
|
This is used to modify the value of an already existing field in a record.
|
||||||
The previous value must have exactly the same size as the new value. If len
|
The previous value must have exactly the same size as the new value. If len
|
||||||
is UNIV_SQL_NULL then the field is treated as an SQL null for old-style
|
is UNIV_SQL_NULL then the field is treated as an SQL null.
|
||||||
records. For new-style records, len must not be UNIV_SQL_NULL. */
|
For records in ROW_FORMAT=COMPACT (new-style records), len must not be
|
||||||
|
UNIV_SQL_NULL unless the field already is SQL null. */
|
||||||
UNIV_INLINE
|
UNIV_INLINE
|
||||||
void
|
void
|
||||||
rec_set_nth_field(
|
rec_set_nth_field(
|
||||||
@ -378,11 +379,7 @@ rec_set_nth_field(
|
|||||||
const ulint* offsets,/* in: array returned by rec_get_offsets() */
|
const ulint* offsets,/* in: array returned by rec_get_offsets() */
|
||||||
ulint n, /* in: index number of the field */
|
ulint n, /* in: index number of the field */
|
||||||
const void* data, /* in: pointer to the data if not SQL null */
|
const void* data, /* in: pointer to the data if not SQL null */
|
||||||
ulint len); /* in: length of the data or UNIV_SQL_NULL.
|
ulint len); /* in: length of the data or UNIV_SQL_NULL */
|
||||||
If not SQL null, must have the same
|
|
||||||
length as the previous value.
|
|
||||||
If SQL null, previous value must be
|
|
||||||
SQL null. */
|
|
||||||
/**************************************************************
|
/**************************************************************
|
||||||
The following function returns the data size of an old-style physical
|
The following function returns the data size of an old-style physical
|
||||||
record, that is the sum of field lengths. SQL null fields
|
record, that is the sum of field lengths. SQL null fields
|
||||||
|
@ -1204,8 +1204,9 @@ rec_get_nth_field_size(
|
|||||||
/***************************************************************
|
/***************************************************************
|
||||||
This is used to modify the value of an already existing field in a record.
|
This is used to modify the value of an already existing field in a record.
|
||||||
The previous value must have exactly the same size as the new value. If len
|
The previous value must have exactly the same size as the new value. If len
|
||||||
is UNIV_SQL_NULL then the field is treated as an SQL null for old-style
|
is UNIV_SQL_NULL then the field is treated as an SQL null.
|
||||||
records. For new-style records, len must not be UNIV_SQL_NULL. */
|
For records in ROW_FORMAT=COMPACT (new-style records), len must not be
|
||||||
|
UNIV_SQL_NULL unless the field already is SQL null. */
|
||||||
UNIV_INLINE
|
UNIV_INLINE
|
||||||
void
|
void
|
||||||
rec_set_nth_field(
|
rec_set_nth_field(
|
||||||
@ -1215,11 +1216,7 @@ rec_set_nth_field(
|
|||||||
ulint n, /* in: index number of the field */
|
ulint n, /* in: index number of the field */
|
||||||
const void* data, /* in: pointer to the data
|
const void* data, /* in: pointer to the data
|
||||||
if not SQL null */
|
if not SQL null */
|
||||||
ulint len) /* in: length of the data or UNIV_SQL_NULL.
|
ulint len) /* in: length of the data or UNIV_SQL_NULL */
|
||||||
If not SQL null, must have the same
|
|
||||||
length as the previous value.
|
|
||||||
If SQL null, previous value must be
|
|
||||||
SQL null. */
|
|
||||||
{
|
{
|
||||||
byte* data2;
|
byte* data2;
|
||||||
ulint len2;
|
ulint len2;
|
||||||
@ -1227,9 +1224,11 @@ rec_set_nth_field(
|
|||||||
ut_ad(rec);
|
ut_ad(rec);
|
||||||
ut_ad(rec_offs_validate(rec, NULL, offsets));
|
ut_ad(rec_offs_validate(rec, NULL, offsets));
|
||||||
|
|
||||||
if (len == UNIV_SQL_NULL) {
|
if (UNIV_UNLIKELY(len == UNIV_SQL_NULL)) {
|
||||||
ut_ad(!rec_offs_comp(offsets));
|
if (!rec_offs_nth_sql_null(offsets, n)) {
|
||||||
rec_set_nth_field_sql_null(rec, n);
|
ut_a(!rec_offs_comp(offsets));
|
||||||
|
rec_set_nth_field_sql_null(rec, n);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -222,13 +222,16 @@ trx_undo_lists_init(
|
|||||||
Assigns an undo log for a transaction. A new undo log is created or a cached
|
Assigns an undo log for a transaction. A new undo log is created or a cached
|
||||||
undo log reused. */
|
undo log reused. */
|
||||||
|
|
||||||
trx_undo_t*
|
ulint
|
||||||
trx_undo_assign_undo(
|
trx_undo_assign_undo(
|
||||||
/*=================*/
|
/*=================*/
|
||||||
/* out: the undo log, NULL if did not succeed: out of
|
/* out: DB_SUCCESS if undo log assign
|
||||||
space */
|
* successful, possible error codes are:
|
||||||
trx_t* trx, /* in: transaction */
|
* ER_TOO_MANY_CONCURRENT_TRXS
|
||||||
ulint type); /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
|
* DB_OUT_OF_FILE_SPAC
|
||||||
|
* DB_OUT_OF_MEMORY */
|
||||||
|
trx_t* trx, /* in: transaction */
|
||||||
|
ulint type); /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
Sets the state of the undo log segment at a transaction finish. */
|
Sets the state of the undo log segment at a transaction finish. */
|
||||||
|
|
||||||
|
@ -1679,8 +1679,8 @@ pars_get_lex_chars(
|
|||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = pars_sym_tab_global->string_len
|
len= (uint) (pars_sym_tab_global->string_len
|
||||||
- pars_sym_tab_global->next_char_pos;
|
- pars_sym_tab_global->next_char_pos);
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
#ifdef YYDEBUG
|
#ifdef YYDEBUG
|
||||||
/* fputs("SQL string ends\n", stderr); */
|
/* fputs("SQL string ends\n", stderr); */
|
||||||
|
@ -587,7 +587,7 @@ cmp_dtuple_rec_with_match(
|
|||||||
dtuple_byte = cmp_collate(dtuple_byte);
|
dtuple_byte = cmp_collate(dtuple_byte);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = dtuple_byte - rec_byte;
|
ret = (uint) (dtuple_byte - rec_byte);
|
||||||
if (UNIV_UNLIKELY(ret)) {
|
if (UNIV_UNLIKELY(ret)) {
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
@ -494,7 +494,8 @@ handle_new_error:
|
|||||||
/* MySQL will roll back the latest SQL statement */
|
/* MySQL will roll back the latest SQL statement */
|
||||||
} else if (err == DB_ROW_IS_REFERENCED
|
} else if (err == DB_ROW_IS_REFERENCED
|
||||||
|| err == DB_NO_REFERENCED_ROW
|
|| err == DB_NO_REFERENCED_ROW
|
||||||
|| err == DB_CANNOT_ADD_CONSTRAINT) {
|
|| err == DB_CANNOT_ADD_CONSTRAINT
|
||||||
|
|| err == DB_TOO_MANY_CONCURRENT_TRXS) {
|
||||||
if (savept) {
|
if (savept) {
|
||||||
/* Roll back the latest, possibly incomplete
|
/* Roll back the latest, possibly incomplete
|
||||||
insertion or update */
|
insertion or update */
|
||||||
|
@ -1013,6 +1013,7 @@ trx_undo_report_row_operation(
|
|||||||
ibool is_insert;
|
ibool is_insert;
|
||||||
trx_rseg_t* rseg;
|
trx_rseg_t* rseg;
|
||||||
mtr_t mtr;
|
mtr_t mtr;
|
||||||
|
ulint err = DB_SUCCESS;
|
||||||
mem_heap_t* heap = NULL;
|
mem_heap_t* heap = NULL;
|
||||||
ulint offsets_[REC_OFFS_NORMAL_SIZE];
|
ulint offsets_[REC_OFFS_NORMAL_SIZE];
|
||||||
ulint* offsets = offsets_;
|
ulint* offsets = offsets_;
|
||||||
@ -1024,7 +1025,7 @@ trx_undo_report_row_operation(
|
|||||||
|
|
||||||
*roll_ptr = ut_dulint_zero;
|
*roll_ptr = ut_dulint_zero;
|
||||||
|
|
||||||
return(DB_SUCCESS);
|
return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
ut_ad(thr);
|
ut_ad(thr);
|
||||||
@ -1042,7 +1043,7 @@ trx_undo_report_row_operation(
|
|||||||
|
|
||||||
if (trx->insert_undo == NULL) {
|
if (trx->insert_undo == NULL) {
|
||||||
|
|
||||||
trx_undo_assign_undo(trx, TRX_UNDO_INSERT);
|
err = trx_undo_assign_undo(trx, TRX_UNDO_INSERT);
|
||||||
}
|
}
|
||||||
|
|
||||||
undo = trx->insert_undo;
|
undo = trx->insert_undo;
|
||||||
@ -1052,7 +1053,7 @@ trx_undo_report_row_operation(
|
|||||||
|
|
||||||
if (trx->update_undo == NULL) {
|
if (trx->update_undo == NULL) {
|
||||||
|
|
||||||
trx_undo_assign_undo(trx, TRX_UNDO_UPDATE);
|
err = trx_undo_assign_undo(trx, TRX_UNDO_UPDATE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1060,11 +1061,11 @@ trx_undo_report_row_operation(
|
|||||||
is_insert = FALSE;
|
is_insert = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (undo == NULL) {
|
if (err != DB_SUCCESS) {
|
||||||
/* Did not succeed: out of space */
|
/* Did not succeed: return the error encountered */
|
||||||
mutex_exit(&(trx->undo_mutex));
|
mutex_exit(&(trx->undo_mutex));
|
||||||
|
|
||||||
return(DB_OUT_OF_FILE_SPACE);
|
return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
page_no = undo->last_page_no;
|
page_no = undo->last_page_no;
|
||||||
@ -1154,7 +1155,7 @@ trx_undo_report_row_operation(
|
|||||||
if (UNIV_LIKELY_NULL(heap)) {
|
if (UNIV_LIKELY_NULL(heap)) {
|
||||||
mem_heap_free(heap);
|
mem_heap_free(heap);
|
||||||
}
|
}
|
||||||
return(DB_SUCCESS);
|
return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*============== BUILDING PREVIOUS VERSION OF A RECORD ===============*/
|
/*============== BUILDING PREVIOUS VERSION OF A RECORD ===============*/
|
||||||
|
@ -374,27 +374,32 @@ trx_undo_page_init(
|
|||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
Creates a new undo log segment in file. */
|
Creates a new undo log segment in file. */
|
||||||
static
|
static
|
||||||
page_t*
|
ulint
|
||||||
trx_undo_seg_create(
|
trx_undo_seg_create(
|
||||||
/*================*/
|
/*================*/
|
||||||
/* out: segment header page x-latched, NULL
|
/* out: DB_SUCCESS if page creation OK
|
||||||
if no space left */
|
possible error codes are:
|
||||||
|
DB_TOO_MANY_CONCURRENT_TRXS
|
||||||
|
DB_OUT_OF_FILE_SPACE */
|
||||||
trx_rseg_t* rseg __attribute__((unused)),/* in: rollback segment */
|
trx_rseg_t* rseg __attribute__((unused)),/* in: rollback segment */
|
||||||
trx_rsegf_t* rseg_hdr,/* in: rollback segment header, page
|
trx_rsegf_t* rseg_hdr,/* in: rollback segment header, page
|
||||||
x-latched */
|
x-latched */
|
||||||
ulint type, /* in: type of the segment: TRX_UNDO_INSERT or
|
ulint type, /* in: type of the segment: TRX_UNDO_INSERT or
|
||||||
TRX_UNDO_UPDATE */
|
TRX_UNDO_UPDATE */
|
||||||
ulint* id, /* out: slot index within rseg header */
|
ulint* id, /* out: slot index within rseg header */
|
||||||
|
page_t** undo_page,
|
||||||
|
/* out: segment header page x-latched, NULL
|
||||||
|
if there was an error */
|
||||||
mtr_t* mtr) /* in: mtr */
|
mtr_t* mtr) /* in: mtr */
|
||||||
{
|
{
|
||||||
ulint slot_no;
|
ulint slot_no;
|
||||||
ulint space;
|
ulint space;
|
||||||
page_t* undo_page;
|
|
||||||
trx_upagef_t* page_hdr;
|
trx_upagef_t* page_hdr;
|
||||||
trx_usegf_t* seg_hdr;
|
trx_usegf_t* seg_hdr;
|
||||||
ulint n_reserved;
|
ulint n_reserved;
|
||||||
ibool success;
|
ibool success;
|
||||||
|
ulint err = DB_SUCCESS;
|
||||||
|
|
||||||
ut_ad(mtr && id && rseg_hdr);
|
ut_ad(mtr && id && rseg_hdr);
|
||||||
#ifdef UNIV_SYNC_DEBUG
|
#ifdef UNIV_SYNC_DEBUG
|
||||||
ut_ad(mutex_own(&(rseg->mutex)));
|
ut_ad(mutex_own(&(rseg->mutex)));
|
||||||
@ -411,7 +416,7 @@ trx_undo_seg_create(
|
|||||||
"InnoDB: Warning: cannot find a free slot for an undo log. Do you have too\n"
|
"InnoDB: Warning: cannot find a free slot for an undo log. Do you have too\n"
|
||||||
"InnoDB: many active transactions running concurrently?\n");
|
"InnoDB: many active transactions running concurrently?\n");
|
||||||
|
|
||||||
return(NULL);
|
return(DB_TOO_MANY_CONCURRENT_TRXS);
|
||||||
}
|
}
|
||||||
|
|
||||||
space = buf_frame_get_space_id(rseg_hdr);
|
space = buf_frame_get_space_id(rseg_hdr);
|
||||||
@ -420,29 +425,29 @@ trx_undo_seg_create(
|
|||||||
mtr);
|
mtr);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
|
|
||||||
return(NULL);
|
return(DB_OUT_OF_FILE_SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate a new file segment for the undo log */
|
/* Allocate a new file segment for the undo log */
|
||||||
undo_page = fseg_create_general(space, 0,
|
*undo_page = fseg_create_general(space, 0,
|
||||||
TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER, TRUE, mtr);
|
TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER, TRUE, mtr);
|
||||||
|
|
||||||
fil_space_release_free_extents(space, n_reserved);
|
fil_space_release_free_extents(space, n_reserved);
|
||||||
|
|
||||||
if (undo_page == NULL) {
|
if (*undo_page == NULL) {
|
||||||
/* No space left */
|
/* No space left */
|
||||||
|
|
||||||
return(NULL);
|
return(DB_OUT_OF_FILE_SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef UNIV_SYNC_DEBUG
|
#ifdef UNIV_SYNC_DEBUG
|
||||||
buf_page_dbg_add_level(undo_page, SYNC_TRX_UNDO_PAGE);
|
buf_page_dbg_add_level(*undo_page, SYNC_TRX_UNDO_PAGE);
|
||||||
#endif /* UNIV_SYNC_DEBUG */
|
#endif /* UNIV_SYNC_DEBUG */
|
||||||
|
|
||||||
page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
|
page_hdr = *undo_page + TRX_UNDO_PAGE_HDR;
|
||||||
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
|
seg_hdr = *undo_page + TRX_UNDO_SEG_HDR;
|
||||||
|
|
||||||
trx_undo_page_init(undo_page, type, mtr);
|
trx_undo_page_init(*undo_page, type, mtr);
|
||||||
|
|
||||||
mlog_write_ulint(page_hdr + TRX_UNDO_PAGE_FREE,
|
mlog_write_ulint(page_hdr + TRX_UNDO_PAGE_FREE,
|
||||||
TRX_UNDO_SEG_HDR + TRX_UNDO_SEG_HDR_SIZE,
|
TRX_UNDO_SEG_HDR + TRX_UNDO_SEG_HDR_SIZE,
|
||||||
@ -456,10 +461,11 @@ trx_undo_seg_create(
|
|||||||
page_hdr + TRX_UNDO_PAGE_NODE, mtr);
|
page_hdr + TRX_UNDO_PAGE_NODE, mtr);
|
||||||
|
|
||||||
trx_rsegf_set_nth_undo(rseg_hdr, slot_no,
|
trx_rsegf_set_nth_undo(rseg_hdr, slot_no,
|
||||||
buf_frame_get_page_no(undo_page), mtr);
|
buf_frame_get_page_no(*undo_page), mtr);
|
||||||
|
|
||||||
*id = slot_no;
|
*id = slot_no;
|
||||||
|
|
||||||
return(undo_page);
|
return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -1400,6 +1406,11 @@ trx_undo_mem_create(
|
|||||||
|
|
||||||
undo = mem_alloc(sizeof(trx_undo_t));
|
undo = mem_alloc(sizeof(trx_undo_t));
|
||||||
|
|
||||||
|
if (undo == NULL) {
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
undo->id = id;
|
undo->id = id;
|
||||||
undo->type = type;
|
undo->type = type;
|
||||||
undo->state = TRX_UNDO_ACTIVE;
|
undo->state = TRX_UNDO_ACTIVE;
|
||||||
@ -1479,11 +1490,15 @@ trx_undo_mem_free(
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
Creates a new undo log. */
|
Creates a new undo log. */
|
||||||
static
|
static
|
||||||
trx_undo_t*
|
ulint
|
||||||
trx_undo_create(
|
trx_undo_create(
|
||||||
/*============*/
|
/*============*/
|
||||||
/* out: undo log object, NULL if did not
|
/* out: DB_SUCCESS if successful in creating
|
||||||
succeed: out of space */
|
the new undo lob object, possible error
|
||||||
|
codes are:
|
||||||
|
DB_TOO_MANY_CONCURRENT_TRXS
|
||||||
|
DB_OUT_OF_FILE_SPACE
|
||||||
|
DB_OUT_OF_MEMORY*/
|
||||||
trx_t* trx, /* in: transaction */
|
trx_t* trx, /* in: transaction */
|
||||||
trx_rseg_t* rseg, /* in: rollback segment memory copy */
|
trx_rseg_t* rseg, /* in: rollback segment memory copy */
|
||||||
ulint type, /* in: type of the log: TRX_UNDO_INSERT or
|
ulint type, /* in: type of the log: TRX_UNDO_INSERT or
|
||||||
@ -1491,36 +1506,39 @@ trx_undo_create(
|
|||||||
dulint trx_id, /* in: id of the trx for which the undo log
|
dulint trx_id, /* in: id of the trx for which the undo log
|
||||||
is created */
|
is created */
|
||||||
XID* xid, /* in: X/Open transaction identification*/
|
XID* xid, /* in: X/Open transaction identification*/
|
||||||
|
trx_undo_t** undo, /* out: the new undo log object, undefined
|
||||||
|
* if did not succeed */
|
||||||
mtr_t* mtr) /* in: mtr */
|
mtr_t* mtr) /* in: mtr */
|
||||||
{
|
{
|
||||||
trx_rsegf_t* rseg_header;
|
trx_rsegf_t* rseg_header;
|
||||||
ulint page_no;
|
ulint page_no;
|
||||||
ulint offset;
|
ulint offset;
|
||||||
ulint id;
|
ulint id;
|
||||||
trx_undo_t* undo;
|
|
||||||
page_t* undo_page;
|
page_t* undo_page;
|
||||||
|
ulint err;
|
||||||
|
|
||||||
#ifdef UNIV_SYNC_DEBUG
|
#ifdef UNIV_SYNC_DEBUG
|
||||||
ut_ad(mutex_own(&(rseg->mutex)));
|
ut_ad(mutex_own(&(rseg->mutex)));
|
||||||
#endif /* UNIV_SYNC_DEBUG */
|
#endif /* UNIV_SYNC_DEBUG */
|
||||||
|
|
||||||
if (rseg->curr_size == rseg->max_size) {
|
if (rseg->curr_size == rseg->max_size) {
|
||||||
|
|
||||||
return(NULL);
|
return(DB_OUT_OF_FILE_SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
rseg->curr_size++;
|
rseg->curr_size++;
|
||||||
|
|
||||||
rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
|
rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
|
||||||
|
|
||||||
undo_page = trx_undo_seg_create(rseg, rseg_header, type, &id, mtr);
|
err = trx_undo_seg_create(rseg, rseg_header, type, &id,
|
||||||
|
&undo_page, mtr);
|
||||||
|
|
||||||
if (undo_page == NULL) {
|
if (err != DB_SUCCESS) {
|
||||||
/* Did not succeed */
|
/* Did not succeed */
|
||||||
|
|
||||||
rseg->curr_size--;
|
rseg->curr_size--;
|
||||||
|
|
||||||
return(NULL);
|
return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
page_no = buf_frame_get_page_no(undo_page);
|
page_no = buf_frame_get_page_no(undo_page);
|
||||||
@ -1532,9 +1550,14 @@ trx_undo_create(
|
|||||||
undo_page + offset, mtr);
|
undo_page + offset, mtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
undo = trx_undo_mem_create(rseg, id, type, trx_id, xid,
|
*undo = trx_undo_mem_create(rseg, id, type, trx_id, xid,
|
||||||
page_no, offset);
|
page_no, offset);
|
||||||
return(undo);
|
if (*undo == NULL) {
|
||||||
|
|
||||||
|
err = DB_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*================ UNDO LOG ASSIGNMENT AND CLEANUP =====================*/
|
/*================ UNDO LOG ASSIGNMENT AND CLEANUP =====================*/
|
||||||
@ -1653,17 +1676,20 @@ trx_undo_mark_as_dict_operation(
|
|||||||
Assigns an undo log for a transaction. A new undo log is created or a cached
|
Assigns an undo log for a transaction. A new undo log is created or a cached
|
||||||
undo log reused. */
|
undo log reused. */
|
||||||
|
|
||||||
trx_undo_t*
|
ulint
|
||||||
trx_undo_assign_undo(
|
trx_undo_assign_undo(
|
||||||
/*=================*/
|
/*=================*/
|
||||||
/* out: the undo log, NULL if did not succeed: out of
|
/* out: DB_SUCCESS if undo log assign
|
||||||
space */
|
successful, possible error codes are:
|
||||||
trx_t* trx, /* in: transaction */
|
DD_TOO_MANY_CONCURRENT_TRXS
|
||||||
ulint type) /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
|
DB_OUT_OF_FILE_SPACE DB_OUT_OF_MEMORY*/
|
||||||
|
trx_t* trx, /* in: transaction */
|
||||||
|
ulint type) /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
|
||||||
{
|
{
|
||||||
trx_rseg_t* rseg;
|
trx_rseg_t* rseg;
|
||||||
trx_undo_t* undo;
|
trx_undo_t* undo;
|
||||||
mtr_t mtr;
|
mtr_t mtr;
|
||||||
|
ulint err = DB_SUCCESS;
|
||||||
|
|
||||||
ut_ad(trx);
|
ut_ad(trx);
|
||||||
ut_ad(trx->rseg);
|
ut_ad(trx->rseg);
|
||||||
@ -1684,15 +1710,11 @@ trx_undo_assign_undo(
|
|||||||
undo = trx_undo_reuse_cached(trx, rseg, type, trx->id, &trx->xid,
|
undo = trx_undo_reuse_cached(trx, rseg, type, trx->id, &trx->xid,
|
||||||
&mtr);
|
&mtr);
|
||||||
if (undo == NULL) {
|
if (undo == NULL) {
|
||||||
undo = trx_undo_create(trx, rseg, type, trx->id, &trx->xid,
|
err = trx_undo_create(trx, rseg, type, trx->id, &trx->xid,
|
||||||
&mtr);
|
&undo, &mtr);
|
||||||
if (undo == NULL) {
|
if (err != DB_SUCCESS) {
|
||||||
/* Did not succeed */
|
|
||||||
|
|
||||||
mutex_exit(&(rseg->mutex));
|
goto func_exit;
|
||||||
mtr_commit(&mtr);
|
|
||||||
|
|
||||||
return(NULL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1710,10 +1732,11 @@ trx_undo_assign_undo(
|
|||||||
trx_undo_mark_as_dict_operation(trx, undo, &mtr);
|
trx_undo_mark_as_dict_operation(trx, undo, &mtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func_exit:
|
||||||
mutex_exit(&(rseg->mutex));
|
mutex_exit(&(rseg->mutex));
|
||||||
mtr_commit(&mtr);
|
mtr_commit(&mtr);
|
||||||
|
|
||||||
return(undo);
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
@ -3552,7 +3552,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
|
|||||||
*/
|
*/
|
||||||
char *start= value + param->offset;
|
char *start= value + param->offset;
|
||||||
char *end= value + length;
|
char *end= value + length;
|
||||||
ulong copy_length;
|
size_t copy_length;
|
||||||
if (start < end)
|
if (start < end)
|
||||||
{
|
{
|
||||||
copy_length= end - start;
|
copy_length= end - start;
|
||||||
@ -3786,13 +3786,13 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||||||
#undef NOT_FIXED_DEC
|
#undef NOT_FIXED_DEC
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
The 14 below is to ensure that the server and client has the same
|
DBL_DIG below is to ensure that the server and client has the same
|
||||||
precisions. This will ensure that on the same machine you get the
|
precisions. This will ensure that on the same machine you get the
|
||||||
same value as a string independent of the protocol you use.
|
same value as a string independent of the protocol you use.
|
||||||
*/
|
*/
|
||||||
sprintf(buff, "%-*.*g", (int) min(sizeof(buff)-1,
|
sprintf(buff, "%-*.*g", (int) min(sizeof(buff)-1,
|
||||||
param->buffer_length),
|
param->buffer_length),
|
||||||
min(14,width), value);
|
min(DBL_DIG, width), value);
|
||||||
end= strcend(buff, ' ');
|
end= strcend(buff, ' ');
|
||||||
*end= 0;
|
*end= 0;
|
||||||
}
|
}
|
||||||
@ -3807,11 +3807,11 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||||||
if (field->flags & ZEROFILL_FLAG && length < field->length &&
|
if (field->flags & ZEROFILL_FLAG && length < field->length &&
|
||||||
field->length < MAX_DOUBLE_STRING_REP_LENGTH - 1)
|
field->length < MAX_DOUBLE_STRING_REP_LENGTH - 1)
|
||||||
{
|
{
|
||||||
bmove_upp((char*) buff + field->length, buff + length, length);
|
bmove_upp((char*) buff + field->length, buff + length, (uint) length);
|
||||||
bfill((char*) buff, field->length - length, '0');
|
bfill((char*) buff, field->length - length, '0');
|
||||||
length= field->length;
|
length= field->length;
|
||||||
}
|
}
|
||||||
fetch_string_with_conversion(param, buff, length);
|
fetch_string_with_conversion(param, buff, (uint) length);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -159,7 +159,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
sprintf(msg_buf,"%-.16s %-.16s\n",user,passwd);
|
sprintf(msg_buf,"%-.16s %-.16s\n",user,passwd);
|
||||||
msg_len=strlen(msg_buf);
|
msg_len= (uint) strlen(msg_buf);
|
||||||
if (my_net_write(&con->net,msg_buf,msg_len) || net_flush(&con->net))
|
if (my_net_write(&con->net,msg_buf,msg_len) || net_flush(&con->net))
|
||||||
{
|
{
|
||||||
con->last_errno=con->net.last_errno;
|
con->last_errno=con->net.last_errno;
|
||||||
@ -219,7 +219,7 @@ int STDCALL mysql_manager_command(MYSQL_MANAGER* con,const char* cmd,
|
|||||||
int cmd_len)
|
int cmd_len)
|
||||||
{
|
{
|
||||||
if (!cmd_len)
|
if (!cmd_len)
|
||||||
cmd_len=strlen(cmd);
|
cmd_len= (uint) strlen(cmd);
|
||||||
if (my_net_write(&con->net,(char*)cmd,cmd_len) || net_flush(&con->net))
|
if (my_net_write(&con->net,(char*)cmd,cmd_len) || net_flush(&con->net))
|
||||||
{
|
{
|
||||||
con->last_errno=errno;
|
con->last_errno=errno;
|
||||||
|
@ -659,7 +659,7 @@ void mi_collect_stats_nonulls_first(HA_KEYSEG *keyseg, ulonglong *notnull,
|
|||||||
uchar *key)
|
uchar *key)
|
||||||
{
|
{
|
||||||
uint first_null, kp;
|
uint first_null, kp;
|
||||||
first_null= ha_find_null(keyseg, key) - keyseg;
|
first_null= (uint) (ha_find_null(keyseg, key) - keyseg);
|
||||||
/*
|
/*
|
||||||
All prefix tuples that don't include keypart_{first_null} are not-null
|
All prefix tuples that don't include keypart_{first_null} are not-null
|
||||||
tuples (and all others aren't), increment counters for them.
|
tuples (and all others aren't), increment counters for them.
|
||||||
@ -715,7 +715,7 @@ int mi_collect_stats_nonulls_next(HA_KEYSEG *keyseg, ulonglong *notnull,
|
|||||||
seg= keyseg + diffs[0] - 1;
|
seg= keyseg + diffs[0] - 1;
|
||||||
|
|
||||||
/* Find first NULL in last_key */
|
/* Find first NULL in last_key */
|
||||||
first_null_seg= ha_find_null(seg, last_key + diffs[1]) - keyseg;
|
first_null_seg= (uint) (ha_find_null(seg, last_key + diffs[1]) - keyseg);
|
||||||
for (kp= 0; kp < first_null_seg; kp++)
|
for (kp= 0; kp < first_null_seg; kp++)
|
||||||
notnull[kp]++;
|
notnull[kp]++;
|
||||||
|
|
||||||
@ -3913,7 +3913,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
|
|||||||
key_block++;
|
key_block++;
|
||||||
sort_info->key_block=key_block;
|
sort_info->key_block=key_block;
|
||||||
sort_param->keyinfo=& sort_info->info->s->ft2_keyinfo;
|
sort_param->keyinfo=& sort_info->info->s->ft2_keyinfo;
|
||||||
ft_buf->count=(ft_buf->buf - p)/val_len;
|
ft_buf->count=(uint) (ft_buf->buf - p)/val_len;
|
||||||
|
|
||||||
/* flushing buffer to second-level tree */
|
/* flushing buffer to second-level tree */
|
||||||
for (error=0; !error && p < ft_buf->buf; p+= val_len)
|
for (error=0; !error && p < ft_buf->buf; p+= val_len)
|
||||||
|
@ -112,7 +112,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
|
|||||||
share_buff.state.rec_per_key_part=rec_per_key_part;
|
share_buff.state.rec_per_key_part=rec_per_key_part;
|
||||||
share_buff.state.key_root=key_root;
|
share_buff.state.key_root=key_root;
|
||||||
share_buff.state.key_del=key_del;
|
share_buff.state.key_del=key_del;
|
||||||
share_buff.key_cache= multi_key_cache_search(name_buff, strlen(name_buff));
|
share_buff.key_cache= multi_key_cache_search(name_buff,
|
||||||
|
(uint) strlen(name_buff));
|
||||||
|
|
||||||
DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_open",
|
DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_open",
|
||||||
if (strstr(name, "/t1"))
|
if (strstr(name, "/t1"))
|
||||||
@ -314,7 +315,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
|
|||||||
(char*) key_del, (sizeof(my_off_t) *
|
(char*) key_del, (sizeof(my_off_t) *
|
||||||
share->state.header.max_block_size));
|
share->state.header.max_block_size));
|
||||||
strmov(share->unique_file_name, name_buff);
|
strmov(share->unique_file_name, name_buff);
|
||||||
share->unique_name_length= strlen(name_buff);
|
share->unique_name_length= (uint) strlen(name_buff);
|
||||||
strmov(share->index_file_name, index_name);
|
strmov(share->index_file_name, index_name);
|
||||||
strmov(share->data_file_name, data_name);
|
strmov(share->data_file_name, data_name);
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
|
|||||||
MYF(MY_HOLD_ON_ERROR));
|
MYF(MY_HOLD_ON_ERROR));
|
||||||
/* Fix the table addresses in the tree heads. */
|
/* Fix the table addresses in the tree heads. */
|
||||||
{
|
{
|
||||||
long diff=PTR_BYTE_DIFF(decode_table,share->decode_tables);
|
my_ptrdiff_t diff=PTR_BYTE_DIFF(decode_table,share->decode_tables);
|
||||||
share->decode_tables=decode_table;
|
share->decode_tables=decode_table;
|
||||||
for (i=0 ; i < trees ; i++)
|
for (i=0 ; i < trees ; i++)
|
||||||
share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table,
|
share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table,
|
||||||
|
@ -408,7 +408,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
|
|||||||
}
|
}
|
||||||
from+=keyseg->length;
|
from+=keyseg->length;
|
||||||
page=from+nod_flag;
|
page=from+nod_flag;
|
||||||
length=from-vseg;
|
length= (uint) (from - vseg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page > end)
|
if (page > end)
|
||||||
|
@ -95,7 +95,7 @@ static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag,
|
|||||||
_mi_kpos(nod_flag, k), level + 1)))
|
_mi_kpos(nod_flag, k), level + 1)))
|
||||||
{
|
{
|
||||||
case 0: /* found - exit from recursion */
|
case 0: /* found - exit from recursion */
|
||||||
*saved_key = k - page_buf;
|
*saved_key = (uint) (k - page_buf);
|
||||||
goto ok;
|
goto ok;
|
||||||
case 1: /* not found - continue searching */
|
case 1: /* not found - continue searching */
|
||||||
info->rtree_recursion_depth = level;
|
info->rtree_recursion_depth = level;
|
||||||
@ -117,7 +117,7 @@ static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag,
|
|||||||
info->lastkey_length = k_len + info->s->base.rec_reflength;
|
info->lastkey_length = k_len + info->s->base.rec_reflength;
|
||||||
memcpy(info->lastkey, k, info->lastkey_length);
|
memcpy(info->lastkey, k, info->lastkey_length);
|
||||||
info->rtree_recursion_depth = level;
|
info->rtree_recursion_depth = level;
|
||||||
*saved_key = last - page_buf;
|
*saved_key = (uint) (last - page_buf);
|
||||||
|
|
||||||
if (after_key < last)
|
if (after_key < last)
|
||||||
{
|
{
|
||||||
@ -314,7 +314,7 @@ static int rtree_get_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint key_length,
|
|||||||
_mi_kpos(nod_flag, k), level + 1)))
|
_mi_kpos(nod_flag, k), level + 1)))
|
||||||
{
|
{
|
||||||
case 0: /* found - exit from recursion */
|
case 0: /* found - exit from recursion */
|
||||||
*saved_key = k - page_buf;
|
*saved_key = (uint) (k - page_buf);
|
||||||
goto ok;
|
goto ok;
|
||||||
case 1: /* not found - continue searching */
|
case 1: /* not found - continue searching */
|
||||||
info->rtree_recursion_depth = level;
|
info->rtree_recursion_depth = level;
|
||||||
@ -333,7 +333,7 @@ static int rtree_get_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint key_length,
|
|||||||
memcpy(info->lastkey, k, info->lastkey_length);
|
memcpy(info->lastkey, k, info->lastkey_length);
|
||||||
|
|
||||||
info->rtree_recursion_depth = level;
|
info->rtree_recursion_depth = level;
|
||||||
*saved_key = k - page_buf;
|
*saved_key = (uint) (k - page_buf);
|
||||||
|
|
||||||
if (after_key < last)
|
if (after_key < last)
|
||||||
{
|
{
|
||||||
@ -420,7 +420,7 @@ int rtree_get_next(MI_INFO *info, uint keynr, uint key_length)
|
|||||||
info->lastkey_length = k_len + info->s->base.rec_reflength;
|
info->lastkey_length = k_len + info->s->base.rec_reflength;
|
||||||
memcpy(info->lastkey, key, k_len + info->s->base.rec_reflength);
|
memcpy(info->lastkey, key, k_len + info->s->base.rec_reflength);
|
||||||
|
|
||||||
*(int*)info->int_keypos = key - info->buff;
|
*(uint*)info->int_keypos = (uint) (key - info->buff);
|
||||||
if (after_key >= info->int_maxpos)
|
if (after_key >= info->int_maxpos)
|
||||||
{
|
{
|
||||||
info->buff_used = 1;
|
info->buff_used = 1;
|
||||||
|
6
mysql-test/include/master-slave-end.inc
Normal file
6
mysql-test/include/master-slave-end.inc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
--connection master
|
||||||
|
--sync_slave_with_master
|
||||||
|
--connection slave
|
||||||
|
--disable_query_log
|
||||||
|
STOP SLAVE;
|
||||||
|
--enable_query_log
|
@ -2,23 +2,50 @@
|
|||||||
# By JBM 2006-02-16 So that the code is not repeated #
|
# By JBM 2006-02-16 So that the code is not repeated #
|
||||||
# in test cases and can be reused. #
|
# in test cases and can be reused. #
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
|
--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
|
||||||
|
|
||||||
# there is no neat way to find the backupid, this is a hack to find it...
|
# To find the backupid, we must dump this data to a table, and SELECT
|
||||||
|
# what we want into an outfile. This could be accomplished with grep, but
|
||||||
|
# grep isn't Windows-portable
|
||||||
|
|
||||||
--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
|
--disable_query_log
|
||||||
|
# create a table to help us out
|
||||||
|
--disable_warnings # leave this on until done with the entire process
|
||||||
|
# cleanup
|
||||||
|
DROP TABLE IF EXISTS helper1;
|
||||||
|
CREATE TABLE helper1(c1 VARCHAR(20));
|
||||||
|
# dump raw data to file
|
||||||
|
let $ndb_backup_file1= $MYSQLTEST_VARDIR/ndb_backup_tmp.dat;
|
||||||
|
let $ndb_backup_file2= $MYSQLTEST_VARDIR/tmp.dat;
|
||||||
|
--error 0,1
|
||||||
|
--remove_file $ndb_backup_file1
|
||||||
|
--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 > $ndb_backup_file1
|
||||||
|
# load the table from the raw data file
|
||||||
|
eval LOAD DATA INFILE '$ndb_backup_file1' INTO TABLE helper1;
|
||||||
|
--remove_file $ndb_backup_file1
|
||||||
|
# output what we need
|
||||||
|
eval SELECT * FROM helper1 WHERE c1 LIKE '%520093696%'
|
||||||
|
INTO OUTFILE '$ndb_backup_file2';
|
||||||
|
# cleanup
|
||||||
|
DROP TABLE helper1;
|
||||||
|
--enable_warnings
|
||||||
|
--enable_query_log
|
||||||
|
|
||||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||||
|
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||||
|
|
||||||
DELETE FROM test.backup_info;
|
DELETE FROM test.backup_info;
|
||||||
|
|
||||||
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
|
||||||
|
eval LOAD DATA INFILE '$ndb_backup_file2'
|
||||||
|
INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||||
|
--remove_file $ndb_backup_file2
|
||||||
|
|
||||||
--replace_column 1 <the_backup_id>
|
--replace_column 1 <the_backup_id>
|
||||||
|
|
||||||
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
||||||
|
let $the_backup_id=`SELECT @the_backup_id`;
|
||||||
let the_backup_id=`select @the_backup_id`;
|
|
||||||
|
|
||||||
DROP TABLE test.backup_info;
|
DROP TABLE test.backup_info;
|
||||||
|
|
||||||
|
21
mysql-test/include/start_slave.inc
Normal file
21
mysql-test/include/start_slave.inc
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# ==== Purpose ====
|
||||||
|
#
|
||||||
|
# Issues START SLAVE on the current connection. Then waits until both
|
||||||
|
# the IO and SQL threads have started, or until a timeout is reached.
|
||||||
|
#
|
||||||
|
# Please use this instead of 'START SLAVE', to reduce the risk of test
|
||||||
|
# case bugs.
|
||||||
|
#
|
||||||
|
# ==== Usage ====
|
||||||
|
#
|
||||||
|
# source include/wait_for_slave_to_start.inc;
|
||||||
|
#
|
||||||
|
# Parameters to this macro are $slave_timeout and
|
||||||
|
# $master_connection. See wait_for_slave_param.inc for
|
||||||
|
# descriptions.
|
||||||
|
|
||||||
|
--disable_query_log
|
||||||
|
START SLAVE;
|
||||||
|
--enable_query_log
|
||||||
|
--echo include/start_slave.inc
|
||||||
|
source include/wait_for_slave_to_start.inc;
|
21
mysql-test/include/stop_slave.inc
Normal file
21
mysql-test/include/stop_slave.inc
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# ==== Purpose ====
|
||||||
|
#
|
||||||
|
# Issues STOP SLAVE on the current connection. Then waits until both
|
||||||
|
# the IO and SQL threads have stopped, or until a timeout is reached.
|
||||||
|
#
|
||||||
|
# Please use this instead of 'STOP SLAVE', to reduce the risk of test
|
||||||
|
# case bugs.
|
||||||
|
#
|
||||||
|
# ==== Usage ====
|
||||||
|
#
|
||||||
|
# source include/wait_for_slave_to_start.inc;
|
||||||
|
#
|
||||||
|
# Parameters to this macro are $slave_timeout and
|
||||||
|
# $master_connection. See wait_for_slave_param.inc for
|
||||||
|
# descriptions.
|
||||||
|
|
||||||
|
--disable_query_log
|
||||||
|
STOP SLAVE;
|
||||||
|
--enable_query_log
|
||||||
|
--echo include/stop_slave.inc
|
||||||
|
source include/wait_for_slave_to_stop.inc;
|
40
mysql-test/include/wait_for_slave_sql_error.inc
Normal file
40
mysql-test/include/wait_for_slave_sql_error.inc
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# ==== Purpose ====
|
||||||
|
#
|
||||||
|
# Waits until the SQL thread of the current connection has got an
|
||||||
|
# error, or until a timeout is reached. Also waits until the SQL
|
||||||
|
# thread has completely stopped.
|
||||||
|
#
|
||||||
|
# ==== Usage ====
|
||||||
|
#
|
||||||
|
# source include/wait_for_slave_sql_error.inc;
|
||||||
|
#
|
||||||
|
# Parameters:
|
||||||
|
#
|
||||||
|
# $slave_sql_errno
|
||||||
|
# The expected SQL error number. This is required.
|
||||||
|
# (After BUG#41956 has been fixed, this will be required to be a
|
||||||
|
# symbolic name instead of a number.)
|
||||||
|
#
|
||||||
|
# $slave_timeout
|
||||||
|
# See wait_for_slave_param.inc for description.
|
||||||
|
#
|
||||||
|
# $master_connection
|
||||||
|
# See wait_for_slave_param.inc for description.
|
||||||
|
|
||||||
|
if (`SELECT '$slave_sql_errno' = ''`) {
|
||||||
|
--echo !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_fro_slave_sql_error.inc
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
let $slave_param= Slave_SQL_Running;
|
||||||
|
let $slave_param_value= No;
|
||||||
|
let $slave_error_message= Failed while waiting for slave to stop the SQL thread (expecting error in the SQL thread);
|
||||||
|
source include/wait_for_slave_param.inc;
|
||||||
|
|
||||||
|
# NOTE: on mysql-5.0, there is no way to distinguish slave SQL error from IO error
|
||||||
|
let $_error= query_get_value(SHOW SLAVE STATUS, Last_Errno, 1);
|
||||||
|
if (`SELECT '$_error' != '$slave_sql_errno'`) {
|
||||||
|
--echo Slave stopped with wrong error code: $_error (expected $slave_sql_errno)
|
||||||
|
source include/show_rpl_debug_info.inc;
|
||||||
|
exit;
|
||||||
|
}
|
39
mysql-test/include/wait_for_slave_sql_error_and_skip.inc
Normal file
39
mysql-test/include/wait_for_slave_sql_error_and_skip.inc
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# ==== Purpose ====
|
||||||
|
#
|
||||||
|
# Wait for slave SQL error, skip the erroneous statement and restart
|
||||||
|
# slave
|
||||||
|
#
|
||||||
|
# ==== Usage ====
|
||||||
|
#
|
||||||
|
# let $slave_sql_error= <ERRNO>;
|
||||||
|
# source include/wait_for_slave_sql_error_and_skip.inc;
|
||||||
|
#
|
||||||
|
# Parameters:
|
||||||
|
#
|
||||||
|
# $slave_sql_errno
|
||||||
|
# The error number to wait for. This is required. (See
|
||||||
|
# wait_for_slave_sql_error.inc)
|
||||||
|
#
|
||||||
|
# $show_sql_error
|
||||||
|
# If set, will print the error to the query log.
|
||||||
|
#
|
||||||
|
# $slave_timeout
|
||||||
|
# See wait_for_slave_param.inc for description.
|
||||||
|
#
|
||||||
|
# $master_connection
|
||||||
|
# See wait_for_slave_param.inc for description.
|
||||||
|
|
||||||
|
echo --source include/wait_for_slave_sql_error_and_skip.inc;
|
||||||
|
connection slave;
|
||||||
|
source include/wait_for_slave_sql_error.inc;
|
||||||
|
if ($show_sql_error)
|
||||||
|
{
|
||||||
|
# NOTE: on mysql-5.0, there is no way to distinguish slave SQL error from IO error
|
||||||
|
let $error= query_get_value("SHOW SLAVE STATUS", Last_Error, 1);
|
||||||
|
echo Last_SQL_Error = $error;
|
||||||
|
}
|
||||||
|
|
||||||
|
# skip the erroneous statement
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
source include/start_slave.inc;
|
||||||
|
connection master;
|
78
mysql-test/include/wait_show_condition.inc
Normal file
78
mysql-test/include/wait_show_condition.inc
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
# include/wait_show_condition.inc
|
||||||
|
#
|
||||||
|
# SUMMARY
|
||||||
|
#
|
||||||
|
# Waits until the show statement ($show_statement) has at least within one of
|
||||||
|
# the rows of the result set for the field ($field) a value which fulfils
|
||||||
|
# a condition ($condition), or the operation times out.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# USAGE
|
||||||
|
#
|
||||||
|
# let $show_statement= SHOW PROCESSLIST;
|
||||||
|
# let $field= State;
|
||||||
|
# let $condition= = 'Updating';
|
||||||
|
# --source include/wait_show_condition.inc
|
||||||
|
#
|
||||||
|
# OR
|
||||||
|
#
|
||||||
|
# let $wait_timeout= 60; # Override default of 30 seconds with 60.
|
||||||
|
# let $show_statement= SHOW PROCESSLIST;
|
||||||
|
# let $field= State;
|
||||||
|
# let $condition= = 'Updating';
|
||||||
|
# --source include/wait_show_condition.inc
|
||||||
|
#
|
||||||
|
# Please do not use this use routine if you can replace the SHOW statement
|
||||||
|
# with a select. In such a case include/wait_condition.inc is recommended.
|
||||||
|
#
|
||||||
|
# Created: 2009-02-18 mleich
|
||||||
|
#
|
||||||
|
|
||||||
|
let $max_run_time= 30;
|
||||||
|
if ($wait_timeout)
|
||||||
|
{
|
||||||
|
let $max_run_time= $wait_timeout;
|
||||||
|
}
|
||||||
|
# Reset $wait_timeout so that its value won't be used on subsequent
|
||||||
|
# calls, and default will be used instead.
|
||||||
|
let $wait_timeout= 0;
|
||||||
|
|
||||||
|
# The smallest timespan till UNIX_TIMESTAMP() gets incremented is ~0 seconds.
|
||||||
|
# We add one second to avoid the case that somebody measures timespans on a
|
||||||
|
# real clock with fractions of seconds, detects that n seconds are sufficient,
|
||||||
|
# assigns n to this routine and suffers because he sometimes gets n - 1
|
||||||
|
# seconds in reality.
|
||||||
|
inc $max_run_time;
|
||||||
|
|
||||||
|
let $found= 0;
|
||||||
|
let $max_end_time= `SELECT UNIX_TIMESTAMP() + $max_run_time`;
|
||||||
|
while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
|
||||||
|
{
|
||||||
|
# Sleep a bit to avoid too heavy load.
|
||||||
|
real_sleep 0.2;
|
||||||
|
let $rowno= 1;
|
||||||
|
let $process_result= 1;
|
||||||
|
while (`SELECT $process_result = 1 AND $found = 0`)
|
||||||
|
{
|
||||||
|
let $field_value= query_get_value($show_statement, $field, $rowno);
|
||||||
|
if (`SELECT '$field_value' $condition`)
|
||||||
|
{
|
||||||
|
let $found= 1;
|
||||||
|
}
|
||||||
|
if (`SELECT '$field_value' = 'No such row'`)
|
||||||
|
{
|
||||||
|
# We are behind the last row of the result set.
|
||||||
|
let $process_result= 0;
|
||||||
|
}
|
||||||
|
inc $rowno;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$found)
|
||||||
|
{
|
||||||
|
echo # Timeout in include/wait_show_condition.inc for $wait_condition;
|
||||||
|
echo # show_statement : $show_statement;
|
||||||
|
echo # field : $field;
|
||||||
|
echo # condition : $condition;
|
||||||
|
echo # max_run_time : $max_run_time;
|
||||||
|
}
|
||||||
|
|
@ -2,14 +2,23 @@
|
|||||||
#
|
#
|
||||||
# SUMMARY
|
# SUMMARY
|
||||||
#
|
#
|
||||||
# Waits until the passed number ($count_sessions) of concurrent sessions was
|
# Waits until the passed number ($count_sessions) of concurrent sessions or
|
||||||
# observed via
|
# a smaller number was observed via
|
||||||
# SHOW STATUS LIKE 'Threads_connected'
|
# SHOW STATUS LIKE 'Threads_connected'
|
||||||
# or the operation times out.
|
# or the operation times out.
|
||||||
# Note: Starting with 5.1 we could also use
|
# Note:
|
||||||
# SELECT COUNT(*) FROM information_schema.processlist
|
# 1. We wait for $current_sessions <= $count_sessions because in the use case
|
||||||
# I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
|
# with count_sessions.inc before and wait_until_count_sessions.inc after
|
||||||
# runs in all versions 5.0+
|
# the core of the test it could happen that the disconnects of sessions
|
||||||
|
# belonging to the preceeding test are not finished.
|
||||||
|
# sessions at test begin($count_sessions) = m + n
|
||||||
|
# sessions of the previous test which will be soon disconnected = n (n >= 0)
|
||||||
|
# sessions at test end ($current sessions, assuming the test disconnects
|
||||||
|
# all additional sessions) = m
|
||||||
|
# 2. Starting with 5.1 we could also use
|
||||||
|
# SELECT COUNT(*) FROM information_schema.processlist
|
||||||
|
# I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
|
||||||
|
# runs in all versions 5.0+
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# USAGE
|
# USAGE
|
||||||
@ -19,7 +28,7 @@
|
|||||||
#
|
#
|
||||||
# OR typical example of a test which uses more than one session
|
# OR typical example of a test which uses more than one session
|
||||||
# Such a test could harm successing tests if there is no server shutdown
|
# Such a test could harm successing tests if there is no server shutdown
|
||||||
# and start between.cw
|
# and start between.
|
||||||
#
|
#
|
||||||
# If the testing box is slow than the disconnect of sessions belonging to
|
# If the testing box is slow than the disconnect of sessions belonging to
|
||||||
# the current test might happen when the successing test gets executed.
|
# the current test might happen when the successing test gets executed.
|
||||||
@ -79,10 +88,14 @@
|
|||||||
# backup.test, grant3.test
|
# backup.test, grant3.test
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Created: 2009-01-14 mleich
|
# Created:
|
||||||
|
# 2009-01-14 mleich
|
||||||
|
# Modified:
|
||||||
|
# 2009-02-24 mleich Fix Bug#43114 wait_until_count_sessions too restrictive,
|
||||||
|
# random PB failures
|
||||||
#
|
#
|
||||||
|
|
||||||
let $wait_counter= 50;
|
let $wait_counter= 100;
|
||||||
if ($wait_timeout)
|
if ($wait_timeout)
|
||||||
{
|
{
|
||||||
let $wait_counter= `SELECT $wait_timeout * 10`;
|
let $wait_counter= `SELECT $wait_timeout * 10`;
|
||||||
@ -93,7 +106,7 @@ let $wait_timeout= 0;
|
|||||||
while ($wait_counter)
|
while ($wait_counter)
|
||||||
{
|
{
|
||||||
let $current_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
|
let $current_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
|
||||||
let $success= `SELECT $current_sessions = $count_sessions`;
|
let $success= `SELECT $current_sessions <= $count_sessions`;
|
||||||
if ($success)
|
if ($success)
|
||||||
{
|
{
|
||||||
let $wait_counter= 0;
|
let $wait_counter= 0;
|
||||||
@ -107,6 +120,7 @@ while ($wait_counter)
|
|||||||
if (!$success)
|
if (!$success)
|
||||||
{
|
{
|
||||||
--echo # Timeout in wait_until_count_sessions.inc
|
--echo # Timeout in wait_until_count_sessions.inc
|
||||||
--echo # Number of sessions expected: $count_sessions found: $current_sessions
|
--echo # Number of sessions expected: <= $count_sessions found: $current_sessions
|
||||||
|
SHOW PROCESSLIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
|
|||||||
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
|
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
108 POINT(15 15)
|
108 POINT(15 15)
|
||||||
109 POINT(25.416666666667 25.416666666667)
|
109 POINT(25.4166666666667 25.4166666666667)
|
||||||
110 POINT(20 10)
|
110 POINT(20 10)
|
||||||
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
|
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
@ -325,8 +325,8 @@ fid IsClosed(g)
|
|||||||
116 0
|
116 0
|
||||||
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
|
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
117 POINT(55.588527753042 17.426536064114)
|
117 POINT(55.5885277530424 17.426536064114)
|
||||||
118 POINT(55.588527753042 17.426536064114)
|
118 POINT(55.5885277530424 17.426536064114)
|
||||||
119 POINT(2 2)
|
119 POINT(2 2)
|
||||||
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
|
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
set SQL_LOG_BIN=0;
|
set SQL_LOG_BIN=0;
|
||||||
drop table if exists t1, t2, t3;
|
drop table if exists t1, t2, t3, t4;
|
||||||
create table t4(n int);
|
create table t4(n int);
|
||||||
backup table t4 to '../bogus';
|
backup table t4 to '../bogus';
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
|
@ -291,7 +291,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
|
|||||||
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
|
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
108 POINT(15 15)
|
108 POINT(15 15)
|
||||||
109 POINT(25.416666666667 25.416666666667)
|
109 POINT(25.4166666666667 25.4166666666667)
|
||||||
110 POINT(20 10)
|
110 POINT(20 10)
|
||||||
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
|
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
@ -325,8 +325,8 @@ fid IsClosed(g)
|
|||||||
116 0
|
116 0
|
||||||
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
|
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
117 POINT(55.588527753042 17.426536064114)
|
117 POINT(55.5885277530424 17.426536064114)
|
||||||
118 POINT(55.588527753042 17.426536064114)
|
118 POINT(55.5885277530424 17.426536064114)
|
||||||
119 POINT(2 2)
|
119 POINT(2 2)
|
||||||
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
|
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1,t2;
|
||||||
|
drop view if exists v1;
|
||||||
create table t1(n int not null, key(n), key(n), key(n), key(n));
|
create table t1(n int not null, key(n), key(n), key(n), key(n));
|
||||||
check table t1 extended;
|
check table t1 extended;
|
||||||
insert into t1 values (200000);
|
insert into t1 values (200000);
|
||||||
|
@ -1,15 +1,23 @@
|
|||||||
drop table if exists t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
create table t1 (a int) engine=innodb;
|
# Establish connection con1 (user=root)
|
||||||
start transaction with consistent snapshot;
|
# Establish connection con2 (user=root)
|
||||||
insert into t1 values(1);
|
# Switch to connection con1
|
||||||
select * from t1;
|
CREATE TABLE t1 (a INT) ENGINE=innodb;
|
||||||
|
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||||
|
# Switch to connection con2
|
||||||
|
INSERT INTO t1 VALUES(1);
|
||||||
|
# Switch to connection con1
|
||||||
|
SELECT * FROM t1;
|
||||||
a
|
a
|
||||||
commit;
|
COMMIT;
|
||||||
delete from t1;
|
DELETE FROM t1;
|
||||||
start transaction;
|
START TRANSACTION;
|
||||||
insert into t1 values(1);
|
# Switch to connection con2
|
||||||
select * from t1;
|
INSERT INTO t1 VALUES(1);
|
||||||
|
# Switch to connection con1
|
||||||
|
SELECT * FROM t1;
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
commit;
|
COMMIT;
|
||||||
drop table t1;
|
# Switch to connection default + close connections con1 and con2
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -611,3 +611,22 @@ check table t1 extended;
|
|||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 check status OK
|
test.t1 check status OK
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci);
|
||||||
|
least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci)
|
||||||
|
a
|
||||||
|
create table t1
|
||||||
|
select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci) as f1;
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`f1` varchar(1) character set latin5 NOT NULL default ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
|
select case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate
|
||||||
|
latin5_turkish_ci then 2 else 3 end;
|
||||||
|
case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate
|
||||||
|
latin5_turkish_ci then 2 else 3 end
|
||||||
|
3
|
||||||
|
select concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci);
|
||||||
|
concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci)
|
||||||
|
abc
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
drop table if exists t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
create table t1 (n int);
|
CREATE TABLE t1 (n INT);
|
||||||
insert into t1 values (1),(2),(3);
|
INSERT INTO t1 VALUES (1),(2),(3);
|
||||||
select * from t1;
|
SELECT * FROM t1;
|
||||||
n
|
n
|
||||||
1
|
1
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
drop table t1;
|
DROP TABLE t1;
|
||||||
|
@ -155,3 +155,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
Warnings:
|
Warnings:
|
||||||
Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1`
|
Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1`
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||||
|
EXPLAIN EXTENDED SELECT COUNT(a) FROM t1 USE KEY(a);
|
||||||
|
ERROR HY000: Key 'a' doesn't exist in table 't1'
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -2094,6 +2094,26 @@ SELECT t1.a FROM t1, t1 as t2 WHERE t2.b NOT LIKE t1.b;
|
|||||||
a
|
a
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# BUG#21360 - mysqldump error on federated tables
|
||||||
|
#
|
||||||
|
#Switch to Connection Slave
|
||||||
|
CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id));
|
||||||
|
INSERT INTO t1 VALUES ('text1'),('text2'),('text3'),('text4');
|
||||||
|
#Switch to Connection Master
|
||||||
|
CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id)) ENGINE=FEDERATED
|
||||||
|
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
||||||
|
# Dump table t1 using mysqldump tool
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
|
CREATE TABLE `t1` (
|
||||||
|
`id` varchar(20) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
DROP TABLE t1;
|
||||||
|
#Switch to Connection Slave
|
||||||
|
DROP TABLE t1;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
|
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
|
||||||
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
|
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
|
||||||
|
@ -1,39 +1,57 @@
|
|||||||
drop table if exists t1;
|
# Establish connection con1 (user=root)
|
||||||
create table t1 (a int) engine=innodb;
|
# Establish connection con2 (user=root)
|
||||||
begin;
|
# Establish connection con3 (user=root)
|
||||||
insert into t1 values(1);
|
# Switch to connection con1
|
||||||
flush tables with read lock;
|
DROP TABLE IF EXISTS t1;
|
||||||
select * from t1;
|
CREATE TABLE t1 (a INT) ENGINE=innodb;
|
||||||
|
BEGIN;
|
||||||
|
INSERT INTO t1 VALUES(1);
|
||||||
|
# Switch to connection con2
|
||||||
|
FLUSH TABLES WITH READ LOCK;
|
||||||
|
SELECT * FROM t1;
|
||||||
a
|
a
|
||||||
commit;
|
# Switch to connection con1
|
||||||
select * from t1;
|
COMMIT;
|
||||||
|
# Switch to connection con2
|
||||||
|
SELECT * FROM t1;
|
||||||
a
|
a
|
||||||
unlock tables;
|
UNLOCK TABLES;
|
||||||
begin;
|
# Switch to connection con1
|
||||||
select * from t1 for update;
|
# Switch to connection con1
|
||||||
|
BEGIN;
|
||||||
|
SELECT * FROM t1 FOR UPDATE;
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
begin;
|
# Switch to connection con2
|
||||||
select * from t1 for update;
|
BEGIN;
|
||||||
flush tables with read lock;
|
SELECT * FROM t1 FOR UPDATE;
|
||||||
commit;
|
# Switch to connection con3
|
||||||
|
FLUSH TABLES WITH READ LOCK;
|
||||||
|
# Switch to connection con1
|
||||||
|
COMMIT;
|
||||||
|
# Switch to connection con2
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
unlock tables;
|
# Switch to connection con3
|
||||||
commit;
|
UNLOCK TABLES;
|
||||||
begin;
|
# Switch to connection con2
|
||||||
insert into t1 values(10);
|
COMMIT;
|
||||||
flush tables with read lock;
|
# Switch to connection con1
|
||||||
commit;
|
BEGIN;
|
||||||
unlock tables;
|
INSERT INTO t1 VALUES(10);
|
||||||
flush tables with read lock;
|
FLUSH TABLES WITH READ LOCK;
|
||||||
unlock tables;
|
COMMIT;
|
||||||
begin;
|
UNLOCK TABLES;
|
||||||
select * from t1;
|
# Switch to connection con2
|
||||||
|
FLUSH TABLES WITH READ LOCK;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
BEGIN;
|
||||||
|
SELECT * FROM t1;
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
10
|
10
|
||||||
show create database test;
|
SHOW CREATE DATABASE test;
|
||||||
Database Create Database
|
Database Create Database
|
||||||
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
|
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||||
drop table t1;
|
DROP TABLE t1;
|
||||||
|
# Switch to connection default and close connections con1, con2, con3
|
||||||
|
@ -1,15 +1,23 @@
|
|||||||
create table t1 (a int) engine=innodb;
|
# Establish connection con1 (user=root)
|
||||||
reset master;
|
# Establish connection con2 (user=root)
|
||||||
set autocommit=0;
|
# Switch to connection con1
|
||||||
insert t1 values (1);
|
CREATE TABLE t1 (a INT) ENGINE=innodb;
|
||||||
flush tables with read lock;
|
RESET MASTER;
|
||||||
show master status;
|
SET AUTOCOMMIT=0;
|
||||||
|
INSERT t1 VALUES (1);
|
||||||
|
# Switch to connection con2
|
||||||
|
FLUSH TABLES WITH READ LOCK;
|
||||||
|
SHOW MASTER STATUS;
|
||||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||||
master-bin.000001 98
|
master-bin.000001 98
|
||||||
commit;
|
# Switch to connection con1
|
||||||
show master status;
|
COMMIT;
|
||||||
|
# Switch to connection con2
|
||||||
|
SHOW MASTER STATUS;
|
||||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||||
master-bin.000001 98
|
master-bin.000001 98
|
||||||
unlock tables;
|
UNLOCK TABLES;
|
||||||
drop table t1;
|
# Switch to connection con1
|
||||||
set autocommit=1;
|
DROP TABLE t1;
|
||||||
|
SET AUTOCOMMIT=1;
|
||||||
|
# Switch to connection default and close connections con1 and con2
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
drop table if exists t1;
|
SET @old_concurrent_insert= @@global.concurrent_insert;
|
||||||
create table t1 (kill_id int);
|
SET @@global.concurrent_insert= 0;
|
||||||
insert into t1 values(connection_id());
|
DROP TABLE IF EXISTS t1;
|
||||||
flush tables with read lock;
|
CREATE TABLE t1 (kill_id INT);
|
||||||
select ((@id := kill_id) - kill_id) from t1;
|
INSERT INTO t1 VALUES(connection_id());
|
||||||
|
FLUSH TABLES WITH READ LOCK;
|
||||||
|
SELECT ((@id := kill_id) - kill_id) FROM t1;
|
||||||
((@id := kill_id) - kill_id)
|
((@id := kill_id) - kill_id)
|
||||||
0
|
0
|
||||||
kill connection @id;
|
KILL CONNECTION @id;
|
||||||
drop table t1;
|
DROP TABLE t1;
|
||||||
|
SET @@global.concurrent_insert= @old_concurrent_insert;
|
||||||
|
@ -506,3 +506,7 @@ SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1;
|
|||||||
MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE)
|
MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE)
|
||||||
2
|
2
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(a TEXT);
|
||||||
|
SELECT GROUP_CONCAT(a) AS st FROM t1 HAVING MATCH(st) AGAINST('test' IN BOOLEAN MODE);
|
||||||
|
ERROR HY000: Incorrect arguments to AGAINST
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -61,7 +61,7 @@ grp sum
|
|||||||
NULL NULL
|
NULL NULL
|
||||||
1 7
|
1 7
|
||||||
2 20.25
|
2 20.25
|
||||||
3 45.483163247594
|
3 45.4831632475944
|
||||||
create table t2 (grp int, a bigint unsigned, c char(10));
|
create table t2 (grp int, a bigint unsigned, c char(10));
|
||||||
insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp;
|
insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp;
|
||||||
replace into t2 select grp, a, c from t1 limit 2,1;
|
replace into t2 select grp, a, c from t1 limit 2,1;
|
||||||
@ -1195,7 +1195,7 @@ std(s1/s2)
|
|||||||
0.21325764
|
0.21325764
|
||||||
select std(o1/o2) from bug22555;
|
select std(o1/o2) from bug22555;
|
||||||
std(o1/o2)
|
std(o1/o2)
|
||||||
0.21325763586649
|
0.213257635866493
|
||||||
select std(e1/e2) from bug22555;
|
select std(e1/e2) from bug22555;
|
||||||
std(e1/e2)
|
std(e1/e2)
|
||||||
0.21325764
|
0.21325764
|
||||||
@ -1221,7 +1221,7 @@ round(std(s1/s2), 17)
|
|||||||
0.21325763586649341
|
0.21325763586649341
|
||||||
select std(o1/o2) from bug22555;
|
select std(o1/o2) from bug22555;
|
||||||
std(o1/o2)
|
std(o1/o2)
|
||||||
0.21325763586649
|
0.213257635866493
|
||||||
select round(std(e1/e2), 17) from bug22555;
|
select round(std(e1/e2), 17) from bug22555;
|
||||||
round(std(e1/e2), 17)
|
round(std(e1/e2), 17)
|
||||||
0.21325763586649341
|
0.21325763586649341
|
||||||
@ -1246,7 +1246,7 @@ round(std(s1/s2), 17)
|
|||||||
0.21325763586649341
|
0.21325763586649341
|
||||||
select std(o1/o2) from bug22555;
|
select std(o1/o2) from bug22555;
|
||||||
std(o1/o2)
|
std(o1/o2)
|
||||||
0.21325763586649
|
0.213257635866493
|
||||||
select round(std(e1/e2), 17) from bug22555;
|
select round(std(e1/e2), 17) from bug22555;
|
||||||
round(std(e1/e2), 17)
|
round(std(e1/e2), 17)
|
||||||
0.21325763586649341
|
0.21325763586649341
|
||||||
|
@ -60,7 +60,7 @@ Warnings:
|
|||||||
Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
|
Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
|
||||||
select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
|
select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
|
||||||
log2(8) log2(15) log2(-2) log2(0) log2(NULL)
|
log2(8) log2(15) log2(-2) log2(0) log2(NULL)
|
||||||
3 3.9068905956085 NULL NULL NULL
|
3 3.90689059560852 NULL NULL NULL
|
||||||
explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
|
explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
@ -68,7 +68,7 @@ Warnings:
|
|||||||
Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
|
Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
|
||||||
select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
|
select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
|
||||||
log10(100) log10(18) log10(-4) log10(0) log10(NULL)
|
log10(100) log10(18) log10(-4) log10(0) log10(NULL)
|
||||||
2 1.2552725051033 NULL NULL NULL
|
2 1.25527250510331 NULL NULL NULL
|
||||||
explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
|
explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
@ -85,7 +85,7 @@ Note 1003 select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4
|
|||||||
set @@rand_seed1=10000000,@@rand_seed2=1000000;
|
set @@rand_seed1=10000000,@@rand_seed2=1000000;
|
||||||
select rand(999999),rand();
|
select rand(999999),rand();
|
||||||
rand(999999) rand()
|
rand(999999) rand()
|
||||||
0.014231365187309 0.028870999839968
|
0.0142313651873091 0.028870999839968
|
||||||
explain extended select rand(999999),rand();
|
explain extended select rand(999999),rand();
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
@ -101,7 +101,7 @@ Warnings:
|
|||||||
Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`
|
Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`
|
||||||
select degrees(pi()),radians(360);
|
select degrees(pi()),radians(360);
|
||||||
degrees(pi()) radians(360)
|
degrees(pi()) radians(360)
|
||||||
180 6.2831853071796
|
180 6.28318530717959
|
||||||
SELECT ACOS(1.0);
|
SELECT ACOS(1.0);
|
||||||
ACOS(1.0)
|
ACOS(1.0)
|
||||||
0
|
0
|
||||||
@ -321,7 +321,7 @@ mod(5, cast(-2 as unsigned)) mod(5, 18446744073709551614) mod(5, -2)
|
|||||||
5 5 1
|
5 5 1
|
||||||
select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5);
|
select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5);
|
||||||
pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5)
|
pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5)
|
||||||
2.1359870359209e+96 2.1359870359209e+96 -32
|
2.13598703592091e+96 2.13598703592091e+96 -32
|
||||||
CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1));
|
CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1));
|
||||||
INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0);
|
INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0);
|
||||||
SELECT a DIV 900 y FROM t1 GROUP BY y;
|
SELECT a DIV 900 y FROM t1 GROUP BY y;
|
||||||
@ -360,4 +360,34 @@ SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1;
|
|||||||
a DIV 2
|
a DIV 2
|
||||||
0
|
0
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (a DOUBLE);
|
||||||
|
INSERT INTO t1 VALUES (-1.1), (1.1),
|
||||||
|
(-1.5), (1.5),
|
||||||
|
(-1.9), (1.9),
|
||||||
|
(-2.1), (2.1),
|
||||||
|
(-2.5), (2.5),
|
||||||
|
(-2.9), (2.9),
|
||||||
|
# Check numbers with absolute values > 2^53 - 1
|
||||||
|
# (see comments for MAX_EXACT_INTEGER)
|
||||||
|
(-1e16 - 0.5), (1e16 + 0.5),
|
||||||
|
(-1e16 - 1.5), (1e16 + 1.5);
|
||||||
|
SELECT a, ROUND(a) FROM t1;
|
||||||
|
a ROUND(a)
|
||||||
|
-1.1 -1
|
||||||
|
1.1 1
|
||||||
|
-1.5 -2
|
||||||
|
1.5 2
|
||||||
|
-1.9 -2
|
||||||
|
1.9 2
|
||||||
|
-2.1 -2
|
||||||
|
2.1 2
|
||||||
|
-2.5 -2
|
||||||
|
2.5 2
|
||||||
|
-2.9 -3
|
||||||
|
2.9 3
|
||||||
|
-1e+16 -10000000000000000
|
||||||
|
1e+16 10000000000000000
|
||||||
|
-1e+16 -10000000000000002
|
||||||
|
1e+16 10000000000000002
|
||||||
|
DROP TABLE t1;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
|
@ -1131,10 +1131,10 @@ cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2))
|
|||||||
20.06
|
20.06
|
||||||
select conv("18383815659218730760",10,10) + 0;
|
select conv("18383815659218730760",10,10) + 0;
|
||||||
conv("18383815659218730760",10,10) + 0
|
conv("18383815659218730760",10,10) + 0
|
||||||
1.8383815659219e+19
|
1.83838156592187e+19
|
||||||
select "18383815659218730760" + 0;
|
select "18383815659218730760" + 0;
|
||||||
"18383815659218730760" + 0
|
"18383815659218730760" + 0
|
||||||
1.8383815659219e+19
|
1.83838156592187e+19
|
||||||
CREATE TABLE t1 (code varchar(10));
|
CREATE TABLE t1 (code varchar(10));
|
||||||
INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13');
|
INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13');
|
||||||
SELECT ASCII(code), code FROM t1 WHERE code='A12';
|
SELECT ASCII(code), code FROM t1 WHERE code='A12';
|
||||||
@ -2181,4 +2181,10 @@ def format(a, 2) 253 20 4 Y 0 2 8
|
|||||||
format(a, 2)
|
format(a, 2)
|
||||||
1.33
|
1.33
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE t1 (c DATE, aa VARCHAR(30));
|
||||||
|
INSERT INTO t1 VALUES ('2008-12-31','aaaaaa');
|
||||||
|
SELECT DATE_FORMAT(c, GET_FORMAT(DATE, 'eur')) h, CONCAT(UPPER(aa),', ', aa) i FROM t1;
|
||||||
|
h i
|
||||||
|
31.12.2008 AAAAAA, aaaaaa
|
||||||
|
DROP TABLE t1;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
|
@ -284,7 +284,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
|
|||||||
SELECT fid, AsText(Centroid(g)) FROM gis_polygon;
|
SELECT fid, AsText(Centroid(g)) FROM gis_polygon;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
108 POINT(15 15)
|
108 POINT(15 15)
|
||||||
109 POINT(25.416666666667 25.416666666667)
|
109 POINT(25.4166666666667 25.4166666666667)
|
||||||
110 POINT(20 10)
|
110 POINT(20 10)
|
||||||
SELECT fid, Area(g) FROM gis_polygon;
|
SELECT fid, Area(g) FROM gis_polygon;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
@ -318,8 +318,8 @@ fid IsClosed(g)
|
|||||||
116 0
|
116 0
|
||||||
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
|
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
117 POINT(55.588527753042 17.426536064114)
|
117 POINT(55.5885277530424 17.426536064114)
|
||||||
118 POINT(55.588527753042 17.426536064114)
|
118 POINT(55.5885277530424 17.426536064114)
|
||||||
119 POINT(2 2)
|
119 POINT(2 2)
|
||||||
SELECT fid, Area(g) FROM gis_multi_polygon;
|
SELECT fid, Area(g) FROM gis_multi_polygon;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
@ -651,11 +651,11 @@ insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
|
|||||||
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
|
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
|
||||||
t1 where object_id=85998;
|
t1 where object_id=85998;
|
||||||
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
|
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
|
||||||
85998 MULTIPOLYGON 0 POINT(115.31877315203 -36.237472821022)
|
85998 MULTIPOLYGON 0 POINT(115.318773152032 -36.2374728210215)
|
||||||
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
|
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
|
||||||
t1 where object_id=85984;
|
t1 where object_id=85984;
|
||||||
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
|
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
|
||||||
85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469)
|
85984 MULTIPOLYGON 0 POINT(-114.877871869233 36.3310176346905)
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (fl geometry not null);
|
create table t1 (fl geometry not null);
|
||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
|
@ -162,7 +162,7 @@ Warnings:
|
|||||||
Warning 1364 Field 'ssl_cipher' doesn't have a default value
|
Warning 1364 Field 'ssl_cipher' doesn't have a default value
|
||||||
Warning 1364 Field 'x509_issuer' doesn't have a default value
|
Warning 1364 Field 'x509_issuer' doesn't have a default value
|
||||||
Warning 1364 Field 'x509_subject' doesn't have a default value
|
Warning 1364 Field 'x509_subject' doesn't have a default value
|
||||||
insert into mysql.db (host, db, user, select_priv) values
|
insert into mysql.db (host, db, user, select_priv) values
|
||||||
('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
|
('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
|
||||||
alter table mysql.db order by db asc;
|
alter table mysql.db order by db asc;
|
||||||
flush privileges;
|
flush privileges;
|
||||||
@ -262,7 +262,7 @@ drop user mysqltest_1@localhost;
|
|||||||
SET NAMES koi8r;
|
SET NAMES koi8r;
|
||||||
CREATE DATABASE <20><>;
|
CREATE DATABASE <20><>;
|
||||||
USE <20><>;
|
USE <20><>;
|
||||||
CREATE TABLE <20><><EFBFBD> (<28><><EFBFBD> int);
|
CREATE TABLE <20><><EFBFBD> (<28><><EFBFBD> INT);
|
||||||
GRANT SELECT ON <20><>.* TO <20><><EFBFBD><EFBFBD>@localhost;
|
GRANT SELECT ON <20><>.* TO <20><><EFBFBD><EFBFBD>@localhost;
|
||||||
SHOW GRANTS FOR <20><><EFBFBD><EFBFBD>@localhost;
|
SHOW GRANTS FOR <20><><EFBFBD><EFBFBD>@localhost;
|
||||||
Grants for <20><><EFBFBD><EFBFBD>@localhost
|
Grants for <20><><EFBFBD><EFBFBD>@localhost
|
||||||
@ -381,21 +381,21 @@ grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost;
|
|||||||
grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost;
|
grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost;
|
||||||
grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost;
|
grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost;
|
||||||
grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost;
|
grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost;
|
||||||
SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES
|
SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES
|
||||||
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
|
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
|
||||||
ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE;
|
ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE;
|
||||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||||
'mysqltest_3'@'localhost' NULL mysqltest_1 t1 a UPDATE NO
|
'mysqltest_3'@'localhost' NULL mysqltest_1 t1 a UPDATE NO
|
||||||
'mysqltest_3'@'localhost' NULL mysqltest_2 t1 c SELECT NO
|
'mysqltest_3'@'localhost' NULL mysqltest_2 t1 c SELECT NO
|
||||||
'mysqltest_3'@'localhost' NULL mysqltest_1 t2 b SELECT NO
|
'mysqltest_3'@'localhost' NULL mysqltest_1 t2 b SELECT NO
|
||||||
'mysqltest_3'@'localhost' NULL mysqltest_2 t2 d UPDATE NO
|
'mysqltest_3'@'localhost' NULL mysqltest_2 t2 d UPDATE NO
|
||||||
SELECT * FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES
|
SELECT * FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES
|
||||||
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
|
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
|
||||||
ORDER BY TABLE_NAME,PRIVILEGE_TYPE;
|
ORDER BY TABLE_NAME,PRIVILEGE_TYPE;
|
||||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||||
SELECT * from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES
|
SELECT * from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES
|
||||||
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
|
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
|
||||||
ORDER BY TABLE_SCHEMA,PRIVILEGE_TYPE;
|
ORDER BY TABLE_SCHEMA,PRIVILEGE_TYPE;
|
||||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||||
SELECT * from INFORMATION_SCHEMA.USER_PRIVILEGES
|
SELECT * from INFORMATION_SCHEMA.USER_PRIVILEGES
|
||||||
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
|
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
|
||||||
@ -457,7 +457,7 @@ Privilege Context Comment
|
|||||||
Alter Tables To alter the table
|
Alter Tables To alter the table
|
||||||
Alter routine Functions,Procedures To alter or drop stored functions/procedures
|
Alter routine Functions,Procedures To alter or drop stored functions/procedures
|
||||||
Create Databases,Tables,Indexes To create new databases and tables
|
Create Databases,Tables,Indexes To create new databases and tables
|
||||||
Create routine Functions,Procedures To use CREATE FUNCTION/PROCEDURE
|
Create routine Databases To use CREATE FUNCTION/PROCEDURE
|
||||||
Create temporary tables Databases To use CREATE TEMPORARY TABLE
|
Create temporary tables Databases To use CREATE TEMPORARY TABLE
|
||||||
Create view Tables To create new views
|
Create view Tables To create new views
|
||||||
Create user Server Admin To create new users
|
Create user Server Admin To create new users
|
||||||
@ -880,11 +880,11 @@ flush privileges;
|
|||||||
drop table t2;
|
drop table t2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
CREATE DATABASE mysqltest3;
|
CREATE DATABASE mysqltest3;
|
||||||
use mysqltest3;
|
USE mysqltest3;
|
||||||
CREATE TABLE t_nn (c1 INT);
|
CREATE TABLE t_nn (c1 INT);
|
||||||
CREATE VIEW v_nn AS SELECT * FROM t_nn;
|
CREATE VIEW v_nn AS SELECT * FROM t_nn;
|
||||||
CREATE DATABASE mysqltest2;
|
CREATE DATABASE mysqltest2;
|
||||||
use mysqltest2;
|
USE mysqltest2;
|
||||||
CREATE TABLE t_nn (c1 INT);
|
CREATE TABLE t_nn (c1 INT);
|
||||||
CREATE VIEW v_nn AS SELECT * FROM t_nn;
|
CREATE VIEW v_nn AS SELECT * FROM t_nn;
|
||||||
CREATE VIEW v_yn AS SELECT * FROM t_nn;
|
CREATE VIEW v_yn AS SELECT * FROM t_nn;
|
||||||
@ -954,7 +954,7 @@ DROP TABLE mysqltest3.t_nn;
|
|||||||
DROP DATABASE mysqltest3;
|
DROP DATABASE mysqltest3;
|
||||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost';
|
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost';
|
||||||
DROP USER 'mysqltest_1'@'localhost';
|
DROP USER 'mysqltest_1'@'localhost';
|
||||||
use test;
|
USE test;
|
||||||
create user mysqltest1_thisisreallytoolong;
|
create user mysqltest1_thisisreallytoolong;
|
||||||
ERROR HY000: String 'mysqltest1_thisisreallytoolong' is too long for user name (should be no longer than 16)
|
ERROR HY000: String 'mysqltest1_thisisreallytoolong' is too long for user name (should be no longer than 16)
|
||||||
GRANT CREATE ON mysqltest.* TO 1234567890abcdefGHIKL@localhost;
|
GRANT CREATE ON mysqltest.* TO 1234567890abcdefGHIKL@localhost;
|
||||||
@ -1106,16 +1106,16 @@ DROP DATABASE mysqltest1;
|
|||||||
DROP DATABASE mysqltest2;
|
DROP DATABASE mysqltest2;
|
||||||
DROP USER mysqltest_1@localhost;
|
DROP USER mysqltest_1@localhost;
|
||||||
DROP USER mysqltest_2@localhost;
|
DROP USER mysqltest_2@localhost;
|
||||||
use test;
|
USE test;
|
||||||
CREATE TABLE t1 (f1 int, f2 int);
|
CREATE TABLE t1 (f1 int, f2 int);
|
||||||
INSERT INTO t1 VALUES(1,1), (2,2);
|
INSERT INTO t1 VALUES(1,1), (2,2);
|
||||||
CREATE DATABASE db27878;
|
CREATE DATABASE db27878;
|
||||||
GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost';
|
GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost';
|
||||||
GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost';
|
GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost';
|
||||||
GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost';
|
GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost';
|
||||||
use db27878;
|
USE db27878;
|
||||||
CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1;
|
CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1;
|
||||||
use db27878;
|
USE db27878;
|
||||||
UPDATE v1 SET f2 = 4;
|
UPDATE v1 SET f2 = 4;
|
||||||
ERROR HY000: View 'db27878.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
ERROR HY000: View 'db27878.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||||
SELECT * FROM test.t1;
|
SELECT * FROM test.t1;
|
||||||
@ -1127,7 +1127,7 @@ REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost';
|
|||||||
REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost';
|
REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost';
|
||||||
DROP USER mysqltest_1@localhost;
|
DROP USER mysqltest_1@localhost;
|
||||||
DROP DATABASE db27878;
|
DROP DATABASE db27878;
|
||||||
use test;
|
USE test;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
drop table if exists test;
|
drop table if exists test;
|
||||||
Warnings:
|
Warnings:
|
||||||
|
@ -433,7 +433,7 @@ USE db1;
|
|||||||
SELECT c FROM t2;
|
SELECT c FROM t2;
|
||||||
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
|
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
|
||||||
SELECT * FROM t2;
|
SELECT * FROM t2;
|
||||||
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
|
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for table 't2'
|
||||||
SELECT * FROM t1 JOIN t2 USING (b);
|
SELECT * FROM t1 JOIN t2 USING (b);
|
||||||
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
|
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
|
||||||
USE test;
|
USE test;
|
||||||
|
@ -2429,3 +2429,18 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
Warnings:
|
Warnings:
|
||||||
Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,(max(`test`.`t1`.`b`) + 1) AS `max(b)+1` from `test`.`t1` where (`test`.`t1`.`a` = 0) group by `test`.`t1`.`a`
|
Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,(max(`test`.`t1`.`b`) + 1) AS `max(b)+1` from `test`.`t1` where (`test`.`t1`.`a` = 0) group by `test`.`t1`.`a`
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE t1 (a int, b int, c int, d int,
|
||||||
|
KEY foo (c,d,a,b), KEY bar (c,a,b,d));
|
||||||
|
INSERT INTO t1 VALUES (1, 1, 1, 1), (1, 1, 1, 2), (1, 1, 1, 3), (1, 1, 1, 4);
|
||||||
|
INSERT INTO t1 SELECT * FROM t1;
|
||||||
|
INSERT INTO t1 SELECT * FROM t1;
|
||||||
|
INSERT INTO t1 SELECT a,b,c+1,d FROM t1;
|
||||||
|
EXPLAIN SELECT DISTINCT c FROM t1 WHERE d=4;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 range NULL foo 10 NULL 9 Using where; Using index for group-by
|
||||||
|
SELECT DISTINCT c FROM t1 WHERE d=4;
|
||||||
|
c
|
||||||
|
1
|
||||||
|
2
|
||||||
|
DROP TABLE t1;
|
||||||
|
End of 5.0 tests
|
||||||
|
@ -75,7 +75,7 @@ t2
|
|||||||
t3
|
t3
|
||||||
t5
|
t5
|
||||||
v1
|
v1
|
||||||
select c,table_name from v1
|
select c,table_name from v1
|
||||||
inner join information_schema.TABLES v2 on (v1.c=v2.table_name)
|
inner join information_schema.TABLES v2 on (v1.c=v2.table_name)
|
||||||
where v1.c like "t%";
|
where v1.c like "t%";
|
||||||
c table_name
|
c table_name
|
||||||
@ -94,7 +94,7 @@ t4 t4
|
|||||||
t2 t2
|
t2 t2
|
||||||
t3 t3
|
t3 t3
|
||||||
t5 t5
|
t5 t5
|
||||||
select c,table_name from v1
|
select c,table_name from v1
|
||||||
left join information_schema.TABLES v2 on (v1.c=v2.table_name)
|
left join information_schema.TABLES v2 on (v1.c=v2.table_name)
|
||||||
where v1.c like "t%";
|
where v1.c like "t%";
|
||||||
c table_name
|
c table_name
|
||||||
@ -173,7 +173,7 @@ a int(11) YES NULL
|
|||||||
create view mysqltest.v1 (c) as select a from mysqltest.t1;
|
create view mysqltest.v1 (c) as select a from mysqltest.t1;
|
||||||
grant select (a) on mysqltest.t1 to mysqltest_2@localhost;
|
grant select (a) on mysqltest.t1 to mysqltest_2@localhost;
|
||||||
grant select on mysqltest.v1 to mysqltest_3;
|
grant select on mysqltest.v1 to mysqltest_3;
|
||||||
select table_name, column_name, privileges from information_schema.columns
|
select table_name, column_name, privileges from information_schema.columns
|
||||||
where table_schema = 'mysqltest' and table_name = 't1';
|
where table_schema = 'mysqltest' and table_name = 't1';
|
||||||
table_name column_name privileges
|
table_name column_name privileges
|
||||||
t1 a select
|
t1 a select
|
||||||
@ -249,7 +249,7 @@ begin
|
|||||||
select * from t1;
|
select * from t1;
|
||||||
select * from t2;
|
select * from t2;
|
||||||
end|
|
end|
|
||||||
select parameter_style, sql_data_access, dtd_identifier
|
select parameter_style, sql_data_access, dtd_identifier
|
||||||
from information_schema.routines;
|
from information_schema.routines;
|
||||||
parameter_style sql_data_access dtd_identifier
|
parameter_style sql_data_access dtd_identifier
|
||||||
SQL CONTAINS SQL NULL
|
SQL CONTAINS SQL NULL
|
||||||
@ -280,7 +280,7 @@ sub1 sub1
|
|||||||
select count(*) from information_schema.ROUTINES;
|
select count(*) from information_schema.ROUTINES;
|
||||||
count(*)
|
count(*)
|
||||||
2
|
2
|
||||||
create view v1 as select routine_schema, routine_name from information_schema.routines
|
create view v1 as select routine_schema, routine_name from information_schema.routines
|
||||||
order by routine_schema, routine_name;
|
order by routine_schema, routine_name;
|
||||||
select * from v1;
|
select * from v1;
|
||||||
routine_schema routine_name
|
routine_schema routine_name
|
||||||
@ -532,7 +532,7 @@ drop view v1;
|
|||||||
create table t1(a NUMERIC(5,3), b NUMERIC(5,1), c float(5,2),
|
create table t1(a NUMERIC(5,3), b NUMERIC(5,1), c float(5,2),
|
||||||
d NUMERIC(6,4), e float, f DECIMAL(6,3), g int(11), h DOUBLE(10,3),
|
d NUMERIC(6,4), e float, f DECIMAL(6,3), g int(11), h DOUBLE(10,3),
|
||||||
i DOUBLE);
|
i DOUBLE);
|
||||||
select COLUMN_NAME,COLUMN_TYPE, CHARACTER_MAXIMUM_LENGTH,
|
select COLUMN_NAME,COLUMN_TYPE, CHARACTER_MAXIMUM_LENGTH,
|
||||||
CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE
|
CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE
|
||||||
from information_schema.columns where table_name= 't1';
|
from information_schema.columns where table_name= 't1';
|
||||||
COLUMN_NAME COLUMN_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE
|
COLUMN_NAME COLUMN_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE
|
||||||
@ -589,7 +589,7 @@ TABLE_NAME= "vo";
|
|||||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
|
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
|
||||||
drop view vo;
|
drop view vo;
|
||||||
select TABLE_NAME,TABLE_TYPE,ENGINE
|
select TABLE_NAME,TABLE_TYPE,ENGINE
|
||||||
from information_schema.tables
|
from information_schema.tables
|
||||||
where table_schema='information_schema' limit 2;
|
where table_schema='information_schema' limit 2;
|
||||||
TABLE_NAME TABLE_TYPE ENGINE
|
TABLE_NAME TABLE_TYPE ENGINE
|
||||||
CHARACTER_SETS SYSTEM VIEW MEMORY
|
CHARACTER_SETS SYSTEM VIEW MEMORY
|
||||||
@ -700,7 +700,7 @@ where table_schema="information_schema" and table_name="COLUMNS" and
|
|||||||
column_type
|
column_type
|
||||||
varchar(64)
|
varchar(64)
|
||||||
varchar(64)
|
varchar(64)
|
||||||
select TABLE_ROWS from information_schema.tables where
|
select TABLE_ROWS from information_schema.tables where
|
||||||
table_schema="information_schema" and table_name="COLUMNS";
|
table_schema="information_schema" and table_name="COLUMNS";
|
||||||
TABLE_ROWS
|
TABLE_ROWS
|
||||||
NULL
|
NULL
|
||||||
@ -733,7 +733,7 @@ count(*)
|
|||||||
drop view a2, a1;
|
drop view a2, a1;
|
||||||
drop table t_crashme;
|
drop table t_crashme;
|
||||||
select table_schema,table_name, column_name from
|
select table_schema,table_name, column_name from
|
||||||
information_schema.columns
|
information_schema.columns
|
||||||
where data_type = 'longtext';
|
where data_type = 'longtext';
|
||||||
table_schema table_name column_name
|
table_schema table_name column_name
|
||||||
information_schema COLUMNS COLUMN_DEFAULT
|
information_schema COLUMNS COLUMN_DEFAULT
|
||||||
@ -755,7 +755,7 @@ TABLES UPDATE_TIME datetime
|
|||||||
TABLES CHECK_TIME datetime
|
TABLES CHECK_TIME datetime
|
||||||
TRIGGERS CREATED datetime
|
TRIGGERS CREATED datetime
|
||||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES A
|
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES A
|
||||||
WHERE NOT EXISTS
|
WHERE NOT EXISTS
|
||||||
(SELECT * FROM INFORMATION_SCHEMA.COLUMNS B
|
(SELECT * FROM INFORMATION_SCHEMA.COLUMNS B
|
||||||
WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
|
WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
|
||||||
AND A.TABLE_NAME = B.TABLE_NAME);
|
AND A.TABLE_NAME = B.TABLE_NAME);
|
||||||
@ -784,7 +784,7 @@ x_float NULL NULL
|
|||||||
x_double_precision NULL NULL
|
x_double_precision NULL NULL
|
||||||
drop table t1;
|
drop table t1;
|
||||||
grant select on test.* to mysqltest_4@localhost;
|
grant select on test.* to mysqltest_4@localhost;
|
||||||
SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
|
SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
where COLUMN_NAME='TABLE_NAME';
|
where COLUMN_NAME='TABLE_NAME';
|
||||||
TABLE_NAME COLUMN_NAME PRIVILEGES
|
TABLE_NAME COLUMN_NAME PRIVILEGES
|
||||||
COLUMNS TABLE_NAME select
|
COLUMNS TABLE_NAME select
|
||||||
@ -1027,7 +1027,7 @@ BEGIN
|
|||||||
SELECT 'foo' FROM DUAL;
|
SELECT 'foo' FROM DUAL;
|
||||||
END |
|
END |
|
||||||
ERROR 42000: Unknown database 'information_schema'
|
ERROR 42000: Unknown database 'information_schema'
|
||||||
select ROUTINE_NAME from routines;
|
select ROUTINE_NAME from routines;
|
||||||
ROUTINE_NAME
|
ROUTINE_NAME
|
||||||
grant all on information_schema.* to 'user1'@'localhost';
|
grant all on information_schema.* to 'user1'@'localhost';
|
||||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||||
|
@ -188,7 +188,7 @@ Field Type Null Key Default Extra
|
|||||||
f1 char(4) YES NULL
|
f1 char(4) YES NULL
|
||||||
show create view v2;
|
show create view v2;
|
||||||
View Create View
|
View Create View
|
||||||
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1`
|
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1`
|
||||||
show create view testdb_1.v1;
|
show create view testdb_1.v1;
|
||||||
ERROR 42000: SHOW VIEW command denied to user 'testdb_2'@'localhost' for table 'v1'
|
ERROR 42000: SHOW VIEW command denied to user 'testdb_2'@'localhost' for table 'v1'
|
||||||
select table_name from information_schema.columns a
|
select table_name from information_schema.columns a
|
||||||
|
17
mysql-test/r/innodb_bug42419.result
Normal file
17
mysql-test/r/innodb_bug42419.result
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB;
|
||||||
|
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
|
||||||
|
COMMIT;
|
||||||
|
SET AUTOCOMMIT = 0;
|
||||||
|
CREATE TEMPORARY TABLE t1_tmp ( b INT );
|
||||||
|
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3;
|
||||||
|
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2;
|
||||||
|
SET AUTOCOMMIT = 0;
|
||||||
|
CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int );
|
||||||
|
INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53);
|
||||||
|
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1;
|
||||||
|
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2;
|
||||||
|
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1;
|
||||||
|
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||||
|
Reap the server message for connection user2 UPDATE t1 ...
|
||||||
|
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3;
|
||||||
|
DROP TABLE t1;
|
@ -291,7 +291,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
|
|||||||
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
|
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
108 POINT(15 15)
|
108 POINT(15 15)
|
||||||
109 POINT(25.416666666667 25.416666666667)
|
109 POINT(25.4166666666667 25.4166666666667)
|
||||||
110 POINT(20 10)
|
110 POINT(20 10)
|
||||||
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
|
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
@ -325,8 +325,8 @@ fid IsClosed(g)
|
|||||||
116 0
|
116 0
|
||||||
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
|
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
117 POINT(55.588527753042 17.426536064114)
|
117 POINT(55.5885277530424 17.426536064114)
|
||||||
118 POINT(55.588527753042 17.426536064114)
|
118 POINT(55.5885277530424 17.426536064114)
|
||||||
119 POINT(2 2)
|
119 POINT(2 2)
|
||||||
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
|
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
|
@ -51,10 +51,10 @@ ERROR HY000: Can't execute the query because you have a conflicting read lock
|
|||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
DROP DATABASE mysqltest_1;
|
DROP DATABASE mysqltest_1;
|
||||||
ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist
|
ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist
|
||||||
use mysql;
|
USE mysql;
|
||||||
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
|
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
|
||||||
FLUSH TABLES;
|
FLUSH TABLES;
|
||||||
use mysql;
|
USE mysql;
|
||||||
SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
|
SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
|
||||||
OPTIMIZE TABLES columns_priv, db, host, user;
|
OPTIMIZE TABLES columns_priv, db, host, user;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
@ -65,7 +65,7 @@ mysql.user optimize status OK
|
|||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
Select_priv
|
Select_priv
|
||||||
N
|
N
|
||||||
use test;
|
USE test;
|
||||||
use test;
|
use test;
|
||||||
CREATE TABLE t1 (c1 int);
|
CREATE TABLE t1 (c1 int);
|
||||||
LOCK TABLE t1 WRITE;
|
LOCK TABLE t1 WRITE;
|
||||||
@ -93,7 +93,7 @@ create table t1 (a int);
|
|||||||
connection: locker
|
connection: locker
|
||||||
lock tables t1 read;
|
lock tables t1 read;
|
||||||
connection: writer
|
connection: writer
|
||||||
create table t2 like t1;;
|
create table t2 like t1;
|
||||||
connection: default
|
connection: default
|
||||||
kill query
|
kill query
|
||||||
ERROR 70100: Query execution was interrupted
|
ERROR 70100: Query execution was interrupted
|
||||||
|
9
mysql-test/r/lowercase_utf8.result
Normal file
9
mysql-test/r/lowercase_utf8.result
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
set names utf8;
|
||||||
|
create table `А` (id int);
|
||||||
|
show tables from test like 'А';
|
||||||
|
Tables_in_test (А)
|
||||||
|
а
|
||||||
|
show tables from test like 'а';
|
||||||
|
Tables_in_test (а)
|
||||||
|
а
|
||||||
|
drop table `А`;
|
@ -375,7 +375,7 @@ update t2, t1 set t2.field=t1.field
|
|||||||
where t1.id1=t2.id2 and 0=1;
|
where t1.id1=t2.id2 and 0=1;
|
||||||
delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2
|
delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2
|
||||||
where 0=1;
|
where 0=1;
|
||||||
delete t1, t2 from t2,t1
|
delete t1, t2 from t2,t1
|
||||||
where t1.id1=t2.id2 and 0=1;
|
where t1.id1=t2.id2 and 0=1;
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
CREATE TABLE t1 ( a int );
|
CREATE TABLE t1 ( a int );
|
||||||
@ -443,12 +443,12 @@ delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2
|
|||||||
ERROR HY000: You can't specify target table 't1' for update in FROM clause
|
ERROR HY000: You can't specify target table 't1' for update in FROM clause
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
create table t1 (
|
create table t1 (
|
||||||
aclid bigint not null primary key,
|
aclid bigint not null primary key,
|
||||||
status tinyint(1) not null
|
status tinyint(1) not null
|
||||||
) engine = innodb;
|
) engine = innodb;
|
||||||
create table t2 (
|
create table t2 (
|
||||||
refid bigint not null primary key,
|
refid bigint not null primary key,
|
||||||
aclid bigint, index idx_acl(aclid)
|
aclid bigint, index idx_acl(aclid)
|
||||||
) engine = innodb;
|
) engine = innodb;
|
||||||
insert into t2 values(1,null);
|
insert into t2 values(1,null);
|
||||||
delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
|
delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
|
||||||
@ -522,7 +522,7 @@ a b
|
|||||||
4 4
|
4 4
|
||||||
show master status /* there must be the UPDATE query event */;
|
show master status /* there must be the UPDATE query event */;
|
||||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||||
master-bin.000001 189
|
master-bin.000001 198
|
||||||
delete from t1;
|
delete from t1;
|
||||||
delete from t2;
|
delete from t2;
|
||||||
insert into t1 values (1,2),(3,4),(4,4);
|
insert into t1 values (1,2),(3,4),(4,4);
|
||||||
@ -532,7 +532,7 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
|
|||||||
ERROR 23000: Duplicate entry '4' for key 1
|
ERROR 23000: Duplicate entry '4' for key 1
|
||||||
show master status /* there must be the UPDATE query event */;
|
show master status /* there must be the UPDATE query event */;
|
||||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||||
master-bin.000001 204
|
master-bin.000001 213
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
drop table if exists t1, t2, t3;
|
drop table if exists t1, t2, t3;
|
||||||
CREATE TABLE t1 (a int, PRIMARY KEY (a));
|
CREATE TABLE t1 (a int, PRIMARY KEY (a));
|
||||||
|
@ -188,4 +188,17 @@ delimiter
|
|||||||
2
|
2
|
||||||
@z:='1' @z=database()
|
@z:='1' @z=database()
|
||||||
1 NULL
|
1 NULL
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
set @old_max_allowed_packet = @@global.max_allowed_packet;
|
||||||
|
set @@global.max_allowed_packet = 2 * 1024 * 1024 + 1024;
|
||||||
|
CREATE TABLE t1(data LONGBLOB);
|
||||||
|
INSERT INTO t1 SELECT REPEAT('1', 2*1024*1024);
|
||||||
|
SELECT LENGTH(data) FROM t1;
|
||||||
|
LENGTH(data)
|
||||||
|
2097152
|
||||||
|
DROP TABLE t1;
|
||||||
|
set @@global.max_allowed_packet = @old_max_allowed_packet;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
|
@ -349,17 +349,35 @@ DELIMITER ;
|
|||||||
ROLLBACK /* added by mysqlbinlog */;
|
ROLLBACK /* added by mysqlbinlog */;
|
||||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||||
CREATE TABLE t1 (c1 CHAR(10));
|
CREATE TABLE t1 (c1 CHAR(10));
|
||||||
flush logs;
|
FLUSH LOGS;
|
||||||
INSERT INTO t1 VALUES ('0123456789');
|
INSERT INTO t1 VALUES ('0123456789');
|
||||||
flush logs;
|
FLUSH LOGS;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
# Query thread_id=REMOVED exec_time=REMOVED error_code=REMOVED
|
We expect this value to be 1
|
||||||
flush logs;
|
The bug being tested was that 'Query' lines were not preceded by '#'
|
||||||
create table t1(a int);
|
If the line is in the table, it had to have been preceded by a '#'
|
||||||
insert into t1 values(connection_id());
|
|
||||||
flush logs;
|
SELECT COUNT(*) AS `BUG#28293_expect_1` FROM patch WHERE a LIKE '%Query%';
|
||||||
drop table t1;
|
BUG#28293_expect_1
|
||||||
1
|
1
|
||||||
drop table t1;
|
DROP TABLE patch;
|
||||||
|
FLUSH LOGS;
|
||||||
|
CREATE TABLE t1(a INT);
|
||||||
|
INSERT INTO t1 VALUES(connection_id());
|
||||||
|
FLUSH LOGS;
|
||||||
|
DROP TABLE t1;
|
||||||
|
1
|
||||||
|
DROP TABLE t1;
|
||||||
shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql
|
shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql
|
||||||
|
SET @@global.server_id= 4294967295;
|
||||||
|
RESET MASTER;
|
||||||
|
FLUSH LOGS;
|
||||||
|
SELECT
|
||||||
|
(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
|
||||||
|
IS NOT NULL;
|
||||||
|
(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
|
||||||
|
IS NOT NULL
|
||||||
|
1
|
||||||
|
*** Unsigned server_id 4294967295 is found: 1 ***
|
||||||
|
SET @@global.server_id= 1;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
|
@ -93,73 +93,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
|||||||
|
|
||||||
USE `test`;
|
USE `test`;
|
||||||
DROP TABLE IF EXISTS `t1`;
|
DROP TABLE IF EXISTS `t1`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t1` (
|
CREATE TABLE `t1` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||||
INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `t2`;
|
DROP TABLE IF EXISTS `t2`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t2` (
|
CREATE TABLE `t2` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
|
||||||
INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `t3`;
|
DROP TABLE IF EXISTS `t3`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t3` (
|
CREATE TABLE `t3` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
|
||||||
INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `t4`;
|
DROP TABLE IF EXISTS `t4`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t4` (
|
CREATE TABLE `t4` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
|
||||||
INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `t5`;
|
DROP TABLE IF EXISTS `t5`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t5` (
|
CREATE TABLE `t5` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
|
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
|
||||||
INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `t6`;
|
DROP TABLE IF EXISTS `t6`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t6` (
|
CREATE TABLE `t6` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
|
||||||
INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
@ -190,73 +190,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
|||||||
|
|
||||||
USE `test`;
|
USE `test`;
|
||||||
DROP TABLE IF EXISTS `t1`;
|
DROP TABLE IF EXISTS `t1`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t1` (
|
CREATE TABLE `t1` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||||
INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `t2`;
|
DROP TABLE IF EXISTS `t2`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t2` (
|
CREATE TABLE `t2` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
|
||||||
INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `t3`;
|
DROP TABLE IF EXISTS `t3`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t3` (
|
CREATE TABLE `t3` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
|
||||||
INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `t4`;
|
DROP TABLE IF EXISTS `t4`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t4` (
|
CREATE TABLE `t4` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
|
||||||
INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `t5`;
|
DROP TABLE IF EXISTS `t5`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t5` (
|
CREATE TABLE `t5` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
|
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
|
||||||
INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `t6`;
|
DROP TABLE IF EXISTS `t6`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t6` (
|
CREATE TABLE `t6` (
|
||||||
`id` int(8) default NULL,
|
`id` int(8) default NULL,
|
||||||
`name` varchar(32) default NULL
|
`name` varchar(32) default NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
|
||||||
INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -210,7 +210,6 @@ source database
|
|||||||
"MySQL: The world's most popular ;open source database"
|
"MySQL: The world's most popular ;open source database"
|
||||||
echo message echo message
|
echo message echo message
|
||||||
|
|
||||||
mysqltest: At line 1: command "false" failed
|
|
||||||
mysqltest: At line 1: Missing argument in exec
|
mysqltest: At line 1: Missing argument in exec
|
||||||
MySQL
|
MySQL
|
||||||
"MySQL"
|
"MySQL"
|
||||||
@ -378,7 +377,6 @@ mysqltest: At line 1: The argument to dec must be a variable (start with $)
|
|||||||
mysqltest: At line 1: End of line junk detected: "1000"
|
mysqltest: At line 1: End of line junk detected: "1000"
|
||||||
mysqltest: At line 1: Missing arguments to system, nothing to do!
|
mysqltest: At line 1: Missing arguments to system, nothing to do!
|
||||||
mysqltest: At line 1: Missing arguments to system, nothing to do!
|
mysqltest: At line 1: Missing arguments to system, nothing to do!
|
||||||
mysqltest: At line 1: system command 'false' failed
|
|
||||||
system command 'NonExistsinfComamdn 2> /dev/null' failed
|
system command 'NonExistsinfComamdn 2> /dev/null' failed
|
||||||
test
|
test
|
||||||
test2
|
test2
|
||||||
|
@ -291,7 +291,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
|
|||||||
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
|
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
108 POINT(15 15)
|
108 POINT(15 15)
|
||||||
109 POINT(25.416666666667 25.416666666667)
|
109 POINT(25.4166666666667 25.4166666666667)
|
||||||
110 POINT(20 10)
|
110 POINT(20 10)
|
||||||
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
|
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
@ -325,8 +325,8 @@ fid IsClosed(g)
|
|||||||
116 0
|
116 0
|
||||||
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
|
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
117 POINT(55.588527753042 17.426536064114)
|
117 POINT(55.5885277530424 17.426536064114)
|
||||||
118 POINT(55.588527753042 17.426536064114)
|
118 POINT(55.5885277530424 17.426536064114)
|
||||||
119 POINT(2 2)
|
119 POINT(2 2)
|
||||||
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
|
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
@ -835,7 +835,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
|
|||||||
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
|
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
108 POINT(15 15)
|
108 POINT(15 15)
|
||||||
109 POINT(25.416666666667 25.416666666667)
|
109 POINT(25.4166666666667 25.4166666666667)
|
||||||
110 POINT(20 10)
|
110 POINT(20 10)
|
||||||
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
|
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
@ -869,8 +869,8 @@ fid IsClosed(g)
|
|||||||
116 0
|
116 0
|
||||||
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
|
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
|
||||||
fid AsText(Centroid(g))
|
fid AsText(Centroid(g))
|
||||||
117 POINT(55.588527753042 17.426536064114)
|
117 POINT(55.5885277530424 17.426536064114)
|
||||||
118 POINT(55.588527753042 17.426536064114)
|
118 POINT(55.5885277530424 17.426536064114)
|
||||||
119 POINT(2 2)
|
119 POINT(2 2)
|
||||||
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
|
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
|
||||||
fid Area(g)
|
fid Area(g)
|
||||||
|
@ -129,9 +129,11 @@ create table t7 engine=myisam as select * from t7_c;
|
|||||||
create table t8 engine=myisam as select * from t8_c;
|
create table t8 engine=myisam as select * from t8_c;
|
||||||
create table t9 engine=myisam as select * from t9_c;
|
create table t9 engine=myisam as select * from t9_c;
|
||||||
create table t10 engine=myisam as select * from t10_c;
|
create table t10 engine=myisam as select * from t10_c;
|
||||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||||
|
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||||
DELETE FROM test.backup_info;
|
DELETE FROM test.backup_info;
|
||||||
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat'
|
||||||
|
INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||||
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
||||||
@the_backup_id:=backup_id
|
@the_backup_id:=backup_id
|
||||||
<the_backup_id>
|
<the_backup_id>
|
||||||
|
@ -227,9 +227,11 @@ hex(h3) NULL
|
|||||||
hex(i1) NULL
|
hex(i1) NULL
|
||||||
hex(i2) NULL
|
hex(i2) NULL
|
||||||
hex(i3) NULL
|
hex(i3) NULL
|
||||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||||
|
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||||
DELETE FROM test.backup_info;
|
DELETE FROM test.backup_info;
|
||||||
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat'
|
||||||
|
INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||||
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
||||||
@the_backup_id:=backup_id
|
@the_backup_id:=backup_id
|
||||||
<the_backup_id>
|
<the_backup_id>
|
||||||
@ -261,9 +263,11 @@ create table t4 (pk int key, a int) engine ndb;
|
|||||||
insert into t2 values (1,11),(2,12),(3,13),(4,14),(5,15);
|
insert into t2 values (1,11),(2,12),(3,13),(4,14),(5,15);
|
||||||
insert into t3 values (1,21),(2,22),(3,23),(4,24),(5,25);
|
insert into t3 values (1,21),(2,22),(3,23),(4,24),(5,25);
|
||||||
insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
|
insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
|
||||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||||
|
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||||
DELETE FROM test.backup_info;
|
DELETE FROM test.backup_info;
|
||||||
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat'
|
||||||
|
INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||||
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
||||||
@the_backup_id:=backup_id
|
@the_backup_id:=backup_id
|
||||||
<the_backup_id>
|
<the_backup_id>
|
||||||
@ -305,9 +309,11 @@ create table t1
|
|||||||
insert into t1 values(1, 8388607, 16777215);
|
insert into t1 values(1, 8388607, 16777215);
|
||||||
insert into t1 values(2, -8388608, 0);
|
insert into t1 values(2, -8388608, 0);
|
||||||
insert into t1 values(3, -1, 1);
|
insert into t1 values(3, -1, 1);
|
||||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
|
||||||
|
(id INT, backup_id INT) ENGINE = MEMORY;
|
||||||
DELETE FROM test.backup_info;
|
DELETE FROM test.backup_info;
|
||||||
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat'
|
||||||
|
INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||||
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
||||||
@the_backup_id:=backup_id
|
@the_backup_id:=backup_id
|
||||||
<the_backup_id>
|
<the_backup_id>
|
||||||
|
@ -77,12 +77,12 @@ INSERT INTO t1 VALUES (1), (2);
|
|||||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
DROP TABLE IF EXISTS `t1`;
|
DROP TABLE IF EXISTS `t1`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t1` (
|
CREATE TABLE `t1` (
|
||||||
`a` int(11) default NULL
|
`a` int(11) default NULL
|
||||||
);
|
);
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
LOCK TABLES `t1` WRITE;
|
LOCK TABLES `t1` WRITE;
|
||||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||||
@ -111,12 +111,12 @@ UNLOCK TABLES;
|
|||||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
DROP TABLE IF EXISTS `t1`;
|
DROP TABLE IF EXISTS `t1`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t1` (
|
CREATE TABLE `t1` (
|
||||||
`a` int(11) default NULL
|
`a` int(11) default NULL
|
||||||
);
|
);
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
LOCK TABLES `t1` WRITE;
|
LOCK TABLES `t1` WRITE;
|
||||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||||
@ -145,12 +145,12 @@ UNLOCK TABLES;
|
|||||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
DROP TABLE IF EXISTS `t1`;
|
DROP TABLE IF EXISTS `t1`;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
SET character_set_client = utf8;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t1` (
|
CREATE TABLE `t1` (
|
||||||
`a` int(11) default NULL
|
`a` int(11) default NULL
|
||||||
);
|
);
|
||||||
SET character_set_client = @saved_cs_client;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
LOCK TABLES `t1` WRITE;
|
LOCK TABLES `t1` WRITE;
|
||||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
set @max_allowed_packet=@@global.max_allowed_packet;
|
||||||
|
set @net_buffer_length=@@global.net_buffer_length;
|
||||||
set global max_allowed_packet=100;
|
set global max_allowed_packet=100;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
|
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
|
||||||
@ -33,3 +35,5 @@ len
|
|||||||
select length(repeat('a',2000));
|
select length(repeat('a',2000));
|
||||||
length(repeat('a',2000))
|
length(repeat('a',2000))
|
||||||
2000
|
2000
|
||||||
|
set global max_allowed_packet=@max_allowed_packet;
|
||||||
|
set global net_buffer_length=@net_buffer_length;
|
||||||
|
@ -144,7 +144,7 @@ Key_reads 0
|
|||||||
load index into cache t3, t2 key (primary,b) ;
|
load index into cache t3, t2 key (primary,b) ;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t3 preload_keys Error Table 'test.t3' doesn't exist
|
test.t3 preload_keys Error Table 'test.t3' doesn't exist
|
||||||
test.t3 preload_keys error Corrupt
|
test.t3 preload_keys status Operation failed
|
||||||
test.t2 preload_keys status OK
|
test.t2 preload_keys status OK
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
@ -159,7 +159,7 @@ Key_reads 0
|
|||||||
load index into cache t3 key (b), t2 key (c) ;
|
load index into cache t3 key (b), t2 key (c) ;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t3 preload_keys Error Table 'test.t3' doesn't exist
|
test.t3 preload_keys Error Table 'test.t3' doesn't exist
|
||||||
test.t3 preload_keys error Corrupt
|
test.t3 preload_keys status Operation failed
|
||||||
test.t2 preload_keys Error Key 'c' doesn't exist in table 't2'
|
test.t2 preload_keys Error Key 'c' doesn't exist in table 't2'
|
||||||
test.t2 preload_keys status Operation failed
|
test.t2 preload_keys status Operation failed
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
|
@ -235,7 +235,7 @@ execute stmt1;
|
|||||||
prepare stmt1 from "insert into t1 select i from t1";
|
prepare stmt1 from "insert into t1 select i from t1";
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
prepare stmt1 from "select * from t1 into outfile 'f1.txt'";
|
prepare stmt1 from "select * from t1 into outfile '<MYSQLTEST_VARDIR>/tmp/f1.txt'";
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
deallocate prepare stmt1;
|
deallocate prepare stmt1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
@ -1386,13 +1386,13 @@ execute stmt;
|
|||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 repair status OK
|
test.t1 repair status OK
|
||||||
test.t4 repair Error Table 'test.t4' doesn't exist
|
test.t4 repair Error Table 'test.t4' doesn't exist
|
||||||
test.t4 repair error Corrupt
|
test.t4 repair status Operation failed
|
||||||
test.t3 repair status OK
|
test.t3 repair status OK
|
||||||
execute stmt;
|
execute stmt;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 repair status OK
|
test.t1 repair status OK
|
||||||
test.t4 repair Error Table 'test.t4' doesn't exist
|
test.t4 repair Error Table 'test.t4' doesn't exist
|
||||||
test.t4 repair error Corrupt
|
test.t4 repair status Operation failed
|
||||||
test.t3 repair status OK
|
test.t3 repair status OK
|
||||||
prepare stmt from "optimize table t1, t3, t4";
|
prepare stmt from "optimize table t1, t3, t4";
|
||||||
execute stmt;
|
execute stmt;
|
||||||
@ -1400,23 +1400,23 @@ Table Op Msg_type Msg_text
|
|||||||
test.t1 optimize status OK
|
test.t1 optimize status OK
|
||||||
test.t3 optimize status OK
|
test.t3 optimize status OK
|
||||||
test.t4 optimize Error Table 'test.t4' doesn't exist
|
test.t4 optimize Error Table 'test.t4' doesn't exist
|
||||||
test.t4 optimize error Corrupt
|
test.t4 optimize status Operation failed
|
||||||
execute stmt;
|
execute stmt;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 optimize status Table is already up to date
|
test.t1 optimize status Table is already up to date
|
||||||
test.t3 optimize status Table is already up to date
|
test.t3 optimize status Table is already up to date
|
||||||
test.t4 optimize Error Table 'test.t4' doesn't exist
|
test.t4 optimize Error Table 'test.t4' doesn't exist
|
||||||
test.t4 optimize error Corrupt
|
test.t4 optimize status Operation failed
|
||||||
prepare stmt from "analyze table t4, t1";
|
prepare stmt from "analyze table t4, t1";
|
||||||
execute stmt;
|
execute stmt;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t4 analyze Error Table 'test.t4' doesn't exist
|
test.t4 analyze Error Table 'test.t4' doesn't exist
|
||||||
test.t4 analyze error Corrupt
|
test.t4 analyze status Operation failed
|
||||||
test.t1 analyze status Table is already up to date
|
test.t1 analyze status Table is already up to date
|
||||||
execute stmt;
|
execute stmt;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t4 analyze Error Table 'test.t4' doesn't exist
|
test.t4 analyze Error Table 'test.t4' doesn't exist
|
||||||
test.t4 analyze error Corrupt
|
test.t4 analyze status Operation failed
|
||||||
test.t1 analyze status Table is already up to date
|
test.t1 analyze status Table is already up to date
|
||||||
deallocate prepare stmt;
|
deallocate prepare stmt;
|
||||||
drop table t1, t2, t3;
|
drop table t1, t2, t3;
|
||||||
|
@ -47,7 +47,7 @@ Note 1051 Unknown table 'ttt'
|
|||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
drop user test@localhost;
|
drop user test@localhost;
|
||||||
#
|
#
|
||||||
# Bug #27440 read_only allows create and drop database
|
# Bug#27440 read_only allows create and drop database
|
||||||
#
|
#
|
||||||
drop database if exists mysqltest_db1;
|
drop database if exists mysqltest_db1;
|
||||||
drop database if exists mysqltest_db2;
|
drop database if exists mysqltest_db2;
|
||||||
|
@ -27,7 +27,7 @@ drop table t1;
|
|||||||
repair table t1 use_frm;
|
repair table t1 use_frm;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 repair Error Table 'test.t1' doesn't exist
|
test.t1 repair Error Table 'test.t1' doesn't exist
|
||||||
test.t1 repair error Corrupt
|
test.t1 repair status Operation failed
|
||||||
create table t1 engine=myisam SELECT 1,"table 1";
|
create table t1 engine=myisam SELECT 1,"table 1";
|
||||||
flush tables;
|
flush tables;
|
||||||
repair table t1;
|
repair table t1;
|
||||||
|
@ -443,3 +443,17 @@ SELECT ROW(a, 1) IN (SELECT SUM(b), 3) FROM t1 GROUP BY a;
|
|||||||
ROW(a, 1) IN (SELECT SUM(b), 3)
|
ROW(a, 1) IN (SELECT SUM(b), 3)
|
||||||
0
|
0
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
create table t1 (a varchar(200),
|
||||||
|
b int unsigned not null primary key auto_increment)
|
||||||
|
default character set 'utf8';
|
||||||
|
create table t2 (c varchar(200),
|
||||||
|
d int unsigned not null primary key auto_increment)
|
||||||
|
default character set 'latin1';
|
||||||
|
insert into t1 (a) values('abc');
|
||||||
|
insert into t2 (c) values('abc');
|
||||||
|
select * from t1,t2 where (a,b) = (c,d);
|
||||||
|
a b c d
|
||||||
|
abc 1 abc 1
|
||||||
|
select host,user from mysql.user where (host,user) = ('localhost','test');
|
||||||
|
host user
|
||||||
|
drop table t1,t2;
|
||||||
|
@ -16,5 +16,5 @@ Error 1205 Lock wait timeout exceeded; try restarting transaction
|
|||||||
OPTIMIZE TABLE non_existing;
|
OPTIMIZE TABLE non_existing;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.non_existing optimize Error Table 'test.non_existing' doesn't exist
|
test.non_existing optimize Error Table 'test.non_existing' doesn't exist
|
||||||
test.non_existing optimize error Corrupt
|
test.non_existing optimize status Operation failed
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
151
mysql-test/r/rpl_filter_tables_not_exist.result
Normal file
151
mysql-test/r/rpl_filter_tables_not_exist.result
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
stop slave;
|
||||||
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
|
reset master;
|
||||||
|
reset slave;
|
||||||
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
|
start slave;
|
||||||
|
CREATE TABLE t1 (id int, a int);
|
||||||
|
CREATE TABLE t2 (id int, b int);
|
||||||
|
CREATE TABLE t3 (id int, c int);
|
||||||
|
CREATE TABLE t4 (id int, d int);
|
||||||
|
CREATE TABLE t5 (id int, e int);
|
||||||
|
CREATE TABLE t6 (id int, f int);
|
||||||
|
CREATE TABLE t7 (id int, g int);
|
||||||
|
CREATE TABLE t8 (id int, h int);
|
||||||
|
CREATE TABLE t9 (id int, i int);
|
||||||
|
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
|
||||||
|
INSERT INTO t2 VALUES (1, 1), (2, 2), (3, 3);
|
||||||
|
INSERT INTO t3 VALUES (1, 1), (2, 2), (3, 3);
|
||||||
|
INSERT INTO t4 VALUES (1, 1), (2, 2), (3, 3);
|
||||||
|
INSERT INTO t5 VALUES (1, 1), (2, 2), (3, 3);
|
||||||
|
INSERT INTO t6 VALUES (1, 1), (2, 2), (3, 3);
|
||||||
|
INSERT INTO t7 VALUES (1, 1), (2, 2), (3, 3);
|
||||||
|
INSERT INTO t8 VALUES (1, 1), (2, 2), (3, 3);
|
||||||
|
INSERT INTO t9 VALUES (1, 1), (2, 2), (3, 3);
|
||||||
|
[on slave]
|
||||||
|
SHOW TABLES LIKE 't%';
|
||||||
|
Tables_in_test (t%)
|
||||||
|
t1
|
||||||
|
t2
|
||||||
|
t3
|
||||||
|
[on master]
|
||||||
|
UPDATE t7 LEFT JOIN t4 ON (t4.id=t7.id) SET d=0, g=0 where t7.id=1;
|
||||||
|
UPDATE t7 LEFT JOIN (t4, t5, t6) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t6.id) SET d=0, e=0, f=0, g=0 where t7.id=1;
|
||||||
|
UPDATE t4 LEFT JOIN (t7, t8, t9) ON (t4.id=t7.id and t4.id=t8.id and t4.id=t9.id) SET d=0, g=0, h=0, i=0 where t4.id=1;
|
||||||
|
UPDATE t7 LEFT JOIN (t8, t9) ON (t7.id=t8.id and t7.id=t9.id) SET g=0, h=0, i=0 where t7.id=1;
|
||||||
|
UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET d=0 where t1.id=1;
|
||||||
|
UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET g=0 where t1.id=1;
|
||||||
|
UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET d=0, e=0, f=0 where t1.id=1;
|
||||||
|
UPDATE t1 LEFT JOIN (t4, t5, t8) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t8.id) SET d=0, e=0, h=0 where t1.id=1;
|
||||||
|
UPDATE t1 LEFT JOIN (t7, t8, t5) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t5.id) SET g=0, h=0, e=0 where t1.id=1;
|
||||||
|
UPDATE t1 LEFT JOIN (t2, t3, t5) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t5.id) SET e=0 where t1.id=1;
|
||||||
|
UPDATE t4 LEFT JOIN t1 ON (t1.id=t4.id) SET a=0, d=0 where t4.id=1;
|
||||||
|
UPDATE t4 LEFT JOIN (t1, t7) ON (t4.id=t1.id and t7.id=t4.id) SET a = 0, d=0, g=0 where t4.id=1;
|
||||||
|
UPDATE t4 LEFT JOIN (t1, t2, t3) ON (t1.id=t4.id and t2.id=t4.id and t3.id=t4.id) SET a=0, b=0, c=0, d=0 where t4.id=1;
|
||||||
|
UPDATE t4 LEFT JOIN (t1, t2, t5) ON (t1.id=t4.id and t2.id=t4.id and t5.id=t4.id) SET a=0, b=0, e=0, d=0 where t4.id=1;
|
||||||
|
UPDATE t4 LEFT JOIN (t1, t6, t7) ON (t4.id=t1.id and t4.id=t6.id and t4.id=t7.id) SET a=0, d=0, f=0, g=0 where t4.id=1;
|
||||||
|
UPDATE t7 LEFT JOIN (t4, t1, t2) ON (t7.id=t4.id and t7.id=t1.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1;
|
||||||
|
UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id) SET a=0, d=0, g=0, h=0 where t7.id=1;
|
||||||
|
UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t1 LEFT JOIN (t4, t7) ON (t1.id=t4.id and t1.id=t7.id) SET a=0 where t1.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7) ON (t1.id=t4.id and t1.id=t7.id) SET a=0 where t1.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t1 LEFT JOIN (t2, t4, t7) ON (t1.id=t2.id and t1.id=t4.id and t1.id=t7.id) SET a=0, b=0 where t1.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t4, t7) ON (t1.id=t2.id and t1.id=t4.id and t1.id=t7.id) SET a=0, b=0 where t1.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t1 LEFT JOIN (t2, t3, t7) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t7.id) SET a=0, b=0, c=0 where t1.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t3, t7) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t7.id) SET a=0, b=0, c=0 where t1.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET a=0, g=0 where t1.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET a=0, g=0 where t1.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t7 LEFT JOIN t1 ON (t1.id=t7.id) SET a=0, g=0 where t7.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN t1 ON (t1.id=t7.id) SET a=0, g=0 where t7.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t1 LEFT JOIN (t4, t5, t7) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t7.id) SET a=0, g=0 where t1.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t7) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t7.id) SET a=0, g=0 where t1.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t1 LEFT JOIN (t4, t7, t8) ON (t1.id=t4.id and t1.id=t7.id and t1.id=t8.id) SET a=0, g=0 where t1.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7, t8) ON (t1.id=t4.id and t1.id=t7.id and t1.id=t8.id) SET a=0, g=0 where t1.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t1 LEFT JOIN (t7, t8, t9) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t9.id) SET a=0, g=0, h=0, i=0 where t1.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t7, t8, t9) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t9.id) SET a=0, g=0, h=0, i=0 where t1.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t7 LEFT JOIN (t1, t2, t3) ON (t7.id=t1.id and t7.id=t2.id and t7.id=t3.id) SET g=0, a=0, b=0, c=0 where t7.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t2, t3) ON (t7.id=t1.id and t7.id=t2.id and t7.id=t3.id) SET g=0, a=0, b=0, c=0 where t7.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t7 LEFT JOIN (t4, t5, t3) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t3.id) SET g=0, c=0 where t7.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t4, t5, t3) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t3.id) SET g=0, c=0 where t7.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t7 LEFT JOIN (t8, t9, t3) ON (t7.id=t8.id and t7.id=t9.id and t7.id=t3.id) SET g=0, h=0, i=0, c=0 where t7.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t8, t9, t3) ON (t7.id=t8.id and t7.id=t9.id and t7.id=t3.id) SET g=0, h=0, i=0, c=0 where t7.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0, d=0 where t1.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0, d=0 where t1.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET a=0, d=0, e=0, f=0 where t1.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET a=0, d=0, e=0, f=0 where t1.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id) SET a=0, e=0, f=0 where t4.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id) SET a=0, e=0, f=0 where t4.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1;
|
||||||
|
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||||
|
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1'
|
||||||
|
set global sql_slave_skip_counter=1;
|
||||||
|
include/start_slave.inc
|
||||||
|
[on slave]
|
||||||
|
show tables like 't%';
|
||||||
|
Tables_in_test (t%)
|
||||||
|
t1
|
||||||
|
t2
|
||||||
|
t3
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id a
|
||||||
|
1 1
|
||||||
|
2 2
|
||||||
|
3 3
|
||||||
|
SELECT * FROM t2;
|
||||||
|
id b
|
||||||
|
1 1
|
||||||
|
2 2
|
||||||
|
3 3
|
||||||
|
SELECT * FROM t3;
|
||||||
|
id c
|
||||||
|
1 1
|
||||||
|
2 2
|
||||||
|
3 3
|
||||||
|
[on master]
|
||||||
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user