Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1 sql/mysqld.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_acl.h: Auto merged
This commit is contained in:
commit
d9f92569c6
@ -1106,3 +1106,4 @@ vio/test-ssl
|
||||
vio/test-sslclient
|
||||
vio/test-sslserver
|
||||
vio/viotest-ssl
|
||||
VC++Files/client/mysql_amd64.dsp
|
||||
|
@ -2154,7 +2154,7 @@ print_table_data_xml(MYSQL_RES *result)
|
||||
for (uint i=0; i < mysql_num_fields(result); i++)
|
||||
{
|
||||
tee_fprintf(PAGER, "\t<field name=\"");
|
||||
xmlencode_print(fields[i].name, strlen(fields[i].name));
|
||||
xmlencode_print(fields[i].name, (uint) strlen(fields[i].name));
|
||||
tee_fprintf(PAGER, "\">");
|
||||
xmlencode_print(cur[i], lengths[i]);
|
||||
tee_fprintf(PAGER, "</field>\n");
|
||||
|
@ -103,6 +103,22 @@ class Load_log_processor
|
||||
{
|
||||
char target_dir_name[FN_REFLEN];
|
||||
int target_dir_name_len;
|
||||
|
||||
/*
|
||||
When we see first event corresponding to some LOAD DATA statement in
|
||||
binlog, we create temporary file to store data to be loaded.
|
||||
We add name of this file to file_names array using its file_id as index.
|
||||
If we have Create_file event (i.e. we have binary log in pre-5.0.3
|
||||
format) we also store save event object to be able which is needed to
|
||||
emit LOAD DATA statement when we will meet Exec_load_data event.
|
||||
If we have Begin_load_query event we simply store 0 in
|
||||
File_name_record::event field.
|
||||
*/
|
||||
struct File_name_record
|
||||
{
|
||||
char *fname;
|
||||
Create_file_log_event *event;
|
||||
};
|
||||
DYNAMIC_ARRAY file_names;
|
||||
|
||||
/*
|
||||
@ -144,7 +160,7 @@ public:
|
||||
|
||||
int init()
|
||||
{
|
||||
return init_dynamic_array(&file_names,sizeof(Create_file_log_event*),
|
||||
return init_dynamic_array(&file_names, sizeof(File_name_record),
|
||||
100,100 CALLER_INFO);
|
||||
}
|
||||
|
||||
@ -161,33 +177,91 @@ public:
|
||||
}
|
||||
void destroy()
|
||||
{
|
||||
Create_file_log_event **ptr= (Create_file_log_event**)file_names.buffer;
|
||||
Create_file_log_event **end= ptr + file_names.elements;
|
||||
File_name_record *ptr= (File_name_record *)file_names.buffer;
|
||||
File_name_record *end= ptr + file_names.elements;
|
||||
for (; ptr<end; ptr++)
|
||||
{
|
||||
if (*ptr)
|
||||
if (ptr->fname)
|
||||
{
|
||||
my_free((char*)(*ptr)->fname,MYF(MY_WME));
|
||||
delete *ptr;
|
||||
*ptr= 0;
|
||||
my_free(ptr->fname, MYF(MY_WME));
|
||||
delete ptr->event;
|
||||
bzero((char *)ptr, sizeof(File_name_record));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Obtain Create_file event for LOAD DATA statement by its file_id.
|
||||
|
||||
SYNOPSIS
|
||||
grab_event()
|
||||
file_id - file_id identifiying LOAD DATA statement
|
||||
|
||||
DESCRIPTION
|
||||
Checks whenever we have already seen Create_file event for this file_id.
|
||||
If yes then returns pointer to it and removes it from array describing
|
||||
active temporary files. Since this moment caller is responsible for
|
||||
freeing memory occupied by this event and associated file name.
|
||||
|
||||
RETURN VALUES
|
||||
Pointer to Create_file event or 0 if there was no such event
|
||||
with this file_id.
|
||||
*/
|
||||
Create_file_log_event *grab_event(uint file_id)
|
||||
{
|
||||
File_name_record *ptr;
|
||||
Create_file_log_event *res;
|
||||
|
||||
if (file_id >= file_names.elements)
|
||||
return 0;
|
||||
Create_file_log_event **ptr=
|
||||
(Create_file_log_event**)file_names.buffer + file_id;
|
||||
Create_file_log_event *res= *ptr;
|
||||
*ptr= 0;
|
||||
ptr= dynamic_element(&file_names, file_id, File_name_record*);
|
||||
if ((res= ptr->event))
|
||||
bzero((char *)ptr, sizeof(File_name_record));
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
Obtain file name of temporary file for LOAD DATA statement by its file_id.
|
||||
|
||||
SYNOPSIS
|
||||
grab_fname()
|
||||
file_id - file_id identifiying LOAD DATA statement
|
||||
|
||||
DESCRIPTION
|
||||
Checks whenever we have already seen Begin_load_query event for this
|
||||
file_id. If yes then returns file name of corresponding temporary file.
|
||||
Removes record about this file from the array of active temporary files.
|
||||
Since this moment caller is responsible for freeing memory occupied by
|
||||
this name.
|
||||
|
||||
RETURN VALUES
|
||||
String with name of temporary file or 0 if we have not seen Begin_load_query
|
||||
event with this file_id.
|
||||
*/
|
||||
char *grab_fname(uint file_id)
|
||||
{
|
||||
File_name_record *ptr;
|
||||
char *res= 0;
|
||||
|
||||
if (file_id >= file_names.elements)
|
||||
return 0;
|
||||
ptr= dynamic_element(&file_names, file_id, File_name_record*);
|
||||
if (!ptr->event)
|
||||
{
|
||||
res= ptr->fname;
|
||||
bzero((char *)ptr, sizeof(File_name_record));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
int process(Create_file_log_event *ce);
|
||||
int process(Begin_load_query_log_event *ce);
|
||||
int process(Append_block_log_event *ae);
|
||||
File prepare_new_file_for_old_format(Load_log_event *le, char *filename);
|
||||
int load_old_format_file(NET* net, const char *server_fname,
|
||||
uint server_fname_len, File file);
|
||||
int process_first_event(const char *bname, uint blen, const char *block,
|
||||
uint block_len, uint file_id,
|
||||
Create_file_log_event *ce);
|
||||
};
|
||||
|
||||
|
||||
@ -265,22 +339,42 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname,
|
||||
}
|
||||
|
||||
|
||||
int Load_log_processor::process(Create_file_log_event *ce)
|
||||
/*
|
||||
Process first event in the sequence of events representing LOAD DATA
|
||||
statement.
|
||||
|
||||
SYNOPSIS
|
||||
process_first_event()
|
||||
bname - base name for temporary file to be created
|
||||
blen - base name length
|
||||
block - first block of data to be loaded
|
||||
block_len - first block length
|
||||
file_id - identifies LOAD DATA statement
|
||||
ce - pointer to Create_file event object if we are processing
|
||||
this type of event.
|
||||
|
||||
DESCRIPTION
|
||||
Creates temporary file to be used in LOAD DATA and writes first block of
|
||||
data to it. Registers its file name (and optional Create_file event)
|
||||
in the array of active temporary files.
|
||||
|
||||
RETURN VALUES
|
||||
0 - success
|
||||
non-0 - error
|
||||
*/
|
||||
|
||||
int Load_log_processor::process_first_event(const char *bname, uint blen,
|
||||
const char *block, uint block_len,
|
||||
uint file_id,
|
||||
Create_file_log_event *ce)
|
||||
{
|
||||
const char *bname= ce->fname+dirname_length(ce->fname);
|
||||
uint blen= ce->fname_len - (bname-ce->fname);
|
||||
uint full_len= target_dir_name_len + blen + 9 + 9 + 1;
|
||||
int error= 0;
|
||||
char *fname, *ptr;
|
||||
File file;
|
||||
DBUG_ENTER("Load_log_processor::process");
|
||||
File_name_record rec;
|
||||
DBUG_ENTER("Load_log_processor::process_first_event");
|
||||
|
||||
if (set_dynamic(&file_names,(gptr)&ce,ce->file_id))
|
||||
{
|
||||
sql_print_error("Could not construct local filename %s%s",
|
||||
target_dir_name,bname);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
if (!(fname= my_malloc(full_len,MYF(MY_WME))))
|
||||
DBUG_RETURN(-1);
|
||||
|
||||
@ -288,7 +382,7 @@ int Load_log_processor::process(Create_file_log_event *ce)
|
||||
ptr= fname + target_dir_name_len;
|
||||
memcpy(ptr,bname,blen);
|
||||
ptr+= blen;
|
||||
ptr+= my_sprintf(ptr,(ptr,"-%x",ce->file_id));
|
||||
ptr+= my_sprintf(ptr, (ptr, "-%x", file_id));
|
||||
|
||||
if ((file= create_unique_file(fname,ptr)) < 0)
|
||||
{
|
||||
@ -296,9 +390,21 @@ int Load_log_processor::process(Create_file_log_event *ce)
|
||||
target_dir_name,bname);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
ce->set_fname_outside_temp_buf(fname,strlen(fname));
|
||||
|
||||
if (my_write(file,(byte*) ce->block,ce->block_len,MYF(MY_WME|MY_NABP)))
|
||||
rec.fname= fname;
|
||||
rec.event= ce;
|
||||
|
||||
if (set_dynamic(&file_names, (gptr)&rec, file_id))
|
||||
{
|
||||
sql_print_error("Could not construct local filename %s%s",
|
||||
target_dir_name, bname);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
if (ce)
|
||||
ce->set_fname_outside_temp_buf(fname, strlen(fname));
|
||||
|
||||
if (my_write(file, (byte*)block, block_len, MYF(MY_WME|MY_NABP)))
|
||||
error= -1;
|
||||
if (my_close(file, MYF(MY_WME)))
|
||||
error= -1;
|
||||
@ -306,19 +412,35 @@ 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);
|
||||
uint blen= ce->fname_len - (bname-ce->fname);
|
||||
|
||||
return process_first_event(bname, blen, ce->block, ce->block_len,
|
||||
ce->file_id, ce);
|
||||
}
|
||||
|
||||
|
||||
int Load_log_processor::process(Begin_load_query_log_event *blqe)
|
||||
{
|
||||
return process_first_event("SQL_LOAD_MB", 11, blqe->block, blqe->block_len,
|
||||
blqe->file_id, 0);
|
||||
}
|
||||
|
||||
|
||||
int Load_log_processor::process(Append_block_log_event *ae)
|
||||
{
|
||||
DBUG_ENTER("Load_log_processor::process");
|
||||
Create_file_log_event* ce= ((ae->file_id < file_names.elements) ?
|
||||
*((Create_file_log_event**)file_names.buffer +
|
||||
ae->file_id) :
|
||||
0);
|
||||
const char* fname= ((ae->file_id < file_names.elements) ?
|
||||
dynamic_element(&file_names, ae->file_id,
|
||||
File_name_record*)->fname : 0);
|
||||
|
||||
if (ce)
|
||||
if (fname)
|
||||
{
|
||||
File file;
|
||||
int error= 0;
|
||||
if (((file= my_open(ce->fname,
|
||||
if (((file= my_open(fname,
|
||||
O_APPEND|O_BINARY|O_WRONLY,MYF(MY_WME))) < 0))
|
||||
DBUG_RETURN(-1);
|
||||
if (my_write(file,(byte*)ae->block,ae->block_len,MYF(MY_WME|MY_NABP)))
|
||||
@ -342,6 +464,14 @@ Create_file event for file_id: %u\n",ae->file_id);
|
||||
Load_log_processor load_processor;
|
||||
|
||||
|
||||
static bool check_database(const char *log_dbname)
|
||||
{
|
||||
return one_database &&
|
||||
(log_dbname != NULL) &&
|
||||
strcmp(log_dbname, database);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Process an event
|
||||
|
||||
@ -395,29 +525,21 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev,
|
||||
|
||||
switch (ev_type) {
|
||||
case QUERY_EVENT:
|
||||
if (one_database)
|
||||
{
|
||||
const char * log_dbname = ((Query_log_event*)ev)->db;
|
||||
if ((log_dbname != NULL) && (strcmp(log_dbname, database)))
|
||||
goto end;
|
||||
}
|
||||
if (check_database(((Query_log_event*)ev)->db))
|
||||
goto end;
|
||||
ev->print(result_file, short_form, last_event_info);
|
||||
break;
|
||||
case CREATE_FILE_EVENT:
|
||||
{
|
||||
Create_file_log_event* ce= (Create_file_log_event*)ev;
|
||||
if (one_database)
|
||||
{
|
||||
/*
|
||||
We test if this event has to be ignored. If yes, we don't save
|
||||
this event; this will have the good side-effect of ignoring all
|
||||
related Append_block and Exec_load.
|
||||
Note that Load event from 3.23 is not tested.
|
||||
*/
|
||||
const char * log_dbname = ce->db;
|
||||
if ((log_dbname != NULL) && (strcmp(log_dbname, database)))
|
||||
goto end; // Next event
|
||||
}
|
||||
/*
|
||||
We test if this event has to be ignored. If yes, we don't save
|
||||
this event; this will have the good side-effect of ignoring all
|
||||
related Append_block and Exec_load.
|
||||
Note that Load event from 3.23 is not tested.
|
||||
*/
|
||||
if (check_database(ce->db))
|
||||
goto end; // Next event
|
||||
/*
|
||||
We print the event, but with a leading '#': this is just to inform
|
||||
the user of the original command; the command we want to execute
|
||||
@ -473,6 +595,32 @@ Create_file event for file_id: %u\n",exv->file_id);
|
||||
*/
|
||||
ev= 0;
|
||||
break;
|
||||
case BEGIN_LOAD_QUERY_EVENT:
|
||||
ev->print(result_file, short_form, last_event_info);
|
||||
load_processor.process((Begin_load_query_log_event*) ev);
|
||||
break;
|
||||
case EXECUTE_LOAD_QUERY_EVENT:
|
||||
{
|
||||
Execute_load_query_log_event *exlq= (Execute_load_query_log_event*)ev;
|
||||
char *fname= load_processor.grab_fname(exlq->file_id);
|
||||
|
||||
if (check_database(exlq->db))
|
||||
{
|
||||
if (fname)
|
||||
my_free(fname, MYF(MY_WME));
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (fname)
|
||||
{
|
||||
exlq->print(result_file, short_form, last_event_info, fname);
|
||||
my_free(fname, MYF(MY_WME));
|
||||
}
|
||||
else
|
||||
fprintf(stderr,"Warning: ignoring Execute_load_query as there is no \
|
||||
Begin_load_query event for file_id: %u\n", exlq->file_id);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ev->print(result_file, short_form, last_event_info);
|
||||
}
|
||||
|
@ -28,6 +28,11 @@
|
||||
#include <floatingpoint.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
The following extern declarations are ok as these are interface functions
|
||||
required by the string function
|
||||
*/
|
||||
|
||||
extern gptr sql_alloc(unsigned size);
|
||||
extern void sql_element_free(void *ptr);
|
||||
|
||||
@ -97,14 +102,7 @@ bool String::set(longlong num, CHARSET_INFO *cs)
|
||||
|
||||
if (alloc(l))
|
||||
return TRUE;
|
||||
if (cs->cset->snprintf == my_snprintf_8bit)
|
||||
{
|
||||
str_length=(uint32) (longlong10_to_str(num,Ptr,-10)-Ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_length=cs->cset->snprintf(cs,Ptr,l,"%d",num);
|
||||
}
|
||||
str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,-10,num);
|
||||
str_charset=cs;
|
||||
return FALSE;
|
||||
}
|
||||
@ -115,14 +113,7 @@ bool String::set(ulonglong num, CHARSET_INFO *cs)
|
||||
|
||||
if (alloc(l))
|
||||
return TRUE;
|
||||
if (cs->cset->snprintf == my_snprintf_8bit)
|
||||
{
|
||||
str_length=(uint32) (longlong10_to_str(num,Ptr,10)-Ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_length=cs->cset->snprintf(cs,Ptr,l,"%d",num);
|
||||
}
|
||||
str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,10,num);
|
||||
str_charset=cs;
|
||||
return FALSE;
|
||||
}
|
||||
@ -130,12 +121,13 @@ bool String::set(ulonglong num, CHARSET_INFO *cs)
|
||||
bool String::set(double num,uint decimals, CHARSET_INFO *cs)
|
||||
{
|
||||
char buff[331];
|
||||
uint dummy_errors;
|
||||
|
||||
str_charset=cs;
|
||||
if (decimals >= NOT_FIXED_DEC)
|
||||
{
|
||||
sprintf(buff,"%.14g",num); // Enough for a DATETIME
|
||||
return copy(buff, (uint32) strlen(buff), &my_charset_latin1, cs);
|
||||
uint32 len= my_sprintf(buff,(buff, "%.14g",num));// Enough for a DATETIME
|
||||
return copy(buff, len, &my_charset_latin1, cs, &dummy_errors);
|
||||
}
|
||||
#ifdef HAVE_FCONVERT
|
||||
int decpt,sign;
|
||||
@ -150,7 +142,8 @@ bool String::set(double num,uint decimals, CHARSET_INFO *cs)
|
||||
buff[0]='-';
|
||||
pos=buff;
|
||||
}
|
||||
return copy(pos,(uint32) strlen(pos), &my_charset_latin1, cs);
|
||||
uint dummy_errors;
|
||||
return copy(pos,(uint32) strlen(pos), &my_charset_latin1, cs, &dummy_errors);
|
||||
}
|
||||
if (alloc((uint32) ((uint32) decpt+3+decimals)))
|
||||
return TRUE;
|
||||
@ -200,7 +193,8 @@ end:
|
||||
#else
|
||||
sprintf(buff,"%.*f",(int) decimals,num);
|
||||
#endif
|
||||
return copy(buff,(uint32) strlen(buff), &my_charset_latin1, cs);
|
||||
return copy(buff,(uint32) strlen(buff), &my_charset_latin1, cs,
|
||||
&dummy_errors);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -237,55 +231,163 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Copy with charset convertion */
|
||||
bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *from, CHARSET_INFO *to)
|
||||
|
||||
/*
|
||||
Checks that the source string can be just copied to the destination string
|
||||
without conversion.
|
||||
|
||||
SYNPOSIS
|
||||
|
||||
needs_conversion()
|
||||
arg_length Length of string to copy.
|
||||
from_cs Character set to copy from
|
||||
to_cs Character set to copy to
|
||||
uint32 *offset Returns number of unaligned characters.
|
||||
|
||||
RETURN
|
||||
0 No conversion needed
|
||||
1 Either character set conversion or adding leading zeros
|
||||
(e.g. for UCS-2) must be done
|
||||
*/
|
||||
|
||||
bool String::needs_conversion(uint32 arg_length,
|
||||
CHARSET_INFO *from_cs,
|
||||
CHARSET_INFO *to_cs,
|
||||
uint32 *offset)
|
||||
{
|
||||
uint32 new_length=to->mbmaxlen*arg_length;
|
||||
int cnvres;
|
||||
my_wc_t wc;
|
||||
const uchar *s=(const uchar *)str;
|
||||
const uchar *se=s+arg_length;
|
||||
uchar *d, *de;
|
||||
*offset= 0;
|
||||
if ((to_cs == &my_charset_bin) ||
|
||||
(to_cs == from_cs) ||
|
||||
my_charset_same(from_cs, to_cs) ||
|
||||
((from_cs == &my_charset_bin) &&
|
||||
(!(*offset=(arg_length % to_cs->mbminlen)))))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (alloc(new_length))
|
||||
|
||||
/*
|
||||
Copy a multi-byte character sets with adding leading zeros.
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
copy_aligned()
|
||||
str String to copy
|
||||
arg_length Length of string. This should NOT be dividable with
|
||||
cs->mbminlen.
|
||||
offset arg_length % cs->mb_minlength
|
||||
cs Character set for 'str'
|
||||
|
||||
NOTES
|
||||
For real multi-byte, ascii incompatible charactser sets,
|
||||
like UCS-2, add leading zeros if we have an incomplete character.
|
||||
Thus,
|
||||
SELECT _ucs2 0xAA
|
||||
will automatically be converted into
|
||||
SELECT _ucs2 0x00AA
|
||||
|
||||
RETURN
|
||||
0 ok
|
||||
1 error
|
||||
*/
|
||||
|
||||
bool String::copy_aligned(const char *str,uint32 arg_length, uint32 offset,
|
||||
CHARSET_INFO *cs)
|
||||
{
|
||||
/* How many bytes are in incomplete character */
|
||||
offset= cs->mbmaxlen - offset; /* How many zeros we should prepend */
|
||||
DBUG_ASSERT(offset && offset != cs->mbmaxlen);
|
||||
|
||||
uint32 aligned_length= arg_length + offset;
|
||||
if (alloc(aligned_length))
|
||||
return TRUE;
|
||||
|
||||
d=(uchar *)Ptr;
|
||||
de=d+new_length;
|
||||
|
||||
for (str_length=new_length ; s < se && d < de ; )
|
||||
{
|
||||
if ((cnvres=from->cset->mb_wc(from,&wc,s,se)) > 0 )
|
||||
{
|
||||
s+=cnvres;
|
||||
}
|
||||
else if (cnvres==MY_CS_ILSEQ)
|
||||
{
|
||||
s++;
|
||||
wc='?';
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
outp:
|
||||
if((cnvres=to->cset->wc_mb(to,wc,d,de)) >0 )
|
||||
{
|
||||
d+=cnvres;
|
||||
}
|
||||
else if (cnvres==MY_CS_ILUNI && wc!='?')
|
||||
{
|
||||
wc='?';
|
||||
goto outp;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
Ptr[new_length]=0;
|
||||
length((uint32) (d-(uchar *)Ptr));
|
||||
str_charset=to;
|
||||
/*
|
||||
Note, this is only safe for little-endian UCS-2.
|
||||
If we add big-endian UCS-2 sometimes, this code
|
||||
will be more complicated. But it's OK for now.
|
||||
*/
|
||||
bzero((char*) Ptr, offset);
|
||||
memcpy(Ptr + offset, str, arg_length);
|
||||
Ptr[aligned_length]=0;
|
||||
/* str_length is always >= 0 as arg_length is != 0 */
|
||||
str_length= aligned_length;
|
||||
str_charset= cs;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
bool String::set_or_copy_aligned(const char *str,uint32 arg_length,
|
||||
CHARSET_INFO *cs)
|
||||
{
|
||||
/* How many bytes are in incomplete character */
|
||||
uint32 offset= (arg_length % cs->mbminlen);
|
||||
|
||||
if (!offset) /* All characters are complete, just copy */
|
||||
{
|
||||
set(str, arg_length, cs);
|
||||
return FALSE;
|
||||
}
|
||||
return copy_aligned(str, arg_length, offset, cs);
|
||||
}
|
||||
|
||||
/* Copy with charset convertion */
|
||||
|
||||
bool String::copy(const char *str, uint32 arg_length,
|
||||
CHARSET_INFO *from_cs, CHARSET_INFO *to_cs, uint *errors)
|
||||
{
|
||||
uint32 offset;
|
||||
if (!needs_conversion(arg_length, from_cs, to_cs, &offset))
|
||||
{
|
||||
*errors= 0;
|
||||
return copy(str, arg_length, to_cs);
|
||||
}
|
||||
if ((from_cs == &my_charset_bin) && offset)
|
||||
{
|
||||
*errors= 0;
|
||||
return copy_aligned(str, arg_length, offset, to_cs);
|
||||
}
|
||||
uint32 new_length= to_cs->mbmaxlen*arg_length;
|
||||
if (alloc(new_length))
|
||||
return TRUE;
|
||||
str_length=copy_and_convert((char*) Ptr, new_length, to_cs,
|
||||
str, arg_length, from_cs, errors);
|
||||
str_charset=to_cs;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Set a string to the value of a latin1-string, keeping the original charset
|
||||
|
||||
SYNOPSIS
|
||||
copy_or_set()
|
||||
str String of a simple charset (latin1)
|
||||
arg_length Length of string
|
||||
|
||||
IMPLEMENTATION
|
||||
If string object is of a simple character set, set it to point to the
|
||||
given string.
|
||||
If not, make a copy and convert it to the new character set.
|
||||
|
||||
RETURN
|
||||
0 ok
|
||||
1 Could not allocate result buffer
|
||||
|
||||
*/
|
||||
|
||||
bool String::set_ascii(const char *str, uint32 arg_length)
|
||||
{
|
||||
if (str_charset->mbminlen == 1)
|
||||
{
|
||||
set(str, arg_length, str_charset);
|
||||
return 0;
|
||||
}
|
||||
uint dummy_errors;
|
||||
return copy(str, arg_length, &my_charset_latin1, str_charset, &dummy_errors);
|
||||
}
|
||||
|
||||
|
||||
/* This is used by mysql.cc */
|
||||
|
||||
bool String::fill(uint32 max_length,char fill_char)
|
||||
@ -320,11 +422,34 @@ bool String::append(const String &s)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Append an ASCII string to the a string of the current character set
|
||||
*/
|
||||
|
||||
bool String::append(const char *s,uint32 arg_length)
|
||||
{
|
||||
if (!arg_length) // Default argument
|
||||
if (!(arg_length= (uint32) strlen(s)))
|
||||
return FALSE;
|
||||
if (!arg_length)
|
||||
return FALSE;
|
||||
|
||||
/*
|
||||
For an ASCII incompatible string, e.g. UCS-2, we need to convert
|
||||
*/
|
||||
if (str_charset->mbminlen > 1)
|
||||
{
|
||||
uint32 add_length=arg_length * str_charset->mbmaxlen;
|
||||
uint dummy_errors;
|
||||
if (realloc(str_length+ add_length))
|
||||
return TRUE;
|
||||
str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset,
|
||||
s, arg_length, &my_charset_latin1,
|
||||
&dummy_errors);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
For an ASCII compatinble string we can just append.
|
||||
*/
|
||||
if (realloc(str_length+arg_length))
|
||||
return TRUE;
|
||||
memcpy(Ptr+str_length,s,arg_length);
|
||||
@ -332,6 +457,46 @@ bool String::append(const char *s,uint32 arg_length)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Append a 0-terminated ASCII string
|
||||
*/
|
||||
|
||||
bool String::append(const char *s)
|
||||
{
|
||||
return append(s, strlen(s));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Append a string in the given charset to the string
|
||||
with character set recoding
|
||||
*/
|
||||
|
||||
bool String::append(const char *s,uint32 arg_length, CHARSET_INFO *cs)
|
||||
{
|
||||
uint32 dummy_offset;
|
||||
|
||||
if (needs_conversion(arg_length, cs, str_charset, &dummy_offset))
|
||||
{
|
||||
uint32 add_length= arg_length / cs->mbminlen * str_charset->mbmaxlen;
|
||||
uint dummy_errors;
|
||||
if (realloc(str_length + add_length))
|
||||
return TRUE;
|
||||
str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset,
|
||||
s, arg_length, cs, &dummy_errors);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (realloc(str_length + arg_length))
|
||||
return TRUE;
|
||||
memcpy(Ptr + str_length, s, arg_length);
|
||||
str_length+= arg_length;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
#ifdef TO_BE_REMOVED
|
||||
bool String::append(FILE* file, uint32 arg_length, myf my_flags)
|
||||
{
|
||||
@ -360,48 +525,33 @@ bool String::append(IO_CACHE* file, uint32 arg_length)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool String::append_with_prefill(const char *s,uint32 arg_length,
|
||||
uint32 full_length, char fill_char)
|
||||
{
|
||||
int t_length= arg_length > full_length ? arg_length : full_length;
|
||||
|
||||
if (realloc(str_length + t_length))
|
||||
return TRUE;
|
||||
t_length= full_length - arg_length;
|
||||
if (t_length > 0)
|
||||
{
|
||||
bfill(Ptr+str_length, t_length, fill_char);
|
||||
str_length=str_length + t_length;
|
||||
}
|
||||
append(s, arg_length);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
uint32 String::numchars()
|
||||
{
|
||||
#ifdef USE_MB
|
||||
register uint32 n=0,mblen;
|
||||
register const char *mbstr=Ptr;
|
||||
register const char *end=mbstr+str_length;
|
||||
if (use_mb(str_charset))
|
||||
{
|
||||
while (mbstr < end) {
|
||||
if ((mblen=my_ismbchar(str_charset, mbstr,end))) mbstr+=mblen;
|
||||
else ++mbstr;
|
||||
++n;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return str_length;
|
||||
return str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length);
|
||||
}
|
||||
|
||||
int String::charpos(int i,uint32 offset)
|
||||
{
|
||||
#ifdef USE_MB
|
||||
register uint32 mblen;
|
||||
register const char *mbstr=Ptr+offset;
|
||||
register const char *end=Ptr+str_length;
|
||||
if (use_mb(str_charset))
|
||||
{
|
||||
if (i<=0) return i;
|
||||
while (i && mbstr < end) {
|
||||
if ((mblen=my_ismbchar(str_charset, mbstr,end))) mbstr+=mblen;
|
||||
else ++mbstr;
|
||||
--i;
|
||||
}
|
||||
if ( INT_MAX32-i <= (int) (mbstr-Ptr-offset))
|
||||
return INT_MAX32;
|
||||
else
|
||||
return (int) ((mbstr-Ptr-offset)+i);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (i <= 0)
|
||||
return i;
|
||||
return str_charset->cset->charpos(str_charset,Ptr+offset,Ptr+str_length,i);
|
||||
}
|
||||
|
||||
int String::strstr(const String &s,uint32 offset)
|
||||
@ -431,40 +581,6 @@ skip:
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
Search after a string without regarding to case
|
||||
This needs to be replaced when we have character sets per string
|
||||
*/
|
||||
|
||||
int String::strstr_case(const String &s,uint32 offset)
|
||||
{
|
||||
if (s.length()+offset <= str_length)
|
||||
{
|
||||
if (!s.length())
|
||||
return ((int) offset); // Empty string is always found
|
||||
|
||||
register const char *str = Ptr+offset;
|
||||
register const char *search=s.ptr();
|
||||
const char *end=Ptr+str_length-s.length()+1;
|
||||
const char *search_end=s.ptr()+s.length();
|
||||
skip:
|
||||
while (str != end)
|
||||
{
|
||||
if (str_charset->sort_order[*str++] == str_charset->sort_order[*search])
|
||||
{
|
||||
register char *i,*j;
|
||||
i=(char*) str; j=(char*) search+1;
|
||||
while (j != search_end)
|
||||
if (str_charset->sort_order[*i++] !=
|
||||
str_charset->sort_order[*j++])
|
||||
goto skip;
|
||||
return (int) (str-Ptr) -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
** Search string from end. Offset is offset to the end of string
|
||||
*/
|
||||
@ -504,14 +620,20 @@ skip:
|
||||
|
||||
bool String::replace(uint32 offset,uint32 arg_length,const String &to)
|
||||
{
|
||||
long diff = (long) to.length()-(long) arg_length;
|
||||
return replace(offset,arg_length,to.ptr(),to.length());
|
||||
}
|
||||
|
||||
bool String::replace(uint32 offset,uint32 arg_length,
|
||||
const char *to,uint32 length)
|
||||
{
|
||||
long diff = (long) length-(long) arg_length;
|
||||
if (offset+arg_length <= str_length)
|
||||
{
|
||||
if (diff < 0)
|
||||
{
|
||||
if (to.length())
|
||||
memcpy(Ptr+offset,to.ptr(),to.length());
|
||||
bmove(Ptr+offset+to.length(),Ptr+offset+arg_length,
|
||||
if (length)
|
||||
memcpy(Ptr+offset,to,length);
|
||||
bmove(Ptr+offset+length,Ptr+offset+arg_length,
|
||||
str_length-offset-arg_length);
|
||||
}
|
||||
else
|
||||
@ -523,14 +645,15 @@ bool String::replace(uint32 offset,uint32 arg_length,const String &to)
|
||||
bmove_upp(Ptr+str_length+diff,Ptr+str_length,
|
||||
str_length-offset-arg_length);
|
||||
}
|
||||
if (to.length())
|
||||
memcpy(Ptr+offset,to.ptr(),to.length());
|
||||
if (length)
|
||||
memcpy(Ptr+offset,to,length);
|
||||
}
|
||||
str_length+=(uint32) diff;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
// added by Holyfoot for "geometry" needs
|
||||
int String::reserve(uint32 space_needed, uint32 grow_by)
|
||||
{
|
||||
@ -542,9 +665,8 @@ int String::reserve(uint32 space_needed, uint32 grow_by)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void String::qs_append(const char *str)
|
||||
void String::qs_append(const char *str, uint32 len)
|
||||
{
|
||||
int len = (int)strlen(str);
|
||||
memcpy(Ptr + str_length, str, len + 1);
|
||||
str_length += len;
|
||||
}
|
||||
@ -552,8 +674,7 @@ void String::qs_append(const char *str)
|
||||
void String::qs_append(double d)
|
||||
{
|
||||
char *buff = Ptr + str_length;
|
||||
sprintf(buff,"%.14g", d);
|
||||
str_length += (int)strlen(buff);
|
||||
str_length+= my_sprintf(buff, (buff, "%.14g", d));
|
||||
}
|
||||
|
||||
void String::qs_append(double *d)
|
||||
@ -563,90 +684,70 @@ void String::qs_append(double *d)
|
||||
qs_append(ld);
|
||||
}
|
||||
|
||||
void String::qs_append(const char &c)
|
||||
void String::qs_append(int i)
|
||||
{
|
||||
Ptr[str_length] = c;
|
||||
str_length += sizeof(c);
|
||||
char *buff= Ptr + str_length;
|
||||
char *end= int10_to_str(i, buff, -10);
|
||||
str_length+= (int) (end-buff);
|
||||
}
|
||||
|
||||
void String::qs_append(uint i)
|
||||
{
|
||||
char *buff= Ptr + str_length;
|
||||
char *end= int10_to_str(i, buff, 10);
|
||||
str_length+= (int) (end-buff);
|
||||
}
|
||||
|
||||
/*
|
||||
Compare strings according to collation, without end space.
|
||||
|
||||
SYNOPSIS
|
||||
sortcmp()
|
||||
s First string
|
||||
t Second string
|
||||
cs Collation
|
||||
|
||||
NOTE:
|
||||
Normally this is case sensitive comparison
|
||||
|
||||
RETURN
|
||||
< 0 s < t
|
||||
0 s == t
|
||||
> 0 s > t
|
||||
*/
|
||||
|
||||
|
||||
int sortcmp(const String *s,const String *t, CHARSET_INFO *cs)
|
||||
{
|
||||
return cs->coll->strnncollsp(cs,
|
||||
(unsigned char *) s->ptr(),s->length(),
|
||||
(unsigned char *) t->ptr(),t->length(), 0);
|
||||
}
|
||||
|
||||
|
||||
int sortcmp(const String *x,const String *y)
|
||||
/*
|
||||
Compare strings byte by byte. End spaces are also compared.
|
||||
|
||||
SYNOPSIS
|
||||
stringcmp()
|
||||
s First string
|
||||
t Second string
|
||||
|
||||
NOTE:
|
||||
Strings are compared as a stream of unsigned chars
|
||||
|
||||
RETURN
|
||||
< 0 s < t
|
||||
0 s == t
|
||||
> 0 s > t
|
||||
*/
|
||||
|
||||
|
||||
int stringcmp(const String *s,const String *t)
|
||||
{
|
||||
const char *s= x->ptr();
|
||||
const char *t= y->ptr();
|
||||
uint32 x_len=x->length(),y_len=y->length(),len=min(x_len,y_len);
|
||||
|
||||
if (use_strnxfrm(x->str_charset))
|
||||
{
|
||||
#ifndef CMP_ENDSPACE
|
||||
while (x_len && my_isspace(x->str_charset,s[x_len-1]))
|
||||
x_len--;
|
||||
while (y_len && my_isspace(x->str_charset,t[y_len-1]))
|
||||
y_len--;
|
||||
#endif
|
||||
return my_strnncoll(x->str_charset,
|
||||
(unsigned char *)s,x_len,(unsigned char *)t,y_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
x_len-=len; // For easy end space test
|
||||
y_len-=len;
|
||||
if (x->str_charset->sort_order)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
if (x->str_charset->sort_order[(uchar) *s++] !=
|
||||
x->str_charset->sort_order[(uchar) *t++])
|
||||
return ((int) x->str_charset->sort_order[(uchar) s[-1]] -
|
||||
(int) x->str_charset->sort_order[(uchar) t[-1]]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
if (*s++ != *t++)
|
||||
return ((int) s[-1] - (int) t[-1]);
|
||||
}
|
||||
}
|
||||
#ifndef CMP_ENDSPACE
|
||||
/* Don't compare end space in strings */
|
||||
{
|
||||
if (y_len)
|
||||
{
|
||||
const char *end=t+y_len;
|
||||
for (; t != end ; t++)
|
||||
if (!my_isspace(x->str_charset,*t))
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *end=s+x_len;
|
||||
for (; s != end ; s++)
|
||||
if (!my_isspace(x->str_charset,*s))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
return (int) (x_len-y_len);
|
||||
#endif /* CMP_ENDSPACE */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int stringcmp(const String *x,const String *y)
|
||||
{
|
||||
const char *s= x->ptr();
|
||||
const char *t= y->ptr();
|
||||
uint32 x_len=x->length(),y_len=y->length(),len=min(x_len,y_len);
|
||||
|
||||
while (len--)
|
||||
{
|
||||
if (*s++ != *t++)
|
||||
return ((int) (uchar) s[-1] - (int) (uchar) t[-1]);
|
||||
}
|
||||
return (int) (x_len-y_len);
|
||||
uint32 s_len=s->length(),t_len=t->length(),len=min(s_len,t_len);
|
||||
int cmp= memcmp(s->ptr(), t->ptr(), len);
|
||||
return (cmp) ? cmp : (int) (s_len - t_len);
|
||||
}
|
||||
|
||||
|
||||
@ -668,4 +769,124 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length)
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
Help functions
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
copy a string from one character set to another
|
||||
|
||||
SYNOPSIS
|
||||
copy_and_convert()
|
||||
to Store result here
|
||||
to_cs Character set of result string
|
||||
from Copy from here
|
||||
from_length Length of from string
|
||||
from_cs From character set
|
||||
|
||||
NOTES
|
||||
'to' must be big enough as form_length * to_cs->mbmaxlen
|
||||
|
||||
RETURN
|
||||
length of bytes copied to 'to'
|
||||
*/
|
||||
|
||||
|
||||
uint32
|
||||
copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
|
||||
const char *from, uint32 from_length, CHARSET_INFO *from_cs,
|
||||
uint *errors)
|
||||
{
|
||||
int cnvres;
|
||||
my_wc_t wc;
|
||||
const uchar *from_end= (const uchar*) from+from_length;
|
||||
char *to_start= to;
|
||||
uchar *to_end= (uchar*) to+to_length;
|
||||
int (*mb_wc)(struct charset_info_st *, my_wc_t *, const uchar *,
|
||||
const uchar *) = from_cs->cset->mb_wc;
|
||||
int (*wc_mb)(struct charset_info_st *, my_wc_t, uchar *s, uchar *e)=
|
||||
to_cs->cset->wc_mb;
|
||||
uint error_count= 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if ((cnvres= (*mb_wc)(from_cs, &wc, (uchar*) from,
|
||||
from_end)) > 0)
|
||||
from+= cnvres;
|
||||
else if (cnvres == MY_CS_ILSEQ)
|
||||
{
|
||||
error_count++;
|
||||
from++;
|
||||
wc= '?';
|
||||
}
|
||||
else
|
||||
break; // Impossible char.
|
||||
|
||||
outp:
|
||||
if ((cnvres= (*wc_mb)(to_cs, wc, (uchar*) to, to_end)) > 0)
|
||||
to+= cnvres;
|
||||
else if (cnvres == MY_CS_ILUNI && wc != '?')
|
||||
{
|
||||
error_count++;
|
||||
wc= '?';
|
||||
goto outp;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
*errors= error_count;
|
||||
return (uint32) (to - to_start);
|
||||
}
|
||||
|
||||
|
||||
void String::print(String *str)
|
||||
{
|
||||
char *st= (char*)Ptr, *end= st+str_length;
|
||||
for (; st < end; st++)
|
||||
{
|
||||
uchar c= *st;
|
||||
switch (c)
|
||||
{
|
||||
case '\\':
|
||||
str->append("\\\\", 2);
|
||||
break;
|
||||
case '\0':
|
||||
str->append("\\0", 2);
|
||||
break;
|
||||
case '\'':
|
||||
str->append("\\'", 2);
|
||||
break;
|
||||
case '\n':
|
||||
str->append("\\n", 2);
|
||||
break;
|
||||
case '\r':
|
||||
str->append("\\r", 2);
|
||||
break;
|
||||
case 26: //Ctrl-Z
|
||||
str->append("\\z", 2);
|
||||
break;
|
||||
default:
|
||||
str->append(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Exchange state of this object and argument.
|
||||
|
||||
SYNOPSIS
|
||||
String::swap()
|
||||
|
||||
RETURN
|
||||
Target string will contain state of this object and vice versa.
|
||||
*/
|
||||
|
||||
void String::swap(String &s)
|
||||
{
|
||||
swap_variables(char *, Ptr, s.Ptr);
|
||||
swap_variables(uint32, str_length, s.str_length);
|
||||
swap_variables(uint32, Alloced_length, s.Alloced_length);
|
||||
swap_variables(bool, alloced, s.alloced);
|
||||
swap_variables(CHARSET_INFO*, str_charset, s.str_charset);
|
||||
}
|
||||
|
@ -25,9 +25,11 @@
|
||||
#endif
|
||||
|
||||
class String;
|
||||
int sortcmp(const String *a,const String *b);
|
||||
int stringcmp(const String *a,const String *b);
|
||||
int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
|
||||
String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
|
||||
uint32 copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
|
||||
const char *from, uint32 from_length,
|
||||
CHARSET_INFO *from_cs, uint *errors);
|
||||
|
||||
class String
|
||||
{
|
||||
@ -39,12 +41,12 @@ public:
|
||||
String()
|
||||
{
|
||||
Ptr=0; str_length=Alloced_length=0; alloced=0;
|
||||
str_charset= &my_charset_latin1;
|
||||
str_charset= &my_charset_bin;
|
||||
}
|
||||
String(uint32 length_arg)
|
||||
{
|
||||
alloced=0; Alloced_length=0; (void) real_alloc(length_arg);
|
||||
str_charset= &my_charset_latin1;
|
||||
str_charset= &my_charset_bin;
|
||||
}
|
||||
String(const char *str, CHARSET_INFO *cs)
|
||||
{
|
||||
@ -67,12 +69,15 @@ public:
|
||||
Alloced_length=str.Alloced_length; alloced=0;
|
||||
str_charset=str.str_charset;
|
||||
}
|
||||
static void *operator new(size_t size) { return (void*) sql_alloc((uint) size); }
|
||||
static void operator delete(void *ptr_arg,size_t size) /*lint -e715 */
|
||||
{ sql_element_free(ptr_arg); }
|
||||
static void *operator new(size_t size, MEM_ROOT *mem_root)
|
||||
{ return (void*) alloc_root(mem_root, (uint) size); }
|
||||
static void operator delete(void *ptr_arg,size_t size)
|
||||
{ TRASH(ptr_arg, size); }
|
||||
static void operator delete(void *ptr_arg, MEM_ROOT *mem_root)
|
||||
{ /* never called */ }
|
||||
~String() { free(); }
|
||||
|
||||
inline void set_charset(CHARSET_INFO *charset) { str_charset=charset; }
|
||||
inline void set_charset(CHARSET_INFO *charset) { str_charset= charset; }
|
||||
inline CHARSET_INFO *charset() const { return str_charset; }
|
||||
inline uint32 length() const { return str_length;}
|
||||
inline uint32 alloced_length() const { return Alloced_length;}
|
||||
@ -103,6 +108,7 @@ public:
|
||||
|
||||
void set(String &str,uint32 offset,uint32 arg_length)
|
||||
{
|
||||
DBUG_ASSERT(&str != this);
|
||||
free();
|
||||
Ptr=(char*) str.ptr()+offset; str_length=arg_length; alloced=0;
|
||||
if (str.Alloced_length)
|
||||
@ -123,6 +129,7 @@ public:
|
||||
Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0;
|
||||
str_charset=cs;
|
||||
}
|
||||
bool set_ascii(const char *str, uint32 arg_length);
|
||||
inline void set_quick(char *str,uint32 arg_length, CHARSET_INFO *cs)
|
||||
{
|
||||
if (!alloced)
|
||||
@ -134,6 +141,34 @@ public:
|
||||
bool set(longlong num, CHARSET_INFO *cs);
|
||||
bool set(ulonglong num, CHARSET_INFO *cs);
|
||||
bool set(double num,uint decimals, CHARSET_INFO *cs);
|
||||
|
||||
/*
|
||||
PMG 2004.11.12
|
||||
This is a method that works the same as perl's "chop". It simply
|
||||
drops the last character of a string. This is useful in the case
|
||||
of the federated storage handler where I'm building a unknown
|
||||
number, list of values and fields to be used in a sql insert
|
||||
statement to be run on the remote server, and have a comma after each.
|
||||
When the list is complete, I "chop" off the trailing comma
|
||||
|
||||
ex.
|
||||
String stringobj;
|
||||
stringobj.append("VALUES ('foo', 'fi', 'fo',");
|
||||
stringobj.chop();
|
||||
stringobj.append(")");
|
||||
|
||||
In this case, the value of string was:
|
||||
|
||||
VALUES ('foo', 'fi', 'fo',
|
||||
VALUES ('foo', 'fi', 'fo'
|
||||
VALUES ('foo', 'fi', 'fo')
|
||||
|
||||
*/
|
||||
inline void chop()
|
||||
{
|
||||
Ptr[str_length--]= '\0';
|
||||
}
|
||||
|
||||
inline void free()
|
||||
{
|
||||
if (alloced)
|
||||
@ -175,6 +210,11 @@ public:
|
||||
{
|
||||
if (&s != this)
|
||||
{
|
||||
/*
|
||||
It is forbidden to do assignments like
|
||||
some_string = substring_of_that_string
|
||||
*/
|
||||
DBUG_ASSERT(!s.uses_buffer_owned_by(this));
|
||||
free();
|
||||
Ptr=s.Ptr ; str_length=s.str_length ; Alloced_length=s.Alloced_length;
|
||||
alloced=0;
|
||||
@ -185,13 +225,24 @@ public:
|
||||
bool copy(); // Alloc string if not alloced
|
||||
bool copy(const String &s); // Allocate new string
|
||||
bool copy(const char *s,uint32 arg_length, CHARSET_INFO *cs); // Allocate new string
|
||||
bool copy(const char*s,uint32 arg_length, CHARSET_INFO *csfrom, CHARSET_INFO *csto);
|
||||
static bool needs_conversion(uint32 arg_length,
|
||||
CHARSET_INFO *cs_from, CHARSET_INFO *cs_to,
|
||||
uint32 *offset);
|
||||
bool copy_aligned(const char *s, uint32 arg_length, uint32 offset,
|
||||
CHARSET_INFO *cs);
|
||||
bool set_or_copy_aligned(const char *s, uint32 arg_length, CHARSET_INFO *cs);
|
||||
bool copy(const char*s,uint32 arg_length, CHARSET_INFO *csfrom,
|
||||
CHARSET_INFO *csto, uint *errors);
|
||||
bool append(const String &s);
|
||||
bool append(const char *s,uint32 arg_length=0);
|
||||
bool append(const char *s);
|
||||
bool append(const char *s,uint32 arg_length);
|
||||
bool append(const char *s,uint32 arg_length, CHARSET_INFO *cs);
|
||||
bool append(IO_CACHE* file, uint32 arg_length);
|
||||
bool append_with_prefill(const char *s, uint32 arg_length,
|
||||
uint32 full_length, char fill_char);
|
||||
int strstr(const String &search,uint32 offset=0); // Returns offset to substring or -1
|
||||
int strstr_case(const String &s,uint32 offset=0);
|
||||
int strrstr(const String &search,uint32 offset=0); // Returns offset to substring or -1
|
||||
bool replace(uint32 offset,uint32 arg_length,const char *to,uint32 length);
|
||||
bool replace(uint32 offset,uint32 arg_length,const String &to);
|
||||
inline bool append(char chr)
|
||||
{
|
||||
@ -211,7 +262,7 @@ public:
|
||||
void strip_sp();
|
||||
inline void caseup() { my_caseup(str_charset,Ptr,str_length); }
|
||||
inline void casedn() { my_casedn(str_charset,Ptr,str_length); }
|
||||
friend int sortcmp(const String *a,const String *b);
|
||||
friend int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
|
||||
friend int stringcmp(const String *a,const String *b);
|
||||
friend String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
|
||||
uint32 numchars();
|
||||
@ -228,11 +279,11 @@ public:
|
||||
q_*** methods writes values of parameters itself
|
||||
qs_*** methods writes string representation of value
|
||||
*/
|
||||
void q_append(const char &c)
|
||||
void q_append(const char c)
|
||||
{
|
||||
Ptr[str_length++] = c;
|
||||
}
|
||||
void q_append(const uint32 &n)
|
||||
void q_append(const uint32 n)
|
||||
{
|
||||
int4store(Ptr + str_length, n);
|
||||
str_length += 4;
|
||||
@ -253,13 +304,53 @@ public:
|
||||
str_length += data_len;
|
||||
}
|
||||
|
||||
void WriteAtPosition(int position, uint32 value)
|
||||
void write_at_position(int position, uint32 value)
|
||||
{
|
||||
int4store(Ptr + position,value);
|
||||
}
|
||||
|
||||
void qs_append(const char *str);
|
||||
void qs_append(const char *str, uint32 len);
|
||||
void qs_append(double d);
|
||||
void qs_append(double *d);
|
||||
void qs_append(const char &c);
|
||||
inline void qs_append(const char c)
|
||||
{
|
||||
Ptr[str_length]= c;
|
||||
str_length++;
|
||||
}
|
||||
void qs_append(int i);
|
||||
void qs_append(uint i);
|
||||
|
||||
/* Inline (general) functions used by the protocol functions */
|
||||
|
||||
inline char *prep_append(uint32 arg_length, uint32 step_alloc)
|
||||
{
|
||||
uint32 new_length= arg_length + str_length;
|
||||
if (new_length > Alloced_length)
|
||||
{
|
||||
if (realloc(new_length + step_alloc))
|
||||
return 0;
|
||||
}
|
||||
uint32 old_length= str_length;
|
||||
str_length+= arg_length;
|
||||
return Ptr+ old_length; /* Area to use */
|
||||
}
|
||||
|
||||
inline bool append(const char *s, uint32 arg_length, uint32 step_alloc)
|
||||
{
|
||||
uint32 new_length= arg_length + str_length;
|
||||
if (new_length > Alloced_length && realloc(new_length + step_alloc))
|
||||
return TRUE;
|
||||
memcpy(Ptr+str_length, s, arg_length);
|
||||
str_length+= arg_length;
|
||||
return FALSE;
|
||||
}
|
||||
void print(String *print);
|
||||
|
||||
/* Swap two string objects. Efficient way to exchange data without memcpy. */
|
||||
void swap(String &s);
|
||||
|
||||
inline bool uses_buffer_owned_by(const String *s) const
|
||||
{
|
||||
return (s->alloced && Ptr >= s->Ptr && Ptr < s->Ptr + s->str_length);
|
||||
}
|
||||
};
|
||||
|
@ -546,9 +546,7 @@ dtuple_convert_big_rec(
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_externally_stored
|
||||
&& dict_index_get_nth_type(index, i)->mtype
|
||||
== DATA_BLOB) {
|
||||
if (!is_externally_stored) {
|
||||
|
||||
dfield = dtuple_get_nth_field(entry, i);
|
||||
|
||||
|
@ -401,11 +401,20 @@ sym_tab_add_null_lit() */
|
||||
|
||||
struct dtype_struct{
|
||||
ulint mtype; /* main data type */
|
||||
ulint prtype; /* precise type; MySQL data type */
|
||||
ulint prtype; /* precise type; MySQL data type, charset code,
|
||||
flags to indicate nullability, signedness,
|
||||
whether this is a binary string, whether this
|
||||
is a true VARCHAR where MySQL uses 2 bytes to
|
||||
store the length */
|
||||
|
||||
/* the remaining fields do not affect alphabetical ordering: */
|
||||
|
||||
ulint len; /* length */
|
||||
ulint len; /* length; for MySQL data this is
|
||||
field->pack_length(), except that for a
|
||||
>= 5.0.3 type true VARCHAR this is the
|
||||
maximum byte length of the string data
|
||||
(in addition to the string, MySQL uses 1 or
|
||||
2 bytes to store the string length) */
|
||||
ulint prec; /* precision */
|
||||
|
||||
ulint mbminlen; /* minimum length of a character, in bytes */
|
||||
|
@ -2018,7 +2018,8 @@ Converts a key value stored in MySQL format to an Innobase dtuple. The last
|
||||
field of the key value may be just a prefix of a fixed length field: hence
|
||||
the parameter key_len. But currently we do not allow search keys where the
|
||||
last field is only a prefix of the full key field len and print a warning if
|
||||
such appears. */
|
||||
such appears. A counterpart of this function is
|
||||
ha_innobase::store_key_val_for_row() in ha_innodb.cc. */
|
||||
|
||||
void
|
||||
row_sel_convert_mysql_key_to_innobase(
|
||||
@ -2099,10 +2100,10 @@ row_sel_convert_mysql_key_to_innobase(
|
||||
type = dfield_get_type(dfield)->mtype;
|
||||
|
||||
/* Calculate data length and data field total length */
|
||||
|
||||
|
||||
if (type == DATA_BLOB) {
|
||||
/* The key field is a column prefix of a BLOB or
|
||||
TEXT type column */
|
||||
TEXT */
|
||||
|
||||
ut_a(field->prefix_len > 0);
|
||||
|
||||
@ -2118,9 +2119,10 @@ row_sel_convert_mysql_key_to_innobase(
|
||||
data_len = key_ptr[data_offset]
|
||||
+ 256 * key_ptr[data_offset + 1];
|
||||
data_field_len = data_offset + 2 + field->prefix_len;
|
||||
|
||||
data_offset += 2;
|
||||
|
||||
/* now that we know the length, we store the column
|
||||
/* Now that we know the length, we store the column
|
||||
value like it would be a fixed char field */
|
||||
|
||||
} else if (field->prefix_len > 0) {
|
||||
@ -2142,6 +2144,18 @@ row_sel_convert_mysql_key_to_innobase(
|
||||
data_field_len = data_offset + data_len;
|
||||
}
|
||||
|
||||
if (dtype_get_mysql_type(dfield_get_type(dfield))
|
||||
== DATA_MYSQL_TRUE_VARCHAR) {
|
||||
/* In a MySQL key value format, a true VARCHAR is
|
||||
always preceded by 2 bytes of a length field.
|
||||
dfield_get_type(dfield)->len returns the maximum
|
||||
'payload' len in bytes. That does not include the
|
||||
2 bytes that tell the actual data length. */
|
||||
|
||||
data_len += 2;
|
||||
data_field_len += 2;
|
||||
}
|
||||
|
||||
/* Storing may use at most data_len bytes of buf */
|
||||
|
||||
if (!is_null) {
|
||||
|
@ -226,16 +226,3 @@ create table t1 (v varchar(65530), key(v(10)));
|
||||
insert into t1 values(repeat('a',65530));
|
||||
select length(v) from t1 where v=repeat('a',65530);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Some errors/warnings on create
|
||||
#
|
||||
|
||||
create table t1 (v varchar(65530), key(v));
|
||||
drop table if exists t1;
|
||||
create table t1 (v varchar(65536));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 (v varchar(65530) character set utf8);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
@ -1541,12 +1541,14 @@ run_testcase ()
|
||||
disable_test $tname "$comment"
|
||||
return
|
||||
fi
|
||||
comment=`$GREP "^$tname *: *" $TESTDIR/disabled.def`;
|
||||
if [ -n "$comment" ]
|
||||
then
|
||||
comment=`echo $comment | sed 's/^[^:]*: *//'`
|
||||
disable_test $tname "$comment"
|
||||
return
|
||||
if [ -f "$TESTDIR/disabled.def" ] ; then
|
||||
comment=`$GREP "^$tname *: *" $TESTDIR/disabled.def`;
|
||||
if [ -n "$comment" ]
|
||||
then
|
||||
comment=`echo $comment | sed 's/^[^:]*: *//'`
|
||||
disable_test $tname "$comment"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "x$USE_EMBEDDED_SERVER" != "x1" ] ; then
|
||||
|
@ -8,128 +8,128 @@ commit;
|
||||
begin;
|
||||
insert t2 values (5);
|
||||
commit;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 194 use `test`; create table t1 (a int) engine=bdb
|
||||
master-bin.000001 194 Query 1 295 use `test`; create table t2 (a int) engine=innodb
|
||||
master-bin.000001 295 Query 1 364 use `test`; BEGIN
|
||||
master-bin.000001 364 Query 1 84 use `test`; insert t1 values (5)
|
||||
master-bin.000001 448 Query 1 518 use `test`; COMMIT
|
||||
master-bin.000001 518 Query 1 587 use `test`; BEGIN
|
||||
master-bin.000001 587 Query 1 84 use `test`; insert t2 values (5)
|
||||
master-bin.000001 671 Xid 1 698 COMMIT /* xid=11 */
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=bdb
|
||||
master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test`; insert t1 values (5)
|
||||
master-bin.000001 # Query 1 # use `test`; COMMIT
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test`; insert t2 values (5)
|
||||
master-bin.000001 # Xid 1 # COMMIT /* xid=11 */
|
||||
drop table t1,t2;
|
||||
reset master;
|
||||
create table t1 (n int) engine=innodb;
|
||||
begin;
|
||||
commit;
|
||||
drop table t1;
|
||||
show binlog events in 'master-bin.000001' from 96;
|
||||
show binlog events in 'master-bin.000001' from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 197 use `test`; create table t1 (n int) engine=innodb
|
||||
master-bin.000001 197 Query 1 266 use `test`; BEGIN
|
||||
master-bin.000001 266 Query 1 94 use `test`; insert into t1 values(100 + 4)
|
||||
master-bin.000001 360 Query 1 187 use `test`; insert into t1 values(99 + 4)
|
||||
master-bin.000001 453 Query 1 280 use `test`; insert into t1 values(98 + 4)
|
||||
master-bin.000001 546 Query 1 373 use `test`; insert into t1 values(97 + 4)
|
||||
master-bin.000001 639 Query 1 466 use `test`; insert into t1 values(96 + 4)
|
||||
master-bin.000001 732 Query 1 559 use `test`; insert into t1 values(95 + 4)
|
||||
master-bin.000001 825 Query 1 652 use `test`; insert into t1 values(94 + 4)
|
||||
master-bin.000001 918 Query 1 745 use `test`; insert into t1 values(93 + 4)
|
||||
master-bin.000001 1011 Query 1 838 use `test`; insert into t1 values(92 + 4)
|
||||
master-bin.000001 1104 Query 1 931 use `test`; insert into t1 values(91 + 4)
|
||||
master-bin.000001 1197 Query 1 1024 use `test`; insert into t1 values(90 + 4)
|
||||
master-bin.000001 1290 Query 1 1117 use `test`; insert into t1 values(89 + 4)
|
||||
master-bin.000001 1383 Query 1 1210 use `test`; insert into t1 values(88 + 4)
|
||||
master-bin.000001 1476 Query 1 1303 use `test`; insert into t1 values(87 + 4)
|
||||
master-bin.000001 1569 Query 1 1396 use `test`; insert into t1 values(86 + 4)
|
||||
master-bin.000001 1662 Query 1 1489 use `test`; insert into t1 values(85 + 4)
|
||||
master-bin.000001 1755 Query 1 1582 use `test`; insert into t1 values(84 + 4)
|
||||
master-bin.000001 1848 Query 1 1675 use `test`; insert into t1 values(83 + 4)
|
||||
master-bin.000001 1941 Query 1 1768 use `test`; insert into t1 values(82 + 4)
|
||||
master-bin.000001 2034 Query 1 1861 use `test`; insert into t1 values(81 + 4)
|
||||
master-bin.000001 2127 Query 1 1954 use `test`; insert into t1 values(80 + 4)
|
||||
master-bin.000001 2220 Query 1 2047 use `test`; insert into t1 values(79 + 4)
|
||||
master-bin.000001 2313 Query 1 2140 use `test`; insert into t1 values(78 + 4)
|
||||
master-bin.000001 2406 Query 1 2233 use `test`; insert into t1 values(77 + 4)
|
||||
master-bin.000001 2499 Query 1 2326 use `test`; insert into t1 values(76 + 4)
|
||||
master-bin.000001 2592 Query 1 2419 use `test`; insert into t1 values(75 + 4)
|
||||
master-bin.000001 2685 Query 1 2512 use `test`; insert into t1 values(74 + 4)
|
||||
master-bin.000001 2778 Query 1 2605 use `test`; insert into t1 values(73 + 4)
|
||||
master-bin.000001 2871 Query 1 2698 use `test`; insert into t1 values(72 + 4)
|
||||
master-bin.000001 2964 Query 1 2791 use `test`; insert into t1 values(71 + 4)
|
||||
master-bin.000001 3057 Query 1 2884 use `test`; insert into t1 values(70 + 4)
|
||||
master-bin.000001 3150 Query 1 2977 use `test`; insert into t1 values(69 + 4)
|
||||
master-bin.000001 3243 Query 1 3070 use `test`; insert into t1 values(68 + 4)
|
||||
master-bin.000001 3336 Query 1 3163 use `test`; insert into t1 values(67 + 4)
|
||||
master-bin.000001 3429 Query 1 3256 use `test`; insert into t1 values(66 + 4)
|
||||
master-bin.000001 3522 Query 1 3349 use `test`; insert into t1 values(65 + 4)
|
||||
master-bin.000001 3615 Query 1 3442 use `test`; insert into t1 values(64 + 4)
|
||||
master-bin.000001 3708 Query 1 3535 use `test`; insert into t1 values(63 + 4)
|
||||
master-bin.000001 3801 Query 1 3628 use `test`; insert into t1 values(62 + 4)
|
||||
master-bin.000001 3894 Query 1 3721 use `test`; insert into t1 values(61 + 4)
|
||||
master-bin.000001 3987 Query 1 3814 use `test`; insert into t1 values(60 + 4)
|
||||
master-bin.000001 4080 Query 1 3907 use `test`; insert into t1 values(59 + 4)
|
||||
master-bin.000001 4173 Query 1 4000 use `test`; insert into t1 values(58 + 4)
|
||||
master-bin.000001 4266 Query 1 4093 use `test`; insert into t1 values(57 + 4)
|
||||
master-bin.000001 4359 Query 1 4186 use `test`; insert into t1 values(56 + 4)
|
||||
master-bin.000001 4452 Query 1 4279 use `test`; insert into t1 values(55 + 4)
|
||||
master-bin.000001 4545 Query 1 4372 use `test`; insert into t1 values(54 + 4)
|
||||
master-bin.000001 4638 Query 1 4465 use `test`; insert into t1 values(53 + 4)
|
||||
master-bin.000001 4731 Query 1 4558 use `test`; insert into t1 values(52 + 4)
|
||||
master-bin.000001 4824 Query 1 4651 use `test`; insert into t1 values(51 + 4)
|
||||
master-bin.000001 4917 Query 1 4744 use `test`; insert into t1 values(50 + 4)
|
||||
master-bin.000001 5010 Query 1 4837 use `test`; insert into t1 values(49 + 4)
|
||||
master-bin.000001 5103 Query 1 4930 use `test`; insert into t1 values(48 + 4)
|
||||
master-bin.000001 5196 Query 1 5023 use `test`; insert into t1 values(47 + 4)
|
||||
master-bin.000001 5289 Query 1 5116 use `test`; insert into t1 values(46 + 4)
|
||||
master-bin.000001 5382 Query 1 5209 use `test`; insert into t1 values(45 + 4)
|
||||
master-bin.000001 5475 Query 1 5302 use `test`; insert into t1 values(44 + 4)
|
||||
master-bin.000001 5568 Query 1 5395 use `test`; insert into t1 values(43 + 4)
|
||||
master-bin.000001 5661 Query 1 5488 use `test`; insert into t1 values(42 + 4)
|
||||
master-bin.000001 5754 Query 1 5581 use `test`; insert into t1 values(41 + 4)
|
||||
master-bin.000001 5847 Query 1 5674 use `test`; insert into t1 values(40 + 4)
|
||||
master-bin.000001 5940 Query 1 5767 use `test`; insert into t1 values(39 + 4)
|
||||
master-bin.000001 6033 Query 1 5860 use `test`; insert into t1 values(38 + 4)
|
||||
master-bin.000001 6126 Query 1 5953 use `test`; insert into t1 values(37 + 4)
|
||||
master-bin.000001 6219 Query 1 6046 use `test`; insert into t1 values(36 + 4)
|
||||
master-bin.000001 6312 Query 1 6139 use `test`; insert into t1 values(35 + 4)
|
||||
master-bin.000001 6405 Query 1 6232 use `test`; insert into t1 values(34 + 4)
|
||||
master-bin.000001 6498 Query 1 6325 use `test`; insert into t1 values(33 + 4)
|
||||
master-bin.000001 6591 Query 1 6418 use `test`; insert into t1 values(32 + 4)
|
||||
master-bin.000001 6684 Query 1 6511 use `test`; insert into t1 values(31 + 4)
|
||||
master-bin.000001 6777 Query 1 6604 use `test`; insert into t1 values(30 + 4)
|
||||
master-bin.000001 6870 Query 1 6697 use `test`; insert into t1 values(29 + 4)
|
||||
master-bin.000001 6963 Query 1 6790 use `test`; insert into t1 values(28 + 4)
|
||||
master-bin.000001 7056 Query 1 6883 use `test`; insert into t1 values(27 + 4)
|
||||
master-bin.000001 7149 Query 1 6976 use `test`; insert into t1 values(26 + 4)
|
||||
master-bin.000001 7242 Query 1 7069 use `test`; insert into t1 values(25 + 4)
|
||||
master-bin.000001 7335 Query 1 7162 use `test`; insert into t1 values(24 + 4)
|
||||
master-bin.000001 7428 Query 1 7255 use `test`; insert into t1 values(23 + 4)
|
||||
master-bin.000001 7521 Query 1 7348 use `test`; insert into t1 values(22 + 4)
|
||||
master-bin.000001 7614 Query 1 7441 use `test`; insert into t1 values(21 + 4)
|
||||
master-bin.000001 7707 Query 1 7534 use `test`; insert into t1 values(20 + 4)
|
||||
master-bin.000001 7800 Query 1 7627 use `test`; insert into t1 values(19 + 4)
|
||||
master-bin.000001 7893 Query 1 7720 use `test`; insert into t1 values(18 + 4)
|
||||
master-bin.000001 7986 Query 1 7813 use `test`; insert into t1 values(17 + 4)
|
||||
master-bin.000001 8079 Query 1 7906 use `test`; insert into t1 values(16 + 4)
|
||||
master-bin.000001 8172 Query 1 7999 use `test`; insert into t1 values(15 + 4)
|
||||
master-bin.000001 8265 Query 1 8092 use `test`; insert into t1 values(14 + 4)
|
||||
master-bin.000001 8358 Query 1 8185 use `test`; insert into t1 values(13 + 4)
|
||||
master-bin.000001 8451 Query 1 8278 use `test`; insert into t1 values(12 + 4)
|
||||
master-bin.000001 8544 Query 1 8371 use `test`; insert into t1 values(11 + 4)
|
||||
master-bin.000001 8637 Query 1 8464 use `test`; insert into t1 values(10 + 4)
|
||||
master-bin.000001 8730 Query 1 8556 use `test`; insert into t1 values(9 + 4)
|
||||
master-bin.000001 8822 Query 1 8648 use `test`; insert into t1 values(8 + 4)
|
||||
master-bin.000001 8914 Query 1 8740 use `test`; insert into t1 values(7 + 4)
|
||||
master-bin.000001 9006 Query 1 8832 use `test`; insert into t1 values(6 + 4)
|
||||
master-bin.000001 9098 Query 1 8924 use `test`; insert into t1 values(5 + 4)
|
||||
master-bin.000001 9190 Query 1 9016 use `test`; insert into t1 values(4 + 4)
|
||||
master-bin.000001 9282 Query 1 9108 use `test`; insert into t1 values(3 + 4)
|
||||
master-bin.000001 9374 Query 1 9200 use `test`; insert into t1 values(2 + 4)
|
||||
master-bin.000001 9466 Query 1 9292 use `test`; insert into t1 values(1 + 4)
|
||||
master-bin.000001 9558 Xid 1 9585 COMMIT /* xid=18 */
|
||||
master-bin.000001 9585 Rotate 1 9629 master-bin.000002;pos=4
|
||||
show binlog events in 'master-bin.000002' from 96;
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(100 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(99 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(98 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(97 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(96 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(95 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(94 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(93 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(92 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(91 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(90 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(89 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(88 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(87 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(86 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(85 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(84 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(83 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(82 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(81 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(80 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(79 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(78 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(77 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(76 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(75 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(74 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(73 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(72 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(71 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(70 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(69 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(68 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(67 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(66 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(65 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(64 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(63 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(62 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(61 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(60 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(59 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(58 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(57 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(56 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(55 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(54 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(53 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(52 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(51 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(50 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(49 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(48 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(47 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(46 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(45 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(44 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(43 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(42 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(41 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(40 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(39 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(38 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(37 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(36 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(35 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(34 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(33 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(32 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(31 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(30 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(29 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(28 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(27 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(26 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(25 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(24 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(23 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(22 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(21 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(20 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(19 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(18 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(17 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(16 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(15 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(14 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(13 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(12 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(11 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(10 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(9 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(8 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(7 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(6 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(5 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(4 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(3 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(2 + 4)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values(1 + 4)
|
||||
master-bin.000001 # Xid 1 # COMMIT /* xid=18 */
|
||||
master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
|
||||
show binlog events in 'master-bin.000002' from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000002 96 Query 1 173 use `test`; drop table t1
|
||||
master-bin.000002 # Query 1 # use `test`; drop table t1
|
||||
|
@ -523,10 +523,10 @@ create table t2 (c char(30)) charset=ucs2;
|
||||
set @v=convert('abc' using ucs2);
|
||||
reset master;
|
||||
insert into t2 values (@v);
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 User var 1 136 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
|
||||
master-bin.000001 136 Query 1 226 use `test`; insert into t2 values (@v)
|
||||
master-bin.000001 # User var 1 # @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t2 values (@v)
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
ROLLBACK;
|
||||
|
@ -178,7 +178,7 @@ teststring
|
||||
teststring
|
||||
explain select * from t1 order by text1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL key1 32 NULL 3 Using index
|
||||
1 SIMPLE t1 index NULL key1 34 NULL 3 Using index
|
||||
alter table t1 modify text1 char(32) binary not null;
|
||||
select * from t1 order by text1;
|
||||
text1
|
||||
|
@ -20,16 +20,14 @@ CREATE TABLE federated.t1 (
|
||||
)
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:@/too/many/items/federated/t1';
|
||||
ERROR HY000: Can't create table 'this connection string is not in the correct format!
|
||||
' (errno: 0)
|
||||
ERROR HY000: Can't create table 'connection string is not in the correct format' (errno: 0)
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(32) NOT NULL default ''
|
||||
)
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1';
|
||||
ERROR HY000: Can't create table 'this connection string is not in the correct format!
|
||||
' (errno: 0)
|
||||
ERROR HY000: Can't create table 'connection string is not in the correct format' (errno: 0)
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(32) NOT NULL default ''
|
||||
@ -645,7 +643,7 @@ int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
|
||||
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
|
||||
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
|
||||
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
|
||||
int, i999 int, i1000 int, b blob) row_format=dynamic;
|
||||
int, i999 int, i1000 int, b varchar(256)) row_format=dynamic;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1
|
||||
(i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
||||
@ -772,7 +770,7 @@ int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
|
||||
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
|
||||
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
|
||||
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
|
||||
int, i999 int, i1000 int, b blob)
|
||||
int, i999 int, i1000 int, b varchar(256))
|
||||
row_format=dynamic
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
@ -821,15 +819,15 @@ UPDATE federated.t1 SET b=repeat('a',256);
|
||||
UPDATE federated.t1 SET i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0, i10=0;
|
||||
SELECT * FROM federated.t1 WHERE i9=0 and i10=0;
|
||||
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63 i64 i65 i66 i67 i68 i69 i70 i71 i72 i73 i74 i75 i76 i77 i78 i79 i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i90 i91 i92 i93 i94 i95 i96 i97 i98 i99 i100 i101 i102 i103 i104 i105 i106 i107 i108 i109 i110 i111 i112 i113 i114 i115 i116 i117 i118 i119 i120 i121 i122 i123 i124 i125 i126 i127 i128 i129 i130 i131 i132 i133 i134 i135 i136 i137 i138 i139 i140 i141 i142 i143 i144 i145 i146 i147 i148 i149 i150 i151 i152 i153 i154 i155 i156 i157 i158 i159 i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i170 i171 i172 i173 i174 i175 i176 i177 i178 i179 i180 i181 i182 i183 i184 i185 i186 i187 i188 i189 i190 i191 i192 i193 i194 i195 i196 i197 i198 i199 i200 i201 i202 i203 i204 i205 i206 i207 i208 i209 i210 i211 i212 i213 i214 i215 i216 i217 i218 i219 i220 i221 i222 i223 i224 i225 i226 i227 i228 i229 i230 i231 i232 i233 i234 i235 i236 i237 i238 i239 i240 i241 i242 i243 i244 i245 i246 i247 i248 i249 i250 i251 i252 i253 i254 i255 i256 i257 i258 i259 i260 i261 i262 i263 i264 i265 i266 i267 i268 i269 i270 i271 i272 i273 i274 i275 i276 i277 i278 i279 i280 i281 i282 i283 i284 i285 i286 i287 i288 i289 i290 i291 i292 i293 i294 i295 i296 i297 i298 i299 i300 i301 i302 i303 i304 i305 i306 i307 i308 i309 i310 i311 i312 i313 i314 i315 i316 i317 i318 i319 i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i330 i331 i332 i333 i334 i335 i336 i337 i338 i339 i340 i341 i342 i343 i344 i345 i346 i347 i348 i349 i350 i351 i352 i353 i354 i355 i356 i357 i358 i359 i360 i361 i362 i363 i364 i365 i366 i367 i368 i369 i370 i371 i372 i373 i374 i375 i376 i377 i378 i379 i380 i381 i382 i383 i384 i385 i386 i387 i388 i389 i390 i391 i392 i393 i394 i395 i396 i397 i398 i399 i400 i401 i402 i403 i404 i405 i406 i407 i408 i409 i410 i411 i412 i413 i414 i415 i416 i417 i418 i419 i420 i421 i422 i423 i424 i425 i426 i427 i428 i429 i430 i431 i432 i433 i434 i435 i436 i437 i438 i439 i440 i441 i442 i443 i444 i445 i446 i447 i448 i449 i450 i451 i452 i453 i454 i455 i456 i457 i458 i459 i460 i461 i462 i463 i464 i465 i466 i467 i468 i469 i470 i471 i472 i473 i474 i475 i476 i477 i478 i479 i480 i481 i482 i483 i484 i485 i486 i487 i488 i489 i490 i491 i492 i493 i494 i495 i496 i497 i498 i499 i500 i501 i502 i503 i504 i505 i506 i507 i508 i509 i510 i511 i512 i513 i514 i515 i516 i517 i518 i519 i520 i521 i522 i523 i524 i525 i526 i527 i528 i529 i530 i531 i532 i533 i534 i535 i536 i537 i538 i539 i540 i541 i542 i543 i544 i545 i546 i547 i548 i549 i550 i551 i552 i553 i554 i555 i556 i557 i558 i559 i560 i561 i562 i563 i564 i565 i566 i567 i568 i569 i570 i571 i572 i573 i574 i575 i576 i577 i578 i579 i580 i581 i582 i583 i584 i585 i586 i587 i588 i589 i590 i591 i592 i593 i594 i595 i596 i597 i598 i599 i600 i601 i602 i603 i604 i605 i606 i607 i608 i609 i610 i611 i612 i613 i614 i615 i616 i617 i618 i619 i620 i621 i622 i623 i624 i625 i626 i627 i628 i629 i630 i631 i632 i633 i634 i635 i636 i637 i638 i639 i640 i641 i642 i643 i644 i645 i646 i647 i648 i649 i650 i651 i652 i653 i654 i655 i656 i657 i658 i659 i660 i661 i662 i663 i664 i665 i666 i667 i668 i669 i670 i671 i672 i673 i674 i675 i676 i677 i678 i679 i680 i681 i682 i683 i684 i685 i686 i687 i688 i689 i690 i691 i692 i693 i694 i695 i696 i697 i698 i699 i700 i701 i702 i703 i704 i705 i706 i707 i708 i709 i710 i711 i712 i713 i714 i715 i716 i717 i718 i719 i720 i721 i722 i723 i724 i725 i726 i727 i728 i729 i730 i731 i732 i733 i734 i735 i736 i737 i738 i739 i740 i741 i742 i743 i744 i745 i746 i747 i748 i749 i750 i751 i752 i753 i754 i755 i756 i757 i758 i759 i760 i761 i762 i763 i764 i765 i766 i767 i768 i769 i770 i771 i772 i773 i774 i775 i776 i777 i778 i779 i780 i781 i782 i783 i784 i785 i786 i787 i788 i789 i790 i791 i792 i793 i794 i795 i796 i797 i798 i799 i800 i801 i802 i803 i804 i805 i806 i807 i808 i809 i810 i811 i812 i813 i814 i815 i816 i817 i818 i819 i820 i821 i822 i823 i824 i825 i826 i827 i828 i829 i830 i831 i832 i833 i834 i835 i836 i837 i838 i839 i840 i841 i842 i843 i844 i845 i846 i847 i848 i849 i850 i851 i852 i853 i854 i855 i856 i857 i858 i859 i860 i861 i862 i863 i864 i865 i866 i867 i868 i869 i870 i871 i872 i873 i874 i875 i876 i877 i878 i879 i880 i881 i882 i883 i884 i885 i886 i887 i888 i889 i890 i891 i892 i893 i894 i895 i896 i897 i898 i899 i900 i901 i902 i903 i904 i905 i906 i907 i908 i909 i910 i911 i912 i913 i914 i915 i916 i917 i918 i919 i920 i921 i922 i923 i924 i925 i926 i927 i928 i929 i930 i931 i932 i933 i934 i935 i936 i937 i938 i939 i940 i941 i942 i943 i944 i945 i946 i947 i948 i949 i950 i951 i952 i953 i954 i955 i956 i957 i958 i959 i960 i961 i962 i963 i964 i965 i966 i967 i968 i969 i970 i971 i972 i973 i974 i975 i976 i977 i978 i979 i980 i981 i982 i983 i984 i985 i986 i987 i988 i989 i990 i991 i992 i993 i994 i995 i996 i997 i998 i999 i1000 b
|
||||
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 PatrickG
|
||||
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
UPDATE federated.t1 SET i50=20;
|
||||
SELECT * FROM federated.t1;
|
||||
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63 i64 i65 i66 i67 i68 i69 i70 i71 i72 i73 i74 i75 i76 i77 i78 i79 i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i90 i91 i92 i93 i94 i95 i96 i97 i98 i99 i100 i101 i102 i103 i104 i105 i106 i107 i108 i109 i110 i111 i112 i113 i114 i115 i116 i117 i118 i119 i120 i121 i122 i123 i124 i125 i126 i127 i128 i129 i130 i131 i132 i133 i134 i135 i136 i137 i138 i139 i140 i141 i142 i143 i144 i145 i146 i147 i148 i149 i150 i151 i152 i153 i154 i155 i156 i157 i158 i159 i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i170 i171 i172 i173 i174 i175 i176 i177 i178 i179 i180 i181 i182 i183 i184 i185 i186 i187 i188 i189 i190 i191 i192 i193 i194 i195 i196 i197 i198 i199 i200 i201 i202 i203 i204 i205 i206 i207 i208 i209 i210 i211 i212 i213 i214 i215 i216 i217 i218 i219 i220 i221 i222 i223 i224 i225 i226 i227 i228 i229 i230 i231 i232 i233 i234 i235 i236 i237 i238 i239 i240 i241 i242 i243 i244 i245 i246 i247 i248 i249 i250 i251 i252 i253 i254 i255 i256 i257 i258 i259 i260 i261 i262 i263 i264 i265 i266 i267 i268 i269 i270 i271 i272 i273 i274 i275 i276 i277 i278 i279 i280 i281 i282 i283 i284 i285 i286 i287 i288 i289 i290 i291 i292 i293 i294 i295 i296 i297 i298 i299 i300 i301 i302 i303 i304 i305 i306 i307 i308 i309 i310 i311 i312 i313 i314 i315 i316 i317 i318 i319 i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i330 i331 i332 i333 i334 i335 i336 i337 i338 i339 i340 i341 i342 i343 i344 i345 i346 i347 i348 i349 i350 i351 i352 i353 i354 i355 i356 i357 i358 i359 i360 i361 i362 i363 i364 i365 i366 i367 i368 i369 i370 i371 i372 i373 i374 i375 i376 i377 i378 i379 i380 i381 i382 i383 i384 i385 i386 i387 i388 i389 i390 i391 i392 i393 i394 i395 i396 i397 i398 i399 i400 i401 i402 i403 i404 i405 i406 i407 i408 i409 i410 i411 i412 i413 i414 i415 i416 i417 i418 i419 i420 i421 i422 i423 i424 i425 i426 i427 i428 i429 i430 i431 i432 i433 i434 i435 i436 i437 i438 i439 i440 i441 i442 i443 i444 i445 i446 i447 i448 i449 i450 i451 i452 i453 i454 i455 i456 i457 i458 i459 i460 i461 i462 i463 i464 i465 i466 i467 i468 i469 i470 i471 i472 i473 i474 i475 i476 i477 i478 i479 i480 i481 i482 i483 i484 i485 i486 i487 i488 i489 i490 i491 i492 i493 i494 i495 i496 i497 i498 i499 i500 i501 i502 i503 i504 i505 i506 i507 i508 i509 i510 i511 i512 i513 i514 i515 i516 i517 i518 i519 i520 i521 i522 i523 i524 i525 i526 i527 i528 i529 i530 i531 i532 i533 i534 i535 i536 i537 i538 i539 i540 i541 i542 i543 i544 i545 i546 i547 i548 i549 i550 i551 i552 i553 i554 i555 i556 i557 i558 i559 i560 i561 i562 i563 i564 i565 i566 i567 i568 i569 i570 i571 i572 i573 i574 i575 i576 i577 i578 i579 i580 i581 i582 i583 i584 i585 i586 i587 i588 i589 i590 i591 i592 i593 i594 i595 i596 i597 i598 i599 i600 i601 i602 i603 i604 i605 i606 i607 i608 i609 i610 i611 i612 i613 i614 i615 i616 i617 i618 i619 i620 i621 i622 i623 i624 i625 i626 i627 i628 i629 i630 i631 i632 i633 i634 i635 i636 i637 i638 i639 i640 i641 i642 i643 i644 i645 i646 i647 i648 i649 i650 i651 i652 i653 i654 i655 i656 i657 i658 i659 i660 i661 i662 i663 i664 i665 i666 i667 i668 i669 i670 i671 i672 i673 i674 i675 i676 i677 i678 i679 i680 i681 i682 i683 i684 i685 i686 i687 i688 i689 i690 i691 i692 i693 i694 i695 i696 i697 i698 i699 i700 i701 i702 i703 i704 i705 i706 i707 i708 i709 i710 i711 i712 i713 i714 i715 i716 i717 i718 i719 i720 i721 i722 i723 i724 i725 i726 i727 i728 i729 i730 i731 i732 i733 i734 i735 i736 i737 i738 i739 i740 i741 i742 i743 i744 i745 i746 i747 i748 i749 i750 i751 i752 i753 i754 i755 i756 i757 i758 i759 i760 i761 i762 i763 i764 i765 i766 i767 i768 i769 i770 i771 i772 i773 i774 i775 i776 i777 i778 i779 i780 i781 i782 i783 i784 i785 i786 i787 i788 i789 i790 i791 i792 i793 i794 i795 i796 i797 i798 i799 i800 i801 i802 i803 i804 i805 i806 i807 i808 i809 i810 i811 i812 i813 i814 i815 i816 i817 i818 i819 i820 i821 i822 i823 i824 i825 i826 i827 i828 i829 i830 i831 i832 i833 i834 i835 i836 i837 i838 i839 i840 i841 i842 i843 i844 i845 i846 i847 i848 i849 i850 i851 i852 i853 i854 i855 i856 i857 i858 i859 i860 i861 i862 i863 i864 i865 i866 i867 i868 i869 i870 i871 i872 i873 i874 i875 i876 i877 i878 i879 i880 i881 i882 i883 i884 i885 i886 i887 i888 i889 i890 i891 i892 i893 i894 i895 i896 i897 i898 i899 i900 i901 i902 i903 i904 i905 i906 i907 i908 i909 i910 i911 i912 i913 i914 i915 i916 i917 i918 i919 i920 i921 i922 i923 i924 i925 i926 i927 i928 i929 i930 i931 i932 i933 i934 i935 i936 i937 i938 i939 i940 i941 i942 i943 i944 i945 i946 i947 i948 i949 i950 i951 i952 i953 i954 i955 i956 i957 i958 i959 i960 i961 i962 i963 i964 i965 i966 i967 i968 i969 i970 i971 i972 i973 i974 i975 i976 i977 i978 i979 i980 i981 i982 i983 i984 i985 i986 i987 i988 i989 i990 i991 i992 i993 i994 i995 i996 i997 i998 i999 i1000 b
|
||||
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 PatrickG
|
||||
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
DELETE FROM federated.t1 WHERE i51=20;
|
||||
SELECT * FROM federated.t1;
|
||||
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63 i64 i65 i66 i67 i68 i69 i70 i71 i72 i73 i74 i75 i76 i77 i78 i79 i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i90 i91 i92 i93 i94 i95 i96 i97 i98 i99 i100 i101 i102 i103 i104 i105 i106 i107 i108 i109 i110 i111 i112 i113 i114 i115 i116 i117 i118 i119 i120 i121 i122 i123 i124 i125 i126 i127 i128 i129 i130 i131 i132 i133 i134 i135 i136 i137 i138 i139 i140 i141 i142 i143 i144 i145 i146 i147 i148 i149 i150 i151 i152 i153 i154 i155 i156 i157 i158 i159 i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i170 i171 i172 i173 i174 i175 i176 i177 i178 i179 i180 i181 i182 i183 i184 i185 i186 i187 i188 i189 i190 i191 i192 i193 i194 i195 i196 i197 i198 i199 i200 i201 i202 i203 i204 i205 i206 i207 i208 i209 i210 i211 i212 i213 i214 i215 i216 i217 i218 i219 i220 i221 i222 i223 i224 i225 i226 i227 i228 i229 i230 i231 i232 i233 i234 i235 i236 i237 i238 i239 i240 i241 i242 i243 i244 i245 i246 i247 i248 i249 i250 i251 i252 i253 i254 i255 i256 i257 i258 i259 i260 i261 i262 i263 i264 i265 i266 i267 i268 i269 i270 i271 i272 i273 i274 i275 i276 i277 i278 i279 i280 i281 i282 i283 i284 i285 i286 i287 i288 i289 i290 i291 i292 i293 i294 i295 i296 i297 i298 i299 i300 i301 i302 i303 i304 i305 i306 i307 i308 i309 i310 i311 i312 i313 i314 i315 i316 i317 i318 i319 i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i330 i331 i332 i333 i334 i335 i336 i337 i338 i339 i340 i341 i342 i343 i344 i345 i346 i347 i348 i349 i350 i351 i352 i353 i354 i355 i356 i357 i358 i359 i360 i361 i362 i363 i364 i365 i366 i367 i368 i369 i370 i371 i372 i373 i374 i375 i376 i377 i378 i379 i380 i381 i382 i383 i384 i385 i386 i387 i388 i389 i390 i391 i392 i393 i394 i395 i396 i397 i398 i399 i400 i401 i402 i403 i404 i405 i406 i407 i408 i409 i410 i411 i412 i413 i414 i415 i416 i417 i418 i419 i420 i421 i422 i423 i424 i425 i426 i427 i428 i429 i430 i431 i432 i433 i434 i435 i436 i437 i438 i439 i440 i441 i442 i443 i444 i445 i446 i447 i448 i449 i450 i451 i452 i453 i454 i455 i456 i457 i458 i459 i460 i461 i462 i463 i464 i465 i466 i467 i468 i469 i470 i471 i472 i473 i474 i475 i476 i477 i478 i479 i480 i481 i482 i483 i484 i485 i486 i487 i488 i489 i490 i491 i492 i493 i494 i495 i496 i497 i498 i499 i500 i501 i502 i503 i504 i505 i506 i507 i508 i509 i510 i511 i512 i513 i514 i515 i516 i517 i518 i519 i520 i521 i522 i523 i524 i525 i526 i527 i528 i529 i530 i531 i532 i533 i534 i535 i536 i537 i538 i539 i540 i541 i542 i543 i544 i545 i546 i547 i548 i549 i550 i551 i552 i553 i554 i555 i556 i557 i558 i559 i560 i561 i562 i563 i564 i565 i566 i567 i568 i569 i570 i571 i572 i573 i574 i575 i576 i577 i578 i579 i580 i581 i582 i583 i584 i585 i586 i587 i588 i589 i590 i591 i592 i593 i594 i595 i596 i597 i598 i599 i600 i601 i602 i603 i604 i605 i606 i607 i608 i609 i610 i611 i612 i613 i614 i615 i616 i617 i618 i619 i620 i621 i622 i623 i624 i625 i626 i627 i628 i629 i630 i631 i632 i633 i634 i635 i636 i637 i638 i639 i640 i641 i642 i643 i644 i645 i646 i647 i648 i649 i650 i651 i652 i653 i654 i655 i656 i657 i658 i659 i660 i661 i662 i663 i664 i665 i666 i667 i668 i669 i670 i671 i672 i673 i674 i675 i676 i677 i678 i679 i680 i681 i682 i683 i684 i685 i686 i687 i688 i689 i690 i691 i692 i693 i694 i695 i696 i697 i698 i699 i700 i701 i702 i703 i704 i705 i706 i707 i708 i709 i710 i711 i712 i713 i714 i715 i716 i717 i718 i719 i720 i721 i722 i723 i724 i725 i726 i727 i728 i729 i730 i731 i732 i733 i734 i735 i736 i737 i738 i739 i740 i741 i742 i743 i744 i745 i746 i747 i748 i749 i750 i751 i752 i753 i754 i755 i756 i757 i758 i759 i760 i761 i762 i763 i764 i765 i766 i767 i768 i769 i770 i771 i772 i773 i774 i775 i776 i777 i778 i779 i780 i781 i782 i783 i784 i785 i786 i787 i788 i789 i790 i791 i792 i793 i794 i795 i796 i797 i798 i799 i800 i801 i802 i803 i804 i805 i806 i807 i808 i809 i810 i811 i812 i813 i814 i815 i816 i817 i818 i819 i820 i821 i822 i823 i824 i825 i826 i827 i828 i829 i830 i831 i832 i833 i834 i835 i836 i837 i838 i839 i840 i841 i842 i843 i844 i845 i846 i847 i848 i849 i850 i851 i852 i853 i854 i855 i856 i857 i858 i859 i860 i861 i862 i863 i864 i865 i866 i867 i868 i869 i870 i871 i872 i873 i874 i875 i876 i877 i878 i879 i880 i881 i882 i883 i884 i885 i886 i887 i888 i889 i890 i891 i892 i893 i894 i895 i896 i897 i898 i899 i900 i901 i902 i903 i904 i905 i906 i907 i908 i909 i910 i911 i912 i913 i914 i915 i916 i917 i918 i919 i920 i921 i922 i923 i924 i925 i926 i927 i928 i929 i930 i931 i932 i933 i934 i935 i936 i937 i938 i939 i940 i941 i942 i943 i944 i945 i946 i947 i948 i949 i950 i951 i952 i953 i954 i955 i956 i957 i958 i959 i960 i961 i962 i963 i964 i965 i966 i967 i968 i969 i970 i971 i972 i973 i974 i975 i976 i977 i978 i979 i980 i981 i982 i983 i984 i985 i986 i987 i988 i989 i990 i991 i992 i993 i994 i995 i996 i997 i998 i999 i1000 b
|
||||
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 PatrickG
|
||||
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
DELETE FROM federated.t1 WHERE i50=20;
|
||||
SELECT * FROM federated.t1;
|
||||
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63 i64 i65 i66 i67 i68 i69 i70 i71 i72 i73 i74 i75 i76 i77 i78 i79 i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i90 i91 i92 i93 i94 i95 i96 i97 i98 i99 i100 i101 i102 i103 i104 i105 i106 i107 i108 i109 i110 i111 i112 i113 i114 i115 i116 i117 i118 i119 i120 i121 i122 i123 i124 i125 i126 i127 i128 i129 i130 i131 i132 i133 i134 i135 i136 i137 i138 i139 i140 i141 i142 i143 i144 i145 i146 i147 i148 i149 i150 i151 i152 i153 i154 i155 i156 i157 i158 i159 i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i170 i171 i172 i173 i174 i175 i176 i177 i178 i179 i180 i181 i182 i183 i184 i185 i186 i187 i188 i189 i190 i191 i192 i193 i194 i195 i196 i197 i198 i199 i200 i201 i202 i203 i204 i205 i206 i207 i208 i209 i210 i211 i212 i213 i214 i215 i216 i217 i218 i219 i220 i221 i222 i223 i224 i225 i226 i227 i228 i229 i230 i231 i232 i233 i234 i235 i236 i237 i238 i239 i240 i241 i242 i243 i244 i245 i246 i247 i248 i249 i250 i251 i252 i253 i254 i255 i256 i257 i258 i259 i260 i261 i262 i263 i264 i265 i266 i267 i268 i269 i270 i271 i272 i273 i274 i275 i276 i277 i278 i279 i280 i281 i282 i283 i284 i285 i286 i287 i288 i289 i290 i291 i292 i293 i294 i295 i296 i297 i298 i299 i300 i301 i302 i303 i304 i305 i306 i307 i308 i309 i310 i311 i312 i313 i314 i315 i316 i317 i318 i319 i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i330 i331 i332 i333 i334 i335 i336 i337 i338 i339 i340 i341 i342 i343 i344 i345 i346 i347 i348 i349 i350 i351 i352 i353 i354 i355 i356 i357 i358 i359 i360 i361 i362 i363 i364 i365 i366 i367 i368 i369 i370 i371 i372 i373 i374 i375 i376 i377 i378 i379 i380 i381 i382 i383 i384 i385 i386 i387 i388 i389 i390 i391 i392 i393 i394 i395 i396 i397 i398 i399 i400 i401 i402 i403 i404 i405 i406 i407 i408 i409 i410 i411 i412 i413 i414 i415 i416 i417 i418 i419 i420 i421 i422 i423 i424 i425 i426 i427 i428 i429 i430 i431 i432 i433 i434 i435 i436 i437 i438 i439 i440 i441 i442 i443 i444 i445 i446 i447 i448 i449 i450 i451 i452 i453 i454 i455 i456 i457 i458 i459 i460 i461 i462 i463 i464 i465 i466 i467 i468 i469 i470 i471 i472 i473 i474 i475 i476 i477 i478 i479 i480 i481 i482 i483 i484 i485 i486 i487 i488 i489 i490 i491 i492 i493 i494 i495 i496 i497 i498 i499 i500 i501 i502 i503 i504 i505 i506 i507 i508 i509 i510 i511 i512 i513 i514 i515 i516 i517 i518 i519 i520 i521 i522 i523 i524 i525 i526 i527 i528 i529 i530 i531 i532 i533 i534 i535 i536 i537 i538 i539 i540 i541 i542 i543 i544 i545 i546 i547 i548 i549 i550 i551 i552 i553 i554 i555 i556 i557 i558 i559 i560 i561 i562 i563 i564 i565 i566 i567 i568 i569 i570 i571 i572 i573 i574 i575 i576 i577 i578 i579 i580 i581 i582 i583 i584 i585 i586 i587 i588 i589 i590 i591 i592 i593 i594 i595 i596 i597 i598 i599 i600 i601 i602 i603 i604 i605 i606 i607 i608 i609 i610 i611 i612 i613 i614 i615 i616 i617 i618 i619 i620 i621 i622 i623 i624 i625 i626 i627 i628 i629 i630 i631 i632 i633 i634 i635 i636 i637 i638 i639 i640 i641 i642 i643 i644 i645 i646 i647 i648 i649 i650 i651 i652 i653 i654 i655 i656 i657 i658 i659 i660 i661 i662 i663 i664 i665 i666 i667 i668 i669 i670 i671 i672 i673 i674 i675 i676 i677 i678 i679 i680 i681 i682 i683 i684 i685 i686 i687 i688 i689 i690 i691 i692 i693 i694 i695 i696 i697 i698 i699 i700 i701 i702 i703 i704 i705 i706 i707 i708 i709 i710 i711 i712 i713 i714 i715 i716 i717 i718 i719 i720 i721 i722 i723 i724 i725 i726 i727 i728 i729 i730 i731 i732 i733 i734 i735 i736 i737 i738 i739 i740 i741 i742 i743 i744 i745 i746 i747 i748 i749 i750 i751 i752 i753 i754 i755 i756 i757 i758 i759 i760 i761 i762 i763 i764 i765 i766 i767 i768 i769 i770 i771 i772 i773 i774 i775 i776 i777 i778 i779 i780 i781 i782 i783 i784 i785 i786 i787 i788 i789 i790 i791 i792 i793 i794 i795 i796 i797 i798 i799 i800 i801 i802 i803 i804 i805 i806 i807 i808 i809 i810 i811 i812 i813 i814 i815 i816 i817 i818 i819 i820 i821 i822 i823 i824 i825 i826 i827 i828 i829 i830 i831 i832 i833 i834 i835 i836 i837 i838 i839 i840 i841 i842 i843 i844 i845 i846 i847 i848 i849 i850 i851 i852 i853 i854 i855 i856 i857 i858 i859 i860 i861 i862 i863 i864 i865 i866 i867 i868 i869 i870 i871 i872 i873 i874 i875 i876 i877 i878 i879 i880 i881 i882 i883 i884 i885 i886 i887 i888 i889 i890 i891 i892 i893 i894 i895 i896 i897 i898 i899 i900 i901 i902 i903 i904 i905 i906 i907 i908 i909 i910 i911 i912 i913 i914 i915 i916 i917 i918 i919 i920 i921 i922 i923 i924 i925 i926 i927 i928 i929 i930 i931 i932 i933 i934 i935 i936 i937 i938 i939 i940 i941 i942 i943 i944 i945 i946 i947 i948 i949 i950 i951 i952 i953 i954 i955 i956 i957 i958 i959 i960 i961 i962 i963 i964 i965 i966 i967 i968 i969 i970 i971 i972 i973 i974 i975 i976 i977 i978 i979 i980 i981 i982 i983 i984 i985 i986 i987 i988 i989 i990 i991 i992 i993 i994 i995 i996 i997 i998 i999 i1000 b
|
||||
|
@ -8,7 +8,7 @@ n
|
||||
3
|
||||
flush tables with read lock;
|
||||
drop table t2;
|
||||
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
|
||||
ERROR HY000: Can't execute the query because you have a conflicting read lock
|
||||
drop table t2;
|
||||
unlock tables;
|
||||
create database mysqltest;
|
||||
|
@ -23,6 +23,7 @@ grant select on `my\_1`.* to mysqltest_4@localhost with grant option;
|
||||
ERROR 42000: 'mysqltest_1'@'localhost' is not allowed to create new users
|
||||
grant select on `my\_1`.* to mysqltest_4@localhost identified by 'mypass'
|
||||
with grant option;
|
||||
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
|
||||
show grants for mysqltest_1@localhost;
|
||||
Grants for mysqltest_1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
||||
|
@ -118,9 +118,9 @@ t2
|
||||
t3
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t2 MyISAM 9 Fixed 0 0 0 21474836479 1024 0 NULL # # NULL latin1_swedish_ci NULL
|
||||
t3 MyISAM 9 Fixed 0 0 0 21474836479 1024 0 NULL # # NULL latin1_swedish_ci NULL
|
||||
v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
|
||||
t2 MyISAM 9 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
|
||||
t3 MyISAM 9 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
|
||||
v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
|
||||
show full columns from t3 like "a%";
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
a int(11) NULL YES MUL NULL select,insert,update,references
|
||||
|
@ -1466,13 +1466,13 @@ Error 1146 Table 'test.t4' doesn't exist
|
||||
checksum table t1, t2, t3;
|
||||
Table Checksum
|
||||
test.t1 2948697075
|
||||
test.t2 968604391
|
||||
test.t3 968604391
|
||||
test.t2 1157260244
|
||||
test.t3 1157260244
|
||||
checksum table t1, t2, t3 extended;
|
||||
Table Checksum
|
||||
test.t1 3092701434
|
||||
test.t2 968604391
|
||||
test.t3 968604391
|
||||
test.t2 1157260244
|
||||
test.t3 1157260244
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb;
|
||||
insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
|
||||
@ -1808,7 +1808,591 @@ set global innodb_thread_sleep_delay=10000;
|
||||
show variables like "innodb_thread_sleep_delay";
|
||||
Variable_name Value
|
||||
innodb_thread_sleep_delay 10000
|
||||
set storage_engine=INNODB;
|
||||
drop table if exists t1,t2,t3;
|
||||
--- Testing varchar ---
|
||||
--- Testing varchar ---
|
||||
create table t1 (v varchar(10), c char(10), t text);
|
||||
insert into t1 values('+ ', '+ ', '+ ');
|
||||
set @a=repeat(' ',20);
|
||||
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'v' at row 1
|
||||
select concat('*',v,'*',c,'*',t,'*') from t1;
|
||||
concat('*',v,'*',c,'*',t,'*')
|
||||
*+ *+*+ *
|
||||
*+ *+*+ *
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` varchar(10) default NULL,
|
||||
`c` char(10) default NULL,
|
||||
`t` text
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
create table t2 like t1;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`v` varchar(10) default NULL,
|
||||
`c` char(10) default NULL,
|
||||
`t` text
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
create table t3 select * from t1;
|
||||
show create table t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`v` varchar(10) default NULL,
|
||||
`c` char(10) default NULL,
|
||||
`t` text
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
alter table t1 modify c varchar(10);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` varchar(10) default NULL,
|
||||
`c` varchar(10) default NULL,
|
||||
`t` text
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
alter table t1 modify v char(10);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` char(10) default NULL,
|
||||
`c` varchar(10) default NULL,
|
||||
`t` text
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
alter table t1 modify t varchar(10);
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 't' at row 2
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` char(10) default NULL,
|
||||
`c` varchar(10) default NULL,
|
||||
`t` varchar(10) default NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
select concat('*',v,'*',c,'*',t,'*') from t1;
|
||||
concat('*',v,'*',c,'*',t,'*')
|
||||
*+*+*+ *
|
||||
*+*+*+ *
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` varchar(10) default NULL,
|
||||
`c` char(10) default NULL,
|
||||
`t` text,
|
||||
KEY `v` (`v`),
|
||||
KEY `c` (`c`),
|
||||
KEY `t` (`t`(10))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
270
|
||||
insert into t1 values(concat('a',char(1)),concat('a',char(1)),concat('a',char(1)));
|
||||
select count(*) from t1 where v='a';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where c='a';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where t='a';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v='a ';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where c='a ';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where t='a ';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v between 'a' and 'a ';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v like 'a%';
|
||||
count(*)
|
||||
11
|
||||
select count(*) from t1 where c like 'a%';
|
||||
count(*)
|
||||
11
|
||||
select count(*) from t1 where t like 'a%';
|
||||
count(*)
|
||||
11
|
||||
select count(*) from t1 where v like 'a %';
|
||||
count(*)
|
||||
9
|
||||
explain select count(*) from t1 where v='a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 13 const # Using where; Using index
|
||||
explain select count(*) from t1 where c='a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref c c 11 const # Using where; Using index
|
||||
explain select count(*) from t1 where t='a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range t t 13 NULL # Using where
|
||||
explain select count(*) from t1 where v like 'a%';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
alter table t1 add unique(v);
|
||||
ERROR 23000: Duplicate entry '{ ' for key 1
|
||||
alter table t1 add key(v);
|
||||
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
|
||||
qq
|
||||
*a*a*a*
|
||||
*a *a*a *
|
||||
*a *a*a *
|
||||
*a *a*a *
|
||||
*a *a*a *
|
||||
*a *a*a *
|
||||
*a *a*a *
|
||||
*a *a*a *
|
||||
*a *a*a *
|
||||
*a *a*a *
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v,v_2 # 13 const # Using where
|
||||
select v,count(*) from t1 group by v limit 10;
|
||||
v count(*)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select v,count(t) from t1 group by v limit 10;
|
||||
v count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select v,count(c) from t1 group by v limit 10;
|
||||
v count(c)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select sql_big_result v,count(t) from t1 group by v limit 10;
|
||||
v count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select sql_big_result v,count(c) from t1 group by v limit 10;
|
||||
v count(c)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select c,count(*) from t1 group by c limit 10;
|
||||
c count(*)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select c,count(t) from t1 group by c limit 10;
|
||||
c count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select sql_big_result c,count(t) from t1 group by c limit 10;
|
||||
c count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select t,count(*) from t1 group by t limit 10;
|
||||
t count(*)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select t,count(t) from t1 group by t limit 10;
|
||||
t count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select sql_big_result t,count(t) from t1 group by t limit 10;
|
||||
t count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
alter table t1 modify v varchar(300), drop key v, drop key v_2, add key v (v);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` varchar(300) default NULL,
|
||||
`c` char(10) default NULL,
|
||||
`t` text,
|
||||
KEY `c` (`c`),
|
||||
KEY `t` (`t`(10)),
|
||||
KEY `v` (`v`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
select count(*) from t1 where v='a';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v='a ';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v between 'a' and 'a ';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v like 'a%';
|
||||
count(*)
|
||||
11
|
||||
select count(*) from t1 where v like 'a %';
|
||||
count(*)
|
||||
9
|
||||
explain select count(*) from t1 where v='a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 303 const # Using where; Using index
|
||||
explain select count(*) from t1 where v like 'a%';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 303 const # Using where
|
||||
select v,count(*) from t1 group by v limit 10;
|
||||
v count(*)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select v,count(t) from t1 group by v limit 10;
|
||||
v count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select sql_big_result v,count(t) from t1 group by v limit 10;
|
||||
v count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
alter table t1 drop key v, add key v (v(30));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` varchar(300) default NULL,
|
||||
`c` char(10) default NULL,
|
||||
`t` text,
|
||||
KEY `c` (`c`),
|
||||
KEY `t` (`t`(10)),
|
||||
KEY `v` (`v`(30))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
select count(*) from t1 where v='a';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v='a ';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v between 'a' and 'a ';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
count(*)
|
||||
10
|
||||
select count(*) from t1 where v like 'a%';
|
||||
count(*)
|
||||
11
|
||||
select count(*) from t1 where v like 'a %';
|
||||
count(*)
|
||||
9
|
||||
explain select count(*) from t1 where v='a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
explain select count(*) from t1 where v like 'a%';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
select v,count(*) from t1 group by v limit 10;
|
||||
v count(*)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select v,count(t) from t1 group by v limit 10;
|
||||
v count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select sql_big_result v,count(t) from t1 group by v limit 10;
|
||||
v count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
alter table t1 modify v varchar(600), drop key v, add key v (v);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` varchar(600) default NULL,
|
||||
`c` char(10) default NULL,
|
||||
`t` text,
|
||||
KEY `c` (`c`),
|
||||
KEY `t` (`t`(10)),
|
||||
KEY `v` (`v`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
select v,count(*) from t1 group by v limit 10;
|
||||
v count(*)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select v,count(t) from t1 group by v limit 10;
|
||||
v count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
select sql_big_result v,count(t) from t1 group by v limit 10;
|
||||
v count(t)
|
||||
a 1
|
||||
a 10
|
||||
b 10
|
||||
c 10
|
||||
d 10
|
||||
e 10
|
||||
f 10
|
||||
g 10
|
||||
h 10
|
||||
i 10
|
||||
drop table t1;
|
||||
create table t1 (a char(10), unique (a));
|
||||
insert into t1 values ('a ');
|
||||
insert into t1 values ('a ');
|
||||
ERROR 23000: Duplicate entry 'a' for key 1
|
||||
alter table t1 modify a varchar(10);
|
||||
insert into t1 values ('a '),('a '),('a '),('a ');
|
||||
ERROR 23000: Duplicate entry 'a ' for key 1
|
||||
insert into t1 values ('a ');
|
||||
ERROR 23000: Duplicate entry 'a ' for key 1
|
||||
insert into t1 values ('a ');
|
||||
ERROR 23000: Duplicate entry 'a ' for key 1
|
||||
insert into t1 values ('a ');
|
||||
ERROR 23000: Duplicate entry 'a ' for key 1
|
||||
update t1 set a='a ' where a like 'a%';
|
||||
select concat(a,'.') from t1;
|
||||
concat(a,'.')
|
||||
a .
|
||||
update t1 set a='abc ' where a like 'a ';
|
||||
select concat(a,'.') from t1;
|
||||
concat(a,'.')
|
||||
a .
|
||||
update t1 set a='a ' where a like 'a %';
|
||||
select concat(a,'.') from t1;
|
||||
concat(a,'.')
|
||||
a .
|
||||
update t1 set a='a ' where a like 'a ';
|
||||
select concat(a,'.') from t1;
|
||||
concat(a,'.')
|
||||
a .
|
||||
drop table t1;
|
||||
create table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` varchar(10) default NULL,
|
||||
`c` char(10) default NULL,
|
||||
`t` text,
|
||||
KEY `v` (`v`(5)),
|
||||
KEY `c` (`c`(5)),
|
||||
KEY `t` (`t`(5))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (v char(10) character set utf8);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` char(10) character set utf8 default NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (v varchar(10), c char(10)) row_format=fixed;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` varchar(10) default NULL,
|
||||
`c` char(10) default NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
|
||||
insert into t1 values('a','a'),('a ','a ');
|
||||
select concat('*',v,'*',c,'*') from t1;
|
||||
concat('*',v,'*',c,'*')
|
||||
*a*a*
|
||||
*a *a*
|
||||
drop table t1;
|
||||
create table t1 (v varchar(65530), key(v(10)));
|
||||
insert into t1 values(repeat('a',65530));
|
||||
select length(v) from t1 where v=repeat('a',65530);
|
||||
length(v)
|
||||
65530
|
||||
drop table t1;
|
||||
create table t1 (v varchar(65530), key(v));
|
||||
ERROR HY000: Can't create table './test/t1.frm' (errno: 139)
|
||||
create table t1 (v varchar(65536));
|
||||
Warnings:
|
||||
Note 1246 Converting column 'v' from VARCHAR to TEXT
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` mediumtext
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (v varchar(65530) character set utf8);
|
||||
Warnings:
|
||||
Note 1246 Converting column 'v' from VARCHAR to TEXT
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` mediumtext character set utf8
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
set storage_engine=MyISAM;
|
||||
create table t1 (v varchar(16384)) engine=innodb;
|
||||
ERROR 42000: Column length too big for column 'v' (max = 255); use BLOB instead
|
||||
drop table t1;
|
||||
create table t1 (a bit, key(a)) engine=innodb;
|
||||
ERROR 42000: The storage engine for the table doesn't support BIT FIELD
|
||||
|
@ -74,8 +74,8 @@ insert into t1 select * from t2;
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 96 Query 1 191 use `test`; insert into t1 select * from t2
|
||||
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
@ -88,7 +88,7 @@ create table t2(unique(a)) select a from t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
|
||||
drop table t1;
|
||||
create table t1 (a int not null);
|
||||
create table t2 (a int not null);
|
||||
|
@ -1,4 +1,4 @@
|
||||
drop table if exists t1;
|
||||
drop table if exists t1, t2;
|
||||
create table t1 (a date, b date, c date not null, d date);
|
||||
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
|
||||
Warnings:
|
||||
@ -66,3 +66,57 @@ a b
|
||||
3 row 3
|
||||
0
|
||||
drop table t1;
|
||||
create table t1 (a int default 100, b int, c varchar(60));
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
|
||||
select * from t1;
|
||||
a b c
|
||||
NULL 20 b=10
|
||||
NULL 25 b=15
|
||||
truncate table t1;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
|
||||
select * from t1;
|
||||
a b c
|
||||
NULL NULL oops
|
||||
NULL NULL oops
|
||||
truncate table t1;
|
||||
set @c:=123;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
|
||||
select * from t1;
|
||||
a b c
|
||||
100 10 123
|
||||
100 15 123
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, @b);
|
||||
select * from t1;
|
||||
a b c
|
||||
100 10 123
|
||||
100 15 123
|
||||
100 NULL NULL
|
||||
100 NULL NULL
|
||||
select @a, @b;
|
||||
@a @b
|
||||
NULL 15
|
||||
truncate table t1;
|
||||
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
|
||||
select * from t1;
|
||||
a b c
|
||||
1 2 Wow
|
||||
3 4 Wow
|
||||
5 6 Wow
|
||||
truncate table t1;
|
||||
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
|
||||
select * from t1;
|
||||
a b c
|
||||
1 2 1+2+123+2+NIL
|
||||
3 4 3+4+123+4+NIL
|
||||
5 6 5+6+123+6+NIL
|
||||
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
|
||||
ERROR HY000: Can't load value from file with fixed size rows to variable
|
||||
create table t2 (num int primary key, str varchar(10));
|
||||
insert into t2 values (10,'Ten'), (15,'Fifteen');
|
||||
truncate table t1;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
|
||||
select * from t1;
|
||||
a b c
|
||||
10 NULL Ten
|
||||
15 NULL Fifteen
|
||||
drop table t1, t2;
|
||||
|
@ -6,12 +6,12 @@ begin;
|
||||
insert into t1 values(1);
|
||||
insert into t2 select * from t1;
|
||||
commit;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(1)
|
||||
master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 348 Xid 1 # COMMIT /* xid=7 */
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 167 Query 1 # use `test`; insert into t1 values(1)
|
||||
master-bin.000001 255 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 350 Xid 1 # COMMIT /* xid=7 */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
@ -21,12 +21,12 @@ insert into t2 select * from t1;
|
||||
rollback;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(2)
|
||||
master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 348 Query 1 # use `test`; ROLLBACK
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 167 Query 1 # use `test`; insert into t1 values(2)
|
||||
master-bin.000001 255 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 350 Query 1 # use `test`; ROLLBACK
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
@ -39,15 +39,15 @@ rollback to savepoint my_savepoint;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
commit;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(3)
|
||||
master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 339 Query 1 # use `test`; insert into t1 values(4)
|
||||
master-bin.000001 427 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 522 Query 1 # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 620 Xid 1 # COMMIT /* xid=24 */
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 167 Query 1 # use `test`; insert into t1 values(3)
|
||||
master-bin.000001 255 Query 1 # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 341 Query 1 # use `test`; insert into t1 values(4)
|
||||
master-bin.000001 429 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 524 Query 1 # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 622 Xid 1 # COMMIT /* xid=24 */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
@ -65,16 +65,16 @@ select a from t1 order by a;
|
||||
a
|
||||
5
|
||||
7
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(5)
|
||||
master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 339 Query 1 # use `test`; insert into t1 values(6)
|
||||
master-bin.000001 427 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 522 Query 1 # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 620 Query 1 # use `test`; insert into t1 values(7)
|
||||
master-bin.000001 708 Xid 1 # COMMIT /* xid=36 */
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 167 Query 1 # use `test`; insert into t1 values(5)
|
||||
master-bin.000001 255 Query 1 # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 341 Query 1 # use `test`; insert into t1 values(6)
|
||||
master-bin.000001 429 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 524 Query 1 # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 622 Query 1 # use `test`; insert into t1 values(7)
|
||||
master-bin.000001 710 Xid 1 # COMMIT /* xid=36 */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
@ -87,43 +87,43 @@ insert into t2 select * from t1;
|
||||
select get_lock("a",10);
|
||||
get_lock("a",10)
|
||||
1
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(8)
|
||||
master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 348 Query 1 # use `test`; ROLLBACK
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 167 Query 1 # use `test`; insert into t1 values(8)
|
||||
master-bin.000001 255 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 350 Query 1 # use `test`; ROLLBACK
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
insert into t1 values(9);
|
||||
insert into t2 select * from t1;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 # use `test`; insert into t1 values(9)
|
||||
master-bin.000001 184 Xid 1 # COMMIT /* xid=59 */
|
||||
master-bin.000001 211 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 98 Query 1 # use `test`; insert into t1 values(9)
|
||||
master-bin.000001 186 Xid 1 # COMMIT /* xid=59 */
|
||||
master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
insert into t1 values(10);
|
||||
begin;
|
||||
insert into t2 select * from t1;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 # use `test`; insert into t1 values(10)
|
||||
master-bin.000001 185 Xid 1 # COMMIT /* xid=65 */
|
||||
master-bin.000001 212 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10)
|
||||
master-bin.000001 187 Xid 1 # COMMIT /* xid=65 */
|
||||
master-bin.000001 214 Query 1 # use `test`; insert into t2 select * from t1
|
||||
insert into t1 values(11);
|
||||
commit;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 # use `test`; insert into t1 values(10)
|
||||
master-bin.000001 185 Xid 1 # COMMIT /* xid=65 */
|
||||
master-bin.000001 212 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 307 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 376 Query 1 # use `test`; insert into t1 values(11)
|
||||
master-bin.000001 465 Xid 1 # COMMIT /* xid=67 */
|
||||
master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10)
|
||||
master-bin.000001 187 Xid 1 # COMMIT /* xid=65 */
|
||||
master-bin.000001 214 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 309 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 378 Query 1 # use `test`; insert into t1 values(11)
|
||||
master-bin.000001 467 Xid 1 # COMMIT /* xid=67 */
|
||||
alter table t2 engine=INNODB;
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -132,12 +132,12 @@ begin;
|
||||
insert into t1 values(12);
|
||||
insert into t2 select * from t1;
|
||||
commit;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(12)
|
||||
master-bin.000001 254 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 349 Xid 1 # COMMIT /* xid=77 */
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 167 Query 1 # use `test`; insert into t1 values(12)
|
||||
master-bin.000001 256 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 351 Xid 1 # COMMIT /* xid=77 */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
@ -145,7 +145,7 @@ begin;
|
||||
insert into t1 values(13);
|
||||
insert into t2 select * from t1;
|
||||
rollback;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -157,11 +157,11 @@ insert into t1 values(15);
|
||||
insert into t2 select * from t1;
|
||||
rollback to savepoint my_savepoint;
|
||||
commit;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(14)
|
||||
master-bin.000001 254 Xid 1 # COMMIT /* xid=93 */
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 167 Query 1 # use `test`; insert into t1 values(14)
|
||||
master-bin.000001 256 Xid 1 # COMMIT /* xid=93 */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
@ -177,12 +177,12 @@ select a from t1 order by a;
|
||||
a
|
||||
16
|
||||
18
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(16)
|
||||
master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18)
|
||||
master-bin.000001 343 Xid 1 # COMMIT /* xid=104 */
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 167 Query 1 # use `test`; insert into t1 values(16)
|
||||
master-bin.000001 256 Query 1 # use `test`; insert into t1 values(18)
|
||||
master-bin.000001 345 Xid 1 # COMMIT /* xid=104 */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
alter table t2 type=MyISAM;
|
||||
|
@ -1171,9 +1171,9 @@ t1 CREATE TABLE `t1` (
|
||||
`v` mediumtext character set utf8
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
set storage_engine=MyISAM;
|
||||
create table t1 (v varchar(65535));
|
||||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
|
||||
set storage_engine=MyISAM;
|
||||
create table t1 (a int) engine=myisam;
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
|
@ -9,7 +9,6 @@ load data infile '../../std_data/words.dat' into table t1;
|
||||
load data infile '../../std_data/words.dat' into table t1;
|
||||
load data infile '../../std_data/words.dat' into table t1;
|
||||
load data infile '../../std_data/words.dat' into table t1;
|
||||
load data infile '../../std_data/words.dat' into table t1;
|
||||
insert into t1 values ("Alas");
|
||||
flush logs;
|
||||
|
||||
@ -32,11 +31,14 @@ insert into t1 values ("abirvalg");
|
||||
SET INSERT_ID=1;
|
||||
SET TIMESTAMP=1000000000;
|
||||
insert into t2 values ();
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-1-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-2-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-3-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-4-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-5-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
SET TIMESTAMP=1000000000;
|
||||
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-1-0' INTO table t1;
|
||||
SET TIMESTAMP=1000000000;
|
||||
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-2-0' INTO table t1;
|
||||
SET TIMESTAMP=1000000000;
|
||||
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-0' INTO table t1;
|
||||
SET TIMESTAMP=1000000000;
|
||||
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-0' INTO table t1;
|
||||
ROLLBACK;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
@ -91,11 +93,14 @@ insert into t1 values ("abirvalg");
|
||||
SET INSERT_ID=1;
|
||||
SET TIMESTAMP=1000000000;
|
||||
insert into t2 values ();
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-1-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-2-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-3-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-4-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-5-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
SET TIMESTAMP=1000000000;
|
||||
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-1-2' INTO table t1;
|
||||
SET TIMESTAMP=1000000000;
|
||||
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-2-2' INTO table t1;
|
||||
SET TIMESTAMP=1000000000;
|
||||
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-2' INTO table t1;
|
||||
SET TIMESTAMP=1000000000;
|
||||
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-2' INTO table t1;
|
||||
ROLLBACK;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
DROP TABLE IF EXISTS t1, `"t"1`, t1aa,t2aa;
|
||||
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa;
|
||||
drop database if exists mysqldump_test_db;
|
||||
drop view if exists v1;
|
||||
CREATE TABLE t1(a int);
|
||||
|
@ -70,7 +70,7 @@ def test t9 t9 c18 c18 1 4 1 Y 32768 0 63
|
||||
def test t9 t9 c19 c19 1 1 1 Y 32768 0 63
|
||||
def test t9 t9 c20 c20 254 1 1 Y 0 0 8
|
||||
def test t9 t9 c21 c21 254 10 10 Y 0 0 8
|
||||
def test t9 t9 c22 c22 254 30 30 Y 0 0 8
|
||||
def test t9 t9 c22 c22 253 30 30 Y 0 0 8
|
||||
def test t9 t9 c23 c23 252 255 8 Y 144 0 63
|
||||
def test t9 t9 c24 c24 252 255 8 Y 16 0 8
|
||||
def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
|
||||
@ -1691,8 +1691,8 @@ affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
select a,b from t2 order by a ;
|
||||
a b
|
||||
3 duplicate
|
||||
4 duplicate
|
||||
3 duplicate
|
||||
4 duplicate
|
||||
103 three
|
||||
delete from t2 ;
|
||||
prepare stmt1 from ' insert into t2 (b,a)
|
||||
@ -1710,8 +1710,8 @@ affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
select a,b from t2 order by a ;
|
||||
a b
|
||||
3 duplicate
|
||||
4 duplicate
|
||||
3 duplicate
|
||||
4 duplicate
|
||||
103 three
|
||||
drop table t2;
|
||||
drop table if exists t5 ;
|
||||
|
@ -178,9 +178,9 @@ insert into t1 values ('','empt',2,2),
|
||||
('dddd','d--d',2,2);
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
pk1 pk2 key1 key2
|
||||
empt 2 2
|
||||
a a--a 2 2
|
||||
bb b--b 2 2
|
||||
ccc c--c 2 2
|
||||
dddd d--d 2 2
|
||||
empt 2 2
|
||||
drop table t1;
|
||||
|
@ -1,7 +1,7 @@
|
||||
reset master;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 96
|
||||
master-bin.000001 98
|
||||
reset slave;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
@ -17,7 +17,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
|
||||
start slave;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 96 # # master-bin.000001 Yes Yes 0 0 96 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 98 # # master-bin.000001 Yes Yes 0 0 98 # None 0 No #
|
||||
drop table if exists t1;
|
||||
create table t1 (n int);
|
||||
insert into t1 values (10),(45),(90);
|
||||
|
@ -13,11 +13,11 @@ insert into t1 values(2);
|
||||
stop slave;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 358 # # master-bin.000001 No No 0 0 182 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 360 # # master-bin.000001 No No 0 0 184 # None 0 No #
|
||||
change master to master_user='root';
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 182 # # master-bin.000001 No No 0 0 182 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 184 # # master-bin.000001 No No 0 0 184 # None 0 No #
|
||||
start slave;
|
||||
select * from t1;
|
||||
n
|
||||
|
@ -103,7 +103,7 @@ a b
|
||||
1 cp850_general_ci
|
||||
drop database mysqltest2;
|
||||
drop database mysqltest3;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # drop database if exists mysqltest2
|
||||
master-bin.000001 # Query 1 # drop database if exists mysqltest3
|
||||
|
@ -39,9 +39,9 @@ a
|
||||
22
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 19116 # # master-bin.000001 Yes Yes 0 0 19116 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 19118 # # master-bin.000001 Yes Yes 0 0 19118 # None 0 No #
|
||||
stop slave;
|
||||
change master to master_log_pos=534;
|
||||
change master to master_log_pos=536;
|
||||
begin;
|
||||
select * from t2 for update;
|
||||
a
|
||||
@ -57,10 +57,10 @@ a
|
||||
22
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 19116 # # master-bin.000001 Yes Yes 0 0 19116 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 19118 # # master-bin.000001 Yes Yes 0 0 19118 # None 0 No #
|
||||
set global max_relay_log_size=0;
|
||||
stop slave;
|
||||
change master to master_log_pos=534;
|
||||
change master to master_log_pos=536;
|
||||
begin;
|
||||
select * from t2 for update;
|
||||
a
|
||||
@ -77,5 +77,5 @@ a
|
||||
22
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 19116 # # master-bin.000001 Yes Yes 0 0 19116 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 19118 # # master-bin.000001 Yes Yes 0 0 19118 # None 0 No #
|
||||
drop table t1,t2;
|
||||
|
@ -9,7 +9,7 @@ insert into t1 values (1),(1);
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 288 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 288 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 290 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 290 # None 0 No #
|
||||
show tables like 't1';
|
||||
Tables_in_test (t1)
|
||||
drop table t1;
|
||||
@ -26,14 +26,14 @@ select (@id := id) - id from t3;
|
||||
0
|
||||
kill @id;
|
||||
drop table t2,t3;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 195 use `test`; create table t1 (a int primary key)
|
||||
master-bin.000001 195 Query 1 288 use `test`; insert into t1 values (1),(1)
|
||||
master-bin.000001 288 Query 1 365 use `test`; drop table t1
|
||||
master-bin.000001 365 Query 1 464 use `test`; create table t2 (a int primary key)
|
||||
master-bin.000001 464 Query 1 552 use `test`; insert into t2 values(1)
|
||||
master-bin.000001 552 Query 1 640 use `test`; create table t3 (id int)
|
||||
master-bin.000001 640 Query 1 742 use `test`; insert into t3 values(connection_id())
|
||||
master-bin.000001 742 Query 1 862 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
|
||||
master-bin.000001 862 Query 1 942 use `test`; drop table t2,t3
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (a int primary key)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values (1),(1)
|
||||
master-bin.000001 # Query 1 # use `test`; drop table t1
|
||||
master-bin.000001 # Query 1 # use `test`; create table t2 (a int primary key)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t2 values(1)
|
||||
master-bin.000001 # Query 1 # use `test`; create table t3 (id int)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t3 values(connection_id())
|
||||
master-bin.000001 # Query 1 # use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
|
||||
master-bin.000001 # Query 1 # use `test`; drop table t2,t3
|
||||
|
@ -14,4 +14,4 @@ start slave;
|
||||
flush logs;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 207 # # slave-bin.000001 Yes Yes 0 0 207 # None 0 No #
|
||||
# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 209 # # slave-bin.000001 Yes Yes 0 0 209 # None 0 No #
|
||||
|
@ -14,27 +14,27 @@ rename table t1 to t5, t2 to t1;
|
||||
flush no_write_to_binlog tables;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 96 Server ver: SERVER_VERSION, Binlog ver: 4
|
||||
master-bin.000001 96 Query 1 183 use `test`; create table t1 (a int)
|
||||
master-bin.000001 183 Query 1 273 use `test`; insert into t1 values (10)
|
||||
master-bin.000001 273 Query 1 360 use `test`; create table t2 (a int)
|
||||
master-bin.000001 360 Query 1 470 use `test`; create table t3 (a int) engine=merge union(t1)
|
||||
master-bin.000001 470 Query 1 557 use `test`; create table t4 (a int)
|
||||
master-bin.000001 557 Query 1 652 use `test`; insert into t4 select * from t3
|
||||
master-bin.000001 652 Query 1 747 use `test`; rename table t1 to t5, t2 to t1
|
||||
master-bin.000001 # Format_desc 1 # Server ver: SERVER_VERSION, Binlog ver: 4
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values (10)
|
||||
master-bin.000001 # Query 1 # use `test`; create table t2 (a int)
|
||||
master-bin.000001 # Query 1 # use `test`; create table t3 (a int) engine=merge union(t1)
|
||||
master-bin.000001 # Query 1 # use `test`; create table t4 (a int)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t4 select * from t3
|
||||
master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
|
||||
select * from t3;
|
||||
a
|
||||
flush tables;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 96 Server ver: SERVER_VERSION, Binlog ver: 4
|
||||
master-bin.000001 96 Query 1 183 use `test`; create table t1 (a int)
|
||||
master-bin.000001 183 Query 1 273 use `test`; insert into t1 values (10)
|
||||
master-bin.000001 273 Query 1 360 use `test`; create table t2 (a int)
|
||||
master-bin.000001 360 Query 1 470 use `test`; create table t3 (a int) engine=merge union(t1)
|
||||
master-bin.000001 470 Query 1 557 use `test`; create table t4 (a int)
|
||||
master-bin.000001 557 Query 1 652 use `test`; insert into t4 select * from t3
|
||||
master-bin.000001 652 Query 1 747 use `test`; rename table t1 to t5, t2 to t1
|
||||
master-bin.000001 747 Query 1 823 use `test`; flush tables
|
||||
master-bin.000001 # Format_desc 1 # Server ver: SERVER_VERSION, Binlog ver: 4
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values (10)
|
||||
master-bin.000001 # Query 1 # use `test`; create table t2 (a int)
|
||||
master-bin.000001 # Query 1 # use `test`; create table t3 (a int) engine=merge union(t1)
|
||||
master-bin.000001 # Query 1 # use `test`; create table t4 (a int)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t4 select * from t3
|
||||
master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
|
||||
master-bin.000001 # Query 1 # use `test`; flush tables
|
||||
select * from t3;
|
||||
a
|
||||
|
@ -22,7 +22,7 @@ day id category name
|
||||
2003-03-22 2416 a bbbbb
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
slave-bin.000001 1097
|
||||
slave-bin.000001 1292
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
@ -33,7 +33,7 @@ set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1560 # # master-bin.000001 Yes Yes 0 0 1560 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1800 # # master-bin.000001 Yes Yes 0 0 1800 # None 0 No #
|
||||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
set sql_log_bin=1;
|
||||
@ -43,7 +43,7 @@ change master to master_user='test';
|
||||
change master to master_user='root';
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1668 # # master-bin.000001 No No 0 0 1668 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1835 # # master-bin.000001 No No 0 0 1835 # None 0 No #
|
||||
set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
set sql_log_bin=0;
|
||||
@ -64,5 +64,5 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
|
||||
ERROR 23000: Duplicate entry '2003-03-22' for key 1
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 537
|
||||
master-bin.000001 441
|
||||
drop table t2;
|
||||
|
@ -10,8 +10,10 @@ create database mysqltest;
|
||||
create table t1(a int, b int, unique(b));
|
||||
use mysqltest;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 198 drop database if exists mysqltest
|
||||
master-bin.000001 198 Query 1 292 create database mysqltest
|
||||
master-bin.000001 # Query 1 # drop database if exists mysqltest
|
||||
master-bin.000001 # Query 1 # create database mysqltest
|
||||
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=12
|
||||
master-bin.000001 # Execute_load_query 1 # use `mysqltest`; load data infile '../../std_data/rpl_loaddata.dat' into table test.t1 ;file_id=1
|
||||
drop database mysqltest;
|
||||
|
@ -10,5 +10,5 @@ load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
|
@ -12,3 +12,20 @@ select a,count(*) from t1 group by a;
|
||||
a count(*)
|
||||
1 10000
|
||||
drop table t1;
|
||||
create table t1(a int);
|
||||
insert into t1 values (1), (2), (2), (3);
|
||||
select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1;
|
||||
drop table t1;
|
||||
create table t1(a int primary key);
|
||||
load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
drop table t1;
|
||||
|
@ -19,25 +19,25 @@ count(*)
|
||||
drop table t1;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
master-bin.000001 218 Intvar 1 246 INSERT_ID=1
|
||||
master-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
|
||||
master-bin.000001 338 Query 1 415 use `test`; drop table t1
|
||||
master-bin.000001 415 Query 1 519 use `test`; create table t1 (word char(20) not null)
|
||||
master-bin.000001 519 Create_file 1 1189 db=test;table=t1;file_id=1;block_len=581
|
||||
master-bin.000001 1189 Exec_load 1 1212 ;file_id=1
|
||||
master-bin.000001 1212 Query 1 1289 use `test`; drop table t1
|
||||
show binlog events from 96 limit 1;
|
||||
master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
master-bin.000001 220 Intvar 1 248 INSERT_ID=1
|
||||
master-bin.000001 248 Query 1 340 use `test`; insert into t1 values (NULL)
|
||||
master-bin.000001 340 Query 1 417 use `test`; drop table t1
|
||||
master-bin.000001 417 Query 1 521 use `test`; create table t1 (word char(20) not null)
|
||||
master-bin.000001 521 Begin_load_query 1 1125 ;file_id=1;block_len=581
|
||||
master-bin.000001 1125 Execute_load_query 1 1274 use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1
|
||||
master-bin.000001 1274 Query 1 1351 use `test`; drop table t1
|
||||
show binlog events from 98 limit 1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
show binlog events from 96 limit 2;
|
||||
master-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
show binlog events from 98 limit 2;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
master-bin.000001 218 Intvar 1 246 INSERT_ID=1
|
||||
show binlog events from 96 limit 2,1;
|
||||
master-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
master-bin.000001 220 Intvar 1 248 INSERT_ID=1
|
||||
show binlog events from 98 limit 2,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
|
||||
master-bin.000001 248 Query 1 340 use `test`; insert into t1 values (NULL)
|
||||
flush logs;
|
||||
create table t5 (a int);
|
||||
drop table t5;
|
||||
@ -49,24 +49,24 @@ insert into t1 values (1);
|
||||
drop table t1;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
master-bin.000001 218 Intvar 1 246 INSERT_ID=1
|
||||
master-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
|
||||
master-bin.000001 338 Query 1 415 use `test`; drop table t1
|
||||
master-bin.000001 415 Query 1 519 use `test`; create table t1 (word char(20) not null)
|
||||
master-bin.000001 519 Create_file 1 1189 db=test;table=t1;file_id=1;block_len=581
|
||||
master-bin.000001 1189 Exec_load 1 1212 ;file_id=1
|
||||
master-bin.000001 1212 Query 1 1289 use `test`; drop table t1
|
||||
master-bin.000001 1289 Rotate 1 1333 master-bin.000002;pos=4
|
||||
master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
master-bin.000001 220 Intvar 1 248 INSERT_ID=1
|
||||
master-bin.000001 248 Query 1 340 use `test`; insert into t1 values (NULL)
|
||||
master-bin.000001 340 Query 1 417 use `test`; drop table t1
|
||||
master-bin.000001 417 Query 1 521 use `test`; create table t1 (word char(20) not null)
|
||||
master-bin.000001 521 Begin_load_query 1 1125 ;file_id=1;block_len=581
|
||||
master-bin.000001 1125 Execute_load_query 1 1274 use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1
|
||||
master-bin.000001 1274 Query 1 1351 use `test`; drop table t1
|
||||
master-bin.000001 1351 Rotate 1 1395 master-bin.000002;pos=4
|
||||
show binlog events in 'master-bin.000002';
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000002 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000002 96 Query 1 183 use `test`; create table t5 (a int)
|
||||
master-bin.000002 183 Query 1 260 use `test`; drop table t5
|
||||
master-bin.000002 260 Query 1 347 use `test`; create table t1 (n int)
|
||||
master-bin.000002 347 Query 1 436 use `test`; insert into t1 values (1)
|
||||
master-bin.000002 436 Query 1 513 use `test`; drop table t1
|
||||
master-bin.000002 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000002 98 Query 1 185 use `test`; create table t5 (a int)
|
||||
master-bin.000002 185 Query 1 262 use `test`; drop table t5
|
||||
master-bin.000002 262 Query 1 349 use `test`; create table t1 (n int)
|
||||
master-bin.000002 349 Query 1 438 use `test`; insert into t1 values (1)
|
||||
master-bin.000002 438 Query 1 515 use `test`; drop table t1
|
||||
show binary logs;
|
||||
Log_name
|
||||
master-bin.000001
|
||||
@ -78,26 +78,26 @@ slave-bin.000001
|
||||
slave-bin.000002
|
||||
show binlog events in 'slave-bin.000001' from 4;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
slave-bin.000001 4 Format_desc 2 96 Server ver: VERSION, Binlog ver: 4
|
||||
slave-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
slave-bin.000001 218 Intvar 1 246 INSERT_ID=1
|
||||
slave-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
|
||||
slave-bin.000001 338 Query 1 415 use `test`; drop table t1
|
||||
slave-bin.000001 415 Query 1 519 use `test`; create table t1 (word char(20) not null)
|
||||
slave-bin.000001 519 Create_file 1 1198 db=test;table=t1;file_id=1;block_len=581
|
||||
slave-bin.000001 1198 Exec_load 1 1221 ;file_id=1
|
||||
slave-bin.000001 1221 Query 1 1298 use `test`; drop table t1
|
||||
slave-bin.000001 1298 Query 1 1385 use `test`; create table t5 (a int)
|
||||
slave-bin.000001 1385 Query 1 1462 use `test`; drop table t5
|
||||
slave-bin.000001 1462 Rotate 2 1505 slave-bin.000002;pos=4
|
||||
slave-bin.000001 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4
|
||||
slave-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
slave-bin.000001 220 Intvar 1 248 INSERT_ID=1
|
||||
slave-bin.000001 248 Query 1 340 use `test`; insert into t1 values (NULL)
|
||||
slave-bin.000001 340 Query 1 417 use `test`; drop table t1
|
||||
slave-bin.000001 417 Query 1 521 use `test`; create table t1 (word char(20) not null)
|
||||
slave-bin.000001 521 Begin_load_query 1 1125 ;file_id=1;block_len=581
|
||||
slave-bin.000001 1125 Execute_load_query 1 1283 use `test`; load data INFILE '../../var/tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
|
||||
slave-bin.000001 1283 Query 1 1360 use `test`; drop table t1
|
||||
slave-bin.000001 1360 Query 1 1447 use `test`; create table t5 (a int)
|
||||
slave-bin.000001 1447 Query 1 1524 use `test`; drop table t5
|
||||
slave-bin.000001 1524 Rotate 2 1567 slave-bin.000002;pos=4
|
||||
show binlog events in 'slave-bin.000002' from 4;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
slave-bin.000002 4 Format_desc 2 96 Server ver: VERSION, Binlog ver: 4
|
||||
slave-bin.000002 96 Query 1 183 use `test`; create table t1 (n int)
|
||||
slave-bin.000002 183 Query 1 272 use `test`; insert into t1 values (1)
|
||||
slave-bin.000002 272 Query 1 349 use `test`; drop table t1
|
||||
slave-bin.000002 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4
|
||||
slave-bin.000002 98 Query 1 185 use `test`; create table t1 (n int)
|
||||
slave-bin.000002 185 Query 1 274 use `test`; insert into t1 values (1)
|
||||
slave-bin.000002 274 Query 1 351 use `test`; drop table t1
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 513 # # master-bin.000002 Yes Yes 0 0 513 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 515 # # master-bin.000002 Yes Yes 0 0 515 # None 0 No #
|
||||
show binlog events in 'slave-bin.000005' from 4;
|
||||
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
|
||||
|
@ -6,10 +6,10 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 96
|
||||
master-bin.000001 98
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 96 # # master-bin.000001 Yes Yes 0 0 96 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 98 # # master-bin.000001 Yes Yes 0 0 98 # None 0 No #
|
||||
stop slave;
|
||||
change master to master_log_pos=73;
|
||||
start slave;
|
||||
@ -30,13 +30,13 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 173 # # master-bin.000001 No Yes 0 0 173 # None 0 No #
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 96
|
||||
master-bin.000001 98
|
||||
create table if not exists t1 (n int);
|
||||
drop table if exists t1;
|
||||
create table t1 (n int);
|
||||
insert into t1 values (1),(2),(3);
|
||||
stop slave;
|
||||
change master to master_log_pos=96;
|
||||
change master to master_log_pos=98;
|
||||
start slave;
|
||||
select * from t1;
|
||||
n
|
||||
|
@ -16,7 +16,7 @@ select @@global.max_relay_log_size;
|
||||
start slave;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73752 # # master-bin.000001 Yes Yes 0 0 73752 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73754 # # master-bin.000001 Yes Yes 0 0 73754 # None 0 No #
|
||||
stop slave;
|
||||
reset slave;
|
||||
set global max_relay_log_size=(5*4096);
|
||||
@ -26,7 +26,7 @@ select @@global.max_relay_log_size;
|
||||
start slave;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73752 # # master-bin.000001 Yes Yes 0 0 73752 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73754 # # master-bin.000001 Yes Yes 0 0 73754 # None 0 No #
|
||||
stop slave;
|
||||
reset slave;
|
||||
set global max_relay_log_size=0;
|
||||
@ -36,7 +36,7 @@ select @@global.max_relay_log_size;
|
||||
start slave;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73752 # # master-bin.000001 Yes Yes 0 0 73752 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73754 # # master-bin.000001 Yes Yes 0 0 73754 # None 0 No #
|
||||
stop slave;
|
||||
reset slave;
|
||||
flush logs;
|
||||
@ -49,13 +49,13 @@ flush logs;
|
||||
create table t1 (a int);
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73839 # # master-bin.000001 Yes Yes 0 0 73839 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73841 # # master-bin.000001 Yes Yes 0 0 73841 # None 0 No #
|
||||
flush logs;
|
||||
drop table t1;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73916 # # master-bin.000001 Yes Yes 0 0 73916 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73918 # # master-bin.000001 Yes Yes 0 0 73918 # None 0 No #
|
||||
flush logs;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000002 96
|
||||
master-bin.000002 98
|
||||
|
@ -19,7 +19,7 @@ n
|
||||
3
|
||||
4
|
||||
5
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # drop database if exists mysqltest
|
||||
master-bin.000001 # Query 1 # create database mysqltest
|
||||
|
@ -18,5 +18,5 @@ max(a)
|
||||
8000
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743186 # # master-bin.000001 Yes Yes 0 0 743186 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743188 # # master-bin.000001 Yes Yes 0 0 743188 # None 0 No #
|
||||
drop table t1;
|
||||
|
@ -28,4 +28,4 @@ ERROR 42S02: Table 'test.t11' doesn't exist
|
||||
drop table if exists t1,t2,t11;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1618 # # master-bin.000001 Yes Yes test.t1 0 0 1618 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1668 # # master-bin.000001 Yes Yes test.t1 0 0 1668 # None 0 No #
|
||||
|
@ -6,12 +6,12 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 96 # # master-bin.000001 Yes Yes 0 0 96 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 98 # # master-bin.000001 Yes Yes 0 0 98 # None 0 No #
|
||||
stop slave;
|
||||
change master to master_user='test';
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 96 # # master-bin.000001 No No 0 0 96 # None 0 No #
|
||||
# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 98 # # master-bin.000001 No No 0 0 98 # None 0 No #
|
||||
reset slave;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
@ -19,7 +19,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
|
||||
start slave;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 96 # # master-bin.000001 Yes Yes 0 0 96 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 98 # # master-bin.000001 Yes Yes 0 0 98 # None 0 No #
|
||||
stop slave;
|
||||
reset slave;
|
||||
start slave;
|
||||
|
@ -16,7 +16,7 @@ create table t1 (s text);
|
||||
insert into t1 values('Could not break slave'),('Tried hard');
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 550 # # master-bin.000001 Yes Yes 0 0 550 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 552 # # master-bin.000001 Yes Yes 0 0 552 # None 0 No #
|
||||
select * from t1;
|
||||
s
|
||||
Could not break slave
|
||||
@ -57,7 +57,7 @@ master-bin.000003
|
||||
insert into t2 values (65);
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 498 # # master-bin.000003 Yes Yes 0 0 498 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 500 # # master-bin.000003 Yes Yes 0 0 500 # None 0 No #
|
||||
select * from t2;
|
||||
m
|
||||
34
|
||||
@ -79,13 +79,13 @@ master-bin.000004
|
||||
master-bin.000005
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000005 2051
|
||||
master-bin.000005 2146
|
||||
select * from t4;
|
||||
a
|
||||
testing temporary tables part 2
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2051 # # master-bin.000005 Yes Yes 0 0 2051 # None 0 No #
|
||||
# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2146 # # master-bin.000005 Yes Yes 0 0 2146 # None 0 No #
|
||||
lock tables t3 read;
|
||||
select count(*) from t3 where n >= 4;
|
||||
count(*)
|
||||
|
@ -10,7 +10,7 @@ stop slave;
|
||||
change master to master_port=SLAVE_PORT;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 96 None 0 No NULL
|
||||
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 98 None 0 No NULL
|
||||
start slave;
|
||||
insert into t1 values (1);
|
||||
show status like "slave_running";
|
||||
|
@ -10,7 +10,7 @@ stop slave;
|
||||
change master to master_port=SLAVE_PORT;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 96 None 0 No NULL
|
||||
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 98 None 0 No NULL
|
||||
start slave;
|
||||
insert into t1 values (1);
|
||||
select * from t1;
|
||||
|
@ -38,19 +38,19 @@ f
|
||||
7
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 96 Query 1 186 use `test`; drop table if exists t1,t2
|
||||
master-bin.000001 186 Query 1 272 use `test`; create table t1(f int)
|
||||
master-bin.000001 272 Query 1 358 use `test`; create table t2(f int)
|
||||
master-bin.000001 358 Query 1 484 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
|
||||
master-bin.000001 484 Query 1 580 use `test`; create temporary table t3(f int)
|
||||
master-bin.000001 580 Query 1 685 use `test`; insert into t3 select * from t1 where f<6
|
||||
master-bin.000001 685 Query 1 781 use `test`; create temporary table t3(f int)
|
||||
master-bin.000001 781 Query 1 883 use `test`; insert into t2 select count(*) from t3
|
||||
master-bin.000001 883 Query 1 989 use `test`; insert into t3 select * from t1 where f>=4
|
||||
master-bin.000001 989 Query 1 1076 use `test`; drop temporary table t3
|
||||
master-bin.000001 1076 Query 1 1178 use `test`; insert into t2 select count(*) from t3
|
||||
master-bin.000001 1178 Query 1 1265 use `test`; drop temporary table t3
|
||||
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 # Query 1 # use `test`; drop table if exists t1,t2
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1(f int)
|
||||
master-bin.000001 # Query 1 # use `test`; create table t2(f int)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
|
||||
master-bin.000001 # Query 1 # use `test`; create temporary table t3(f int)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t3 select * from t1 where f<6
|
||||
master-bin.000001 # Query 1 # use `test`; create temporary table t3(f int)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t2 select count(*) from t3
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t3 select * from t1 where f>=4
|
||||
master-bin.000001 # Query 1 # use `test`; drop temporary table t3
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t2 select count(*) from t3
|
||||
master-bin.000001 # Query 1 # use `test`; drop temporary table t3
|
||||
drop table t1, t2;
|
||||
use test;
|
||||
SET TIMESTAMP=1040323920;
|
||||
|
@ -32,13 +32,13 @@ t
|
||||
2004-06-11 09:39:02
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 96 Query 1 189 use `test`; create table t1 (t timestamp)
|
||||
master-bin.000001 189 Query 1 281 use `test`; create table t2 (t char(32))
|
||||
master-bin.000001 281 Query 1 373 use `test`; SET ONE_SHOT TIME_ZONE='UTC'
|
||||
master-bin.000001 373 Query 1 497 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
|
||||
master-bin.000001 497 Query 1 575 use `test`; delete from t1
|
||||
master-bin.000001 575 Query 1 699 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
|
||||
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (t timestamp)
|
||||
master-bin.000001 # Query 1 # use `test`; create table t2 (t char(32))
|
||||
master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT TIME_ZONE='UTC'
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
|
||||
master-bin.000001 # Query 1 # use `test`; delete from t1
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
|
||||
set time_zone='MET';
|
||||
insert into t2 (select t from t1);
|
||||
select * from t1;
|
||||
|
@ -14,15 +14,15 @@ insert into t2 values (3),(4);
|
||||
drop table t2;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
master-bin.000001 218 Query 1 319 use `test`; insert into t1 values (1),(2),(3),(4)
|
||||
master-bin.000001 319 Query 1 396 use `test`; drop table t1
|
||||
master-bin.000001 396 Query 1 518 use `test`; create table t2(n int not null auto_increment primary key)
|
||||
master-bin.000001 518 Query 1 611 use `test`; insert into t2 values (1),(2)
|
||||
master-bin.000001 611 Query 1 704 use `test`; insert into t2 values (3),(4)
|
||||
master-bin.000001 704 Query 1 781 use `test`; drop table t2
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=304;
|
||||
master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
master-bin.000001 220 Query 1 321 use `test`; insert into t1 values (1),(2),(3),(4)
|
||||
master-bin.000001 321 Query 1 398 use `test`; drop table t1
|
||||
master-bin.000001 398 Query 1 520 use `test`; create table t2(n int not null auto_increment primary key)
|
||||
master-bin.000001 520 Query 1 613 use `test`; insert into t2 values (1),(2)
|
||||
master-bin.000001 613 Query 1 706 use `test`; insert into t2 values (3),(4)
|
||||
master-bin.000001 706 Query 1 783 use `test`; drop table t2
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=321;
|
||||
select * from t1;
|
||||
n
|
||||
1
|
||||
@ -31,7 +31,7 @@ n
|
||||
4
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 319 # Master master-bin.000001 304 No #
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 783 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 321 # Master master-bin.000001 321 No #
|
||||
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
|
||||
select * from t1;
|
||||
n
|
||||
@ -41,21 +41,21 @@ n
|
||||
4
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 319 # Master master-no-such-bin.000001 291 No #
|
||||
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=710;
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 783 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 321 # Master master-no-such-bin.000001 291 No #
|
||||
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=751;
|
||||
select * from t2;
|
||||
n
|
||||
1
|
||||
2
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 611 # Relay slave-relay-bin.000004 710 No #
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 783 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 613 # Relay slave-relay-bin.000004 751 No #
|
||||
start slave;
|
||||
stop slave;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=710;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=783;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 781 # Master master-bin.000001 710 No #
|
||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 783 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 783 # Master master-bin.000001 783 No #
|
||||
start slave until master_log_file='master-bin', master_log_pos=561;
|
||||
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
|
||||
@ -67,6 +67,6 @@ ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UN
|
||||
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
|
||||
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||
start slave sql_thread;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=710;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=783;
|
||||
Warnings:
|
||||
Note 1254 Slave is already running
|
||||
|
@ -76,35 +76,35 @@ abcn1n2
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
slave-bin.000001 96 Query 1 187 use `test`; create table t1(n char(30))
|
||||
slave-bin.000001 187 User var 2 230 @`i1`=12345678901234
|
||||
slave-bin.000001 230 User var 2 273 @`i2`=-12345678901234
|
||||
slave-bin.000001 273 User var 2 316 @`i3`=0
|
||||
slave-bin.000001 316 User var 2 359 @`i4`=-1
|
||||
slave-bin.000001 359 Query 1 471 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4)
|
||||
slave-bin.000001 471 User var 2 510 @`r1`=12.5
|
||||
slave-bin.000001 510 User var 2 549 @`r2`=-12.5
|
||||
slave-bin.000001 549 Query 1 647 use `test`; insert into t1 values (@r1), (@r2)
|
||||
slave-bin.000001 647 User var 2 696 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 696 User var 2 731 @`s2`=_latin1 "" COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 731 User var 2 773 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 773 User var 2 815 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 815 User var 2 857 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 857 Query 1 976 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5)
|
||||
slave-bin.000001 976 User var 2 1002 @`n1`=NULL
|
||||
slave-bin.000001 1002 Query 1 1093 use `test`; insert into t1 values (@n1)
|
||||
slave-bin.000001 1093 User var 2 1119 @`n2`=NULL
|
||||
slave-bin.000001 1119 Query 1 1210 use `test`; insert into t1 values (@n2)
|
||||
slave-bin.000001 1210 Query 1 1327 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
|
||||
slave-bin.000001 1327 User var 2 1369 @`a`=2
|
||||
slave-bin.000001 1369 Query 1 1470 use `test`; insert into t1 values (@a+(@b:=@a+1))
|
||||
slave-bin.000001 1470 User var 2 1507 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 1507 Query 1 1640 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
|
||||
slave-bin.000001 1640 User var 2 1682 @`a`=5
|
||||
slave-bin.000001 1682 Query 1 1777 use `test`; insert into t1 values (@a),(@a)
|
||||
slave-bin.000001 1777 User var 2 1802 @`a`=NULL
|
||||
slave-bin.000001 1802 Query 1 1904 use `test`; insert into t1 values (@a),(@a),(@a*5)
|
||||
slave-bin.000001 # Query 1 # use `test`; create table t1(n char(30))
|
||||
slave-bin.000001 # User var 2 # @`i1`=12345678901234
|
||||
slave-bin.000001 # User var 2 # @`i2`=-12345678901234
|
||||
slave-bin.000001 # User var 2 # @`i3`=0
|
||||
slave-bin.000001 # User var 2 # @`i4`=-1
|
||||
slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4)
|
||||
slave-bin.000001 # User var 2 # @`r1`=12.5
|
||||
slave-bin.000001 # User var 2 # @`r2`=-12.5
|
||||
slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@r1), (@r2)
|
||||
slave-bin.000001 # User var 2 # @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 # User var 2 # @`s2`=_latin1 "" COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 # User var 2 # @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 # User var 2 # @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 # User var 2 # @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5)
|
||||
slave-bin.000001 # User var 2 # @`n1`=NULL
|
||||
slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@n1)
|
||||
slave-bin.000001 # User var 2 # @`n2`=NULL
|
||||
slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@n2)
|
||||
slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
|
||||
slave-bin.000001 # User var 2 # @`a`=2
|
||||
slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a+(@b:=@a+1))
|
||||
slave-bin.000001 # User var 2 # @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci
|
||||
slave-bin.000001 # Query 1 # use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
|
||||
slave-bin.000001 # User var 2 # @`a`=5
|
||||
slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a),(@a)
|
||||
slave-bin.000001 # User var 2 # @`a`=NULL
|
||||
slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a),(@a),(@a*5)
|
||||
drop table t1;
|
||||
stop slave;
|
||||
|
@ -2446,3 +2446,12 @@ cast((a - b) as unsigned)
|
||||
1
|
||||
18446744073709551615
|
||||
drop table t1;
|
||||
create table t1 (a int, b int);
|
||||
create table t2 like t1;
|
||||
select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1;
|
||||
a
|
||||
select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1;
|
||||
a
|
||||
select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1;
|
||||
a a a
|
||||
drop table t1,t2;
|
||||
|
@ -122,10 +122,10 @@ EXPLAIN SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JO
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 system PRIMARY NULL NULL NULL 0 const row not found
|
||||
1 PRIMARY t2 ALL DDOCTYPEID_IDX NULL NULL NULL 9 Using where
|
||||
1 PRIMARY t4 eq_ref PRIMARY PRIMARY 32 test.t2.DOCTYPEID 1
|
||||
2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
3 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
4 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
5 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
6 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
1 PRIMARY t4 eq_ref PRIMARY PRIMARY 34 test.t2.DOCTYPEID 1
|
||||
2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 34 func 1 Using index; Using where
|
||||
3 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 34 func 1 Using index; Using where
|
||||
4 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 34 func 1 Using index; Using where
|
||||
5 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 34 func 1 Using index; Using where
|
||||
6 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 func 1 Using index; Using where
|
||||
drop table t1, t2, t3, t4;
|
||||
|
@ -176,13 +176,13 @@ INSERT INTO t1 VALUES(@`a b`);
|
||||
set @var1= "';aaa";
|
||||
SET @var2=char(ascii('a'));
|
||||
insert into t1 values (@var1),(@var2);
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 96 User var 1 137 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
|
||||
master-bin.000001 137 Query 1 230 use `test`; INSERT INTO t1 VALUES(@`a b`)
|
||||
master-bin.000001 230 User var 1 272 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 272 User var 1 310 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 310 Query 1 411 use `test`; insert into t1 values (@var1),(@var2)
|
||||
master-bin.000001 # User var 1 # @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
|
||||
master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@`a b`)
|
||||
master-bin.000001 # User var 1 # @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 # User var 1 # @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 # Query 1 # use `test`; insert into t1 values (@var1),(@var2)
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
ROLLBACK;
|
||||
|
@ -1115,8 +1115,8 @@ select * from v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 MyISAM 9 Fixed 0 0 0 21474836479 1024 0 NULL # # NULL latin1_swedish_ci NULL
|
||||
v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s)
|
||||
t1 MyISAM 9 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
|
||||
v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s)
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1;
|
||||
|
3
mysql-test/std_data/loaddata5.dat
Normal file
3
mysql-test/std_data/loaddata5.dat
Normal file
@ -0,0 +1,3 @@
|
||||
1 2
|
||||
3 4
|
||||
5 6
|
@ -954,4 +954,19 @@ drop table t1;
|
||||
let $default=`select @@storage_engine`;
|
||||
set storage_engine=bdb;
|
||||
source include/varchar.inc;
|
||||
|
||||
#
|
||||
# Some errors/warnings on create
|
||||
#
|
||||
|
||||
create table t1 (v varchar(65530), key(v));
|
||||
drop table if exists t1;
|
||||
create table t1 (v varchar(65536));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 (v varchar(65530) character set utf8);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
# End varchar test
|
||||
eval set storage_engine=$default;
|
||||
|
@ -19,7 +19,8 @@ insert t2 values (5);
|
||||
commit;
|
||||
# first COMMIT must be Query_log_event, second - Xid_log_event
|
||||
--replace_result "xid=18" "xid=11"
|
||||
show binlog events from 96;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 98;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
@ -40,6 +41,8 @@ while ($1)
|
||||
commit;
|
||||
drop table t1;
|
||||
--replace_result "xid=29" "xid=18"
|
||||
show binlog events in 'master-bin.000001' from 96;
|
||||
show binlog events in 'master-bin.000002' from 96;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events in 'master-bin.000001' from 98;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events in 'master-bin.000002' from 98;
|
||||
|
||||
|
@ -338,7 +338,8 @@ create table t2 (c char(30)) charset=ucs2;
|
||||
set @v=convert('abc' using ucs2);
|
||||
reset master;
|
||||
insert into t2 values (@v);
|
||||
show binlog events from 96;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 98;
|
||||
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
|
||||
# absolutely need variables names to be quoted and strings to be
|
||||
# escaped).
|
||||
|
@ -10,11 +10,3 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
ndb_alter_table : NDB team needs to fix
|
||||
ndb_autodiscover : NDB team needs to fix
|
||||
ndb_autodiscover2 : NDB team needs to fix
|
||||
ndb_cache_multi : NDB team needs to fix
|
||||
ndb_cache_multi2 : NDB team needs to fix
|
||||
ndb_multi : NDB team needs to fix
|
||||
ndb_restore : NDB team needs to fix
|
||||
|
||||
|
@ -556,7 +556,7 @@ int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
|
||||
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
|
||||
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
|
||||
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
|
||||
int, i999 int, i1000 int, b blob) row_format=dynamic;
|
||||
int, i999 int, i1000 int, b varchar(256)) row_format=dynamic;
|
||||
|
||||
connection master;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
@ -686,7 +686,7 @@ int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
|
||||
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
|
||||
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
|
||||
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
|
||||
int, i999 int, i1000 int, b blob)
|
||||
int, i999 int, i1000 int, b varchar(256))
|
||||
row_format=dynamic
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
|
@ -37,7 +37,7 @@ connection con1;
|
||||
select * from t1;
|
||||
connection con2;
|
||||
flush tables with read lock;
|
||||
--error 1099;
|
||||
--error 1223
|
||||
drop table t2;
|
||||
connection con1;
|
||||
send drop table t2;
|
||||
|
@ -36,6 +36,7 @@ set @@sql_mode='NO_AUTO_CREATE_USER';
|
||||
select @@sql_mode;
|
||||
--error 1211
|
||||
grant select on `my\_1`.* to mysqltest_4@localhost with grant option;
|
||||
--error 1044
|
||||
grant select on `my\_1`.* to mysqltest_4@localhost identified by 'mypass'
|
||||
with grant option;
|
||||
disconnect user1;
|
||||
|
@ -37,8 +37,7 @@ select * from information_schema.STATISTICS where TABLE_SCHEMA = "testtets";
|
||||
show keys from t3 where Key_name = "a_data";
|
||||
|
||||
show tables like 't%';
|
||||
--replace_column 12 # 13 #
|
||||
--replace_result "2147483647 " "21474836479 "
|
||||
--replace_column 8 # 12 # 13 #
|
||||
show table status;
|
||||
show full columns from t3 like "a%";
|
||||
show full columns from mysql.db like "Insert%";
|
||||
|
@ -1285,15 +1285,30 @@ show variables like "innodb_thread_sleep_delay";
|
||||
# Test varchar
|
||||
#
|
||||
|
||||
#let $default=`select @@storage_engine`;
|
||||
#set storage_engine=INNODB;
|
||||
#source include/varchar.inc;
|
||||
#eval set storage_engine=$default;
|
||||
let $default=`select @@storage_engine`;
|
||||
set storage_engine=INNODB;
|
||||
source include/varchar.inc;
|
||||
|
||||
#
|
||||
# Some errors/warnings on create
|
||||
#
|
||||
|
||||
--error 1005
|
||||
create table t1 (v varchar(65530), key(v));
|
||||
create table t1 (v varchar(65536));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 (v varchar(65530) character set utf8);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
eval set storage_engine=$default;
|
||||
|
||||
# InnoDB specific varchar tests
|
||||
--error 1074
|
||||
create table t1 (v varchar(16384)) engine=innodb;
|
||||
drop table t1;
|
||||
|
||||
# The following should be moved to type_bit.test when innodb will support it
|
||||
--error 1178
|
||||
create table t1 (a bit, key(a)) engine=innodb;
|
||||
--error 1178
|
||||
create table t1 (a bit, key(a)) engine=innodb;
|
||||
|
||||
|
@ -85,6 +85,7 @@ insert into t1 select * from t2;
|
||||
# verify the binlog :
|
||||
let $VERSION=`select version()`;
|
||||
--replace_result $VERSION VERSION
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events;
|
||||
select * from t1;
|
||||
drop table t1, t2;
|
||||
@ -99,6 +100,7 @@ create table t2(unique(a)) select a from t1;
|
||||
# The above should produce an error, *and* not appear in the binlog
|
||||
let $VERSION=`select version()`;
|
||||
--replace_result $VERSION VERSION
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events;
|
||||
drop table t1;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (a date, b date, c date not null, d date);
|
||||
@ -31,3 +31,46 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Let us test extended LOAD DATA features
|
||||
#
|
||||
create table t1 (a int default 100, b int, c varchar(60));
|
||||
# we can do something like this
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
|
||||
select * from t1;
|
||||
truncate table t1;
|
||||
# we can use filled fields in expressions
|
||||
# we also assigning NULL value to field with non-NULL default here
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
|
||||
select * from t1;
|
||||
truncate table t1;
|
||||
# we even can use variables in set clause, and missed columns will be set
|
||||
# with default values
|
||||
set @c:=123;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
|
||||
select * from t1;
|
||||
# let us test side-effect of such load
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, @b);
|
||||
select * from t1;
|
||||
select @a, @b;
|
||||
truncate table t1;
|
||||
# now going to test fixed field-row file format
|
||||
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
|
||||
select * from t1;
|
||||
truncate table t1;
|
||||
# this also should work
|
||||
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
|
||||
select * from t1;
|
||||
# and this should bark
|
||||
--error 1409
|
||||
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
|
||||
|
||||
# Now let us test LOAD DATA with subselect
|
||||
create table t2 (num int primary key, str varchar(10));
|
||||
insert into t2 values (10,'Ten'), (15,'Fifteen');
|
||||
truncate table t1;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
|
||||
select * from t1;
|
||||
|
||||
# cleanup
|
||||
drop table t1, t2;
|
||||
|
@ -27,7 +27,7 @@ commit;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=12" "xid=7"
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -40,7 +40,7 @@ insert into t2 select * from t1;
|
||||
rollback;
|
||||
|
||||
--replace_column 5 #
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -56,7 +56,7 @@ commit;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=45" "xid=24"
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -74,7 +74,7 @@ select a from t1 order by a; # check that savepoints work :)
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=67" "xid=36"
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
|
||||
# and when ROLLBACK is not explicit?
|
||||
delete from t1;
|
||||
@ -95,7 +95,7 @@ connection con2;
|
||||
# logging has been done, we use a user lock.
|
||||
select get_lock("a",10);
|
||||
--replace_column 5 #
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
|
||||
# and when not in a transact1on?
|
||||
delete from t1;
|
||||
@ -107,7 +107,7 @@ insert into t2 select * from t1;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=116" "xid=59"
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
|
||||
# Check that when the query updat1ng the MyISAM table is the first in the
|
||||
# transaction, we log it immediately.
|
||||
@ -120,13 +120,13 @@ begin;
|
||||
insert into t2 select * from t1;
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=130" "xid=65"
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
insert into t1 values(11);
|
||||
commit;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=130" "xid=65" "xid=133" "xid=67"
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
|
||||
|
||||
# Check that things work like before this BEGIN/ROLLBACK code was added,
|
||||
@ -145,7 +145,7 @@ commit;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=152" "xid=77"
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -157,7 +157,7 @@ insert into t2 select * from t1;
|
||||
rollback;
|
||||
|
||||
--replace_column 5 #
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -173,7 +173,7 @@ commit;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=184" "xid=93"
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -191,7 +191,7 @@ select a from t1 order by a; # check that savepoints work :)
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=205" "xid=104"
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
|
||||
# Test for BUG#5714, where a MyISAM update in the transaction used to
|
||||
# release row-level locks in InnoDB
|
||||
|
@ -560,12 +560,26 @@ drop table t1,t2;
|
||||
let $default=`select @@storage_engine`;
|
||||
set storage_engine=MyISAM;
|
||||
source include/varchar.inc;
|
||||
eval set storage_engine=$default;
|
||||
|
||||
#
|
||||
# Some errors/warnings on create
|
||||
#
|
||||
|
||||
create table t1 (v varchar(65530), key(v));
|
||||
drop table if exists t1;
|
||||
create table t1 (v varchar(65536));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 (v varchar(65530) character set utf8);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
# MyISAM specific varchar tests
|
||||
--error 1118
|
||||
create table t1 (v varchar(65535));
|
||||
|
||||
eval set storage_engine=$default;
|
||||
|
||||
#
|
||||
# Test how DROP TABLE works if the index or data file doesn't exists
|
||||
|
||||
|
@ -24,7 +24,6 @@ load data infile '../../std_data/words.dat' into table t1;
|
||||
load data infile '../../std_data/words.dat' into table t1;
|
||||
load data infile '../../std_data/words.dat' into table t1;
|
||||
load data infile '../../std_data/words.dat' into table t1;
|
||||
load data infile '../../std_data/words.dat' into table t1;
|
||||
# simple query to show more in second binlog
|
||||
insert into t1 values ("Alas");
|
||||
flush logs;
|
||||
@ -61,7 +60,7 @@ select "--- --database --" as "";
|
||||
select "--- --position --" as "";
|
||||
--enable_query_log
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --position=119 $MYSQL_TEST_DIR/var/log/master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --position=232 $MYSQL_TEST_DIR/var/log/master-bin.000002
|
||||
|
||||
# These are tests for remote binlog.
|
||||
# They should return the same as previous test.
|
||||
@ -93,7 +92,7 @@ select "--- --database --" as "";
|
||||
select "--- --position --" as "";
|
||||
--enable_query_log
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --position=119 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --position=232 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
|
||||
|
||||
# Bug#7853 (mysqlbinlog does not accept input from stdin)
|
||||
--disable_query_log
|
||||
|
@ -46,11 +46,11 @@ select "--- offset --" as "";
|
||||
--disable_query_log
|
||||
select "--- start-position --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=602 $MYSQL_TEST_DIR/var/log/master-bin.000001
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQL_TEST_DIR/var/log/master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- stop-position --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=602 $MYSQL_TEST_DIR/var/log/master-bin.000001
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=604 $MYSQL_TEST_DIR/var/log/master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- start-datetime --" as "";
|
||||
--enable_query_log
|
||||
@ -75,11 +75,11 @@ select "--- offset --" as "";
|
||||
--disable_query_log
|
||||
select "--- start-position --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=602 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- stop-position --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=124 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=126 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- start-datetime --" as "";
|
||||
--enable_query_log
|
||||
@ -102,11 +102,11 @@ select "--- offset --" as "";
|
||||
--disable_query_log
|
||||
select "--- start-position --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=602 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- stop-position --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=602 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- start-datetime --" as "";
|
||||
--enable_query_log
|
||||
@ -129,11 +129,11 @@ select "--- offset --" as "";
|
||||
--disable_query_log
|
||||
select "--- start-position --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=602 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- stop-position --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=124 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=126 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- start-datetime --" as "";
|
||||
--enable_query_log
|
||||
|
@ -1,5 +1,5 @@
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, `"t"1`, t1aa,t2aa;
|
||||
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa;
|
||||
drop database if exists mysqldump_test_db;
|
||||
drop view if exists v1;
|
||||
--enable_warnings
|
||||
|
@ -107,7 +107,7 @@ connection master;
|
||||
drop database mysqltest2;
|
||||
drop database mysqltest3;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
sync_slave_with_master;
|
||||
|
||||
# Check that we can change global.collation_server (since 5.0.3)
|
||||
|
@ -68,7 +68,7 @@ show slave status;
|
||||
# 2) Test lock wait timeout
|
||||
|
||||
stop slave;
|
||||
change master to master_log_pos=534; # the BEGIN log event
|
||||
change master to master_log_pos=536; # the BEGIN log event
|
||||
begin;
|
||||
select * from t2 for update; # hold lock
|
||||
start slave;
|
||||
@ -89,7 +89,7 @@ set global max_relay_log_size=0;
|
||||
|
||||
# This is really copy-paste of 2) of above
|
||||
stop slave;
|
||||
change master to master_log_pos=534;
|
||||
change master to master_log_pos=536;
|
||||
begin;
|
||||
select * from t2 for update;
|
||||
start slave;
|
||||
|
@ -48,7 +48,8 @@ connection master;
|
||||
--error 0,1053;
|
||||
reap;
|
||||
connection master1;
|
||||
show binlog events from 96;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 98;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
# SQL slave thread should not have stopped (because table of the killed
|
||||
|
@ -18,6 +18,7 @@ rename table t1 to t5, t2 to t1;
|
||||
flush no_write_to_binlog tables;
|
||||
# Check that it's not in the binlog.
|
||||
--replace_result $SERVER_VERSION SERVER_VERSION
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events;
|
||||
# Check that the master is not confused.
|
||||
select * from t3;
|
||||
@ -25,6 +26,7 @@ select * from t3;
|
||||
flush tables;
|
||||
# Check that it's in the binlog.
|
||||
--replace_result $SERVER_VERSION SERVER_VERSION
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
|
@ -36,8 +36,7 @@ select * from t3;
|
||||
# But we can't simply read this binlog, because as the slave has not been
|
||||
# restarted for this test, the file_id is uncertain (would cause test
|
||||
# failures). So instead, we test if the binlog looks long enough to
|
||||
# contain LOAD DATA. That is, I (Guilhem) have done SHOW BINLOG EVENTS on my
|
||||
# machine, saw that the binlog is of size 1068 (in 5.0.0) when things go fine.
|
||||
# contain LOAD DATA. Since 5.0.3 we assume that binlog of 1292 is ok.
|
||||
# If LOAD DATA was not logged, the binlog would be shorter.
|
||||
show master status;
|
||||
|
||||
@ -84,7 +83,9 @@ set sql_log_bin=1;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
# The SQL slave thread should be stopped now.
|
||||
# The SQL slave thread should be stopped now.
|
||||
# Exec_Master_Log_Pos should point to the start of Execute event
|
||||
# for last load data.
|
||||
wait_for_slave_to_stop;
|
||||
|
||||
# CHANGE MASTER and see if error is cleared in SHOW SLAVE STATUS.
|
||||
|
@ -19,5 +19,9 @@ create database mysqltest;
|
||||
create table t1(a int, b int, unique(b));
|
||||
use mysqltest;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
|
||||
show binlog events from 96; # should be nothing
|
||||
# Starting from 5.0.3 LOAD DATA is replicated much in the same way as ordinary
|
||||
# query so "show binlog ..." should show two events (before 5.0.3 no events
|
||||
# were returned).
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 98;
|
||||
drop database mysqltest;
|
||||
|
@ -17,4 +17,4 @@ save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
select count(*) from t1; # check that LOAD was replicated
|
||||
show binlog events from 96; # should be nothing
|
||||
show binlog events from 98; # should be nothing
|
||||
|
@ -34,3 +34,27 @@ drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
||||
#
|
||||
# Now let us test how well we replicate LOAD DATA LOCAL in situation when
|
||||
# we met duplicates in tables to which we are adding rows.
|
||||
# (It supposed that LOAD DATA LOCAL ignores such errors)
|
||||
#
|
||||
connection master;
|
||||
create table t1(a int);
|
||||
insert into t1 values (1), (2), (2), (3);
|
||||
select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1;
|
||||
drop table t1;
|
||||
create table t1(a int primary key);
|
||||
load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1;
|
||||
system rm ./var/master-data/rpl_loaddatalocal.select_outfile ;
|
||||
select * from t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
select * from t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
@ -38,9 +38,9 @@ select count(*) from t1;
|
||||
drop table t1;
|
||||
--replace_result $VERSION VERSION
|
||||
show binlog events;
|
||||
show binlog events from 96 limit 1;
|
||||
show binlog events from 96 limit 2;
|
||||
show binlog events from 96 limit 2,1;
|
||||
show binlog events from 98 limit 1;
|
||||
show binlog events from 98 limit 2;
|
||||
show binlog events from 98 limit 2,1;
|
||||
flush logs;
|
||||
|
||||
# We need an extra update before doing save_master_pos.
|
||||
|
@ -38,7 +38,7 @@ insert into t1 values (1),(2),(3);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
stop slave;
|
||||
change master to master_log_pos=96;
|
||||
change master to master_log_pos=98;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
select * from t1;
|
||||
|
@ -24,6 +24,6 @@ sync_slave_with_master;
|
||||
select * from mysqltest.t1;
|
||||
connection master;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 96;
|
||||
show binlog events from 98;
|
||||
drop database mysqltest;
|
||||
sync_slave_with_master;
|
||||
|
@ -82,6 +82,7 @@ drop temporary table t3;
|
||||
select * from t2;
|
||||
|
||||
--replace_result $VERSION VERSION
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events;
|
||||
|
||||
drop table t1, t2;
|
||||
|
@ -32,6 +32,7 @@ select * from t1;
|
||||
connection master;
|
||||
# We should not see SET ONE_SHOT time_zone before second insert
|
||||
--replace_result $VERSION VERSION
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events;
|
||||
|
||||
#
|
||||
|
@ -24,7 +24,7 @@ show binlog events;
|
||||
|
||||
# try to replicate all queries until drop of t1
|
||||
connection slave;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=304;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=321;
|
||||
sleep 2;
|
||||
# here table should be still not deleted
|
||||
select * from t1;
|
||||
@ -42,7 +42,7 @@ sleep 2;
|
||||
show slave status;
|
||||
|
||||
# try replicate all until second insert to t2;
|
||||
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=710;
|
||||
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=751;
|
||||
sleep 4;
|
||||
select * from t2;
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
@ -58,7 +58,7 @@ sync_with_master;
|
||||
stop slave;
|
||||
|
||||
# this should stop immediately as we are already there
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=710;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=783;
|
||||
# 2 is not enough when running with valgrind
|
||||
real_sleep 4
|
||||
# here the sql slave thread should be stopped
|
||||
@ -77,6 +77,6 @@ start slave until master_log_file='master-bin.000001';
|
||||
start slave until relay_log_file='slave-relay-bin.000002';
|
||||
--error 1277
|
||||
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
|
||||
|
||||
# Warning should be given for second command
|
||||
start slave sql_thread;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=710;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=783;
|
||||
|
@ -46,7 +46,8 @@ save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
select * from t1;
|
||||
show binlog events from 96;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 98;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
|
@ -2015,3 +2015,13 @@ select a-b , (a-b < 0) from t1 order by 1;
|
||||
select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0;
|
||||
select cast((a - b) as unsigned) from t1 order by 1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#8670
|
||||
#
|
||||
create table t1 (a int, b int);
|
||||
create table t2 like t1;
|
||||
select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1;
|
||||
select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1;
|
||||
select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1;
|
||||
drop table t1,t2;
|
||||
|
@ -108,7 +108,8 @@ INSERT INTO t1 VALUES(@`a b`);
|
||||
set @var1= "';aaa";
|
||||
SET @var2=char(ascii('a'));
|
||||
insert into t1 values (@var1),(@var2);
|
||||
show binlog events from 96;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 98;
|
||||
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
|
||||
# absolutely need variables names to be quoted and strings to be
|
||||
# escaped).
|
||||
|
@ -1117,8 +1117,7 @@ create view v1 as select x1() from t1;
|
||||
drop function x1;
|
||||
-- error 1356
|
||||
select * from v1;
|
||||
--replace_column 12 # 13 #
|
||||
--replace_result "2147483647 " "21474836479 "
|
||||
--replace_column 8 # 12 # 13 #
|
||||
show table status;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
@ -14,8 +14,10 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifdef __sgi
|
||||
/* define on IRIX to get posix compliant vsnprintf */
|
||||
#define _XOPEN_SOURCE 500
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <basestring_vsnprintf.h>
|
||||
#include <my_config.h>
|
||||
|
@ -404,12 +404,13 @@ NdbEventOperationImpl::next(int *pOverrun)
|
||||
Uint32 *aDataPtr = ptr[1].p;
|
||||
|
||||
#ifdef EVENT_DEBUG
|
||||
int i;
|
||||
printf("after values sz=%u\n", ptr[1].sz);
|
||||
for(int i=0; i < (int)ptr[1].sz; i++)
|
||||
for(i=0; i < (int)ptr[1].sz; i++)
|
||||
printf ("H'%.8X ",ptr[1].p[i]);
|
||||
printf("\n");
|
||||
printf("before values sz=%u\n", ptr[2].sz);
|
||||
for(int i=0; i < (int)ptr[2].sz; i++)
|
||||
for(i=0; i < (int)ptr[2].sz; i++)
|
||||
printf ("H'%.8X ",ptr[2].p[i]);
|
||||
printf("\n");
|
||||
#endif
|
||||
|
38
sql/field.cc
38
sql/field.cc
@ -5328,11 +5328,11 @@ Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table)
|
||||
|
||||
int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||
{
|
||||
int error= 0;
|
||||
uint32 not_used, copy_length;
|
||||
char buff[STRING_BUFFER_USUAL_SIZE];
|
||||
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
||||
bool lost_only_spaces= FALSE;
|
||||
int error_code= 0;
|
||||
enum MYSQL_ERROR::enum_warning_level level= MYSQL_ERROR::WARN_LEVEL_WARN;
|
||||
|
||||
/* Convert character set if necessary */
|
||||
if (String::needs_conversion(length, cs, field_charset, ¬_used))
|
||||
@ -5342,7 +5342,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||
from= tmpstr.ptr();
|
||||
length= tmpstr.length();
|
||||
if (conv_errors)
|
||||
error= 1;
|
||||
error_code= WARN_DATA_TRUNCATED;
|
||||
}
|
||||
/*
|
||||
Make sure we don't break a multibyte sequence
|
||||
@ -5359,30 +5359,26 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||
int2store(ptr, copy_length);
|
||||
|
||||
// Check if we lost something other than just trailing spaces
|
||||
if ((copy_length < length) && table->in_use->count_cuted_fields)
|
||||
if ((copy_length < length) && table->in_use->count_cuted_fields &&
|
||||
!error_code)
|
||||
{
|
||||
const char *end= from + length;
|
||||
from+= copy_length;
|
||||
from+= field_charset->cset->scan(field_charset, from, end, MY_SEQ_SPACES);
|
||||
/*
|
||||
If we lost only spaces then produce a NOTE, not a WARNING.
|
||||
But if we have already had errors (e.g with charset conversion),
|
||||
then don't reset level to NOTE.
|
||||
*/
|
||||
if (from == end && !error)
|
||||
lost_only_spaces= TRUE;
|
||||
error= 1;
|
||||
/* If we lost only spaces then produce a NOTE, not a WARNING */
|
||||
if (from == end)
|
||||
level= MYSQL_ERROR::WARN_LEVEL_NOTE;
|
||||
error_code= WARN_DATA_TRUNCATED;
|
||||
}
|
||||
if (error)
|
||||
if (error_code)
|
||||
{
|
||||
if (lost_only_spaces)
|
||||
set_warning(MYSQL_ERROR::WARN_LEVEL_NOTE, WARN_DATA_TRUNCATED, 1);
|
||||
else if (table->in_use->abort_on_warning)
|
||||
set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
|
||||
else
|
||||
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
|
||||
if (level == MYSQL_ERROR::WARN_LEVEL_WARN &&
|
||||
table->in_use->abort_on_warning)
|
||||
error_code= ER_DATA_TOO_LONG;
|
||||
set_warning(level, error_code, 1);
|
||||
return 1;
|
||||
}
|
||||
return error;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -7562,7 +7558,7 @@ create_field::create_field(Field *old_field,Field *orig_field)
|
||||
false - otherwise
|
||||
*/
|
||||
bool
|
||||
Field::set_warning(const uint level, const uint code, int cuted_increment)
|
||||
Field::set_warning(uint level, uint code, int cuted_increment)
|
||||
{
|
||||
THD *thd= table->in_use;
|
||||
if (thd->count_cuted_fields)
|
||||
|
@ -279,7 +279,7 @@ public:
|
||||
virtual CHARSET_INFO *sort_charset(void) const { return charset(); }
|
||||
virtual bool has_charset(void) const { return FALSE; }
|
||||
virtual void set_charset(CHARSET_INFO *charset) { }
|
||||
bool set_warning(const unsigned int level, const unsigned int code,
|
||||
bool set_warning(unsigned int level, unsigned int code,
|
||||
int cuted_increment);
|
||||
bool check_int(const char *str, int length, const char *int_end,
|
||||
CHARSET_INFO *cs);
|
||||
|
@ -634,23 +634,12 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table,
|
||||
share->port= MYSQL_PORT;
|
||||
}
|
||||
|
||||
DBUG_PRINT("ha_federated::parse_url",
|
||||
DBUG_PRINT("info",
|
||||
("scheme %s username %s password %s \
|
||||
hostname %s port %d database %s tablename %s\n",
|
||||
share->scheme, share->username, share->password,
|
||||
share->hostname, share->port, share->database,
|
||||
share->table_base_name));
|
||||
|
||||
/* If creation, check first if we can connect and that the table exists */
|
||||
/*if (table_create_flag)
|
||||
{
|
||||
if (check_foreign_data_source(share))
|
||||
goto error;
|
||||
*/
|
||||
/* free share->schema even if no error, since this is a create */
|
||||
/*
|
||||
my_free((gptr) share->scheme, MYF(0));
|
||||
}*/
|
||||
}
|
||||
else
|
||||
goto error;
|
||||
@ -662,7 +651,7 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table,
|
||||
|
||||
error:
|
||||
my_error(error_num, MYF(0),
|
||||
"this connection string is not in the correct format!\n");
|
||||
"connection string is not in the correct format",0);
|
||||
DBUG_RETURN(1);
|
||||
|
||||
}
|
||||
@ -760,7 +749,7 @@ bool ha_federated::create_where_from_key(String *to, KEY *key_info,
|
||||
if (to->append("IS NULL", 7))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
DBUG_PRINT("ha_federated::create_where_from_key",
|
||||
DBUG_PRINT("info",
|
||||
("NULL type %s", to->c_ptr_quick()));
|
||||
key_length-= key_part->store_length;
|
||||
key+= key_part->store_length - 1;
|
||||
@ -790,8 +779,6 @@ bool ha_federated::create_where_from_key(String *to, KEY *key_info,
|
||||
if (to->append(buff, (uint)(ptr - buff)))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
DBUG_PRINT("ha_federated::create_where_from_key",
|
||||
("bit type %s", to->c_ptr_quick()));
|
||||
key_length-= length;
|
||||
continue;
|
||||
}
|
||||
@ -805,8 +792,6 @@ bool ha_federated::create_where_from_key(String *to, KEY *key_info,
|
||||
if (append_escaped(to, &tmp))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
DBUG_PRINT("ha_federated::create_where_from_key",
|
||||
("blob type %s", to->c_ptr_quick()));
|
||||
length= key_part->length;
|
||||
}
|
||||
else if (key_part->key_part_flag & HA_VAR_LENGTH_PART)
|
||||
@ -816,14 +801,9 @@ bool ha_federated::create_where_from_key(String *to, KEY *key_info,
|
||||
tmp.set_quick((char*) key, length, &my_charset_bin);
|
||||
if (append_escaped(to, &tmp))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
DBUG_PRINT("ha_federated::create_where_from_key",
|
||||
("varchar type %s", to->c_ptr_quick()));
|
||||
}
|
||||
else
|
||||
{
|
||||
DBUG_PRINT("ha_federated::create_where_from_key",
|
||||
("else block, unknown type so far"));
|
||||
char buff[MAX_FIELD_WIDTH];
|
||||
String str(buff, sizeof(buff), field->charset()), *res;
|
||||
|
||||
@ -833,16 +813,13 @@ bool ha_federated::create_where_from_key(String *to, KEY *key_info,
|
||||
if (append_escaped(to, res))
|
||||
DBUG_RETURN(1);
|
||||
res= field->val_str(&str, (char*) (key));
|
||||
|
||||
DBUG_PRINT("ha_federated::create_where_from_key",
|
||||
("else block, string type", to->c_ptr_quick()));
|
||||
}
|
||||
else if (to->append(res->ptr(), res->length()))
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (needs_quotes && to->append("'"))
|
||||
DBUG_RETURN(1);
|
||||
DBUG_PRINT("ha_federated::create_where_from_key",
|
||||
DBUG_PRINT("info",
|
||||
("final value for 'to' %s", to->c_ptr_quick()));
|
||||
key+= length;
|
||||
key_length-= length;
|
||||
@ -869,7 +846,7 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
|
||||
|
||||
/* share->table_name has the file location - we want the table's name! */
|
||||
table_base_name= (char*) table->s->table_name;
|
||||
DBUG_PRINT("ha_federated::get_share", ("table_name %s", table_base_name));
|
||||
DBUG_PRINT("info", ("table_name %s", table_base_name));
|
||||
/*
|
||||
So why does this exist? There is no way currently to init a storage engine.
|
||||
Innodb and BDB both have modifications to the server to allow them to
|
||||
@ -909,7 +886,7 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
|
||||
share->select_query= select_query;
|
||||
strmov(share->table_name, table_name);
|
||||
strmov(share->select_query, query.ptr());
|
||||
DBUG_PRINT("ha_federated::get_share",
|
||||
DBUG_PRINT("info",
|
||||
("share->select_query %s", share->select_query));
|
||||
if (my_hash_insert(&federated_open_tables, (byte*) share))
|
||||
goto error;
|
||||
@ -996,11 +973,11 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked)
|
||||
|
||||
/* Connect to foreign database mysql_real_connect() */
|
||||
mysql= mysql_init(0);
|
||||
DBUG_PRINT("ha_federated::open", ("hostname %s", share->hostname));
|
||||
DBUG_PRINT("ha_federated::open", ("username %s", share->username));
|
||||
DBUG_PRINT("ha_federated::open", ("password %s", share->password));
|
||||
DBUG_PRINT("ha_federated::open", ("database %s", share->database));
|
||||
DBUG_PRINT("ha_federated::open", ("port %d", share->port));
|
||||
DBUG_PRINT("info", ("hostname %s", share->hostname));
|
||||
DBUG_PRINT("info", ("username %s", share->username));
|
||||
DBUG_PRINT("info", ("password %s", share->password));
|
||||
DBUG_PRINT("info", ("database %s", share->database));
|
||||
DBUG_PRINT("info", ("port %d", share->port));
|
||||
if (!mysql_real_connect(mysql,
|
||||
share->hostname,
|
||||
share->username,
|
||||
@ -1034,7 +1011,7 @@ int ha_federated::close(void)
|
||||
/* free the result set */
|
||||
if (result)
|
||||
{
|
||||
DBUG_PRINT("ha_federated::close",
|
||||
DBUG_PRINT("info",
|
||||
("mysql_free_result result at address %lx", result));
|
||||
mysql_free_result(result);
|
||||
result= 0;
|
||||
@ -1120,7 +1097,7 @@ int ha_federated::write_row(byte *buf)
|
||||
insert_field_value_string.length(0);
|
||||
|
||||
DBUG_ENTER("ha_federated::write_row");
|
||||
DBUG_PRINT("ha_federated::write_row", ("table charset name %s csname %s",
|
||||
DBUG_PRINT("info", ("table charset name %s csname %s",
|
||||
table->s->table_charset->name, table->s->table_charset->csname));
|
||||
|
||||
statistic_increment(table->in_use->status_var.ha_write_count, &LOCK_status);
|
||||
@ -1133,8 +1110,7 @@ int ha_federated::write_row(byte *buf)
|
||||
this query id
|
||||
*/
|
||||
current_query_id= table->in_use->query_id;
|
||||
DBUG_PRINT("ha_federated::write_row", ("current query id %d",
|
||||
current_query_id));
|
||||
DBUG_PRINT("info", ("current query id %d", current_query_id));
|
||||
|
||||
/* start off our string */
|
||||
insert_string.append("INSERT INTO `");
|
||||
@ -1160,9 +1136,9 @@ int ha_federated::write_row(byte *buf)
|
||||
loop through the field pointer array, add any fields to both the values
|
||||
list and the fields list that match the current query id
|
||||
*/
|
||||
x=0;
|
||||
for (field= table->field; *field; field++, x++)
|
||||
{
|
||||
DBUG_PRINT("ha_federated::write_row", ("field type %d", (*field)->type()));
|
||||
/* if there is a query id and if it's equal to the current query id */
|
||||
if (((*field)->query_id && (*field)->query_id == current_query_id)
|
||||
|| all_fields_have_same_query_id)
|
||||
@ -1171,16 +1147,16 @@ int ha_federated::write_row(byte *buf)
|
||||
|
||||
if ((*field)->is_null())
|
||||
{
|
||||
DBUG_PRINT("ha_federated::write_row",
|
||||
("current query id %d field is_null query id %d",
|
||||
current_query_id, (*field)->query_id));
|
||||
DBUG_PRINT("info",
|
||||
("column %d current query id %d field is_null query id %d",
|
||||
x, current_query_id, (*field)->query_id));
|
||||
insert_field_value_string.append("NULL");
|
||||
}
|
||||
else
|
||||
{
|
||||
DBUG_PRINT("ha_federated::write_row",
|
||||
("current query id %d field is not null query ID %d",
|
||||
current_query_id, (*field)->query_id));
|
||||
DBUG_PRINT("info",
|
||||
("column %d current query id %d field is not null query ID %d",
|
||||
x, current_query_id, (*field)->query_id));
|
||||
(*field)->val_str(&insert_field_value_string);
|
||||
/* quote these fields if they require it */
|
||||
(*field)->quote_data(&insert_field_value_string); }
|
||||
@ -1194,10 +1170,6 @@ int ha_federated::write_row(byte *buf)
|
||||
/* append commas between both fields and fieldnames */
|
||||
insert_string.append(',');
|
||||
values_string.append(',');
|
||||
DBUG_PRINT("ha_federated::write_row",
|
||||
("insert_string %s values_string %s insert_field_value_string %s",
|
||||
insert_string.c_ptr_quick(), values_string.c_ptr_quick(),
|
||||
insert_field_value_string.c_ptr_quick()));
|
||||
|
||||
}
|
||||
}
|
||||
@ -1215,7 +1187,7 @@ int ha_federated::write_row(byte *buf)
|
||||
AND, we don't want to chop off the last char '('
|
||||
insert will be "INSERT INTO t1 VALUES ();"
|
||||
*/
|
||||
DBUG_PRINT("ha_federated::write_row", ("x %d num fields %d", x, num_fields));
|
||||
DBUG_PRINT("info", ("x %d num fields %d", x, num_fields));
|
||||
if (num_fields > 0)
|
||||
{
|
||||
/* chops off leading commas */
|
||||
@ -1228,8 +1200,7 @@ int ha_federated::write_row(byte *buf)
|
||||
/* add the values */
|
||||
insert_string.append(values_string);
|
||||
|
||||
DBUG_PRINT("ha_federated::write_row", ("insert query %s",
|
||||
insert_string.c_ptr_quick()));
|
||||
DBUG_PRINT("info", ("insert query %s", insert_string.c_ptr_quick()));
|
||||
|
||||
if (mysql_real_query(mysql, insert_string.ptr(), insert_string.length()))
|
||||
{
|
||||
@ -1240,6 +1211,7 @@ int ha_federated::write_row(byte *buf)
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Yes, update_row() does what you expect, it updates a row. old_data will have
|
||||
the previous row record in it, while new_data will have the newest data in
|
||||
@ -1286,7 +1258,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
|
||||
primary_key_field_num= has_a_primary_key ?
|
||||
table->key_info[table->s->primary_key].key_part->fieldnr - 1 : -1;
|
||||
if (has_a_primary_key)
|
||||
DBUG_PRINT("ha_federated::update_row", ("has a primary key"));
|
||||
DBUG_PRINT("info", ("has a primary key"));
|
||||
|
||||
update_string.append("UPDATE `");
|
||||
update_string.append(share->table_base_name);
|
||||
@ -1324,7 +1296,10 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
|
||||
update_string.append('=');
|
||||
|
||||
if ((*field)->is_null())
|
||||
{
|
||||
DBUG_PRINT("info", ("column %d is NULL", x ));
|
||||
new_field_value.append("NULL");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* otherwise = */
|
||||
@ -1356,12 +1331,18 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
|
||||
where_string.append(" IS NULL ");
|
||||
else
|
||||
{
|
||||
uint o_len;
|
||||
(*field)->val_str(&old_field_value,
|
||||
(char*) (old_data + (*field)->offset()));
|
||||
o_len= (*field)->pack_length();
|
||||
DBUG_PRINT("info", ("o_len %lu", o_len));
|
||||
(*field)->quote_data(&old_field_value);
|
||||
where_string.append(old_field_value);
|
||||
}
|
||||
}
|
||||
DBUG_PRINT("info",
|
||||
("column %d new value %s old value %s",
|
||||
x, new_field_value.c_ptr_quick(), old_field_value.c_ptr_quick() ));
|
||||
update_string.append(new_field_value);
|
||||
new_field_value.length(0);
|
||||
|
||||
@ -1378,7 +1359,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
|
||||
if (! has_a_primary_key)
|
||||
update_string.append(" LIMIT 1");
|
||||
|
||||
DBUG_PRINT("ha_federated::update_row", ("Final update query: %s",
|
||||
DBUG_PRINT("info", ("Final update query: %s",
|
||||
update_string.c_ptr_quick()));
|
||||
if (mysql_real_query(mysql, update_string.ptr(), update_string.length()))
|
||||
{
|
||||
@ -1447,7 +1428,7 @@ int ha_federated::delete_row(const byte *buf)
|
||||
}
|
||||
|
||||
delete_string.append(" LIMIT 1");
|
||||
DBUG_PRINT("ha_federated::delete_row",
|
||||
DBUG_PRINT("info",
|
||||
("Delete sql: %s", delete_string.c_ptr_quick()));
|
||||
if (mysql_real_query(mysql, delete_string.ptr(), delete_string.length()))
|
||||
{
|
||||
@ -1513,12 +1494,12 @@ int ha_federated::index_read_idx(byte *buf, uint index, const byte *key,
|
||||
create_where_from_key(&index_string, &table->key_info[index], key, keylen);
|
||||
sql_query.append(index_string);
|
||||
|
||||
DBUG_PRINT("ha_federated::index_read_idx",
|
||||
DBUG_PRINT("info",
|
||||
("current key %d key value %s index_string value %s length %d",
|
||||
index, (char*) key, index_string.c_ptr_quick(),
|
||||
index_string.length()));
|
||||
|
||||
DBUG_PRINT("ha_federated::index_read_idx",
|
||||
DBUG_PRINT("info",
|
||||
("current position %d sql_query %s", current_position,
|
||||
sql_query.c_ptr_quick()));
|
||||
|
||||
@ -1554,7 +1535,7 @@ int ha_federated::index_init(uint keynr)
|
||||
{
|
||||
int error;
|
||||
DBUG_ENTER("ha_federated::index_init");
|
||||
DBUG_PRINT("ha_federated::index_init",
|
||||
DBUG_PRINT("info",
|
||||
("table: '%s' key: %d", table->s->table_name, keynr));
|
||||
active_index= keynr;
|
||||
DBUG_RETURN(0);
|
||||
@ -1623,11 +1604,10 @@ int ha_federated::rnd_init(bool scan)
|
||||
scan_flag= scan;
|
||||
if (scan)
|
||||
{
|
||||
DBUG_PRINT("ha_federated::rnd_init",
|
||||
("share->select_query %s", share->select_query));
|
||||
DBUG_PRINT("info", ("share->select_query %s", share->select_query));
|
||||
if (result)
|
||||
{
|
||||
DBUG_PRINT("ha_federated::rnd_init",
|
||||
DBUG_PRINT("info",
|
||||
("mysql_free_result address %lx", result));
|
||||
mysql_free_result(result);
|
||||
result= 0;
|
||||
@ -1652,8 +1632,7 @@ int ha_federated::rnd_end()
|
||||
DBUG_ENTER("ha_federated::rnd_end");
|
||||
if (result)
|
||||
{
|
||||
DBUG_PRINT("ha_federated::index_end",
|
||||
("mysql_free_result address %lx", result));
|
||||
DBUG_PRINT("info", ("mysql_free_result address %lx", result));
|
||||
mysql_free_result(result);
|
||||
result= 0;
|
||||
}
|
||||
@ -1696,8 +1675,7 @@ int ha_federated::rnd_next(byte *buf)
|
||||
|
||||
/* Fetch a row, insert it back in a row format. */
|
||||
current_position= result->data_cursor;
|
||||
DBUG_PRINT("ha_federated::rnd_next",
|
||||
("current position %d", current_position));
|
||||
DBUG_PRINT("info", ("current position %d", current_position));
|
||||
if (!(row= mysql_fetch_row(result)))
|
||||
DBUG_RETURN(HA_ERR_END_OF_FILE);
|
||||
|
||||
@ -1941,7 +1919,7 @@ int ha_federated::create(const char *name, TABLE *table_arg,
|
||||
DBUG_RETURN(0);
|
||||
|
||||
error:
|
||||
DBUG_PRINT("ha_federated::create", ("errors, returning %d", ER_CANT_CREATE_TABLE));
|
||||
DBUG_PRINT("info", ("errors, returning %d", ER_CANT_CREATE_TABLE));
|
||||
my_free((gptr) tmp.scheme, MYF(0));
|
||||
DBUG_RETURN(ER_CANT_CREATE_TABLE);
|
||||
|
||||
|
@ -2920,6 +2920,7 @@ calc_row_difference(
|
||||
ulint o_len;
|
||||
ulint n_len;
|
||||
ulint col_pack_len;
|
||||
byte* new_mysql_row_col;
|
||||
byte* o_ptr;
|
||||
byte* n_ptr;
|
||||
byte* buf;
|
||||
@ -2948,10 +2949,17 @@ calc_row_difference(
|
||||
o_ptr = (byte*) old_row + get_field_offset(table, field);
|
||||
n_ptr = (byte*) new_row + get_field_offset(table, field);
|
||||
|
||||
/* Use new_mysql_row_col and col_pack_len save the values */
|
||||
|
||||
new_mysql_row_col = n_ptr;
|
||||
col_pack_len = field->pack_length();
|
||||
|
||||
o_len = col_pack_len;
|
||||
n_len = col_pack_len;
|
||||
|
||||
/* We use o_ptr and n_ptr to dig up the actual data for
|
||||
comparison. */
|
||||
|
||||
field_mysql_type = field->type();
|
||||
|
||||
col_type = get_innobase_type_from_mysql_type(field);
|
||||
@ -3017,13 +3025,11 @@ calc_row_difference(
|
||||
&dfield,
|
||||
(byte*)buf,
|
||||
TRUE,
|
||||
n_ptr,
|
||||
new_mysql_row_col,
|
||||
col_pack_len,
|
||||
prebuilt->table->comp);
|
||||
ufield->new_val.data =
|
||||
dfield_get_data(&dfield);
|
||||
ufield->new_val.len =
|
||||
dfield_get_len(&dfield);
|
||||
ufield->new_val.data = dfield.data;
|
||||
ufield->new_val.len = dfield.len;
|
||||
} else {
|
||||
ufield->new_val.data = NULL;
|
||||
ufield->new_val.len = UNIV_SQL_NULL;
|
||||
@ -4031,7 +4037,11 @@ create_index(
|
||||
col_type = get_innobase_type_from_mysql_type(key_part->field);
|
||||
|
||||
if (DATA_BLOB == col_type
|
||||
|| key_part->length < field->pack_length()) {
|
||||
|| (key_part->length < field->pack_length()
|
||||
&& field->type() != MYSQL_TYPE_VARCHAR)
|
||||
|| (field->type() == MYSQL_TYPE_VARCHAR
|
||||
&& key_part->length < field->pack_length()
|
||||
- ((Field_varstring*)field)->length_bytes)) {
|
||||
|
||||
prefix_len = key_part->length;
|
||||
|
||||
|
@ -762,6 +762,14 @@ static char* xid_to_str(char *buf, XID *xid)
|
||||
for (i=0; i < xid->gtrid_length+xid->bqual_length; i++)
|
||||
{
|
||||
uchar c=(uchar)xid->data[i];
|
||||
bool is_next_dig;
|
||||
if (i < XIDDATASIZE)
|
||||
{
|
||||
char ch=xid->data[i+1];
|
||||
is_next_dig=(c >= '0' && c <='9');
|
||||
}
|
||||
else
|
||||
is_next_dig=FALSE;
|
||||
if (i == xid->gtrid_length)
|
||||
{
|
||||
*s++='\'';
|
||||
@ -774,9 +782,11 @@ static char* xid_to_str(char *buf, XID *xid)
|
||||
if (c < 32 || c > 126)
|
||||
{
|
||||
*s++='\\';
|
||||
*s++='x';
|
||||
*s++=_dig_vec_lower[c >> 4];
|
||||
*s++=_dig_vec_lower[c & 15];
|
||||
if (c > 077 || is_next_dig)
|
||||
*s++=_dig_vec_lower[c >> 6];
|
||||
if (c > 007 || is_next_dig)
|
||||
*s++=_dig_vec_lower[(c >> 3) & 7];
|
||||
*s++=_dig_vec_lower[c & 7];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -834,7 +844,7 @@ int ha_recover(HASH *commit_list)
|
||||
for now, only InnoDB supports 2pc. It means we can always safely
|
||||
rollback all pending transactions, without risking inconsistent data
|
||||
*/
|
||||
DBUG_ASSERT(total_ha_2pc == opt_bin_log+1); // only InnoDB and binlog
|
||||
DBUG_ASSERT(total_ha_2pc == (ulong) opt_bin_log+1); // only InnoDB and binlog
|
||||
tc_heuristic_recover= TC_HEURISTIC_RECOVER_ROLLBACK; // forcing ROLLBACK
|
||||
dry_run=FALSE;
|
||||
#endif
|
||||
@ -862,6 +872,10 @@ int ha_recover(HASH *commit_list)
|
||||
my_xid x=list[i].get_my_xid();
|
||||
if (!x) // not "mine" - that is generated by external TM
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
char buf[XIDDATASIZE*4+6]; // see xid_to_str
|
||||
sql_print_information("ignore xid %s", xid_to_str(buf, list+i));
|
||||
#endif
|
||||
found_foreign_xids++;
|
||||
continue;
|
||||
}
|
||||
@ -962,9 +976,9 @@ bool mysql_xa_recover(THD *thd)
|
||||
if (xid->get_my_xid())
|
||||
continue; // skip "our" xids
|
||||
protocol->prepare_for_resend();
|
||||
protocol->store_long((longlong)xid->formatID);
|
||||
protocol->store_long((longlong)xid->gtrid_length);
|
||||
protocol->store_long((longlong)xid->bqual_length);
|
||||
protocol->store_longlong((longlong)xid->formatID, FALSE);
|
||||
protocol->store_longlong((longlong)xid->gtrid_length, FALSE);
|
||||
protocol->store_longlong((longlong)xid->bqual_length, FALSE);
|
||||
protocol->store(xid->data, xid->gtrid_length+xid->bqual_length,
|
||||
&my_charset_bin);
|
||||
if (protocol->write())
|
||||
|
125
sql/item_func.cc
125
sql/item_func.cc
@ -3294,12 +3294,28 @@ Item_func_set_user_var::fix_length_and_dec()
|
||||
}
|
||||
|
||||
|
||||
bool Item_func_set_user_var::update_hash(void *ptr, uint length,
|
||||
Item_result type,
|
||||
CHARSET_INFO *cs,
|
||||
Derivation dv)
|
||||
/*
|
||||
Set value to user variable.
|
||||
|
||||
SYNOPSYS
|
||||
update_hash()
|
||||
entry - pointer to structure representing variable
|
||||
set_null - should we set NULL value ?
|
||||
ptr - pointer to buffer with new value
|
||||
length - length of new value
|
||||
type - type of new value
|
||||
cs - charset info for new value
|
||||
dv - derivation for new value
|
||||
|
||||
RETURN VALUE
|
||||
False - success, True - failure
|
||||
*/
|
||||
|
||||
static bool
|
||||
update_hash(user_var_entry *entry, bool set_null, void *ptr, uint length,
|
||||
Item_result type, CHARSET_INFO *cs, Derivation dv)
|
||||
{
|
||||
if ((null_value=args[0]->null_value))
|
||||
if (set_null)
|
||||
{
|
||||
char *pos= (char*) entry+ ALIGN_SIZE(sizeof(user_var_entry));
|
||||
if (entry->value && entry->value != pos)
|
||||
@ -3332,7 +3348,7 @@ bool Item_func_set_user_var::update_hash(void *ptr, uint length,
|
||||
entry->value=0;
|
||||
if (!(entry->value=(char*) my_realloc(entry->value, length,
|
||||
MYF(MY_ALLOW_ZERO_PTR))))
|
||||
goto err;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (type == STRING_RESULT)
|
||||
@ -3348,11 +3364,21 @@ bool Item_func_set_user_var::update_hash(void *ptr, uint length,
|
||||
entry->collation.set(cs, dv);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
err:
|
||||
current_thd->fatal_error(); // Probably end of memory
|
||||
null_value= 1;
|
||||
return 1;
|
||||
|
||||
bool
|
||||
Item_func_set_user_var::update_hash(void *ptr, uint length, Item_result type,
|
||||
CHARSET_INFO *cs, Derivation dv)
|
||||
{
|
||||
if (::update_hash(entry, (null_value= args[0]->null_value),
|
||||
ptr, length, type, cs, dv))
|
||||
{
|
||||
current_thd->fatal_error(); // Probably end of memory
|
||||
null_value= 1;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -3878,6 +3904,77 @@ bool Item_func_get_user_var::eq(const Item *item, bool binary_cmp) const
|
||||
}
|
||||
|
||||
|
||||
bool Item_user_var_as_out_param::fix_fields(THD *thd, TABLE_LIST *tables,
|
||||
Item **ref)
|
||||
{
|
||||
DBUG_ASSERT(fixed == 0);
|
||||
if (Item::fix_fields(thd, tables, ref) ||
|
||||
!(entry= get_variable(&thd->user_vars, name, 1)))
|
||||
return TRUE;
|
||||
entry->type= STRING_RESULT;
|
||||
/*
|
||||
Let us set the same collation which is used for loading
|
||||
of fields in LOAD DATA INFILE.
|
||||
(Since Item_user_var_as_out_param is used only there).
|
||||
*/
|
||||
entry->collation.set(thd->variables.collation_database);
|
||||
entry->update_query_id= thd->query_id;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
void Item_user_var_as_out_param::set_null_value(CHARSET_INFO* cs)
|
||||
{
|
||||
if (::update_hash(entry, TRUE, 0, 0, STRING_RESULT, cs,
|
||||
DERIVATION_IMPLICIT))
|
||||
current_thd->fatal_error(); // Probably end of memory
|
||||
}
|
||||
|
||||
|
||||
void Item_user_var_as_out_param::set_value(const char *str, uint length,
|
||||
CHARSET_INFO* cs)
|
||||
{
|
||||
if (::update_hash(entry, FALSE, (void*)str, length, STRING_RESULT, cs,
|
||||
DERIVATION_IMPLICIT))
|
||||
current_thd->fatal_error(); // Probably end of memory
|
||||
}
|
||||
|
||||
|
||||
double Item_user_var_as_out_param::val_real()
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
longlong Item_user_var_as_out_param::val_int()
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
String* Item_user_var_as_out_param::val_str(String *str)
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
my_decimal* Item_user_var_as_out_param::val_decimal(my_decimal *decimal_buffer)
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void Item_user_var_as_out_param::print(String *str)
|
||||
{
|
||||
str->append('@');
|
||||
str->append(name.str,name.length);
|
||||
}
|
||||
|
||||
|
||||
longlong Item_func_inet_aton::val_int()
|
||||
{
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
@ -4370,19 +4467,19 @@ Item_func_sp::Item_func_sp(sp_name *name)
|
||||
{
|
||||
maybe_null= 1;
|
||||
m_name->init_qname(current_thd);
|
||||
dummy_table= (TABLE *)sql_alloc(sizeof(TABLE));
|
||||
bzero(dummy_table, sizeof(TABLE));
|
||||
dummy_table= (TABLE*) sql_calloc(sizeof(TABLE));
|
||||
}
|
||||
|
||||
|
||||
Item_func_sp::Item_func_sp(sp_name *name, List<Item> &list)
|
||||
:Item_func(list), m_name(name), m_sp(NULL)
|
||||
{
|
||||
maybe_null= 1;
|
||||
m_name->init_qname(current_thd);
|
||||
dummy_table= (TABLE *)sql_alloc(sizeof(TABLE));
|
||||
bzero(dummy_table, sizeof(TABLE));
|
||||
dummy_table= (TABLE*) sql_calloc(sizeof(TABLE));
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
Item_func_sp::func_name() const
|
||||
{
|
||||
|
@ -1131,6 +1131,35 @@ public:
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
This item represents user variable used as out parameter (e.g in LOAD DATA),
|
||||
and it is supposed to be used only for this purprose. So it is simplified
|
||||
a lot. Actually you should never obtain its value.
|
||||
|
||||
The only two reasons for this thing being an Item is possibility to store it
|
||||
in List<Item> and desire to place this code somewhere near other functions
|
||||
working with user variables.
|
||||
*/
|
||||
class Item_user_var_as_out_param :public Item
|
||||
{
|
||||
LEX_STRING name;
|
||||
user_var_entry *entry;
|
||||
public:
|
||||
Item_user_var_as_out_param(LEX_STRING a) : name(a) {}
|
||||
/* We should return something different from FIELD_ITEM here */
|
||||
enum Type type() const { return STRING_ITEM;}
|
||||
double val_real();
|
||||
longlong val_int();
|
||||
String *val_str(String *str);
|
||||
my_decimal *val_decimal(my_decimal *decimal_buffer);
|
||||
/* fix_fields() binds variable name with its entry structure */
|
||||
bool fix_fields(THD *thd, struct st_table_list *tables, Item **ref);
|
||||
void print(String *str);
|
||||
void set_null_value(CHARSET_INFO* cs);
|
||||
void set_value(const char *str, uint length, CHARSET_INFO* cs);
|
||||
};
|
||||
|
||||
|
||||
class Item_func_inet_aton : public Item_int_func
|
||||
{
|
||||
public:
|
||||
|
@ -727,7 +727,7 @@ Item_sum_avg_distinct::fix_length_and_dec()
|
||||
AVG() will divide val by count. We need to reserve digits
|
||||
after decimal point as the result can be fractional.
|
||||
*/
|
||||
decimals+= 4;
|
||||
decimals= min(decimals + 4, NOT_FIXED_DEC);
|
||||
}
|
||||
|
||||
|
||||
@ -927,7 +927,7 @@ void Item_sum_variance::fix_length_and_dec()
|
||||
{
|
||||
DBUG_ENTER("Item_sum_variance::fix_length_and_dec");
|
||||
maybe_null= null_value= 1;
|
||||
decimals= args[0]->decimals + 4;
|
||||
decimals= min(args[0]->decimals + 4, NOT_FIXED_DEC);
|
||||
switch (args[0]->result_type()) {
|
||||
case REAL_RESULT:
|
||||
case STRING_RESULT:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user