mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
convert files from CRLF to LF line endings
This commit is contained in:
parent
e774008b04
commit
b5c5f3176a
171 changed files with 14008 additions and 14008 deletions
|
@ -1,417 +1,417 @@
|
|||
/************* Colblk C++ Functions Source Code File (.CPP) ************/
|
||||
/* Name: COLBLK.CPP Version 2.1 */
|
||||
/* */
|
||||
/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */
|
||||
/* */
|
||||
/* This file contains the COLBLK class functions. */
|
||||
/***********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
/* Include relevant MariaDB header file. */
|
||||
/***********************************************************************/
|
||||
#include "my_global.h"
|
||||
|
||||
/***********************************************************************/
|
||||
/* Include required application header files */
|
||||
/* global.h is header containing all global Plug declarations. */
|
||||
/* plgdbsem.h is header containing the DB applic. declarations. */
|
||||
/***********************************************************************/
|
||||
#include "global.h"
|
||||
#include "plgdbsem.h"
|
||||
#include "tabcol.h"
|
||||
#include "colblk.h"
|
||||
#include "xindex.h"
|
||||
#include "xtable.h"
|
||||
|
||||
/***********************************************************************/
|
||||
/* COLBLK protected constructor. */
|
||||
/***********************************************************************/
|
||||
COLBLK::COLBLK(PCOLDEF cdp, PTDB tdbp, int i)
|
||||
{
|
||||
Next = NULL;
|
||||
Index = i;
|
||||
//Number = 0;
|
||||
ColUse = 0;
|
||||
|
||||
if ((Cdp = cdp)) {
|
||||
Name = cdp->Name;
|
||||
Format = cdp->F;
|
||||
Opt = cdp->Opt;
|
||||
Long = cdp->Long;
|
||||
Precision = cdp->Precision;
|
||||
Freq = cdp->Freq;
|
||||
Buf_Type = cdp->Buf_Type;
|
||||
ColUse |= cdp->Flags; // Used by CONNECT
|
||||
Nullable = !!(cdp->Flags & U_NULLS);
|
||||
Unsigned = !!(cdp->Flags & U_UNSIGNED);
|
||||
} else {
|
||||
Name = NULL;
|
||||
memset(&Format, 0, sizeof(FORMAT));
|
||||
Opt = 0;
|
||||
Long = 0;
|
||||
Precision = 0;
|
||||
Freq = 0;
|
||||
Buf_Type = TYPE_ERROR;
|
||||
Nullable = false;
|
||||
Unsigned = false;
|
||||
} // endif cdp
|
||||
|
||||
To_Tdb = tdbp;
|
||||
Status = BUF_NO;
|
||||
//Value = NULL; done in XOBJECT constructor
|
||||
To_Kcol = NULL;
|
||||
} // end of COLBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* COLBLK constructor used for copying columns. */
|
||||
/* tdbp is the pointer to the new table descriptor. */
|
||||
/***********************************************************************/
|
||||
COLBLK::COLBLK(PCOL col1, PTDB tdbp)
|
||||
{
|
||||
PCOL colp;
|
||||
|
||||
// Copy the old column block to the new one
|
||||
*this = *col1;
|
||||
Next = NULL;
|
||||
//To_Orig = col1;
|
||||
To_Tdb = tdbp;
|
||||
|
||||
if (trace > 1)
|
||||
htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this);
|
||||
|
||||
if (tdbp)
|
||||
// Attach the new column to the table block
|
||||
if (!tdbp->GetColumns())
|
||||
tdbp->SetColumns(this);
|
||||
else {
|
||||
for (colp = tdbp->GetColumns(); colp->Next; colp = colp->Next) ;
|
||||
|
||||
colp->Next = this;
|
||||
} // endelse
|
||||
|
||||
} // end of COLBLK copy constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* Reset the column descriptor to non evaluated yet. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::Reset(void)
|
||||
{
|
||||
Status &= ~BUF_READ;
|
||||
} // end of Reset
|
||||
|
||||
/***********************************************************************/
|
||||
/* Compare: compares itself to an (expression) object and returns */
|
||||
/* true if it is equivalent. */
|
||||
/***********************************************************************/
|
||||
bool COLBLK::Compare(PXOB xp)
|
||||
{
|
||||
return (this == xp);
|
||||
} // end of Compare
|
||||
|
||||
/***********************************************************************/
|
||||
/* SetFormat: function used to set SELECT output format. */
|
||||
/***********************************************************************/
|
||||
bool COLBLK::SetFormat(PGLOBAL g, FORMAT& fmt)
|
||||
{
|
||||
fmt = Format;
|
||||
|
||||
if (trace > 1)
|
||||
htrc("COLBLK: %p format=%c(%d,%d)\n",
|
||||
this, *fmt.Type, fmt.Length, fmt.Prec);
|
||||
|
||||
return false;
|
||||
} // end of SetFormat
|
||||
|
||||
/***********************************************************************/
|
||||
/* Eval: get the column value from the last read record or from a */
|
||||
/* matching Index column if there is one. */
|
||||
/***********************************************************************/
|
||||
bool COLBLK::Eval(PGLOBAL g)
|
||||
{
|
||||
if (trace > 1)
|
||||
htrc("Col Eval: %s status=%.4X\n", Name, Status);
|
||||
|
||||
if (!GetStatus(BUF_READ)) {
|
||||
// if (To_Tdb->IsNull())
|
||||
// Value->Reset();
|
||||
if (To_Kcol)
|
||||
To_Kcol->FillValue(Value);
|
||||
else
|
||||
ReadColumn(g);
|
||||
|
||||
AddStatus(BUF_READ);
|
||||
} // endif
|
||||
|
||||
return false;
|
||||
} // end of Eval
|
||||
|
||||
/***********************************************************************/
|
||||
/* InitValue: prepare a column block for read operation. */
|
||||
/* Now we use Format.Length for the len parameter to avoid strings */
|
||||
/* to be truncated when converting from string to coded string. */
|
||||
/* Added in version 1.5 is the arguments GetScale() and Domain */
|
||||
/* in calling AllocateValue. Domain is used for TYPE_DATE only. */
|
||||
/***********************************************************************/
|
||||
bool COLBLK::InitValue(PGLOBAL g)
|
||||
{
|
||||
if (Value)
|
||||
return false; // Already done
|
||||
|
||||
// Allocate a Value object
|
||||
if (!(Value = AllocateValue(g, Buf_Type, Precision,
|
||||
GetScale(), Unsigned, GetDomain())))
|
||||
return true;
|
||||
|
||||
AddStatus(BUF_READY);
|
||||
Value->SetNullable(Nullable);
|
||||
|
||||
if (trace > 1)
|
||||
htrc(" colp=%p type=%d value=%p coluse=%.4X status=%.4X\n",
|
||||
this, Buf_Type, Value, ColUse, Status);
|
||||
|
||||
return false;
|
||||
} // end of InitValue
|
||||
|
||||
/***********************************************************************/
|
||||
/* SetBuffer: prepare a column block for write operation. */
|
||||
/***********************************************************************/
|
||||
bool COLBLK::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
|
||||
{
|
||||
sprintf(g->Message, MSG(UNDEFINED_AM), "SetBuffer");
|
||||
return true;
|
||||
} // end of SetBuffer
|
||||
|
||||
/***********************************************************************/
|
||||
/* GetLength: returns an evaluation of the column string length. */
|
||||
/***********************************************************************/
|
||||
int COLBLK::GetLengthEx(void)
|
||||
{
|
||||
return Long;
|
||||
} // end of GetLengthEx
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to access the last line */
|
||||
/* read from the corresponding table, extract from it the field */
|
||||
/* corresponding to this column and convert it to buffer type. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
sprintf(g->Message, MSG(UNDEFINED_AM), "ReadColumn");
|
||||
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
|
||||
} // end of ReadColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* WriteColumn: what this routine does is to access the last line */
|
||||
/* read from the corresponding table, and rewrite the field */
|
||||
/* corresponding to this column from the column buffer and type. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::WriteColumn(PGLOBAL g)
|
||||
{
|
||||
sprintf(g->Message, MSG(UNDEFINED_AM), "WriteColumn");
|
||||
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
|
||||
} // end of WriteColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* Make file output of a column descriptor block. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::Print(PGLOBAL g, FILE *f, uint n)
|
||||
{
|
||||
char m[64];
|
||||
int i;
|
||||
PCOL colp;
|
||||
|
||||
memset(m, ' ', n); // Make margin string
|
||||
m[n] = '\0';
|
||||
|
||||
for (colp = To_Tdb->GetColumns(), i = 1; colp; colp = colp->Next, i++)
|
||||
if (colp == this)
|
||||
break;
|
||||
|
||||
fprintf(f, "%sR%dC%d type=%d F=%.2s(%d,%d)", m, To_Tdb->GetTdb_No(),
|
||||
i, GetAmType(), Format.Type, Format.Length, Format.Prec);
|
||||
fprintf(f,
|
||||
" coluse=%04X status=%04X buftyp=%d value=%p name=%s\n",
|
||||
ColUse, Status, Buf_Type, Value, Name);
|
||||
} // end of Print
|
||||
|
||||
/***********************************************************************/
|
||||
/* Make string output of a column descriptor block. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::Print(PGLOBAL g, char *ps, uint z)
|
||||
{
|
||||
sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name);
|
||||
} // end of Print
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
/* SPCBLK constructor. */
|
||||
/***********************************************************************/
|
||||
SPCBLK::SPCBLK(PCOLUMN cp)
|
||||
: COLBLK((PCOLDEF)NULL, cp->GetTo_Table()->GetTo_Tdb(), 0)
|
||||
{
|
||||
Name = (char*)cp->GetName();
|
||||
Precision = Long = 0;
|
||||
Buf_Type = TYPE_ERROR;
|
||||
} // end of SPCBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* WriteColumn: what this routine does is to access the last line */
|
||||
/* read from the corresponding table, and rewrite the field */
|
||||
/* corresponding to this column from the column buffer and type. */
|
||||
/***********************************************************************/
|
||||
void SPCBLK::WriteColumn(PGLOBAL g)
|
||||
{
|
||||
sprintf(g->Message, MSG(SPCOL_READONLY), Name);
|
||||
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
|
||||
} // end of WriteColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* RIDBLK constructor for the ROWID special column. */
|
||||
/***********************************************************************/
|
||||
RIDBLK::RIDBLK(PCOLUMN cp, bool rnm) : SPCBLK(cp)
|
||||
{
|
||||
Precision = Long = 10;
|
||||
Buf_Type = TYPE_INT;
|
||||
Rnm = rnm;
|
||||
*Format.Type = 'N';
|
||||
Format.Length = 10;
|
||||
} // end of RIDBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to return the ordinal */
|
||||
/* number of the current row in the table (if Rnm is true) or in the */
|
||||
/* current file (if Rnm is false) the same except for multiple tables.*/
|
||||
/***********************************************************************/
|
||||
void RIDBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
Value->SetValue(To_Tdb->RowNumber(g, Rnm));
|
||||
} // end of ReadColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* FIDBLK constructor for the FILEID special column. */
|
||||
/***********************************************************************/
|
||||
FIDBLK::FIDBLK(PCOLUMN cp, OPVAL op) : SPCBLK(cp), Op(op)
|
||||
{
|
||||
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
|
||||
Precision = Long = _MAX_PATH;
|
||||
Buf_Type = TYPE_STRING;
|
||||
*Format.Type = 'C';
|
||||
Format.Length = Long;
|
||||
#if defined(WIN32)
|
||||
Format.Prec = 1; // Case insensitive
|
||||
#endif // WIN32
|
||||
Constant = (!((PTDBASE)To_Tdb)->GetDef()->GetMultiple() &&
|
||||
To_Tdb->GetAmType() != TYPE_AM_PLG &&
|
||||
To_Tdb->GetAmType() != TYPE_AM_PLM);
|
||||
Fn = NULL;
|
||||
} // end of FIDBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to return the current */
|
||||
/* file ID of the table (can change for Multiple tables). */
|
||||
/***********************************************************************/
|
||||
void FIDBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
if (Fn != ((PTDBASE)To_Tdb)->GetFile(g)) {
|
||||
char filename[_MAX_PATH];
|
||||
|
||||
Fn = ((PTDBASE)To_Tdb)->GetFile(g);
|
||||
PlugSetPath(filename, Fn, ((PTDBASE)To_Tdb)->GetPath());
|
||||
|
||||
if (Op != OP_XX) {
|
||||
char buff[_MAX_PATH];
|
||||
|
||||
Value->SetValue_psz(ExtractFromPath(g, buff, filename, Op));
|
||||
} else
|
||||
Value->SetValue_psz(filename);
|
||||
|
||||
} // endif Fn
|
||||
|
||||
} // end of ReadColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* TIDBLK constructor for the TABID special column. */
|
||||
/***********************************************************************/
|
||||
TIDBLK::TIDBLK(PCOLUMN cp) : SPCBLK(cp)
|
||||
{
|
||||
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
|
||||
Precision = Long = 64;
|
||||
Buf_Type = TYPE_STRING;
|
||||
*Format.Type = 'C';
|
||||
Format.Length = Long;
|
||||
Format.Prec = 1; // Case insensitive
|
||||
Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL);
|
||||
Tname = NULL;
|
||||
} // end of TIDBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to return the table ID. */
|
||||
/***********************************************************************/
|
||||
void TIDBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
if (Tname == NULL) {
|
||||
Tname = (char*)To_Tdb->GetName();
|
||||
Value->SetValue_psz(Tname);
|
||||
} // endif Tname
|
||||
|
||||
} // end of ReadColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* PRTBLK constructor for the PARTID special column. */
|
||||
/***********************************************************************/
|
||||
PRTBLK::PRTBLK(PCOLUMN cp) : SPCBLK(cp)
|
||||
{
|
||||
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
|
||||
Precision = Long = 64;
|
||||
Buf_Type = TYPE_STRING;
|
||||
*Format.Type = 'C';
|
||||
Format.Length = Long;
|
||||
Format.Prec = 1; // Case insensitive
|
||||
Constant = true; // TODO: check whether this is true indeed
|
||||
Pname = NULL;
|
||||
} // end of PRTBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to return the partition ID. */
|
||||
/***********************************************************************/
|
||||
void PRTBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
if (Pname == NULL) {
|
||||
char *p;
|
||||
PTDBASE tdbp = (PTDBASE)To_Tdb;
|
||||
|
||||
Pname = tdbp->GetDef()->GetStringCatInfo(g, "partname", "?");
|
||||
|
||||
p = strrchr(Pname, '#');
|
||||
Value->SetValue_psz((p) ? p + 1 : Pname);
|
||||
} // endif Pname
|
||||
|
||||
} // end of ReadColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* SIDBLK constructor for the SERVID special column. */
|
||||
/***********************************************************************/
|
||||
SIDBLK::SIDBLK(PCOLUMN cp) : SPCBLK(cp)
|
||||
{
|
||||
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
|
||||
Precision = Long = 64;
|
||||
Buf_Type = TYPE_STRING;
|
||||
*Format.Type = 'C';
|
||||
Format.Length = Long;
|
||||
Format.Prec = 1; // Case insensitive
|
||||
Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL);
|
||||
Sname = NULL;
|
||||
} // end of TIDBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to return the server ID. */
|
||||
/***********************************************************************/
|
||||
void SIDBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
//if (Sname == NULL) {
|
||||
Sname = (char*)To_Tdb->GetServer();
|
||||
Value->SetValue_psz(Sname);
|
||||
// } // endif Sname
|
||||
|
||||
} // end of ReadColumn
|
||||
|
||||
/************* Colblk C++ Functions Source Code File (.CPP) ************/
|
||||
/* Name: COLBLK.CPP Version 2.1 */
|
||||
/* */
|
||||
/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */
|
||||
/* */
|
||||
/* This file contains the COLBLK class functions. */
|
||||
/***********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
/* Include relevant MariaDB header file. */
|
||||
/***********************************************************************/
|
||||
#include "my_global.h"
|
||||
|
||||
/***********************************************************************/
|
||||
/* Include required application header files */
|
||||
/* global.h is header containing all global Plug declarations. */
|
||||
/* plgdbsem.h is header containing the DB applic. declarations. */
|
||||
/***********************************************************************/
|
||||
#include "global.h"
|
||||
#include "plgdbsem.h"
|
||||
#include "tabcol.h"
|
||||
#include "colblk.h"
|
||||
#include "xindex.h"
|
||||
#include "xtable.h"
|
||||
|
||||
/***********************************************************************/
|
||||
/* COLBLK protected constructor. */
|
||||
/***********************************************************************/
|
||||
COLBLK::COLBLK(PCOLDEF cdp, PTDB tdbp, int i)
|
||||
{
|
||||
Next = NULL;
|
||||
Index = i;
|
||||
//Number = 0;
|
||||
ColUse = 0;
|
||||
|
||||
if ((Cdp = cdp)) {
|
||||
Name = cdp->Name;
|
||||
Format = cdp->F;
|
||||
Opt = cdp->Opt;
|
||||
Long = cdp->Long;
|
||||
Precision = cdp->Precision;
|
||||
Freq = cdp->Freq;
|
||||
Buf_Type = cdp->Buf_Type;
|
||||
ColUse |= cdp->Flags; // Used by CONNECT
|
||||
Nullable = !!(cdp->Flags & U_NULLS);
|
||||
Unsigned = !!(cdp->Flags & U_UNSIGNED);
|
||||
} else {
|
||||
Name = NULL;
|
||||
memset(&Format, 0, sizeof(FORMAT));
|
||||
Opt = 0;
|
||||
Long = 0;
|
||||
Precision = 0;
|
||||
Freq = 0;
|
||||
Buf_Type = TYPE_ERROR;
|
||||
Nullable = false;
|
||||
Unsigned = false;
|
||||
} // endif cdp
|
||||
|
||||
To_Tdb = tdbp;
|
||||
Status = BUF_NO;
|
||||
//Value = NULL; done in XOBJECT constructor
|
||||
To_Kcol = NULL;
|
||||
} // end of COLBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* COLBLK constructor used for copying columns. */
|
||||
/* tdbp is the pointer to the new table descriptor. */
|
||||
/***********************************************************************/
|
||||
COLBLK::COLBLK(PCOL col1, PTDB tdbp)
|
||||
{
|
||||
PCOL colp;
|
||||
|
||||
// Copy the old column block to the new one
|
||||
*this = *col1;
|
||||
Next = NULL;
|
||||
//To_Orig = col1;
|
||||
To_Tdb = tdbp;
|
||||
|
||||
if (trace > 1)
|
||||
htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this);
|
||||
|
||||
if (tdbp)
|
||||
// Attach the new column to the table block
|
||||
if (!tdbp->GetColumns())
|
||||
tdbp->SetColumns(this);
|
||||
else {
|
||||
for (colp = tdbp->GetColumns(); colp->Next; colp = colp->Next) ;
|
||||
|
||||
colp->Next = this;
|
||||
} // endelse
|
||||
|
||||
} // end of COLBLK copy constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* Reset the column descriptor to non evaluated yet. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::Reset(void)
|
||||
{
|
||||
Status &= ~BUF_READ;
|
||||
} // end of Reset
|
||||
|
||||
/***********************************************************************/
|
||||
/* Compare: compares itself to an (expression) object and returns */
|
||||
/* true if it is equivalent. */
|
||||
/***********************************************************************/
|
||||
bool COLBLK::Compare(PXOB xp)
|
||||
{
|
||||
return (this == xp);
|
||||
} // end of Compare
|
||||
|
||||
/***********************************************************************/
|
||||
/* SetFormat: function used to set SELECT output format. */
|
||||
/***********************************************************************/
|
||||
bool COLBLK::SetFormat(PGLOBAL g, FORMAT& fmt)
|
||||
{
|
||||
fmt = Format;
|
||||
|
||||
if (trace > 1)
|
||||
htrc("COLBLK: %p format=%c(%d,%d)\n",
|
||||
this, *fmt.Type, fmt.Length, fmt.Prec);
|
||||
|
||||
return false;
|
||||
} // end of SetFormat
|
||||
|
||||
/***********************************************************************/
|
||||
/* Eval: get the column value from the last read record or from a */
|
||||
/* matching Index column if there is one. */
|
||||
/***********************************************************************/
|
||||
bool COLBLK::Eval(PGLOBAL g)
|
||||
{
|
||||
if (trace > 1)
|
||||
htrc("Col Eval: %s status=%.4X\n", Name, Status);
|
||||
|
||||
if (!GetStatus(BUF_READ)) {
|
||||
// if (To_Tdb->IsNull())
|
||||
// Value->Reset();
|
||||
if (To_Kcol)
|
||||
To_Kcol->FillValue(Value);
|
||||
else
|
||||
ReadColumn(g);
|
||||
|
||||
AddStatus(BUF_READ);
|
||||
} // endif
|
||||
|
||||
return false;
|
||||
} // end of Eval
|
||||
|
||||
/***********************************************************************/
|
||||
/* InitValue: prepare a column block for read operation. */
|
||||
/* Now we use Format.Length for the len parameter to avoid strings */
|
||||
/* to be truncated when converting from string to coded string. */
|
||||
/* Added in version 1.5 is the arguments GetScale() and Domain */
|
||||
/* in calling AllocateValue. Domain is used for TYPE_DATE only. */
|
||||
/***********************************************************************/
|
||||
bool COLBLK::InitValue(PGLOBAL g)
|
||||
{
|
||||
if (Value)
|
||||
return false; // Already done
|
||||
|
||||
// Allocate a Value object
|
||||
if (!(Value = AllocateValue(g, Buf_Type, Precision,
|
||||
GetScale(), Unsigned, GetDomain())))
|
||||
return true;
|
||||
|
||||
AddStatus(BUF_READY);
|
||||
Value->SetNullable(Nullable);
|
||||
|
||||
if (trace > 1)
|
||||
htrc(" colp=%p type=%d value=%p coluse=%.4X status=%.4X\n",
|
||||
this, Buf_Type, Value, ColUse, Status);
|
||||
|
||||
return false;
|
||||
} // end of InitValue
|
||||
|
||||
/***********************************************************************/
|
||||
/* SetBuffer: prepare a column block for write operation. */
|
||||
/***********************************************************************/
|
||||
bool COLBLK::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
|
||||
{
|
||||
sprintf(g->Message, MSG(UNDEFINED_AM), "SetBuffer");
|
||||
return true;
|
||||
} // end of SetBuffer
|
||||
|
||||
/***********************************************************************/
|
||||
/* GetLength: returns an evaluation of the column string length. */
|
||||
/***********************************************************************/
|
||||
int COLBLK::GetLengthEx(void)
|
||||
{
|
||||
return Long;
|
||||
} // end of GetLengthEx
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to access the last line */
|
||||
/* read from the corresponding table, extract from it the field */
|
||||
/* corresponding to this column and convert it to buffer type. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
sprintf(g->Message, MSG(UNDEFINED_AM), "ReadColumn");
|
||||
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
|
||||
} // end of ReadColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* WriteColumn: what this routine does is to access the last line */
|
||||
/* read from the corresponding table, and rewrite the field */
|
||||
/* corresponding to this column from the column buffer and type. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::WriteColumn(PGLOBAL g)
|
||||
{
|
||||
sprintf(g->Message, MSG(UNDEFINED_AM), "WriteColumn");
|
||||
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
|
||||
} // end of WriteColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* Make file output of a column descriptor block. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::Print(PGLOBAL g, FILE *f, uint n)
|
||||
{
|
||||
char m[64];
|
||||
int i;
|
||||
PCOL colp;
|
||||
|
||||
memset(m, ' ', n); // Make margin string
|
||||
m[n] = '\0';
|
||||
|
||||
for (colp = To_Tdb->GetColumns(), i = 1; colp; colp = colp->Next, i++)
|
||||
if (colp == this)
|
||||
break;
|
||||
|
||||
fprintf(f, "%sR%dC%d type=%d F=%.2s(%d,%d)", m, To_Tdb->GetTdb_No(),
|
||||
i, GetAmType(), Format.Type, Format.Length, Format.Prec);
|
||||
fprintf(f,
|
||||
" coluse=%04X status=%04X buftyp=%d value=%p name=%s\n",
|
||||
ColUse, Status, Buf_Type, Value, Name);
|
||||
} // end of Print
|
||||
|
||||
/***********************************************************************/
|
||||
/* Make string output of a column descriptor block. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::Print(PGLOBAL g, char *ps, uint z)
|
||||
{
|
||||
sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name);
|
||||
} // end of Print
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
/* SPCBLK constructor. */
|
||||
/***********************************************************************/
|
||||
SPCBLK::SPCBLK(PCOLUMN cp)
|
||||
: COLBLK((PCOLDEF)NULL, cp->GetTo_Table()->GetTo_Tdb(), 0)
|
||||
{
|
||||
Name = (char*)cp->GetName();
|
||||
Precision = Long = 0;
|
||||
Buf_Type = TYPE_ERROR;
|
||||
} // end of SPCBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* WriteColumn: what this routine does is to access the last line */
|
||||
/* read from the corresponding table, and rewrite the field */
|
||||
/* corresponding to this column from the column buffer and type. */
|
||||
/***********************************************************************/
|
||||
void SPCBLK::WriteColumn(PGLOBAL g)
|
||||
{
|
||||
sprintf(g->Message, MSG(SPCOL_READONLY), Name);
|
||||
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
|
||||
} // end of WriteColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* RIDBLK constructor for the ROWID special column. */
|
||||
/***********************************************************************/
|
||||
RIDBLK::RIDBLK(PCOLUMN cp, bool rnm) : SPCBLK(cp)
|
||||
{
|
||||
Precision = Long = 10;
|
||||
Buf_Type = TYPE_INT;
|
||||
Rnm = rnm;
|
||||
*Format.Type = 'N';
|
||||
Format.Length = 10;
|
||||
} // end of RIDBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to return the ordinal */
|
||||
/* number of the current row in the table (if Rnm is true) or in the */
|
||||
/* current file (if Rnm is false) the same except for multiple tables.*/
|
||||
/***********************************************************************/
|
||||
void RIDBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
Value->SetValue(To_Tdb->RowNumber(g, Rnm));
|
||||
} // end of ReadColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* FIDBLK constructor for the FILEID special column. */
|
||||
/***********************************************************************/
|
||||
FIDBLK::FIDBLK(PCOLUMN cp, OPVAL op) : SPCBLK(cp), Op(op)
|
||||
{
|
||||
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
|
||||
Precision = Long = _MAX_PATH;
|
||||
Buf_Type = TYPE_STRING;
|
||||
*Format.Type = 'C';
|
||||
Format.Length = Long;
|
||||
#if defined(WIN32)
|
||||
Format.Prec = 1; // Case insensitive
|
||||
#endif // WIN32
|
||||
Constant = (!((PTDBASE)To_Tdb)->GetDef()->GetMultiple() &&
|
||||
To_Tdb->GetAmType() != TYPE_AM_PLG &&
|
||||
To_Tdb->GetAmType() != TYPE_AM_PLM);
|
||||
Fn = NULL;
|
||||
} // end of FIDBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to return the current */
|
||||
/* file ID of the table (can change for Multiple tables). */
|
||||
/***********************************************************************/
|
||||
void FIDBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
if (Fn != ((PTDBASE)To_Tdb)->GetFile(g)) {
|
||||
char filename[_MAX_PATH];
|
||||
|
||||
Fn = ((PTDBASE)To_Tdb)->GetFile(g);
|
||||
PlugSetPath(filename, Fn, ((PTDBASE)To_Tdb)->GetPath());
|
||||
|
||||
if (Op != OP_XX) {
|
||||
char buff[_MAX_PATH];
|
||||
|
||||
Value->SetValue_psz(ExtractFromPath(g, buff, filename, Op));
|
||||
} else
|
||||
Value->SetValue_psz(filename);
|
||||
|
||||
} // endif Fn
|
||||
|
||||
} // end of ReadColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* TIDBLK constructor for the TABID special column. */
|
||||
/***********************************************************************/
|
||||
TIDBLK::TIDBLK(PCOLUMN cp) : SPCBLK(cp)
|
||||
{
|
||||
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
|
||||
Precision = Long = 64;
|
||||
Buf_Type = TYPE_STRING;
|
||||
*Format.Type = 'C';
|
||||
Format.Length = Long;
|
||||
Format.Prec = 1; // Case insensitive
|
||||
Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL);
|
||||
Tname = NULL;
|
||||
} // end of TIDBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to return the table ID. */
|
||||
/***********************************************************************/
|
||||
void TIDBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
if (Tname == NULL) {
|
||||
Tname = (char*)To_Tdb->GetName();
|
||||
Value->SetValue_psz(Tname);
|
||||
} // endif Tname
|
||||
|
||||
} // end of ReadColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* PRTBLK constructor for the PARTID special column. */
|
||||
/***********************************************************************/
|
||||
PRTBLK::PRTBLK(PCOLUMN cp) : SPCBLK(cp)
|
||||
{
|
||||
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
|
||||
Precision = Long = 64;
|
||||
Buf_Type = TYPE_STRING;
|
||||
*Format.Type = 'C';
|
||||
Format.Length = Long;
|
||||
Format.Prec = 1; // Case insensitive
|
||||
Constant = true; // TODO: check whether this is true indeed
|
||||
Pname = NULL;
|
||||
} // end of PRTBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to return the partition ID. */
|
||||
/***********************************************************************/
|
||||
void PRTBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
if (Pname == NULL) {
|
||||
char *p;
|
||||
PTDBASE tdbp = (PTDBASE)To_Tdb;
|
||||
|
||||
Pname = tdbp->GetDef()->GetStringCatInfo(g, "partname", "?");
|
||||
|
||||
p = strrchr(Pname, '#');
|
||||
Value->SetValue_psz((p) ? p + 1 : Pname);
|
||||
} // endif Pname
|
||||
|
||||
} // end of ReadColumn
|
||||
|
||||
/***********************************************************************/
|
||||
/* SIDBLK constructor for the SERVID special column. */
|
||||
/***********************************************************************/
|
||||
SIDBLK::SIDBLK(PCOLUMN cp) : SPCBLK(cp)
|
||||
{
|
||||
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
|
||||
Precision = Long = 64;
|
||||
Buf_Type = TYPE_STRING;
|
||||
*Format.Type = 'C';
|
||||
Format.Length = Long;
|
||||
Format.Prec = 1; // Case insensitive
|
||||
Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL);
|
||||
Sname = NULL;
|
||||
} // end of TIDBLK constructor
|
||||
|
||||
/***********************************************************************/
|
||||
/* ReadColumn: what this routine does is to return the server ID. */
|
||||
/***********************************************************************/
|
||||
void SIDBLK::ReadColumn(PGLOBAL g)
|
||||
{
|
||||
//if (Sname == NULL) {
|
||||
Sname = (char*)To_Tdb->GetServer();
|
||||
Value->SetValue_psz(Sname);
|
||||
// } // endif Sname
|
||||
|
||||
} // end of ReadColumn
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
# Use default setting for mysqld processes
|
||||
!include include/default_mysqld.cnf
|
||||
!include include/default_client.cnf
|
||||
|
||||
[mysqld.1]
|
||||
#log-bin= master-bin
|
||||
|
||||
[mysqld.2]
|
||||
|
||||
[ENV]
|
||||
MASTER_MYPORT= @mysqld.1.port
|
||||
MASTER_MYSOCK= @mysqld.1.socket
|
||||
|
||||
SLAVE_MYPORT= @mysqld.2.port
|
||||
SLAVE_MYSOCK= @mysqld.2.socket
|
||||
|
||||
PGCLIENTENCODING= UTF8
|
||||
# Use default setting for mysqld processes
|
||||
!include include/default_mysqld.cnf
|
||||
!include include/default_client.cnf
|
||||
|
||||
[mysqld.1]
|
||||
#log-bin= master-bin
|
||||
|
||||
[mysqld.2]
|
||||
|
||||
[ENV]
|
||||
MASTER_MYPORT= @mysqld.1.port
|
||||
MASTER_MYSOCK= @mysqld.1.socket
|
||||
|
||||
SLAVE_MYPORT= @mysqld.2.port
|
||||
SLAVE_MYSOCK= @mysqld.2.socket
|
||||
|
||||
PGCLIENTENCODING= UTF8
|
||||
|
|
|
@ -1,45 +1,45 @@
|
|||
[
|
||||
{
|
||||
"ISBN": "9782212090819",
|
||||
"LANG": "fr",
|
||||
"SUBJECT": "applications",
|
||||
"AUTHOR": [
|
||||
{
|
||||
"FIRSTNAME": "Jean-Christophe",
|
||||
"LASTNAME": "Bernadac"
|
||||
},
|
||||
{
|
||||
"FIRSTNAME": "François",
|
||||
"LASTNAME": "Knab"
|
||||
}
|
||||
],
|
||||
"TITLE": "Construire une application XML",
|
||||
"PUBLISHER": {
|
||||
"NAME": "Eyrolles",
|
||||
"PLACE": "Paris"
|
||||
},
|
||||
"DATEPUB": 1999
|
||||
},
|
||||
{
|
||||
"ISBN": "9782840825685",
|
||||
"LANG": "fr",
|
||||
"SUBJECT": "applications",
|
||||
"AUTHOR": [
|
||||
{
|
||||
"FIRSTNAME": "William J.",
|
||||
"LASTNAME": "Pardi"
|
||||
}
|
||||
],
|
||||
"TITLE": "XML en Action",
|
||||
"TRANSLATION": "adapté de l'anglais par",
|
||||
"TRANSLATOR": {
|
||||
"FIRSTNAME": "James",
|
||||
"LASTNAME": "Guerin"
|
||||
},
|
||||
"PUBLISHER": {
|
||||
"NAME": "Microsoft Press",
|
||||
"PLACE": "Paris"
|
||||
},
|
||||
"DATEPUB": 1999
|
||||
}
|
||||
]
|
||||
[
|
||||
{
|
||||
"ISBN": "9782212090819",
|
||||
"LANG": "fr",
|
||||
"SUBJECT": "applications",
|
||||
"AUTHOR": [
|
||||
{
|
||||
"FIRSTNAME": "Jean-Christophe",
|
||||
"LASTNAME": "Bernadac"
|
||||
},
|
||||
{
|
||||
"FIRSTNAME": "François",
|
||||
"LASTNAME": "Knab"
|
||||
}
|
||||
],
|
||||
"TITLE": "Construire une application XML",
|
||||
"PUBLISHER": {
|
||||
"NAME": "Eyrolles",
|
||||
"PLACE": "Paris"
|
||||
},
|
||||
"DATEPUB": 1999
|
||||
},
|
||||
{
|
||||
"ISBN": "9782840825685",
|
||||
"LANG": "fr",
|
||||
"SUBJECT": "applications",
|
||||
"AUTHOR": [
|
||||
{
|
||||
"FIRSTNAME": "William J.",
|
||||
"LASTNAME": "Pardi"
|
||||
}
|
||||
],
|
||||
"TITLE": "XML en Action",
|
||||
"TRANSLATION": "adapté de l'anglais par",
|
||||
"TRANSLATOR": {
|
||||
"FIRSTNAME": "James",
|
||||
"LASTNAME": "Guerin"
|
||||
},
|
||||
"PUBLISHER": {
|
||||
"NAME": "Microsoft Press",
|
||||
"PLACE": "Paris"
|
||||
},
|
||||
"DATEPUB": 1999
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<bookstore>
|
||||
<book category="COOKING">
|
||||
<title lang="en">Everyday Italian</title>
|
||||
<author>Giada De Laurentiis</author>
|
||||
<year>2005</year>
|
||||
<price>30.00</price>
|
||||
</book>
|
||||
<book category="CHILDREN">
|
||||
<title lang="en">Harry Potter</title>
|
||||
<author>J K. Rowling</author>
|
||||
<year>2005</year>
|
||||
<price>29.99</price>
|
||||
</book>
|
||||
<book category="WEB">
|
||||
<title lang="en">XQuery Kick Start</title>
|
||||
<author>James McGovern</author>
|
||||
<author>Per Bothner</author>
|
||||
<author>Kurt Cagle</author>
|
||||
<author>James Linn</author>
|
||||
<author>Vaidyanathan Nagarajan</author>
|
||||
<year>2003</year>
|
||||
<price>49.99</price>
|
||||
</book>
|
||||
<book category="WEB">
|
||||
<title lang="en">Learning XML</title>
|
||||
<author>Erik T. Ray</author>
|
||||
<year>2003</year>
|
||||
<price>39.95</price>
|
||||
</book>
|
||||
</bookstore>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<bookstore>
|
||||
<book category="COOKING">
|
||||
<title lang="en">Everyday Italian</title>
|
||||
<author>Giada De Laurentiis</author>
|
||||
<year>2005</year>
|
||||
<price>30.00</price>
|
||||
</book>
|
||||
<book category="CHILDREN">
|
||||
<title lang="en">Harry Potter</title>
|
||||
<author>J K. Rowling</author>
|
||||
<year>2005</year>
|
||||
<price>29.99</price>
|
||||
</book>
|
||||
<book category="WEB">
|
||||
<title lang="en">XQuery Kick Start</title>
|
||||
<author>James McGovern</author>
|
||||
<author>Per Bothner</author>
|
||||
<author>Kurt Cagle</author>
|
||||
<author>James Linn</author>
|
||||
<author>Vaidyanathan Nagarajan</author>
|
||||
<year>2003</year>
|
||||
<price>49.99</price>
|
||||
</book>
|
||||
<book category="WEB">
|
||||
<title lang="en">Learning XML</title>
|
||||
<author>Erik T. Ray</author>
|
||||
<year>2003</year>
|
||||
<price>39.95</price>
|
||||
</book>
|
||||
</bookstore>
|
||||
|
|
|
@ -1,158 +1,158 @@
|
|||
[
|
||||
{
|
||||
"WHO": "Joe",
|
||||
"WEEK": [
|
||||
{
|
||||
"NUMBER": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 18.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 20.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 16.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Beth",
|
||||
"WEEK": [
|
||||
{
|
||||
"NUMBER": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 16.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 15.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 20.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Janet",
|
||||
"WEEK": [
|
||||
{
|
||||
"NUMBER": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 18.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 18.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 17.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
[
|
||||
{
|
||||
"WHO": "Joe",
|
||||
"WEEK": [
|
||||
{
|
||||
"NUMBER": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 18.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 20.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 16.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Beth",
|
||||
"WEEK": [
|
||||
{
|
||||
"NUMBER": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 16.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 15.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 20.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Janet",
|
||||
"WEEK": [
|
||||
{
|
||||
"NUMBER": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 18.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 18.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 17.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"NUMBER": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,52 +1,52 @@
|
|||
[
|
||||
{
|
||||
"WHO": "Joe",
|
||||
"WEEK": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 18.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 20.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Beth",
|
||||
"WEEK": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 16.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Janet",
|
||||
"WEEK": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 18.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 18.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
[
|
||||
{
|
||||
"WHO": "Joe",
|
||||
"WEEK": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 18.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 20.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Beth",
|
||||
"WEEK": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 16.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Janet",
|
||||
"WEEK": 3,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 18.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 18.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,52 +1,52 @@
|
|||
[
|
||||
{
|
||||
"WHO": "Joe",
|
||||
"WEEK": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 16.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Beth",
|
||||
"WEEK": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 15.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Janet",
|
||||
"WEEK": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 17.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
[
|
||||
{
|
||||
"WHO": "Joe",
|
||||
"WEEK": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 16.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Beth",
|
||||
"WEEK": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 17.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 15.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Janet",
|
||||
"WEEK": 4,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 17.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,52 +1,52 @@
|
|||
[
|
||||
{
|
||||
"WHO": "Joe",
|
||||
"WEEK": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Beth",
|
||||
"WEEK": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 20.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Janet",
|
||||
"WEEK": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
[
|
||||
{
|
||||
"WHO": "Joe",
|
||||
"WEEK": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Beth",
|
||||
"WEEK": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 20.00
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"WHO": "Janet",
|
||||
"WEEK": 5,
|
||||
"EXPENSE": [
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 14.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Car",
|
||||
"AMOUNT": 12.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Beer",
|
||||
"AMOUNT": 19.00
|
||||
},
|
||||
{
|
||||
"WHAT": "Food",
|
||||
"AMOUNT": 12.00
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
0;Inconnu
|
||||
1;Masculin
|
||||
2;Feminin
|
||||
0;Inconnu
|
||||
1;Masculin
|
||||
2;Feminin
|
||||
|
|
|
|
@ -1,7 +1,7 @@
|
|||
.;Inconnu
|
||||
C;Celibataire
|
||||
D;Divorce
|
||||
L;Union libre
|
||||
M;Marie
|
||||
S;Separe
|
||||
V;Veuf
|
||||
.;Inconnu
|
||||
C;Celibataire
|
||||
D;Divorce
|
||||
L;Union libre
|
||||
M;Marie
|
||||
S;Separe
|
||||
V;Veuf
|
||||
|
|
|
|
@ -1,139 +1,139 @@
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # Testing indexing with ALTER on inward table (in-place)
|
||||
--echo #
|
||||
CREATE TABLE t1 (c INT NOT NULL, d CHAR(10) NOT NULL) ENGINE=CONNECT;
|
||||
INSERT INTO t1 VALUES (1,'One'), (2,'Two'), (3,'Three');
|
||||
SELECT * FROM t1;
|
||||
CREATE INDEX xc ON t1(c);
|
||||
DESCRIBE SELECT * FROM t1 WHERE c = 2;
|
||||
DROP INDEX xc ON t1;
|
||||
CREATE INDEX xd ON t1(d);
|
||||
DROP INDEX xd ON t1;
|
||||
ALTER TABLE t1 ADD INDEX xc (c), ADD INDEX xd (d);
|
||||
SHOW INDEX FROM t1;
|
||||
ALTER TABLE t1 DROP INDEX xc, DROP INDEX xd;
|
||||
SHOW INDEX FROM t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing modifying columns inward table (not in-place)
|
||||
--echo #
|
||||
ALTER TABLE t1 MODIFY COLUMN c CHAR(5) NOT NULL;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 MODIFY COLUMN c INT NOT NULL;
|
||||
|
||||
--echo #
|
||||
--echo # Fails because indexing must be in-place
|
||||
--echo #
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
||||
ALTER TABLE t1 MODIFY COLUMN c CHAR(10) NOT NULL, ADD INDEX xd (d);
|
||||
|
||||
--echo #
|
||||
--echo # Testing changing table type (not in-place)
|
||||
--echo #
|
||||
ALTER TABLE t1 TABLE_TYPE=CSV HEADER=1 QUOTED=1;
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--echo # create an outward table used to see the t1 file
|
||||
CREATE TABLE t2 (line VARCHAR(100) NOT NULL) ENGINE=CONNECT FILE_NAME='t1.csv';
|
||||
SELECT * FROM t2;
|
||||
|
||||
--echo #
|
||||
--echo # Testing changing engine
|
||||
--echo #
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c INT NOT NULL, d CHAR(10) NOT NULL) ENGINE=CONNECT;
|
||||
INSERT INTO t1 VALUES (1,'One'), (2,'Two'), (3,'Three');
|
||||
ALTER TABLE t1 ADD INDEX xc (c), ADD INDEX xd (d);
|
||||
ALTER TABLE t1 ENGINE = MYISAM;
|
||||
SHOW CREATE TABLE t1;
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 ENGINE = CONNECT TABLE_TYPE=DBF;
|
||||
SHOW CREATE TABLE t1;
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # Testing ALTER on outward tables
|
||||
--echo #
|
||||
CREATE TABLE t1 (c INT NOT NULL, d CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='tf1.txt' ENDING=1;
|
||||
INSERT INTO t1 VALUES (1,'One'), (2,'Two'), (3,'Three');
|
||||
SELECT * FROM t1;
|
||||
CREATE TABLE t2 (line VARCHAR(100) NOT NULL) ENGINE=CONNECT FILE_NAME='tf1.txt';
|
||||
SELECT * FROM t2;
|
||||
|
||||
--echo #
|
||||
--echo # Indexing works the same
|
||||
--echo #
|
||||
ALTER TABLE t1 ADD INDEX xc (c), ADD INDEX xd (d);
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT d FROM t1 WHERE c = 2;
|
||||
ALTER TABLE t1 DROP INDEX xc, DROP INDEX xd;
|
||||
SHOW INDEX FROM t1;
|
||||
|
||||
--echo #
|
||||
--echo # Other alterations do not modify the file
|
||||
--echo #
|
||||
ALTER TABLE t1 MODIFY COLUMN c CHAR(5) NOT NULL;
|
||||
SELECT * FROM t2;
|
||||
SHOW CREATE TABLE t1;
|
||||
#Wrong result
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 MODIFY COLUMN c INT NOT NULL;
|
||||
|
||||
--echo #
|
||||
--echo # Changing column order
|
||||
--echo #
|
||||
ALTER TABLE t1 MODIFY COLUMN c INT NOT NULL AFTER d;
|
||||
SELECT * FROM t2;
|
||||
SHOW CREATE TABLE t1;
|
||||
--echo # Wrong result
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 MODIFY COLUMN c INT NOT NULL FIRST;
|
||||
--echo # What should have been done
|
||||
ALTER TABLE t1 MODIFY c INT NOT NULL FLAG=0 AFTER d, MODIFY d CHAR(10) NOT NULL FLAG=11;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo #
|
||||
--echo # Changing to another engine is Ok
|
||||
--echo # However, the data file is not deleted.
|
||||
--echo #
|
||||
ALTER TABLE t1 ENGINE=ARIA;
|
||||
SHOW CREATE TABLE t1;
|
||||
set @old_sql_mode=@@sql_mode;
|
||||
set sql_mode=ignore_bad_table_options;
|
||||
SHOW CREATE TABLE t1;
|
||||
set sql_mode=@old_sql_mode;
|
||||
SELECT * from t1;
|
||||
SELECT * from t2;
|
||||
|
||||
--echo #
|
||||
--echo # Changing back to CONNECT fails
|
||||
--echo # Sure enough, the data file was not deleted.
|
||||
--echo #
|
||||
--error ER_UNKNOWN_ERROR
|
||||
ALTER TABLE t1 ENGINE=CONNECT;
|
||||
|
||||
--echo #
|
||||
--echo # But changing back to CONNECT succeed
|
||||
--echo # if the data file does not exist.
|
||||
--echo #
|
||||
--remove_file $MYSQLD_DATADIR/test/tf1.txt
|
||||
ALTER TABLE t1 ENGINE=CONNECT;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * from t1;
|
||||
SELECT * from t2;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
--remove_file $MYSQLD_DATADIR/test/tf1.txt
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # Testing indexing with ALTER on inward table (in-place)
|
||||
--echo #
|
||||
CREATE TABLE t1 (c INT NOT NULL, d CHAR(10) NOT NULL) ENGINE=CONNECT;
|
||||
INSERT INTO t1 VALUES (1,'One'), (2,'Two'), (3,'Three');
|
||||
SELECT * FROM t1;
|
||||
CREATE INDEX xc ON t1(c);
|
||||
DESCRIBE SELECT * FROM t1 WHERE c = 2;
|
||||
DROP INDEX xc ON t1;
|
||||
CREATE INDEX xd ON t1(d);
|
||||
DROP INDEX xd ON t1;
|
||||
ALTER TABLE t1 ADD INDEX xc (c), ADD INDEX xd (d);
|
||||
SHOW INDEX FROM t1;
|
||||
ALTER TABLE t1 DROP INDEX xc, DROP INDEX xd;
|
||||
SHOW INDEX FROM t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing modifying columns inward table (not in-place)
|
||||
--echo #
|
||||
ALTER TABLE t1 MODIFY COLUMN c CHAR(5) NOT NULL;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 MODIFY COLUMN c INT NOT NULL;
|
||||
|
||||
--echo #
|
||||
--echo # Fails because indexing must be in-place
|
||||
--echo #
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
||||
ALTER TABLE t1 MODIFY COLUMN c CHAR(10) NOT NULL, ADD INDEX xd (d);
|
||||
|
||||
--echo #
|
||||
--echo # Testing changing table type (not in-place)
|
||||
--echo #
|
||||
ALTER TABLE t1 TABLE_TYPE=CSV HEADER=1 QUOTED=1;
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--echo # create an outward table used to see the t1 file
|
||||
CREATE TABLE t2 (line VARCHAR(100) NOT NULL) ENGINE=CONNECT FILE_NAME='t1.csv';
|
||||
SELECT * FROM t2;
|
||||
|
||||
--echo #
|
||||
--echo # Testing changing engine
|
||||
--echo #
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c INT NOT NULL, d CHAR(10) NOT NULL) ENGINE=CONNECT;
|
||||
INSERT INTO t1 VALUES (1,'One'), (2,'Two'), (3,'Three');
|
||||
ALTER TABLE t1 ADD INDEX xc (c), ADD INDEX xd (d);
|
||||
ALTER TABLE t1 ENGINE = MYISAM;
|
||||
SHOW CREATE TABLE t1;
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 ENGINE = CONNECT TABLE_TYPE=DBF;
|
||||
SHOW CREATE TABLE t1;
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # Testing ALTER on outward tables
|
||||
--echo #
|
||||
CREATE TABLE t1 (c INT NOT NULL, d CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='tf1.txt' ENDING=1;
|
||||
INSERT INTO t1 VALUES (1,'One'), (2,'Two'), (3,'Three');
|
||||
SELECT * FROM t1;
|
||||
CREATE TABLE t2 (line VARCHAR(100) NOT NULL) ENGINE=CONNECT FILE_NAME='tf1.txt';
|
||||
SELECT * FROM t2;
|
||||
|
||||
--echo #
|
||||
--echo # Indexing works the same
|
||||
--echo #
|
||||
ALTER TABLE t1 ADD INDEX xc (c), ADD INDEX xd (d);
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT d FROM t1 WHERE c = 2;
|
||||
ALTER TABLE t1 DROP INDEX xc, DROP INDEX xd;
|
||||
SHOW INDEX FROM t1;
|
||||
|
||||
--echo #
|
||||
--echo # Other alterations do not modify the file
|
||||
--echo #
|
||||
ALTER TABLE t1 MODIFY COLUMN c CHAR(5) NOT NULL;
|
||||
SELECT * FROM t2;
|
||||
SHOW CREATE TABLE t1;
|
||||
#Wrong result
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 MODIFY COLUMN c INT NOT NULL;
|
||||
|
||||
--echo #
|
||||
--echo # Changing column order
|
||||
--echo #
|
||||
ALTER TABLE t1 MODIFY COLUMN c INT NOT NULL AFTER d;
|
||||
SELECT * FROM t2;
|
||||
SHOW CREATE TABLE t1;
|
||||
--echo # Wrong result
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 MODIFY COLUMN c INT NOT NULL FIRST;
|
||||
--echo # What should have been done
|
||||
ALTER TABLE t1 MODIFY c INT NOT NULL FLAG=0 AFTER d, MODIFY d CHAR(10) NOT NULL FLAG=11;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo #
|
||||
--echo # Changing to another engine is Ok
|
||||
--echo # However, the data file is not deleted.
|
||||
--echo #
|
||||
ALTER TABLE t1 ENGINE=ARIA;
|
||||
SHOW CREATE TABLE t1;
|
||||
set @old_sql_mode=@@sql_mode;
|
||||
set sql_mode=ignore_bad_table_options;
|
||||
SHOW CREATE TABLE t1;
|
||||
set sql_mode=@old_sql_mode;
|
||||
SELECT * from t1;
|
||||
SELECT * from t2;
|
||||
|
||||
--echo #
|
||||
--echo # Changing back to CONNECT fails
|
||||
--echo # Sure enough, the data file was not deleted.
|
||||
--echo #
|
||||
--error ER_UNKNOWN_ERROR
|
||||
ALTER TABLE t1 ENGINE=CONNECT;
|
||||
|
||||
--echo #
|
||||
--echo # But changing back to CONNECT succeed
|
||||
--echo # if the data file does not exist.
|
||||
--echo #
|
||||
--remove_file $MYSQLD_DATADIR/test/tf1.txt
|
||||
ALTER TABLE t1 ENGINE=CONNECT;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * from t1;
|
||||
SELECT * from t2;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
--remove_file $MYSQLD_DATADIR/test/tf1.txt
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
--source have_libxml2.inc
|
||||
|
||||
--echo #
|
||||
--echo # Testing changing table type (not in-place)
|
||||
--echo #
|
||||
CREATE TABLE t1 (c INT NOT NULL, d CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=CSV HEADER=1 QUOTED=1;
|
||||
INSERT INTO t1 VALUES (1,'One'), (2,'Two'), (3,'Three');
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo # This would fail if the top node name is not specified.
|
||||
--echo # This is because the XML top node name defaults to the table name.
|
||||
--echo # Sure enough the temporary table name begins with '#' and is rejected by XML.
|
||||
--echo # Therefore the top node name must be specified (along with the row nodes name).
|
||||
ALTER TABLE t1 TABLE_TYPE=XML TABNAME=t1 OPTION_LIST='rownode=row';
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--echo # Let us see the XML file
|
||||
CREATE TABLE t2 (line VARCHAR(100) NOT NULL) ENGINE=CONNECT FILE_NAME='t1.xml';
|
||||
SELECT * FROM t2;
|
||||
--echo # NOTE: The first (ignored) row is due to the remaining HEADER=1 option.
|
||||
|
||||
--echo # Testing field option modification
|
||||
ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL FIELD_FORMAT='@', HEADER=0;
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
--source have_libxml2.inc
|
||||
|
||||
--echo #
|
||||
--echo # Testing changing table type (not in-place)
|
||||
--echo #
|
||||
CREATE TABLE t1 (c INT NOT NULL, d CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=CSV HEADER=1 QUOTED=1;
|
||||
INSERT INTO t1 VALUES (1,'One'), (2,'Two'), (3,'Three');
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo # This would fail if the top node name is not specified.
|
||||
--echo # This is because the XML top node name defaults to the table name.
|
||||
--echo # Sure enough the temporary table name begins with '#' and is rejected by XML.
|
||||
--echo # Therefore the top node name must be specified (along with the row nodes name).
|
||||
ALTER TABLE t1 TABLE_TYPE=XML TABNAME=t1 OPTION_LIST='rownode=row';
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--echo # Let us see the XML file
|
||||
CREATE TABLE t2 (line VARCHAR(100) NOT NULL) ENGINE=CONNECT FILE_NAME='t1.xml';
|
||||
SELECT * FROM t2;
|
||||
--echo # NOTE: The first (ignored) row is due to the remaining HEADER=1 option.
|
||||
|
||||
--echo # Testing field option modification
|
||||
ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL FIELD_FORMAT='@', HEADER=0;
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
|
|
@ -1,77 +1,77 @@
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--copy_file $MTR_SUITE_DIR/std_data/Testbal.dat $MYSQLD_DATADIR/test/Testbal.dat
|
||||
|
||||
--echo #
|
||||
--echo # Testing errors
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ID INT NOT NULL
|
||||
) Engine=CONNECT TABLE_TYPE=BIN FILE_NAME='nonexistent.txt';
|
||||
--replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/
|
||||
# TODO: check why this is needed for Windows
|
||||
--replace_result Open(rt) Open(rb)
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
SET time_zone='+00:00';
|
||||
CREATE TABLE t1
|
||||
(
|
||||
fig INT(4) NOT NULL FIELD_FORMAT='C',
|
||||
name CHAR(10) not null,
|
||||
birth DATE NOT NULL,
|
||||
id CHAR(5) NOT NULL FIELD_FORMAT='S',
|
||||
salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F',
|
||||
dept INT(4) NOT NULL FIELD_FORMAT='S'
|
||||
) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=5 FILE_NAME='Testbal.dat';
|
||||
SELECT * FROM t1;
|
||||
|
||||
--error ER_GET_ERRMSG
|
||||
INSERT INTO t1 VALUES (55555,'RONALD','1980-02-26','3333',4444.44,555);
|
||||
INSERT INTO t1 VALUES (5555,'RONALD','1980-02-26','3333',4444.44,555);
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing READONLY tables
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
fig INT(4) NOT NULL FIELD_FORMAT='C',
|
||||
name CHAR(10) not null,
|
||||
birth DATE NOT NULL,
|
||||
id CHAR(5) NOT NULL FIELD_FORMAT='S',
|
||||
salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F',
|
||||
dept INT(4) NOT NULL FIELD_FORMAT='S'
|
||||
) ENGINE=CONNECT TABLE_TYPE=BIN READONLY=Yes FILE_NAME='Testbal.dat';
|
||||
--error ER_OPEN_AS_READONLY
|
||||
INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777);
|
||||
ALTER TABLE t1 READONLY=NO;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777);
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 READONLY=YES;
|
||||
SHOW CREATE TABLE t1;
|
||||
--error ER_OPEN_AS_READONLY
|
||||
INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777);
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing that the underlying file is created
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c CHAR(4) NOT NULL FIELD_FORMAT='C'
|
||||
) ENGINE=CONNECT TABLE_TYPE=BIN FILE_NAME='bin2.dat';
|
||||
INSERT INTO t1 VALUES (10),(20),(300),(4000);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
--remove_file $MYSQLD_DATADIR/test/Testbal.dat
|
||||
--remove_file $MYSQLD_DATADIR/test/bin2.dat
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--copy_file $MTR_SUITE_DIR/std_data/Testbal.dat $MYSQLD_DATADIR/test/Testbal.dat
|
||||
|
||||
--echo #
|
||||
--echo # Testing errors
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ID INT NOT NULL
|
||||
) Engine=CONNECT TABLE_TYPE=BIN FILE_NAME='nonexistent.txt';
|
||||
--replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/
|
||||
# TODO: check why this is needed for Windows
|
||||
--replace_result Open(rt) Open(rb)
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
SET time_zone='+00:00';
|
||||
CREATE TABLE t1
|
||||
(
|
||||
fig INT(4) NOT NULL FIELD_FORMAT='C',
|
||||
name CHAR(10) not null,
|
||||
birth DATE NOT NULL,
|
||||
id CHAR(5) NOT NULL FIELD_FORMAT='S',
|
||||
salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F',
|
||||
dept INT(4) NOT NULL FIELD_FORMAT='S'
|
||||
) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=5 FILE_NAME='Testbal.dat';
|
||||
SELECT * FROM t1;
|
||||
|
||||
--error ER_GET_ERRMSG
|
||||
INSERT INTO t1 VALUES (55555,'RONALD','1980-02-26','3333',4444.44,555);
|
||||
INSERT INTO t1 VALUES (5555,'RONALD','1980-02-26','3333',4444.44,555);
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing READONLY tables
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
fig INT(4) NOT NULL FIELD_FORMAT='C',
|
||||
name CHAR(10) not null,
|
||||
birth DATE NOT NULL,
|
||||
id CHAR(5) NOT NULL FIELD_FORMAT='S',
|
||||
salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F',
|
||||
dept INT(4) NOT NULL FIELD_FORMAT='S'
|
||||
) ENGINE=CONNECT TABLE_TYPE=BIN READONLY=Yes FILE_NAME='Testbal.dat';
|
||||
--error ER_OPEN_AS_READONLY
|
||||
INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777);
|
||||
ALTER TABLE t1 READONLY=NO;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777);
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 READONLY=YES;
|
||||
SHOW CREATE TABLE t1;
|
||||
--error ER_OPEN_AS_READONLY
|
||||
INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777);
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing that the underlying file is created
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c CHAR(4) NOT NULL FIELD_FORMAT='C'
|
||||
) ENGINE=CONNECT TABLE_TYPE=BIN FILE_NAME='bin2.dat';
|
||||
INSERT INTO t1 VALUES (10),(20),(300),(4000);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
--remove_file $MYSQLD_DATADIR/test/Testbal.dat
|
||||
--remove_file $MYSQLD_DATADIR/test/bin2.dat
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
--echo #
|
||||
--echo # Testing out of range dates as (var)char
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id INT NOT NULL,
|
||||
dat CHAR(10) NOT NULL,
|
||||
tim CHAR(8) DEFAULT '09:35:08',
|
||||
datim CHAR(19) DEFAULT '1789-08-10 14:20:30')
|
||||
ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
INSERT INTO t1(id,dat) VALUES(1,'1515-04-01'),(2,'2014-07-26'),(3,'2118-11-02');
|
||||
SELECT * FROM t1;
|
||||
SELECT id, DATE(datim) FROM t1 LIMIT 1;
|
||||
SELECT id, DAYNAME(dat) FROM t1;
|
||||
SELECT id, DAYNAME(datim) FROM t1 LIMIT 1;
|
||||
SELECT id, TIME(tim) FROM t1 LIMIT 1;
|
||||
DROP TABLE t1;
|
||||
--echo #
|
||||
--echo # Testing out of range dates as (var)char
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id INT NOT NULL,
|
||||
dat CHAR(10) NOT NULL,
|
||||
tim CHAR(8) DEFAULT '09:35:08',
|
||||
datim CHAR(19) DEFAULT '1789-08-10 14:20:30')
|
||||
ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
INSERT INTO t1(id,dat) VALUES(1,'1515-04-01'),(2,'2014-07-26'),(3,'2118-11-02');
|
||||
SELECT * FROM t1;
|
||||
SELECT id, DATE(datim) FROM t1 LIMIT 1;
|
||||
SELECT id, DAYNAME(dat) FROM t1;
|
||||
SELECT id, DAYNAME(datim) FROM t1 LIMIT 1;
|
||||
SELECT id, TIME(tim) FROM t1 LIMIT 1;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -1,85 +1,85 @@
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--copy_file $MTR_SUITE_DIR/std_data/funny.txt $MYSQLD_DATADIR/test/funny.txt
|
||||
--copy_file $MTR_SUITE_DIR/std_data/funny2.txt $MYSQLD_DATADIR/test/funny2.txt
|
||||
|
||||
--echo #
|
||||
--echo # Testing errors
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ID INT NOT NULL field_format=' %n%d%n'
|
||||
) Engine=CONNECT table_type=FMT file_name='nonexistent.txt';
|
||||
--replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/
|
||||
# TODO: check why this is needed for Windows
|
||||
--replace_result Open(rt) Open(rb)
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing update on FMT tables
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL field_format=' %n%d%n'
|
||||
) ENGINE=CONNECT TABLE_TYPE=FMT FILE_NAME='t1.txt';
|
||||
--error ER_GET_ERRMSG
|
||||
INSERT INTO t1 VALUES (10),(20);
|
||||
# TODO:
|
||||
#--error ER_GET_ERRMSG
|
||||
#UPDATE t1 SET id=20;
|
||||
#TRUNCATE TABLE t1;
|
||||
#DELETE FROM t1 WHERE id=10;
|
||||
#SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
#--remove_file $MYSQLD_DATADIR/test/t1.txt
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing manual examples
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ID Integer(5) not null field_format=' %n%d%n',
|
||||
NAME Char(16) not null field_format=" , '%n%[^']%n'",
|
||||
DEPNO Integer(4) not null field_format=' , #%n%d%n',
|
||||
SALARY Double(12,2) not null field_format=' ; %n%f%n'
|
||||
) Engine=CONNECT table_type=FMT file_name='funny.txt';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# TODO: shoudn't a warning instead of error be returned on bad format?
|
||||
#
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ID Integer(5) not null field_format=' %n%d%n',
|
||||
NAME Char(16) not null field_format=" , '%n%[^']%n'",
|
||||
DEPNO Integer(4) not null field_format=' , #%n%d%n',
|
||||
SALARY Double(12,2) not null field_format=' ; %n%f%n'
|
||||
) Engine=CONNECT table_type=FMT file_name='funny2.txt';
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ID Integer(5) not null field_format=' %n%d%n',
|
||||
NAME Char(16) not null field_format=' , ''%n%[^'']%m',
|
||||
DEPNO Integer(4) not null field_format=''' , #%n%d%m',
|
||||
SALARY Double(12,2) not null field_format=' ; %n%f%n'
|
||||
) Engine=CONNECT table_type=FMT file_name='funny2.txt';
|
||||
SELECT * FROM t1;
|
||||
--error ER_GET_ERRMSG
|
||||
UPDATE t1 SET SALARY=1234;
|
||||
# TODO: this query crashes
|
||||
# UPDATE t1 SET SALARY=1234 WHERE ID=56;
|
||||
DELETE FROM t1 WHERE ID=56;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
--remove_file $MYSQLD_DATADIR/test/funny.txt
|
||||
--remove_file $MYSQLD_DATADIR/test/funny2.txt
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--copy_file $MTR_SUITE_DIR/std_data/funny.txt $MYSQLD_DATADIR/test/funny.txt
|
||||
--copy_file $MTR_SUITE_DIR/std_data/funny2.txt $MYSQLD_DATADIR/test/funny2.txt
|
||||
|
||||
--echo #
|
||||
--echo # Testing errors
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ID INT NOT NULL field_format=' %n%d%n'
|
||||
) Engine=CONNECT table_type=FMT file_name='nonexistent.txt';
|
||||
--replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/
|
||||
# TODO: check why this is needed for Windows
|
||||
--replace_result Open(rt) Open(rb)
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing update on FMT tables
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL field_format=' %n%d%n'
|
||||
) ENGINE=CONNECT TABLE_TYPE=FMT FILE_NAME='t1.txt';
|
||||
--error ER_GET_ERRMSG
|
||||
INSERT INTO t1 VALUES (10),(20);
|
||||
# TODO:
|
||||
#--error ER_GET_ERRMSG
|
||||
#UPDATE t1 SET id=20;
|
||||
#TRUNCATE TABLE t1;
|
||||
#DELETE FROM t1 WHERE id=10;
|
||||
#SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
#--remove_file $MYSQLD_DATADIR/test/t1.txt
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing manual examples
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ID Integer(5) not null field_format=' %n%d%n',
|
||||
NAME Char(16) not null field_format=" , '%n%[^']%n'",
|
||||
DEPNO Integer(4) not null field_format=' , #%n%d%n',
|
||||
SALARY Double(12,2) not null field_format=' ; %n%f%n'
|
||||
) Engine=CONNECT table_type=FMT file_name='funny.txt';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# TODO: shoudn't a warning instead of error be returned on bad format?
|
||||
#
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ID Integer(5) not null field_format=' %n%d%n',
|
||||
NAME Char(16) not null field_format=" , '%n%[^']%n'",
|
||||
DEPNO Integer(4) not null field_format=' , #%n%d%n',
|
||||
SALARY Double(12,2) not null field_format=' ; %n%f%n'
|
||||
) Engine=CONNECT table_type=FMT file_name='funny2.txt';
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ID Integer(5) not null field_format=' %n%d%n',
|
||||
NAME Char(16) not null field_format=' , ''%n%[^'']%m',
|
||||
DEPNO Integer(4) not null field_format=''' , #%n%d%m',
|
||||
SALARY Double(12,2) not null field_format=' ; %n%f%n'
|
||||
) Engine=CONNECT table_type=FMT file_name='funny2.txt';
|
||||
SELECT * FROM t1;
|
||||
--error ER_GET_ERRMSG
|
||||
UPDATE t1 SET SALARY=1234;
|
||||
# TODO: this query crashes
|
||||
# UPDATE t1 SET SALARY=1234 WHERE ID=56;
|
||||
DELETE FROM t1 WHERE ID=56;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
--remove_file $MYSQLD_DATADIR/test/funny.txt
|
||||
--remove_file $MYSQLD_DATADIR/test/funny2.txt
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
--echo #
|
||||
--echo # Testing features not specific to any TABLE_TYPE
|
||||
--echo #
|
||||
--error ER_UNKNOWN_ERROR
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=NON_EXISTING;
|
||||
#SHOW CREATE TABLE t1;
|
||||
#DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
SELECT * FROM t1;
|
||||
#--error ER_GET_ERRMSG
|
||||
--error ER_UNKNOWN_ERROR
|
||||
ALTER TABLE t1 TABLE_TYPE=NON_EXISTING;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
--echo #
|
||||
--echo # Testing features not specific to any TABLE_TYPE
|
||||
--echo #
|
||||
--error ER_UNKNOWN_ERROR
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=NON_EXISTING;
|
||||
#SHOW CREATE TABLE t1;
|
||||
#DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
SELECT * FROM t1;
|
||||
#--error ER_GET_ERRMSG
|
||||
--error ER_UNKNOWN_ERROR
|
||||
ALTER TABLE t1 TABLE_TYPE=NON_EXISTING;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -1,264 +1,264 @@
|
|||
--source include/not_embedded.inc
|
||||
--source include/have_partition.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--copy_file $MTR_SUITE_DIR/std_data/biblio.json $MYSQLD_DATADIR/test/biblio.json
|
||||
--copy_file $MTR_SUITE_DIR/std_data/expense.json $MYSQLD_DATADIR/test/expense.json
|
||||
--copy_file $MTR_SUITE_DIR/std_data/mulexp3.json $MYSQLD_DATADIR/test/mulexp3.json
|
||||
--copy_file $MTR_SUITE_DIR/std_data/mulexp4.json $MYSQLD_DATADIR/test/mulexp4.json
|
||||
--copy_file $MTR_SUITE_DIR/std_data/mulexp5.json $MYSQLD_DATADIR/test/mulexp5.json
|
||||
|
||||
--echo #
|
||||
--echo # Testing doc samples
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ISBN CHAR(15),
|
||||
LANG CHAR(2),
|
||||
SUBJECT CHAR(32),
|
||||
AUTHOR CHAR(64),
|
||||
TITLE CHAR(32),
|
||||
TRANSLATION CHAR(32),
|
||||
TRANSLATOR CHAR(80),
|
||||
PUBLISHER CHAR(32),
|
||||
DATEPUB int(4)
|
||||
) ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing Jpath. Get the number of authors
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ISBN CHAR(15),
|
||||
Language CHAR(2) FIELD_FORMAT='LANG',
|
||||
Subject CHAR(32) FIELD_FORMAT='SUBJECT',
|
||||
Authors INT(2) FIELD_FORMAT='AUTHOR:[#]',
|
||||
Title CHAR(32) FIELD_FORMAT='TITLE',
|
||||
Translation CHAR(32) FIELD_FORMAT='TRANSLATION',
|
||||
Translator CHAR(80) FIELD_FORMAT='TRANSLATOR',
|
||||
Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME',
|
||||
Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE',
|
||||
Year int(4) FIELD_FORMAT='DATEPUB'
|
||||
)
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Concatenates the authors
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ISBN CHAR(15),
|
||||
Language CHAR(2) FIELD_FORMAT='LANG',
|
||||
Subject CHAR(32) FIELD_FORMAT='SUBJECT',
|
||||
AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:FIRSTNAME',
|
||||
AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:LASTNAME',
|
||||
Title CHAR(32) FIELD_FORMAT='TITLE',
|
||||
Translation CHAR(32) FIELD_FORMAT='TRANSLATION',
|
||||
Translator CHAR(80) FIELD_FORMAT='TRANSLATOR',
|
||||
Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME',
|
||||
Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE',
|
||||
Year int(4) FIELD_FORMAT='DATEPUB'
|
||||
)
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing expanding authors
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ISBN CHAR(15),
|
||||
Language CHAR(2) FIELD_FORMAT='LANG',
|
||||
Subject CHAR(32) FIELD_FORMAT='SUBJECT',
|
||||
AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:FIRSTNAME',
|
||||
AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:LASTNAME',
|
||||
Title CHAR(32) FIELD_FORMAT='TITLE',
|
||||
Translation CHAR(32) FIELD_FORMAT='TRANSLATION',
|
||||
Translator CHAR(80) FIELD_FORMAT='TRANSLATOR',
|
||||
Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME',
|
||||
Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE',
|
||||
Year int(4) FIELD_FORMAT='DATEPUB'
|
||||
)
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET AuthorFN = 'Philippe' WHERE AuthorLN = 'Knab';
|
||||
SELECT * FROM t1 WHERE ISBN = '9782212090819';
|
||||
|
||||
--echo #
|
||||
--echo # To add an author a new table must be created
|
||||
--echo #
|
||||
CREATE TABLE t2 (
|
||||
FIRSTNAME CHAR(32),
|
||||
LASTNAME CHAR(32))
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json' OPTION_LIST='Object=[2]:AUTHOR';
|
||||
SELECT * FROM t2;
|
||||
INSERT INTO t2 VALUES('Charles','Dickens');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
--echo #
|
||||
--echo # Check the biblio file has the good format
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
line char(255)
|
||||
)
|
||||
ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='biblio.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # A file with 2 arrays
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER',
|
||||
WHAT CHAR(32) FIELD_FORMAT='WEEK::EXPENSE:["+"]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK::EXPENSE:[+]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Now it can be fully expanded
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER',
|
||||
WHAT CHAR(32) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
#--error ER_GET_ERRMSG
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # A table showing many calculated results
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12) NOT NULL,
|
||||
WEEKS CHAR(12) NOT NULL FIELD_FORMAT='WEEK:[", "]:NUMBER',
|
||||
SUMS CHAR(64) NOT NULL FIELD_FORMAT='WEEK:["+"]:EXPENSE:[+]:AMOUNT',
|
||||
SUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[+]:EXPENSE:[+]:AMOUNT',
|
||||
AVGS CHAR(64) NOT NULL FIELD_FORMAT='WEEK:["+"]:EXPENSE:[!]:AMOUNT',
|
||||
SUMAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[+]:EXPENSE:[!]:AMOUNT',
|
||||
AVGSUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[+]:AMOUNT',
|
||||
AVGAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[!]:AMOUNT',
|
||||
AVERAGE DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Expand expense in 3 one week tables
|
||||
--echo #
|
||||
CREATE TABLE t2 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2) FIELD_FORMAT='WEEK:[1]:NUMBER',
|
||||
WHAT CHAR(32) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
SELECT * FROM t2;
|
||||
|
||||
CREATE TABLE t3 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2) FIELD_FORMAT='WEEK:[2]:NUMBER',
|
||||
WHAT CHAR(32) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
SELECT * FROM t3;
|
||||
|
||||
CREATE TABLE t4 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2) FIELD_FORMAT='WEEK:[3]:NUMBER',
|
||||
WHAT CHAR(32) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
SELECT * FROM t4;
|
||||
|
||||
--echo #
|
||||
--echo # The expanded table is made as a TBL table
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32),
|
||||
AMOUNT DOUBLE(8,2))
|
||||
ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t2,t3,t4';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
|
||||
--echo #
|
||||
--echo # Three partial JSON tables
|
||||
--echo #
|
||||
CREATE TABLE t2 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp3.json';
|
||||
SELECT * FROM t2;
|
||||
|
||||
CREATE TABLE t3 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp4.json';
|
||||
SELECT * FROM t3;
|
||||
|
||||
CREATE TABLE t4 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp5.json';
|
||||
SELECT * FROM t4;
|
||||
|
||||
--echo #
|
||||
--echo # The complete table can be a multiple JSON table
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.json' MULTIPLE=1;
|
||||
SELECT * FROM t1 ORDER BY WHO, WEEK, WHAT, AMOUNT;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Or also a partition JSON table
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp%s.json';
|
||||
ALTER TABLE t1
|
||||
PARTITION BY LIST COLUMNS(WEEK) (
|
||||
PARTITION `3` VALUES IN(3),
|
||||
PARTITION `4` VALUES IN(4),
|
||||
PARTITION `5` VALUES IN(5));
|
||||
SHOW WARNINGS;
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 WHERE WEEK = 4;
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
--remove_file $MYSQLD_DATADIR/test/biblio.json
|
||||
--remove_file $MYSQLD_DATADIR/test/expense.json
|
||||
--remove_file $MYSQLD_DATADIR/test/mulexp3.json
|
||||
--remove_file $MYSQLD_DATADIR/test/mulexp4.json
|
||||
--remove_file $MYSQLD_DATADIR/test/mulexp5.json
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_partition.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--copy_file $MTR_SUITE_DIR/std_data/biblio.json $MYSQLD_DATADIR/test/biblio.json
|
||||
--copy_file $MTR_SUITE_DIR/std_data/expense.json $MYSQLD_DATADIR/test/expense.json
|
||||
--copy_file $MTR_SUITE_DIR/std_data/mulexp3.json $MYSQLD_DATADIR/test/mulexp3.json
|
||||
--copy_file $MTR_SUITE_DIR/std_data/mulexp4.json $MYSQLD_DATADIR/test/mulexp4.json
|
||||
--copy_file $MTR_SUITE_DIR/std_data/mulexp5.json $MYSQLD_DATADIR/test/mulexp5.json
|
||||
|
||||
--echo #
|
||||
--echo # Testing doc samples
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ISBN CHAR(15),
|
||||
LANG CHAR(2),
|
||||
SUBJECT CHAR(32),
|
||||
AUTHOR CHAR(64),
|
||||
TITLE CHAR(32),
|
||||
TRANSLATION CHAR(32),
|
||||
TRANSLATOR CHAR(80),
|
||||
PUBLISHER CHAR(32),
|
||||
DATEPUB int(4)
|
||||
) ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing Jpath. Get the number of authors
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ISBN CHAR(15),
|
||||
Language CHAR(2) FIELD_FORMAT='LANG',
|
||||
Subject CHAR(32) FIELD_FORMAT='SUBJECT',
|
||||
Authors INT(2) FIELD_FORMAT='AUTHOR:[#]',
|
||||
Title CHAR(32) FIELD_FORMAT='TITLE',
|
||||
Translation CHAR(32) FIELD_FORMAT='TRANSLATION',
|
||||
Translator CHAR(80) FIELD_FORMAT='TRANSLATOR',
|
||||
Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME',
|
||||
Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE',
|
||||
Year int(4) FIELD_FORMAT='DATEPUB'
|
||||
)
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Concatenates the authors
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ISBN CHAR(15),
|
||||
Language CHAR(2) FIELD_FORMAT='LANG',
|
||||
Subject CHAR(32) FIELD_FORMAT='SUBJECT',
|
||||
AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:FIRSTNAME',
|
||||
AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:LASTNAME',
|
||||
Title CHAR(32) FIELD_FORMAT='TITLE',
|
||||
Translation CHAR(32) FIELD_FORMAT='TRANSLATION',
|
||||
Translator CHAR(80) FIELD_FORMAT='TRANSLATOR',
|
||||
Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME',
|
||||
Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE',
|
||||
Year int(4) FIELD_FORMAT='DATEPUB'
|
||||
)
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing expanding authors
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ISBN CHAR(15),
|
||||
Language CHAR(2) FIELD_FORMAT='LANG',
|
||||
Subject CHAR(32) FIELD_FORMAT='SUBJECT',
|
||||
AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:FIRSTNAME',
|
||||
AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:LASTNAME',
|
||||
Title CHAR(32) FIELD_FORMAT='TITLE',
|
||||
Translation CHAR(32) FIELD_FORMAT='TRANSLATION',
|
||||
Translator CHAR(80) FIELD_FORMAT='TRANSLATOR',
|
||||
Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME',
|
||||
Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE',
|
||||
Year int(4) FIELD_FORMAT='DATEPUB'
|
||||
)
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET AuthorFN = 'Philippe' WHERE AuthorLN = 'Knab';
|
||||
SELECT * FROM t1 WHERE ISBN = '9782212090819';
|
||||
|
||||
--echo #
|
||||
--echo # To add an author a new table must be created
|
||||
--echo #
|
||||
CREATE TABLE t2 (
|
||||
FIRSTNAME CHAR(32),
|
||||
LASTNAME CHAR(32))
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json' OPTION_LIST='Object=[2]:AUTHOR';
|
||||
SELECT * FROM t2;
|
||||
INSERT INTO t2 VALUES('Charles','Dickens');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
--echo #
|
||||
--echo # Check the biblio file has the good format
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
line char(255)
|
||||
)
|
||||
ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='biblio.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # A file with 2 arrays
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER',
|
||||
WHAT CHAR(32) FIELD_FORMAT='WEEK::EXPENSE:["+"]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK::EXPENSE:[+]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Now it can be fully expanded
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER',
|
||||
WHAT CHAR(32) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
#--error ER_GET_ERRMSG
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # A table showing many calculated results
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12) NOT NULL,
|
||||
WEEKS CHAR(12) NOT NULL FIELD_FORMAT='WEEK:[", "]:NUMBER',
|
||||
SUMS CHAR(64) NOT NULL FIELD_FORMAT='WEEK:["+"]:EXPENSE:[+]:AMOUNT',
|
||||
SUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[+]:EXPENSE:[+]:AMOUNT',
|
||||
AVGS CHAR(64) NOT NULL FIELD_FORMAT='WEEK:["+"]:EXPENSE:[!]:AMOUNT',
|
||||
SUMAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[+]:EXPENSE:[!]:AMOUNT',
|
||||
AVGSUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[+]:AMOUNT',
|
||||
AVGAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[!]:AMOUNT',
|
||||
AVERAGE DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Expand expense in 3 one week tables
|
||||
--echo #
|
||||
CREATE TABLE t2 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2) FIELD_FORMAT='WEEK:[1]:NUMBER',
|
||||
WHAT CHAR(32) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
SELECT * FROM t2;
|
||||
|
||||
CREATE TABLE t3 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2) FIELD_FORMAT='WEEK:[2]:NUMBER',
|
||||
WHAT CHAR(32) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
SELECT * FROM t3;
|
||||
|
||||
CREATE TABLE t4 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2) FIELD_FORMAT='WEEK:[3]:NUMBER',
|
||||
WHAT CHAR(32) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
|
||||
SELECT * FROM t4;
|
||||
|
||||
--echo #
|
||||
--echo # The expanded table is made as a TBL table
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32),
|
||||
AMOUNT DOUBLE(8,2))
|
||||
ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t2,t3,t4';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
|
||||
--echo #
|
||||
--echo # Three partial JSON tables
|
||||
--echo #
|
||||
CREATE TABLE t2 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp3.json';
|
||||
SELECT * FROM t2;
|
||||
|
||||
CREATE TABLE t3 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp4.json';
|
||||
SELECT * FROM t3;
|
||||
|
||||
CREATE TABLE t4 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp5.json';
|
||||
SELECT * FROM t4;
|
||||
|
||||
--echo #
|
||||
--echo # The complete table can be a multiple JSON table
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.json' MULTIPLE=1;
|
||||
SELECT * FROM t1 ORDER BY WHO, WEEK, WHAT, AMOUNT;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Or also a partition JSON table
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
WHO CHAR(12),
|
||||
WEEK INT(2),
|
||||
WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT',
|
||||
AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT')
|
||||
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp%s.json';
|
||||
ALTER TABLE t1
|
||||
PARTITION BY LIST COLUMNS(WEEK) (
|
||||
PARTITION `3` VALUES IN(3),
|
||||
PARTITION `4` VALUES IN(4),
|
||||
PARTITION `5` VALUES IN(5));
|
||||
SHOW WARNINGS;
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 WHERE WEEK = 4;
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
--remove_file $MYSQLD_DATADIR/test/biblio.json
|
||||
--remove_file $MYSQLD_DATADIR/test/expense.json
|
||||
--remove_file $MYSQLD_DATADIR/test/mulexp3.json
|
||||
--remove_file $MYSQLD_DATADIR/test/mulexp4.json
|
||||
--remove_file $MYSQLD_DATADIR/test/mulexp5.json
|
||||
|
|
|
@ -1,93 +1,93 @@
|
|||
--source json_udf.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--copy_file $MTR_SUITE_DIR/std_data/biblio.json $MYSQLD_DATADIR/test/biblio.json
|
||||
--copy_file $MTR_SUITE_DIR/std_data/employee.dat $MYSQLD_DATADIR/test/employee.dat
|
||||
|
||||
--echo #
|
||||
--echo # Test UDF's with constant arguments
|
||||
--echo #
|
||||
SELECT Json_Array();
|
||||
SELECT Json_Object(56,3.1416,'foo',NULL);
|
||||
SELECT Json_Object(56 qty,3.1416 price,'foo' truc, NULL garanty);
|
||||
SELECT Json_Array(56,3.1416,'My name is "Foo"',NULL);
|
||||
--error ER_CANT_INITIALIZE_UDF
|
||||
SELECT Json_Array_Add(Json_Array(56,3.1416,'foo',NULL)) Array;
|
||||
SELECT Json_Array_Add(Json_Array(56,3.1416,'foo',NULL),'One more') Array;
|
||||
SELECT Json_Array_Add(Json_Value('one value'),'One more');
|
||||
--error ER_CANT_INITIALIZE_UDF
|
||||
SELECT Json_Array_Add('one value','One more');
|
||||
SELECT Json_Array_Add('one value' json_,'One more');
|
||||
--error ER_CANT_INITIALIZE_UDF
|
||||
SELECT Json_Value(56,3.1416,'foo',NULL);
|
||||
SELECT Json_Value(3.1416);
|
||||
SELECT Json_Value('foo');
|
||||
SELECT Json_Value(NULL);
|
||||
SELECT Json_Value();
|
||||
SELECT Json_Object();
|
||||
SELECT Json_Object(Json_Array(56,3.1416,'foo'),NULL);
|
||||
SELECT Json_Array(Json_Array(56,3.1416,'foo'),NULL);
|
||||
SELECT Json_Array(Json_Object(56 "qty",3.1416 "price",'foo'),NULL);
|
||||
|
||||
--echo #
|
||||
--echo # Test UDF's with column arguments
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ISBN CHAR(15),
|
||||
LANG CHAR(2),
|
||||
SUBJECT CHAR(32),
|
||||
AUTHOR CHAR(64),
|
||||
TITLE CHAR(32),
|
||||
TRANSLATION CHAR(32),
|
||||
TRANSLATOR CHAR(80),
|
||||
PUBLISHER CHAR(32),
|
||||
DATEPUB int(4)
|
||||
) ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
|
||||
|
||||
SELECT Json_Array(AUTHOR, TITLE, DATEPUB) FROM t1;
|
||||
SELECT Json_Object(AUTHOR, TITLE, DATEPUB) FROM t1;
|
||||
--error ER_CANT_INITIALIZE_UDF
|
||||
SELECT Json_Array_Grp(TITLE, DATEPUB) FROM t1;
|
||||
SELECT Json_Array_Grp(TITLE) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
SERIALNO CHAR(5) NOT NULL,
|
||||
NAME VARCHAR(12) NOT NULL FLAG=6,
|
||||
SEX SMALLINT(1) NOT NULL,
|
||||
TITLE VARCHAR(15) NOT NULL FLAG=20,
|
||||
MANAGER CHAR(5) DEFAULT NULL,
|
||||
DEPARTMENT CHAr(4) NOT NULL FLAG=41,
|
||||
SECRETARY CHAR(5) DEFAULT NULL FLAG=46,
|
||||
SALARY DOUBLE(8,2) NOT NULL FLAG=52
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX BLOCK_SIZE=8 FILE_NAME='employee.dat' ENDING=1;
|
||||
|
||||
SELECT Json_Object(SERIALNO, NAME, TITLE, SALARY) FROM t1 WHERE NAME = 'MERCHANT';
|
||||
SELECT DEPARTMENT, Json_Array_Grp(NAME) FROM t1 GROUP BY DEPARTMENT;
|
||||
set connect_json_grp_size=30;
|
||||
SELECT Json_Array(DEPARTMENT, Json_Array_Grp(NAME)) FROM t1 GROUP BY DEPARTMENT;
|
||||
SELECT Json_Object(DEPARTMENT, Json_Array_Grp(NAME) json_NAMES) FROM t1 GROUP BY DEPARTMENT;
|
||||
SELECT Json_Object(DEPARTMENT, Json_Array_Grp(Json_Object(SERIALNO, NAME, TITLE, SALARY)) json_EMPLOYES) FROM t1 GROUP BY DEPARTMENT;
|
||||
SELECT Json_Object(DEPARTMENT, TITLE, Json_Array_Grp(Json_Object(SERIALNO, NAME, SALARY)) json_EMPLOYES) FROM t1 GROUP BY DEPARTMENT, TITLE;
|
||||
--error ER_CANT_INITIALIZE_UDF
|
||||
SELECT Json_Object_Grp(SALARY) FROM t1;
|
||||
SELECT Json_Object_Grp(SALARY, NAME) FROM t1;
|
||||
SELECT Json_Object(DEPARTMENT, Json_Object_Grp(SALARY, NAME) "Json_SALARIES") FROM t1 GROUP BY DEPARTMENT;
|
||||
SELECT Json_Array_Grp(NAME) from t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
DROP FUNCTION Json_Array;
|
||||
DROP FUNCTION Json_Array_Add;
|
||||
DROP FUNCTION Json_Object;
|
||||
DROP FUNCTION Json_Object_Nonull;
|
||||
DROP FUNCTION Json_Value;
|
||||
DROP FUNCTION Json_Array_Grp;
|
||||
DROP FUNCTION Json_Object_Grp;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
--remove_file $MYSQLD_DATADIR/test/biblio.json
|
||||
--remove_file $MYSQLD_DATADIR/test/employee.dat
|
||||
--source json_udf.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--copy_file $MTR_SUITE_DIR/std_data/biblio.json $MYSQLD_DATADIR/test/biblio.json
|
||||
--copy_file $MTR_SUITE_DIR/std_data/employee.dat $MYSQLD_DATADIR/test/employee.dat
|
||||
|
||||
--echo #
|
||||
--echo # Test UDF's with constant arguments
|
||||
--echo #
|
||||
SELECT Json_Array();
|
||||
SELECT Json_Object(56,3.1416,'foo',NULL);
|
||||
SELECT Json_Object(56 qty,3.1416 price,'foo' truc, NULL garanty);
|
||||
SELECT Json_Array(56,3.1416,'My name is "Foo"',NULL);
|
||||
--error ER_CANT_INITIALIZE_UDF
|
||||
SELECT Json_Array_Add(Json_Array(56,3.1416,'foo',NULL)) Array;
|
||||
SELECT Json_Array_Add(Json_Array(56,3.1416,'foo',NULL),'One more') Array;
|
||||
SELECT Json_Array_Add(Json_Value('one value'),'One more');
|
||||
--error ER_CANT_INITIALIZE_UDF
|
||||
SELECT Json_Array_Add('one value','One more');
|
||||
SELECT Json_Array_Add('one value' json_,'One more');
|
||||
--error ER_CANT_INITIALIZE_UDF
|
||||
SELECT Json_Value(56,3.1416,'foo',NULL);
|
||||
SELECT Json_Value(3.1416);
|
||||
SELECT Json_Value('foo');
|
||||
SELECT Json_Value(NULL);
|
||||
SELECT Json_Value();
|
||||
SELECT Json_Object();
|
||||
SELECT Json_Object(Json_Array(56,3.1416,'foo'),NULL);
|
||||
SELECT Json_Array(Json_Array(56,3.1416,'foo'),NULL);
|
||||
SELECT Json_Array(Json_Object(56 "qty",3.1416 "price",'foo'),NULL);
|
||||
|
||||
--echo #
|
||||
--echo # Test UDF's with column arguments
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
ISBN CHAR(15),
|
||||
LANG CHAR(2),
|
||||
SUBJECT CHAR(32),
|
||||
AUTHOR CHAR(64),
|
||||
TITLE CHAR(32),
|
||||
TRANSLATION CHAR(32),
|
||||
TRANSLATOR CHAR(80),
|
||||
PUBLISHER CHAR(32),
|
||||
DATEPUB int(4)
|
||||
) ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
|
||||
|
||||
SELECT Json_Array(AUTHOR, TITLE, DATEPUB) FROM t1;
|
||||
SELECT Json_Object(AUTHOR, TITLE, DATEPUB) FROM t1;
|
||||
--error ER_CANT_INITIALIZE_UDF
|
||||
SELECT Json_Array_Grp(TITLE, DATEPUB) FROM t1;
|
||||
SELECT Json_Array_Grp(TITLE) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
SERIALNO CHAR(5) NOT NULL,
|
||||
NAME VARCHAR(12) NOT NULL FLAG=6,
|
||||
SEX SMALLINT(1) NOT NULL,
|
||||
TITLE VARCHAR(15) NOT NULL FLAG=20,
|
||||
MANAGER CHAR(5) DEFAULT NULL,
|
||||
DEPARTMENT CHAr(4) NOT NULL FLAG=41,
|
||||
SECRETARY CHAR(5) DEFAULT NULL FLAG=46,
|
||||
SALARY DOUBLE(8,2) NOT NULL FLAG=52
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX BLOCK_SIZE=8 FILE_NAME='employee.dat' ENDING=1;
|
||||
|
||||
SELECT Json_Object(SERIALNO, NAME, TITLE, SALARY) FROM t1 WHERE NAME = 'MERCHANT';
|
||||
SELECT DEPARTMENT, Json_Array_Grp(NAME) FROM t1 GROUP BY DEPARTMENT;
|
||||
set connect_json_grp_size=30;
|
||||
SELECT Json_Array(DEPARTMENT, Json_Array_Grp(NAME)) FROM t1 GROUP BY DEPARTMENT;
|
||||
SELECT Json_Object(DEPARTMENT, Json_Array_Grp(NAME) json_NAMES) FROM t1 GROUP BY DEPARTMENT;
|
||||
SELECT Json_Object(DEPARTMENT, Json_Array_Grp(Json_Object(SERIALNO, NAME, TITLE, SALARY)) json_EMPLOYES) FROM t1 GROUP BY DEPARTMENT;
|
||||
SELECT Json_Object(DEPARTMENT, TITLE, Json_Array_Grp(Json_Object(SERIALNO, NAME, SALARY)) json_EMPLOYES) FROM t1 GROUP BY DEPARTMENT, TITLE;
|
||||
--error ER_CANT_INITIALIZE_UDF
|
||||
SELECT Json_Object_Grp(SALARY) FROM t1;
|
||||
SELECT Json_Object_Grp(SALARY, NAME) FROM t1;
|
||||
SELECT Json_Object(DEPARTMENT, Json_Object_Grp(SALARY, NAME) "Json_SALARIES") FROM t1 GROUP BY DEPARTMENT;
|
||||
SELECT Json_Array_Grp(NAME) from t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
DROP FUNCTION Json_Array;
|
||||
DROP FUNCTION Json_Array_Add;
|
||||
DROP FUNCTION Json_Object;
|
||||
DROP FUNCTION Json_Object_Nonull;
|
||||
DROP FUNCTION Json_Value;
|
||||
DROP FUNCTION Json_Array_Grp;
|
||||
DROP FUNCTION Json_Object_Grp;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
--remove_file $MYSQLD_DATADIR/test/biblio.json
|
||||
--remove_file $MYSQLD_DATADIR/test/employee.dat
|
||||
|
|
|
@ -1,66 +1,66 @@
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--copy_file $MTR_SUITE_DIR/std_data/emp.txt $MYSQLD_DATADIR/test/emp.txt
|
||||
|
||||
--echo #
|
||||
--echo # Show MRR setting. The way it is done is because the t3 table cannot be directly based on
|
||||
--echo # the information_schema.session_variables table. Not being a CONNECT table, it would be
|
||||
--echo # read using an intermediate MYSQL table using the MySQL API and could not reflect the
|
||||
--echo # current session variable change (the call would create another session) This would be
|
||||
--echo # correct only for querying GLOBAL variables but is not what we want to do here.
|
||||
--echo #
|
||||
CREATE TABLE t2 (
|
||||
name VARCHAR(64) NOT NULL,
|
||||
value VARCHAR(1024) NOT NULL
|
||||
) ENGINE=CONNECT TABLE_TYPE=DOS;
|
||||
INSERT INTO t2 SELECT * FROM information_schema.session_variables WHERE variable_name = 'OPTIMIZER_SWITCH';
|
||||
# Check that MRR is OFF by default
|
||||
create table t3 (
|
||||
name CHAR(32) NOT NULL,
|
||||
value CHAR(64) NOT NULL
|
||||
) ENGINE=CONNECT TABLE_TYPE=XCOL TABNAME=t2 OPTION_LIST='Colname=value';
|
||||
SELECT value FROM t3 WHERE value LIKE 'mrr%';
|
||||
|
||||
--echo #
|
||||
--echo # Testing indexing with MRR OFF
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
matricule INT(4) KEY NOT NULL field_format='Z',
|
||||
nom VARCHAR(16) NOT NULL,
|
||||
prenom VARCHAR(20) NOT NULL,
|
||||
sexe SMALLINT(1) NOT NULL COMMENT 'sexe 1:M 2:F',
|
||||
aanais INT(4) NOT NULL,
|
||||
mmnais INT(2) NOT NULL,
|
||||
ddentree DATE NOT NULL date_format='YYYYMM',
|
||||
ddnom DATE NOT NULL date_format='YYYYMM',
|
||||
brut INT(5) NOT NULL,
|
||||
net DOUBLE(8,2) NOT NULL,
|
||||
service INT(2) NOT NULL,
|
||||
sitmat CHAR(1) NOT NULL,
|
||||
formation CHAR(5) NOT NULL,
|
||||
INDEX NP(nom,prenom)
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='emp.txt' ENDING=2;
|
||||
SELECT * FROM t1 LIMIT 10;
|
||||
--echo # Without MRR, the rows are retrieved sorted by name
|
||||
SELECT matricule, nom, prenom, sitmat, net FROM t1 WHERE nom IN ('ETANG','FOCH','CERF','ITALIE','ROI');
|
||||
|
||||
--echo #
|
||||
--echo # Testing indexing with MRR ON
|
||||
--echo #
|
||||
SET @@LOCAL.OPTIMIZER_SWITCH='mrr=on';
|
||||
--echo # Refresh the t2 table to reflect the change
|
||||
UPDATE t2, information_schema.session_variables SET value = variable_value WHERE variable_name = 'OPTIMIZER_SWITCH';
|
||||
--echo # Check that MRR is ON for the session
|
||||
SELECT value FROM t3 WHERE value LIKE 'mrr%';
|
||||
--echo # With MRR, the rows are retrieved sorted by their position in the table
|
||||
SELECT matricule, nom, prenom, sitmat, net FROM t1 WHERE nom IN ('ETANG','FOCH','CERF','ITALIE','ROI');
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
SET @@LOCAL.OPTIMIZER_SWITCH='mrr=off';
|
||||
--remove_file $MYSQLD_DATADIR/test/emp.txt
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--copy_file $MTR_SUITE_DIR/std_data/emp.txt $MYSQLD_DATADIR/test/emp.txt
|
||||
|
||||
--echo #
|
||||
--echo # Show MRR setting. The way it is done is because the t3 table cannot be directly based on
|
||||
--echo # the information_schema.session_variables table. Not being a CONNECT table, it would be
|
||||
--echo # read using an intermediate MYSQL table using the MySQL API and could not reflect the
|
||||
--echo # current session variable change (the call would create another session) This would be
|
||||
--echo # correct only for querying GLOBAL variables but is not what we want to do here.
|
||||
--echo #
|
||||
CREATE TABLE t2 (
|
||||
name VARCHAR(64) NOT NULL,
|
||||
value VARCHAR(1024) NOT NULL
|
||||
) ENGINE=CONNECT TABLE_TYPE=DOS;
|
||||
INSERT INTO t2 SELECT * FROM information_schema.session_variables WHERE variable_name = 'OPTIMIZER_SWITCH';
|
||||
# Check that MRR is OFF by default
|
||||
create table t3 (
|
||||
name CHAR(32) NOT NULL,
|
||||
value CHAR(64) NOT NULL
|
||||
) ENGINE=CONNECT TABLE_TYPE=XCOL TABNAME=t2 OPTION_LIST='Colname=value';
|
||||
SELECT value FROM t3 WHERE value LIKE 'mrr%';
|
||||
|
||||
--echo #
|
||||
--echo # Testing indexing with MRR OFF
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
matricule INT(4) KEY NOT NULL field_format='Z',
|
||||
nom VARCHAR(16) NOT NULL,
|
||||
prenom VARCHAR(20) NOT NULL,
|
||||
sexe SMALLINT(1) NOT NULL COMMENT 'sexe 1:M 2:F',
|
||||
aanais INT(4) NOT NULL,
|
||||
mmnais INT(2) NOT NULL,
|
||||
ddentree DATE NOT NULL date_format='YYYYMM',
|
||||
ddnom DATE NOT NULL date_format='YYYYMM',
|
||||
brut INT(5) NOT NULL,
|
||||
net DOUBLE(8,2) NOT NULL,
|
||||
service INT(2) NOT NULL,
|
||||
sitmat CHAR(1) NOT NULL,
|
||||
formation CHAR(5) NOT NULL,
|
||||
INDEX NP(nom,prenom)
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='emp.txt' ENDING=2;
|
||||
SELECT * FROM t1 LIMIT 10;
|
||||
--echo # Without MRR, the rows are retrieved sorted by name
|
||||
SELECT matricule, nom, prenom, sitmat, net FROM t1 WHERE nom IN ('ETANG','FOCH','CERF','ITALIE','ROI');
|
||||
|
||||
--echo #
|
||||
--echo # Testing indexing with MRR ON
|
||||
--echo #
|
||||
SET @@LOCAL.OPTIMIZER_SWITCH='mrr=on';
|
||||
--echo # Refresh the t2 table to reflect the change
|
||||
UPDATE t2, information_schema.session_variables SET value = variable_value WHERE variable_name = 'OPTIMIZER_SWITCH';
|
||||
--echo # Check that MRR is ON for the session
|
||||
SELECT value FROM t3 WHERE value LIKE 'mrr%';
|
||||
--echo # With MRR, the rows are retrieved sorted by their position in the table
|
||||
SELECT matricule, nom, prenom, sitmat, net FROM t1 WHERE nom IN ('ETANG','FOCH','CERF','ITALIE','ROI');
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
SET @@LOCAL.OPTIMIZER_SWITCH='mrr=off';
|
||||
--remove_file $MYSQLD_DATADIR/test/emp.txt
|
||||
|
|
|
@ -1,43 +1,43 @@
|
|||
--echo #
|
||||
--echo # Testing multiple 1
|
||||
--echo #
|
||||
CREATE TABLE `t1` (
|
||||
`a` char(10) DEFAULT NULL,
|
||||
`b` char(10) DEFAULT NULL
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `sep_char`=';';
|
||||
INSERT INTO t1 VALUES('test1','bla');
|
||||
SELECT * FROM t1;
|
||||
|
||||
CREATE TABLE `t2` (
|
||||
`a` char(10) DEFAULT NULL,
|
||||
`b` char(10) DEFAULT NULL
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `sep_char`=';';
|
||||
INSERT INTO t2 VALUES('test2','blub');
|
||||
SELECT * FROM t2;
|
||||
|
||||
CREATE TABLE `t_all` (
|
||||
`a` char(10) DEFAULT NULL,
|
||||
`b` char(10) DEFAULT NULL
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `file_name`='t*.csv' `sep_char`=';' `multiple`=1;
|
||||
SELECT * FROM t_all order by `a`;
|
||||
|
||||
--echo #
|
||||
--echo # Testing multiple 2
|
||||
--echo #
|
||||
CREATE table fnlist (
|
||||
fn char(8) not null
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 table_type=DOS;
|
||||
INSERT INTO fnlist VALUES('t1.csv'),('t2.csv');
|
||||
SELECT fn FROM fnlist;
|
||||
|
||||
CREATE TABLE `tblist` (
|
||||
`a` char(10) DEFAULT NULL,
|
||||
`b` char(10) DEFAULT NULL
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `file_name`='fnlist.dos' `sep_char`=';' `multiple`=2;
|
||||
SELECT * FROM tblist;
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t_all;
|
||||
DROP TABLE fnlist;
|
||||
DROP TABLE tblist;
|
||||
--echo #
|
||||
--echo # Testing multiple 1
|
||||
--echo #
|
||||
CREATE TABLE `t1` (
|
||||
`a` char(10) DEFAULT NULL,
|
||||
`b` char(10) DEFAULT NULL
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `sep_char`=';';
|
||||
INSERT INTO t1 VALUES('test1','bla');
|
||||
SELECT * FROM t1;
|
||||
|
||||
CREATE TABLE `t2` (
|
||||
`a` char(10) DEFAULT NULL,
|
||||
`b` char(10) DEFAULT NULL
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `sep_char`=';';
|
||||
INSERT INTO t2 VALUES('test2','blub');
|
||||
SELECT * FROM t2;
|
||||
|
||||
CREATE TABLE `t_all` (
|
||||
`a` char(10) DEFAULT NULL,
|
||||
`b` char(10) DEFAULT NULL
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `file_name`='t*.csv' `sep_char`=';' `multiple`=1;
|
||||
SELECT * FROM t_all order by `a`;
|
||||
|
||||
--echo #
|
||||
--echo # Testing multiple 2
|
||||
--echo #
|
||||
CREATE table fnlist (
|
||||
fn char(8) not null
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 table_type=DOS;
|
||||
INSERT INTO fnlist VALUES('t1.csv'),('t2.csv');
|
||||
SELECT fn FROM fnlist;
|
||||
|
||||
CREATE TABLE `tblist` (
|
||||
`a` char(10) DEFAULT NULL,
|
||||
`b` char(10) DEFAULT NULL
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `file_name`='fnlist.dos' `sep_char`=';' `multiple`=2;
|
||||
SELECT * FROM tblist;
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t_all;
|
||||
DROP TABLE fnlist;
|
||||
DROP TABLE tblist;
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
--source include/not_embedded.inc
|
||||
|
||||
let $PORT= `select @@port`;
|
||||
|
||||
--disable_query_log
|
||||
--replace_result $PORT PORT
|
||||
--error 0,ER_UNKNOWN_ERROR
|
||||
eval CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/tx1';
|
||||
if (!`SELECT count(*) FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
|
||||
AND ENGINE='CONNECT'
|
||||
AND CREATE_OPTIONS LIKE '%`table_type`=MySQL%'`)
|
||||
{
|
||||
Skip Need MySQL support;
|
||||
}
|
||||
DROP TABLE t1;
|
||||
--enable_query_log
|
||||
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
|
||||
connection master;
|
||||
CREATE DATABASE connect;
|
||||
|
||||
connection slave;
|
||||
CREATE DATABASE connect;
|
||||
--source include/not_embedded.inc
|
||||
|
||||
let $PORT= `select @@port`;
|
||||
|
||||
--disable_query_log
|
||||
--replace_result $PORT PORT
|
||||
--error 0,ER_UNKNOWN_ERROR
|
||||
eval CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/tx1';
|
||||
if (!`SELECT count(*) FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
|
||||
AND ENGINE='CONNECT'
|
||||
AND CREATE_OPTIONS LIKE '%`table_type`=MySQL%'`)
|
||||
{
|
||||
Skip Need MySQL support;
|
||||
}
|
||||
DROP TABLE t1;
|
||||
--enable_query_log
|
||||
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
|
||||
connection master;
|
||||
CREATE DATABASE connect;
|
||||
|
||||
connection slave;
|
||||
CREATE DATABASE connect;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
connection master;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS connect.t1;
|
||||
DROP DATABASE IF EXISTS connect;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE IF EXISTS connect.t1;
|
||||
DROP DATABASE IF EXISTS connect;
|
||||
--enable_warnings
|
||||
connection master;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS connect.t1;
|
||||
DROP DATABASE IF EXISTS connect;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE IF EXISTS connect.t1;
|
||||
DROP DATABASE IF EXISTS connect;
|
||||
--enable_warnings
|
||||
|
|
|
@ -1,472 +1,472 @@
|
|||
-- source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# TODO: consider a possibility to run this test
|
||||
# against some remote MySQL server
|
||||
#
|
||||
|
||||
let $PORT= `select @@port`;
|
||||
|
||||
--disable_query_log
|
||||
--replace_result $PORT PORT
|
||||
--error 0,ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='tx1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
if (!`SELECT count(*) FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
|
||||
AND ENGINE='CONNECT'
|
||||
AND CREATE_OPTIONS LIKE '%`table_type`=MySQL%'`)
|
||||
{
|
||||
Skip Need MySQL support;
|
||||
}
|
||||
DROP TABLE t1;
|
||||
--enable_query_log
|
||||
|
||||
# TODO: remote VARCHAR is displayed as CHAR
|
||||
|
||||
CREATE TABLE t1 (a int, b char(10));
|
||||
INSERT INTO t1 VALUES (NULL,NULL),(0,'test00'),(1,'test01'),(2,'test02'),(3,'test03');
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing errors
|
||||
--echo #
|
||||
|
||||
# Bad user name
|
||||
# Suppress "mysql_real_connect failed:" (printed in _DEBUG build)
|
||||
--replace_result $PORT PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root1,port=$PORT'
|
||||
|
||||
# Bad database name
|
||||
--replace_result $PORT PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='unknown' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
|
||||
# Bad database name, with OPTION_LIST going first.
|
||||
--replace_result $PORT PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL OPTION_LIST='host=localhost,user=root,port=$PORT' DBNAME='unknown' TABNAME='t1'
|
||||
|
||||
# Bad table name
|
||||
--replace_result $PORT PORT
|
||||
--error ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='unknown' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SHOW CREATE TABLE t2;
|
||||
|
||||
# Bad column name
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
# The remote table disappeared
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
ALTER TABLE t1 RENAME t1backup;
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t2;
|
||||
ALTER TABLE t1backup RENAME t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing SELECT, etc.
|
||||
--echo #
|
||||
|
||||
# Automatic table structure
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
|
||||
# Explicit table structure
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
|
||||
# Explicit table structure: remote NULL, local NOT NULL
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 (a INT NOT NULL, b CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
|
||||
# Explicit table structure with wrong column types
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 (a char(10), b int) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing numeric data types
|
||||
--echo #
|
||||
|
||||
# TODO: tinyint is mapped to smallint
|
||||
#CREATE TABLE t1 (a tinyint);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: unsigned does not work
|
||||
#CREATE TABLE t1 (a tinyint unsigned);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (a smallint);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (a mediumint);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (a int);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
|
||||
# TODO: bigint is mapped to double(20,0)
|
||||
CREATE TABLE t1 (a bigint);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
|
||||
# TODO: ERROR 1439: Display width out of range for 'a' (max = 255)
|
||||
#CREATE TABLE t1 (a float);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1439: Display width out of range for 'a' (max = 255)
|
||||
#CREATE TABLE t1 (a double);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: decimal is converted to double
|
||||
#CREATE TABLE t1 (a decimal(20,5));
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: add test for BIT
|
||||
|
||||
--echo #
|
||||
--echo # Testing character data types
|
||||
--echo #
|
||||
|
||||
# TODO: char is mapped to varchar
|
||||
CREATE TABLE t1 (a char(10));
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (a varchar(10));
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type tinytext
|
||||
#CREATE TABLE t1 (a tinytext);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type mediumtext
|
||||
#CREATE TABLE t1 (a mediumtext);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: text is converted to varchar(256)
|
||||
#CREATE TABLE t1 (a text);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type longtext
|
||||
#CREATE TABLE t1 (a longtext);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
#TODO: add tests for ENUM
|
||||
#TODO: add tests for SET
|
||||
|
||||
--echo #
|
||||
--echo # Testing binary data types
|
||||
--echo #
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type binary
|
||||
#CREATE TABLE t1 (a binary(10));
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type varbinary
|
||||
#CREATE TABLE t1 (a varbinary(10));
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type tinyblob
|
||||
#CREATE TABLE t1 (a tinyblob);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type mediumblob
|
||||
#CREATE TABLE t1 (a mediumblob);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: blob is converted to varchar(256)
|
||||
#CREATE TABLE t1 (a blob);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type longblob
|
||||
#CREATE TABLE t1 (a longblob);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type geometry
|
||||
#CREATE TABLE t1 (a geometry);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing temporal data types
|
||||
--echo #
|
||||
|
||||
# TODO: time is converted to date
|
||||
#CREATE TABLE t1 (a time);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (a date);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
# TODO: datetime is converted to date
|
||||
#CREATE TABLE t1 (a datetime);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: timestamp is converted to date
|
||||
#CREATE TABLE t1 (a timestamp);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: add test for YEAR
|
||||
# TODO: add tests for fractional seconds
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-4877 mysqldump dumps all data from a connect table
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (10),(20),(30);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@localhost:$PORT/test/t1'
|
||||
SELECT * FROM t2;
|
||||
--echo # Start of mysqldump ------
|
||||
--replace_result $PORT PORT
|
||||
--exec $MYSQL_DUMP --compact test t2
|
||||
--echo # End of mysqldump ------
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing getting unsigned types
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
a TINYINT UNSIGNED NOT NULL,
|
||||
b SMALLINT ZEROFILL NOT NULL,
|
||||
c INT UNSIGNED NOT NULL,
|
||||
d BIGINT UNSIGNED NOT NULL,
|
||||
e CHAR(32) NOT NULL DEFAULT 'Hello') ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
DESCRIBE t1;
|
||||
INSERT INTO t1(a,b,c,d) VALUES(255,65535,4294967295,18446744073709551615);
|
||||
SELECT * FROM t1;
|
||||
|
||||
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME=t1;
|
||||
DESCRIBE t2;
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# MDEV-6085 ALTER TABLE looses the connection string
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (10),(20),(30);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@localhost:$PORT/test/t1'
|
||||
SELECT * FROM t2;
|
||||
ALTER TABLE t2 MODIFY a TINYINT;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# TODO: consider a possibility to run this test
|
||||
# against some remote MySQL server
|
||||
#
|
||||
|
||||
let $PORT= `select @@port`;
|
||||
|
||||
--disable_query_log
|
||||
--replace_result $PORT PORT
|
||||
--error 0,ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='tx1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
if (!`SELECT count(*) FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
|
||||
AND ENGINE='CONNECT'
|
||||
AND CREATE_OPTIONS LIKE '%`table_type`=MySQL%'`)
|
||||
{
|
||||
Skip Need MySQL support;
|
||||
}
|
||||
DROP TABLE t1;
|
||||
--enable_query_log
|
||||
|
||||
# TODO: remote VARCHAR is displayed as CHAR
|
||||
|
||||
CREATE TABLE t1 (a int, b char(10));
|
||||
INSERT INTO t1 VALUES (NULL,NULL),(0,'test00'),(1,'test01'),(2,'test02'),(3,'test03');
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing errors
|
||||
--echo #
|
||||
|
||||
# Bad user name
|
||||
# Suppress "mysql_real_connect failed:" (printed in _DEBUG build)
|
||||
--replace_result $PORT PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root1,port=$PORT'
|
||||
|
||||
# Bad database name
|
||||
--replace_result $PORT PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='unknown' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
|
||||
# Bad database name, with OPTION_LIST going first.
|
||||
--replace_result $PORT PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL OPTION_LIST='host=localhost,user=root,port=$PORT' DBNAME='unknown' TABNAME='t1'
|
||||
|
||||
# Bad table name
|
||||
--replace_result $PORT PORT
|
||||
--error ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='unknown' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SHOW CREATE TABLE t2;
|
||||
|
||||
# Bad column name
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
# The remote table disappeared
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
ALTER TABLE t1 RENAME t1backup;
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t2;
|
||||
ALTER TABLE t1backup RENAME t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing SELECT, etc.
|
||||
--echo #
|
||||
|
||||
# Automatic table structure
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
|
||||
# Explicit table structure
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
|
||||
# Explicit table structure: remote NULL, local NOT NULL
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 (a INT NOT NULL, b CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
|
||||
# Explicit table structure with wrong column types
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 (a char(10), b int) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing numeric data types
|
||||
--echo #
|
||||
|
||||
# TODO: tinyint is mapped to smallint
|
||||
#CREATE TABLE t1 (a tinyint);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: unsigned does not work
|
||||
#CREATE TABLE t1 (a tinyint unsigned);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (a smallint);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (a mediumint);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (a int);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
|
||||
# TODO: bigint is mapped to double(20,0)
|
||||
CREATE TABLE t1 (a bigint);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
|
||||
# TODO: ERROR 1439: Display width out of range for 'a' (max = 255)
|
||||
#CREATE TABLE t1 (a float);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1439: Display width out of range for 'a' (max = 255)
|
||||
#CREATE TABLE t1 (a double);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: decimal is converted to double
|
||||
#CREATE TABLE t1 (a decimal(20,5));
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: add test for BIT
|
||||
|
||||
--echo #
|
||||
--echo # Testing character data types
|
||||
--echo #
|
||||
|
||||
# TODO: char is mapped to varchar
|
||||
CREATE TABLE t1 (a char(10));
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (a varchar(10));
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type tinytext
|
||||
#CREATE TABLE t1 (a tinytext);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type mediumtext
|
||||
#CREATE TABLE t1 (a mediumtext);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: text is converted to varchar(256)
|
||||
#CREATE TABLE t1 (a text);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type longtext
|
||||
#CREATE TABLE t1 (a longtext);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
#TODO: add tests for ENUM
|
||||
#TODO: add tests for SET
|
||||
|
||||
--echo #
|
||||
--echo # Testing binary data types
|
||||
--echo #
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type binary
|
||||
#CREATE TABLE t1 (a binary(10));
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type varbinary
|
||||
#CREATE TABLE t1 (a varbinary(10));
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type tinyblob
|
||||
#CREATE TABLE t1 (a tinyblob);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type mediumblob
|
||||
#CREATE TABLE t1 (a mediumblob);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: blob is converted to varchar(256)
|
||||
#CREATE TABLE t1 (a blob);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type longblob
|
||||
#CREATE TABLE t1 (a longblob);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type geometry
|
||||
#CREATE TABLE t1 (a geometry);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing temporal data types
|
||||
--echo #
|
||||
|
||||
# TODO: time is converted to date
|
||||
#CREATE TABLE t1 (a time);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (a date);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
# TODO: datetime is converted to date
|
||||
#CREATE TABLE t1 (a datetime);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: timestamp is converted to date
|
||||
#CREATE TABLE t1 (a timestamp);
|
||||
#--replace_result $PORT PORT
|
||||
#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $PORT PORT
|
||||
#SHOW CREATE TABLE t2;
|
||||
#SELECT * FROM t2;
|
||||
#DROP TABLE t2, t1;
|
||||
|
||||
# TODO: add test for YEAR
|
||||
# TODO: add tests for fractional seconds
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-4877 mysqldump dumps all data from a connect table
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (10),(20),(30);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@localhost:$PORT/test/t1'
|
||||
SELECT * FROM t2;
|
||||
--echo # Start of mysqldump ------
|
||||
--replace_result $PORT PORT
|
||||
--exec $MYSQL_DUMP --compact test t2
|
||||
--echo # End of mysqldump ------
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing getting unsigned types
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
a TINYINT UNSIGNED NOT NULL,
|
||||
b SMALLINT ZEROFILL NOT NULL,
|
||||
c INT UNSIGNED NOT NULL,
|
||||
d BIGINT UNSIGNED NOT NULL,
|
||||
e CHAR(32) NOT NULL DEFAULT 'Hello') ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
DESCRIBE t1;
|
||||
INSERT INTO t1(a,b,c,d) VALUES(255,65535,4294967295,18446744073709551615);
|
||||
SELECT * FROM t1;
|
||||
|
||||
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME=t1;
|
||||
DESCRIBE t2;
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# MDEV-6085 ALTER TABLE looses the connection string
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (10),(20),(30);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@localhost:$PORT/test/t1'
|
||||
SELECT * FROM t2;
|
||||
ALTER TABLE t2 MODIFY a TINYINT;
|
||||
--replace_result $PORT PORT
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
-- source myconn.inc
|
||||
|
||||
connection slave;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
`id` int(20) primary key,
|
||||
`group` int NOT NULL default 1,
|
||||
`a\\b` int NOT NULL default 2,
|
||||
`a\\` int unsigned,
|
||||
`name` varchar(32) default 'name')
|
||||
DEFAULT CHARSET=latin1;
|
||||
|
||||
connection master;
|
||||
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (id, name) VALUES (1, 'foo');
|
||||
INSERT INTO t1 (id, name) VALUES (2, 'fee');
|
||||
--sorted_result
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
--sorted_result
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- source myconn_cleanup.inc
|
||||
|
||||
-- source myconn.inc
|
||||
|
||||
connection slave;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
`id` int(20) primary key,
|
||||
`group` int NOT NULL default 1,
|
||||
`a\\b` int NOT NULL default 2,
|
||||
`a\\` int unsigned,
|
||||
`name` varchar(32) default 'name')
|
||||
DEFAULT CHARSET=latin1;
|
||||
|
||||
connection master;
|
||||
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (id, name) VALUES (1, 'foo');
|
||||
INSERT INTO t1 (id, name) VALUES (2, 'fee');
|
||||
--sorted_result
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
--sorted_result
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- source myconn_cleanup.inc
|
||||
|
||||
|
|
|
@ -1,45 +1,45 @@
|
|||
-- source myconn.inc
|
||||
|
||||
--echo #
|
||||
--echo # Checking Sending Commands
|
||||
--echo #
|
||||
connection master;
|
||||
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (
|
||||
command VARCHAR(128) NOT NULL,
|
||||
warnings INT(4) NOT NULL FLAG=3,
|
||||
number INT(5) NOT NULL FLAG=1,
|
||||
message VARCHAR(255) FLAG=2)
|
||||
ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test' OPTION_LIST='Execsrc=1,maxerr=2';
|
||||
|
||||
SELECT * FROM t1 WHERE command IN ('Warning','Note',
|
||||
'drop table if exists t1',
|
||||
'create table t1 (id int key auto_increment, msg varchar(32) not null)',
|
||||
"insert into t1(msg) values('One'),(NULL),('Three')",
|
||||
"insert into t1 values(2,'Deux') on duplicate key update msg = 'Two'",
|
||||
"insert into t1(message) values('Four'),('Five'),('Six')",
|
||||
'insert into t1(id) values(NULL)',
|
||||
"update t1 set msg = 'Four' where id = 4",
|
||||
'select * from t1');
|
||||
|
||||
--echo #
|
||||
--echo # Checking Using Procedure
|
||||
--echo #
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
CREATE PROCEDURE p1(cmd varchar(512))
|
||||
READS SQL DATA
|
||||
SELECT * FROM t1 WHERE command IN ('Warning','Note',cmd);
|
||||
|
||||
CALL p1('insert into t1(id) values(NULL)');
|
||||
CALL p1('update t1 set msg = "Five" where id = 5');
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
--sorted_result
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- source myconn_cleanup.inc
|
||||
|
||||
-- source myconn.inc
|
||||
|
||||
--echo #
|
||||
--echo # Checking Sending Commands
|
||||
--echo #
|
||||
connection master;
|
||||
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (
|
||||
command VARCHAR(128) NOT NULL,
|
||||
warnings INT(4) NOT NULL FLAG=3,
|
||||
number INT(5) NOT NULL FLAG=1,
|
||||
message VARCHAR(255) FLAG=2)
|
||||
ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test' OPTION_LIST='Execsrc=1,maxerr=2';
|
||||
|
||||
SELECT * FROM t1 WHERE command IN ('Warning','Note',
|
||||
'drop table if exists t1',
|
||||
'create table t1 (id int key auto_increment, msg varchar(32) not null)',
|
||||
"insert into t1(msg) values('One'),(NULL),('Three')",
|
||||
"insert into t1 values(2,'Deux') on duplicate key update msg = 'Two'",
|
||||
"insert into t1(message) values('Four'),('Five'),('Six')",
|
||||
'insert into t1(id) values(NULL)',
|
||||
"update t1 set msg = 'Four' where id = 4",
|
||||
'select * from t1');
|
||||
|
||||
--echo #
|
||||
--echo # Checking Using Procedure
|
||||
--echo #
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
CREATE PROCEDURE p1(cmd varchar(512))
|
||||
READS SQL DATA
|
||||
SELECT * FROM t1 WHERE command IN ('Warning','Note',cmd);
|
||||
|
||||
CALL p1('insert into t1(id) values(NULL)');
|
||||
CALL p1('update t1 set msg = "Five" where id = 5');
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
--sorted_result
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- source myconn_cleanup.inc
|
||||
|
||||
|
|
|
@ -1,78 +1,78 @@
|
|||
-- source include/not_embedded.inc
|
||||
|
||||
let $PORT= `select @@port`;
|
||||
|
||||
--disable_query_log
|
||||
--replace_result $PORT PORT
|
||||
--error 0,ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='tx1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
if (!`SELECT count(*) FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
|
||||
AND ENGINE='CONNECT'
|
||||
AND CREATE_OPTIONS LIKE '%`table_type`=MySQL%'`)
|
||||
{
|
||||
Skip Need MySQL support;
|
||||
}
|
||||
DROP TABLE t1;
|
||||
--enable_query_log
|
||||
|
||||
--echo #
|
||||
--echo # Testing FILE privilege
|
||||
--echo #
|
||||
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
|
||||
REVOKE FILE ON *.* FROM user@localhost;
|
||||
--connect(user,localhost,user,,)
|
||||
--connection user
|
||||
SELECT user();
|
||||
--replace_result $PORT PORT
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=$PORT'
|
||||
--connection default
|
||||
SELECT user();
|
||||
CREATE TABLE t1remote (a INT NOT NULL);
|
||||
INSERT INTO t1remote VALUES (10),(20),(30);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL TABNAME=t1remote OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
SELECT * FROM t1;
|
||||
--connection user
|
||||
SELECT user();
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
SELECT * FROM t1;
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
INSERT INTO t1 VALUES ('xxx');
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
DELETE FROM t1 WHERE a='xxx';
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
UPDATE t1 SET a='yyy' WHERE a='xxx';
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
TRUNCATE TABLE t1;
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
ALTER TABLE t1 READONLY=1;
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
|
||||
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE
|
||||
--connection default
|
||||
SELECT user();
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
--connection user
|
||||
SELECT user();
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
SELECT * FROM v1;
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
INSERT INTO v1 VALUES (2);
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
UPDATE v1 SET a=123;
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
DELETE FROM v1;
|
||||
|
||||
--disconnect user
|
||||
--connection default
|
||||
SELECT user();
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t1remote;
|
||||
DROP USER user@localhost;
|
||||
--echo #
|
||||
--echo # Testing FILE privileges done
|
||||
--echo #
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
let $PORT= `select @@port`;
|
||||
|
||||
--disable_query_log
|
||||
--replace_result $PORT PORT
|
||||
--error 0,ER_UNKNOWN_ERROR
|
||||
--eval CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='tx1' OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
if (!`SELECT count(*) FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
|
||||
AND ENGINE='CONNECT'
|
||||
AND CREATE_OPTIONS LIKE '%`table_type`=MySQL%'`)
|
||||
{
|
||||
Skip Need MySQL support;
|
||||
}
|
||||
DROP TABLE t1;
|
||||
--enable_query_log
|
||||
|
||||
--echo #
|
||||
--echo # Testing FILE privilege
|
||||
--echo #
|
||||
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
|
||||
REVOKE FILE ON *.* FROM user@localhost;
|
||||
--connect(user,localhost,user,,)
|
||||
--connection user
|
||||
SELECT user();
|
||||
--replace_result $PORT PORT
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=$PORT'
|
||||
--connection default
|
||||
SELECT user();
|
||||
CREATE TABLE t1remote (a INT NOT NULL);
|
||||
INSERT INTO t1remote VALUES (10),(20),(30);
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL TABNAME=t1remote OPTION_LIST='host=localhost,user=root,port=$PORT'
|
||||
SELECT * FROM t1;
|
||||
--connection user
|
||||
SELECT user();
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
SELECT * FROM t1;
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
INSERT INTO t1 VALUES ('xxx');
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
DELETE FROM t1 WHERE a='xxx';
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
UPDATE t1 SET a='yyy' WHERE a='xxx';
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
TRUNCATE TABLE t1;
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
ALTER TABLE t1 READONLY=1;
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
|
||||
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE
|
||||
--connection default
|
||||
SELECT user();
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
--connection user
|
||||
SELECT user();
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
SELECT * FROM v1;
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
INSERT INTO v1 VALUES (2);
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
UPDATE v1 SET a=123;
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
DELETE FROM v1;
|
||||
|
||||
--disconnect user
|
||||
--connection default
|
||||
SELECT user();
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t1remote;
|
||||
DROP USER user@localhost;
|
||||
--echo #
|
||||
--echo # Testing FILE privileges done
|
||||
--echo #
|
||||
|
||||
|
|
|
@ -1,325 +1,325 @@
|
|||
-- source myconn.inc
|
||||
|
||||
#
|
||||
# This test is run against a remote MySQL server
|
||||
#
|
||||
|
||||
connection slave;
|
||||
|
||||
CREATE TABLE t1 (a int, b char(10));
|
||||
INSERT INTO t1 VALUES (NULL,NULL),(0,'test00'),(1,'test01'),(2,'test02'),(3,'test03');
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing errors
|
||||
--echo #
|
||||
connection master;
|
||||
|
||||
# Bad user name
|
||||
# Suppress "mysql_real_connect failed:" (printed in _DEBUG build)
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://unknown@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
|
||||
# Bad database name
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/unknown/t1';
|
||||
|
||||
# Bad database name, with OPTION_LIST going first.
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT' DBNAME='unknown' TABNAME='t1';
|
||||
|
||||
# Bad table name
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
--error ER_UNKNOWN_ERROR
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/unknown';
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
# Bad column name
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# The remote table disappeared
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
|
||||
connection slave;
|
||||
ALTER TABLE t1 RENAME t1backup;
|
||||
|
||||
connection master;
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t1;
|
||||
|
||||
connection slave;
|
||||
ALTER TABLE t1backup RENAME t1;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing SELECT, etc.
|
||||
--echo #
|
||||
|
||||
# Automatic table structure
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Explicit table structure
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1'
|
||||
OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Explicit table structure: remote NULL, local NOT NULL
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (a INT NOT NULL, b CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Explicit table structure with wrong column types
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (a char(10), b int) ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing numeric data types
|
||||
--echo #
|
||||
|
||||
# TODO: mediumint is converted to int, float is converted to double, decimal is converted to double
|
||||
CREATE TABLE t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float, g double, h decimal(20,5));
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES(100,3333,41235,1234567890,235000000000,3.14159265,3.14159265,3141.59265);
|
||||
|
||||
connection master;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
|
||||
# TODO: unsigned does not work
|
||||
#CREATE TABLE t1 (a tinyint unsigned);
|
||||
#SHOW CREATE TABLE t1;
|
||||
|
||||
#connection master;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT';
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1;
|
||||
|
||||
#connection slave;
|
||||
#DROP TABLE t1;
|
||||
|
||||
# TODO: add test for BIT
|
||||
|
||||
--echo #
|
||||
--echo # Testing character data types
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a char(12), b varchar(12));
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES('Welcome','Hello, World');
|
||||
SELECT * FROM t1;
|
||||
|
||||
connection master;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type tinytext
|
||||
#CREATE TABLE t1 (a tinytext);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type mediumtext
|
||||
#CREATE TABLE t1 (a mediumtext);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: text is converted to varchar(256)
|
||||
#CREATE TABLE t1 (a text);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type longtext
|
||||
#CREATE TABLE t1 (a longtext);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
#TODO: add tests for ENUM
|
||||
#TODO: add tests for SET
|
||||
|
||||
#--echo #
|
||||
#--echo # Testing binary data types
|
||||
#--echo #
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type binary
|
||||
#CREATE TABLE t1 (a binary(10));
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type varbinary
|
||||
#CREATE TABLE t1 (a varbinary(10));
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type tinyblob
|
||||
#CREATE TABLE t1 (a tinyblob);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type mediumblob
|
||||
#CREATE TABLE t1 (a mediumblob);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: blob is converted to varchar(256)
|
||||
#CREATE TABLE t1 (a blob);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type longblob
|
||||
#CREATE TABLE t1 (a longblob);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type geometry
|
||||
#CREATE TABLE t1 (a geometry);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing temporal data types
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a date, b datetime, c time, d timestamp, e year);
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES('2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23');
|
||||
SELECT * FROM t1;
|
||||
|
||||
connection master;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- source myconn_cleanup.inc
|
||||
|
||||
-- source myconn.inc
|
||||
|
||||
#
|
||||
# This test is run against a remote MySQL server
|
||||
#
|
||||
|
||||
connection slave;
|
||||
|
||||
CREATE TABLE t1 (a int, b char(10));
|
||||
INSERT INTO t1 VALUES (NULL,NULL),(0,'test00'),(1,'test01'),(2,'test02'),(3,'test03');
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing errors
|
||||
--echo #
|
||||
connection master;
|
||||
|
||||
# Bad user name
|
||||
# Suppress "mysql_real_connect failed:" (printed in _DEBUG build)
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://unknown@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
|
||||
# Bad database name
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/unknown/t1';
|
||||
|
||||
# Bad database name, with OPTION_LIST going first.
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT "mysql_real_connect failed: " ""
|
||||
--error ER_UNKNOWN_ERROR
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT' DBNAME='unknown' TABNAME='t1';
|
||||
|
||||
# Bad table name
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
--error ER_UNKNOWN_ERROR
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/unknown';
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
# Bad column name
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# The remote table disappeared
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
|
||||
connection slave;
|
||||
ALTER TABLE t1 RENAME t1backup;
|
||||
|
||||
connection master;
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM t1;
|
||||
|
||||
connection slave;
|
||||
ALTER TABLE t1backup RENAME t1;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing SELECT, etc.
|
||||
--echo #
|
||||
|
||||
# Automatic table structure
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Explicit table structure
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1'
|
||||
OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Explicit table structure: remote NULL, local NOT NULL
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (a INT NOT NULL, b CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Explicit table structure with wrong column types
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 (a char(10), b int) ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing numeric data types
|
||||
--echo #
|
||||
|
||||
# TODO: mediumint is converted to int, float is converted to double, decimal is converted to double
|
||||
CREATE TABLE t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float, g double, h decimal(20,5));
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES(100,3333,41235,1234567890,235000000000,3.14159265,3.14159265,3141.59265);
|
||||
|
||||
connection master;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
|
||||
# TODO: unsigned does not work
|
||||
#CREATE TABLE t1 (a tinyint unsigned);
|
||||
#SHOW CREATE TABLE t1;
|
||||
|
||||
#connection master;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT';
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1;
|
||||
|
||||
#connection slave;
|
||||
#DROP TABLE t1;
|
||||
|
||||
# TODO: add test for BIT
|
||||
|
||||
--echo #
|
||||
--echo # Testing character data types
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a char(12), b varchar(12));
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES('Welcome','Hello, World');
|
||||
SELECT * FROM t1;
|
||||
|
||||
connection master;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type tinytext
|
||||
#CREATE TABLE t1 (a tinytext);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type mediumtext
|
||||
#CREATE TABLE t1 (a mediumtext);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: text is converted to varchar(256)
|
||||
#CREATE TABLE t1 (a text);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type longtext
|
||||
#CREATE TABLE t1 (a longtext);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
#TODO: add tests for ENUM
|
||||
#TODO: add tests for SET
|
||||
|
||||
#--echo #
|
||||
#--echo # Testing binary data types
|
||||
#--echo #
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type binary
|
||||
#CREATE TABLE t1 (a binary(10));
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type varbinary
|
||||
#CREATE TABLE t1 (a varbinary(10));
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type tinyblob
|
||||
#CREATE TABLE t1 (a tinyblob);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type mediumblob
|
||||
#CREATE TABLE t1 (a mediumblob);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: blob is converted to varchar(256)
|
||||
#CREATE TABLE t1 (a blob);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type longblob
|
||||
#CREATE TABLE t1 (a longblob);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
# TODO: ERROR 1105: Unsupported column type geometry
|
||||
#CREATE TABLE t1 (a geometry);
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=127.0.0.1,user=root,port=$SLAVE_MYPORT'
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
#SHOW CREATE TABLE t1;
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1, t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing temporal data types
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a date, b datetime, c time, d timestamp, e year);
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES('2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23');
|
||||
SELECT * FROM t1;
|
||||
|
||||
connection master;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- source myconn_cleanup.inc
|
||||
|
||||
|
|
|
@ -1,87 +1,87 @@
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # Testing FIX null columns
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL,
|
||||
nb INT,
|
||||
msg VARCHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
--error ER_BAD_NULL_ERROR
|
||||
INSERT INTO t1 values(NULL,1,'Hello');
|
||||
INSERT INTO t1 values(10,4,NULL),(20,2,'Hello'),(0,0,'Zero');
|
||||
SELECT * FROM t1;
|
||||
SELECT* FROM t1 WHERE id IS NULL;
|
||||
SELECT * FROM t1 WHERE nb IS NULL;
|
||||
SELECT * FROM t1 WHERE msg IS NOT NULL;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing CSV null columns
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL,
|
||||
nb INT,
|
||||
msg VARCHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV HEADER=1;
|
||||
--error ER_BAD_NULL_ERROR
|
||||
INSERT INTO t1 values(NULL,1,'Hello');
|
||||
INSERT INTO t1 values(10,4,NULL),(20,2,'Hello'),(0,0,'Zero');
|
||||
SELECT * FROM t1;
|
||||
SELECT* FROM t1 WHERE id IS NULL;
|
||||
SELECT * FROM t1 WHERE nb IS NULL;
|
||||
SELECT * FROM t1 WHERE msg IS NOT NULL;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing BIN null columns
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL,
|
||||
nb INT,
|
||||
msg VARCHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=BIN;
|
||||
--error ER_BAD_NULL_ERROR
|
||||
INSERT INTO t1 values(NULL,1,'Hello');
|
||||
INSERT INTO t1 values(10,4,NULL),(20,2,'Hello'),(0,0,'Zero');
|
||||
SELECT * FROM t1;
|
||||
SELECT* FROM t1 WHERE id IS NULL;
|
||||
SELECT * FROM t1 WHERE nb IS NULL;
|
||||
SELECT * FROM t1 WHERE msg IS NOT NULL;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing DBF null columns
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL,
|
||||
nb INT,
|
||||
msg VARCHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=DBF;
|
||||
--error ER_BAD_NULL_ERROR
|
||||
INSERT INTO t1 values(NULL,1,'Hello');
|
||||
INSERT INTO t1 values(10,4,NULL),(20,2,'Hello'),(0,0,'Zero');
|
||||
SELECT * FROM t1;
|
||||
SELECT* FROM t1 WHERE id IS NULL;
|
||||
SELECT * FROM t1 WHERE nb IS NULL;
|
||||
SELECT * FROM t1 WHERE msg IS NOT NULL;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing INI null columns
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
`sec` char(8) NOT NULL flag=1,
|
||||
`key` char(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=INI;
|
||||
INSERT INTO t1(sec) values('S1');
|
||||
SELECT * FROM t1;
|
||||
INSERT INTO t1 values('S1','Newval');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # Testing FIX null columns
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL,
|
||||
nb INT,
|
||||
msg VARCHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
--error ER_BAD_NULL_ERROR
|
||||
INSERT INTO t1 values(NULL,1,'Hello');
|
||||
INSERT INTO t1 values(10,4,NULL),(20,2,'Hello'),(0,0,'Zero');
|
||||
SELECT * FROM t1;
|
||||
SELECT* FROM t1 WHERE id IS NULL;
|
||||
SELECT * FROM t1 WHERE nb IS NULL;
|
||||
SELECT * FROM t1 WHERE msg IS NOT NULL;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing CSV null columns
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL,
|
||||
nb INT,
|
||||
msg VARCHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV HEADER=1;
|
||||
--error ER_BAD_NULL_ERROR
|
||||
INSERT INTO t1 values(NULL,1,'Hello');
|
||||
INSERT INTO t1 values(10,4,NULL),(20,2,'Hello'),(0,0,'Zero');
|
||||
SELECT * FROM t1;
|
||||
SELECT* FROM t1 WHERE id IS NULL;
|
||||
SELECT * FROM t1 WHERE nb IS NULL;
|
||||
SELECT * FROM t1 WHERE msg IS NOT NULL;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing BIN null columns
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL,
|
||||
nb INT,
|
||||
msg VARCHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=BIN;
|
||||
--error ER_BAD_NULL_ERROR
|
||||
INSERT INTO t1 values(NULL,1,'Hello');
|
||||
INSERT INTO t1 values(10,4,NULL),(20,2,'Hello'),(0,0,'Zero');
|
||||
SELECT * FROM t1;
|
||||
SELECT* FROM t1 WHERE id IS NULL;
|
||||
SELECT * FROM t1 WHERE nb IS NULL;
|
||||
SELECT * FROM t1 WHERE msg IS NOT NULL;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing DBF null columns
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id INT NOT NULL,
|
||||
nb INT,
|
||||
msg VARCHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=DBF;
|
||||
--error ER_BAD_NULL_ERROR
|
||||
INSERT INTO t1 values(NULL,1,'Hello');
|
||||
INSERT INTO t1 values(10,4,NULL),(20,2,'Hello'),(0,0,'Zero');
|
||||
SELECT * FROM t1;
|
||||
SELECT* FROM t1 WHERE id IS NULL;
|
||||
SELECT * FROM t1 WHERE nb IS NULL;
|
||||
SELECT * FROM t1 WHERE msg IS NOT NULL;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing INI null columns
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
`sec` char(8) NOT NULL flag=1,
|
||||
`key` char(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=INI;
|
||||
INSERT INTO t1(sec) values('S1');
|
||||
SELECT * FROM t1;
|
||||
INSERT INTO t1 values('S1','Newval');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -1,61 +1,61 @@
|
|||
-- source include/not_embedded.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $PORT= `select @@port`;
|
||||
--copy_file $MTR_SUITE_DIR/std_data/employee.dat $MYSQLD_DATADIR/test/employee.dat
|
||||
|
||||
CREATE TABLE employee (
|
||||
serialno CHAR(5) NOT NULL,
|
||||
name VARCHAR(12) NOT NULL FLAG=6,
|
||||
sex TINYINT(1) NOT NULL,
|
||||
title VARCHAR(15) NOT NULL FLAG=20,
|
||||
manager CHAR(5) DEFAULT NULL,
|
||||
department CHAR(4) NOT NULL FLAG=41,
|
||||
secretary CHAR(5) DEFAULT NULL FLAG=46,
|
||||
salary DOUBLE(8,2) NOT NULL FLAG=52
|
||||
) ENGINE=connect TABLE_TYPE=fix FILE_NAME='employee.dat' ENDING=1;
|
||||
SELECT * FROM employee;
|
||||
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE occurs (name CHAR(12), sex CHAR(1), title CHAR(15), department CHAR(4), salary DOUBLE(8,2), id_of CHAR(12), id CHAR(5) NOT NULL) ENGINE=CONNECT TABLE_TYPE=OCCUR TABNAME=employee OPTION_LIST='OccurCol=ID,RankCol=ID_OF,Colist=serialno;manager;secretary,port=$PORT';
|
||||
SELECT * FROM occurs;
|
||||
|
||||
DROP TABLE occurs;
|
||||
DROP TABLE employee;
|
||||
|
||||
CREATE TABLE pets (
|
||||
name VARCHAR(12) NOT NULL,
|
||||
dog INT NOT NULL DEFAULT 0,
|
||||
cat INT NOT NULL DEFAULT 0,
|
||||
rabbit INT NOT NULL DEFAULT 0,
|
||||
bird INT NOT NULL DEFAULT 0,
|
||||
fish INT NOT NULL DEFAULT 0) ENGINE=MYISAM;
|
||||
INSERT INTO pets(name,dog) VALUES('John',2);
|
||||
INSERT INTO pets(name,cat) VALUES('Bill',1);
|
||||
INSERT INTO pets(name,dog,cat) VALUES('Mary',1,1);
|
||||
INSERT INTO pets(name,rabbit) VALUES('Lisbeth',2);
|
||||
INSERT INTO pets(name,cat,bird) VALUES('Kevin',2,6);
|
||||
INSERT INTO pets(name,dog,fish) VALUES('Donald',1,3);
|
||||
SELECT * FROM pets;
|
||||
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE xpet (name VARCHAR(12) NOT NULL, race CHAR(6) NOT NULL, number INT) ENGINE=CONNECT TABLE_TYPE=OCCUR TABNAME=pets OPTION_LIST='OccurCol=number,RankCol=race,Colist=dog;cat;rabbit;bird;fish,port=$PORT'
|
||||
|
||||
SELECT * FROM xpet;
|
||||
SELECT name FROM xpet;
|
||||
SELECT name FROM xpet WHERE race = 'cat' AND number = 0;
|
||||
SELECT name, SUM(number) pets FROM xpet GROUP BY name;
|
||||
|
||||
ALTER TABLE xpet MODIFY number INT NOT NULL;
|
||||
|
||||
SELECT * FROM xpet;
|
||||
SELECT * FROM xpet WHERE number > 1;
|
||||
SELECT DISTINCT name FROM xpet WHERE number > 1;
|
||||
SELECT name FROM xpet;
|
||||
SELECT name, race FROM xpet;
|
||||
SELECT name, count(*) FROM xpet GROUP BY name, LEAST(number,1);
|
||||
SELECT name, number, count(*) FROM xpet GROUP BY name, number;
|
||||
|
||||
DROP TABLE xpet;
|
||||
DROP TABLE pets;
|
||||
--remove_file $MYSQLD_DATADIR/test/employee.dat
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $PORT= `select @@port`;
|
||||
--copy_file $MTR_SUITE_DIR/std_data/employee.dat $MYSQLD_DATADIR/test/employee.dat
|
||||
|
||||
CREATE TABLE employee (
|
||||
serialno CHAR(5) NOT NULL,
|
||||
name VARCHAR(12) NOT NULL FLAG=6,
|
||||
sex TINYINT(1) NOT NULL,
|
||||
title VARCHAR(15) NOT NULL FLAG=20,
|
||||
manager CHAR(5) DEFAULT NULL,
|
||||
department CHAR(4) NOT NULL FLAG=41,
|
||||
secretary CHAR(5) DEFAULT NULL FLAG=46,
|
||||
salary DOUBLE(8,2) NOT NULL FLAG=52
|
||||
) ENGINE=connect TABLE_TYPE=fix FILE_NAME='employee.dat' ENDING=1;
|
||||
SELECT * FROM employee;
|
||||
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE occurs (name CHAR(12), sex CHAR(1), title CHAR(15), department CHAR(4), salary DOUBLE(8,2), id_of CHAR(12), id CHAR(5) NOT NULL) ENGINE=CONNECT TABLE_TYPE=OCCUR TABNAME=employee OPTION_LIST='OccurCol=ID,RankCol=ID_OF,Colist=serialno;manager;secretary,port=$PORT';
|
||||
SELECT * FROM occurs;
|
||||
|
||||
DROP TABLE occurs;
|
||||
DROP TABLE employee;
|
||||
|
||||
CREATE TABLE pets (
|
||||
name VARCHAR(12) NOT NULL,
|
||||
dog INT NOT NULL DEFAULT 0,
|
||||
cat INT NOT NULL DEFAULT 0,
|
||||
rabbit INT NOT NULL DEFAULT 0,
|
||||
bird INT NOT NULL DEFAULT 0,
|
||||
fish INT NOT NULL DEFAULT 0) ENGINE=MYISAM;
|
||||
INSERT INTO pets(name,dog) VALUES('John',2);
|
||||
INSERT INTO pets(name,cat) VALUES('Bill',1);
|
||||
INSERT INTO pets(name,dog,cat) VALUES('Mary',1,1);
|
||||
INSERT INTO pets(name,rabbit) VALUES('Lisbeth',2);
|
||||
INSERT INTO pets(name,cat,bird) VALUES('Kevin',2,6);
|
||||
INSERT INTO pets(name,dog,fish) VALUES('Donald',1,3);
|
||||
SELECT * FROM pets;
|
||||
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE xpet (name VARCHAR(12) NOT NULL, race CHAR(6) NOT NULL, number INT) ENGINE=CONNECT TABLE_TYPE=OCCUR TABNAME=pets OPTION_LIST='OccurCol=number,RankCol=race,Colist=dog;cat;rabbit;bird;fish,port=$PORT'
|
||||
|
||||
SELECT * FROM xpet;
|
||||
SELECT name FROM xpet;
|
||||
SELECT name FROM xpet WHERE race = 'cat' AND number = 0;
|
||||
SELECT name, SUM(number) pets FROM xpet GROUP BY name;
|
||||
|
||||
ALTER TABLE xpet MODIFY number INT NOT NULL;
|
||||
|
||||
SELECT * FROM xpet;
|
||||
SELECT * FROM xpet WHERE number > 1;
|
||||
SELECT DISTINCT name FROM xpet WHERE number > 1;
|
||||
SELECT name FROM xpet;
|
||||
SELECT name, race FROM xpet;
|
||||
SELECT name, count(*) FROM xpet GROUP BY name, LEAST(number,1);
|
||||
SELECT name, number, count(*) FROM xpet GROUP BY name, number;
|
||||
|
||||
DROP TABLE xpet;
|
||||
DROP TABLE pets;
|
||||
--remove_file $MYSQLD_DATADIR/test/employee.dat
|
||||
|
|
|
@ -1,90 +1,90 @@
|
|||
--source have_odbc_sqlite3.inc
|
||||
|
||||
#
|
||||
# To run this test, install SQLite3 ODBC Driver from
|
||||
# http://www.ch-werner.de/sqliteodbc/
|
||||
#
|
||||
# Note, the test does not need a DSN to be created
|
||||
# (only the driver is required)
|
||||
#
|
||||
#
|
||||
# On Windows:
|
||||
# -----------
|
||||
# Download and run the installer file sqliteodbc.exe
|
||||
# Version sqliteodbc-0.991 is known to Work.
|
||||
# After running the installer the test should start working automatically.
|
||||
#
|
||||
# On Linux:
|
||||
# --------
|
||||
# 1. Download the source tarball, e.g.: sqliteodbc-0.993.tar.gz
|
||||
# 2. Unpack the sources:
|
||||
# tar -zxf sqliteodbc-0.993.tar.gz
|
||||
# 3. Compile the source and install:
|
||||
# cd sqliteodbc-0.993
|
||||
# ./configure --prefix=/opt/sqliteodbc
|
||||
# make
|
||||
# sudo make install
|
||||
#
|
||||
# (you can use a different --prefix, according to your preferences)
|
||||
#
|
||||
# 4. Add these lines into /etc/odbcinst.ini
|
||||
#
|
||||
#[SQLite3 ODBC Driver]
|
||||
#Description=SQLite3 ODBC Driver
|
||||
#Driver=/opt/sqliteodbc/libsqlite3odbc.so
|
||||
#Setup=/opt/sqliteodbc/libsqlite3odbc.so
|
||||
#
|
||||
# Adjust the directory "/opt/sqliteodbc/" according to --prefix
|
||||
# that you chose on step #3.
|
||||
#
|
||||
#
|
||||
|
||||
SET NAMES utf8;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
|
||||
#
|
||||
# For some reasons Windows does not allow to remove the data base
|
||||
# file after "DROP TABLE t1". So unlike in odbc_xls.test we won't copy
|
||||
# the data file, we'll use directly the file in std_data.
|
||||
# As we do not do any modifications in the database, this should be OK.
|
||||
#
|
||||
let $Database=$MTR_SUITE_DIR/std_data/test.sqlite3;
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
--eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=$Database;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
|
||||
CREATE TABLE t2 AS SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
SELECT * FROM v1;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
--eval CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Columns TABNAME='t1' TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=$Database;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
--eval CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Tables TABNAME='t1' TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=$Database;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
--eval CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Columns TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=$Database;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8
|
||||
SELECT * FROM t1 ORDER BY Table_name;
|
||||
DROP TABLE t1;
|
||||
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
--eval CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Tables TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=$Database;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8
|
||||
SELECT * FROM t1 ORDER BY Table_name;
|
||||
DROP TABLE t1;
|
||||
--source have_odbc_sqlite3.inc
|
||||
|
||||
#
|
||||
# To run this test, install SQLite3 ODBC Driver from
|
||||
# http://www.ch-werner.de/sqliteodbc/
|
||||
#
|
||||
# Note, the test does not need a DSN to be created
|
||||
# (only the driver is required)
|
||||
#
|
||||
#
|
||||
# On Windows:
|
||||
# -----------
|
||||
# Download and run the installer file sqliteodbc.exe
|
||||
# Version sqliteodbc-0.991 is known to Work.
|
||||
# After running the installer the test should start working automatically.
|
||||
#
|
||||
# On Linux:
|
||||
# --------
|
||||
# 1. Download the source tarball, e.g.: sqliteodbc-0.993.tar.gz
|
||||
# 2. Unpack the sources:
|
||||
# tar -zxf sqliteodbc-0.993.tar.gz
|
||||
# 3. Compile the source and install:
|
||||
# cd sqliteodbc-0.993
|
||||
# ./configure --prefix=/opt/sqliteodbc
|
||||
# make
|
||||
# sudo make install
|
||||
#
|
||||
# (you can use a different --prefix, according to your preferences)
|
||||
#
|
||||
# 4. Add these lines into /etc/odbcinst.ini
|
||||
#
|
||||
#[SQLite3 ODBC Driver]
|
||||
#Description=SQLite3 ODBC Driver
|
||||
#Driver=/opt/sqliteodbc/libsqlite3odbc.so
|
||||
#Setup=/opt/sqliteodbc/libsqlite3odbc.so
|
||||
#
|
||||
# Adjust the directory "/opt/sqliteodbc/" according to --prefix
|
||||
# that you chose on step #3.
|
||||
#
|
||||
#
|
||||
|
||||
SET NAMES utf8;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
|
||||
#
|
||||
# For some reasons Windows does not allow to remove the data base
|
||||
# file after "DROP TABLE t1". So unlike in odbc_xls.test we won't copy
|
||||
# the data file, we'll use directly the file in std_data.
|
||||
# As we do not do any modifications in the database, this should be OK.
|
||||
#
|
||||
let $Database=$MTR_SUITE_DIR/std_data/test.sqlite3;
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
--eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=$Database;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
|
||||
CREATE TABLE t2 AS SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
SELECT * FROM v1;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
--eval CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Columns TABNAME='t1' TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=$Database;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
--eval CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Tables TABNAME='t1' TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=$Database;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
--eval CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Columns TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=$Database;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8
|
||||
SELECT * FROM t1 ORDER BY Table_name;
|
||||
DROP TABLE t1;
|
||||
|
||||
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
|
||||
--eval CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Tables TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=$Database;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8
|
||||
SELECT * FROM t1 ORDER BY Table_name;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -1,166 +1,166 @@
|
|||
--source include/have_partition.inc
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
set @@global.connect_exact_info=ON;
|
||||
|
||||
--echo # This will be used to see what data files are created
|
||||
CREATE TABLE dr1 (
|
||||
fname VARCHAR(256) NOT NULL FLAG=2,
|
||||
ftype CHAR(8) NOT NULL FLAG=3
|
||||
# ,FSIZE INT(6) NOT NULL FLAG=5 removed because Unix size != Windows size
|
||||
) engine=CONNECT table_type=DIR file_name='t1#P#*.*';
|
||||
|
||||
--echo #
|
||||
--echo # Testing partitioning on inward table
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id INT NOT NULL,
|
||||
msg VARCHAR(32)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV AVG_ROW_LENGTH=10
|
||||
PARTITION BY RANGE(id) (
|
||||
PARTITION first VALUES LESS THAN(10),
|
||||
PARTITION middle VALUES LESS THAN(50),
|
||||
PARTITION last VALUES LESS THAN(MAXVALUE));
|
||||
INSERT INTO t1 VALUES(4, 'four'),(24, 'twenty four');
|
||||
INSERT INTO t1 VALUES(7,'seven'),(10,'ten'),(40,'forty'),(60,'sixty'),(81,'eighty one');
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id > 50;
|
||||
SELECT * FROM t1 WHERE id > 50;
|
||||
#TODO: Differences between Linux and Windows
|
||||
#SHOW TABLE STATUS LIKE 't1';
|
||||
--error ER_GET_ERRMSG
|
||||
UPDATE t1 set id = 41 WHERE msg = 'four';
|
||||
UPDATE t1 set msg = 'quatre' WHERE id = 4;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
--echo #
|
||||
--echo # Altering partitioning on inward table
|
||||
--echo #
|
||||
ALTER TABLE t1
|
||||
PARTITION by range(id) (
|
||||
PARTITION first VALUES LESS THAN(11),
|
||||
PARTITION middle VALUES LESS THAN(50),
|
||||
PARTITION last VALUES LESS THAN(MAXVALUE));
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id=10;
|
||||
SELECT * FROM t1 WHERE id=10;
|
||||
DELETE FROM t1 WHERE id in (4,60);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
# TODO: this fails on Linux
|
||||
#SELECT * FROM dr1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing partitioning on a void outward table
|
||||
--echo #
|
||||
ALTER TABLE dr1 FILE_NAME='part*.*';
|
||||
CREATE TABLE t1 (
|
||||
rwid INT(6) DEFAULT 0 SPECIAL=ROWID,
|
||||
rnum INT(6) DEFAULT 0 SPECIAL=ROWNUM,
|
||||
prtn VARCHAR(64) DEFAULT '' SPECIAL=PARTID,
|
||||
tbn VARCHAR(64) DEFAULT '' SPECIAL=TABID,
|
||||
fid VARCHAR(256) DEFAULT '' SPECIAL=FNAME,
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32)
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='part%s.txt';
|
||||
--replace_result $MYSQLD_DATADIR "DATADIR/"
|
||||
ALTER TABLE t1
|
||||
PARTITION by range columns(id) (
|
||||
PARTITION `1` VALUES LESS THAN(10),
|
||||
PARTITION `2` VALUES LESS THAN(50),
|
||||
PARTITION `3` VALUES LESS THAN(MAXVALUE));
|
||||
SHOW INDEX FROM t1;
|
||||
# TODO: this fails on Linux
|
||||
#SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
INSERT INTO t1(id,msg) VALUES(4, 'four');
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
INSERT INTO t1(id,msg) VALUES(7,'seven'),(10,'ten'),(40,'forty'),(60,'sixty'),(81,'eighty one');
|
||||
INSERT INTO t1(id,msg) VALUES(72,'seventy two'),(20,'twenty'),(1,'one'),(35,'thirty five'),(8,'eight');
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by id;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id = 10;
|
||||
SELECT * FROM t1 WHERE id = 10;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id >= 10;
|
||||
SELECT * FROM t1 WHERE id >= 10;
|
||||
SELECT count(*) FROM t1 WHERE id < 10;
|
||||
SELECT case when id < 10 then 1 when id < 50 then 2 else 3 end as pn, count(*) FROM t1 group by pn;
|
||||
SELECT prtn, count(*) FROM t1 group by prtn;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id > 50;
|
||||
SELECT * FROM t1 WHERE id = 35;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
--echo # This does not change the partition file data and is WRONG
|
||||
ALTER TABLE t1
|
||||
PARTITION by range columns(id) (
|
||||
PARTITION `1` VALUES LESS THAN(11),
|
||||
PARTITION `2` VALUES LESS THAN(70),
|
||||
PARTITION `3` VALUES LESS THAN(MAXVALUE));
|
||||
SELECT CASE WHEN id < 11 THEN 1 WHEN id < 70 THEN 2 ELSE 3 END AS pn, COUNT(*) FROM t1 GROUP BY pn;
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
--echo #
|
||||
--echo # This is the correct way to change partitioning:
|
||||
--echo # Save table values, erase the table, then re-insert saved values in modified table
|
||||
--echo #
|
||||
CREATE TABLE t2 (
|
||||
id INT NOT NULL,
|
||||
msg VARCHAR(32)
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
INSERT INTO t2 SELECT id, msg FROM t1;
|
||||
DELETE FROM t1;
|
||||
INSERT INTO t1(id,msg) SELECT * FROM t2;
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing partitioning on a populated outward table
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id INT NOT NULL,
|
||||
msg VARCHAR(32)
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='part%s.txt'
|
||||
PARTITION by range columns(id) (
|
||||
PARTITION `1` VALUES LESS THAN(11),
|
||||
PARTITION `2` VALUES LESS THAN(70),
|
||||
PARTITION `3` VALUES LESS THAN(MAXVALUE));
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1 WHERE id < 11;
|
||||
SELECT * FROM t1 WHERE id >= 70;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
|
||||
--echo #
|
||||
--echo # Testing indexing on a partitioned table
|
||||
--echo #
|
||||
CREATE INDEX XID ON t1(id);
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id = 10;
|
||||
DROP INDEX XID ON t1;
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
ALTER TABLE t1 ADD PRIMARY KEY (id);
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id = 10;
|
||||
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE dr1;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
set @@global.connect_exact_info=OFF;
|
||||
|
||||
--remove_file $MYSQLD_DATADIR/test/part1.txt
|
||||
--remove_file $MYSQLD_DATADIR/test/part2.txt
|
||||
--remove_file $MYSQLD_DATADIR/test/part3.txt
|
||||
#--remove_file $MYSQLD_DATADIR/test/part%s.fnx
|
||||
#--remove_file $MYSQLD_DATADIR/test/part1.fnx
|
||||
#--remove_file $MYSQLD_DATADIR/test/part2.fnx
|
||||
#--remove_file $MYSQLD_DATADIR/test/part3.fnx
|
||||
--source include/have_partition.inc
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
set @@global.connect_exact_info=ON;
|
||||
|
||||
--echo # This will be used to see what data files are created
|
||||
CREATE TABLE dr1 (
|
||||
fname VARCHAR(256) NOT NULL FLAG=2,
|
||||
ftype CHAR(8) NOT NULL FLAG=3
|
||||
# ,FSIZE INT(6) NOT NULL FLAG=5 removed because Unix size != Windows size
|
||||
) engine=CONNECT table_type=DIR file_name='t1#P#*.*';
|
||||
|
||||
--echo #
|
||||
--echo # Testing partitioning on inward table
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id INT NOT NULL,
|
||||
msg VARCHAR(32)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV AVG_ROW_LENGTH=10
|
||||
PARTITION BY RANGE(id) (
|
||||
PARTITION first VALUES LESS THAN(10),
|
||||
PARTITION middle VALUES LESS THAN(50),
|
||||
PARTITION last VALUES LESS THAN(MAXVALUE));
|
||||
INSERT INTO t1 VALUES(4, 'four'),(24, 'twenty four');
|
||||
INSERT INTO t1 VALUES(7,'seven'),(10,'ten'),(40,'forty'),(60,'sixty'),(81,'eighty one');
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id > 50;
|
||||
SELECT * FROM t1 WHERE id > 50;
|
||||
#TODO: Differences between Linux and Windows
|
||||
#SHOW TABLE STATUS LIKE 't1';
|
||||
--error ER_GET_ERRMSG
|
||||
UPDATE t1 set id = 41 WHERE msg = 'four';
|
||||
UPDATE t1 set msg = 'quatre' WHERE id = 4;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
--echo #
|
||||
--echo # Altering partitioning on inward table
|
||||
--echo #
|
||||
ALTER TABLE t1
|
||||
PARTITION by range(id) (
|
||||
PARTITION first VALUES LESS THAN(11),
|
||||
PARTITION middle VALUES LESS THAN(50),
|
||||
PARTITION last VALUES LESS THAN(MAXVALUE));
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id=10;
|
||||
SELECT * FROM t1 WHERE id=10;
|
||||
DELETE FROM t1 WHERE id in (4,60);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
# TODO: this fails on Linux
|
||||
#SELECT * FROM dr1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing partitioning on a void outward table
|
||||
--echo #
|
||||
ALTER TABLE dr1 FILE_NAME='part*.*';
|
||||
CREATE TABLE t1 (
|
||||
rwid INT(6) DEFAULT 0 SPECIAL=ROWID,
|
||||
rnum INT(6) DEFAULT 0 SPECIAL=ROWNUM,
|
||||
prtn VARCHAR(64) DEFAULT '' SPECIAL=PARTID,
|
||||
tbn VARCHAR(64) DEFAULT '' SPECIAL=TABID,
|
||||
fid VARCHAR(256) DEFAULT '' SPECIAL=FNAME,
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32)
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='part%s.txt';
|
||||
--replace_result $MYSQLD_DATADIR "DATADIR/"
|
||||
ALTER TABLE t1
|
||||
PARTITION by range columns(id) (
|
||||
PARTITION `1` VALUES LESS THAN(10),
|
||||
PARTITION `2` VALUES LESS THAN(50),
|
||||
PARTITION `3` VALUES LESS THAN(MAXVALUE));
|
||||
SHOW INDEX FROM t1;
|
||||
# TODO: this fails on Linux
|
||||
#SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
INSERT INTO t1(id,msg) VALUES(4, 'four');
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
INSERT INTO t1(id,msg) VALUES(7,'seven'),(10,'ten'),(40,'forty'),(60,'sixty'),(81,'eighty one');
|
||||
INSERT INTO t1(id,msg) VALUES(72,'seventy two'),(20,'twenty'),(1,'one'),(35,'thirty five'),(8,'eight');
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 order by id;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id = 10;
|
||||
SELECT * FROM t1 WHERE id = 10;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id >= 10;
|
||||
SELECT * FROM t1 WHERE id >= 10;
|
||||
SELECT count(*) FROM t1 WHERE id < 10;
|
||||
SELECT case when id < 10 then 1 when id < 50 then 2 else 3 end as pn, count(*) FROM t1 group by pn;
|
||||
SELECT prtn, count(*) FROM t1 group by prtn;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id > 50;
|
||||
SELECT * FROM t1 WHERE id = 35;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
--echo # This does not change the partition file data and is WRONG
|
||||
ALTER TABLE t1
|
||||
PARTITION by range columns(id) (
|
||||
PARTITION `1` VALUES LESS THAN(11),
|
||||
PARTITION `2` VALUES LESS THAN(70),
|
||||
PARTITION `3` VALUES LESS THAN(MAXVALUE));
|
||||
SELECT CASE WHEN id < 11 THEN 1 WHEN id < 70 THEN 2 ELSE 3 END AS pn, COUNT(*) FROM t1 GROUP BY pn;
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
--echo #
|
||||
--echo # This is the correct way to change partitioning:
|
||||
--echo # Save table values, erase the table, then re-insert saved values in modified table
|
||||
--echo #
|
||||
CREATE TABLE t2 (
|
||||
id INT NOT NULL,
|
||||
msg VARCHAR(32)
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
INSERT INTO t2 SELECT id, msg FROM t1;
|
||||
DELETE FROM t1;
|
||||
INSERT INTO t1(id,msg) SELECT * FROM t2;
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Testing partitioning on a populated outward table
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id INT NOT NULL,
|
||||
msg VARCHAR(32)
|
||||
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='part%s.txt'
|
||||
PARTITION by range columns(id) (
|
||||
PARTITION `1` VALUES LESS THAN(11),
|
||||
PARTITION `2` VALUES LESS THAN(70),
|
||||
PARTITION `3` VALUES LESS THAN(MAXVALUE));
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1 WHERE id < 11;
|
||||
SELECT * FROM t1 WHERE id >= 70;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
|
||||
--echo #
|
||||
--echo # Testing indexing on a partitioned table
|
||||
--echo #
|
||||
CREATE INDEX XID ON t1(id);
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id = 10;
|
||||
DROP INDEX XID ON t1;
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
ALTER TABLE t1 ADD PRIMARY KEY (id);
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id = 10;
|
||||
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||
SHOW INDEX FROM t1;
|
||||
SELECT * FROM dr1 ORDER BY fname, ftype;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE dr1;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
set @@global.connect_exact_info=OFF;
|
||||
|
||||
--remove_file $MYSQLD_DATADIR/test/part1.txt
|
||||
--remove_file $MYSQLD_DATADIR/test/part2.txt
|
||||
--remove_file $MYSQLD_DATADIR/test/part3.txt
|
||||
#--remove_file $MYSQLD_DATADIR/test/part%s.fnx
|
||||
#--remove_file $MYSQLD_DATADIR/test/part1.fnx
|
||||
#--remove_file $MYSQLD_DATADIR/test/part2.fnx
|
||||
#--remove_file $MYSQLD_DATADIR/test/part3.fnx
|
||||
|
|
|
@ -1,92 +1,92 @@
|
|||
--source include/not_embedded.inc
|
||||
--source include/have_partition.inc
|
||||
|
||||
set @@global.connect_exact_info=ON;
|
||||
|
||||
#
|
||||
# These will be used by the t1 table partition table
|
||||
#
|
||||
CREATE TABLE xt1 (
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32))
|
||||
ENGINE=MyISAM;
|
||||
INSERT INTO xt1 VALUES(4, 'four'),(7,'seven'),(1,'one'),(8,'eight');
|
||||
SELECT * FROM xt1;
|
||||
|
||||
CREATE TABLE xt2 (
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32));
|
||||
INSERT INTO xt2 VALUES(10,'ten'),(40,'forty'),(11,'eleven'),(35,'thirty five');
|
||||
SELECT * FROM xt2;
|
||||
|
||||
CREATE TABLE xt3 (
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32))
|
||||
ENGINE=CONNECT TABLE_TYPE=CSV AVG_ROW_LENGTH=10;
|
||||
INSERT INTO xt3 VALUES(60,'sixty'),(81,'eighty one'),(72,'seventy two');
|
||||
SELECT * FROM xt3;
|
||||
|
||||
#
|
||||
# Based on PROXY the table is not indexable
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
id INT NOT NULL,
|
||||
msg VARCHAR(32))
|
||||
ENGINE=CONNECT TABLE_TYPE=PROXY TABNAME='xt%s'
|
||||
PARTITION BY RANGE COLUMNS(id) (
|
||||
PARTITION `1` VALUES LESS THAN(10),
|
||||
PARTITION `2` VALUES LESS THAN(50),
|
||||
PARTITION `3` VALUES LESS THAN(MAXVALUE));
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t1;
|
||||
--error ER_UNKNOWN_ERROR
|
||||
ALTER TABLE t1 ADD INDEX XID(id);
|
||||
INSERT INTO t1 VALUES(4, 'four');
|
||||
INSERT INTO t1 VALUES(7,'seven'),(10,'ten'),(40,'forty'),(60,'sixty'),(81,'eighty one');
|
||||
INSERT INTO t1 VALUES(72,'seventy two'),(11,'eleven'),(1,'one'),(35,'thirty five'),(8,'eight');
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
EXPLAIN PARTITIONS
|
||||
SELECT * FROM t1 WHERE id = 81;
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Based on MYSQL the table is indexable
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32))
|
||||
ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='xt%s'
|
||||
PARTITION BY RANGE COLUMNS(id) (
|
||||
PARTITION `1` VALUES LESS THAN(10),
|
||||
PARTITION `2` VALUES LESS THAN(50),
|
||||
PARTITION `3` VALUES LESS THAN(MAXVALUE));
|
||||
SHOW INDEX FROM t1;
|
||||
INSERT INTO t1 VALUES(4, 'four');
|
||||
INSERT INTO t1 VALUES(40, 'forty');
|
||||
INSERT INTO t1 VALUES(72,'seventy two');
|
||||
INSERT INTO t1 VALUES(7,'seven'),(10,'ten'),(60,'sixty'),(81,'eighty one'),(11,'eleven'),(1,'one'),(35,'thirty five'),(8,'eight');
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id = 81;
|
||||
SELECT * FROM t1 WHERE id = 7;
|
||||
SELECT * FROM t1 WHERE id = 35;
|
||||
UPDATE t1 SET msg = 'number' WHERE id in (60,72);
|
||||
UPDATE t1 SET msg = 'soixante' WHERE id = 60;
|
||||
SELECT * FROM t1 WHERE id > 50;
|
||||
UPDATE t1 SET msg = 'big' WHERE id > 50;
|
||||
UPDATE t1 SET msg = 'sept' WHERE id = 7;
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t1 WHERE id in (60,72);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE xt1;
|
||||
DROP TABLE xt2;
|
||||
DROP TABLE xt3;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
set @@global.connect_exact_info=OFF;
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_partition.inc
|
||||
|
||||
set @@global.connect_exact_info=ON;
|
||||
|
||||
#
|
||||
# These will be used by the t1 table partition table
|
||||
#
|
||||
CREATE TABLE xt1 (
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32))
|
||||
ENGINE=MyISAM;
|
||||
INSERT INTO xt1 VALUES(4, 'four'),(7,'seven'),(1,'one'),(8,'eight');
|
||||
SELECT * FROM xt1;
|
||||
|
||||
CREATE TABLE xt2 (
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32));
|
||||
INSERT INTO xt2 VALUES(10,'ten'),(40,'forty'),(11,'eleven'),(35,'thirty five');
|
||||
SELECT * FROM xt2;
|
||||
|
||||
CREATE TABLE xt3 (
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32))
|
||||
ENGINE=CONNECT TABLE_TYPE=CSV AVG_ROW_LENGTH=10;
|
||||
INSERT INTO xt3 VALUES(60,'sixty'),(81,'eighty one'),(72,'seventy two');
|
||||
SELECT * FROM xt3;
|
||||
|
||||
#
|
||||
# Based on PROXY the table is not indexable
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
id INT NOT NULL,
|
||||
msg VARCHAR(32))
|
||||
ENGINE=CONNECT TABLE_TYPE=PROXY TABNAME='xt%s'
|
||||
PARTITION BY RANGE COLUMNS(id) (
|
||||
PARTITION `1` VALUES LESS THAN(10),
|
||||
PARTITION `2` VALUES LESS THAN(50),
|
||||
PARTITION `3` VALUES LESS THAN(MAXVALUE));
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t1;
|
||||
--error ER_UNKNOWN_ERROR
|
||||
ALTER TABLE t1 ADD INDEX XID(id);
|
||||
INSERT INTO t1 VALUES(4, 'four');
|
||||
INSERT INTO t1 VALUES(7,'seven'),(10,'ten'),(40,'forty'),(60,'sixty'),(81,'eighty one');
|
||||
INSERT INTO t1 VALUES(72,'seventy two'),(11,'eleven'),(1,'one'),(35,'thirty five'),(8,'eight');
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
EXPLAIN PARTITIONS
|
||||
SELECT * FROM t1 WHERE id = 81;
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Based on MYSQL the table is indexable
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32))
|
||||
ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='xt%s'
|
||||
PARTITION BY RANGE COLUMNS(id) (
|
||||
PARTITION `1` VALUES LESS THAN(10),
|
||||
PARTITION `2` VALUES LESS THAN(50),
|
||||
PARTITION `3` VALUES LESS THAN(MAXVALUE));
|
||||
SHOW INDEX FROM t1;
|
||||
INSERT INTO t1 VALUES(4, 'four');
|
||||
INSERT INTO t1 VALUES(40, 'forty');
|
||||
INSERT INTO t1 VALUES(72,'seventy two');
|
||||
INSERT INTO t1 VALUES(7,'seven'),(10,'ten'),(60,'sixty'),(81,'eighty one'),(11,'eleven'),(1,'one'),(35,'thirty five'),(8,'eight');
|
||||
SELECT partition_name, table_rows FROM information_schema.partitions WHERE table_name = 't1';
|
||||
SELECT * FROM t1;
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE id = 81;
|
||||
SELECT * FROM t1 WHERE id = 7;
|
||||
SELECT * FROM t1 WHERE id = 35;
|
||||
UPDATE t1 SET msg = 'number' WHERE id in (60,72);
|
||||
UPDATE t1 SET msg = 'soixante' WHERE id = 60;
|
||||
SELECT * FROM t1 WHERE id > 50;
|
||||
UPDATE t1 SET msg = 'big' WHERE id > 50;
|
||||
UPDATE t1 SET msg = 'sept' WHERE id = 7;
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t1 WHERE id in (60,72);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE xt1;
|
||||
DROP TABLE xt2;
|
||||
DROP TABLE xt3;
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
set @@global.connect_exact_info=OFF;
|
||||
|
|
|
@ -1,163 +1,163 @@
|
|||
-- source include/not_embedded.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $PORT= `select @@port`;
|
||||
--copy_file $MTR_SUITE_DIR/std_data/expenses.txt $MYSQLD_DATADIR/test/expenses.txt
|
||||
|
||||
--echo #
|
||||
--echo # Testing the PIVOT table type
|
||||
--echo #
|
||||
CREATE TABLE expenses (
|
||||
Who CHAR(10) NOT NULL,
|
||||
Week INT(2) NOT NULL,
|
||||
What CHAR(12) NOT NULL,
|
||||
Amount DOUBLE(8,2))
|
||||
ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='expenses.txt' ENDING=2;
|
||||
SELECT * FROM expenses;
|
||||
|
||||
--echo #
|
||||
--echo # Pivoting from What
|
||||
--echo #
|
||||
CREATE TABLE pivex (
|
||||
Who CHAR(10) NOT NULL,
|
||||
Week INT(2) NOT NULL,
|
||||
Beer DOUBLE(8,2) FLAG=1,
|
||||
Car DOUBLE(8,2) FLAG=1,
|
||||
Food DOUBLE(8,2) FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT TABNAME=expenses;
|
||||
--replace_result $PORT PORT
|
||||
--eval ALTER TABLE pivex OPTION_LIST='port=$PORT'
|
||||
SELECT * FROM pivex;
|
||||
|
||||
--echo #
|
||||
--echo # Restricting the columns in a Pivot Table
|
||||
--echo #
|
||||
ALTER TABLE pivex DROP COLUMN week;
|
||||
SELECT * FROM pivex;
|
||||
|
||||
--echo #
|
||||
--echo # Using a source definition
|
||||
--echo #
|
||||
DROP TABLE pivex;
|
||||
CREATE TABLE pivex (
|
||||
Who CHAR(10) NOT NULL,
|
||||
Week INT(2) NOT NULL,
|
||||
Beer DOUBLE(8,2) FLAG=1,
|
||||
Car DOUBLE(8,2) FLAG=1,
|
||||
Food DOUBLE(8,2) FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT
|
||||
SRCDEF='select who, week, what, sum(amount) as amount from expenses where week in (4,5) group by who, week, what';
|
||||
--replace_result $PORT PORT
|
||||
--eval ALTER TABLE pivex OPTION_LIST='PivotCol=what,FncCol=amount,port=$PORT'
|
||||
SELECT * FROM pivex;
|
||||
|
||||
--echo #
|
||||
--echo # Pivoting from Week
|
||||
--echo #
|
||||
DROP TABLE pivex;
|
||||
CREATE TABLE pivex (
|
||||
Who CHAR(10) NOT NULL,
|
||||
What CHAR(12) NOT NULL,
|
||||
`3` DOUBLE(8,2) FLAG=1,
|
||||
`4` DOUBLE(8,2) FLAG=1,
|
||||
`5` DOUBLE(8,2) FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT TABNAME=expenses;
|
||||
--replace_result $PORT PORT
|
||||
--eval ALTER TABLE pivex OPTION_LIST='PivotCol=Week,port=$PORT'
|
||||
SELECT * FROM pivex;
|
||||
|
||||
--echo #
|
||||
--echo # Using scalar functions and expresssions
|
||||
--echo #
|
||||
DROP TABLE pivex;
|
||||
CREATE TABLE pivex (
|
||||
Who CHAR(10) NOT NULL,
|
||||
What CHAR(12) NOT NULL,
|
||||
First DOUBLE(8,2) FLAG=1,
|
||||
Middle DOUBLE(8,2) FLAG=1,
|
||||
Last DOUBLE(8,2) FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT
|
||||
SRCDEF='select who, what, case when week=3 then ''First'' when week=5 then ''Last'' else ''Middle'' end as wk, sum(amount) * 6.56 as amnt from expenses group by who, what, wk';
|
||||
--replace_result $PORT PORT
|
||||
--eval ALTER TABLE pivex OPTION_LIST='PivotCol=wk,FncCol=amnt,port=$PORT'
|
||||
SELECT * FROM pivex;
|
||||
DROP TABLE pivex;
|
||||
DROP TABLE expenses;
|
||||
|
||||
--echo #
|
||||
--echo # Make the PETS table
|
||||
--echo #
|
||||
CREATE TABLE pets (
|
||||
Name VARCHAR(12) NOT NULL,
|
||||
Race CHAR(6) NOT NULL,
|
||||
Number INT NOT NULL) ENGINE=MYISAM;
|
||||
INSERT INTO pets VALUES('John','dog',2);
|
||||
INSERT INTO pets VALUES('Bill','cat',1);
|
||||
INSERT INTO pets VALUES('Mary','dog',1);
|
||||
INSERT INTO pets VALUES('Mary','cat',1);
|
||||
INSERT INTO pets VALUES('Lisbeth','rabbit',2);
|
||||
INSERT INTO pets VALUES('Kevin','cat',2);
|
||||
INSERT INTO pets VALUES('Kevin','bird',6);
|
||||
INSERT INTO pets VALUES('Donald','dog',1);
|
||||
INSERT INTO pets VALUES('Donald','fish',3);
|
||||
SELECT * FROM pets;
|
||||
|
||||
--echo #
|
||||
--echo # Pivot the PETS table
|
||||
--echo #
|
||||
CREATE TABLE pivet (
|
||||
name VARCHAR(12) NOT NULL,
|
||||
dog INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
cat INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
rabbit INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
bird INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
fish INT NOT NULL DEFAULT 0 FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT TABNAME=pets OPTION_LIST='PivotCol=race,groupby=1';
|
||||
SELECT * FROM pivet;
|
||||
DROP TABLE pivet;
|
||||
|
||||
--echo #
|
||||
--echo # Testing the "data" column list
|
||||
--echo #
|
||||
CREATE TABLE pivet (
|
||||
name VARCHAR(12) NOT NULL,
|
||||
dog INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
cat INT NOT NULL DEFAULT 0 FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT TABNAME=pets OPTION_LIST='PivotCol=race,groupby=1';
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM pivet;
|
||||
ALTER TABLE pivet OPTION_LIST='PivotCol=race,groupby=1,accept=1';
|
||||
SELECT * FROM pivet;
|
||||
DROP TABLE pivet;
|
||||
|
||||
--echo #
|
||||
--echo # Adding a "dump" column
|
||||
--echo #
|
||||
CREATE TABLE pivet (
|
||||
name VARCHAR(12) NOT NULL,
|
||||
dog INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
cat INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
other INT NOT NULL DEFAULT 0 FLAG=2)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT TABNAME=pets OPTION_LIST='PivotCol=race,groupby=1';
|
||||
SELECT * FROM pivet;
|
||||
|
||||
DROP TABLE pivet;
|
||||
DROP TABLE pets;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-5734
|
||||
--echo #
|
||||
CREATE TABLE fruit (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(32) NOT NULL,
|
||||
`cnt` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
|
||||
INSERT INTO fruit VALUES (1,'apple',1),(2,'banana',1),(3,'apple',2),(4,'cherry',4),(5,'durazno',2);
|
||||
SELECT * FROM fruit;
|
||||
CREATE TABLE fruit_pivot ENGINE=CONNECT TABLE_TYPE=pivot TABNAME=fruit;
|
||||
SELECT * FROM fruit_pivot;
|
||||
|
||||
DROP TABLE fruit_pivot;
|
||||
DROP TABLE fruit;
|
||||
--remove_file $MYSQLD_DATADIR/test/expenses.txt
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $PORT= `select @@port`;
|
||||
--copy_file $MTR_SUITE_DIR/std_data/expenses.txt $MYSQLD_DATADIR/test/expenses.txt
|
||||
|
||||
--echo #
|
||||
--echo # Testing the PIVOT table type
|
||||
--echo #
|
||||
CREATE TABLE expenses (
|
||||
Who CHAR(10) NOT NULL,
|
||||
Week INT(2) NOT NULL,
|
||||
What CHAR(12) NOT NULL,
|
||||
Amount DOUBLE(8,2))
|
||||
ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='expenses.txt' ENDING=2;
|
||||
SELECT * FROM expenses;
|
||||
|
||||
--echo #
|
||||
--echo # Pivoting from What
|
||||
--echo #
|
||||
CREATE TABLE pivex (
|
||||
Who CHAR(10) NOT NULL,
|
||||
Week INT(2) NOT NULL,
|
||||
Beer DOUBLE(8,2) FLAG=1,
|
||||
Car DOUBLE(8,2) FLAG=1,
|
||||
Food DOUBLE(8,2) FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT TABNAME=expenses;
|
||||
--replace_result $PORT PORT
|
||||
--eval ALTER TABLE pivex OPTION_LIST='port=$PORT'
|
||||
SELECT * FROM pivex;
|
||||
|
||||
--echo #
|
||||
--echo # Restricting the columns in a Pivot Table
|
||||
--echo #
|
||||
ALTER TABLE pivex DROP COLUMN week;
|
||||
SELECT * FROM pivex;
|
||||
|
||||
--echo #
|
||||
--echo # Using a source definition
|
||||
--echo #
|
||||
DROP TABLE pivex;
|
||||
CREATE TABLE pivex (
|
||||
Who CHAR(10) NOT NULL,
|
||||
Week INT(2) NOT NULL,
|
||||
Beer DOUBLE(8,2) FLAG=1,
|
||||
Car DOUBLE(8,2) FLAG=1,
|
||||
Food DOUBLE(8,2) FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT
|
||||
SRCDEF='select who, week, what, sum(amount) as amount from expenses where week in (4,5) group by who, week, what';
|
||||
--replace_result $PORT PORT
|
||||
--eval ALTER TABLE pivex OPTION_LIST='PivotCol=what,FncCol=amount,port=$PORT'
|
||||
SELECT * FROM pivex;
|
||||
|
||||
--echo #
|
||||
--echo # Pivoting from Week
|
||||
--echo #
|
||||
DROP TABLE pivex;
|
||||
CREATE TABLE pivex (
|
||||
Who CHAR(10) NOT NULL,
|
||||
What CHAR(12) NOT NULL,
|
||||
`3` DOUBLE(8,2) FLAG=1,
|
||||
`4` DOUBLE(8,2) FLAG=1,
|
||||
`5` DOUBLE(8,2) FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT TABNAME=expenses;
|
||||
--replace_result $PORT PORT
|
||||
--eval ALTER TABLE pivex OPTION_LIST='PivotCol=Week,port=$PORT'
|
||||
SELECT * FROM pivex;
|
||||
|
||||
--echo #
|
||||
--echo # Using scalar functions and expresssions
|
||||
--echo #
|
||||
DROP TABLE pivex;
|
||||
CREATE TABLE pivex (
|
||||
Who CHAR(10) NOT NULL,
|
||||
What CHAR(12) NOT NULL,
|
||||
First DOUBLE(8,2) FLAG=1,
|
||||
Middle DOUBLE(8,2) FLAG=1,
|
||||
Last DOUBLE(8,2) FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT
|
||||
SRCDEF='select who, what, case when week=3 then ''First'' when week=5 then ''Last'' else ''Middle'' end as wk, sum(amount) * 6.56 as amnt from expenses group by who, what, wk';
|
||||
--replace_result $PORT PORT
|
||||
--eval ALTER TABLE pivex OPTION_LIST='PivotCol=wk,FncCol=amnt,port=$PORT'
|
||||
SELECT * FROM pivex;
|
||||
DROP TABLE pivex;
|
||||
DROP TABLE expenses;
|
||||
|
||||
--echo #
|
||||
--echo # Make the PETS table
|
||||
--echo #
|
||||
CREATE TABLE pets (
|
||||
Name VARCHAR(12) NOT NULL,
|
||||
Race CHAR(6) NOT NULL,
|
||||
Number INT NOT NULL) ENGINE=MYISAM;
|
||||
INSERT INTO pets VALUES('John','dog',2);
|
||||
INSERT INTO pets VALUES('Bill','cat',1);
|
||||
INSERT INTO pets VALUES('Mary','dog',1);
|
||||
INSERT INTO pets VALUES('Mary','cat',1);
|
||||
INSERT INTO pets VALUES('Lisbeth','rabbit',2);
|
||||
INSERT INTO pets VALUES('Kevin','cat',2);
|
||||
INSERT INTO pets VALUES('Kevin','bird',6);
|
||||
INSERT INTO pets VALUES('Donald','dog',1);
|
||||
INSERT INTO pets VALUES('Donald','fish',3);
|
||||
SELECT * FROM pets;
|
||||
|
||||
--echo #
|
||||
--echo # Pivot the PETS table
|
||||
--echo #
|
||||
CREATE TABLE pivet (
|
||||
name VARCHAR(12) NOT NULL,
|
||||
dog INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
cat INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
rabbit INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
bird INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
fish INT NOT NULL DEFAULT 0 FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT TABNAME=pets OPTION_LIST='PivotCol=race,groupby=1';
|
||||
SELECT * FROM pivet;
|
||||
DROP TABLE pivet;
|
||||
|
||||
--echo #
|
||||
--echo # Testing the "data" column list
|
||||
--echo #
|
||||
CREATE TABLE pivet (
|
||||
name VARCHAR(12) NOT NULL,
|
||||
dog INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
cat INT NOT NULL DEFAULT 0 FLAG=1)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT TABNAME=pets OPTION_LIST='PivotCol=race,groupby=1';
|
||||
--error ER_GET_ERRMSG
|
||||
SELECT * FROM pivet;
|
||||
ALTER TABLE pivet OPTION_LIST='PivotCol=race,groupby=1,accept=1';
|
||||
SELECT * FROM pivet;
|
||||
DROP TABLE pivet;
|
||||
|
||||
--echo #
|
||||
--echo # Adding a "dump" column
|
||||
--echo #
|
||||
CREATE TABLE pivet (
|
||||
name VARCHAR(12) NOT NULL,
|
||||
dog INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
cat INT NOT NULL DEFAULT 0 FLAG=1,
|
||||
other INT NOT NULL DEFAULT 0 FLAG=2)
|
||||
ENGINE=CONNECT TABLE_TYPE=PIVOT TABNAME=pets OPTION_LIST='PivotCol=race,groupby=1';
|
||||
SELECT * FROM pivet;
|
||||
|
||||
DROP TABLE pivet;
|
||||
DROP TABLE pets;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-5734
|
||||
--echo #
|
||||
CREATE TABLE fruit (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(32) NOT NULL,
|
||||
`cnt` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
|
||||
INSERT INTO fruit VALUES (1,'apple',1),(2,'banana',1),(3,'apple',2),(4,'cherry',4),(5,'durazno',2);
|
||||
SELECT * FROM fruit;
|
||||
CREATE TABLE fruit_pivot ENGINE=CONNECT TABLE_TYPE=pivot TABNAME=fruit;
|
||||
SELECT * FROM fruit_pivot;
|
||||
|
||||
DROP TABLE fruit_pivot;
|
||||
DROP TABLE fruit;
|
||||
--remove_file $MYSQLD_DATADIR/test/expenses.txt
|
||||
|
|
|
@ -1,53 +1,53 @@
|
|||
-- source include/not_embedded.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $PORT= `select @@port`;
|
||||
|
||||
--echo #
|
||||
--echo # Checking TBL tables
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
a INT NOT NULL,
|
||||
message CHAR(10)) ENGINE=connect;
|
||||
INSERT INTO t1 VALUES (1,'Testing'),(2,'dos table'),(3,'t1');
|
||||
SELECT * FROM t1;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
a INT NOT NULL,
|
||||
message CHAR(10)) ENGINE=connect TABLE_TYPE=BIN;
|
||||
INSERT INTO t2 VALUES (1,'Testing'),(2,NULL),(3,'t2');
|
||||
SELECT * FROM t2;
|
||||
|
||||
CREATE TABLE t3 (
|
||||
a INT NOT NULL,
|
||||
message CHAR(10)) ENGINE=connect TABLE_TYPE=CSV;
|
||||
INSERT INTO t3 VALUES (1,'Testing'),(2,'csv table'),(3,'t3');
|
||||
SELECT * FROM t3;
|
||||
|
||||
CREATE TABLE t4 (
|
||||
ta INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
message CHAR(20)) ENGINE=MyISAM;
|
||||
INSERT INTO t4 (message) VALUES ('Testing'),('myisam table'),('t4');
|
||||
SELECT * FROM t4;
|
||||
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE total (tabname CHAR(8) NOT NULL SPECIAL='TABID', ta TINYINT NOT NULL FLAG=1, message CHAR(20)) engine=CONNECT table_type=TBL table_list='t1,t2,t3,t4' option_list='port=$PORT'
|
||||
|
||||
select * from total;
|
||||
select * from total where tabname = 't2';
|
||||
select * from total where tabname = 't2' and ta = 3;
|
||||
select * from total where tabname in ('t1','t4');
|
||||
select * from total where ta = 3 and tabname in ('t1','t2');
|
||||
select * from total where tabname <> 't2';
|
||||
select * from total where tabname != 't2' and ta = 3;
|
||||
select * from total where tabname not in ('t2','t3');
|
||||
select * from total where ta = 3 and tabname in ('t2','t3');
|
||||
select * from total where ta = 3 or tabname in ('t2','t4');
|
||||
select * from total where not tabname = 't2';
|
||||
select * from total where tabname = 't2' or tabname = 't1';
|
||||
|
||||
DROP TABLE total;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
DROP TABLE t4;
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $PORT= `select @@port`;
|
||||
|
||||
--echo #
|
||||
--echo # Checking TBL tables
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
a INT NOT NULL,
|
||||
message CHAR(10)) ENGINE=connect;
|
||||
INSERT INTO t1 VALUES (1,'Testing'),(2,'dos table'),(3,'t1');
|
||||
SELECT * FROM t1;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
a INT NOT NULL,
|
||||
message CHAR(10)) ENGINE=connect TABLE_TYPE=BIN;
|
||||
INSERT INTO t2 VALUES (1,'Testing'),(2,NULL),(3,'t2');
|
||||
SELECT * FROM t2;
|
||||
|
||||
CREATE TABLE t3 (
|
||||
a INT NOT NULL,
|
||||
message CHAR(10)) ENGINE=connect TABLE_TYPE=CSV;
|
||||
INSERT INTO t3 VALUES (1,'Testing'),(2,'csv table'),(3,'t3');
|
||||
SELECT * FROM t3;
|
||||
|
||||
CREATE TABLE t4 (
|
||||
ta INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
message CHAR(20)) ENGINE=MyISAM;
|
||||
INSERT INTO t4 (message) VALUES ('Testing'),('myisam table'),('t4');
|
||||
SELECT * FROM t4;
|
||||
|
||||
--replace_result $PORT PORT
|
||||
--eval CREATE TABLE total (tabname CHAR(8) NOT NULL SPECIAL='TABID', ta TINYINT NOT NULL FLAG=1, message CHAR(20)) engine=CONNECT table_type=TBL table_list='t1,t2,t3,t4' option_list='port=$PORT'
|
||||
|
||||
select * from total;
|
||||
select * from total where tabname = 't2';
|
||||
select * from total where tabname = 't2' and ta = 3;
|
||||
select * from total where tabname in ('t1','t4');
|
||||
select * from total where ta = 3 and tabname in ('t1','t2');
|
||||
select * from total where tabname <> 't2';
|
||||
select * from total where tabname != 't2' and ta = 3;
|
||||
select * from total where tabname not in ('t2','t3');
|
||||
select * from total where ta = 3 and tabname in ('t2','t3');
|
||||
select * from total where ta = 3 or tabname in ('t2','t4');
|
||||
select * from total where not tabname = 't2';
|
||||
select * from total where tabname = 't2' or tabname = 't1';
|
||||
|
||||
DROP TABLE total;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
DROP TABLE t4;
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
--echo #
|
||||
--echo # Testing unsigned types
|
||||
--echo #
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (
|
||||
a TINYINT UNSIGNED NOT NULL,
|
||||
b SMALLINT ZEROFILL NOT NULL,
|
||||
c INT UNSIGNED NOT NULL,
|
||||
d BIGINT UNSIGNED NOT NULL,
|
||||
e CHAR(32) NOT NULL DEFAULT '???') ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
DESCRIBE t1;
|
||||
INSERT INTO t1(a,b,c,d) VALUES(255,65535,4294967295,18446744073709551615);
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET e = d;
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET c = d;
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET c = e;
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET d = e;
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=PROXY TABNAME=t1;
|
||||
DESCRIBE t2;
|
||||
SELECT * FROM t2;
|
||||
|
||||
# Moved to mysql.test (cannot be executed if embedded)
|
||||
#DROP TABLE t2;
|
||||
#CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME=t1;
|
||||
#DESCRIBE t2;
|
||||
#SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
--echo #
|
||||
--echo # Testing unsigned types
|
||||
--echo #
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (
|
||||
a TINYINT UNSIGNED NOT NULL,
|
||||
b SMALLINT ZEROFILL NOT NULL,
|
||||
c INT UNSIGNED NOT NULL,
|
||||
d BIGINT UNSIGNED NOT NULL,
|
||||
e CHAR(32) NOT NULL DEFAULT '???') ENGINE=CONNECT TABLE_TYPE=FIX;
|
||||
DESCRIBE t1;
|
||||
INSERT INTO t1(a,b,c,d) VALUES(255,65535,4294967295,18446744073709551615);
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET e = d;
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET c = d;
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET c = e;
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET d = e;
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=PROXY TABNAME=t1;
|
||||
DESCRIBE t2;
|
||||
SELECT * FROM t2;
|
||||
|
||||
# Moved to mysql.test (cannot be executed if embedded)
|
||||
#DROP TABLE t2;
|
||||
#CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME=t1;
|
||||
#DESCRIBE t2;
|
||||
#SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -1,153 +1,153 @@
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--copy_file $MTR_SUITE_DIR/std_data/employee.dat $MYSQLD_DATADIR/test/employee.dat
|
||||
|
||||
CREATE TABLE employee
|
||||
(
|
||||
serialno CHAR(5) NOT NULL,
|
||||
name VARCHAR(12) NOT NULL FLAG=6,
|
||||
sex TINYINT(1) NOT NULL,
|
||||
title VARCHAR(15) NOT NULL FLAG=20,
|
||||
manager CHAR(5) NOT NULL,
|
||||
department CHAR(4) NOT NULL FLAG=41,
|
||||
secretary CHAR(5) NOT NULL FLAG=46,
|
||||
salary DOUBLE(8,2) NOT NULL FLAG=52
|
||||
) ENGINE=connect TABLE_TYPE=fix FILE_NAME='employee.dat' ENDING=1;
|
||||
SELECT * FROM employee;
|
||||
|
||||
DELIMITER //;
|
||||
CREATE PROCEDURE test.tst_up() DETERMINISTIC
|
||||
BEGIN
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET salary = salary + 1, title = 'RESEARCH' WHERE title = 'SCIENTIST';
|
||||
UPDATE t1 SET salary = salary + 1, title = 'TECHNICIAN' WHERE title = 'ENGINEER';
|
||||
UPDATE t1 SET title = 'PUPPET' WHERE name = 'TONGHO';
|
||||
UPDATE t1 SET salary = 0. WHERE title = 'XXX';
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t1 WHERE title = 'SECRETARY';
|
||||
DELETE FROM t1 WHERE title = 'DIRECTOR';
|
||||
DELETE FROM t1 WHERE title = 'TYPIST';
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t1 LIMIT 3;
|
||||
INSERT INTO t1(serialno, name, title, salary) VALUES('66666','NEWMAN','ENGINEER',10000.80);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
DELIMITER ;//
|
||||
|
||||
--echo #
|
||||
--echo # Testing DOS table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing DOS table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect mapped=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing FIX table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=fix AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing FIX table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=fix mapped=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing FIX table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=fix huge=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing CSV table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=csv AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing CSV table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=csv mapped=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing DBF table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=dbf AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing DBF table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=dbf mapped=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing BIN table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=bin AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing BIN table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=bin mapped=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing BIN table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=bin huge=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing VEC table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=vec MAX_ROWS=30 AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing VEC table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=vec mapped=yes MAX_ROWS=30 AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing VEC table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=vec huge=yes MAX_ROWS=30 AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing INI table changes
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
serialno CHAR(5) NOT NULL FLAG=1,
|
||||
name VARCHAR(12) NOT NULL,
|
||||
sex TINYINT(1),
|
||||
title VARCHAR(15) NOT NULL,
|
||||
manager CHAR(5),
|
||||
department CHAR(4),
|
||||
secretary CHAR(5),
|
||||
salary DOUBLE(8,2) NOT NULL
|
||||
) ENGINE=connect TABLE_TYPE=ini;
|
||||
INSERT INTO t1 SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing XML table changes (must be in a separate test)
|
||||
--echo #
|
||||
#CREATE TABLE t1 ENGINE=connect TABLE_TYPE=xml option_list='rownode=dd' AS SELECT * FROM employee;
|
||||
#CALL test.tst_up();
|
||||
|
||||
DROP PROCEDURE test.tst_up;
|
||||
DROP TABLE employee;
|
||||
|
||||
--remove_file $MYSQLD_DATADIR/test/employee.dat
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--copy_file $MTR_SUITE_DIR/std_data/employee.dat $MYSQLD_DATADIR/test/employee.dat
|
||||
|
||||
CREATE TABLE employee
|
||||
(
|
||||
serialno CHAR(5) NOT NULL,
|
||||
name VARCHAR(12) NOT NULL FLAG=6,
|
||||
sex TINYINT(1) NOT NULL,
|
||||
title VARCHAR(15) NOT NULL FLAG=20,
|
||||
manager CHAR(5) NOT NULL,
|
||||
department CHAR(4) NOT NULL FLAG=41,
|
||||
secretary CHAR(5) NOT NULL FLAG=46,
|
||||
salary DOUBLE(8,2) NOT NULL FLAG=52
|
||||
) ENGINE=connect TABLE_TYPE=fix FILE_NAME='employee.dat' ENDING=1;
|
||||
SELECT * FROM employee;
|
||||
|
||||
DELIMITER //;
|
||||
CREATE PROCEDURE test.tst_up() DETERMINISTIC
|
||||
BEGIN
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET salary = salary + 1, title = 'RESEARCH' WHERE title = 'SCIENTIST';
|
||||
UPDATE t1 SET salary = salary + 1, title = 'TECHNICIAN' WHERE title = 'ENGINEER';
|
||||
UPDATE t1 SET title = 'PUPPET' WHERE name = 'TONGHO';
|
||||
UPDATE t1 SET salary = 0. WHERE title = 'XXX';
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t1 WHERE title = 'SECRETARY';
|
||||
DELETE FROM t1 WHERE title = 'DIRECTOR';
|
||||
DELETE FROM t1 WHERE title = 'TYPIST';
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t1 LIMIT 3;
|
||||
INSERT INTO t1(serialno, name, title, salary) VALUES('66666','NEWMAN','ENGINEER',10000.80);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
DELIMITER ;//
|
||||
|
||||
--echo #
|
||||
--echo # Testing DOS table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing DOS table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect mapped=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing FIX table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=fix AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing FIX table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=fix mapped=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing FIX table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=fix huge=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing CSV table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=csv AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing CSV table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=csv mapped=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing DBF table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=dbf AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing DBF table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=dbf mapped=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing BIN table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=bin AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing BIN table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=bin mapped=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing BIN table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=bin huge=yes AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing VEC table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=vec MAX_ROWS=30 AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing VEC table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=vec mapped=yes MAX_ROWS=30 AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing VEC table changes
|
||||
--echo #
|
||||
CREATE TABLE t1 ENGINE=connect TABLE_TYPE=vec huge=yes MAX_ROWS=30 AS SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing INI table changes
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
serialno CHAR(5) NOT NULL FLAG=1,
|
||||
name VARCHAR(12) NOT NULL,
|
||||
sex TINYINT(1),
|
||||
title VARCHAR(15) NOT NULL,
|
||||
manager CHAR(5),
|
||||
department CHAR(4),
|
||||
secretary CHAR(5),
|
||||
salary DOUBLE(8,2) NOT NULL
|
||||
) ENGINE=connect TABLE_TYPE=ini;
|
||||
INSERT INTO t1 SELECT * FROM employee;
|
||||
CALL test.tst_up();
|
||||
|
||||
--echo #
|
||||
--echo # Testing XML table changes (must be in a separate test)
|
||||
--echo #
|
||||
#CREATE TABLE t1 ENGINE=connect TABLE_TYPE=xml option_list='rownode=dd' AS SELECT * FROM employee;
|
||||
#CALL test.tst_up();
|
||||
|
||||
DROP PROCEDURE test.tst_up;
|
||||
DROP TABLE employee;
|
||||
|
||||
--remove_file $MYSQLD_DATADIR/test/employee.dat
|
||||
|
|
|
@ -1,96 +1,96 @@
|
|||
-- source include/not_embedded.inc
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # Testing indexed UPDATE and DELETE for all table types
|
||||
--echo #
|
||||
|
||||
--echo # CSV table
|
||||
CREATE TABLE t1 (
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32))
|
||||
ENGINE=CONNECT TABLE_TYPE=CSV AVG_ROW_LENGTH=6;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=NO BLOCK_SIZE=6;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # DOS table
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16))
|
||||
ENGINE=CONNECT TABLE_TYPE=DOS;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=NO BLOCK_SIZE=4;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # FIX table
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16) CHARSET BINARY DISTRIB=CLUSTERED)
|
||||
ENGINE=CONNECT TABLE_TYPE=FIX BLOCK_SIZE=4;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=NO HUGE=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # BIN table
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16) CHARSET BINARY DISTRIB=CLUSTERED)
|
||||
ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=8;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=NO HUGE=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # DBF table
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16))
|
||||
ENGINE=CONNECT TABLE_TYPE=DBF BLOCK_SIZE=12;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
#ALTER TABLE t1 MAPPED=NO HUGE=YES;
|
||||
#-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # VEC table
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16))
|
||||
ENGINE=CONNECT TABLE_TYPE=VEC BLOCK_SIZE=6 MAX_ROWS=16;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=NO HUGE=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # Split VEC table (outward)
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16))
|
||||
ENGINE=CONNECT TABLE_TYPE=VEC BLOCK_SIZE=6 FILE_NAME='tx.vec';
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
# Cleanup
|
||||
--remove_file $MYSQLD_DATADIR/test/tx1.vec
|
||||
--remove_file $MYSQLD_DATADIR/test/tx2.vec
|
||||
-- source include/not_embedded.inc
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # Testing indexed UPDATE and DELETE for all table types
|
||||
--echo #
|
||||
|
||||
--echo # CSV table
|
||||
CREATE TABLE t1 (
|
||||
id INT KEY NOT NULL,
|
||||
msg VARCHAR(32))
|
||||
ENGINE=CONNECT TABLE_TYPE=CSV AVG_ROW_LENGTH=6;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=NO BLOCK_SIZE=6;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # DOS table
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16))
|
||||
ENGINE=CONNECT TABLE_TYPE=DOS;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=NO BLOCK_SIZE=4;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # FIX table
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16) CHARSET BINARY DISTRIB=CLUSTERED)
|
||||
ENGINE=CONNECT TABLE_TYPE=FIX BLOCK_SIZE=4;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=NO HUGE=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # BIN table
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16) CHARSET BINARY DISTRIB=CLUSTERED)
|
||||
ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=8;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=NO HUGE=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # DBF table
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16))
|
||||
ENGINE=CONNECT TABLE_TYPE=DBF BLOCK_SIZE=12;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
#ALTER TABLE t1 MAPPED=NO HUGE=YES;
|
||||
#-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # VEC table
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16))
|
||||
ENGINE=CONNECT TABLE_TYPE=VEC BLOCK_SIZE=6 MAX_ROWS=16;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=NO HUGE=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # Split VEC table (outward)
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) KEY NOT NULL,
|
||||
msg VARCHAR(16))
|
||||
ENGINE=CONNECT TABLE_TYPE=VEC BLOCK_SIZE=6 FILE_NAME='tx.vec';
|
||||
-- source updelx.inc
|
||||
ALTER TABLE t1 MAPPED=YES;
|
||||
-- source updelx.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
# Cleanup
|
||||
--remove_file $MYSQLD_DATADIR/test/tx1.vec
|
||||
--remove_file $MYSQLD_DATADIR/test/tx2.vec
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
-- source include/not_embedded.inc
|
||||
|
||||
--echo #
|
||||
--echo # Testing multiple indexed UPDATE and DELETE
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) NOT NULL,
|
||||
msg VARCHAR(16) NOT NULL,
|
||||
INDEX IDM(id,msg))
|
||||
ENGINE=CONNECT TABLE_TYPE=DOS;
|
||||
INSERT INTO t1 VALUES(1,'one'),(4, 'four'),(7,'seven'),(8,'eight'),(10,'ten'),(11,'eleven'),(40,'forty'),(35,'thirty five'),(60,'sixty'),(72,'seventy two'),(81,'eighty one');
|
||||
INSERT INTO t1 VALUES(1,'un'),(4, 'quatre'),(7,'sept'),(8,'huit'),(10,'dix'),(11,'onze'),(40,'quarante'),(35,'trente cinq'),(60,'soixante'),(72,'soixante douze'),(81,'quatrevingt un');
|
||||
SELECT * FROM t1 IGNORE INDEX (IDM);
|
||||
UPDATE t1 SET msg = 'dieci' WHERE id = 10;
|
||||
SELECT * FROM t1 IGNORE INDEX (IDM);
|
||||
UPDATE t1 SET msg = 'septante deux' WHERE id = 72;
|
||||
SELECT * FROM t1 IGNORE INDEX (IDM);
|
||||
UPDATE t1 SET id=2, msg='deux' WHERE id=4 AND msg='quatre';
|
||||
SELECT * FROM t1 IGNORE INDEX (IDM);
|
||||
DELETE FROM t1 WHERE id IN (8,40);
|
||||
SELECT * FROM t1 IGNORE INDEX (IDM);
|
||||
DROP TABLE t1;
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--echo #
|
||||
--echo # Testing multiple indexed UPDATE and DELETE
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id INT(4) NOT NULL,
|
||||
msg VARCHAR(16) NOT NULL,
|
||||
INDEX IDM(id,msg))
|
||||
ENGINE=CONNECT TABLE_TYPE=DOS;
|
||||
INSERT INTO t1 VALUES(1,'one'),(4, 'four'),(7,'seven'),(8,'eight'),(10,'ten'),(11,'eleven'),(40,'forty'),(35,'thirty five'),(60,'sixty'),(72,'seventy two'),(81,'eighty one');
|
||||
INSERT INTO t1 VALUES(1,'un'),(4, 'quatre'),(7,'sept'),(8,'huit'),(10,'dix'),(11,'onze'),(40,'quarante'),(35,'trente cinq'),(60,'soixante'),(72,'soixante douze'),(81,'quatrevingt un');
|
||||
SELECT * FROM t1 IGNORE INDEX (IDM);
|
||||
UPDATE t1 SET msg = 'dieci' WHERE id = 10;
|
||||
SELECT * FROM t1 IGNORE INDEX (IDM);
|
||||
UPDATE t1 SET msg = 'septante deux' WHERE id = 72;
|
||||
SELECT * FROM t1 IGNORE INDEX (IDM);
|
||||
UPDATE t1 SET id=2, msg='deux' WHERE id=4 AND msg='quatre';
|
||||
SELECT * FROM t1 IGNORE INDEX (IDM);
|
||||
DELETE FROM t1 WHERE id IN (8,40);
|
||||
SELECT * FROM t1 IGNORE INDEX (IDM);
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
--echo #
|
||||
--echo # Make the children list table
|
||||
--echo #
|
||||
CREATE TABLE chlist (
|
||||
mother char(12) NOT NULL COMMENT 'The mother of the listed children',
|
||||
children varchar(30) DEFAULT NULL COMMENT 'The comma separated list of children'
|
||||
) ENGINE=CONNECT;
|
||||
INSERT INTO chlist VALUES('Sophia','Vivian, Antony');
|
||||
INSERT INTO chlist VALUES('Lisbeth','Lucy,Charles,Diana');
|
||||
INSERT INTO chlist VALUES('Corinne',NULL);
|
||||
INSERT INTO chlist VALUES('Claude','Marc');
|
||||
INSERT INTO chlist VALUES('Janet','Arthur,Sandra,Peter,John');
|
||||
SELECT * FROM chlist;
|
||||
|
||||
--echo #
|
||||
--echo # Checking XCOL tables
|
||||
--echo #
|
||||
CREATE TABLE child ENGINE=CONNECT TABLE_TYPE=XCOL TABNAME=chlist OPTION_LIST='colname=children';
|
||||
SELECT * FROM child;
|
||||
SELECT * FROM child ORDER BY mother;
|
||||
SELECT * FROM child ORDER BY children;
|
||||
SELECT mother FROM child;
|
||||
SELECT mother, COUNT(*) FROM child GROUP BY mother;
|
||||
SELECT mother, COUNT(children) FROM child GROUP BY mother;
|
||||
|
||||
--echo #
|
||||
--echo # Test using special columns
|
||||
--echo #
|
||||
CREATE TABLE `child2` (
|
||||
`row` int NOT NULL SPECIAL=ROWID,
|
||||
`num` int NOT NULL SPECIAL=ROWNUM,
|
||||
`mother` varchar(12) NOT NULL COMMENT 'The mother of the children',
|
||||
`child` varchar(12) NOT NULL COMMENT 'The child name' FLAG=2
|
||||
) ENGINE=CONNECT TABLE_TYPE=XCOL TABNAME=chlist `OPTION_LIST`='colname=child';
|
||||
SELECT * FROM child2;
|
||||
--echo # List only first child
|
||||
SELECT mother, child FROM child2 where num = 1;
|
||||
|
||||
DROP TABLE child;
|
||||
DROP TABLE chlist;
|
||||
DROP TABLE child2;
|
||||
--echo #
|
||||
--echo # Make the children list table
|
||||
--echo #
|
||||
CREATE TABLE chlist (
|
||||
mother char(12) NOT NULL COMMENT 'The mother of the listed children',
|
||||
children varchar(30) DEFAULT NULL COMMENT 'The comma separated list of children'
|
||||
) ENGINE=CONNECT;
|
||||
INSERT INTO chlist VALUES('Sophia','Vivian, Antony');
|
||||
INSERT INTO chlist VALUES('Lisbeth','Lucy,Charles,Diana');
|
||||
INSERT INTO chlist VALUES('Corinne',NULL);
|
||||
INSERT INTO chlist VALUES('Claude','Marc');
|
||||
INSERT INTO chlist VALUES('Janet','Arthur,Sandra,Peter,John');
|
||||
SELECT * FROM chlist;
|
||||
|
||||
--echo #
|
||||
--echo # Checking XCOL tables
|
||||
--echo #
|
||||
CREATE TABLE child ENGINE=CONNECT TABLE_TYPE=XCOL TABNAME=chlist OPTION_LIST='colname=children';
|
||||
SELECT * FROM child;
|
||||
SELECT * FROM child ORDER BY mother;
|
||||
SELECT * FROM child ORDER BY children;
|
||||
SELECT mother FROM child;
|
||||
SELECT mother, COUNT(*) FROM child GROUP BY mother;
|
||||
SELECT mother, COUNT(children) FROM child GROUP BY mother;
|
||||
|
||||
--echo #
|
||||
--echo # Test using special columns
|
||||
--echo #
|
||||
CREATE TABLE `child2` (
|
||||
`row` int NOT NULL SPECIAL=ROWID,
|
||||
`num` int NOT NULL SPECIAL=ROWNUM,
|
||||
`mother` varchar(12) NOT NULL COMMENT 'The mother of the children',
|
||||
`child` varchar(12) NOT NULL COMMENT 'The child name' FLAG=2
|
||||
) ENGINE=CONNECT TABLE_TYPE=XCOL TABNAME=chlist `OPTION_LIST`='colname=child';
|
||||
SELECT * FROM child2;
|
||||
--echo # List only first child
|
||||
SELECT mother, child FROM child2 where num = 1;
|
||||
|
||||
DROP TABLE child;
|
||||
DROP TABLE chlist;
|
||||
DROP TABLE child2;
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
--source have_libxml2.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
SET NAMES utf8;
|
||||
|
||||
#
|
||||
#--echo Testing indexing on not indexable table type
|
||||
#
|
||||
--error ER_UNKNOWN_ERROR
|
||||
CREATE TABLE t1 (i INT UNIQUE NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xt1.xml' OPTION_LIST='Rownode=N';
|
||||
CREATE TABLE t1 (i INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xt1.xml' OPTION_LIST='Rownode=N';
|
||||
DESCRIBE t1;
|
||||
# one could *add* an index to an existing table
|
||||
--error ER_UNKNOWN_ERROR
|
||||
ALTER TABLE t1 ADD UNIQUE(i);
|
||||
--error ER_UNKNOWN_ERROR
|
||||
CREATE UNIQUE INDEX i ON t1(i);
|
||||
DESCRIBE t1;
|
||||
INSERT INTO t1 VALUES(2),(5),(7);
|
||||
SELECT * FROM t1 WHERE i = 5;
|
||||
--error ER_CANT_DROP_FIELD_OR_KEY
|
||||
ALTER TABLE t1 DROP INDEX i;
|
||||
--error ER_CANT_DROP_FIELD_OR_KEY
|
||||
DROP INDEX i ON t1;
|
||||
DROP TABLE t1;
|
||||
--remove_file $MYSQLD_DATADIR/test/xt1.xml
|
||||
--source have_libxml2.inc
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
SET NAMES utf8;
|
||||
|
||||
#
|
||||
#--echo Testing indexing on not indexable table type
|
||||
#
|
||||
--error ER_UNKNOWN_ERROR
|
||||
CREATE TABLE t1 (i INT UNIQUE NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xt1.xml' OPTION_LIST='Rownode=N';
|
||||
CREATE TABLE t1 (i INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xt1.xml' OPTION_LIST='Rownode=N';
|
||||
DESCRIBE t1;
|
||||
# one could *add* an index to an existing table
|
||||
--error ER_UNKNOWN_ERROR
|
||||
ALTER TABLE t1 ADD UNIQUE(i);
|
||||
--error ER_UNKNOWN_ERROR
|
||||
CREATE UNIQUE INDEX i ON t1(i);
|
||||
DESCRIBE t1;
|
||||
INSERT INTO t1 VALUES(2),(5),(7);
|
||||
SELECT * FROM t1 WHERE i = 5;
|
||||
--error ER_CANT_DROP_FIELD_OR_KEY
|
||||
ALTER TABLE t1 DROP INDEX i;
|
||||
--error ER_CANT_DROP_FIELD_OR_KEY
|
||||
DROP INDEX i ON t1;
|
||||
DROP TABLE t1;
|
||||
--remove_file $MYSQLD_DATADIR/test/xt1.xml
|
||||
|
|
|
@ -1,68 +1,68 @@
|
|||
/**************** RCMsg C Program Source Code File (.C) ****************/
|
||||
/* PROGRAM NAME: RCMSG */
|
||||
/* ------------- */
|
||||
/* Version 1.3 */
|
||||
/* */
|
||||
/* COPYRIGHT */
|
||||
/* ---------- */
|
||||
/* (C) Copyright to the author Olivier BERTRAND: 2005 - 2014 */
|
||||
/* */
|
||||
/* WHAT THIS PROGRAM DOES */
|
||||
/* ----------------------- */
|
||||
/* This program simulates LoadString. */
|
||||
/* */
|
||||
/***********************************************************************/
|
||||
#if !defined(XMSG)
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "resource.h"
|
||||
#include "rcmsg.h"
|
||||
#if defined(NEWMSG)
|
||||
#include "msgid.h"
|
||||
#endif // NEWMSG
|
||||
|
||||
#if !defined(WIN32)
|
||||
#define stricmp strcasecmp
|
||||
#endif // !WIN32
|
||||
|
||||
char *msglang(void);
|
||||
|
||||
char *GetMsgid(int id)
|
||||
{
|
||||
char *p = NULL;
|
||||
|
||||
// This conditional until a real fix is found for MDEV-7304
|
||||
#if defined(FRENCH)
|
||||
if (!stricmp(msglang(), "french"))
|
||||
switch (id) {
|
||||
#include "frids.h"
|
||||
#if defined(NEWMSG)
|
||||
#include "frcas.h"
|
||||
#endif // NEWMSG
|
||||
} // endswitch(id)
|
||||
|
||||
else // English
|
||||
#endif // FRENCH
|
||||
switch (id) {
|
||||
#include "enids.h"
|
||||
#if defined(NEWMSG)
|
||||
#include "encas.h"
|
||||
#endif // NEWMSG
|
||||
} // endswitch(id)
|
||||
|
||||
return p;
|
||||
} // end of GetMsgid
|
||||
|
||||
int GetRcString(int id, char *buf, int bufsize)
|
||||
{
|
||||
char *p = NULL, msg[32];
|
||||
|
||||
if (!(p = GetMsgid(id))) {
|
||||
sprintf(msg, "ID=%d unknown", id);
|
||||
p = msg;
|
||||
} // endif p
|
||||
|
||||
return sprintf(buf, "%.*s", bufsize-1, p);
|
||||
} // end of GetRcString
|
||||
|
||||
#endif // !XMSG
|
||||
/**************** RCMsg C Program Source Code File (.C) ****************/
|
||||
/* PROGRAM NAME: RCMSG */
|
||||
/* ------------- */
|
||||
/* Version 1.3 */
|
||||
/* */
|
||||
/* COPYRIGHT */
|
||||
/* ---------- */
|
||||
/* (C) Copyright to the author Olivier BERTRAND: 2005 - 2014 */
|
||||
/* */
|
||||
/* WHAT THIS PROGRAM DOES */
|
||||
/* ----------------------- */
|
||||
/* This program simulates LoadString. */
|
||||
/* */
|
||||
/***********************************************************************/
|
||||
#if !defined(XMSG)
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "resource.h"
|
||||
#include "rcmsg.h"
|
||||
#if defined(NEWMSG)
|
||||
#include "msgid.h"
|
||||
#endif // NEWMSG
|
||||
|
||||
#if !defined(WIN32)
|
||||
#define stricmp strcasecmp
|
||||
#endif // !WIN32
|
||||
|
||||
char *msglang(void);
|
||||
|
||||
char *GetMsgid(int id)
|
||||
{
|
||||
char *p = NULL;
|
||||
|
||||
// This conditional until a real fix is found for MDEV-7304
|
||||
#if defined(FRENCH)
|
||||
if (!stricmp(msglang(), "french"))
|
||||
switch (id) {
|
||||
#include "frids.h"
|
||||
#if defined(NEWMSG)
|
||||
#include "frcas.h"
|
||||
#endif // NEWMSG
|
||||
} // endswitch(id)
|
||||
|
||||
else // English
|
||||
#endif // FRENCH
|
||||
switch (id) {
|
||||
#include "enids.h"
|
||||
#if defined(NEWMSG)
|
||||
#include "encas.h"
|
||||
#endif // NEWMSG
|
||||
} // endswitch(id)
|
||||
|
||||
return p;
|
||||
} // end of GetMsgid
|
||||
|
||||
int GetRcString(int id, char *buf, int bufsize)
|
||||
{
|
||||
char *p = NULL, msg[32];
|
||||
|
||||
if (!(p = GetMsgid(id))) {
|
||||
sprintf(msg, "ID=%d unknown", id);
|
||||
p = msg;
|
||||
} // endif p
|
||||
|
||||
return sprintf(buf, "%.*s", bufsize-1, p);
|
||||
} // end of GetRcString
|
||||
|
||||
#endif // !XMSG
|
||||
|
|
|
@ -1,182 +1,182 @@
|
|||
/*************** TabSys H Declares Source Code File (.H) ***************/
|
||||
/* Name: TABSYS.H Version 2.3 */
|
||||
/* */
|
||||
/* (C) Copyright to the author Olivier BERTRAND 2004-2014 */
|
||||
/* */
|
||||
/* This file contains the XDB system tables classes declares. */
|
||||
/***********************************************************************/
|
||||
typedef class INIDEF *PINIDEF;
|
||||
typedef class TDBINI *PTDBINI;
|
||||
typedef class INICOL *PINICOL;
|
||||
typedef class TDBXIN *PTDBXIN;
|
||||
typedef class XINCOL *PXINCOL;
|
||||
|
||||
/* --------------------------- INI classes --------------------------- */
|
||||
|
||||
/***********************************************************************/
|
||||
/* INI, XDB and XCL tables. */
|
||||
/***********************************************************************/
|
||||
class DllExport INIDEF : public TABDEF { /* INI table description */
|
||||
friend class TDBINI;
|
||||
friend class TDBXIN;
|
||||
friend class TDBXTB;
|
||||
friend class TDBRTB;
|
||||
friend class TDBXCL;
|
||||
public:
|
||||
// Constructor
|
||||
INIDEF(void);
|
||||
|
||||
// Implementation
|
||||
virtual const char *GetType(void) {return "INI";}
|
||||
|
||||
// Methods
|
||||
virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
|
||||
virtual PTDB GetTable(PGLOBAL g, MODE m);
|
||||
|
||||
protected:
|
||||
// Members
|
||||
char *Fn; /* Path/Name of corresponding file */
|
||||
char *Xname; /* The eventual table name */
|
||||
char Layout; /* R: Row, C: Column */
|
||||
int Ln; /* Length of section list buffer */
|
||||
}; // end of INIDEF
|
||||
|
||||
/***********************************************************************/
|
||||
/* This is the class declaration for the INI tables. */
|
||||
/* These are tables represented by a INI like file. */
|
||||
/***********************************************************************/
|
||||
class TDBINI : public TDBASE {
|
||||
friend class INICOL;
|
||||
public:
|
||||
// Constructor
|
||||
TDBINI(PINIDEF tdp);
|
||||
TDBINI(PTDBINI tdbp);
|
||||
|
||||
// Implementation
|
||||
virtual AMT GetAmType(void) {return TYPE_AM_INI;}
|
||||
virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBINI(this);}
|
||||
|
||||
// Methods
|
||||
virtual PTDB CopyOne(PTABS t);
|
||||
virtual int GetRecpos(void) {return N;}
|
||||
virtual int GetProgCur(void) {return N;}
|
||||
//virtual int GetAffectedRows(void) {return 0;}
|
||||
virtual PSZ GetFile(PGLOBAL g) {return Ifile;}
|
||||
virtual void SetFile(PGLOBAL g, PSZ fn) {Ifile = fn;}
|
||||
virtual void ResetDB(void) {Seclist = Section = NULL; N = 0;}
|
||||
virtual void ResetSize(void) {MaxSize = -1; Seclist = NULL;}
|
||||
virtual int RowNumber(PGLOBAL g, bool b = false) {return N;}
|
||||
char *GetSeclist(PGLOBAL g);
|
||||
|
||||
// Database routines
|
||||
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
|
||||
virtual int Cardinality(PGLOBAL g);
|
||||
virtual int GetMaxSize(PGLOBAL g);
|
||||
virtual bool OpenDB(PGLOBAL g);
|
||||
virtual int ReadDB(PGLOBAL g);
|
||||
virtual int WriteDB(PGLOBAL g);
|
||||
virtual int DeleteDB(PGLOBAL g, int irc);
|
||||
virtual void CloseDB(PGLOBAL g);
|
||||
|
||||
protected:
|
||||
// Members
|
||||
char *Ifile; // The INI file
|
||||
char *Seclist; // The section list
|
||||
char *Section; // The current section
|
||||
int Seclen; // Length of seclist buffer
|
||||
int N; // The current section index
|
||||
}; // end of class TDBINI
|
||||
|
||||
/***********************************************************************/
|
||||
/* Class INICOL: XDB table access method column descriptor. */
|
||||
/***********************************************************************/
|
||||
class INICOL : public COLBLK {
|
||||
public:
|
||||
// Constructors
|
||||
INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "INI");
|
||||
INICOL(INICOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||
|
||||
// Implementation
|
||||
virtual int GetAmType(void) {return TYPE_AM_INI;}
|
||||
virtual void SetTo_Val(PVAL valp) {To_Val = valp;}
|
||||
|
||||
// Methods
|
||||
virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check);
|
||||
virtual void ReadColumn(PGLOBAL g);
|
||||
virtual void WriteColumn(PGLOBAL g);
|
||||
virtual void AllocBuf(PGLOBAL g);
|
||||
|
||||
protected:
|
||||
// Default constructor not to be used
|
||||
INICOL(void) {}
|
||||
|
||||
// Members
|
||||
char *Valbuf; // To the key value buffer
|
||||
int Flag; // Tells what set in value
|
||||
int Long; // Buffer length
|
||||
PVAL To_Val; // To value used for Update/Insert
|
||||
}; // end of class INICOL
|
||||
|
||||
/* --------------------------- XINI class ---------------------------- */
|
||||
|
||||
/***********************************************************************/
|
||||
/* This is the class declaration for the XINI tables. */
|
||||
/* These are tables represented by a INI like file */
|
||||
/* having 3 columns Section, Key, and Value. */
|
||||
/***********************************************************************/
|
||||
class TDBXIN : public TDBINI {
|
||||
friend class XINCOL;
|
||||
public:
|
||||
// Constructor
|
||||
TDBXIN(PINIDEF tdp);
|
||||
TDBXIN(PTDBXIN tdbp);
|
||||
|
||||
// Implementation
|
||||
virtual AMT GetAmType(void) {return TYPE_AM_INI;}
|
||||
virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBXIN(this);}
|
||||
|
||||
// Methods
|
||||
virtual PTDB CopyOne(PTABS t);
|
||||
virtual int GetRecpos(void);
|
||||
virtual bool SetRecpos(PGLOBAL g, int recpos);
|
||||
virtual void ResetDB(void)
|
||||
{Seclist = Section = Keycur = NULL; N = 0; Oldsec = -1;}
|
||||
char *GetKeylist(PGLOBAL g, char *sec);
|
||||
|
||||
// Database routines
|
||||
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
|
||||
virtual int Cardinality(PGLOBAL g);
|
||||
virtual bool OpenDB(PGLOBAL g);
|
||||
virtual int ReadDB(PGLOBAL g);
|
||||
virtual int WriteDB(PGLOBAL g);
|
||||
virtual int DeleteDB(PGLOBAL g, int irc);
|
||||
|
||||
protected:
|
||||
// Members
|
||||
char *Keylist; // The key list
|
||||
char *Keycur; // The current key
|
||||
int Keylen; // Length of keylist buffer
|
||||
short Oldsec; // Last current section
|
||||
}; // end of class TDBXIN
|
||||
|
||||
/***********************************************************************/
|
||||
/* Class XINCOL: XIN table access method column descriptor. */
|
||||
/***********************************************************************/
|
||||
class XINCOL : public INICOL {
|
||||
public:
|
||||
// Constructors
|
||||
XINCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "INI");
|
||||
XINCOL(XINCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||
|
||||
// Implementation
|
||||
|
||||
// Methods
|
||||
virtual void ReadColumn(PGLOBAL g);
|
||||
virtual void WriteColumn(PGLOBAL g);
|
||||
|
||||
protected:
|
||||
// Default constructor not to be used
|
||||
XINCOL(void) {}
|
||||
|
||||
// Members
|
||||
}; // end of class XINICOL
|
||||
/*************** TabSys H Declares Source Code File (.H) ***************/
|
||||
/* Name: TABSYS.H Version 2.3 */
|
||||
/* */
|
||||
/* (C) Copyright to the author Olivier BERTRAND 2004-2014 */
|
||||
/* */
|
||||
/* This file contains the XDB system tables classes declares. */
|
||||
/***********************************************************************/
|
||||
typedef class INIDEF *PINIDEF;
|
||||
typedef class TDBINI *PTDBINI;
|
||||
typedef class INICOL *PINICOL;
|
||||
typedef class TDBXIN *PTDBXIN;
|
||||
typedef class XINCOL *PXINCOL;
|
||||
|
||||
/* --------------------------- INI classes --------------------------- */
|
||||
|
||||
/***********************************************************************/
|
||||
/* INI, XDB and XCL tables. */
|
||||
/***********************************************************************/
|
||||
class DllExport INIDEF : public TABDEF { /* INI table description */
|
||||
friend class TDBINI;
|
||||
friend class TDBXIN;
|
||||
friend class TDBXTB;
|
||||
friend class TDBRTB;
|
||||
friend class TDBXCL;
|
||||
public:
|
||||
// Constructor
|
||||
INIDEF(void);
|
||||
|
||||
// Implementation
|
||||
virtual const char *GetType(void) {return "INI";}
|
||||
|
||||
// Methods
|
||||
virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
|
||||
virtual PTDB GetTable(PGLOBAL g, MODE m);
|
||||
|
||||
protected:
|
||||
// Members
|
||||
char *Fn; /* Path/Name of corresponding file */
|
||||
char *Xname; /* The eventual table name */
|
||||
char Layout; /* R: Row, C: Column */
|
||||
int Ln; /* Length of section list buffer */
|
||||
}; // end of INIDEF
|
||||
|
||||
/***********************************************************************/
|
||||
/* This is the class declaration for the INI tables. */
|
||||
/* These are tables represented by a INI like file. */
|
||||
/***********************************************************************/
|
||||
class TDBINI : public TDBASE {
|
||||
friend class INICOL;
|
||||
public:
|
||||
// Constructor
|
||||
TDBINI(PINIDEF tdp);
|
||||
TDBINI(PTDBINI tdbp);
|
||||
|
||||
// Implementation
|
||||
virtual AMT GetAmType(void) {return TYPE_AM_INI;}
|
||||
virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBINI(this);}
|
||||
|
||||
// Methods
|
||||
virtual PTDB CopyOne(PTABS t);
|
||||
virtual int GetRecpos(void) {return N;}
|
||||
virtual int GetProgCur(void) {return N;}
|
||||
//virtual int GetAffectedRows(void) {return 0;}
|
||||
virtual PSZ GetFile(PGLOBAL g) {return Ifile;}
|
||||
virtual void SetFile(PGLOBAL g, PSZ fn) {Ifile = fn;}
|
||||
virtual void ResetDB(void) {Seclist = Section = NULL; N = 0;}
|
||||
virtual void ResetSize(void) {MaxSize = -1; Seclist = NULL;}
|
||||
virtual int RowNumber(PGLOBAL g, bool b = false) {return N;}
|
||||
char *GetSeclist(PGLOBAL g);
|
||||
|
||||
// Database routines
|
||||
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
|
||||
virtual int Cardinality(PGLOBAL g);
|
||||
virtual int GetMaxSize(PGLOBAL g);
|
||||
virtual bool OpenDB(PGLOBAL g);
|
||||
virtual int ReadDB(PGLOBAL g);
|
||||
virtual int WriteDB(PGLOBAL g);
|
||||
virtual int DeleteDB(PGLOBAL g, int irc);
|
||||
virtual void CloseDB(PGLOBAL g);
|
||||
|
||||
protected:
|
||||
// Members
|
||||
char *Ifile; // The INI file
|
||||
char *Seclist; // The section list
|
||||
char *Section; // The current section
|
||||
int Seclen; // Length of seclist buffer
|
||||
int N; // The current section index
|
||||
}; // end of class TDBINI
|
||||
|
||||
/***********************************************************************/
|
||||
/* Class INICOL: XDB table access method column descriptor. */
|
||||
/***********************************************************************/
|
||||
class INICOL : public COLBLK {
|
||||
public:
|
||||
// Constructors
|
||||
INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "INI");
|
||||
INICOL(INICOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||
|
||||
// Implementation
|
||||
virtual int GetAmType(void) {return TYPE_AM_INI;}
|
||||
virtual void SetTo_Val(PVAL valp) {To_Val = valp;}
|
||||
|
||||
// Methods
|
||||
virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check);
|
||||
virtual void ReadColumn(PGLOBAL g);
|
||||
virtual void WriteColumn(PGLOBAL g);
|
||||
virtual void AllocBuf(PGLOBAL g);
|
||||
|
||||
protected:
|
||||
// Default constructor not to be used
|
||||
INICOL(void) {}
|
||||
|
||||
// Members
|
||||
char *Valbuf; // To the key value buffer
|
||||
int Flag; // Tells what set in value
|
||||
int Long; // Buffer length
|
||||
PVAL To_Val; // To value used for Update/Insert
|
||||
}; // end of class INICOL
|
||||
|
||||
/* --------------------------- XINI class ---------------------------- */
|
||||
|
||||
/***********************************************************************/
|
||||
/* This is the class declaration for the XINI tables. */
|
||||
/* These are tables represented by a INI like file */
|
||||
/* having 3 columns Section, Key, and Value. */
|
||||
/***********************************************************************/
|
||||
class TDBXIN : public TDBINI {
|
||||
friend class XINCOL;
|
||||
public:
|
||||
// Constructor
|
||||
TDBXIN(PINIDEF tdp);
|
||||
TDBXIN(PTDBXIN tdbp);
|
||||
|
||||
// Implementation
|
||||
virtual AMT GetAmType(void) {return TYPE_AM_INI;}
|
||||
virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBXIN(this);}
|
||||
|
||||
// Methods
|
||||
virtual PTDB CopyOne(PTABS t);
|
||||
virtual int GetRecpos(void);
|
||||
virtual bool SetRecpos(PGLOBAL g, int recpos);
|
||||
virtual void ResetDB(void)
|
||||
{Seclist = Section = Keycur = NULL; N = 0; Oldsec = -1;}
|
||||
char *GetKeylist(PGLOBAL g, char *sec);
|
||||
|
||||
// Database routines
|
||||
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
|
||||
virtual int Cardinality(PGLOBAL g);
|
||||
virtual bool OpenDB(PGLOBAL g);
|
||||
virtual int ReadDB(PGLOBAL g);
|
||||
virtual int WriteDB(PGLOBAL g);
|
||||
virtual int DeleteDB(PGLOBAL g, int irc);
|
||||
|
||||
protected:
|
||||
// Members
|
||||
char *Keylist; // The key list
|
||||
char *Keycur; // The current key
|
||||
int Keylen; // Length of keylist buffer
|
||||
short Oldsec; // Last current section
|
||||
}; // end of class TDBXIN
|
||||
|
||||
/***********************************************************************/
|
||||
/* Class XINCOL: XIN table access method column descriptor. */
|
||||
/***********************************************************************/
|
||||
class XINCOL : public INICOL {
|
||||
public:
|
||||
// Constructors
|
||||
XINCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "INI");
|
||||
XINCOL(XINCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||
|
||||
// Implementation
|
||||
|
||||
// Methods
|
||||
virtual void ReadColumn(PGLOBAL g);
|
||||
virtual void WriteColumn(PGLOBAL g);
|
||||
|
||||
protected:
|
||||
// Default constructor not to be used
|
||||
XINCOL(void) {}
|
||||
|
||||
// Members
|
||||
}; // end of class XINICOL
|
||||
|
|
|
@ -1 +1 @@
|
|||
--source ../../include/deinit_spider.inc
|
||||
--source ../../include/deinit_spider.inc
|
||||
|
|
|
@ -1 +1 @@
|
|||
--source ../../include/deinit_spider.inc
|
||||
--source ../../include/deinit_spider.inc
|
||||
|
|
|
@ -1 +1 @@
|
|||
--source ../../include/deinit_spider.inc
|
||||
--source ../../include/deinit_spider.inc
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
let $CHILD2_1_HA_AS_DROP_TABLES=
|
||||
$CHILD2_1_DROP_TABLES;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES=
|
||||
$CHILD2_1_CREATE_TABLES;
|
||||
let $CHILD2_1_HA_AS_DROP_TABLES2=
|
||||
$CHILD2_1_DROP_TABLES2;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES2=
|
||||
$CHILD2_1_CREATE_TABLES2;
|
||||
let $CHILD2_1_HA_AS_DROP_TABLES=
|
||||
$CHILD2_1_DROP_TABLES;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES=
|
||||
$CHILD2_1_CREATE_TABLES;
|
||||
let $CHILD2_1_HA_AS_DROP_TABLES2=
|
||||
$CHILD2_1_DROP_TABLES2;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES2=
|
||||
$CHILD2_1_CREATE_TABLES2;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
let $CHILD2_2_HA_DROP_TABLES=
|
||||
$CHILD2_2_DROP_TABLES;
|
||||
let $CHILD2_2_HA_CREATE_TABLES=
|
||||
$CHILD2_2_CREATE_TABLES;
|
||||
let $CHILD2_2_HA_DROP_TABLES=
|
||||
$CHILD2_2_DROP_TABLES;
|
||||
let $CHILD2_2_HA_CREATE_TABLES=
|
||||
$CHILD2_2_CREATE_TABLES;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
let $CHILD2_3_HA_DROP_TABLES=
|
||||
$CHILD2_3_DROP_TABLES;
|
||||
let $CHILD2_3_HA_CREATE_TABLES=
|
||||
$CHILD2_3_CREATE_TABLES;
|
||||
let $CHILD2_3_HA_DROP_TABLES=
|
||||
$CHILD2_3_DROP_TABLES;
|
||||
let $CHILD2_3_HA_CREATE_TABLES=
|
||||
$CHILD2_3_CREATE_TABLES;
|
||||
|
|
|
@ -1,140 +1,140 @@
|
|||
--let $CHILD3_1_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_1_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_1_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_1_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_1_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_1_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_1_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_1_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
--let $CHILD3_1_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_1_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_1_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_1_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_1_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_1_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_1_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_1_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
|
|
|
@ -1,140 +1,140 @@
|
|||
--let $CHILD3_2_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_2_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_2_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_2_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_2_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_2_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_2_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_2_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
--let $CHILD3_2_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_2_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_2_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_2_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_2_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_2_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_2_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_2_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
|
|
|
@ -1,140 +1,140 @@
|
|||
--let $CHILD3_3_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_3_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_3_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_3_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_3_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_3_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_3_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_3_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
--let $CHILD3_3_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_3_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_3_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_3_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_3_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_3_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_3_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_3_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
let $CHILD2_1_HS_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS hs_r;
|
||||
let $CHILD2_1_HS_CREATE_TABLES=
|
||||
CREATE TABLE hs_r (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_HS_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r ORDER BY a;
|
||||
let $CHILD2_1_HS_DROP_TABLES2=
|
||||
DROP TABLE IF EXISTS hs_r2;
|
||||
let $CHILD2_1_HS_CREATE_TABLES2=
|
||||
CREATE TABLE hs_r2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_HS_SELECT_TABLES2=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r2 ORDER BY a;
|
||||
let $CHILD2_1_HS_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS hs_r;
|
||||
let $CHILD2_1_HS_CREATE_TABLES=
|
||||
CREATE TABLE hs_r (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_HS_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r ORDER BY a;
|
||||
let $CHILD2_1_HS_DROP_TABLES2=
|
||||
DROP TABLE IF EXISTS hs_r2;
|
||||
let $CHILD2_1_HS_CREATE_TABLES2=
|
||||
CREATE TABLE hs_r2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_HS_SELECT_TABLES2=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r2 ORDER BY a;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
let $CHILD2_2_HS_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS hs_r3;
|
||||
let $CHILD2_2_HS_CREATE_TABLES=
|
||||
CREATE TABLE hs_r3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_HS_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r3 ORDER BY a;
|
||||
let $CHILD2_2_HS_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS hs_r3;
|
||||
let $CHILD2_2_HS_CREATE_TABLES=
|
||||
CREATE TABLE hs_r3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_HS_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r3 ORDER BY a;
|
||||
|
|
|
@ -1,175 +1,175 @@
|
|||
let $CHILD2_1_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r;
|
||||
let $CHILD2_1_CREATE_TABLES=
|
||||
CREATE TABLE ta_r (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES2=
|
||||
DROP TABLE IF EXISTS ta_r2;
|
||||
let $CHILD2_1_CREATE_TABLES2=
|
||||
CREATE TABLE ta_r2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES2=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES3=
|
||||
DROP TABLE IF EXISTS ta_r_no_idx;
|
||||
let $CHILD2_1_CREATE_TABLES3=
|
||||
CREATE TABLE ta_r_no_idx (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10'
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES3=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_no_idx ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES4=
|
||||
DROP TABLE IF EXISTS ta_r_auto_inc;
|
||||
let $CHILD2_1_CREATE_TABLES4=
|
||||
CREATE TABLE ta_r_auto_inc (
|
||||
a INT AUTO_INCREMENT,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES4=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_auto_inc
|
||||
ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES5=
|
||||
DROP TABLE IF EXISTS ta_r_int;
|
||||
let $CHILD2_1_CREATE_TABLES5=
|
||||
CREATE TABLE ta_r_int (
|
||||
a INT AUTO_INCREMENT,
|
||||
b INT DEFAULT 10,
|
||||
c INT DEFAULT 11,
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b),
|
||||
KEY idx2(c)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES5=
|
||||
SELECT a, b, c FROM ta_r_int ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES6=
|
||||
DROP TABLE IF EXISTS ta_r_3;
|
||||
let $CHILD2_1_CREATE_TABLES6=
|
||||
CREATE TABLE ta_r_3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10'
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES6=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_3 ORDER BY a;
|
||||
let $CHILD2_1_DROP_FT_TABLES=
|
||||
DROP TABLE IF EXISTS ft_r;
|
||||
let $CHILD2_1_CREATE_FT_TABLES=
|
||||
CREATE TABLE ft_r (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET;
|
||||
let $CHILD2_1_SELECT_FT_TABLES=
|
||||
SELECT a, b, c, d FROM ft_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_FT_TABLES2=
|
||||
DROP TABLE IF EXISTS ft_r2;
|
||||
let $CHILD2_1_CREATE_FT_TABLES2=
|
||||
CREATE TABLE ft_r2 (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET;
|
||||
let $CHILD2_1_SELECT_FT_TABLES2=
|
||||
SELECT a, b, c, d FROM ft_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_GM_TABLES=
|
||||
DROP TABLE IF EXISTS gm_r;
|
||||
let $CHILD2_1_CREATE_GM_TABLES=
|
||||
CREATE TABLE gm_r (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET;
|
||||
let $CHILD2_1_SELECT_GM_TABLES=
|
||||
SELECT a, b, c FROM gm_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_GM_TABLES2=
|
||||
DROP TABLE IF EXISTS gm_r2;
|
||||
let $CHILD2_1_CREATE_GM_TABLES2=
|
||||
CREATE TABLE gm_r2 (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET;
|
||||
let $CHILD2_1_SELECT_GM_TABLES2=
|
||||
SELECT a, b, c FROM gm_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_LOCK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_1;
|
||||
let $CHILD2_1_CREATE_LOCK_TABLES1=
|
||||
CREATE TABLE t1_1 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_DROP_LOCK_TABLES2=
|
||||
DROP TABLE IF EXISTS t2_2;
|
||||
let $CHILD2_1_CREATE_LOCK_TABLES2=
|
||||
CREATE TABLE t2_2 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_DROP_INCREMENT_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_1;
|
||||
let $CHILD2_1_CREATE_INCREMENT_TABLES1=
|
||||
CREATE TABLE t1_1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_INCREMENT_TABLES1=
|
||||
SELECT id FROM t1_1 ORDER BY id;
|
||||
let $CHILD2_1_DROP_TEXT_PK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1;
|
||||
let $CHILD2_1_CREATE_TEXT_PK_TABLES1=
|
||||
CREATE TABLE t1 (
|
||||
a VARCHAR(255),
|
||||
PRIMARY KEY (a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET2;
|
||||
let $CHILD2_1_SELECT_TEXT_PK_TABLES1=
|
||||
SELECT a FROM t1 ORDER BY a;
|
||||
let $CHILD2_1_DROP_TEXT_KEY_TABLES1=
|
||||
DROP TABLE IF EXISTS t1;
|
||||
let $CHILD2_1_CREATE_TEXT_KEY_TABLES1=
|
||||
CREATE TABLE t1 (
|
||||
a VARCHAR(255),
|
||||
b VARCHAR(255),
|
||||
c VARCHAR(255),
|
||||
KEY idx1(a,b),
|
||||
KEY idx2(b),
|
||||
PRIMARY KEY(c)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TEXT_KEY_TABLES1=
|
||||
SELECT a, b FROM t1 ORDER BY a, b;
|
||||
let $CHILD2_1_AUTO_INCREMENT_INCREMENT1=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 1;
|
||||
let $CHILD2_1_AUTO_INCREMENT_INCREMENT2=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 4;
|
||||
let $CHILD2_1_AUTO_INCREMENT_OFFSET1=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 1;
|
||||
let $CHILD2_1_AUTO_INCREMENT_OFFSET2=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 2;
|
||||
let $CHILD2_1_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r;
|
||||
let $CHILD2_1_CREATE_TABLES=
|
||||
CREATE TABLE ta_r (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES2=
|
||||
DROP TABLE IF EXISTS ta_r2;
|
||||
let $CHILD2_1_CREATE_TABLES2=
|
||||
CREATE TABLE ta_r2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES2=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES3=
|
||||
DROP TABLE IF EXISTS ta_r_no_idx;
|
||||
let $CHILD2_1_CREATE_TABLES3=
|
||||
CREATE TABLE ta_r_no_idx (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10'
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES3=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_no_idx ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES4=
|
||||
DROP TABLE IF EXISTS ta_r_auto_inc;
|
||||
let $CHILD2_1_CREATE_TABLES4=
|
||||
CREATE TABLE ta_r_auto_inc (
|
||||
a INT AUTO_INCREMENT,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES4=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_auto_inc
|
||||
ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES5=
|
||||
DROP TABLE IF EXISTS ta_r_int;
|
||||
let $CHILD2_1_CREATE_TABLES5=
|
||||
CREATE TABLE ta_r_int (
|
||||
a INT AUTO_INCREMENT,
|
||||
b INT DEFAULT 10,
|
||||
c INT DEFAULT 11,
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b),
|
||||
KEY idx2(c)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES5=
|
||||
SELECT a, b, c FROM ta_r_int ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES6=
|
||||
DROP TABLE IF EXISTS ta_r_3;
|
||||
let $CHILD2_1_CREATE_TABLES6=
|
||||
CREATE TABLE ta_r_3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10'
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES6=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_3 ORDER BY a;
|
||||
let $CHILD2_1_DROP_FT_TABLES=
|
||||
DROP TABLE IF EXISTS ft_r;
|
||||
let $CHILD2_1_CREATE_FT_TABLES=
|
||||
CREATE TABLE ft_r (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET;
|
||||
let $CHILD2_1_SELECT_FT_TABLES=
|
||||
SELECT a, b, c, d FROM ft_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_FT_TABLES2=
|
||||
DROP TABLE IF EXISTS ft_r2;
|
||||
let $CHILD2_1_CREATE_FT_TABLES2=
|
||||
CREATE TABLE ft_r2 (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET;
|
||||
let $CHILD2_1_SELECT_FT_TABLES2=
|
||||
SELECT a, b, c, d FROM ft_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_GM_TABLES=
|
||||
DROP TABLE IF EXISTS gm_r;
|
||||
let $CHILD2_1_CREATE_GM_TABLES=
|
||||
CREATE TABLE gm_r (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET;
|
||||
let $CHILD2_1_SELECT_GM_TABLES=
|
||||
SELECT a, b, c FROM gm_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_GM_TABLES2=
|
||||
DROP TABLE IF EXISTS gm_r2;
|
||||
let $CHILD2_1_CREATE_GM_TABLES2=
|
||||
CREATE TABLE gm_r2 (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET;
|
||||
let $CHILD2_1_SELECT_GM_TABLES2=
|
||||
SELECT a, b, c FROM gm_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_LOCK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_1;
|
||||
let $CHILD2_1_CREATE_LOCK_TABLES1=
|
||||
CREATE TABLE t1_1 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_DROP_LOCK_TABLES2=
|
||||
DROP TABLE IF EXISTS t2_2;
|
||||
let $CHILD2_1_CREATE_LOCK_TABLES2=
|
||||
CREATE TABLE t2_2 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_DROP_INCREMENT_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_1;
|
||||
let $CHILD2_1_CREATE_INCREMENT_TABLES1=
|
||||
CREATE TABLE t1_1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_INCREMENT_TABLES1=
|
||||
SELECT id FROM t1_1 ORDER BY id;
|
||||
let $CHILD2_1_DROP_TEXT_PK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1;
|
||||
let $CHILD2_1_CREATE_TEXT_PK_TABLES1=
|
||||
CREATE TABLE t1 (
|
||||
a VARCHAR(255),
|
||||
PRIMARY KEY (a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET2;
|
||||
let $CHILD2_1_SELECT_TEXT_PK_TABLES1=
|
||||
SELECT a FROM t1 ORDER BY a;
|
||||
let $CHILD2_1_DROP_TEXT_KEY_TABLES1=
|
||||
DROP TABLE IF EXISTS t1;
|
||||
let $CHILD2_1_CREATE_TEXT_KEY_TABLES1=
|
||||
CREATE TABLE t1 (
|
||||
a VARCHAR(255),
|
||||
b VARCHAR(255),
|
||||
c VARCHAR(255),
|
||||
KEY idx1(a,b),
|
||||
KEY idx2(b),
|
||||
PRIMARY KEY(c)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TEXT_KEY_TABLES1=
|
||||
SELECT a, b FROM t1 ORDER BY a, b;
|
||||
let $CHILD2_1_AUTO_INCREMENT_INCREMENT1=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 1;
|
||||
let $CHILD2_1_AUTO_INCREMENT_INCREMENT2=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 4;
|
||||
let $CHILD2_1_AUTO_INCREMENT_OFFSET1=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 1;
|
||||
let $CHILD2_1_AUTO_INCREMENT_OFFSET2=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 2;
|
||||
|
|
|
@ -1,80 +1,80 @@
|
|||
let $CHILD2_2_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r3;
|
||||
let $CHILD2_2_CREATE_TABLES=
|
||||
CREATE TABLE ta_r3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_TABLES5=
|
||||
DROP TABLE IF EXISTS ta_r_int;
|
||||
let $CHILD2_2_CREATE_TABLES5=
|
||||
CREATE TABLE ta_r_int (
|
||||
a INT AUTO_INCREMENT,
|
||||
b INT DEFAULT 10,
|
||||
c INT DEFAULT 11,
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b),
|
||||
KEY idx2(c)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_FT_TABLES=
|
||||
DROP TABLE IF EXISTS ft_r3;
|
||||
let $CHILD2_2_CREATE_FT_TABLES=
|
||||
CREATE TABLE ft_r3 (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_2_FT_ENGINE $CHILD2_2_FT_CHARSET;
|
||||
let $CHILD2_2_SELECT_FT_TABLES=
|
||||
SELECT a, b, c, d FROM ft_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_GM_TABLES=
|
||||
DROP TABLE IF EXISTS gm_r3;
|
||||
let $CHILD2_2_CREATE_GM_TABLES=
|
||||
CREATE TABLE gm_r3 (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_2_GM_ENGINE $CHILD2_2_GM_CHARSET;
|
||||
let $CHILD2_2_SELECT_GM_TABLES=
|
||||
SELECT a, b, c FROM gm_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_LOCK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_2;
|
||||
let $CHILD2_2_CREATE_LOCK_TABLES1=
|
||||
CREATE TABLE t1_2 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_LOCK_TABLES2=
|
||||
DROP TABLE IF EXISTS t2_1;
|
||||
let $CHILD2_2_CREATE_LOCK_TABLES2=
|
||||
CREATE TABLE t2_1 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_INCREMENT_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_2;
|
||||
let $CHILD2_2_CREATE_INCREMENT_TABLES1=
|
||||
CREATE TABLE t1_2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_SELECT_INCREMENT_TABLES1=
|
||||
SELECT id FROM t1_2 ORDER BY id;
|
||||
let $CHILD2_2_AUTO_INCREMENT_INCREMENT1=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 1;
|
||||
let $CHILD2_2_AUTO_INCREMENT_INCREMENT2=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 4;
|
||||
let $CHILD2_2_AUTO_INCREMENT_OFFSET1=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 1;
|
||||
let $CHILD2_2_AUTO_INCREMENT_OFFSET2=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 3;
|
||||
let $CHILD2_2_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r3;
|
||||
let $CHILD2_2_CREATE_TABLES=
|
||||
CREATE TABLE ta_r3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_TABLES5=
|
||||
DROP TABLE IF EXISTS ta_r_int;
|
||||
let $CHILD2_2_CREATE_TABLES5=
|
||||
CREATE TABLE ta_r_int (
|
||||
a INT AUTO_INCREMENT,
|
||||
b INT DEFAULT 10,
|
||||
c INT DEFAULT 11,
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b),
|
||||
KEY idx2(c)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_FT_TABLES=
|
||||
DROP TABLE IF EXISTS ft_r3;
|
||||
let $CHILD2_2_CREATE_FT_TABLES=
|
||||
CREATE TABLE ft_r3 (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_2_FT_ENGINE $CHILD2_2_FT_CHARSET;
|
||||
let $CHILD2_2_SELECT_FT_TABLES=
|
||||
SELECT a, b, c, d FROM ft_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_GM_TABLES=
|
||||
DROP TABLE IF EXISTS gm_r3;
|
||||
let $CHILD2_2_CREATE_GM_TABLES=
|
||||
CREATE TABLE gm_r3 (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_2_GM_ENGINE $CHILD2_2_GM_CHARSET;
|
||||
let $CHILD2_2_SELECT_GM_TABLES=
|
||||
SELECT a, b, c FROM gm_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_LOCK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_2;
|
||||
let $CHILD2_2_CREATE_LOCK_TABLES1=
|
||||
CREATE TABLE t1_2 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_LOCK_TABLES2=
|
||||
DROP TABLE IF EXISTS t2_1;
|
||||
let $CHILD2_2_CREATE_LOCK_TABLES2=
|
||||
CREATE TABLE t2_1 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_INCREMENT_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_2;
|
||||
let $CHILD2_2_CREATE_INCREMENT_TABLES1=
|
||||
CREATE TABLE t1_2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_SELECT_INCREMENT_TABLES1=
|
||||
SELECT id FROM t1_2 ORDER BY id;
|
||||
let $CHILD2_2_AUTO_INCREMENT_INCREMENT1=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 1;
|
||||
let $CHILD2_2_AUTO_INCREMENT_INCREMENT2=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 4;
|
||||
let $CHILD2_2_AUTO_INCREMENT_OFFSET1=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 1;
|
||||
let $CHILD2_2_AUTO_INCREMENT_OFFSET2=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 3;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
let $CHILD2_3_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r4;
|
||||
let $CHILD2_3_CREATE_TABLES=
|
||||
CREATE TABLE ta_r4 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_3_ENGINE $CHILD2_3_CHARSET;
|
||||
let $CHILD2_3_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a;
|
||||
let $CHILD2_3_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r4;
|
||||
let $CHILD2_3_CREATE_TABLES=
|
||||
CREATE TABLE ta_r4 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_3_ENGINE $CHILD2_3_CHARSET;
|
||||
let $CHILD2_3_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
let $SLAVE1_1_COMMENT_INCREMENT1_1=
|
||||
COMMENT '';
|
||||
let $SLAVE1_1_COMMENT_INCREMENT1_P_1=
|
||||
COMMENT ''
|
||||
PARTITION BY LIST(MOD(id, 2)) (
|
||||
PARTITION pt1 VALUES IN (0)
|
||||
COMMENT='',
|
||||
PARTITION pt2 VALUES IN (1)
|
||||
COMMENT=''
|
||||
);
|
||||
let $SLAVE1_1_COMMENT_INCREMENT1_1=
|
||||
COMMENT '';
|
||||
let $SLAVE1_1_COMMENT_INCREMENT1_P_1=
|
||||
COMMENT ''
|
||||
PARTITION BY LIST(MOD(id, 2)) (
|
||||
PARTITION pt1 VALUES IN (0)
|
||||
COMMENT='',
|
||||
PARTITION pt2 VALUES IN (1)
|
||||
COMMENT=''
|
||||
);
|
||||
|
|
|
@ -1,179 +1,179 @@
|
|||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo create table select test
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_TABLES;
|
||||
echo CHILD2_1_CREATE_TABLES;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_TABLES;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_TABLES;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE ta_l (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
|
||||
eval CREATE TABLE ta_l (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
|
||||
--enable_query_log
|
||||
INSERT INTO ta_l (a, b, c) VALUES
|
||||
(1, 'a', '2008-08-01 10:21:39'),
|
||||
(2, 'b', '2000-01-01 00:00:00'),
|
||||
(3, 'e', '2007-06-04 20:03:11'),
|
||||
(4, 'd', '2003-11-30 05:01:03'),
|
||||
(5, 'c', '2001-12-31 23:59:59');
|
||||
|
||||
--echo
|
||||
--echo direct_aggregating test
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT COUNT(*) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l WHERE a < 5;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l WHERE a > 1;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_TABLES;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo create table select test
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_TABLES;
|
||||
echo CHILD2_1_CREATE_TABLES;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_TABLES;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_TABLES;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE ta_l (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
|
||||
eval CREATE TABLE ta_l (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
|
||||
--enable_query_log
|
||||
INSERT INTO ta_l (a, b, c) VALUES
|
||||
(1, 'a', '2008-08-01 10:21:39'),
|
||||
(2, 'b', '2000-01-01 00:00:00'),
|
||||
(3, 'e', '2007-06-04 20:03:11'),
|
||||
(4, 'd', '2003-11-30 05:01:03'),
|
||||
(5, 'c', '2001-12-31 23:59:59');
|
||||
|
||||
--echo
|
||||
--echo direct_aggregating test
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT COUNT(*) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l WHERE a < 5;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l WHERE a > 1;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_TABLES;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
|
|
|
@ -1,192 +1,192 @@
|
|||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
if (!$HAVE_PARTITION)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
skip Test requires partitioning;
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo with partition test
|
||||
if ($HAVE_PARTITION)
|
||||
{
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_DROP_TABLES;
|
||||
echo CHILD2_2_CREATE_TABLES;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_2_DROP_TABLES;
|
||||
--enable_warnings
|
||||
eval $CHILD2_2_CREATE_TABLES;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_TABLES2;
|
||||
echo CHILD2_1_CREATE_TABLES2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_TABLES2;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_TABLES2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
echo CREATE TABLE ta_l2 (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
|
||||
eval CREATE TABLE ta_l2 (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
|
||||
INSERT INTO ta_l2 (a, b, c) VALUES
|
||||
(1, 'a', '2008-08-01 10:21:39'),
|
||||
(2, 'b', '2000-01-01 00:00:00'),
|
||||
(3, 'e', '2007-06-04 20:03:11'),
|
||||
(4, 'd', '2003-11-30 05:01:03'),
|
||||
(5, 'c', '2001-12-31 23:59:59');
|
||||
--enable_query_log
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT COUNT(*) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l2 WHERE a < 5;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l2 WHERE a > 1;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_2_SELECT_TABLES;
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_TABLES2;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
if (!$HAVE_PARTITION)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
skip Test requires partitioning;
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo with partition test
|
||||
if ($HAVE_PARTITION)
|
||||
{
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_DROP_TABLES;
|
||||
echo CHILD2_2_CREATE_TABLES;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_2_DROP_TABLES;
|
||||
--enable_warnings
|
||||
eval $CHILD2_2_CREATE_TABLES;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_TABLES2;
|
||||
echo CHILD2_1_CREATE_TABLES2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_TABLES2;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_TABLES2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
echo CREATE TABLE ta_l2 (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
|
||||
eval CREATE TABLE ta_l2 (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
|
||||
INSERT INTO ta_l2 (a, b, c) VALUES
|
||||
(1, 'a', '2008-08-01 10:21:39'),
|
||||
(2, 'b', '2000-01-01 00:00:00'),
|
||||
(3, 'e', '2007-06-04 20:03:11'),
|
||||
(4, 'd', '2003-11-30 05:01:03'),
|
||||
(5, 'c', '2001-12-31 23:59:59');
|
||||
--enable_query_log
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT COUNT(*) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l2 WHERE a < 5;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l2 WHERE a > 1;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_2_SELECT_TABLES;
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_TABLES2;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
let $HAVE_PARTITION= 0;
|
||||
if (`SELECT count(*) FROM information_schema.plugins WHERE
|
||||
plugin_status = 'ACTIVE' AND
|
||||
plugin_name = 'partition'`)
|
||||
{
|
||||
let $HAVE_PARTITION= 1;
|
||||
}
|
||||
let $HAVE_PARTITION= 0;
|
||||
if (`SELECT count(*) FROM information_schema.plugins WHERE
|
||||
plugin_status = 'ACTIVE' AND
|
||||
plugin_name = 'partition'`)
|
||||
{
|
||||
let $HAVE_PARTITION= 1;
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
let $HAVE_TRIGGER= `SELECT COUNT(*) FROM information_schema.tables
|
||||
WHERE TABLE_SCHEMA = 'information_schema' AND TABLE_NAME = 'TRIGGERS'`;
|
||||
let $HAVE_TRIGGER= `SELECT COUNT(*) FROM information_schema.tables
|
||||
WHERE TABLE_SCHEMA = 'information_schema' AND TABLE_NAME = 'TRIGGERS'`;
|
||||
|
|
|
@ -1,292 +1,292 @@
|
|||
# This test tests for Spider 3.0's bug fixes
|
||||
source include/have_log_bin.inc;
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--source slave_test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo 3.1
|
||||
--echo auto_increment
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1;
|
||||
echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1;
|
||||
eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
SET SESSION sql_log_bin= 1;
|
||||
--connection slave1_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
--connection master_1
|
||||
}
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
SET INSERT_ID=5000;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
INSERT INTO t1 (id) VALUES (10000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 (id) VALUES (1000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
# This test tests for Spider 3.0's bug fixes
|
||||
source include/have_log_bin.inc;
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--source slave_test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo 3.1
|
||||
--echo auto_increment
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1;
|
||||
echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1;
|
||||
eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
SET SESSION sql_log_bin= 1;
|
||||
--connection slave1_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
--connection master_1
|
||||
}
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
SET INSERT_ID=5000;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
INSERT INTO t1 (id) VALUES (10000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 (id) VALUES (1000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
|
|
|
@ -1,345 +1,345 @@
|
|||
# This test tests for Spider 3.0's bug fixes
|
||||
source include/have_log_bin.inc;
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--source slave_test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
if (!$HAVE_PARTITION)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
skip Test requires partitioning;
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo auto_increment with partition
|
||||
if ($HAVE_PARTITION)
|
||||
{
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
--connection child2_2
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_2_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_2_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
SET SESSION sql_log_bin= 1;
|
||||
--connection slave1_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
--connection master_1
|
||||
}
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
SET INSERT_ID=5000;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
INSERT INTO t1 (id) VALUES (10000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 (id) VALUES (1000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
# This test tests for Spider 3.0's bug fixes
|
||||
source include/have_log_bin.inc;
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--source slave_test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
if (!$HAVE_PARTITION)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
skip Test requires partitioning;
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo auto_increment with partition
|
||||
if ($HAVE_PARTITION)
|
||||
{
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
--connection child2_2
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_2_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_2_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
SET SESSION sql_log_bin= 1;
|
||||
--connection slave1_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
--connection master_1
|
||||
}
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
SET INSERT_ID=5000;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
INSERT INTO t1 (id) VALUES (10000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 (id) VALUES (1000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
|
|
|
@ -1 +1 @@
|
|||
--source ../../include/deinit_spider.inc
|
||||
--source ../../include/deinit_spider.inc
|
||||
|
|
|
@ -1 +1 @@
|
|||
--source ../../include/deinit_spider.inc
|
||||
--source ../../include/deinit_spider.inc
|
||||
|
|
|
@ -1 +1 @@
|
|||
--source ../../include/deinit_spider.inc
|
||||
--source ../../include/deinit_spider.inc
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
let $CHILD2_1_HA_AS_DROP_TABLES=
|
||||
$CHILD2_1_DROP_TABLES;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES=
|
||||
$CHILD2_1_CREATE_TABLES;
|
||||
let $CHILD2_1_HA_AS_DROP_TABLES2=
|
||||
$CHILD2_1_DROP_TABLES2;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES2=
|
||||
$CHILD2_1_CREATE_TABLES2;
|
||||
let $CHILD2_1_HA_AS_DROP_TABLES=
|
||||
$CHILD2_1_DROP_TABLES;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES=
|
||||
$CHILD2_1_CREATE_TABLES;
|
||||
let $CHILD2_1_HA_AS_DROP_TABLES2=
|
||||
$CHILD2_1_DROP_TABLES2;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES2=
|
||||
$CHILD2_1_CREATE_TABLES2;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
let $CHILD2_2_HA_DROP_TABLES=
|
||||
$CHILD2_2_DROP_TABLES;
|
||||
let $CHILD2_2_HA_CREATE_TABLES=
|
||||
$CHILD2_2_CREATE_TABLES;
|
||||
let $CHILD2_2_HA_DROP_TABLES=
|
||||
$CHILD2_2_DROP_TABLES;
|
||||
let $CHILD2_2_HA_CREATE_TABLES=
|
||||
$CHILD2_2_CREATE_TABLES;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
let $CHILD2_3_HA_DROP_TABLES=
|
||||
$CHILD2_3_DROP_TABLES;
|
||||
let $CHILD2_3_HA_CREATE_TABLES=
|
||||
$CHILD2_3_CREATE_TABLES;
|
||||
let $CHILD2_3_HA_DROP_TABLES=
|
||||
$CHILD2_3_DROP_TABLES;
|
||||
let $CHILD2_3_HA_CREATE_TABLES=
|
||||
$CHILD2_3_CREATE_TABLES;
|
||||
|
|
|
@ -1,140 +1,140 @@
|
|||
--let $CHILD3_1_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_1_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_1_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_1_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_1_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_1_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_1_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_1_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
--let $CHILD3_1_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_1_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_1_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_1_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_1_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_1_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_1_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_1_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
|
|
|
@ -1,140 +1,140 @@
|
|||
--let $CHILD3_2_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_2_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_2_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_2_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_2_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_2_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_2_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_2_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
--let $CHILD3_2_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_2_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_2_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_2_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_2_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_2_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_2_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_2_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
|
|
|
@ -1,140 +1,140 @@
|
|||
--let $CHILD3_3_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_3_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_3_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_3_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_3_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_3_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_3_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_3_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
--let $CHILD3_3_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_3_ENGINE=ENGINE=Spider
|
||||
--source ../../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_3_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_3_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_3_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_3_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_3_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_3_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
let $CHILD2_1_HS_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS hs_r;
|
||||
let $CHILD2_1_HS_CREATE_TABLES=
|
||||
CREATE TABLE hs_r (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_HS_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r ORDER BY a;
|
||||
let $CHILD2_1_HS_DROP_TABLES2=
|
||||
DROP TABLE IF EXISTS hs_r2;
|
||||
let $CHILD2_1_HS_CREATE_TABLES2=
|
||||
CREATE TABLE hs_r2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_HS_SELECT_TABLES2=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r2 ORDER BY a;
|
||||
let $CHILD2_1_HS_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS hs_r;
|
||||
let $CHILD2_1_HS_CREATE_TABLES=
|
||||
CREATE TABLE hs_r (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_HS_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r ORDER BY a;
|
||||
let $CHILD2_1_HS_DROP_TABLES2=
|
||||
DROP TABLE IF EXISTS hs_r2;
|
||||
let $CHILD2_1_HS_CREATE_TABLES2=
|
||||
CREATE TABLE hs_r2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_HS_SELECT_TABLES2=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r2 ORDER BY a;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
let $CHILD2_2_HS_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS hs_r3;
|
||||
let $CHILD2_2_HS_CREATE_TABLES=
|
||||
CREATE TABLE hs_r3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_HS_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r3 ORDER BY a;
|
||||
let $CHILD2_2_HS_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS hs_r3;
|
||||
let $CHILD2_2_HS_CREATE_TABLES=
|
||||
CREATE TABLE hs_r3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
d INT DEFAULT 11,
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_HS_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r3 ORDER BY a;
|
||||
|
|
|
@ -1,176 +1,176 @@
|
|||
let $CHILD2_1_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r;
|
||||
let $CHILD2_1_CREATE_TABLES=
|
||||
CREATE TABLE ta_r (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES2=
|
||||
DROP TABLE IF EXISTS ta_r2;
|
||||
let $CHILD2_1_CREATE_TABLES2=
|
||||
CREATE TABLE ta_r2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES2=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES3=
|
||||
DROP TABLE IF EXISTS ta_r_no_idx;
|
||||
let $CHILD2_1_CREATE_TABLES3=
|
||||
CREATE TABLE ta_r_no_idx (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10'
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES3=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_no_idx ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES4=
|
||||
DROP TABLE IF EXISTS ta_r_auto_inc;
|
||||
let $CHILD2_1_CREATE_TABLES4=
|
||||
CREATE TABLE ta_r_auto_inc (
|
||||
a INT AUTO_INCREMENT,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES4=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_auto_inc
|
||||
ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES5=
|
||||
DROP TABLE IF EXISTS ta_r_int;
|
||||
let $CHILD2_1_CREATE_TABLES5=
|
||||
CREATE TABLE ta_r_int (
|
||||
a INT AUTO_INCREMENT,
|
||||
b INT DEFAULT 10,
|
||||
c INT DEFAULT 11,
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b),
|
||||
KEY idx2(c)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES5=
|
||||
SELECT a, b, c FROM ta_r_int ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES6=
|
||||
DROP TABLE IF EXISTS ta_r_3;
|
||||
let $CHILD2_1_CREATE_TABLES6=
|
||||
CREATE TABLE ta_r_3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES6=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_3 ORDER BY a;
|
||||
let $CHILD2_1_DROP_FT_TABLES=
|
||||
DROP TABLE IF EXISTS ft_r;
|
||||
let $CHILD2_1_CREATE_FT_TABLES=
|
||||
CREATE TABLE ft_r (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET;
|
||||
let $CHILD2_1_SELECT_FT_TABLES=
|
||||
SELECT a, b, c, d FROM ft_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_FT_TABLES2=
|
||||
DROP TABLE IF EXISTS ft_r2;
|
||||
let $CHILD2_1_CREATE_FT_TABLES2=
|
||||
CREATE TABLE ft_r2 (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET;
|
||||
let $CHILD2_1_SELECT_FT_TABLES2=
|
||||
SELECT a, b, c, d FROM ft_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_GM_TABLES=
|
||||
DROP TABLE IF EXISTS gm_r;
|
||||
let $CHILD2_1_CREATE_GM_TABLES=
|
||||
CREATE TABLE gm_r (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET;
|
||||
let $CHILD2_1_SELECT_GM_TABLES=
|
||||
SELECT a, b, c FROM gm_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_GM_TABLES2=
|
||||
DROP TABLE IF EXISTS gm_r2;
|
||||
let $CHILD2_1_CREATE_GM_TABLES2=
|
||||
CREATE TABLE gm_r2 (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET;
|
||||
let $CHILD2_1_SELECT_GM_TABLES2=
|
||||
SELECT a, b, c FROM gm_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_LOCK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_1;
|
||||
let $CHILD2_1_CREATE_LOCK_TABLES1=
|
||||
CREATE TABLE t1_1 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_DROP_LOCK_TABLES2=
|
||||
DROP TABLE IF EXISTS t2_2;
|
||||
let $CHILD2_1_CREATE_LOCK_TABLES2=
|
||||
CREATE TABLE t2_2 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_DROP_INCREMENT_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_1;
|
||||
let $CHILD2_1_CREATE_INCREMENT_TABLES1=
|
||||
CREATE TABLE t1_1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_INCREMENT_TABLES1=
|
||||
SELECT id FROM t1_1 ORDER BY id;
|
||||
let $CHILD2_1_DROP_TEXT_PK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1;
|
||||
let $CHILD2_1_CREATE_TEXT_PK_TABLES1=
|
||||
CREATE TABLE t1 (
|
||||
a VARCHAR(255),
|
||||
PRIMARY KEY (a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET2;
|
||||
let $CHILD2_1_SELECT_TEXT_PK_TABLES1=
|
||||
SELECT a FROM t1 ORDER BY a;
|
||||
let $CHILD2_1_DROP_TEXT_KEY_TABLES1=
|
||||
DROP TABLE IF EXISTS t1;
|
||||
let $CHILD2_1_CREATE_TEXT_KEY_TABLES1=
|
||||
CREATE TABLE t1 (
|
||||
a VARCHAR(255),
|
||||
b VARCHAR(255),
|
||||
c VARCHAR(255),
|
||||
KEY idx1(a,b),
|
||||
KEY idx2(b),
|
||||
PRIMARY KEY(c)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TEXT_KEY_TABLES1=
|
||||
SELECT a, b FROM t1 ORDER BY a, b;
|
||||
let $CHILD2_1_AUTO_INCREMENT_INCREMENT1=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 1;
|
||||
let $CHILD2_1_AUTO_INCREMENT_INCREMENT2=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 4;
|
||||
let $CHILD2_1_AUTO_INCREMENT_OFFSET1=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 1;
|
||||
let $CHILD2_1_AUTO_INCREMENT_OFFSET2=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 2;
|
||||
let $CHILD2_1_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r;
|
||||
let $CHILD2_1_CREATE_TABLES=
|
||||
CREATE TABLE ta_r (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES2=
|
||||
DROP TABLE IF EXISTS ta_r2;
|
||||
let $CHILD2_1_CREATE_TABLES2=
|
||||
CREATE TABLE ta_r2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES2=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES3=
|
||||
DROP TABLE IF EXISTS ta_r_no_idx;
|
||||
let $CHILD2_1_CREATE_TABLES3=
|
||||
CREATE TABLE ta_r_no_idx (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10'
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES3=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_no_idx ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES4=
|
||||
DROP TABLE IF EXISTS ta_r_auto_inc;
|
||||
let $CHILD2_1_CREATE_TABLES4=
|
||||
CREATE TABLE ta_r_auto_inc (
|
||||
a INT AUTO_INCREMENT,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES4=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_auto_inc
|
||||
ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES5=
|
||||
DROP TABLE IF EXISTS ta_r_int;
|
||||
let $CHILD2_1_CREATE_TABLES5=
|
||||
CREATE TABLE ta_r_int (
|
||||
a INT AUTO_INCREMENT,
|
||||
b INT DEFAULT 10,
|
||||
c INT DEFAULT 11,
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b),
|
||||
KEY idx2(c)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES5=
|
||||
SELECT a, b, c FROM ta_r_int ORDER BY a;
|
||||
let $CHILD2_1_DROP_TABLES6=
|
||||
DROP TABLE IF EXISTS ta_r_3;
|
||||
let $CHILD2_1_CREATE_TABLES6=
|
||||
CREATE TABLE ta_r_3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TABLES6=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_3 ORDER BY a;
|
||||
let $CHILD2_1_DROP_FT_TABLES=
|
||||
DROP TABLE IF EXISTS ft_r;
|
||||
let $CHILD2_1_CREATE_FT_TABLES=
|
||||
CREATE TABLE ft_r (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET;
|
||||
let $CHILD2_1_SELECT_FT_TABLES=
|
||||
SELECT a, b, c, d FROM ft_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_FT_TABLES2=
|
||||
DROP TABLE IF EXISTS ft_r2;
|
||||
let $CHILD2_1_CREATE_FT_TABLES2=
|
||||
CREATE TABLE ft_r2 (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET;
|
||||
let $CHILD2_1_SELECT_FT_TABLES2=
|
||||
SELECT a, b, c, d FROM ft_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_GM_TABLES=
|
||||
DROP TABLE IF EXISTS gm_r;
|
||||
let $CHILD2_1_CREATE_GM_TABLES=
|
||||
CREATE TABLE gm_r (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET;
|
||||
let $CHILD2_1_SELECT_GM_TABLES=
|
||||
SELECT a, b, c FROM gm_r ORDER BY a;
|
||||
let $CHILD2_1_DROP_GM_TABLES2=
|
||||
DROP TABLE IF EXISTS gm_r2;
|
||||
let $CHILD2_1_CREATE_GM_TABLES2=
|
||||
CREATE TABLE gm_r2 (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET;
|
||||
let $CHILD2_1_SELECT_GM_TABLES2=
|
||||
SELECT a, b, c FROM gm_r2 ORDER BY a;
|
||||
let $CHILD2_1_DROP_LOCK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_1;
|
||||
let $CHILD2_1_CREATE_LOCK_TABLES1=
|
||||
CREATE TABLE t1_1 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_DROP_LOCK_TABLES2=
|
||||
DROP TABLE IF EXISTS t2_2;
|
||||
let $CHILD2_1_CREATE_LOCK_TABLES2=
|
||||
CREATE TABLE t2_2 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_DROP_INCREMENT_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_1;
|
||||
let $CHILD2_1_CREATE_INCREMENT_TABLES1=
|
||||
CREATE TABLE t1_1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_INCREMENT_TABLES1=
|
||||
SELECT id FROM t1_1 ORDER BY id;
|
||||
let $CHILD2_1_DROP_TEXT_PK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1;
|
||||
let $CHILD2_1_CREATE_TEXT_PK_TABLES1=
|
||||
CREATE TABLE t1 (
|
||||
a VARCHAR(255),
|
||||
PRIMARY KEY (a)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET2;
|
||||
let $CHILD2_1_SELECT_TEXT_PK_TABLES1=
|
||||
SELECT a FROM t1 ORDER BY a;
|
||||
let $CHILD2_1_DROP_TEXT_KEY_TABLES1=
|
||||
DROP TABLE IF EXISTS t1;
|
||||
let $CHILD2_1_CREATE_TEXT_KEY_TABLES1=
|
||||
CREATE TABLE t1 (
|
||||
a VARCHAR(255),
|
||||
b VARCHAR(255),
|
||||
c VARCHAR(255),
|
||||
KEY idx1(a,b),
|
||||
KEY idx2(b),
|
||||
PRIMARY KEY(c)
|
||||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
|
||||
let $CHILD2_1_SELECT_TEXT_KEY_TABLES1=
|
||||
SELECT a, b FROM t1 ORDER BY a, b;
|
||||
let $CHILD2_1_AUTO_INCREMENT_INCREMENT1=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 1;
|
||||
let $CHILD2_1_AUTO_INCREMENT_INCREMENT2=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 4;
|
||||
let $CHILD2_1_AUTO_INCREMENT_OFFSET1=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 1;
|
||||
let $CHILD2_1_AUTO_INCREMENT_OFFSET2=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 2;
|
||||
|
|
|
@ -1,80 +1,80 @@
|
|||
let $CHILD2_2_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r3;
|
||||
let $CHILD2_2_CREATE_TABLES=
|
||||
CREATE TABLE ta_r3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_TABLES5=
|
||||
DROP TABLE IF EXISTS ta_r_int;
|
||||
let $CHILD2_2_CREATE_TABLES5=
|
||||
CREATE TABLE ta_r_int (
|
||||
a INT AUTO_INCREMENT,
|
||||
b INT DEFAULT 10,
|
||||
c INT DEFAULT 11,
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b),
|
||||
KEY idx2(c)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_FT_TABLES=
|
||||
DROP TABLE IF EXISTS ft_r3;
|
||||
let $CHILD2_2_CREATE_FT_TABLES=
|
||||
CREATE TABLE ft_r3 (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_2_FT_ENGINE $CHILD2_2_FT_CHARSET;
|
||||
let $CHILD2_2_SELECT_FT_TABLES=
|
||||
SELECT a, b, c, d FROM ft_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_GM_TABLES=
|
||||
DROP TABLE IF EXISTS gm_r3;
|
||||
let $CHILD2_2_CREATE_GM_TABLES=
|
||||
CREATE TABLE gm_r3 (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_2_GM_ENGINE $CHILD2_2_GM_CHARSET;
|
||||
let $CHILD2_2_SELECT_GM_TABLES=
|
||||
SELECT a, b, c FROM gm_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_LOCK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_2;
|
||||
let $CHILD2_2_CREATE_LOCK_TABLES1=
|
||||
CREATE TABLE t1_2 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_LOCK_TABLES2=
|
||||
DROP TABLE IF EXISTS t2_1;
|
||||
let $CHILD2_2_CREATE_LOCK_TABLES2=
|
||||
CREATE TABLE t2_1 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_INCREMENT_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_2;
|
||||
let $CHILD2_2_CREATE_INCREMENT_TABLES1=
|
||||
CREATE TABLE t1_2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_SELECT_INCREMENT_TABLES1=
|
||||
SELECT id FROM t1_2 ORDER BY id;
|
||||
let $CHILD2_2_AUTO_INCREMENT_INCREMENT1=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 1;
|
||||
let $CHILD2_2_AUTO_INCREMENT_INCREMENT2=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 4;
|
||||
let $CHILD2_2_AUTO_INCREMENT_OFFSET1=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 1;
|
||||
let $CHILD2_2_AUTO_INCREMENT_OFFSET2=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 3;
|
||||
let $CHILD2_2_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r3;
|
||||
let $CHILD2_2_CREATE_TABLES=
|
||||
CREATE TABLE ta_r3 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_TABLES5=
|
||||
DROP TABLE IF EXISTS ta_r_int;
|
||||
let $CHILD2_2_CREATE_TABLES5=
|
||||
CREATE TABLE ta_r_int (
|
||||
a INT AUTO_INCREMENT,
|
||||
b INT DEFAULT 10,
|
||||
c INT DEFAULT 11,
|
||||
PRIMARY KEY(a),
|
||||
KEY idx1(b),
|
||||
KEY idx2(c)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_FT_TABLES=
|
||||
DROP TABLE IF EXISTS ft_r3;
|
||||
let $CHILD2_2_CREATE_FT_TABLES=
|
||||
CREATE TABLE ft_r3 (
|
||||
a INT DEFAULT 0,
|
||||
b TEXT,
|
||||
c TEXT,
|
||||
d TEXT,
|
||||
PRIMARY KEY(a),
|
||||
FULLTEXT INDEX ft_idx1(b),
|
||||
FULLTEXT INDEX ft_idx2(c)
|
||||
) $CHILD2_2_FT_ENGINE $CHILD2_2_FT_CHARSET;
|
||||
let $CHILD2_2_SELECT_FT_TABLES=
|
||||
SELECT a, b, c, d FROM ft_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_GM_TABLES=
|
||||
DROP TABLE IF EXISTS gm_r3;
|
||||
let $CHILD2_2_CREATE_GM_TABLES=
|
||||
CREATE TABLE gm_r3 (
|
||||
a INT DEFAULT 0,
|
||||
b GEOMETRY NOT NULL,
|
||||
c GEOMETRY NOT NULL,
|
||||
PRIMARY KEY(a),
|
||||
SPATIAL INDEX sp_idx1(b),
|
||||
SPATIAL INDEX sp_idx2(c)
|
||||
) $CHILD2_2_GM_ENGINE $CHILD2_2_GM_CHARSET;
|
||||
let $CHILD2_2_SELECT_GM_TABLES=
|
||||
SELECT a, b, c FROM gm_r3 ORDER BY a;
|
||||
let $CHILD2_2_DROP_LOCK_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_2;
|
||||
let $CHILD2_2_CREATE_LOCK_TABLES1=
|
||||
CREATE TABLE t1_2 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_LOCK_TABLES2=
|
||||
DROP TABLE IF EXISTS t2_1;
|
||||
let $CHILD2_2_CREATE_LOCK_TABLES2=
|
||||
CREATE TABLE t2_1 (
|
||||
id int(11) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_DROP_INCREMENT_TABLES1=
|
||||
DROP TABLE IF EXISTS t1_2;
|
||||
let $CHILD2_2_CREATE_INCREMENT_TABLES1=
|
||||
CREATE TABLE t1_2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
|
||||
let $CHILD2_2_SELECT_INCREMENT_TABLES1=
|
||||
SELECT id FROM t1_2 ORDER BY id;
|
||||
let $CHILD2_2_AUTO_INCREMENT_INCREMENT1=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 1;
|
||||
let $CHILD2_2_AUTO_INCREMENT_INCREMENT2=
|
||||
SET GLOBAL AUTO_INCREMENT_INCREMENT = 4;
|
||||
let $CHILD2_2_AUTO_INCREMENT_OFFSET1=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 1;
|
||||
let $CHILD2_2_AUTO_INCREMENT_OFFSET2=
|
||||
SET GLOBAL AUTO_INCREMENT_OFFSET = 3;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
let $CHILD2_3_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r4;
|
||||
let $CHILD2_3_CREATE_TABLES=
|
||||
CREATE TABLE ta_r4 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_3_ENGINE $CHILD2_3_CHARSET;
|
||||
let $CHILD2_3_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a;
|
||||
let $CHILD2_3_DROP_TABLES=
|
||||
DROP TABLE IF EXISTS ta_r4;
|
||||
let $CHILD2_3_CREATE_TABLES=
|
||||
CREATE TABLE ta_r4 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD2_3_ENGINE $CHILD2_3_CHARSET;
|
||||
let $CHILD2_3_SELECT_TABLES=
|
||||
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
let $SLAVE1_1_COMMENT_INCREMENT1_1=
|
||||
COMMENT '';
|
||||
let $SLAVE1_1_COMMENT_INCREMENT1_P_1=
|
||||
COMMENT ''
|
||||
PARTITION BY LIST(MOD(id, 2)) (
|
||||
PARTITION pt1 VALUES IN (0)
|
||||
COMMENT='',
|
||||
PARTITION pt2 VALUES IN (1)
|
||||
COMMENT=''
|
||||
);
|
||||
let $SLAVE1_1_COMMENT_INCREMENT1_1=
|
||||
COMMENT '';
|
||||
let $SLAVE1_1_COMMENT_INCREMENT1_P_1=
|
||||
COMMENT ''
|
||||
PARTITION BY LIST(MOD(id, 2)) (
|
||||
PARTITION pt1 VALUES IN (0)
|
||||
COMMENT='',
|
||||
PARTITION pt2 VALUES IN (1)
|
||||
COMMENT=''
|
||||
);
|
||||
|
|
|
@ -1,179 +1,179 @@
|
|||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo create table select test
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_TABLES;
|
||||
echo CHILD2_1_CREATE_TABLES;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_TABLES;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_TABLES;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE ta_l (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
|
||||
eval CREATE TABLE ta_l (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
|
||||
--enable_query_log
|
||||
INSERT INTO ta_l (a, b, c) VALUES
|
||||
(1, 'a', '2008-08-01 10:21:39'),
|
||||
(2, 'b', '2000-01-01 00:00:00'),
|
||||
(3, 'e', '2007-06-04 20:03:11'),
|
||||
(4, 'd', '2003-11-30 05:01:03'),
|
||||
(5, 'c', '2001-12-31 23:59:59');
|
||||
|
||||
--echo
|
||||
--echo direct_aggregating test
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT COUNT(*) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l WHERE a < 5;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l WHERE a > 1;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_TABLES;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo create table select test
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_TABLES;
|
||||
echo CHILD2_1_CREATE_TABLES;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_TABLES;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_TABLES;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE ta_l (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
|
||||
eval CREATE TABLE ta_l (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
|
||||
--enable_query_log
|
||||
INSERT INTO ta_l (a, b, c) VALUES
|
||||
(1, 'a', '2008-08-01 10:21:39'),
|
||||
(2, 'b', '2000-01-01 00:00:00'),
|
||||
(3, 'e', '2007-06-04 20:03:11'),
|
||||
(4, 'd', '2003-11-30 05:01:03'),
|
||||
(5, 'c', '2001-12-31 23:59:59');
|
||||
|
||||
--echo
|
||||
--echo direct_aggregating test
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT COUNT(*) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l WHERE a < 5;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l WHERE a > 1;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_TABLES;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
|
|
|
@ -1,192 +1,192 @@
|
|||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
if (!$HAVE_PARTITION)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
skip Test requires partitioning;
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo with partition test
|
||||
if ($HAVE_PARTITION)
|
||||
{
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_DROP_TABLES;
|
||||
echo CHILD2_2_CREATE_TABLES;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_2_DROP_TABLES;
|
||||
--enable_warnings
|
||||
eval $CHILD2_2_CREATE_TABLES;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_TABLES2;
|
||||
echo CHILD2_1_CREATE_TABLES2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_TABLES2;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_TABLES2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
echo CREATE TABLE ta_l2 (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
|
||||
eval CREATE TABLE ta_l2 (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
|
||||
INSERT INTO ta_l2 (a, b, c) VALUES
|
||||
(1, 'a', '2008-08-01 10:21:39'),
|
||||
(2, 'b', '2000-01-01 00:00:00'),
|
||||
(3, 'e', '2007-06-04 20:03:11'),
|
||||
(4, 'd', '2003-11-30 05:01:03'),
|
||||
(5, 'c', '2001-12-31 23:59:59');
|
||||
--enable_query_log
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT COUNT(*) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l2 WHERE a < 5;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l2 WHERE a > 1;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_2_SELECT_TABLES;
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_TABLES2;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
if (!$HAVE_PARTITION)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
skip Test requires partitioning;
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo with partition test
|
||||
if ($HAVE_PARTITION)
|
||||
{
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_DROP_TABLES;
|
||||
echo CHILD2_2_CREATE_TABLES;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_2_DROP_TABLES;
|
||||
--enable_warnings
|
||||
eval $CHILD2_2_CREATE_TABLES;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_TABLES2;
|
||||
echo CHILD2_1_CREATE_TABLES2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_TABLES2;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_TABLES2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
echo CREATE TABLE ta_l2 (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
|
||||
eval CREATE TABLE ta_l2 (
|
||||
a INT,
|
||||
b CHAR(1),
|
||||
c DATETIME,
|
||||
PRIMARY KEY(a)
|
||||
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
|
||||
INSERT INTO ta_l2 (a, b, c) VALUES
|
||||
(1, 'a', '2008-08-01 10:21:39'),
|
||||
(2, 'b', '2000-01-01 00:00:00'),
|
||||
(3, 'e', '2007-06-04 20:03:11'),
|
||||
(4, 'd', '2003-11-30 05:01:03'),
|
||||
(5, 'c', '2001-12-31 23:59:59');
|
||||
--enable_query_log
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT COUNT(*) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l2;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MAX(a) FROM ta_l2 WHERE a < 5;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
SELECT MIN(a) FROM ta_l2 WHERE a > 1;
|
||||
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_2_SELECT_TABLES;
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_TABLES2;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
let $HAVE_PARTITION= 0;
|
||||
if (`SELECT count(*) FROM information_schema.plugins WHERE
|
||||
plugin_status = 'ACTIVE' AND
|
||||
plugin_name = 'partition'`)
|
||||
{
|
||||
let $HAVE_PARTITION= 1;
|
||||
}
|
||||
let $HAVE_PARTITION= 0;
|
||||
if (`SELECT count(*) FROM information_schema.plugins WHERE
|
||||
plugin_status = 'ACTIVE' AND
|
||||
plugin_name = 'partition'`)
|
||||
{
|
||||
let $HAVE_PARTITION= 1;
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
let $HAVE_TRIGGER= `SELECT COUNT(*) FROM information_schema.tables
|
||||
WHERE TABLE_SCHEMA = 'information_schema' AND TABLE_NAME = 'TRIGGERS'`;
|
||||
let $HAVE_TRIGGER= `SELECT COUNT(*) FROM information_schema.tables
|
||||
WHERE TABLE_SCHEMA = 'information_schema' AND TABLE_NAME = 'TRIGGERS'`;
|
||||
|
|
|
@ -1,292 +1,292 @@
|
|||
# This test tests for Spider 3.0's bug fixes
|
||||
source include/have_log_bin.inc;
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--source slave_test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo 3.1
|
||||
--echo auto_increment
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1;
|
||||
echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1;
|
||||
eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
SET SESSION sql_log_bin= 1;
|
||||
--connection slave1_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
--connection master_1
|
||||
}
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
SET INSERT_ID=5000;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
INSERT INTO t1 (id) VALUES (10000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 (id) VALUES (1000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
# This test tests for Spider 3.0's bug fixes
|
||||
source include/have_log_bin.inc;
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--source slave_test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo 3.1
|
||||
--echo auto_increment
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1;
|
||||
echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1;
|
||||
eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
SET SESSION sql_log_bin= 1;
|
||||
--connection slave1_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1;
|
||||
--connection master_1
|
||||
}
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
SET INSERT_ID=5000;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
INSERT INTO t1 (id) VALUES (10000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 (id) VALUES (1000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
|
|
|
@ -1,345 +1,345 @@
|
|||
# This test tests for Spider 3.0's bug fixes
|
||||
source include/have_log_bin.inc;
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--source slave_test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
if (!$HAVE_PARTITION)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
skip Test requires partitioning;
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo auto_increment with partition
|
||||
if ($HAVE_PARTITION)
|
||||
{
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
--connection child2_2
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_2_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_2_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
SET SESSION sql_log_bin= 1;
|
||||
--connection slave1_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
--connection master_1
|
||||
}
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
SET INSERT_ID=5000;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
INSERT INTO t1 (id) VALUES (10000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 (id) VALUES (1000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
# This test tests for Spider 3.0's bug fixes
|
||||
source include/have_log_bin.inc;
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source test_init.inc
|
||||
--source slave_test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
if (!$HAVE_PARTITION)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
skip Test requires partitioning;
|
||||
}
|
||||
|
||||
--echo
|
||||
--echo drop and create databases
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
CREATE DATABASE auto_test_remote2;
|
||||
USE auto_test_remote2;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
--echo test select 1
|
||||
--connection master_1
|
||||
SELECT 1;
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
SELECT 1;
|
||||
--connection child2_2
|
||||
SELECT 1;
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo auto_increment with partition
|
||||
if ($HAVE_PARTITION)
|
||||
{
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_1_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
--connection child2_2
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_DROP_INCREMENT_TABLES1;
|
||||
echo CHILD2_2_CREATE_INCREMENT_TABLES1;
|
||||
echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
|
||||
echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
|
||||
}
|
||||
--disable_warnings
|
||||
eval $CHILD2_2_DROP_INCREMENT_TABLES1;
|
||||
--enable_warnings
|
||||
eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
--connection master_1
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
|
||||
eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
SET SESSION sql_log_bin= 1;
|
||||
--connection slave1_1
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
echo CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
echo CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
eval CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (id)
|
||||
) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
|
||||
--connection master_1
|
||||
}
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 (id) VALUES (null);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
INSERT INTO t1 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
INSERT INTO t2 () VALUES (),(),(),();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT id FROM t2 ORDER BY id;
|
||||
SET INSERT_ID=5000;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
|
||||
--enable_query_log
|
||||
INSERT INTO t1 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
--disable_query_log
|
||||
echo MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
|
||||
--enable_query_log
|
||||
INSERT INTO t2 () VALUES ();
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
INSERT INTO t1 (id) VALUES (10000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t1;
|
||||
INSERT INTO t2 (id) VALUES (1000);
|
||||
SELECT LAST_INSERT_ID();
|
||||
SELECT MAX(id) FROM t2;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
save_master_pos;
|
||||
--connection slave1_1
|
||||
sync_with_master;
|
||||
SELECT id FROM t1 ORDER BY id;
|
||||
--connection master_1
|
||||
--disable_query_log
|
||||
SET SESSION sql_log_bin= 0;
|
||||
--enable_query_log
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
}
|
||||
--connection child2_1
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
--connection child2_2
|
||||
if ($USE_GENERAL_LOG)
|
||||
{
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
|
||||
}
|
||||
eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--disable_query_log
|
||||
echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
|
||||
echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
|
||||
}
|
||||
eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
|
||||
eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
|
||||
if ($OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
}
|
||||
if (!$OUTPUT_CHILD_GROUP2)
|
||||
{
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--echo
|
||||
--echo deinit
|
||||
--disable_warnings
|
||||
--connection master_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
if ($USE_REPLICATION)
|
||||
{
|
||||
--connection slave1_1
|
||||
DROP DATABASE IF EXISTS auto_test_local;
|
||||
}
|
||||
if ($USE_CHILD_GROUP2)
|
||||
{
|
||||
--connection child2_1
|
||||
DROP DATABASE IF EXISTS auto_test_remote;
|
||||
--connection child2_2
|
||||
DROP DATABASE IF EXISTS auto_test_remote2;
|
||||
}
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source slave_test_deinit.inc
|
||||
--source test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo end of test
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
--let $TEST_ENGINE_TYPE= $CHILD2_1_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD2_1_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
--let $TEST_ENGINE_TYPE= $CHILD2_1_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD2_1_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
--let $TEST_ENGINE_TYPE= $CHILD2_2_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD2_2_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
--let $TEST_ENGINE_TYPE= $CHILD2_2_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD2_2_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
--let $TEST_ENGINE_TYPE= $CHILD2_3_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD2_3_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
--let $TEST_ENGINE_TYPE= $CHILD2_3_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD2_3_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
--let $TEST_ENGINE_TYPE= $CHILD3_1_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD3_1_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
--let $TEST_ENGINE_TYPE= $CHILD3_1_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD3_1_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
--let $TEST_ENGINE_TYPE= $CHILD3_2_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD3_2_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
--let $TEST_ENGINE_TYPE= $CHILD3_2_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD3_2_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
--let $TEST_ENGINE_TYPE= $CHILD3_3_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD3_3_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
--let $TEST_ENGINE_TYPE= $CHILD3_3_ENGINE_TYPE
|
||||
--let $INIT_TEST_ENGINE= $INIT_CHILD3_3_ENGINE
|
||||
--source ../include/deinit_engine.inc
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if ($INIT_TEST_ENGINE)
|
||||
{
|
||||
--echo Deinit $TEST_ENGINE_TYPE engine
|
||||
}
|
||||
if ($INIT_TEST_ENGINE)
|
||||
{
|
||||
--echo Deinit $TEST_ENGINE_TYPE engine
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
--source ../include/deinit_spider.inc
|
||||
--source ../include/deinit_spider.inc
|
||||
|
|
|
@ -1 +1 @@
|
|||
--source ../include/deinit_spider.inc
|
||||
--source ../include/deinit_spider.inc
|
||||
|
|
|
@ -1 +1 @@
|
|||
--source ../include/deinit_spider.inc
|
||||
--source ../include/deinit_spider.inc
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
let $CHILD2_1_HA_AS_DROP_TABLES=
|
||||
$CHILD2_1_DROP_TABLES;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES=
|
||||
$CHILD2_1_CREATE_TABLES;
|
||||
let $CHILD2_1_HA_AS_DROP_TABLES2=
|
||||
$CHILD2_1_DROP_TABLES2;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES2=
|
||||
$CHILD2_1_CREATE_TABLES2;
|
||||
let $CHILD2_1_HA_AS_DROP_TABLES=
|
||||
$CHILD2_1_DROP_TABLES;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES=
|
||||
$CHILD2_1_CREATE_TABLES;
|
||||
let $CHILD2_1_HA_AS_DROP_TABLES2=
|
||||
$CHILD2_1_DROP_TABLES2;
|
||||
let $CHILD2_1_HA_AS_CREATE_TABLES2=
|
||||
$CHILD2_1_CREATE_TABLES2;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
let $CHILD2_2_HA_DROP_TABLES=
|
||||
$CHILD2_2_DROP_TABLES;
|
||||
let $CHILD2_2_HA_CREATE_TABLES=
|
||||
$CHILD2_2_CREATE_TABLES;
|
||||
let $CHILD2_2_HA_DROP_TABLES=
|
||||
$CHILD2_2_DROP_TABLES;
|
||||
let $CHILD2_2_HA_CREATE_TABLES=
|
||||
$CHILD2_2_CREATE_TABLES;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
let $CHILD2_3_HA_DROP_TABLES=
|
||||
$CHILD2_3_DROP_TABLES;
|
||||
let $CHILD2_3_HA_CREATE_TABLES=
|
||||
$CHILD2_3_CREATE_TABLES;
|
||||
let $CHILD2_3_HA_DROP_TABLES=
|
||||
$CHILD2_3_DROP_TABLES;
|
||||
let $CHILD2_3_HA_CREATE_TABLES=
|
||||
$CHILD2_3_CREATE_TABLES;
|
||||
|
|
|
@ -1,140 +1,140 @@
|
|||
--let $CHILD3_1_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_1_ENGINE=ENGINE=Spider
|
||||
--source ../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_1_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_1_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_1_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_1_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_1_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_1_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
--let $CHILD3_1_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_1_ENGINE=ENGINE=Spider
|
||||
--source ../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_1_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_1_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_1_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_1_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_1_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_1_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_1_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_1_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_1_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
|
|
|
@ -1,140 +1,140 @@
|
|||
--let $CHILD3_2_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_2_ENGINE=ENGINE=Spider
|
||||
--source ../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_2_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_2_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_2_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_2_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_2_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_2_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
--let $CHILD3_2_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_2_ENGINE=ENGINE=Spider
|
||||
--source ../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_2_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_2_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_2_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_2_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_2_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_2_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_2_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_2_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_2_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
|
|
|
@ -1,140 +1,140 @@
|
|||
--let $CHILD3_3_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_3_ENGINE=ENGINE=Spider
|
||||
--source ../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_3_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_3_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_3_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_3_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_3_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_3_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
--let $CHILD3_3_ENGINE_TYPE=Spider
|
||||
--let $CHILD3_3_ENGINE=ENGINE=Spider
|
||||
--source ../include/init_spider.inc
|
||||
eval INSERT INTO mysql.spider_link_mon_servers
|
||||
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
|
||||
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
|
||||
ssl_verify_server_cert, default_file, default_group) VALUES
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
|
||||
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
|
||||
let $CHILD3_3_CHECK_LINK_STATUS=
|
||||
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
|
||||
ORDER BY db_name, table_name, link_id;
|
||||
let $CHILD3_3_CHECK_LINK_FAILED_LOG=
|
||||
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 2"';
|
||||
let $CHILD3_3_SET_OK_STATUS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2", lst "0 1"';
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_2_1=
|
||||
ALTER TABLE ta_l
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2", lst "1 0"';
|
||||
|
||||
let $CHILD3_3_DROP_TABLES_HA_2_1=
|
||||
DROP TABLE IF EXISTS ta_l;
|
||||
if ($VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
if (!$VERSION_COMPILE_OS_WIN)
|
||||
{
|
||||
let $CHILD3_3_CREATE_TABLES_HA_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
|
||||
CREATE TABLE ta_l (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
|
||||
CONNECTION='host "localhost", user "root", password "",
|
||||
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
|
||||
database "auto_test_remote auto_test_remote2"';
|
||||
}
|
||||
let $CHILD3_3_DROP_TABLES_HA_P_2_1=
|
||||
DROP TABLE IF EXISTS ta_l2;
|
||||
let $CHILD3_3_CREATE_TABLES_HA_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1=
|
||||
CREATE TABLE ta_l2 (
|
||||
a INT DEFAULT 10,
|
||||
b CHAR(1) DEFAULT 'c',
|
||||
c DATETIME DEFAULT '1999-10-10 10:10:10',
|
||||
PRIMARY KEY(a)
|
||||
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
|
||||
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001"'
|
||||
);
|
||||
let $CHILD3_3_SET_RECOVERY_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 2"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "0 1"'
|
||||
);
|
||||
let $CHILD3_3_SET_OK_STATUS_AS_P_2_1=
|
||||
ALTER TABLE ta_l2
|
||||
PARTITION BY KEY(a) (
|
||||
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
|
||||
priority "1000"',
|
||||
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
|
||||
priority "1000001", lst "1 0"'
|
||||
);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue