diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-08-17 11:32:16 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-08-17 11:38:34 +0200 |
commit | cb1e76e4de120d20064a96be4fcc245c3d22bd78 (patch) | |
tree | 29d130592e3dfea50251771979fbaa6923d44ba9 /storage | |
parent | a4885dde4ccec68bbb0268796f62e68e08ba4837 (diff) | |
parent | 48fe832650ae2dc0c2eaa957abfa959b0a2670aa (diff) | |
download | mariadb-git-cb1e76e4de120d20064a96be4fcc245c3d22bd78.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'storage')
172 files changed, 34543 insertions, 1079 deletions
diff --git a/storage/connect/array.cpp b/storage/connect/array.cpp index 639edf63a1a..59a53487a7e 100644 --- a/storage/connect/array.cpp +++ b/storage/connect/array.cpp @@ -520,7 +520,7 @@ bool ARRAY::FilTest(PGLOBAL g, PVAL valp, OPVAL opc, int opm) } else if (opc != OP_EXIST) { sprintf(g->Message, MSG(MISSING_ARG), opc); - throw (int)TYPE_ARRAY; + throw (int)TYPE_ARRAY; } else // OP_EXIST return Nval > 0; diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 6b7236a2f83..5e80201fccf 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -1,4 +1,5 @@ -/* Copyright (C) MariaDB Corporation Ab +/* Copyright (C) Olivier Bertrand 2004 - 2017 + Copyright (C) MariaDB Corporation Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/storage/connect/filter.cpp b/storage/connect/filter.cpp index 1ca482ca269..bb3be629ea4 100644 --- a/storage/connect/filter.cpp +++ b/storage/connect/filter.cpp @@ -87,7 +87,7 @@ BYTE OpBmp(PGLOBAL g, OPVAL opc) case OP_EXIST: bt = 0x00; break; default: sprintf(g->Message, MSG(BAD_FILTER_OP), opc); - throw (int)TYPE_ARRAY; + throw (int)TYPE_FILTER; } // endswitch opc return bt; @@ -1790,7 +1790,7 @@ PFIL PrepareFilter(PGLOBAL g, PFIL fp, bool having) break; // Remove eventual ending separator(s) // if (fp->Convert(g, having)) -// (int)throw TYPE_ARRAY; +// throw (int)TYPE_FILTER; filp = fp; fp = fp->Next; @@ -1799,8 +1799,6 @@ PFIL PrepareFilter(PGLOBAL g, PFIL fp, bool having) if (trace) htrc(" returning filp=%p\n", filp); -//if (filp) -// filp->Print(g, debug, 0); return filp; } // end of PrepareFilter diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index b73f41ff741..458369cd981 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -98,8 +98,8 @@ rnd_next signals that it has reached the end of its data. Calls to ha_connect::extra() are hints as to what will be occuring to the request. - Author Olivier Bertrand -*/ + Author Olivier Bertrand + */ #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation @@ -1070,55 +1070,55 @@ PCSZ GetListOption(PGLOBAL g, PCSZ opname, PCSZ oplist, PCSZ def) if (!oplist) return (char*)def; - char key[16], val[256]; - char *pv, *pn, *pk= (char*)oplist; - PCSZ opval= def; - int n; + char key[16], val[256]; + char *pv, *pn, *pk = (char*)oplist; + PCSZ opval = def; + int n; while (*pk == ' ') pk++; - for (; pk; pk= pn) { - pn= strchr(pk, ','); - pv= strchr(pk, '='); + for (; pk; pk = pn) { + pn = strchr(pk, ','); + pv = strchr(pk, '='); - if (pv && (!pn || pv < pn)) { + if (pv && (!pn || pv < pn)) { n = MY_MIN(static_cast<size_t>(pv - pk), sizeof(key) - 1); memcpy(key, pk, n); while (n && key[n - 1] == ' ') n--; - key[n]= 0; + key[n] = 0; - while(*(++pv) == ' ') ; + while (*(++pv) == ' '); - n= MY_MIN((pn ? pn - pv : strlen(pv)), sizeof(val) - 1); - memcpy(val, pv, n); + n = MY_MIN((pn ? pn - pv : strlen(pv)), sizeof(val) - 1); + memcpy(val, pv, n); while (n && val[n - 1] == ' ') n--; - val[n]= 0; - } else { - n= MY_MIN((pn ? pn - pk : strlen(pk)), sizeof(key) - 1); - memcpy(key, pk, n); + val[n] = 0; + } else { + n = MY_MIN((pn ? pn - pk : strlen(pk)), sizeof(key) - 1); + memcpy(key, pk, n); while (n && key[n - 1] == ' ') n--; - key[n]= 0; - val[0]= 0; - } // endif pv + key[n] = 0; + val[0] = 0; + } // endif pv - if (!stricmp(opname, key)) { - opval= PlugDup(g, val); - break; - } else if (!pn) - break; + if (!stricmp(opname, key)) { + opval = PlugDup(g, val); + break; + } else if (!pn) + break; - while (*(++pn) == ' ') ; - } // endfor pk + while (*(++pn) == ' '); + } // endfor pk return opval; } // end of GetListOption @@ -4321,8 +4321,8 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn, bool quick) } else return false; - /* check FILE_ACL */ - /* fall through */ + // check FILE_ACL + // fall through case TAB_ODBC: case TAB_JDBC: case TAB_MYSQL: diff --git a/storage/connect/jdbconn.cpp b/storage/connect/jdbconn.cpp index cfe74cabacd..9746a66e6c8 100644 --- a/storage/connect/jdbconn.cpp +++ b/storage/connect/jdbconn.cpp @@ -154,38 +154,38 @@ int TranslateJDBCType(int stp, char *tn, int prec, int& len, char& v) case 91: // DATE, YEAR type = TYPE_DATE; - if (!tn || toupper(tn[0]) != 'Y') { - len = 10; - v = 'D'; - } else { - len = 4; - v = 'Y'; - } // endif len + if (!tn || toupper(tn[0]) != 'Y') { + len = 10; + v = 'D'; + } else { + len = 4; + v = 'Y'; + } // endif len - break; - case 92: // TIME - type = TYPE_DATE; - len = 8 + ((prec) ? (prec+1) : 0); - v = 'T'; - break; - case -5: // BIGINT - type = TYPE_BIGINT; - break; - case 0: // NULL - case -2: // BINARY - case -4: // LONGVARBINARY - case 70: // DATALINK - case 2000: // JAVA_OBJECT - case 2001: // DISTINCT - case 2002: // STRUCT - case 2003: // ARRAY - case 2004: // BLOB - case 2005: // CLOB - case 2006: // REF - case 2009: // SQLXML - case 2011: // NCLOB - default: - type = TYPE_ERROR; + break; + case 92: // TIME + type = TYPE_DATE; + len = 8 + ((prec) ? (prec + 1) : 0); + v = 'T'; + break; + case -5: // BIGINT + type = TYPE_BIGINT; + break; + case 0: // NULL + case -2: // BINARY + case -4: // LONGVARBINARY + case 70: // DATALINK + case 2000: // JAVA_OBJECT + case 2001: // DISTINCT + case 2002: // STRUCT + case 2003: // ARRAY + case 2004: // BLOB + case 2005: // CLOB + case 2006: // REF + case 2009: // SQLXML + case 2011: // NCLOB + default: + type = TYPE_ERROR; len = 0; } // endswitch type diff --git a/storage/connect/json.h b/storage/connect/json.h index cf7b2b18737..fd6c029df99 100644 --- a/storage/connect/json.h +++ b/storage/connect/json.h @@ -43,6 +43,10 @@ typedef struct { int len; } STRG, *PSG; +bool IsNum(PSZ s); +char *NextChr(PSZ s, char sep); +char *GetJsonNull(void); + PJSON ParseJson(PGLOBAL g, char *s, int n, int *prty = NULL, bool *b = NULL); PJAR ParseArray(PGLOBAL g, int& i, STRG& src, bool *pty); PJOB ParseObject(PGLOBAL g, int& i, STRG& src, bool *pty); @@ -294,4 +298,3 @@ class JVALUE : public JSON { PJVAL Next; // Next value in array bool Del; // True when deleted }; // end of class JVALUE - diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index 12e511c51b2..00627669d60 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -31,13 +31,15 @@ bool IsNum(PSZ s); char *NextChr(PSZ s, char sep); char *GetJsonNull(void); uint GetJsonGrpSize(void); -static int IsJson(UDF_ARGS *args, uint i); -static PSZ MakePSZ(PGLOBAL g, UDF_ARGS *args, int i); +static int IsJson(UDF_ARGS *args, uint i); +static PSZ MakePSZ(PGLOBAL g, UDF_ARGS *args, int i); static char *handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *error); static char *bin_handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *error); +void json_array_deinit(UDF_INIT* initid); + static uint JsonGrpSize = 10; /* ----------------------------------- JSNX ------------------------------------ */ diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp index 9b160df77b8..25da3162516 100644 --- a/storage/connect/plgdbutl.cpp +++ b/storage/connect/plgdbutl.cpp @@ -95,7 +95,7 @@ extern pthread_mutex_t parmut; //#endif // !__WIN__ // The debug trace used by the main thread - FILE *pfile = NULL; +FILE *pfile = NULL; MBLOCK Nmblk = {NULL, false, 0, false, NULL}; // Used to init MBLOCK's diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp index b44705bc3cc..3b850cfd258 100644 --- a/storage/connect/tabdos.cpp +++ b/storage/connect/tabdos.cpp @@ -1311,7 +1311,7 @@ PBF TDBDOS::InitBlockFilter(PGLOBAL g, PFIL filp) } // endif !opm // if opm, pass thru - /* fall through */ + // fall through case OP_IN: if (filp->GetArgType(0) == TYPE_COLBLK && filp->GetArgType(1) == TYPE_ARRAY) { @@ -1647,8 +1647,8 @@ int TDBDOS::TestBlock(PGLOBAL g) /***********************************************************************/ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) { - int k, n, rc = RC_OK; - bool fixed, doit, sep, b = (pxdf != NULL); + int k, n, rc = RC_OK; + bool fixed, doit, sep, b = (pxdf != NULL); PCOL *keycols, colp; PIXDEF xdp, sxp = NULL; PKPDEF kdp; @@ -1694,8 +1694,8 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) try { // Allocate all columns that will be used by indexes. - // This must be done before opening the table so specific - // column initialization can be done (in particular by TDBVCT) + // This must be done before opening the table so specific + // column initialization can be done (in particular by TDBVCT) for (n = 0, xdp = pxdf; xdp; xdp = xdp->GetNext()) for (kdp = xdp->GetToKeyParts(); kdp; kdp = kdp->GetNext()) { if (!(colp = ColDB(g, kdp->GetName(), 0))) { diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index 56e5e72efd6..8ffa234ba5c 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -289,7 +289,7 @@ void TDBODBC::SetFile(PGLOBAL g, PCSZ fn) sprintf(Connect, MulConn, fn); } // endif MultConn - DBQ = (PSZ)fn; + DBQ = PlugDup(g, fn); } // end of SetFile /***********************************************************************/ diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 6402f48e090..c09386451ff 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -1319,7 +1319,7 @@ void TDBXML::CloseDB(PGLOBAL g) Docp->CloseDoc(g, To_Xb); // This causes a crash in Diagnostics_area::set_error_status -// throw (int)TYPE_AM_XML; +// throw (int)TYPE_AM_XML; } // endif DumpDoc } // endif Changed diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index d709c20218a..60d1c2f459c 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -1656,35 +1656,36 @@ bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) int i; for (i = 0; i < np; i++) - if (vp[i]->IsNull()) - return false; - else - p[i] = vp[i]->GetCharString(val[i]); + p[i] = vp[i]->IsNull() ? NULL : vp[i]->GetCharString(val[i]); - switch (op) { - case OP_CNC: - assert(np == 1 || np == 2); + if (p[i-1]) { + switch (op) { + case OP_CNC: + assert(np == 1 || np == 2); - if (np == 2) - SetValue_psz(p[0]); + if (np == 2) + SetValue_psz(p[0]); - if ((i = Len - (signed)strlen(Strp)) > 0) - strncat(Strp, p[np - 1], i); + if ((i = Len - (signed)strlen(Strp)) > 0) + strncat(Strp, p[np - 1], i); - break; - case OP_MIN: - assert(np == 2); - SetValue_psz((strcmp(p[0], p[1]) < 0) ? p[0] : p[1]); - break; - case OP_MAX: - assert(np == 2); - SetValue_psz((strcmp(p[0], p[1]) > 0) ? p[0] : p[1]); - break; - default: - // sprintf(g->Message, MSG(BAD_EXP_OPER), op); - strcpy(g->Message, "Function not supported"); - return true; - } // endswitch op + break; + case OP_MIN: + assert(np == 2); + SetValue_psz((strcmp(p[0], p[1]) < 0) ? p[0] : p[1]); + break; + case OP_MAX: + assert(np == 2); + SetValue_psz((strcmp(p[0], p[1]) > 0) ? p[0] : p[1]); + break; + default: + // sprintf(g->Message, MSG(BAD_EXP_OPER), op); + strcpy(g->Message, "Function not supported"); + return true; + } // endswitch op + + Null = false; + } // endif p[i] Null = false; return false; diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index ef48665d92a..8e8b39df2b2 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -1421,6 +1421,7 @@ bool ha_federated::create_where_from_key(String *to, } break; } + /* fall through */ case HA_READ_KEY_OR_NEXT: DBUG_PRINT("info", ("federated HA_READ_KEY_OR_NEXT %d", i)); if (emit_key_part_name(&tmp, key_part) || @@ -1440,6 +1441,7 @@ bool ha_federated::create_where_from_key(String *to, goto err; break; } + /* fall through */ case HA_READ_KEY_OR_PREV: DBUG_PRINT("info", ("federated HA_READ_KEY_OR_PREV %d", i)); if (emit_key_part_name(&tmp, key_part) || diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc index 8f027e1b5e0..54059c0ecff 100644 --- a/storage/federatedx/federatedx_io_mysql.cc +++ b/storage/federatedx/federatedx_io_mysql.cc @@ -120,6 +120,7 @@ public: void *ref); virtual int seek_position(FEDERATEDX_IO_RESULT **io_result, const void *ref); + virtual void set_thd(void *thd); }; @@ -648,3 +649,7 @@ int federatedx_io_mysql::seek_position(FEDERATEDX_IO_RESULT **io_result, return 0; } +void federatedx_io_mysql::set_thd(void *thd) +{ + mysql.net.thd= thd; +} diff --git a/storage/federatedx/federatedx_txn.cc b/storage/federatedx/federatedx_txn.cc index 232ac335dfc..220896cc2a4 100644 --- a/storage/federatedx/federatedx_txn.cc +++ b/storage/federatedx/federatedx_txn.cc @@ -93,8 +93,8 @@ void federatedx_txn::close(FEDERATEDX_SERVER *server) } -int federatedx_txn::acquire(FEDERATEDX_SHARE *share, bool readonly, - federatedx_io **ioptr) +int federatedx_txn::acquire(FEDERATEDX_SHARE *share, void *thd, + bool readonly, federatedx_io **ioptr) { federatedx_io *io; FEDERATEDX_SERVER *server= share->s; @@ -131,6 +131,7 @@ int federatedx_txn::acquire(FEDERATEDX_SHARE *share, bool readonly, io->busy= TRUE; io->owner_ptr= ioptr; + io->set_thd(thd); } DBUG_ASSERT(io->busy && io->server == server); @@ -157,7 +158,10 @@ void federatedx_txn::release(federatedx_io **ioptr) io->active, io->is_autocommit())); if (io->is_autocommit()) + { + io->set_thd(NULL); io->active= FALSE; + } } release_scan(); diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index e3506e1a4df..ed97c08ddf7 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -1340,6 +1340,7 @@ bool ha_federatedx::create_where_from_key(String *to, } break; } + /* fall through */ case HA_READ_KEY_OR_NEXT: DBUG_PRINT("info", ("federatedx HA_READ_KEY_OR_NEXT %d", i)); if (emit_key_part_name(&tmp, key_part) || @@ -1359,6 +1360,7 @@ bool ha_federatedx::create_where_from_key(String *to, goto err; break; } + /* fall through */ case HA_READ_KEY_OR_PREV: DBUG_PRINT("info", ("federatedx HA_READ_KEY_OR_PREV %d", i)); if (emit_key_part_name(&tmp, key_part) || @@ -1760,7 +1762,7 @@ int ha_federatedx::open(const char *name, int mode, uint test_if_locked) txn= get_txn(thd); - if ((error= txn->acquire(share, TRUE, &io))) + if ((error= txn->acquire(share, thd, TRUE, &io))) { free_share(txn, share); DBUG_RETURN(error); @@ -2045,7 +2047,7 @@ int ha_federatedx::write_row(uchar *buf) /* we always want to append this, even if there aren't any fields */ values_string.append(STRING_WITH_LEN(") ")); - if ((error= txn->acquire(share, FALSE, &io))) + if ((error= txn->acquire(share, ha_thd(), FALSE, &io))) DBUG_RETURN(error); if (use_bulk_insert) @@ -2134,7 +2136,7 @@ void ha_federatedx::start_bulk_insert(ha_rows rows, uint flags) Make sure we have an open connection so that we know the maximum packet size. */ - if (txn->acquire(share, FALSE, &io)) + if (txn->acquire(share, ha_thd(), FALSE, &io)) DBUG_VOID_RETURN; page_size= (uint) my_getpagesize(); @@ -2165,7 +2167,7 @@ int ha_federatedx::end_bulk_insert() if (bulk_insert.str && bulk_insert.length && !table_will_be_deleted) { - if ((error= txn->acquire(share, FALSE, &io))) + if ((error= txn->acquire(share, ha_thd(), FALSE, &io))) DBUG_RETURN(error); if (io->query(bulk_insert.str, bulk_insert.length)) error= stash_remote_error(); @@ -2217,7 +2219,7 @@ int ha_federatedx::optimize(THD* thd, HA_CHECK_OPT* check_opt) DBUG_ASSERT(txn == get_txn(thd)); - if ((error= txn->acquire(share, FALSE, &io))) + if ((error= txn->acquire(share, thd, FALSE, &io))) DBUG_RETURN(error); if (io->query(query.ptr(), query.length())) @@ -2249,7 +2251,7 @@ int ha_federatedx::repair(THD* thd, HA_CHECK_OPT* check_opt) DBUG_ASSERT(txn == get_txn(thd)); - if ((error= txn->acquire(share, FALSE, &io))) + if ((error= txn->acquire(share, thd, FALSE, &io))) DBUG_RETURN(error); if (io->query(query.ptr(), query.length())) @@ -2408,7 +2410,7 @@ int ha_federatedx::update_row(const uchar *old_data, uchar *new_data) if (!has_a_primary_key) update_string.append(STRING_WITH_LEN(" LIMIT 1")); - if ((error= txn->acquire(share, FALSE, &io))) + if ((error= txn->acquire(share, ha_thd(), FALSE, &io))) DBUG_RETURN(error); if (io->query(update_string.ptr(), update_string.length())) @@ -2486,7 +2488,7 @@ int ha_federatedx::delete_row(const uchar *buf) DBUG_PRINT("info", ("Delete sql: %s", delete_string.c_ptr_quick())); - if ((error= txn->acquire(share, FALSE, &io))) + if ((error= txn->acquire(share, ha_thd(), FALSE, &io))) DBUG_RETURN(error); if (io->query(delete_string.ptr(), delete_string.length())) @@ -2595,7 +2597,7 @@ int ha_federatedx::index_read_idx_with_result_set(uchar *buf, uint index, NULL, 0, 0); sql_query.append(index_string); - if ((retval= txn->acquire(share, TRUE, &io))) + if ((retval= txn->acquire(share, ha_thd(), TRUE, &io))) DBUG_RETURN(retval); if (io->query(sql_query.ptr(), sql_query.length())) @@ -2675,7 +2677,7 @@ int ha_federatedx::read_range_first(const key_range *start_key, &table->key_info[active_index], start_key, end_key, 0, eq_range_arg); - if ((retval= txn->acquire(share, TRUE, &io))) + if ((retval= txn->acquire(share, ha_thd(), TRUE, &io))) DBUG_RETURN(retval); if (stored_result) @@ -2775,7 +2777,7 @@ int ha_federatedx::rnd_init(bool scan) { int error; - if ((error= txn->acquire(share, TRUE, &io))) + if ((error= txn->acquire(share, ha_thd(), TRUE, &io))) DBUG_RETURN(error); if (stored_result) @@ -2822,7 +2824,7 @@ int ha_federatedx::free_result() else { federatedx_io *tmp_io= 0, **iop; - if (!*(iop= &io) && (error= txn->acquire(share, TRUE, (iop= &tmp_io)))) + if (!*(iop= &io) && (error= txn->acquire(share, ha_thd(), TRUE, (iop= &tmp_io)))) { DBUG_ASSERT(0); // Fail when testing insert_dynamic(&results, (uchar*) &stored_result); @@ -2902,7 +2904,7 @@ int ha_federatedx::read_next(uchar *buf, FEDERATEDX_IO_RESULT *result) FEDERATEDX_IO_ROW *row; DBUG_ENTER("ha_federatedx::read_next"); - if ((retval= txn->acquire(share, TRUE, &io))) + if ((retval= txn->acquire(share, ha_thd(), TRUE, &io))) DBUG_RETURN(retval); /* Fetch a row, insert it back in a row format. */ @@ -2947,7 +2949,7 @@ void ha_federatedx::position(const uchar *record __attribute__ ((unused))) DBUG_VOID_RETURN; } - if (txn->acquire(share, TRUE, &io)) + if (txn->acquire(share, ha_thd(), TRUE, &io)) DBUG_VOID_RETURN; io->mark_position(stored_result, ref); @@ -2976,7 +2978,7 @@ int ha_federatedx::rnd_pos(uchar *buf, uchar *pos) /* We have to move this to 'ref' to get things aligned */ bmove(ref, pos, ref_length); - if ((retval= txn->acquire(share, TRUE, &io))) + if ((retval= txn->acquire(share, ha_thd(), TRUE, &io))) goto error; if ((retval= io->seek_position(&result, ref))) @@ -3050,7 +3052,7 @@ int ha_federatedx::info(uint flag) /* we want not to show table status if not needed to do so */ if (flag & (HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO)) { - if (!*(iop= &io) && (error_code= tmp_txn->acquire(share, TRUE, (iop= &tmp_io)))) + if (!*(iop= &io) && (error_code= tmp_txn->acquire(share, thd, TRUE, (iop= &tmp_io)))) goto fail; } @@ -3151,6 +3153,7 @@ int ha_federatedx::extra(ha_extra_function operation) int ha_federatedx::reset(void) { + THD *thd= ha_thd(); int error = 0; insert_dup_update= FALSE; @@ -3168,9 +3171,9 @@ int ha_federatedx::reset(void) federatedx_io *tmp_io= 0, **iop; // external_lock may not have been called so txn may not be set - tmp_txn= get_txn(ha_thd()); + tmp_txn= get_txn(thd); - if (!*(iop= &io) && (error= tmp_txn->acquire(share, TRUE, (iop= &tmp_io)))) + if (!*(iop= &io) && (error= tmp_txn->acquire(share, thd, TRUE, (iop= &tmp_io)))) { DBUG_ASSERT(0); // Fail when testing return error; @@ -3204,6 +3207,7 @@ int ha_federatedx::reset(void) int ha_federatedx::delete_all_rows() { + THD *thd= ha_thd(); char query_buffer[FEDERATEDX_QUERY_BUFFER_SIZE]; String query(query_buffer, sizeof(query_buffer), &my_charset_bin); int error; @@ -3217,14 +3221,14 @@ int ha_federatedx::delete_all_rows() ident_quote_char); /* no need for savepoint in autocommit mode */ - if (!(ha_thd()->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) + if (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) txn->stmt_autocommit(); /* TRUNCATE won't return anything in mysql_affected_rows */ - if ((error= txn->acquire(share, FALSE, &io))) + if ((error= txn->acquire(share, thd, FALSE, &io))) DBUG_RETURN(error); if (io->query(query.ptr(), query.length())) @@ -3369,7 +3373,7 @@ int ha_federatedx::create(const char *name, TABLE *table_arg, if (tmp_share.s) { tmp_txn= get_txn(thd); - if (!(retval= tmp_txn->acquire(&tmp_share, TRUE, &tmp_io))) + if (!(retval= tmp_txn->acquire(&tmp_share, thd, TRUE, &tmp_io))) { retval= test_connection(thd, tmp_io, &tmp_share); tmp_txn->release(&tmp_io); @@ -3466,7 +3470,7 @@ int ha_federatedx::external_lock(MYSQL_THD thd, int lock_type) { table_will_be_deleted = FALSE; txn= get_txn(thd); - if (!(error= txn->acquire(share, lock_type == F_RDLCK, &io)) && + if (!(error= txn->acquire(share, ha_thd(), lock_type == F_RDLCK, &io)) && (lock_type == F_WRLCK || !io->is_autocommit())) { if (!thd_test_options(thd, (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h index f8531014ee4..abf25abe0c5 100644 --- a/storage/federatedx/ha_federatedx.h +++ b/storage/federatedx/ha_federatedx.h @@ -215,6 +215,7 @@ public: void *ref)=0; virtual int seek_position(FEDERATEDX_IO_RESULT **io_result, const void *ref)=0; + virtual void set_thd(void *thd) { } }; @@ -233,7 +234,7 @@ public: bool has_connections() const { return txn_list != NULL; } bool in_transaction() const { return savepoint_next != 0; } - int acquire(FEDERATEDX_SHARE *share, bool readonly, federatedx_io **io); + int acquire(FEDERATEDX_SHARE *share, void *thd, bool readonly, federatedx_io **io); void release(federatedx_io **io); void close(FEDERATEDX_SERVER *); diff --git a/storage/heap/hp_extra.c b/storage/heap/hp_extra.c index c83efd5af61..9a19f818d3b 100644 --- a/storage/heap/hp_extra.c +++ b/storage/heap/hp_extra.c @@ -34,6 +34,7 @@ int heap_extra(register HP_INFO *info, enum ha_extra_function function) switch (function) { case HA_EXTRA_RESET_STATE: heap_reset(info); + /* fall through */ case HA_EXTRA_NO_READCHECK: info->opt_flag&= ~READ_CHECK_USED; /* No readcheck */ break; diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 7bdd03c8a9e..e740370d2f0 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -3901,8 +3901,10 @@ any_extern: } /* We limit max record size to 16k even for 64k page size. */ - if (new_rec_size >= REC_MAX_DATA_SIZE) { - err = DB_OVERFLOW; + if (new_rec_size >= COMPRESSED_REC_MAX_DATA_SIZE || + (!dict_table_is_comp(index->table) + && new_rec_size >= REDUNDANT_REC_MAX_DATA_SIZE)) { + err = DB_OVERFLOW; goto func_exit; } diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index 8db1878b4ef..1c28a39a62e 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -104,6 +104,7 @@ dict_create_sys_tables_tuple( | ((table->flags & DICT_TF_COMPACT) << 31)); dfield_set_data(dfield, ptr, 4); + /* 5: TYPE (table flags) -----------------------------*/ dfield = dtuple_get_nth_field( entry, DICT_COL__SYS_TABLES__TYPE); diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index f54428b4fe6..0da37c8d6f5 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -1375,9 +1375,6 @@ dict_table_add_to_cache( } ut_ad(dict_lru_validate()); - - dict_sys->size += mem_heap_get_size(table->heap) - + strlen(table->name.m_name) + 1; } /**********************************************************************//** @@ -1756,9 +1753,6 @@ dict_table_rename_in_cache( HASH_INSERT(dict_table_t, name_hash, dict_sys->table_hash, fold, table); - dict_sys->size += strlen(new_name) - strlen(old_name); - ut_a(dict_sys->size > 0); - /* Update the table_name field in indexes */ for (index = dict_table_get_first_index(table); index != NULL; @@ -2049,7 +2043,6 @@ dict_table_remove_from_cache_low( { dict_foreign_t* foreign; dict_index_t* index; - lint size; ut_ad(table); ut_ad(dict_lru_validate()); @@ -2130,12 +2123,6 @@ dict_table_remove_from_cache_low( UT_DELETE(table->vc_templ); } - size = mem_heap_get_size(table->heap) + strlen(table->name.m_name) + 1; - - ut_ad(dict_sys->size >= size); - - dict_sys->size -= size; - dict_mem_table_free(table); } @@ -2330,9 +2317,10 @@ dict_index_too_big_for_tree( page(16k for 64k page size). No additional sparse page directory entry will be generated for the first few user records. */ - page_rec_max = srv_page_size == UNIV_PAGE_SIZE_MAX - ? REC_MAX_DATA_SIZE - 1 - : page_get_free_space_of_empty(comp) / 2; + page_rec_max = (comp || srv_page_size < UNIV_PAGE_SIZE_MAX) + ? page_get_free_space_of_empty(comp) / 2 + : REDUNDANT_REC_MAX_DATA_SIZE; + page_ptr_max = page_rec_max; /* Each record has a header. */ rec_max_size = comp @@ -2609,8 +2597,6 @@ dict_index_add_to_cache_w_vcol( rw_lock_create(index_tree_rw_lock_key, &new_index->lock, SYNC_INDEX_TREE); - dict_sys->size += mem_heap_get_size(new_index->heap); - dict_mem_index_free(index); return(DB_SUCCESS); @@ -2627,8 +2613,6 @@ dict_index_remove_from_cache_low( ibool lru_evict) /*!< in: TRUE if index being evicted to make room in the table LRU list */ { - lint size; - ut_ad(table && index); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); @@ -2729,12 +2713,6 @@ dict_index_remove_from_cache_low( } } - size = mem_heap_get_size(index->heap); - - ut_ad(dict_sys->size >= size); - - dict_sys->size -= size; - dict_mem_index_free(index); } @@ -6871,8 +6849,6 @@ dict_close(void) mutex_free(&dict_foreign_err_mutex); - ut_ad(dict_sys->size == 0); - ut_free(dict_sys); dict_sys = NULL; @@ -7245,6 +7221,41 @@ dict_tf_to_row_format_string( return(0); } +/** Calculate the used memory occupied by the data dictionary +table and index objects. +@return number of bytes occupied. */ +UNIV_INTERN +ulint +dict_sys_get_size() +{ + ulint size = 0; + + ut_ad(dict_sys); + + mutex_enter(&dict_sys->mutex); + + for(ulint i = 0; i < hash_get_n_cells(dict_sys->table_hash); i++) { + dict_table_t* table; + + for (table = static_cast<dict_table_t*>(HASH_GET_FIRST(dict_sys->table_hash,i)); + table != NULL; + table = static_cast<dict_table_t*>(HASH_GET_NEXT(name_hash, table))) { + dict_index_t* index; + size += mem_heap_get_size(table->heap) + strlen(table->name.m_name) +1; + + for(index = dict_table_get_first_index(table); + index != NULL; + index = dict_table_get_next_index(index)) { + size += mem_heap_get_size(index->heap); + } + } + } + + mutex_exit(&dict_sys->mutex); + + return (size); +} + /** Look for any dictionary objects that are found in the given tablespace. @param[in] space_id Tablespace ID to search for. @return true if tablespace is empty. */ diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 3dc95b1956a..c8b5f2d7c90 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -3532,17 +3532,12 @@ dict_load_foreign( here. The child table will be loaded later, along with its foreign key constraint. */ - lint old_size = mem_heap_get_size(ref_table->heap); - ut_a(ref_table != NULL); fk_tables.push_back( mem_heap_strdupl(ref_table->heap, foreign->foreign_table_name_lookup, foreign_table_name_len)); - lint new_size = mem_heap_get_size(ref_table->heap); - dict_sys->size += new_size - old_size; - dict_foreign_remove_from_cache(foreign); DBUG_RETURN(DB_SUCCESS); } diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 6e431a6ee0f..366b9ef74ce 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -93,13 +93,20 @@ static ib_mutex_t crypt_stat_mutex; extern my_bool srv_background_scrub_data_uncompressed; extern my_bool srv_background_scrub_data_compressed; +/*********************************************************************** +Check if a key needs rotation given a key_state +@param[in] encrypt_mode Encryption mode +@param[in] key_version Current key version +@param[in] latest_key_version Latest key version +@param[in] rotate_key_age when to rotate +@return true if key needs rotation, false if not */ static bool fil_crypt_needs_rotation( - fil_encryption_t encrypt_mode, /*!< in: Encryption - mode */ - uint key_version, /*!< in: Key version */ - uint latest_key_version, /*!< in: Latest key version */ - uint rotate_key_age); /*!< in: When to rotate */ + fil_encryption_t encrypt_mode, + uint key_version, + uint latest_key_version, + uint rotate_key_age) + MY_ATTRIBUTE((warn_unused_result)); /********************************************************************* Init space crypt */ @@ -2375,7 +2382,10 @@ fil_space_crypt_close_tablespace( ib::warn() << "Waited " << now - start << " seconds to drop space: " - << space->name << "."; + << space->name << " (" + << space->id << ") active threads " + << cnt << "flushing=" + << flushing << "."; last = now; } } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index c2b085b2c04..79d0c7543b0 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2167,15 +2167,21 @@ convert_error_code_to_mysql( locally for BLOB fields. Refer to dict_table_get_format(). We limit max record size to 16k for 64k page size. */ bool prefix = (dict_tf_get_format(flags) == UNIV_FORMAT_A); + bool comp = !!(flags & DICT_TF_COMPACT); + ulint free_space = page_get_free_space_of_empty(comp) / 2; + + if (free_space >= (comp ? COMPRESSED_REC_MAX_DATA_SIZE : + REDUNDANT_REC_MAX_DATA_SIZE)) { + free_space = (comp ? COMPRESSED_REC_MAX_DATA_SIZE : + REDUNDANT_REC_MAX_DATA_SIZE) - 1; + } + my_printf_error(ER_TOO_BIG_ROWSIZE, - "Row size too large (> %lu). Changing some columns" - " to TEXT or BLOB %smay help. In current row" - " format, BLOB prefix of %d bytes is stored inline.", + "Row size too large (> " ULINTPF "). Changing some columns " + "to TEXT or BLOB %smay help. In current row " + "format, BLOB prefix of %d bytes is stored inline.", MYF(0), - srv_page_size == UNIV_PAGE_SIZE_MAX - ? REC_MAX_DATA_SIZE - 1 - : page_get_free_space_of_empty(flags & - DICT_TF_COMPACT) / 2, + free_space, prefix ? "or using ROW_FORMAT=DYNAMIC or" " ROW_FORMAT=COMPRESSED " diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 8a781963cec..6f87e0cf2f0 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -170,6 +170,10 @@ public: int index_last(uchar * buf); + /* Copy a cached MySQL row. If requested, also avoids + overwriting non-read columns. */ + void copy_cached_row(uchar *to_rec, const uchar *from_rec, + uint rec_length); int rnd_init(bool scan); int rnd_end(); diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 22db204faa2..ba4a4a2154f 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -320,14 +320,22 @@ my_error_innodb( case DB_CORRUPTION: my_error(ER_NOT_KEYFILE, MYF(0), table); break; - case DB_TOO_BIG_RECORD: - /* We limit max record size to 16k for 64k page size. */ - my_error(ER_TOO_BIG_ROWSIZE, MYF(0), - srv_page_size == UNIV_PAGE_SIZE_MAX - ? REC_MAX_DATA_SIZE - 1 - : page_get_free_space_of_empty( - flags & DICT_TF_COMPACT) / 2); + case DB_TOO_BIG_RECORD: { + /* Note that in page0zip.ic page_zip_rec_needs_ext() rec_size + is limited to COMPRESSED_REC_MAX_DATA_SIZE (16K) or + REDUNDANT_REC_MAX_DATA_SIZE (16K-1). */ + bool comp = !!(flags & DICT_TF_COMPACT); + ulint free_space = page_get_free_space_of_empty(comp) / 2; + + if (free_space >= (comp ? COMPRESSED_REC_MAX_DATA_SIZE : + REDUNDANT_REC_MAX_DATA_SIZE)) { + free_space = (comp ? COMPRESSED_REC_MAX_DATA_SIZE : + REDUNDANT_REC_MAX_DATA_SIZE) - 1; + } + + my_error(ER_TOO_BIG_ROWSIZE, MYF(0), free_space); break; + } case DB_INVALID_NULL: /* TODO: report the row, as we do for DB_DUPLICATE_KEY */ my_error(ER_INVALID_USE_OF_NULL, MYF(0)); @@ -3293,8 +3301,8 @@ innobase_pk_col_prefix_compare( ulint new_prefix_len, ulint old_prefix_len) { - ut_ad(new_prefix_len < REC_MAX_DATA_SIZE); - ut_ad(old_prefix_len < REC_MAX_DATA_SIZE); + ut_ad(new_prefix_len < COMPRESSED_REC_MAX_DATA_SIZE); + ut_ad(old_prefix_len < COMPRESSED_REC_MAX_DATA_SIZE); if (new_prefix_len == old_prefix_len) { return(0); diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index f80047f29a9..8836e858018 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -1730,9 +1730,6 @@ struct dict_sys_t{ on name */ hash_table_t* table_id_hash; /*!< hash table of the tables, based on id */ - lint size; /*!< varying space in bytes occupied - by the data dictionary table and - index objects */ dict_table_t* sys_tables; /*!< SYS_TABLES table */ dict_table_t* sys_columns; /*!< SYS_COLUMNS table */ dict_table_t* sys_indexes; /*!< SYS_INDEXES table */ @@ -2032,6 +2029,13 @@ dict_table_decode_n_col( ulint* n_col, ulint* n_v_col); +/** Calculate the used memory occupied by the data dictionary +table and index objects. +@return number of bytes occupied. */ +UNIV_INTERN +ulint +dict_sys_get_size(); + /** Look for any dictionary objects that are found in the given tablespace. @param[in] space_id Tablespace ID to search for. @return true if tablespace is empty. */ diff --git a/storage/innobase/include/page0zip.ic b/storage/innobase/include/page0zip.ic index fa03279f9bc..b471e2cf64e 100644 --- a/storage/innobase/include/page0zip.ic +++ b/storage/innobase/include/page0zip.ic @@ -168,8 +168,9 @@ page_zip_rec_needs_ext( > ulint(comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES)); ut_ad(comp || !page_size.is_compressed()); -#if UNIV_PAGE_SIZE_MAX > REC_MAX_DATA_SIZE - if (rec_size >= REC_MAX_DATA_SIZE) { +#if UNIV_PAGE_SIZE_MAX > COMPRESSED_REC_MAX_DATA_SIZE + if (comp ? rec_size >= COMPRESSED_REC_MAX_DATA_SIZE : + rec_size >= REDUNDANT_REC_MAX_DATA_SIZE) { return(TRUE); } #endif diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h index 8d3f87450f8..a5e3268b7d7 100644 --- a/storage/innobase/include/rem0rec.h +++ b/storage/innobase/include/rem0rec.h @@ -1099,9 +1099,15 @@ are given in one byte (resp. two byte) format. */ #define REC_1BYTE_OFFS_LIMIT 0x7FUL #define REC_2BYTE_OFFS_LIMIT 0x7FFFUL -/* The data size of record must be smaller than this because we reserve -two upmost bits in a two byte offset for special purposes */ -#define REC_MAX_DATA_SIZE 16384 +/* The data size of record must not be larger than this on +REDUNDANT row format because we reserve two upmost bits in a +two byte offset for special purposes */ +#define REDUNDANT_REC_MAX_DATA_SIZE (16383) + +/* The data size of record must be smaller than this on +COMPRESSED row format because we reserve two upmost bits in a +two byte offset for special purposes */ +#define COMPRESSED_REC_MAX_DATA_SIZE (16384) #ifdef WITH_WSREP int wsrep_rec_get_foreign_key( diff --git a/storage/innobase/include/row0sel.h b/storage/innobase/include/row0sel.h index d4d55601bc2..d73c186b12e 100644 --- a/storage/innobase/include/row0sel.h +++ b/storage/innobase/include/row0sel.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2017, Oracle and/or its affiliates. Copyright (c) 2017, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -244,6 +244,18 @@ struct sel_buf_t{ when data != NULL */ }; +/** Copy used fields from cached row. +Copy cache record field by field, don't touch fields that +are not covered by current key. +@param[out] buf Where to copy the MySQL row. +@param[in] cached_rec What to copy (in MySQL row format). +@param[in] prebuilt prebuilt struct. */ +void +row_sel_copy_cached_fields_for_mysql( + byte* buf, + const byte* cached_rec, + row_prebuilt_t* prebuilt); + /** Query plan */ struct plan_t{ dict_table_t* table; /*!< table struct in the dictionary diff --git a/storage/innobase/innodb.cmake b/storage/innobase/innodb.cmake index fe2d537c50e..d916d8b4160 100644 --- a/storage/innobase/innodb.cmake +++ b/storage/innobase/innodb.cmake @@ -156,9 +156,9 @@ IF(HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE) ENDIF() IF(NOT MSVC) - # workaround for gcc 4.1.2 RHEL5/x86, gcc atomic ops only work under -march=i686 + # workaround for old gcc on x86, gcc atomic ops only work under -march=i686 IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND - CMAKE_C_COMPILER_VERSION VERSION_LESS "4.1.3") + CMAKE_C_COMPILER_VERSION VERSION_LESS "4.4.0") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686") ENDIF() diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index de1f35a876e..a6bf77835c9 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1989,6 +1989,8 @@ row_merge_read_clustered_index( row_ext_t* ext; page_cur_t* cur = btr_pcur_get_page_cur(&pcur); + mem_heap_empty(row_heap); + /* Do not continue if table pages are still encrypted */ if (!old_table->is_readable() || !new_table->is_readable()) { diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index d71fa902e3b..e4503cfdd4e 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2015, 2017, MariaDB Corporation. @@ -2779,28 +2779,14 @@ Stores a non-SQL-NULL field in the MySQL format. The counterpart of this function is row_mysql_store_col_in_innobase_format() in row0mysql.cc. */ void row_sel_field_store_in_mysql_format_func( -/*=====================================*/ - byte* dest, /*!< in/out: buffer where to store; NOTE - that BLOBs are not in themselves - stored here: the caller must allocate - and copy the BLOB into buffer before, - and pass the pointer to the BLOB in - 'data' */ + byte* dest, const mysql_row_templ_t* templ, - /*!< in: MySQL column template. - Its following fields are referenced: - type, is_unsigned, mysql_col_len, - mbminlen, mbmaxlen */ #ifdef UNIV_DEBUG const dict_index_t* index, - /*!< in: InnoDB index */ ulint field_no, - /*!< in: templ->rec_field_no or - templ->clust_rec_field_no or - templ->icp_rec_field_no */ #endif /* UNIV_DEBUG */ - const byte* data, /*!< in: data to store */ - ulint len) /*!< in: length of the data */ + const byte* data, + ulint len) { byte* ptr; #ifdef UNIV_DEBUG diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 2894be6b12c..c7162144be4 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1363,7 +1363,7 @@ srv_printf_innodb_monitor( "Total large memory allocated " ULINTPF "\n" "Dictionary memory allocated " ULINTPF "\n", os_total_large_mem_allocated, - dict_sys->size); + dict_sys_get_size()); buf_print_io(file); diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 84fba63a2f3..2b27207e601 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -4261,6 +4261,8 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info, } */ DBUG_PRINT("info", ("is quick repair: %d", (int) rep_quick)); + if (!rep_quick) + my_b_clear(&new_data_cache); /* Initialize pthread structures before goto err. */ mysql_mutex_init(key_SORT_INFO_mutex, &sort_info.mutex, MY_MUTEX_INIT_FAST); @@ -4626,7 +4628,7 @@ err: already or they were not yet started (if the error happend before creating the threads). */ - if (!rep_quick) + if (!rep_quick && my_b_inited(&new_data_cache)) end_io_cache(&new_data_cache); if (!got_error) { diff --git a/storage/maria/ma_key_recover.c b/storage/maria/ma_key_recover.c index 8b6342b76b5..610810756f2 100644 --- a/storage/maria/ma_key_recover.c +++ b/storage/maria/ma_key_recover.c @@ -1169,6 +1169,7 @@ uint _ma_apply_redo_index(MARIA_HA *info, goto err; } page_length= page.size; + break; } case KEY_OP_NONE: default: diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c index d0e0210db64..b1d2378870f 100644 --- a/storage/maria/ma_recovery.c +++ b/storage/maria/ma_recovery.c @@ -887,9 +887,7 @@ prototype_redo_exec_hook(REDO_CREATE_TABLE) if (create_database_if_not_exists(name)) goto end; fn_format(filename, name, "", MARIA_NAME_IEXT, - (MY_UNPACK_FILENAME | - (flags & HA_DONT_TOUCH_DATA) ? MY_RETURN_REAL_PATH : 0) | - MY_APPEND_EXT); + MY_UNPACK_FILENAME | MY_RETURN_REAL_PATH | MY_APPEND_EXT); linkname_ptr= NULL; create_flag= MY_DELETE_OLD; tprint(tracef, "Table '%s' creating as '%s'\n", name, filename); diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index b65bb8b78bd..71ab372f2aa 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -2677,6 +2677,8 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info, */ DBUG_PRINT("info", ("is quick repair: %d", rep_quick)); bzero((char*)&sort_info,sizeof(sort_info)); + if (!rep_quick) + my_b_clear(&new_data_cache); /* Initialize pthread structures before goto err. */ mysql_mutex_init(mi_key_mutex_MI_SORT_INFO_mutex, &sort_info.mutex, MY_MUTEX_INIT_FAST); @@ -3056,7 +3058,7 @@ err: already or they were not yet started (if the error happend before creating the threads). */ - if (!rep_quick) + if (!rep_quick && my_b_inited(&new_data_cache)) (void) end_io_cache(&new_data_cache); if (!got_error) { diff --git a/storage/myisam/mysql-test/storage_engine/parts/disabled.def b/storage/myisam/mysql-test/storage_engine/parts/disabled.def new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/parts/disabled.def diff --git a/storage/myisammrg/mysql-test/storage_engine/type_spatial.rdiff b/storage/myisammrg/mysql-test/storage_engine/type_spatial.rdiff index 024c1646892..6f337ffb638 100644 --- a/storage/myisammrg/mysql-test/storage_engine/type_spatial.rdiff +++ b/storage/myisammrg/mysql-test/storage_engine/type_spatial.rdiff @@ -352,8 +352,8 @@ -116 0 -SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; -fid AsText(Centroid(g)) --117 POINT(55.58852775304245 17.426536064113982) --118 POINT(55.58852775304245 17.426536064113982) +-117 POINT(57.98031067576927 17.854754130800433) +-118 POINT(57.98031067576927 17.854754130800433) -119 POINT(2 2) -SELECT fid, Area(g) FROM gis_multi_polygon; -fid Area(g) diff --git a/storage/myisammrg/mysql-test/storage_engine/type_spatial_indexes.rdiff b/storage/myisammrg/mysql-test/storage_engine/type_spatial_indexes.rdiff index 1caa6c3d5a8..04c56979244 100644 --- a/storage/myisammrg/mysql-test/storage_engine/type_spatial_indexes.rdiff +++ b/storage/myisammrg/mysql-test/storage_engine/type_spatial_indexes.rdiff @@ -352,8 +352,8 @@ -116 0 -SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; -fid AsText(Centroid(g)) --117 POINT(55.58852775304245 17.426536064113982) --118 POINT(55.58852775304245 17.426536064113982) +-117 POINT(57.98031067576927 17.854754130800433) +-118 POINT(57.98031067576927 17.854754130800433) -119 POINT(2 2) -SELECT fid, Area(g) FROM gis_multi_polygon; -fid Area(g) @@ -1062,8 +1062,8 @@ -116 0 -SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; -fid AsText(Centroid(g)) --117 POINT(55.58852775304245 17.426536064113982) --118 POINT(55.58852775304245 17.426536064113982) +-117 POINT(57.98031067576927 17.854754130800433) +-118 POINT(57.98031067576927 17.854754130800433) -119 POINT(2 2) -SELECT fid, Area(g) FROM gis_multi_polygon; -fid Area(g) diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index c02375ceb2b..ad96328b8db 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(TOKUDB_VERSION 5.6.36-82.0) +SET(TOKUDB_VERSION 5.6.36-82.1) # PerconaFT only supports x86-64 and cmake-2.8.9+ IF(CMAKE_VERSION VERSION_LESS "2.8.9") MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB") diff --git a/storage/tokudb/PerconaFT/CMakeLists.txt b/storage/tokudb/PerconaFT/CMakeLists.txt index 375ce0078a4..1c9052c2a55 100644 --- a/storage/tokudb/PerconaFT/CMakeLists.txt +++ b/storage/tokudb/PerconaFT/CMakeLists.txt @@ -9,6 +9,16 @@ project(TokuDB) set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") +# detect when we are being built as a subproject +if (DEFINED MYSQL_PROJECT_NAME_DOCSTRING) + add_definitions( -DMYSQL_TOKUDB_ENGINE=1) + if ((CMAKE_BUILD_TYPE MATCHES "Debug") AND + (CMAKE_CXX_FLAGS_DEBUG MATCHES " -DENABLED_DEBUG_SYNC")) + include_directories(${CMAKE_SOURCE_DIR}/include) + include_directories(${CMAKE_SOURCE_DIR}/sql) + endif () +endif () + ## Versions of gcc >= 4.9.0 require special version of 'ar' and 'ranlib' for ## link-time optimizations to work properly. ## diff --git a/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake b/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake index a2c3103f98c..9769b7db13d 100644 --- a/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake +++ b/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake @@ -123,6 +123,9 @@ ExternalProject_Add(build_snappy -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} + -DCMAKE_AR=${CMAKE_AR} + -DCMAKE_NM=${CMAKE_NM} + -DCMAKE_RANLIB=${CMAKE_RANLIB} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${USE_PROJECT_CMAKE_MODULE_PATH} diff --git a/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc b/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc index 4505a236e13..54ef11eb1eb 100644 --- a/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc +++ b/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc @@ -465,7 +465,10 @@ int toku_cachetable_openf (CACHEFILE *cfptr, CACHETABLE ct, const char *fname_in char * toku_cachefile_fname_in_env (CACHEFILE cf) { - return cf->fname_in_env; + if (cf) { + return cf->fname_in_env; + } + return nullptr; } void toku_cachefile_set_fname_in_env(CACHEFILE cf, char *new_fname_in_env) { @@ -2891,6 +2894,10 @@ toku_cachefile_get_cachetable(CACHEFILE cf) { return cf->cachetable; } +CACHEFILE toku_pair_get_cachefile(PAIR pair) { + return pair->cachefile; +} + //Only called by ft_end_checkpoint //Must have access to cf->fd (must be protected) void toku_cachefile_fsync(CACHEFILE cf) { diff --git a/storage/tokudb/PerconaFT/ft/cachetable/cachetable.h b/storage/tokudb/PerconaFT/ft/cachetable/cachetable.h index 3b3cb0a2d46..b9851f33e20 100644 --- a/storage/tokudb/PerconaFT/ft/cachetable/cachetable.h +++ b/storage/tokudb/PerconaFT/ft/cachetable/cachetable.h @@ -297,6 +297,9 @@ void *toku_cachefile_get_userdata(CACHEFILE); CACHETABLE toku_cachefile_get_cachetable(CACHEFILE cf); // Effect: Get the cachetable. +CACHEFILE toku_pair_get_cachefile(PAIR); +// Effect: Get the cachefile of the pair + void toku_cachetable_swap_pair_values(PAIR old_pair, PAIR new_pair); // Effect: Swaps the value_data of old_pair and new_pair. // Requires: both old_pair and new_pair to be pinned with write locks. diff --git a/storage/tokudb/PerconaFT/ft/ft-ops.cc b/storage/tokudb/PerconaFT/ft/ft-ops.cc index d3a5a6c9e91..20035b1d02f 100644 --- a/storage/tokudb/PerconaFT/ft/ft-ops.cc +++ b/storage/tokudb/PerconaFT/ft/ft-ops.cc @@ -652,8 +652,12 @@ void toku_ftnode_clone_callback(void *value_data, // set new pair attr if necessary if (node->height == 0) { *new_attr = make_ftnode_pair_attr(node); - node->logical_rows_delta = 0; - cloned_node->logical_rows_delta = 0; + for (int i = 0; i < node->n_children; i++) { + if (BP_STATE(node, i) == PT_AVAIL) { + BLB_LRD(node, i) = 0; + BLB_LRD(cloned_node, i) = 0; + } + } } else { new_attr->is_valid = false; } @@ -701,9 +705,26 @@ void toku_ftnode_flush_callback(CACHEFILE UU(cachefile), if (ftnode->height == 0) { FT_STATUS_INC(FT_FULL_EVICTIONS_LEAF, 1); FT_STATUS_INC(FT_FULL_EVICTIONS_LEAF_BYTES, node_size); - if (!ftnode->dirty) { - toku_ft_adjust_logical_row_count( - ft, -ftnode->logical_rows_delta); + + // A leaf node (height == 0) is being evicted (!keep_me) and is + // not a checkpoint clone (!is_clone). This leaf node may have + // had messages applied to satisfy a query, but was never + // actually dirtied (!ftnode->dirty && !write_me). **Note that + // if (write_me) would persist the node and clear the dirty + // flag **. This message application may have updated the trees + // logical row count. Since these message applications are not + // persisted, we need undo the logical row count adjustments as + // they may occur again in the future if/when the node is + // re-read from disk for another query or change. + if (!ftnode->dirty && !write_me) { + int64_t lrc_delta = 0; + for (int i = 0; i < ftnode->n_children; i++) { + if (BP_STATE(ftnode, i) == PT_AVAIL) { + lrc_delta -= BLB_LRD(ftnode, i); + BLB_LRD(ftnode, i) = 0; + } + } + toku_ft_adjust_logical_row_count(ft, lrc_delta); } } else { FT_STATUS_INC(FT_FULL_EVICTIONS_NONLEAF, 1); @@ -712,6 +733,11 @@ void toku_ftnode_flush_callback(CACHEFILE UU(cachefile), toku_free(*disk_data); } else { if (ftnode->height == 0) { + // No need to adjust logical row counts when flushing a clone + // as they should have been zeroed out anyway when cloned. + // Clones are 'copies' of work already done so doing it again + // (adjusting row counts) would be redundant and leads to + // inaccurate counts. for (int i = 0; i < ftnode->n_children; i++) { if (BP_STATE(ftnode, i) == PT_AVAIL) { BASEMENTNODE bn = BLB(ftnode, i); @@ -719,10 +745,6 @@ void toku_ftnode_flush_callback(CACHEFILE UU(cachefile), bn->stat64_delta); } } - if (!ftnode->dirty) { - toku_ft_adjust_logical_row_count( - ft, -ftnode->logical_rows_delta); - } } } toku_ftnode_free(&ftnode); @@ -749,24 +771,48 @@ toku_ft_status_update_pivot_fetch_reason(ftnode_fetch_extra *bfe) } } -int toku_ftnode_fetch_callback (CACHEFILE UU(cachefile), PAIR p, int fd, BLOCKNUM blocknum, uint32_t fullhash, - void **ftnode_pv, void** disk_data, PAIR_ATTR *sizep, int *dirtyp, void *extraargs) { +int toku_ftnode_fetch_callback(CACHEFILE UU(cachefile), + PAIR p, + int fd, + BLOCKNUM blocknum, + uint32_t fullhash, + void **ftnode_pv, + void **disk_data, + PAIR_ATTR *sizep, + int *dirtyp, + void *extraargs) { assert(extraargs); - assert(*ftnode_pv == NULL); - FTNODE_DISK_DATA* ndd = (FTNODE_DISK_DATA*)disk_data; + assert(*ftnode_pv == nullptr); + FTNODE_DISK_DATA *ndd = (FTNODE_DISK_DATA *)disk_data; ftnode_fetch_extra *bfe = (ftnode_fetch_extra *)extraargs; - FTNODE *node=(FTNODE*)ftnode_pv; + FTNODE *node = (FTNODE *)ftnode_pv; // deserialize the node, must pass the bfe in because we cannot // evaluate what piece of the the node is necessary until we get it at // least partially into memory - int r = toku_deserialize_ftnode_from(fd, blocknum, fullhash, node, ndd, bfe); + int r = + toku_deserialize_ftnode_from(fd, blocknum, fullhash, node, ndd, bfe); if (r != 0) { if (r == TOKUDB_BAD_CHECKSUM) { - fprintf(stderr, - "Checksum failure while reading node in file %s.\n", - toku_cachefile_fname_in_env(cachefile)); + fprintf( + stderr, + "%s:%d:toku_ftnode_fetch_callback - " + "file[%s], blocknum[%ld], toku_deserialize_ftnode_from " + "failed with a checksum error.\n", + __FILE__, + __LINE__, + toku_cachefile_fname_in_env(cachefile), + blocknum.b); } else { - fprintf(stderr, "Error deserializing node, errno = %d", r); + fprintf( + stderr, + "%s:%d:toku_ftnode_fetch_callback - " + "file[%s], blocknum[%ld], toku_deserialize_ftnode_from " + "failed with %d.\n", + __FILE__, + __LINE__, + toku_cachefile_fname_in_env(cachefile), + blocknum.b, + r); } // make absolutely sure we crash before doing anything else. abort(); @@ -775,7 +821,8 @@ int toku_ftnode_fetch_callback (CACHEFILE UU(cachefile), PAIR p, int fd, BLOCKNU if (r == 0) { *sizep = make_ftnode_pair_attr(*node); (*node)->ct_pair = p; - *dirtyp = (*node)->dirty; // deserialize could mark the node as dirty (presumably for upgrade) + *dirtyp = (*node)->dirty; // deserialize could mark the node as dirty + // (presumably for upgrade) } return r; } @@ -948,6 +995,16 @@ int toku_ftnode_pe_callback(void *ftnode_pv, basements_to_destroy[num_basements_to_destroy++] = bn; toku_ft_decrease_stats(&ft->in_memory_stats, bn->stat64_delta); + // A basement node is being partially evicted. + // This masement node may have had messages applied to it to + // satisfy a query, but was never actually dirtied. + // This message application may have updated the trees + // logical row count. Since these message applications are + // not being persisted, we need undo the logical row count + // adjustments as they may occur again in the future if/when + // the node is re-read from disk for another query or change. + toku_ft_adjust_logical_row_count(ft, + -bn->logical_rows_delta); set_BNULL(node, i); BP_STATE(node, i) = PT_ON_DISK; num_partial_evictions++; diff --git a/storage/tokudb/PerconaFT/ft/ft.cc b/storage/tokudb/PerconaFT/ft/ft.cc index cec54e38a47..abc9d295eae 100644 --- a/storage/tokudb/PerconaFT/ft/ft.cc +++ b/storage/tokudb/PerconaFT/ft/ft.cc @@ -436,7 +436,8 @@ int toku_read_ft_and_store_in_cachefile (FT_HANDLE ft_handle, CACHEFILE cf, LSN } int fd = toku_cachefile_get_fd(cf); - int r = toku_deserialize_ft_from(fd, max_acceptable_lsn, &ft); + const char *fn = toku_cachefile_fname_in_env(cf); + int r = toku_deserialize_ft_from(fd, fn, max_acceptable_lsn, &ft); if (r == TOKUDB_BAD_CHECKSUM) { fprintf(stderr, "Checksum failure while reading header in file %s.\n", toku_cachefile_fname_in_env(cf)); assert(false); // make absolutely sure we crash before doing anything else diff --git a/storage/tokudb/PerconaFT/ft/node.cc b/storage/tokudb/PerconaFT/ft/node.cc index aad0c1ca078..ddc850632bf 100644 --- a/storage/tokudb/PerconaFT/ft/node.cc +++ b/storage/tokudb/PerconaFT/ft/node.cc @@ -94,6 +94,7 @@ void toku_destroy_ftnode_internals(FTNODE node) { if (node->height > 0) { destroy_nonleaf_childinfo(BNC(node,i)); } else { + paranoid_invariant(BLB_LRD(node, i) == 0); destroy_basement_node(BLB(node, i)); } } else if (BP_STATE(node,i) == PT_COMPRESSED) { @@ -387,8 +388,7 @@ static void bnc_apply_messages_to_basement_node( const pivot_bounds & bounds, // contains pivot key bounds of this basement node txn_gc_info *gc_info, - bool *msgs_applied, - int64_t* logical_rows_delta) { + bool *msgs_applied) { int r; NONLEAF_CHILDINFO bnc = BNC(ancestor, childnum); @@ -396,6 +396,7 @@ static void bnc_apply_messages_to_basement_node( // apply messages from this buffer STAT64INFO_S stats_delta = {0, 0}; uint64_t workdone_this_ancestor = 0; + int64_t logical_rows_delta = 0; uint32_t stale_lbi, stale_ube; if (!bn->stale_ancestor_messages_applied) { @@ -471,7 +472,7 @@ static void bnc_apply_messages_to_basement_node( gc_info, &workdone_this_ancestor, &stats_delta, - logical_rows_delta); + &logical_rows_delta); } } else if (stale_lbi == stale_ube) { // No stale messages to apply, we just apply fresh messages, and mark @@ -483,7 +484,7 @@ static void bnc_apply_messages_to_basement_node( .gc_info = gc_info, .workdone = &workdone_this_ancestor, .stats_to_update = &stats_delta, - .logical_rows_delta = logical_rows_delta}; + .logical_rows_delta = &logical_rows_delta}; if (fresh_ube - fresh_lbi > 0) *msgs_applied = true; r = bnc->fresh_message_tree @@ -504,7 +505,7 @@ static void bnc_apply_messages_to_basement_node( .gc_info = gc_info, .workdone = &workdone_this_ancestor, .stats_to_update = &stats_delta, - .logical_rows_delta = logical_rows_delta}; + .logical_rows_delta = &logical_rows_delta}; r = bnc->stale_message_tree .iterate_on_range<struct iterate_do_bn_apply_msg_extra, @@ -522,6 +523,8 @@ static void bnc_apply_messages_to_basement_node( if (stats_delta.numbytes || stats_delta.numrows) { toku_ft_update_stats(&t->ft->in_memory_stats, stats_delta); } + toku_ft_adjust_logical_row_count(t->ft, logical_rows_delta); + bn->logical_rows_delta += logical_rows_delta; } static void @@ -535,7 +538,6 @@ apply_ancestors_messages_to_bn( bool* msgs_applied ) { - int64_t logical_rows_delta = 0; BASEMENTNODE curr_bn = BLB(node, childnum); const pivot_bounds curr_bounds = bounds.next_bounds(node, childnum); for (ANCESTORS curr_ancestors = ancestors; curr_ancestors; curr_ancestors = curr_ancestors->next) { @@ -548,16 +550,13 @@ apply_ancestors_messages_to_bn( curr_ancestors->childnum, curr_bounds, gc_info, - msgs_applied, - &logical_rows_delta + msgs_applied ); // We don't want to check this ancestor node again if the // next time we query it, the msn hasn't changed. curr_bn->max_msn_applied = curr_ancestors->node->max_msn_applied_to_node_on_disk; } } - toku_ft_adjust_logical_row_count(t->ft, logical_rows_delta); - node->logical_rows_delta += logical_rows_delta; // At this point, we know all the stale messages above this // basement node have been applied, and any new messages will be // fresh, so we don't need to look at stale messages for this diff --git a/storage/tokudb/PerconaFT/ft/node.h b/storage/tokudb/PerconaFT/ft/node.h index db189e36d59..05c8a44ebed 100644 --- a/storage/tokudb/PerconaFT/ft/node.h +++ b/storage/tokudb/PerconaFT/ft/node.h @@ -175,11 +175,6 @@ struct ftnode { int height; int dirty; uint32_t fullhash; - // current count of rows add or removed as a result of message application - // to this node as a basement, irrelevant for internal nodes, gets reset - // when node is undirtied. Used to back out tree scoped LRC id node is - // evicted but not persisted - int64_t logical_rows_delta; // for internal nodes, if n_children==fanout+1 then the tree needs to be // rebalanced. for leaf nodes, represents number of basement nodes @@ -211,6 +206,10 @@ struct ftnode_leaf_basement_node { unsigned int seqinsert; // number of sequential inserts to this leaf MSN max_msn_applied; // max message sequence number applied bool stale_ancestor_messages_applied; + // current count of rows added or removed as a result of message application + // to this basement node, gets reset when node is undirtied. + // Used to back out tree scoped LRC id node is evicted but not persisted + int64_t logical_rows_delta; STAT64INFO_S stat64_delta; // change in stat64 counters since basement was last written to disk }; typedef struct ftnode_leaf_basement_node *BASEMENTNODE; @@ -385,6 +384,16 @@ enum reactivity toku_ftnode_get_reactivity(FT ft, FTNODE node); enum reactivity toku_ftnode_get_nonleaf_reactivity(FTNODE node, unsigned int fanout); enum reactivity toku_ftnode_get_leaf_reactivity(FTNODE node, uint32_t nodesize); +inline const char* toku_ftnode_get_cachefile_fname_in_env(FTNODE node) { + if (node->ct_pair) { + CACHEFILE cf = toku_pair_get_cachefile(node->ct_pair); + if (cf) { + return toku_cachefile_fname_in_env(cf); + } + } + return nullptr; +} + /** * Finds the next child for HOT to flush to, given that everything up to * and including k has been flattened. @@ -577,3 +586,4 @@ static inline void set_BSB(FTNODE node, int i, struct sub_block *sb) { #define BLB_DATA(node,i) (&(BLB(node,i)->data_buffer)) #define BLB_NBYTESINDATA(node,i) (BLB_DATA(node,i)->get_disk_size()) #define BLB_SEQINSERT(node,i) (BLB(node,i)->seqinsert) +#define BLB_LRD(node, i) (BLB(node,i)->logical_rows_delta) diff --git a/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc b/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc index 8fcb5293412..fcab9fc675e 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc +++ b/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc @@ -644,7 +644,29 @@ exit: // Read ft from file into struct. Read both headers and use one. // We want the latest acceptable header whose checkpoint_lsn is no later // than max_acceptable_lsn. -int toku_deserialize_ft_from(int fd, LSN max_acceptable_lsn, FT *ft) { +#define dump_state_of_toku_deserialize_ft_from() \ + fprintf(stderr, \ + "%s:%d toku_deserialize_ft_from: " \ + "filename[%s] " \ + "r[%d] max_acceptable_lsn[%lu]" \ + "r0[%d] checkpoint_lsn_0[%lu] checkpoint_count_0[%lu] " \ + "r1[%d] checkpoint_lsn_1[%lu] checkpoint_count_1[%lu]\n", \ + __FILE__, \ + __LINE__, \ + fn, \ + r, \ + max_acceptable_lsn.lsn, \ + r0, \ + checkpoint_lsn_0.lsn, \ + checkpoint_count_0, \ + r1, \ + checkpoint_lsn_1.lsn, \ + checkpoint_count_1); + +int toku_deserialize_ft_from(int fd, + const char *fn, + LSN max_acceptable_lsn, + FT *ft) { struct rbuf rb_0; struct rbuf rb_1; uint64_t checkpoint_count_0 = 0; @@ -655,7 +677,7 @@ int toku_deserialize_ft_from(int fd, LSN max_acceptable_lsn, FT *ft) { bool h0_acceptable = false; bool h1_acceptable = false; struct rbuf *rb = NULL; - int r0, r1, r; + int r0, r1, r = 0; toku_off_t header_0_off = 0; r0 = deserialize_ft_from_fd_into_rbuf(fd, @@ -702,6 +724,10 @@ int toku_deserialize_ft_from(int fd, LSN max_acceptable_lsn, FT *ft) { // first header, unless it's readable } + if (r != TOKUDB_DICTIONARY_NO_HEADER) { + dump_state_of_toku_deserialize_ft_from(); + } + // it should not be possible for both headers to be later than the // max_acceptable_lsn invariant( @@ -713,11 +739,19 @@ int toku_deserialize_ft_from(int fd, LSN max_acceptable_lsn, FT *ft) { if (h0_acceptable && h1_acceptable) { if (checkpoint_count_0 > checkpoint_count_1) { + if (!(checkpoint_count_0 == checkpoint_count_1 + 1) || + !(version_0 >= version_1)) { + dump_state_of_toku_deserialize_ft_from(); + } invariant(checkpoint_count_0 == checkpoint_count_1 + 1); invariant(version_0 >= version_1); rb = &rb_0; version = version_0; } else { + if (!(checkpoint_count_1 == checkpoint_count_0 + 1) || + !(version_1 >= version_0)) { + dump_state_of_toku_deserialize_ft_from(); + } invariant(checkpoint_count_1 == checkpoint_count_0 + 1); invariant(version_1 >= version_0); rb = &rb_1; @@ -729,6 +763,7 @@ int toku_deserialize_ft_from(int fd, LSN max_acceptable_lsn, FT *ft) { fprintf( stderr, "Header 2 checksum failed, but header 1 ok. Proceeding.\n"); + dump_state_of_toku_deserialize_ft_from(); } rb = &rb_0; version = version_0; @@ -738,11 +773,15 @@ int toku_deserialize_ft_from(int fd, LSN max_acceptable_lsn, FT *ft) { fprintf( stderr, "Header 1 checksum failed, but header 2 ok. Proceeding.\n"); + dump_state_of_toku_deserialize_ft_from(); } rb = &rb_1; version = version_1; } + if (!rb) { + dump_state_of_toku_deserialize_ft_from(); + } paranoid_invariant(rb); r = deserialize_ft_versioned(fd, rb, ft, version); diff --git a/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.h b/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.h index fe31ff7c5fd..144e188566c 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.h +++ b/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.h @@ -42,12 +42,23 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #include "ft/serialize/block_table.h" size_t toku_serialize_ft_size(struct ft_header *h); -void toku_serialize_ft_to(int fd, struct ft_header *h, block_table *bt, CACHEFILE cf); -void toku_serialize_ft_to_wbuf(struct wbuf *wbuf, struct ft_header *h, DISKOFF translation_location_on_disk, DISKOFF translation_size_on_disk); -void toku_serialize_descriptor_contents_to_fd(int fd, DESCRIPTOR desc, DISKOFF offset); -void toku_serialize_descriptor_contents_to_wbuf(struct wbuf *wb, DESCRIPTOR desc); - -int toku_deserialize_ft_from(int fd, LSN max_acceptable_lsn, FT *ft); +void toku_serialize_ft_to(int fd, + struct ft_header *h, + block_table *bt, + CACHEFILE cf); +void toku_serialize_ft_to_wbuf(struct wbuf *wbuf, + struct ft_header *h, + DISKOFF translation_location_on_disk, + DISKOFF translation_size_on_disk); +void toku_serialize_descriptor_contents_to_fd(int fd, + DESCRIPTOR desc, + DISKOFF offset); +void toku_serialize_descriptor_contents_to_wbuf(struct wbuf *wb, + DESCRIPTOR desc); +int toku_deserialize_ft_from(int fd, + const char *fn, + LSN max_acceptable_lsn, + FT *ft); // TODO rename int deserialize_ft_from_fd_into_rbuf(int fd, diff --git a/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc b/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc index 9606db64632..22a562ae24c 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc +++ b/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc @@ -830,6 +830,13 @@ int toku_serialize_ftnode_to(int fd, node->dirty = 0; // See #1957. Must set the node to be clean after // serializing it so that it doesn't get written again on // the next checkpoint or eviction. + if (node->height == 0) { + for (int i = 0; i < node->n_children; i++) { + if (BP_STATE(node, i) == PT_AVAIL) { + BLB_LRD(node, i) = 0; + } + } + } return 0; } @@ -996,6 +1003,7 @@ BASEMENTNODE toku_clone_bn(BASEMENTNODE orig_bn) { bn->seqinsert = orig_bn->seqinsert; bn->stale_ancestor_messages_applied = orig_bn->stale_ancestor_messages_applied; bn->stat64_delta = orig_bn->stat64_delta; + bn->logical_rows_delta = orig_bn->logical_rows_delta; bn->data_buffer.clone(&orig_bn->data_buffer); return bn; } @@ -1006,6 +1014,7 @@ BASEMENTNODE toku_create_empty_bn_no_buffer(void) { bn->seqinsert = 0; bn->stale_ancestor_messages_applied = false; bn->stat64_delta = ZEROSTATS; + bn->logical_rows_delta = 0; bn->data_buffer.init_zero(); return bn; } @@ -1149,15 +1158,25 @@ just_decompress_sub_block(struct sub_block *sb) } // verify the checksum -int -verify_ftnode_sub_block (struct sub_block *sb) -{ +int verify_ftnode_sub_block(struct sub_block *sb, + const char *fname, + BLOCKNUM blocknum) { int r = 0; // first verify the checksum uint32_t data_size = sb->uncompressed_size - 4; // checksum is 4 bytes at end uint32_t stored_xsum = toku_dtoh32(*((uint32_t *)((char *)sb->uncompressed_ptr + data_size))); uint32_t actual_xsum = toku_x1764_memory(sb->uncompressed_ptr, data_size); if (stored_xsum != actual_xsum) { + fprintf( + stderr, + "%s:%d:verify_ftnode_sub_block - " + "file[%s], blocknum[%ld], stored_xsum[%u] != actual_xsum[%u]\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + stored_xsum, + actual_xsum); dump_bad_block((Bytef *) sb->uncompressed_ptr, sb->uncompressed_size); r = TOKUDB_BAD_CHECKSUM; } @@ -1165,19 +1184,27 @@ verify_ftnode_sub_block (struct sub_block *sb) } // This function deserializes the data stored by serialize_ftnode_info -static int -deserialize_ftnode_info( - struct sub_block *sb, - FTNODE node - ) -{ +static int deserialize_ftnode_info(struct sub_block *sb, FTNODE node) { + // sb_node_info->uncompressed_ptr stores the serialized node information // this function puts that information into node // first verify the checksum int r = 0; - r = verify_ftnode_sub_block(sb); + const char *fname = toku_ftnode_get_cachefile_fname_in_env(node); + r = verify_ftnode_sub_block(sb, fname, node->blocknum); if (r != 0) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_info - " + "file[%s], blocknum[%ld], verify_ftnode_sub_block failed with %d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + node->blocknum.b, + r); + dump_bad_block(static_cast<unsigned char *>(sb->uncompressed_ptr), + sb->uncompressed_size); goto exit; } @@ -1223,6 +1250,16 @@ deserialize_ftnode_info( // make sure that all the data was read if (data_size != rb.ndone) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_info - " + "file[%s], blocknum[%ld], data_size[%d] != rb.ndone[%d]\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + node->blocknum.b, + data_size, + rb.ndone); dump_bad_block(rb.buf, rb.size); abort(); } @@ -1339,17 +1376,25 @@ static void setup_ftnode_partitions(FTNODE node, ftnode_fetch_extra *bfe, bool d /* deserialize the partition from the sub-block's uncompressed buffer * and destroy the uncompressed buffer */ -static int -deserialize_ftnode_partition( +static int deserialize_ftnode_partition( struct sub_block *sb, FTNODE node, - int childnum, // which partition to deserialize - const toku::comparator &cmp - ) -{ + int childnum, // which partition to deserialize + const toku::comparator &cmp) { + int r = 0; - r = verify_ftnode_sub_block(sb); + const char *fname = toku_ftnode_get_cachefile_fname_in_env(node); + r = verify_ftnode_sub_block(sb, fname, node->blocknum); if (r != 0) { + fprintf(stderr, + "%s:%d:deserialize_ftnode_partition - " + "file[%s], blocknum[%ld], " + "verify_ftnode_sub_block failed with %d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + node->blocknum.b, + r); goto exit; } uint32_t data_size; @@ -1362,7 +1407,20 @@ deserialize_ftnode_partition( ch = rbuf_char(&rb); if (node->height > 0) { - assert(ch == FTNODE_PARTITION_MSG_BUFFER); + if (ch != FTNODE_PARTITION_MSG_BUFFER) { + fprintf(stderr, + "%s:%d:deserialize_ftnode_partition - " + "file[%s], blocknum[%ld], ch[%d] != " + "FTNODE_PARTITION_MSG_BUFFER[%d]\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + node->blocknum.b, + ch, + FTNODE_PARTITION_MSG_BUFFER); + dump_bad_block(rb.buf, rb.size); + assert(ch == FTNODE_PARTITION_MSG_BUFFER); + } NONLEAF_CHILDINFO bnc = BNC(node, childnum); if (node->layout_version_read_from_disk <= FT_LAYOUT_VERSION_26) { // Layout version <= 26 did not serialize sorted message trees to disk. @@ -1371,43 +1429,99 @@ deserialize_ftnode_partition( deserialize_child_buffer(bnc, &rb); } BP_WORKDONE(node, childnum) = 0; - } - else { - assert(ch == FTNODE_PARTITION_DMT_LEAVES); + } else { + if (ch != FTNODE_PARTITION_DMT_LEAVES) { + fprintf(stderr, + "%s:%d:deserialize_ftnode_partition - " + "file[%s], blocknum[%ld], ch[%d] != " + "FTNODE_PARTITION_DMT_LEAVES[%d]\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + node->blocknum.b, + ch, + FTNODE_PARTITION_DMT_LEAVES); + dump_bad_block(rb.buf, rb.size); + assert(ch == FTNODE_PARTITION_DMT_LEAVES); + } + BLB_SEQINSERT(node, childnum) = 0; uint32_t num_entries = rbuf_int(&rb); // we are now at the first byte of first leafentry data_size -= rb.ndone; // remaining bytes of leafentry data BASEMENTNODE bn = BLB(node, childnum); - bn->data_buffer.deserialize_from_rbuf(num_entries, &rb, data_size, node->layout_version_read_from_disk); + bn->data_buffer.deserialize_from_rbuf( + num_entries, &rb, data_size, node->layout_version_read_from_disk); + } + if (rb.ndone != rb.size) { + fprintf(stderr, + "%s:%d:deserialize_ftnode_partition - " + "file[%s], blocknum[%ld], rb.ndone[%d] != rb.size[%d]\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + node->blocknum.b, + rb.ndone, + rb.size); + dump_bad_block(rb.buf, rb.size); + assert(rb.ndone == rb.size); } - assert(rb.ndone == rb.size); + exit: return r; } -static int -decompress_and_deserialize_worker(struct rbuf curr_rbuf, struct sub_block curr_sb, FTNODE node, int child, - const toku::comparator &cmp, tokutime_t *decompress_time) -{ +static int decompress_and_deserialize_worker(struct rbuf curr_rbuf, + struct sub_block curr_sb, + FTNODE node, + int child, + const toku::comparator &cmp, + tokutime_t *decompress_time) { int r = 0; tokutime_t t0 = toku_time_now(); r = read_and_decompress_sub_block(&curr_rbuf, &curr_sb); - tokutime_t t1 = toku_time_now(); - if (r == 0) { - // at this point, sb->uncompressed_ptr stores the serialized node partition - r = deserialize_ftnode_partition(&curr_sb, node, child, cmp); + if (r != 0) { + const char *fname = toku_ftnode_get_cachefile_fname_in_env(node); + fprintf(stderr, + "%s:%d:decompress_and_deserialize_worker - " + "file[%s], blocknum[%ld], read_and_decompress_sub_block failed " + "with %d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + node->blocknum.b, + r); + dump_bad_block(curr_rbuf.buf, curr_rbuf.size); + goto exit; + } + *decompress_time = toku_time_now() - t0; + // at this point, sb->uncompressed_ptr stores the serialized node partition + r = deserialize_ftnode_partition(&curr_sb, node, child, cmp); + if (r != 0) { + const char *fname = toku_ftnode_get_cachefile_fname_in_env(node); + fprintf(stderr, + "%s:%d:decompress_and_deserialize_worker - " + "file[%s], blocknum[%ld], deserialize_ftnode_partition failed " + "with %d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + node->blocknum.b, + r); + dump_bad_block(curr_rbuf.buf, curr_rbuf.size); + goto exit; } - *decompress_time = t1 - t0; +exit: toku_free(curr_sb.uncompressed_ptr); return r; } -static int -check_and_copy_compressed_sub_block_worker(struct rbuf curr_rbuf, struct sub_block curr_sb, FTNODE node, int child) -{ +static int check_and_copy_compressed_sub_block_worker(struct rbuf curr_rbuf, + struct sub_block curr_sb, + FTNODE node, + int child) { int r = 0; r = read_compressed_sub_block(&curr_rbuf, &curr_sb); if (r != 0) { @@ -1419,7 +1533,8 @@ check_and_copy_compressed_sub_block_worker(struct rbuf curr_rbuf, struct sub_blo bp_sb->compressed_size = curr_sb.compressed_size; bp_sb->uncompressed_size = curr_sb.uncompressed_size; bp_sb->compressed_ptr = toku_xmalloc(bp_sb->compressed_size); - memcpy(bp_sb->compressed_ptr, curr_sb.compressed_ptr, bp_sb->compressed_size); + memcpy( + bp_sb->compressed_ptr, curr_sb.compressed_ptr, bp_sb->compressed_size); exit: return r; } @@ -1430,35 +1545,50 @@ static FTNODE alloc_ftnode_for_deserialize(uint32_t fullhash, BLOCKNUM blocknum) node->fullhash = fullhash; node->blocknum = blocknum; node->dirty = 0; - node->logical_rows_delta = 0; - node->bp = nullptr; node->oldest_referenced_xid_known = TXNID_NONE; + node->bp = nullptr; + node->ct_pair = nullptr; return node; } -static int -deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode, - FTNODE_DISK_DATA* ndd, - BLOCKNUM blocknum, - uint32_t fullhash, - ftnode_fetch_extra *bfe, - struct rbuf *rb, - int fd) +static int deserialize_ftnode_header_from_rbuf_if_small_enough( + FTNODE *ftnode, + FTNODE_DISK_DATA *ndd, + BLOCKNUM blocknum, + uint32_t fullhash, + ftnode_fetch_extra *bfe, + struct rbuf *rb, + int fd) // If we have enough information in the rbuf to construct a header, then do so. // Also fetch in the basement node if needed. -// Return 0 if it worked. If something goes wrong (including that we are looking at some old data format that doesn't have partitions) then return nonzero. +// Return 0 if it worked. If something goes wrong (including that we are +// looking at some old data format that doesn't have partitions) then return +// nonzero. { int r = 0; tokutime_t t0, t1; tokutime_t decompress_time = 0; tokutime_t deserialize_time = 0; + // we must get the name from bfe and not through + // toku_ftnode_get_cachefile_fname_in_env as the node is not set up yet + const char* fname = toku_cachefile_fname_in_env(bfe->ft->cf); t0 = toku_time_now(); FTNODE node = alloc_ftnode_for_deserialize(fullhash, blocknum); if (rb->size < 24) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_header_from_rbuf_if_small_enough - " + "file[%s], blocknum[%ld], rb->size[%u] < 24\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + rb->size); + dump_bad_block(rb->buf, rb->size); // TODO: What error do we return here? // Does it even matter? r = toku_db_badformat(); @@ -1467,14 +1597,45 @@ deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode, const void *magic; rbuf_literal_bytes(rb, &magic, 8); - if (memcmp(magic, "tokuleaf", 8)!=0 && - memcmp(magic, "tokunode", 8)!=0) { + if (memcmp(magic, "tokuleaf", 8) != 0 && + memcmp(magic, "tokunode", 8) != 0) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_header_from_rbuf_if_small_enough - " + "file[%s], blocknum[%ld], unrecognized magic number " + "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + static_cast<const uint8_t*>(magic)[0], + static_cast<const uint8_t*>(magic)[1], + static_cast<const uint8_t*>(magic)[2], + static_cast<const uint8_t*>(magic)[3], + static_cast<const uint8_t*>(magic)[4], + static_cast<const uint8_t*>(magic)[5], + static_cast<const uint8_t*>(magic)[6], + static_cast<const uint8_t*>(magic)[7]); + dump_bad_block(rb->buf, rb->size); r = toku_db_badformat(); goto cleanup; } node->layout_version_read_from_disk = rbuf_int(rb); - if (node->layout_version_read_from_disk < FT_FIRST_LAYOUT_VERSION_WITH_BASEMENT_NODES) { + if (node->layout_version_read_from_disk < + FT_FIRST_LAYOUT_VERSION_WITH_BASEMENT_NODES) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_header_from_rbuf_if_small_enough - " + "file[%s], blocknum[%ld], node->layout_version_read_from_disk[%d] " + "< FT_FIRST_LAYOUT_VERSION_WITH_BASEMENT_NODES[%d]\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + node->layout_version_read_from_disk, + FT_FIRST_LAYOUT_VERSION_WITH_BASEMENT_NODES); + dump_bad_block(rb->buf, rb->size); // This code path doesn't have to worry about upgrade. r = toku_db_badformat(); goto cleanup; @@ -1496,10 +1657,24 @@ deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode, // is too big, we may have a problem, so check that we won't overflow // while reading the partition locations. unsigned int nhsize; - nhsize = serialize_node_header_size(node); // we can do this because n_children is filled in. + // we can do this because n_children is filled in. + nhsize = serialize_node_header_size(node); unsigned int needed_size; - needed_size = nhsize + 12; // we need 12 more so that we can read the compressed block size information that follows for the nodeinfo. + // we need 12 more so that we can read the compressed block size information + // that follows for the nodeinfo. + needed_size = nhsize + 12; if (needed_size > rb->size) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_header_from_rbuf_if_small_enough - " + "file[%s], blocknum[%ld], needed_size[%d] > rb->size[%d]\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + needed_size, + rb->size); + dump_bad_block(rb->buf, rb->size); r = toku_db_badformat(); goto cleanup; } @@ -1517,6 +1692,16 @@ deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode, uint32_t stored_checksum; stored_checksum = rbuf_int(rb); if (stored_checksum != checksum) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_header_from_rbuf_if_small_enough - " + "file[%s], blocknum[%ld], stored_checksum[%d] != checksum[%d]\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + stored_checksum, + checksum); dump_bad_block(rb->buf, rb->size); r = TOKUDB_BAD_CHECKSUM; goto cleanup; @@ -1525,9 +1710,23 @@ deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode, // Now we want to read the pivot information. struct sub_block sb_node_info; sub_block_init(&sb_node_info); - sb_node_info.compressed_size = rbuf_int(rb); // we'll be able to read these because we checked the size earlier. + // we'll be able to read these because we checked the size earlier. + sb_node_info.compressed_size = rbuf_int(rb); sb_node_info.uncompressed_size = rbuf_int(rb); - if (rb->size-rb->ndone < sb_node_info.compressed_size + 8) { + if (rb->size - rb->ndone < sb_node_info.compressed_size + 8) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_header_from_rbuf_if_small_enough - " + "file[%s], blocknum[%ld], rb->size[%d] - rb->ndone[%d] < " + "sb_node_info.compressed_size[%d] + 8\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + rb->size, + rb->ndone, + sb_node_info.compressed_size); + dump_bad_block(rb->buf, rb->size); r = toku_db_badformat(); goto cleanup; } @@ -1539,8 +1738,20 @@ deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode, sb_node_info.xsum = rbuf_int(rb); // let's check the checksum uint32_t actual_xsum; - actual_xsum = toku_x1764_memory((char *)sb_node_info.compressed_ptr-8, 8+sb_node_info.compressed_size); + actual_xsum = toku_x1764_memory((char *)sb_node_info.compressed_ptr - 8, + 8 + sb_node_info.compressed_size); if (sb_node_info.xsum != actual_xsum) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_header_from_rbuf_if_small_enough - " + "file[%s], blocknum[%ld], sb_node_info.xsum[%d] != actual_xsum[%d]\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + sb_node_info.xsum, + actual_xsum); + dump_bad_block(rb->buf, rb->size); r = TOKUDB_BAD_CHECKSUM; goto cleanup; } @@ -1550,18 +1761,30 @@ deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode, toku::scoped_malloc sb_node_info_buf(sb_node_info.uncompressed_size); sb_node_info.uncompressed_ptr = sb_node_info_buf.get(); tokutime_t decompress_t0 = toku_time_now(); - toku_decompress( - (Bytef *) sb_node_info.uncompressed_ptr, - sb_node_info.uncompressed_size, - (Bytef *) sb_node_info.compressed_ptr, - sb_node_info.compressed_size - ); + toku_decompress((Bytef *)sb_node_info.uncompressed_ptr, + sb_node_info.uncompressed_size, + (Bytef *)sb_node_info.compressed_ptr, + sb_node_info.compressed_size); tokutime_t decompress_t1 = toku_time_now(); decompress_time = decompress_t1 - decompress_t0; // at this point sb->uncompressed_ptr stores the serialized node info. r = deserialize_ftnode_info(&sb_node_info, node); if (r != 0) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_header_from_rbuf_if_small_enough - " + "file[%s], blocknum[%ld], deserialize_ftnode_info failed with " + "%d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + r); + dump_bad_block( + static_cast<unsigned char *>(sb_node_info.uncompressed_ptr), + sb_node_info.uncompressed_size); + dump_bad_block(rb->buf, rb->size); goto cleanup; } } @@ -1586,6 +1809,17 @@ deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode, PAIR_ATTR attr; r = toku_ftnode_pf_callback(node, *ndd, bfe, fd, &attr); if (r != 0) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_header_from_rbuf_if_small_enough - " + "file[%s], blocknum[%ld], toku_ftnode_pf_callback failed with " + "%d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + r); + dump_bad_block(rb->buf, rb->size); goto cleanup; } } @@ -1622,12 +1856,10 @@ cleanup: // that did not generate MSN's for messages. These new MSN's are // generated from the root downwards, counting backwards from MIN_MSN // and persisted in the ft header. -static int -deserialize_and_upgrade_internal_node(FTNODE node, - struct rbuf *rb, - ftnode_fetch_extra *bfe, - STAT64INFO info) -{ +static int deserialize_and_upgrade_internal_node(FTNODE node, + struct rbuf *rb, + ftnode_fetch_extra *bfe, + STAT64INFO info) { int version = node->layout_version_read_from_disk; if (version == FT_LAST_LAYOUT_VERSION_WITH_FINGERPRINT) { @@ -1892,25 +2124,25 @@ deserialize_and_upgrade_leaf_node(FTNODE node, return r; } -static int -read_and_decompress_block_from_fd_into_rbuf(int fd, BLOCKNUM blocknum, - DISKOFF offset, DISKOFF size, - FT ft, - struct rbuf *rb, - /* out */ int *layout_version_p); +static int read_and_decompress_block_from_fd_into_rbuf( + int fd, + BLOCKNUM blocknum, + DISKOFF offset, + DISKOFF size, + FT ft, + struct rbuf *rb, + /* out */ int *layout_version_p); // This function upgrades a version 14 or 13 ftnode to the current // version. NOTE: This code assumes the first field of the rbuf has // already been read from the buffer (namely the layout_version of the // ftnode.) -static int -deserialize_and_upgrade_ftnode(FTNODE node, - FTNODE_DISK_DATA* ndd, - BLOCKNUM blocknum, - ftnode_fetch_extra *bfe, - STAT64INFO info, - int fd) -{ +static int deserialize_and_upgrade_ftnode(FTNODE node, + FTNODE_DISK_DATA *ndd, + BLOCKNUM blocknum, + ftnode_fetch_extra *bfe, + STAT64INFO info, + int fd) { int r = 0; int version; @@ -1929,6 +2161,16 @@ deserialize_and_upgrade_ftnode(FTNODE node, &rb, &version); if (r != 0) { + const char* fname = toku_cachefile_fname_in_env(bfe->ft->cf); + fprintf(stderr, + "%s:%d:deserialize_and_upgrade_ftnode - " + "file[%s], blocknum[%ld], " + "read_and_decompress_block_from_fd_into_rbuf failed with %d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + r); goto exit; } @@ -1944,6 +2186,21 @@ deserialize_and_upgrade_ftnode(FTNODE node, // Copy over old version info. node->layout_version_read_from_disk = rbuf_int(&rb); // 2. layout version version = node->layout_version_read_from_disk; + if (version > FT_LAYOUT_VERSION_14) { + const char* fname = toku_cachefile_fname_in_env(bfe->ft->cf); + fprintf(stderr, + "%s:%d:deserialize_and_upgrade_ftnode - " + "file[%s], blocknum[%ld], version[%d] > " + "FT_LAYOUT_VERSION_14[%d]\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + version, + FT_LAYOUT_VERSION_14); + dump_bad_block(rb.buf, rb.size); + goto exit; + } assert(version <= FT_LAYOUT_VERSION_14); // Upgrade the current version number to the current version. node->layout_version = FT_LAYOUT_VERSION; @@ -1991,25 +2248,23 @@ exit: return r; } -static int -deserialize_ftnode_from_rbuf( - FTNODE *ftnode, - FTNODE_DISK_DATA* ndd, - BLOCKNUM blocknum, - uint32_t fullhash, - ftnode_fetch_extra *bfe, - STAT64INFO info, - struct rbuf *rb, - int fd - ) -// Effect: deserializes a ftnode that is in rb (with pointer of rb just past the magic) into a FTNODE. -{ +// Effect: deserializes a ftnode that is in rb (with pointer of rb just past the +// magic) into a FTNODE. +static int deserialize_ftnode_from_rbuf(FTNODE *ftnode, + FTNODE_DISK_DATA *ndd, + BLOCKNUM blocknum, + uint32_t fullhash, + ftnode_fetch_extra *bfe, + STAT64INFO info, + struct rbuf *rb, + int fd) { int r = 0; struct sub_block sb_node_info; tokutime_t t0, t1; tokutime_t decompress_time = 0; tokutime_t deserialize_time = 0; + const char* fname = toku_cachefile_fname_in_env(bfe->ft->cf); t0 = toku_time_now(); @@ -2019,8 +2274,26 @@ deserialize_ftnode_from_rbuf( // first thing we do is read the header information const void *magic; rbuf_literal_bytes(rb, &magic, 8); - if (memcmp(magic, "tokuleaf", 8)!=0 && - memcmp(magic, "tokunode", 8)!=0) { + if (memcmp(magic, "tokuleaf", 8) != 0 && + memcmp(magic, "tokunode", 8) != 0) { + fprintf(stderr, + "%s:%d:deserialize_ftnode_from_rbuf - " + "file[%s], blocknum[%ld], unrecognized magic number " + "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + static_cast<const uint8_t *>(magic)[0], + static_cast<const uint8_t *>(magic)[1], + static_cast<const uint8_t *>(magic)[2], + static_cast<const uint8_t *>(magic)[3], + static_cast<const uint8_t *>(magic)[4], + static_cast<const uint8_t *>(magic)[5], + static_cast<const uint8_t *>(magic)[6], + static_cast<const uint8_t *>(magic)[7]); + dump_bad_block(rb->buf, rb->size); + r = toku_db_badformat(); goto cleanup; } @@ -2034,6 +2307,16 @@ deserialize_ftnode_from_rbuf( // Perform the upgrade. r = deserialize_and_upgrade_ftnode(node, ndd, blocknum, bfe, info, fd); if (r != 0) { + fprintf(stderr, + "%s:%d:deserialize_ftnode_from_rbuf - " + "file[%s], blocknum[%ld], deserialize_and_upgrade_ftnode " + "failed with %d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + r); + dump_bad_block(rb->buf, rb->size); goto cleanup; } @@ -2069,6 +2352,16 @@ deserialize_ftnode_from_rbuf( uint32_t stored_checksum; stored_checksum = rbuf_int(rb); if (stored_checksum != checksum) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_from_rbuf - " + "file[%s], blocknum[%ld], stored_checksum[%d] != checksum[%d]\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + stored_checksum, + checksum); dump_bad_block(rb->buf, rb->size); invariant(stored_checksum == checksum); } @@ -2080,34 +2373,61 @@ deserialize_ftnode_from_rbuf( r = read_and_decompress_sub_block(rb, &sb_node_info); tokutime_t sb_decompress_t1 = toku_time_now(); decompress_time += sb_decompress_t1 - sb_decompress_t0; - } - if (r != 0) { - goto cleanup; + if (r != 0) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_from_rbuf - " + "file[%s], blocknum[%ld], read_and_decompress_sub_block failed " + "with %d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + r); + dump_bad_block( + static_cast<unsigned char *>(sb_node_info.uncompressed_ptr), + sb_node_info.uncompressed_size); + dump_bad_block(rb->buf, rb->size); + goto cleanup; + } } // at this point, sb->uncompressed_ptr stores the serialized node info r = deserialize_ftnode_info(&sb_node_info, node); if (r != 0) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_from_rbuf - " + "file[%s], blocknum[%ld], deserialize_ftnode_info failed with " + "%d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + r); + dump_bad_block(rb->buf, rb->size); goto cleanup; } toku_free(sb_node_info.uncompressed_ptr); - // now that the node info has been deserialized, we can proceed to deserialize - // the individual sub blocks + // now that the node info has been deserialized, we can proceed to + // deserialize the individual sub blocks // setup the memory of the partitions - // for partitions being decompressed, create either message buffer or basement node + // for partitions being decompressed, create either message buffer or + // basement node // for partitions staying compressed, create sub_block setup_ftnode_partitions(node, bfe, true); - // This loop is parallelizeable, since we don't have a dependency on the work done so far. + // This loop is parallelizeable, since we don't have a dependency on the + // work done so far. for (int i = 0; i < node->n_children; i++) { - uint32_t curr_offset = BP_START(*ndd,i); - uint32_t curr_size = BP_SIZE(*ndd,i); - // the compressed, serialized partitions start at where rb is currently pointing, - // which would be rb->buf + rb->ndone + uint32_t curr_offset = BP_START(*ndd, i); + uint32_t curr_size = BP_SIZE(*ndd, i); + // the compressed, serialized partitions start at where rb is currently + // pointing, which would be rb->buf + rb->ndone // we need to intialize curr_rbuf to point to this place - struct rbuf curr_rbuf = {.buf = NULL, .size = 0, .ndone = 0}; + struct rbuf curr_rbuf = {.buf = nullptr, .size = 0, .ndone = 0}; rbuf_init(&curr_rbuf, rb->buf + curr_offset, curr_size); // @@ -2120,26 +2440,45 @@ deserialize_ftnode_from_rbuf( // of the compressed partitions (also possibly none or possibly all) // The partitions that we want to decompress and make available // to the node, we do, the rest we simply copy in compressed - // form into the node, and set the state of the partition to PT_COMPRESSED + // form into the node, and set the state of the partition to + // PT_COMPRESSED // struct sub_block curr_sb; sub_block_init(&curr_sb); - // curr_rbuf is passed by value to decompress_and_deserialize_worker, so there's no ugly race condition. + // curr_rbuf is passed by value to decompress_and_deserialize_worker, + // so there's no ugly race condition. // This would be more obvious if curr_rbuf were an array. // deserialize_ftnode_info figures out what the state // should be and sets up the memory so that we are ready to use it - switch (BP_STATE(node,i)) { - case PT_AVAIL: { + switch (BP_STATE(node, i)) { + case PT_AVAIL: { // case where we read and decompress the partition tokutime_t partition_decompress_time; - r = decompress_and_deserialize_worker(curr_rbuf, curr_sb, node, i, - bfe->ft->cmp, &partition_decompress_time); + r = decompress_and_deserialize_worker( + curr_rbuf, + curr_sb, + node, + i, + bfe->ft->cmp, + &partition_decompress_time); decompress_time += partition_decompress_time; if (r != 0) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_from_rbuf - " + "file[%s], blocknum[%ld], childnum[%d], " + "decompress_and_deserialize_worker failed with %d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + i, + r); + dump_bad_block(rb->buf, rb->size); goto cleanup; } break; @@ -2148,6 +2487,19 @@ deserialize_ftnode_from_rbuf( // case where we leave the partition in the compressed state r = check_and_copy_compressed_sub_block_worker(curr_rbuf, curr_sb, node, i); if (r != 0) { + fprintf( + stderr, + "%s:%d:deserialize_ftnode_from_rbuf - " + "file[%s], blocknum[%ld], childnum[%d], " + "check_and_copy_compressed_sub_block_worker failed with " + "%d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + i, + r); + dump_bad_block(rb->buf, rb->size); goto cleanup; } break; @@ -2259,8 +2611,10 @@ toku_deserialize_bp_from_disk(FTNODE node, FTNODE_DISK_DATA ndd, int childnum, i } // Take a ftnode partition that is in the compressed state, and make it avail -int -toku_deserialize_bp_from_compressed(FTNODE node, int childnum, ftnode_fetch_extra *bfe) { +int toku_deserialize_bp_from_compressed(FTNODE node, + int childnum, + ftnode_fetch_extra *bfe) { + int r = 0; assert(BP_STATE(node, childnum) == PT_COMPRESSED); SUB_BLOCK curr_sb = BSB(node, childnum); @@ -2275,16 +2629,30 @@ toku_deserialize_bp_from_compressed(FTNODE node, int childnum, ftnode_fetch_extr // decompress the sub_block tokutime_t t0 = toku_time_now(); - toku_decompress( - (Bytef *) curr_sb->uncompressed_ptr, - curr_sb->uncompressed_size, - (Bytef *) curr_sb->compressed_ptr, - curr_sb->compressed_size - ); + toku_decompress((Bytef *)curr_sb->uncompressed_ptr, + curr_sb->uncompressed_size, + (Bytef *)curr_sb->compressed_ptr, + curr_sb->compressed_size); tokutime_t t1 = toku_time_now(); r = deserialize_ftnode_partition(curr_sb, node, childnum, bfe->ft->cmp); + if (r != 0) { + const char* fname = toku_cachefile_fname_in_env(bfe->ft->cf); + fprintf(stderr, + "%s:%d:toku_deserialize_bp_from_compressed - " + "file[%s], blocknum[%ld], " + "deserialize_ftnode_partition failed with %d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + node->blocknum.b, + r); + dump_bad_block(static_cast<unsigned char *>(curr_sb->compressed_ptr), + curr_sb->compressed_size); + dump_bad_block(static_cast<unsigned char *>(curr_sb->uncompressed_ptr), + curr_sb->uncompressed_size); + } tokutime_t t2 = toku_time_now(); @@ -2299,26 +2667,36 @@ toku_deserialize_bp_from_compressed(FTNODE node, int childnum, ftnode_fetch_extr return r; } -static int -deserialize_ftnode_from_fd(int fd, - BLOCKNUM blocknum, - uint32_t fullhash, - FTNODE *ftnode, - FTNODE_DISK_DATA *ndd, - ftnode_fetch_extra *bfe, - STAT64INFO info) -{ +static int deserialize_ftnode_from_fd(int fd, + BLOCKNUM blocknum, + uint32_t fullhash, + FTNODE *ftnode, + FTNODE_DISK_DATA *ndd, + ftnode_fetch_extra *bfe, + STAT64INFO info) { struct rbuf rb = RBUF_INITIALIZER; tokutime_t t0 = toku_time_now(); - read_block_from_fd_into_rbuf(fd, blocknum, bfe->ft, &rb); + read_block_from_fd_into_rbuf(fd, blocknum, bfe->ft, &rb); tokutime_t t1 = toku_time_now(); // Decompress and deserialize the ftnode. Time statistics // are taken inside this function. - int r = deserialize_ftnode_from_rbuf(ftnode, ndd, blocknum, fullhash, bfe, info, &rb, fd); + int r = deserialize_ftnode_from_rbuf( + ftnode, ndd, blocknum, fullhash, bfe, info, &rb, fd); if (r != 0) { - dump_bad_block(rb.buf,rb.size); + const char* fname = toku_cachefile_fname_in_env(bfe->ft->cf); + fprintf( + stderr, + "%s:%d:deserialize_ftnode_from_fd - " + "file[%s], blocknum[%ld], deserialize_ftnode_from_rbuf failed with " + "%d\n", + __FILE__, + __LINE__, + fname ? fname : "unknown", + blocknum.b, + r); + dump_bad_block(rb.buf, rb.size); } bfe->bytes_read = rb.size; @@ -2327,32 +2705,33 @@ deserialize_ftnode_from_fd(int fd, return r; } -// Read ftnode from file into struct. Perform version upgrade if necessary. -int -toku_deserialize_ftnode_from (int fd, - BLOCKNUM blocknum, - uint32_t fullhash, - FTNODE *ftnode, - FTNODE_DISK_DATA* ndd, - ftnode_fetch_extra *bfe - ) // Effect: Read a node in. If possible, read just the header. -{ +// Perform version upgrade if necessary. +int toku_deserialize_ftnode_from(int fd, + BLOCKNUM blocknum, + uint32_t fullhash, + FTNODE *ftnode, + FTNODE_DISK_DATA *ndd, + ftnode_fetch_extra *bfe) { int r = 0; struct rbuf rb = RBUF_INITIALIZER; - // each function below takes the appropriate io/decompression/deserialize statistics + // each function below takes the appropriate io/decompression/deserialize + // statistics if (!bfe->read_all_partitions) { - read_ftnode_header_from_fd_into_rbuf_if_small_enough(fd, blocknum, bfe->ft, &rb, bfe); - r = deserialize_ftnode_header_from_rbuf_if_small_enough(ftnode, ndd, blocknum, fullhash, bfe, &rb, fd); + read_ftnode_header_from_fd_into_rbuf_if_small_enough( + fd, blocknum, bfe->ft, &rb, bfe); + r = deserialize_ftnode_header_from_rbuf_if_small_enough( + ftnode, ndd, blocknum, fullhash, bfe, &rb, fd); } else { // force us to do it the old way r = -1; } if (r != 0) { // Something went wrong, go back to doing it the old way. - r = deserialize_ftnode_from_fd(fd, blocknum, fullhash, ftnode, ndd, bfe, NULL); + r = deserialize_ftnode_from_fd( + fd, blocknum, fullhash, ftnode, ndd, bfe, nullptr); } toku_free(rb.buf); @@ -2722,12 +3101,14 @@ static int decompress_from_raw_block_into_rbuf_versioned(uint32_t version, uint8 return r; } -static int -read_and_decompress_block_from_fd_into_rbuf(int fd, BLOCKNUM blocknum, - DISKOFF offset, DISKOFF size, - FT ft, - struct rbuf *rb, - /* out */ int *layout_version_p) { +static int read_and_decompress_block_from_fd_into_rbuf( + int fd, + BLOCKNUM blocknum, + DISKOFF offset, + DISKOFF size, + FT ft, + struct rbuf *rb, + /* out */ int *layout_version_p) { int r = 0; if (0) printf("Deserializing Block %" PRId64 "\n", blocknum.b); diff --git a/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.h b/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.h index 3ad616053e9..678139655f0 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.h +++ b/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.h @@ -46,21 +46,51 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #include "ft/serialize/block_table.h" unsigned int toku_serialize_ftnode_size(FTNODE node); -int toku_serialize_ftnode_to_memory(FTNODE node, FTNODE_DISK_DATA *ndd, - unsigned int basementnodesize, - enum toku_compression_method compression_method, - bool do_rebalancing, bool in_parallel, - size_t *n_bytes_to_write, size_t *n_uncompressed_bytes, - char **bytes_to_write); -int toku_serialize_ftnode_to(int fd, BLOCKNUM, FTNODE node, FTNODE_DISK_DATA *ndd, bool do_rebalancing, FT ft, bool for_checkpoint); -int toku_serialize_rollback_log_to(int fd, ROLLBACK_LOG_NODE log, SERIALIZED_ROLLBACK_LOG_NODE serialized_log, bool is_serialized, - FT ft, bool for_checkpoint); -void toku_serialize_rollback_log_to_memory_uncompressed(ROLLBACK_LOG_NODE log, SERIALIZED_ROLLBACK_LOG_NODE serialized); - -int toku_deserialize_rollback_log_from(int fd, BLOCKNUM blocknum, ROLLBACK_LOG_NODE *logp, FT ft); -int toku_deserialize_bp_from_disk(FTNODE node, FTNODE_DISK_DATA ndd, int childnum, int fd, ftnode_fetch_extra *bfe); -int toku_deserialize_bp_from_compressed(FTNODE node, int childnum, ftnode_fetch_extra *bfe); -int toku_deserialize_ftnode_from(int fd, BLOCKNUM off, uint32_t fullhash, FTNODE *node, FTNODE_DISK_DATA *ndd, ftnode_fetch_extra *bfe); +int toku_serialize_ftnode_to_memory( + FTNODE node, + FTNODE_DISK_DATA *ndd, + unsigned int basementnodesize, + enum toku_compression_method compression_method, + bool do_rebalancing, + bool in_parallel, + size_t *n_bytes_to_write, + size_t *n_uncompressed_bytes, + char **bytes_to_write); +int toku_serialize_ftnode_to(int fd, + BLOCKNUM, + FTNODE node, + FTNODE_DISK_DATA *ndd, + bool do_rebalancing, + FT ft, + bool for_checkpoint); +int toku_serialize_rollback_log_to(int fd, + ROLLBACK_LOG_NODE log, + SERIALIZED_ROLLBACK_LOG_NODE serialized_log, + bool is_serialized, + FT ft, + bool for_checkpoint); +void toku_serialize_rollback_log_to_memory_uncompressed( + ROLLBACK_LOG_NODE log, + SERIALIZED_ROLLBACK_LOG_NODE serialized); + +int toku_deserialize_rollback_log_from(int fd, + BLOCKNUM blocknum, + ROLLBACK_LOG_NODE *logp, + FT ft); +int toku_deserialize_bp_from_disk(FTNODE node, + FTNODE_DISK_DATA ndd, + int childnum, + int fd, + ftnode_fetch_extra *bfe); +int toku_deserialize_bp_from_compressed(FTNODE node, + int childnum, + ftnode_fetch_extra *bfe); +int toku_deserialize_ftnode_from(int fd, + BLOCKNUM off, + uint32_t fullhash, + FTNODE *node, + FTNODE_DISK_DATA *ndd, + ftnode_fetch_extra *bfe); void toku_serialize_set_parallel(bool); @@ -73,9 +103,14 @@ int decompress_from_raw_block_into_rbuf(uint8_t *raw_block, size_t raw_block_siz // used by verify int deserialize_ft_versioned(int fd, struct rbuf *rb, FT *ft, uint32_t version); -void read_block_from_fd_into_rbuf(int fd, BLOCKNUM blocknum, FT ft, struct rbuf *rb); +void read_block_from_fd_into_rbuf(int fd, + BLOCKNUM blocknum, + FT ft, + struct rbuf *rb); int read_compressed_sub_block(struct rbuf *rb, struct sub_block *sb); -int verify_ftnode_sub_block(struct sub_block *sb); +int verify_ftnode_sub_block(struct sub_block *sb, + const char *fname, + BLOCKNUM blocknum); void just_decompress_sub_block(struct sub_block *sb); // used by ft-node-deserialize.cc diff --git a/storage/tokudb/PerconaFT/ft/txn/roll.cc b/storage/tokudb/PerconaFT/ft/txn/roll.cc index 4f374d62173..97afd2f5bdb 100644 --- a/storage/tokudb/PerconaFT/ft/txn/roll.cc +++ b/storage/tokudb/PerconaFT/ft/txn/roll.cc @@ -203,7 +203,7 @@ int toku_rollback_frename(BYTESTRING old_iname, } if (toku_stat(new_iname_full.get(), &stat) == -1) { - if (ENOENT == errno) + if (ENOENT == errno || ENAMETOOLONG == errno) new_exist = false; else return 1; diff --git a/storage/tokudb/PerconaFT/ft/txn/txn.cc b/storage/tokudb/PerconaFT/ft/txn/txn.cc index 9e48d0d05dd..a3ce6beb7b0 100644 --- a/storage/tokudb/PerconaFT/ft/txn/txn.cc +++ b/storage/tokudb/PerconaFT/ft/txn/txn.cc @@ -707,8 +707,8 @@ bool toku_txn_has_spilled_rollback(TOKUTXN txn) { } void toku_txn_get_client_id(TOKUTXN txn, uint64_t *client_id, void **client_extra) { - *client_id = txn->client_id; - *client_extra = txn->client_extra; + if (client_id) *client_id = txn->client_id; + if (client_extra) *client_extra = txn->client_extra; } void toku_txn_set_client_id(TOKUTXN txn, uint64_t client_id, void *client_extra) { diff --git a/storage/tokudb/PerconaFT/locktree/lock_request.cc b/storage/tokudb/PerconaFT/locktree/lock_request.cc index 943362e1b9d..0151b5bd466 100644 --- a/storage/tokudb/PerconaFT/locktree/lock_request.cc +++ b/storage/tokudb/PerconaFT/locktree/lock_request.cc @@ -175,7 +175,8 @@ int lock_request::start(void) { m_state = state::PENDING; m_start_time = toku_current_time_microsec() / 1000; m_conflicting_txnid = conflicts.get(0); - if (m_start_before_pending_test_callback) m_start_before_pending_test_callback(); + if (m_start_before_pending_test_callback) + m_start_before_pending_test_callback(); toku_mutex_lock(&m_info->mutex); insert_into_lock_requests(); if (deadlock_exists(conflicts)) { @@ -183,7 +184,8 @@ int lock_request::start(void) { r = DB_LOCK_DEADLOCK; } toku_mutex_unlock(&m_info->mutex); - if (m_start_test_callback) m_start_test_callback(); // test callback + if (m_start_test_callback) + m_start_test_callback(); // test callback } if (r != DB_LOCK_NOTGRANTED) { @@ -242,13 +244,13 @@ int lock_request::wait(uint64_t wait_time_ms, uint64_t killed_time_ms, int (*kil invariant(r == 0 || r == ETIMEDOUT); t_now = toku_current_time_microsec(); - if (m_state == state::PENDING && t_now >= t_end) { + if (m_state == state::PENDING && (t_now >= t_end)) { m_info->counters.timeout_count += 1; - + // if we're still pending and we timed out, then remove our // request from the set of lock requests and fail. remove_from_lock_requests(); - + // complete sets m_state to COMPLETE, breaking us out of the loop complete(DB_LOCK_NOTGRANTED); } @@ -297,13 +299,15 @@ TXNID lock_request::get_conflicting_txnid(void) const { int lock_request::retry(GrowableArray<TXNID> *conflicts_collector) { invariant(m_state == state::PENDING); int r; - txnid_set conflicts; conflicts.create(); + if (m_type == type::WRITE) { - r = m_lt->acquire_write_lock(m_txnid, m_left_key, m_right_key, &conflicts, m_big_txn); + r = m_lt->acquire_write_lock( + m_txnid, m_left_key, m_right_key, &conflicts, m_big_txn); } else { - r = m_lt->acquire_read_lock(m_txnid, m_left_key, m_right_key, &conflicts, m_big_txn); + r = m_lt->acquire_read_lock( + m_txnid, m_left_key, m_right_key, &conflicts, m_big_txn); } // if the acquisition succeeded then remove ourselves from the @@ -311,7 +315,8 @@ int lock_request::retry(GrowableArray<TXNID> *conflicts_collector) { if (r == 0) { remove_from_lock_requests(); complete(r); - if (m_retry_test_callback) m_retry_test_callback(); // test callback + if (m_retry_test_callback) + m_retry_test_callback(); // test callback toku_cond_broadcast(&m_wait_cond); } else { m_conflicting_txnid = conflicts.get(0); @@ -322,54 +327,78 @@ int lock_request::retry(GrowableArray<TXNID> *conflicts_collector) { return r; } -void lock_request::retry_all_lock_requests(locktree *lt, void (*lock_wait_callback)(void *, TXNID, TXNID), void (*after_retry_all_test_callback)(void)) { +void lock_request::retry_all_lock_requests( + locktree *lt, + void (*lock_wait_callback)(void *, TXNID, TXNID), + void (*after_retry_all_test_callback)(void)) { lt_lock_request_info *info = lt->get_lock_request_info(); - info->retry_want++; - // if there are no pending lock requests than there is nothing to do // the unlocked data race on pending_is_empty is OK since lock requests // are retried after added to the pending set. if (info->pending_is_empty) return; - toku_mutex_lock(&info->mutex); + // get my retry generation (post increment of retry_want) + unsigned long long my_retry_want = (info->retry_want += 1); + + toku_mutex_lock(&info->retry_mutex); GrowableArray<TXNID> conflicts_collector; conflicts_collector.init(); // here is the group retry algorithm. - // get the latest retry_want count and use it as the generation number of this retry operation. - // if this retry generation is > the last retry generation, then do the lock retries. otherwise, - // no lock retries are needed. - unsigned long long retry_gen = info->retry_want.load(); - if (retry_gen > info->retry_done) { - - // retry all of the pending lock requests. - for (size_t i = 0; i < info->pending_lock_requests.size(); ) { - lock_request *request; - int r = info->pending_lock_requests.fetch(i, &request); - invariant_zero(r); - - // retry this lock request. if it didn't succeed, - // move on to the next lock request. otherwise - // the request is gone from the list so we may - // read the i'th entry for the next one. - r = request->retry(&conflicts_collector); - if (r != 0) { - i++; + // get the latest retry_want count and use it as the generation number of + // this retry operation. if this retry generation is > the last retry + // generation, then do the lock retries. otherwise, no lock retries + // are needed. + if ((my_retry_want - 1) == info->retry_done) { + for (;;) { + if (!info->running_retry) { + info->running_retry = true; + info->retry_done = info->retry_want; + toku_mutex_unlock(&info->retry_mutex); + retry_all_lock_requests_info(info, &conflicts_collector); + if (after_retry_all_test_callback) + after_retry_all_test_callback(); + toku_mutex_lock(&info->retry_mutex); + info->running_retry = false; + toku_cond_broadcast(&info->retry_cv); + break; + } else { + toku_cond_wait(&info->retry_cv, &info->retry_mutex); } } - if (after_retry_all_test_callback) after_retry_all_test_callback(); - info->retry_done = retry_gen; } - - toku_mutex_unlock(&info->mutex); + toku_mutex_unlock(&info->retry_mutex); report_waits(&conflicts_collector, lock_wait_callback); conflicts_collector.deinit(); } +void lock_request::retry_all_lock_requests_info(lt_lock_request_info *info, GrowableArray<TXNID> *collector) { + toku_mutex_lock(&info->mutex); + // retry all of the pending lock requests. + for (size_t i = 0; i < info->pending_lock_requests.size();) { + lock_request *request; + int r = info->pending_lock_requests.fetch(i, &request); + invariant_zero(r); + + // retry the lock request. if it didn't succeed, + // move on to the next lock request. otherwise + // the request is gone from the list so we may + // read the i'th entry for the next one. + r = request->retry(collector); + if (r != 0) { + i++; + } + } + + // future threads should only retry lock requests if some still exist + info->should_retry_lock_requests = info->pending_lock_requests.size() > 0; + toku_mutex_unlock(&info->mutex); +} + void lock_request::add_conflicts_to_waits(txnid_set *conflicts, GrowableArray<TXNID> *wait_conflicts) { size_t num_conflicts = conflicts->size(); @@ -429,7 +458,8 @@ lock_request *lock_request::find_lock_request(const TXNID &txnid) { void lock_request::insert_into_lock_requests(void) { uint32_t idx; lock_request *request; - int r = m_info->pending_lock_requests.find_zero<TXNID, find_by_txnid>(m_txnid, &request, &idx); + int r = m_info->pending_lock_requests.find_zero<TXNID, find_by_txnid>( + m_txnid, &request, &idx); invariant(r == DB_NOTFOUND); r = m_info->pending_lock_requests.insert_at(this, idx); invariant_zero(r); @@ -440,7 +470,8 @@ void lock_request::insert_into_lock_requests(void) { void lock_request::remove_from_lock_requests(void) { uint32_t idx; lock_request *request; - int r = m_info->pending_lock_requests.find_zero<TXNID, find_by_txnid>(m_txnid, &request, &idx); + int r = m_info->pending_lock_requests.find_zero<TXNID, find_by_txnid>( + m_txnid, &request, &idx); invariant_zero(r); invariant(request == this); r = m_info->pending_lock_requests.delete_at(idx); @@ -449,7 +480,8 @@ void lock_request::remove_from_lock_requests(void) { m_info->pending_is_empty = true; } -int lock_request::find_by_txnid(lock_request * const &request, const TXNID &txnid) { +int lock_request::find_by_txnid(lock_request *const &request, + const TXNID &txnid) { TXNID request_txnid = request->m_txnid; if (request_txnid < txnid) { return -1; diff --git a/storage/tokudb/PerconaFT/locktree/lock_request.h b/storage/tokudb/PerconaFT/locktree/lock_request.h index 1fa94ef5b96..9e82b31541e 100644 --- a/storage/tokudb/PerconaFT/locktree/lock_request.h +++ b/storage/tokudb/PerconaFT/locktree/lock_request.h @@ -108,9 +108,14 @@ public: TXNID get_conflicting_txnid(void) const; // effect: Retries all of the lock requests for the given locktree. - // Any lock requests successfully restarted is completed and woken up. + // Any lock requests successfully restarted is completed and woken + // up. // The rest remain pending. - static void retry_all_lock_requests(locktree *lt, void (*lock_wait_callback)(void *, TXNID, TXNID) = nullptr, void (*after_retry_test_callback)(void) = nullptr); + static void retry_all_lock_requests( + locktree *lt, + void (*lock_wait_callback)(void *, TXNID, TXNID) = nullptr, + void (*after_retry_test_callback)(void) = nullptr); + static void retry_all_lock_requests_info(lt_lock_request_info *info, GrowableArray<TXNID> *collector); void set_start_test_callback(void (*f)(void)); void set_start_before_pending_test_callback(void (*f)(void)); @@ -121,7 +126,7 @@ public: void kill_waiter(void); static void kill_waiter(locktree *lt, void *extra); -private: + private: enum state { UNINITIALIZED, INITIALIZED, @@ -193,7 +198,7 @@ private: void copy_keys(void); - static int find_by_txnid(lock_request * const &request, const TXNID &txnid); + static int find_by_txnid(lock_request *const &request, const TXNID &txnid); // Report list of conflicts to lock wait callback. static void report_waits(GrowableArray<TXNID> *wait_conflicts, diff --git a/storage/tokudb/PerconaFT/locktree/locktree.cc b/storage/tokudb/PerconaFT/locktree/locktree.cc index 11f8a4e5ff7..2fbf078bdd6 100644 --- a/storage/tokudb/PerconaFT/locktree/locktree.cc +++ b/storage/tokudb/PerconaFT/locktree/locktree.cc @@ -80,15 +80,24 @@ void locktree::create(locktree_manager *mgr, DICTIONARY_ID dict_id, const compar m_sto_end_early_count = 0; m_sto_end_early_time = 0; - m_lock_request_info.pending_lock_requests.create(); - m_lock_request_info.pending_is_empty = true; - ZERO_STRUCT(m_lock_request_info.mutex); - toku_mutex_init(&m_lock_request_info.mutex, nullptr); - m_lock_request_info.retry_want = m_lock_request_info.retry_done = 0; - ZERO_STRUCT(m_lock_request_info.counters); + m_lock_request_info.init(); +} + +void lt_lock_request_info::init(void) { + pending_lock_requests.create(); + pending_is_empty = true; + ZERO_STRUCT(mutex); + toku_mutex_init(&mutex, nullptr); + retry_want = retry_done = 0; + ZERO_STRUCT(counters); + ZERO_STRUCT(retry_mutex); + toku_mutex_init(&retry_mutex, nullptr); + toku_cond_init(&retry_cv, nullptr); + running_retry = false; - TOKU_VALGRIND_HG_DISABLE_CHECKING(&m_lock_request_info.pending_is_empty, sizeof(m_lock_request_info.pending_is_empty)); - TOKU_DRD_IGNORE_VAR(m_lock_request_info.pending_is_empty); + TOKU_VALGRIND_HG_DISABLE_CHECKING(&pending_is_empty, + sizeof(pending_is_empty)); + TOKU_DRD_IGNORE_VAR(pending_is_empty); } void locktree::destroy(void) { @@ -98,11 +107,18 @@ void locktree::destroy(void) { m_rangetree->destroy(); toku_free(m_rangetree); m_sto_buffer.destroy(); - m_lock_request_info.pending_lock_requests.destroy(); + m_lock_request_info.destroy(); +} + +void lt_lock_request_info::destroy(void) { + pending_lock_requests.destroy(); + toku_mutex_destroy(&mutex); + toku_mutex_destroy(&retry_mutex); + toku_cond_destroy(&retry_cv); } void locktree::add_reference(void) { - (void) toku_sync_add_and_fetch(&m_reference_count, 1); + (void)toku_sync_add_and_fetch(&m_reference_count, 1); } uint32_t locktree::release_reference(void) { diff --git a/storage/tokudb/PerconaFT/locktree/locktree.h b/storage/tokudb/PerconaFT/locktree/locktree.h index 64171c51b23..1ba7a51b124 100644 --- a/storage/tokudb/PerconaFT/locktree/locktree.h +++ b/storage/tokudb/PerconaFT/locktree/locktree.h @@ -41,11 +41,11 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #include <atomic> #include <db.h> -#include <toku_time.h> #include <toku_pthread.h> +#include <toku_time.h> -#include <ft/ft-ops.h> // just for DICTIONARY_ID.. #include <ft/comparator.h> +#include <ft/ft-ops.h> // just for DICTIONARY_ID.. #include <util/omt.h> @@ -84,20 +84,31 @@ namespace toku { omt<lock_request *> pending_lock_requests; std::atomic_bool pending_is_empty; toku_mutex_t mutex; + bool should_retry_lock_requests; lt_counters counters; std::atomic_ullong retry_want; unsigned long long retry_done; + toku_mutex_t retry_mutex; + toku_cond_t retry_cv; + bool running_retry; + + void init(void); + void destroy(void); }; - // The locktree manager manages a set of locktrees, one for each open dictionary. - // Locktrees are retrieved from the manager. When they are no longer needed, they - // are be released by the user. + // The locktree manager manages a set of locktrees, one for each open + // dictionary. Locktrees are retrieved from the manager. When they are no + // longer needed, they are be released by the user. class locktree_manager { - public: + public: // param: create_cb, called just after a locktree is first created. // destroy_cb, called just before a locktree is destroyed. - // escalate_cb, called after a locktree is escalated (with extra param) - void create(lt_create_cb create_cb, lt_destroy_cb destroy_cb, lt_escalate_cb escalate_cb, void *extra); + // escalate_cb, called after a locktree is escalated (with extra + // param) + void create(lt_create_cb create_cb, + lt_destroy_cb destroy_cb, + lt_escalate_cb escalate_cb, + void *extra); void destroy(void); diff --git a/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_release_wait.cc b/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_release_wait.cc index eb19ceb70e5..717628f9df7 100644 --- a/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_release_wait.cc +++ b/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_release_wait.cc @@ -1,84 +1,87 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -// test the race between start, release, and wait. since start does not put its -// lock request into the pending set, the blocking txn could release its lock before -// the first txn waits. this will block the first txn because its lock request is -// not known when the lock is released. the bug fix is to try again when lock retries -// are locked out. +// test the race between start, release, and wait. since start does not put +// its lock request into the pending set, the blocking txn could release its +// lock before the first txn waits. this will block the first txn because its +// lock request is not known when the lock is released. the bug fix is to try +// again when lock retries are locked out. -#include "locktree.h" #include "lock_request.h" -#include "test.h" -#include "locktree_unit_test.h" -#include <thread> #include <atomic> +#include <thread> +#include "locktree.h" +#include "locktree_unit_test.h" +#include "test.h" namespace toku { -const uint64_t my_lock_wait_time = 1000 * 1000; // ms -const uint64_t my_killed_time = 1 * 1000; // ms - -static uint64_t t_wait; - -static int my_killed_callback(void) { - uint64_t t_now = toku_current_time_microsec(); - assert(t_now >= t_wait); - if (t_now - t_wait >= my_killed_time*1000) - abort(); - return 0; -} - -static void locktree_release_lock(locktree *lt, TXNID txn_id, const DBT *left, const DBT *right) { - range_buffer buffer; - buffer.create(); - buffer.append(left, right); - lt->release_locks(txn_id, &buffer); - buffer.destroy(); -} - -static void test_start_release_wait(void) { - int r; - - locktree_manager mgr; - mgr.create(nullptr, nullptr, nullptr, nullptr); - - DICTIONARY_ID dict_id = { 1 }; - locktree *lt = mgr.get_lt(dict_id, dbt_comparator, nullptr); - - const DBT *one = get_dbt(1); - - // a locks one - lock_request a; - a.create(); - a.set(lt, 1, one, one, lock_request::type::WRITE, false); - r = a.start(); - assert(r == 0); - - // b tries to lock one, fails - lock_request b; - b.create(); - b.set(lt, 2, one, one, lock_request::type::WRITE, false); - r = b.start(); - assert(r == DB_LOCK_NOTGRANTED); - - // a releases its lock - locktree_release_lock(lt, 1, one, one); - - // b waits for one, gets locks immediately - t_wait = toku_current_time_microsec(); - r = b.wait(my_lock_wait_time, my_killed_time, my_killed_callback); - assert(r == 0); - - // b releases its lock so we can exit cleanly - locktree_release_lock(lt, 2, one, one); - - a.destroy(); - b.destroy(); - - mgr.release_lt(lt); - mgr.destroy(); -} + const uint64_t my_lock_wait_time = 1000 * 1000; // ms + const uint64_t my_killed_time = 1 * 1000; // ms + + static uint64_t t_wait; + + static int my_killed_callback(void) { + uint64_t t_now = toku_current_time_microsec(); + assert(t_now >= t_wait); + if (t_now - t_wait >= my_killed_time * 1000) + abort(); + return 0; + } + + static void locktree_release_lock(locktree *lt, + TXNID txn_id, + const DBT *left, + const DBT *right) { + range_buffer buffer; + buffer.create(); + buffer.append(left, right); + lt->release_locks(txn_id, &buffer); + buffer.destroy(); + } + + static void test_start_release_wait(void) { + int r; + + locktree_manager mgr; + mgr.create(nullptr, nullptr, nullptr, nullptr); + + DICTIONARY_ID dict_id = {1}; + locktree *lt = mgr.get_lt(dict_id, dbt_comparator, nullptr); + + const DBT *one = get_dbt(1); + + // a locks one + lock_request a; + a.create(); + a.set(lt, 1, one, one, lock_request::type::WRITE, false); + r = a.start(); + assert(r == 0); + + // b tries to lock one, fails + lock_request b; + b.create(); + b.set(lt, 2, one, one, lock_request::type::WRITE, false); + r = b.start(); + assert(r == DB_LOCK_NOTGRANTED); + + // a releases its lock + locktree_release_lock(lt, 1, one, one); + + // b waits for one, gets locks immediately + t_wait = toku_current_time_microsec(); + r = b.wait(my_lock_wait_time, my_killed_time, my_killed_callback); + assert(r == 0); + + // b releases its lock so we can exit cleanly + locktree_release_lock(lt, 2, one, one); + + a.destroy(); + b.destroy(); + + mgr.release_lt(lt); + mgr.destroy(); + } } /* namespace toku */ @@ -86,4 +89,3 @@ int main(void) { toku::test_start_release_wait(); return 0; } - diff --git a/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_race.cc b/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_race.cc index 88493ec9ce0..5c28701c49e 100644 --- a/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_race.cc +++ b/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_race.cc @@ -34,13 +34,14 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. along with PerconaFT. If not, see <http://www.gnu.org/licenses/>. ======= */ -#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#ident \ + "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include "lock_request.h" #include <iostream> #include <thread> -#include "test.h" #include "locktree.h" -#include "lock_request.h" +#include "test.h" // Test FT-633, the data race on the lock request between ::start and ::retry // This test is non-deterministic. It uses sleeps at 2 critical places to @@ -48,57 +49,54 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. namespace toku { -static void locker_callback(void) { - usleep(10000); -} - -static void run_locker(locktree *lt, TXNID txnid, const DBT *key) { - int i; - for (i = 0; i < 1000; i++) { - - lock_request request; - request.create(); - - request.set(lt, txnid, key, key, lock_request::type::WRITE, false); - - // set the test callbacks - request.set_start_test_callback(locker_callback); - request.set_retry_test_callback(locker_callback); - - // try to acquire the lock - int r = request.start(); - if (r == DB_LOCK_NOTGRANTED) { - // wait for the lock to be granted - r = request.wait(10 * 1000); - } - - if (r == 0) { - // release the lock - range_buffer buffer; - buffer.create(); - buffer.append(key, key); - lt->release_locks(txnid, &buffer); - buffer.destroy(); - - // retry pending lock requests - lock_request::retry_all_lock_requests(lt); + static void locker_callback(void) { usleep(10000); } + + static void run_locker(locktree *lt, TXNID txnid, const DBT *key) { + int i; + for (i = 0; i < 1000; i++) { + lock_request request; + request.create(); + + request.set(lt, txnid, key, key, lock_request::type::WRITE, false); + + // set the test callbacks + request.set_start_test_callback(locker_callback); + request.set_retry_test_callback(locker_callback); + + // try to acquire the lock + int r = request.start(); + if (r == DB_LOCK_NOTGRANTED) { + // wait for the lock to be granted + r = request.wait(10 * 1000); + } + + if (r == 0) { + // release the lock + range_buffer buffer; + buffer.create(); + buffer.append(key, key); + lt->release_locks(txnid, &buffer); + buffer.destroy(); + + // retry pending lock requests + lock_request::retry_all_lock_requests(lt); + } + + request.destroy(); + memset(&request, 0xab, sizeof request); + + toku_pthread_yield(); + if ((i % 10) == 0) + std::cerr << std::this_thread::get_id() << " " << i + << std::endl; } - - request.destroy(); - memset(&request, 0xab, sizeof request); - - toku_pthread_yield(); - if ((i % 10) == 0) - std::cout << std::this_thread::get_id() << " " << i << std::endl; } -} } /* namespace toku */ int main(void) { - toku::locktree lt; - DICTIONARY_ID dict_id = { 1 }; + DICTIONARY_ID dict_id = {1}; lt.create(nullptr, dict_id, toku::dbt_comparator); const DBT *one = toku::get_dbt(1); diff --git a/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_race_3.cc b/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_race_3.cc index 8f0d86c9f64..8458bae6b8c 100644 --- a/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_race_3.cc +++ b/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_race_3.cc @@ -34,77 +34,82 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. along with PerconaFT. If not, see <http://www.gnu.org/licenses/>. ======= */ -#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#ident \ + "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include "lock_request.h" +#include <pthread.h> #include <iostream> #include <thread> -#include <pthread.h> -#include "test.h" #include "locktree.h" -#include "lock_request.h" +#include "test.h" -// Suppose that 3 threads are running a lock acquire, release, retry sequence. There is -// a race in the retry algorithm with 2 threads running lock retry simultaneously. The -// first thread to run retry sets a flag that will cause the second thread to skip the -// lock retries. If the first thread progressed past the contended lock, then the second -// threa will HANG until its lock timer pops, even when the contended lock is no longer held. +// Suppose that 3 threads are running a lock acquire, release, retry sequence. +// There is a race in the retry algorithm with 2 threads running lock retry +// simultaneously. The first thread to run retry sets a flag that will cause +// the second thread to skip the lock retries. If the first thread progressed +// past the contended lock, then the second threa will HANG until its lock timer +// pops, even when the contended lock is no longer held. -// This test exposes this problem as a test hang. The group retry algorithm fixes the race -// in the lock request retry algorihm and this test should no longer hang. +// This test exposes this problem as a test hang. The group retry algorithm +// fixes the race in the lock request retry algorihm and this test should no +// longer hang. namespace toku { -// use 1000 when after_retry_all is implemented, otherwise use 100000 -static const int n_tests = 1000; // 100000; - -static void after_retry_all(void) { - usleep(10000); -} - -static void run_locker(locktree *lt, TXNID txnid, const DBT *key, pthread_barrier_t *b) { - for (int i = 0; i < n_tests; i++) { - int r; - r = pthread_barrier_wait(b); assert(r == 0 || r == PTHREAD_BARRIER_SERIAL_THREAD); - - lock_request request; - request.create(); - - request.set(lt, txnid, key, key, lock_request::type::WRITE, false); - - // try to acquire the lock - r = request.start(); - if (r == DB_LOCK_NOTGRANTED) { - // wait for the lock to be granted - r = request.wait(1000 * 1000); - } - - if (r == 0) { - // release the lock - range_buffer buffer; - buffer.create(); - buffer.append(key, key); - lt->release_locks(txnid, &buffer); - buffer.destroy(); - - // retry pending lock requests - lock_request::retry_all_lock_requests(lt, nullptr, after_retry_all); + // use 1000 when after_retry_all is implemented, otherwise use 100000 + static const int n_tests = 1000; // 100000; + + static void after_retry_all(void) { usleep(10000); } + + static void run_locker(locktree *lt, + TXNID txnid, + const DBT *key, + pthread_barrier_t *b) { + for (int i = 0; i < n_tests; i++) { + int r; + r = pthread_barrier_wait(b); + assert(r == 0 || r == PTHREAD_BARRIER_SERIAL_THREAD); + + lock_request request; + request.create(); + + request.set(lt, txnid, key, key, lock_request::type::WRITE, false); + + // try to acquire the lock + r = request.start(); + if (r == DB_LOCK_NOTGRANTED) { + // wait for the lock to be granted + r = request.wait(1000 * 1000); + } + + if (r == 0) { + // release the lock + range_buffer buffer; + buffer.create(); + buffer.append(key, key); + lt->release_locks(txnid, &buffer); + buffer.destroy(); + + // retry pending lock requests + lock_request::retry_all_lock_requests(lt, nullptr, after_retry_all); + } + + request.destroy(); + memset(&request, 0xab, sizeof request); + + toku_pthread_yield(); + if ((i % 10) == 0) + std::cerr << std::this_thread::get_id() << " " << i + << std::endl; } - - request.destroy(); - memset(&request, 0xab, sizeof request); - - toku_pthread_yield(); - if ((i % 10) == 0) - std::cout << std::this_thread::get_id() << " " << i << std::endl; } -} } /* namespace toku */ int main(void) { - toku::locktree lt; - DICTIONARY_ID dict_id = { 1 }; + DICTIONARY_ID dict_id = {1}; lt.create(nullptr, dict_id, toku::dbt_comparator); const DBT *one = toku::get_dbt(1); @@ -112,16 +117,17 @@ int main(void) { const int n_workers = 3; std::thread worker[n_workers]; pthread_barrier_t b; - int r = pthread_barrier_init(&b, nullptr, n_workers); assert(r == 0); + int r = pthread_barrier_init(&b, nullptr, n_workers); + assert(r == 0); for (int i = 0; i < n_workers; i++) { worker[i] = std::thread(toku::run_locker, <, i, one, &b); } for (int i = 0; i < n_workers; i++) { worker[i].join(); } - r = pthread_barrier_destroy(&b); assert(r == 0); + r = pthread_barrier_destroy(&b); + assert(r == 0); lt.release_reference(); lt.destroy(); return 0; } - diff --git a/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_wait_race_2.cc b/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_wait_race_2.cc index a2ceff99edb..4b6dadd440f 100644 --- a/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_wait_race_2.cc +++ b/storage/tokudb/PerconaFT/locktree/tests/lock_request_start_retry_wait_race_2.cc @@ -34,78 +34,84 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. along with PerconaFT. If not, see <http://www.gnu.org/licenses/>. ======= */ -#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#ident \ + "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include "lock_request.h" +#include <pthread.h> #include <iostream> #include <thread> -#include <pthread.h> -#include "test.h" #include "locktree.h" -#include "lock_request.h" +#include "test.h" -// Suppose that 2 threads are running a lock acquire, release, retry sequence. There is a -// race between the acquire and the release with 2 threads. If thread 1 acquires a lock, -// and thread 2 tries to acquire the same lock and fails, thread 1 may release its lock and retry -// pending lock requests BEFORE thread 2 adds itself to the pending lock requests. If this -// happens, then thread 2 will HANG until its lock timer expires even when the lock it is +// Suppose that 2 threads are running a lock acquire, release, retry sequence. +// There is a race between the acquire and the release with 2 threads. +// If thread 1 acquires a lock, and thread 2 tries to acquire the same lock and +// fails, thread 1 may release its lock and retry pending lock requests BEFORE +// thread 2 adds itself to the pending lock requests. If this happens, then +// thread 2 will HANG until its lock timer expires even when the lock it is // waiting for is FREE. -// This test exposes this problem as a test hang. If the race is fixed, then the test runs to -// completion. +// This test exposes this problem as a test hang. If the race is fixed, then +// the test runs to completion. namespace toku { -static void start_before_pending(void) { - usleep(10000); -} - -static void run_locker(locktree *lt, TXNID txnid, const DBT *key, pthread_barrier_t *b) { - for (int i = 0; i < 100000; i++) { - int r; - r = pthread_barrier_wait(b); assert(r == 0 || r == PTHREAD_BARRIER_SERIAL_THREAD); - - lock_request request; - request.create(); - request.set(lt, txnid, key, key, lock_request::type::WRITE, false); - - // if the callback is included, then the race is easy to reproduce. Otherwise, several - // test runs may be required before the race happens. - if (1) request.set_start_before_pending_test_callback(start_before_pending); - - // try to acquire the lock - r = request.start(); - if (r == DB_LOCK_NOTGRANTED) { - // wait for the lock to be granted - r = request.wait(1000 * 1000); + static void start_before_pending(void) { usleep(10000); } + + static void run_locker(locktree *lt, + TXNID txnid, + const DBT *key, + pthread_barrier_t *b) { + for (int i = 0; i < 100000; i++) { + int r; + r = pthread_barrier_wait(b); + assert(r == 0 || r == PTHREAD_BARRIER_SERIAL_THREAD); + + lock_request request; + request.create(); + request.set(lt, txnid, key, key, lock_request::type::WRITE, false); + + // if the callback is included, then the race is easy to reproduce. + // Otherwise, several test runs may be required before the race + // happens. + request.set_start_before_pending_test_callback( + start_before_pending); + + // try to acquire the lock + r = request.start(); + if (r == DB_LOCK_NOTGRANTED) { + // wait for the lock to be granted + r = request.wait(1000 * 1000); + } + + if (r == 0) { + // release the lock + range_buffer buffer; + buffer.create(); + buffer.append(key, key); + lt->release_locks(txnid, &buffer); + buffer.destroy(); + + // retry pending lock requests + lock_request::retry_all_lock_requests(lt); + } + + request.destroy(); + memset(&request, 0xab, sizeof request); + + toku_pthread_yield(); + if ((i % 10) == 0) + std::cerr << std::this_thread::get_id() << " " << i + << std::endl; } - - if (r == 0) { - // release the lock - range_buffer buffer; - buffer.create(); - buffer.append(key, key); - lt->release_locks(txnid, &buffer); - buffer.destroy(); - - // retry pending lock requests - lock_request::retry_all_lock_requests(lt); - } - - request.destroy(); - memset(&request, 0xab, sizeof request); - - toku_pthread_yield(); - if ((i % 10) == 0) - std::cout << std::this_thread::get_id() << " " << i << std::endl; } -} } /* namespace toku */ int main(void) { - toku::locktree lt; - DICTIONARY_ID dict_id = { 1 }; + DICTIONARY_ID dict_id = {1}; lt.create(nullptr, dict_id, toku::dbt_comparator); const DBT *one = toku::get_dbt(1); @@ -113,16 +119,17 @@ int main(void) { const int n_workers = 2; std::thread worker[n_workers]; pthread_barrier_t b; - int r = pthread_barrier_init(&b, nullptr, n_workers); assert(r == 0); + int r = pthread_barrier_init(&b, nullptr, n_workers); + assert(r == 0); for (int i = 0; i < n_workers; i++) { worker[i] = std::thread(toku::run_locker, <, i, one, &b); } for (int i = 0; i < n_workers; i++) { worker[i].join(); } - r = pthread_barrier_destroy(&b); assert(r == 0); + r = pthread_barrier_destroy(&b); + assert(r == 0); lt.release_reference(); lt.destroy(); return 0; } - diff --git a/storage/tokudb/PerconaFT/portability/toku_debug_sync.h b/storage/tokudb/PerconaFT/portability/toku_debug_sync.h new file mode 100644 index 00000000000..b5394e58d68 --- /dev/null +++ b/storage/tokudb/PerconaFT/portability/toku_debug_sync.h @@ -0,0 +1,77 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/*====== +This file is part of PerconaFT. + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + PerconaFT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + PerconaFT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with PerconaFT. If not, see <http://www.gnu.org/licenses/>. + +---------------------------------------- + + PerconaFT is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License, version 3, + as published by the Free Software Foundation. + + PerconaFT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with PerconaFT. If not, see <http://www.gnu.org/licenses/>. +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#pragma once + +struct tokutxn; + +#if defined(ENABLED_DEBUG_SYNC) + +/* + the below macros are defined in my_global.h, which is included in m_string.h, + the same macros are defined in TokuSetupCompiler.cmake as compiler options, + undefine them here to avoid build errors +*/ +#undef __STDC_FORMAT_MACROS +#undef __STDC_LIMIT_MACROS + +#include "m_string.h" +#include "debug_sync.h" + +void toku_txn_get_client_id(struct tokutxn *txn, + uint64_t *client_id, + void **client_extra); + +inline void toku_debug_sync(struct tokutxn *txn, const char *sync_point_name) { + uint64_t client_id; + void *client_extra; + THD *thd; + + if (likely(!opt_debug_sync_timeout)) + return; + + toku_txn_get_client_id(txn, &client_id, &client_extra); + thd = reinterpret_cast<THD *>(client_extra); + DEBUG_SYNC(thd, sync_point_name); +} + +#else // defined(ENABLED_DEBUG_SYNC) + +inline void toku_debug_sync(struct tokutxn *, const char *) {}; + +#endif // defined(ENABLED_DEBUG_SYNC) diff --git a/storage/tokudb/PerconaFT/portability/toku_portability.h b/storage/tokudb/PerconaFT/portability/toku_portability.h index 1f1215def5b..d3a4e391a9f 100644 --- a/storage/tokudb/PerconaFT/portability/toku_portability.h +++ b/storage/tokudb/PerconaFT/portability/toku_portability.h @@ -121,6 +121,7 @@ typedef int64_t toku_off_t; #include "toku_htod.h" #include "toku_assert.h" #include "toku_crash.h" +#include "toku_debug_sync.h" #define UU(x) x __attribute__((__unused__)) @@ -185,8 +186,10 @@ extern void *realloc(void*, size_t) __THROW __attribute__((__deprecat # pragma GCC poison u_int32_t # pragma GCC poison u_int64_t # pragma GCC poison BOOL +#if !defined(MYSQL_TOKUDB_ENGINE) # pragma GCC poison FALSE # pragma GCC poison TRUE +#endif // MYSQL_TOKUDB_ENGINE #endif #pragma GCC poison __sync_fetch_and_add #pragma GCC poison __sync_fetch_and_sub diff --git a/storage/tokudb/PerconaFT/src/tests/test_iterate_live_transactions.cc b/storage/tokudb/PerconaFT/src/tests/test_iterate_live_transactions.cc index 23c79620cd8..1eb04a06594 100644 --- a/storage/tokudb/PerconaFT/src/tests/test_iterate_live_transactions.cc +++ b/storage/tokudb/PerconaFT/src/tests/test_iterate_live_transactions.cc @@ -94,13 +94,13 @@ int test_main(int UU(argc), char *const UU(argv[])) { r = env->open(env, TOKU_TEST_FILENAME, env_flags, 0755); CKERR(r); r = env->txn_begin(env, NULL, &txn1, 0); CKERR(r); - txn1->set_client_id(txn1, 0, NULL); + txn1->set_client_id(txn1, 0, nullptr); txnid1 = txn1->id64(txn1); r = env->txn_begin(env, NULL, &txn2, 0); CKERR(r); - txn2->set_client_id(txn2, 1, NULL); + txn2->set_client_id(txn2, 1, nullptr); txnid2 = txn2->id64(txn2); r = env->txn_begin(env, NULL, &txn3, 0); CKERR(r); - txn3->set_client_id(txn3, 2, NULL); + txn3->set_client_id(txn3, 2, nullptr); txnid3 = txn3->id64(txn3); { diff --git a/storage/tokudb/PerconaFT/src/tests/transactional_fileops.cc b/storage/tokudb/PerconaFT/src/tests/transactional_fileops.cc index c1e7c5b21c4..858a1d70f7f 100644 --- a/storage/tokudb/PerconaFT/src/tests/transactional_fileops.cc +++ b/storage/tokudb/PerconaFT/src/tests/transactional_fileops.cc @@ -87,6 +87,7 @@ setup (void) { else error_file = stderr; r=db_env_create(&env, 0); CKERR(r); + env->set_dir_per_db(env, true); env->set_errfile(env, error_file ? error_file : stderr); r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r); } @@ -431,6 +432,14 @@ test_fileops_3(void) { r = env->dbrename(env, txn_a, "a.db", NULL, "d.db", 0); CKERR2(r, EEXIST); + // verify correct error return code when trying to + // rename a dictionary to a name that is beyond the limit + // of the operating system. + char longname[FILENAME_MAX+11]; + memset(longname, 'b', FILENAME_MAX+7); + memcpy(longname+FILENAME_MAX+7, ".db", 4); + r = env->dbrename(env, txn_a, "a.db", NULL, longname, 0); + CKERR2(r, ENAMETOOLONG); r=txn_a->abort(txn_a); CKERR(r); } diff --git a/storage/tokudb/PerconaFT/src/ydb.cc b/storage/tokudb/PerconaFT/src/ydb.cc index 6eb138f15d7..886832cec6a 100644 --- a/storage/tokudb/PerconaFT/src/ydb.cc +++ b/storage/tokudb/PerconaFT/src/ydb.cc @@ -3074,28 +3074,31 @@ env_dbremove_subdb(DB_ENV * env, DB_TXN * txn, const char *fname, const char *db // see if we can acquire a table lock for the given dname. // requires: write lock on dname in the directory. dictionary // open, close, and begin checkpoint cannot occur. -// returns: true if we could open, lock, and close a dictionary -// with the given dname, false otherwise. -static bool +// returns: zero if we could open, lock, and close a dictionary +// with the given dname, errno otherwise. +static int can_acquire_table_lock(DB_ENV *env, DB_TXN *txn, const char *iname_in_env) { int r; - bool got_lock = false; DB *db; r = toku_db_create(&db, env, 0); assert_zero(r); r = toku_db_open_iname(db, txn, iname_in_env, 0, 0); - assert_zero(r); + if(r) { + if (r == ENAMETOOLONG) + toku_ydb_do_error(env, r, "File name too long!\n"); + goto exit; + } r = toku_db_pre_acquire_table_lock(db, txn); - if (r == 0) { - got_lock = true; - } else { - got_lock = false; + if (r) { + r = DB_LOCK_NOTGRANTED; } - r = toku_db_close(db); - assert_zero(r); - - return got_lock; +exit: + if(db) { + int r2 = toku_db_close(db); + assert_zero(r2); + } + return r; } static int @@ -3308,8 +3311,8 @@ env_dbrename(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbname, co // otherwise, we're okay in marking this ft as remove on // commit. no new handles can open for this dictionary // because the txn has directory write locks on the dname - if (txn && !can_acquire_table_lock(env, txn, new_iname.get())) { - r = DB_LOCK_NOTGRANTED; + if (txn) { + r = can_acquire_table_lock(env, txn, new_iname.get()); } // We don't do anything at the ft or cachetable layer for rename. // We just update entries in the environment's directory. diff --git a/storage/tokudb/PerconaFT/src/ydb_row_lock.cc b/storage/tokudb/PerconaFT/src/ydb_row_lock.cc index 597e6311eb8..1d2f4e982f5 100644 --- a/storage/tokudb/PerconaFT/src/ydb_row_lock.cc +++ b/storage/tokudb/PerconaFT/src/ydb_row_lock.cc @@ -181,7 +181,16 @@ int toku_db_get_range_lock(DB *db, DB_TXN *txn, const DBT *left_key, const DBT * request.create(); int r = toku_db_start_range_lock(db, txn, left_key, right_key, lock_type, &request); if (r == DB_LOCK_NOTGRANTED) { + toku_debug_sync(db_txn_struct_i(txn)->tokutxn, + "toku_range_lock_before_wait"); r = toku_db_wait_range_lock(db, txn, &request); + if (r == DB_LOCK_NOTGRANTED) + toku_debug_sync(db_txn_struct_i(txn)->tokutxn, + "toku_range_lock_not_granted_after_wait"); + } + else if (r == 0) { + toku_debug_sync(db_txn_struct_i(txn)->tokutxn, + "toku_range_lock_granted_immediately"); } request.destroy(); @@ -191,12 +200,13 @@ int toku_db_get_range_lock(DB *db, DB_TXN *txn, const DBT *left_key, const DBT * // Setup and start an asynchronous lock request. int toku_db_start_range_lock(DB *db, DB_TXN *txn, const DBT *left_key, const DBT *right_key, toku::lock_request::type lock_type, toku::lock_request *request) { - DB_TXN *txn_anc = txn_oldest_ancester(txn); - TXNID txn_anc_id = txn_anc->id64(txn_anc); uint64_t client_id; void *client_extra; + DB_TXN *txn_anc = txn_oldest_ancester(txn); + TXNID txn_anc_id = txn_anc->id64(txn_anc); txn->get_client_id(txn, &client_id, &client_extra); - request->set(db->i->lt, txn_anc_id, left_key, right_key, lock_type, toku_is_big_txn(txn_anc), client_extra); + request->set(db->i->lt, txn_anc_id, left_key, right_key, lock_type, + toku_is_big_txn(txn_anc), client_extra); const int r = request->start(); if (r == 0) { @@ -245,6 +255,8 @@ int toku_db_get_point_write_lock(DB *db, DB_TXN *txn, const DBT *key) { // acquire a point write lock on the key for a given txn. // this does not block the calling thread. void toku_db_grab_write_lock (DB *db, DBT *key, TOKUTXN tokutxn) { + uint64_t client_id; + void *client_extra; DB_TXN *txn = toku_txn_get_container_db_txn(tokutxn); DB_TXN *txn_anc = txn_oldest_ancester(txn); TXNID txn_anc_id = txn_anc->id64(txn_anc); @@ -252,10 +264,10 @@ void toku_db_grab_write_lock (DB *db, DBT *key, TOKUTXN tokutxn) { // This lock request must succeed, so we do not want to wait toku::lock_request request; request.create(); - uint64_t client_id; - void *client_extra; txn->get_client_id(txn, &client_id, &client_extra); - request.set(db->i->lt, txn_anc_id, key, key, toku::lock_request::type::WRITE, toku_is_big_txn(txn_anc), client_extra); + request.set(db->i->lt, txn_anc_id, key, key, + toku::lock_request::type::WRITE, toku_is_big_txn(txn_anc), + client_extra); int r = request.start(); invariant_zero(r); db_txn_note_row_lock(db, txn_anc, key, key); diff --git a/storage/tokudb/PerconaFT/tools/CMakeLists.txt b/storage/tokudb/PerconaFT/tools/CMakeLists.txt index e62931524c9..e8aed51f813 100644 --- a/storage/tokudb/PerconaFT/tools/CMakeLists.txt +++ b/storage/tokudb/PerconaFT/tools/CMakeLists.txt @@ -6,6 +6,14 @@ foreach(tool ${tools}) add_dependencies(${tool} install_tdb_h) target_link_libraries(${tool} ${LIBTOKUDB}_static ft_static z lzma snappy ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS}) + # detect when we are being built as a subproject + if (DEFINED MYSQL_PROJECT_NAME_DOCSTRING) + if ((CMAKE_BUILD_TYPE MATCHES "Debug") AND + (CMAKE_CXX_FLAGS_DEBUG MATCHES " -DENABLED_DEBUG_SYNC")) + target_link_libraries(${tool} sql) + endif() + endif () + add_space_separated_property(TARGET ${tool} COMPILE_FLAGS -fvisibility=hidden) endforeach(tool) diff --git a/storage/tokudb/PerconaFT/tools/ftverify.cc b/storage/tokudb/PerconaFT/tools/ftverify.cc index 2324249ba00..ee40b991ea6 100644 --- a/storage/tokudb/PerconaFT/tools/ftverify.cc +++ b/storage/tokudb/PerconaFT/tools/ftverify.cc @@ -325,7 +325,7 @@ check_block(BLOCKNUM blocknum, int64_t UU(blocksize), int64_t UU(address), void } just_decompress_sub_block(&sb); - r = verify_ftnode_sub_block(&sb); + r = verify_ftnode_sub_block(&sb, nullptr, blocknum); if (r != 0) { printf(" Uncompressed child partition %d checksum failed.\n", i); failure++; diff --git a/storage/tokudb/PerconaFT/tools/tokuftdump.cc b/storage/tokudb/PerconaFT/tools/tokuftdump.cc index f6d777b4161..2838ae5182e 100644 --- a/storage/tokudb/PerconaFT/tools/tokuftdump.cc +++ b/storage/tokudb/PerconaFT/tools/tokuftdump.cc @@ -158,7 +158,8 @@ static void dump_descriptor(DESCRIPTOR d) { static void open_header(int fd, FT *header, CACHEFILE cf) { FT ft = NULL; int r; - r = toku_deserialize_ft_from (fd, MAX_LSN, &ft); + const char *fn = toku_cachefile_fname_in_env(cf); + r = toku_deserialize_ft_from (fd, fn, MAX_LSN, &ft); if (r != 0) { fprintf(stderr, "%s: can not deserialize from %s error %d\n", arg0, fname, r); exit(1); diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 513a5fccac0..2511bea8084 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -532,51 +532,6 @@ typedef struct index_read_info { DBT* orig_key; } *INDEX_READ_INFO; -static int ai_poll_fun(void *extra, float progress) { - LOADER_CONTEXT context = (LOADER_CONTEXT)extra; - if (thd_kill_level(context->thd)) { - sprintf(context->write_status_msg, "The process has been killed, aborting add index."); - return ER_ABORTING_CONNECTION; - } - float percentage = progress * 100; - sprintf(context->write_status_msg, "Adding of indexes about %.1f%% done", percentage); - thd_proc_info(context->thd, context->write_status_msg); -#ifdef HA_TOKUDB_HAS_THD_PROGRESS - thd_progress_report(context->thd, (unsigned long long) percentage, 100); -#endif - return 0; -} - -static int loader_poll_fun(void *extra, float progress) { - LOADER_CONTEXT context = (LOADER_CONTEXT)extra; - if (thd_kill_level(context->thd)) { - sprintf(context->write_status_msg, "The process has been killed, aborting bulk load."); - return ER_ABORTING_CONNECTION; - } - float percentage = progress * 100; - sprintf(context->write_status_msg, "Loading of data about %.1f%% done", percentage); - thd_proc_info(context->thd, context->write_status_msg); -#ifdef HA_TOKUDB_HAS_THD_PROGRESS - thd_progress_report(context->thd, (unsigned long long) percentage, 100); -#endif - return 0; -} - -static void loader_ai_err_fun(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra) { - LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra; - assert_always(context->ha); - context->ha->set_loader_error(err); -} - -static void loader_dup_fun(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra) { - LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra; - assert_always(context->ha); - context->ha->set_loader_error(err); - if (err == DB_KEYEXIST) { - context->ha->set_dup_value_for_pk(key); - } -} - // // smart DBT callback function for optimize // in optimize, we want to flatten DB by doing @@ -3397,11 +3352,13 @@ void ha_tokudb::start_bulk_insert(ha_rows rows) { lc.thd = thd; lc.ha = this; - - error = loader->set_poll_function(loader, loader_poll_fun, &lc); + + error = loader->set_poll_function( + loader, ha_tokudb::bulk_insert_poll, &lc); assert_always(!error); - error = loader->set_error_callback(loader, loader_dup_fun, &lc); + error = loader->set_error_callback( + loader, ha_tokudb::loader_dup, &lc); assert_always(!error); trx->stmt_progress.using_loader = true; @@ -3414,6 +3371,47 @@ void ha_tokudb::start_bulk_insert(ha_rows rows) { } TOKUDB_HANDLER_DBUG_VOID_RETURN; } +int ha_tokudb::bulk_insert_poll(void* extra, float progress) { + LOADER_CONTEXT context = (LOADER_CONTEXT)extra; + if (thd_killed(context->thd)) { + sprintf(context->write_status_msg, + "The process has been killed, aborting bulk load."); + return ER_ABORTING_CONNECTION; + } + float percentage = progress * 100; + sprintf(context->write_status_msg, + "Loading of data t %s about %.1f%% done", + context->ha->share->full_table_name(), + percentage); + thd_proc_info(context->thd, context->write_status_msg); +#ifdef HA_TOKUDB_HAS_THD_PROGRESS + thd_progress_report(context->thd, (unsigned long long)percentage, 100); +#endif + return 0; +} +void ha_tokudb::loader_add_index_err(DB* db, + int i, + int err, + DBT* key, + DBT* val, + void* error_extra) { + LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra; + assert_always(context->ha); + context->ha->set_loader_error(err); +} +void ha_tokudb::loader_dup(DB* db, + int i, + int err, + DBT* key, + DBT* val, + void* error_extra) { + LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra; + assert_always(context->ha); + context->ha->set_loader_error(err); + if (err == DB_KEYEXIST) { + context->ha->set_dup_value_for_pk(key); + } +} // // Method that is called at the end of many calls to insert rows @@ -8178,12 +8176,14 @@ int ha_tokudb::tokudb_add_index( goto cleanup; } - error = indexer->set_poll_function(indexer, ai_poll_fun, &lc); + error = indexer->set_poll_function( + indexer, ha_tokudb::tokudb_add_index_poll, &lc); if (error) { goto cleanup; } - error = indexer->set_error_callback(indexer, loader_ai_err_fun, &lc); + error = indexer->set_error_callback( + indexer, ha_tokudb::loader_add_index_err, &lc); if (error) { goto cleanup; } @@ -8238,12 +8238,14 @@ int ha_tokudb::tokudb_add_index( goto cleanup; } - error = loader->set_poll_function(loader, loader_poll_fun, &lc); + error = + loader->set_poll_function(loader, ha_tokudb::bulk_insert_poll, &lc); if (error) { goto cleanup; } - error = loader->set_error_callback(loader, loader_ai_err_fun, &lc); + error = loader->set_error_callback( + loader, ha_tokudb::loader_add_index_err, &lc); if (error) { goto cleanup; } @@ -8450,6 +8452,24 @@ cleanup: thd_proc_info(thd, orig_proc_info); TOKUDB_HANDLER_DBUG_RETURN(error ? error : loader_error); } +int ha_tokudb::tokudb_add_index_poll(void* extra, float progress) { + LOADER_CONTEXT context = (LOADER_CONTEXT)extra; + if (thd_killed(context->thd)) { + sprintf(context->write_status_msg, + "The process has been killed, aborting add index."); + return ER_ABORTING_CONNECTION; + } + float percentage = progress * 100; + sprintf(context->write_status_msg, + "Adding of indexes to %s about %.1f%% done", + context->ha->share->full_table_name(), + percentage); + thd_proc_info(context->thd, context->write_status_msg); +#ifdef HA_TOKUDB_HAS_THD_PROGRESS + thd_progress_report(context->thd, (unsigned long long)percentage, 100); +#endif + return 0; +} // // Internal function called by ha_tokudb::add_index and ha_tokudb::alter_table_phase2 diff --git a/storage/tokudb/ha_tokudb.h b/storage/tokudb/ha_tokudb.h index 4a7e395d0d1..3891e57738b 100644 --- a/storage/tokudb/ha_tokudb.h +++ b/storage/tokudb/ha_tokudb.h @@ -799,6 +799,19 @@ public: #else void start_bulk_insert(ha_rows rows); #endif + static int bulk_insert_poll(void* extra, float progress); + static void loader_add_index_err(DB* db, + int i, + int err, + DBT* key, + DBT* val, + void* error_extra); + static void loader_dup(DB* db, + int i, + int err, + DBT* key, + DBT* val, + void* error_extra); int end_bulk_insert(); int end_bulk_insert(bool abort); @@ -938,17 +951,23 @@ public: #endif private: - int tokudb_add_index( - TABLE *table_arg, - KEY *key_info, - uint num_of_keys, - DB_TXN* txn, - bool* inc_num_DBs, - bool* modified_DB - ); - void restore_add_index(TABLE* table_arg, uint num_of_keys, bool incremented_numDBs, bool modified_DBs); - int drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, KEY *key_info, DB_TXN* txn); - void restore_drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys); + int tokudb_add_index(TABLE* table_arg, + KEY* key_info, + uint num_of_keys, + DB_TXN* txn, + bool* inc_num_DBs, + bool* modified_DB); + static int tokudb_add_index_poll(void *extra, float progress); + void restore_add_index(TABLE* table_arg, + uint num_of_keys, + bool incremented_numDBs, + bool modified_DBs); + int drop_indexes(TABLE* table_arg, + uint* key_num, + uint num_of_keys, + KEY* key_info, + DB_TXN* txn); + void restore_drop_indexes(TABLE* table_arg, uint* key_num, uint num_of_keys); public: // delete all rows from the table diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index c3fb6afed73..a079e817374 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -55,7 +55,7 @@ static bool tokudb_show_status( static void tokudb_handle_fatal_signal(handlerton* hton, THD* thd, int sig); #endif static int tokudb_close_connection(handlerton* hton, THD* thd); -static void tokudb_kill_query(handlerton *hton, THD *thd, enum thd_kill_levels level); +static void tokudb_kill_connection(handlerton *hton, THD *thd, enum thd_kill_levels level); static int tokudb_commit(handlerton* hton, THD* thd, bool all); static int tokudb_rollback(handlerton* hton, THD* thd, bool all); #if TOKU_INCLUDE_XA @@ -337,7 +337,7 @@ static int tokudb_init_func(void *p) { tokudb_hton->create = tokudb_create_handler; tokudb_hton->close_connection = tokudb_close_connection; - tokudb_hton->kill_query = tokudb_kill_query; + tokudb_hton->kill_query = tokudb_kill_connection; tokudb_hton->savepoint_offset = sizeof(SP_INFO_T); tokudb_hton->savepoint_set = tokudb_savepoint; @@ -762,7 +762,8 @@ static int tokudb_close_connection(handlerton* hton, THD* thd) { return error; } -void tokudb_kill_query(handlerton *hton, THD *thd, enum thd_kill_levels level) { +void tokudb_kill_connection(handlerton *hton, THD *thd, + enum thd_kill_levels level) { TOKUDB_DBUG_ENTER(""); db_env->kill_waiter(db_env, thd); DBUG_VOID_RETURN; diff --git a/storage/tokudb/mysql-test/rpl/include/rpl_tokudb_row_img_general_loop.inc b/storage/tokudb/mysql-test/rpl/include/rpl_tokudb_row_img_general_loop.inc new file mode 100644 index 00000000000..321f09353a1 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/include/rpl_tokudb_row_img_general_loop.inc @@ -0,0 +1,42 @@ +# +# This is a helper script for rpl_row_img.test. It creates +# all combinations MyISAM / InnoDB in a three server replication +# chain. Each engine combination is tested against the current +# seetings for binlog_row_image (on each server). +# +# The test script that is executed on every combination is the +# only argument to this wrapper script. See below. +# +# This script takes one parameter: +# - $row_img_test_script +# the name of the test script to include in every combination +# +# Sample usage: +# -- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test +# -- source include/rpl_row_img_general_loop.test + + +-- let $engine_type_a= 2 +-- let $server_1_engine= TokuDB +while($engine_type_a) +{ + -- let $engine_type_b= 2 + -- let $server_2_engine= TokuDB + while($engine_type_b) + { + -- let $engine_type_c= 2 + -- let $server_3_engine= TokuDB + while($engine_type_c) + { + -- echo ### engines: $server_1_engine, $server_2_engine, $server_3_engine + -- source $row_img_test_script + + -- let $server_3_engine= InnoDB + -- dec $engine_type_c + } + -- let $server_2_engine= InnoDB + -- dec $engine_type_b + } + -- let $server_1_engine= InnoDB + -- dec $engine_type_a +} diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result index d055e4341c7..991ad8d1c48 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result @@ -25,11 +25,13 @@ update t set b=b+2 where a=1; update t set b=b+3 where a=4; update t set b=b+4 where a=3; update t set b=b+1 where 1<=a and a<=3; -select unix_timestamp() into @tstart; +# select unix_timestamp() into @tstart; connection master; connection slave; connection master; -select unix_timestamp() into @tend; +# Commented out for MariaDB +# select unix_timestamp() into @tend; +# select @tend-@tstart <= 5; # assert no delay in the delete time connection slave; select * from t; a b diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result index f39d2400afd..1de619eb4ec 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result @@ -9,11 +9,11 @@ tokudb_rpl_unique_checks OFF tokudb_rpl_unique_checks_delay 5000 connection master; create table t (a bigint not null, primary key(a)) engine=tokudb; -select unix_timestamp() into @tstart; insert into t values (1); insert into t values (2),(3); insert into t values (4); connection slave; +connection master; connection slave; connection master; include/diff_tables.inc [master:test.t, slave:test.t] diff --git a/storage/tokudb/mysql-test/tokudb_rpl/r/rpl_rfr_disable_on_expl_pk_absence.result b/storage/tokudb/mysql-test/rpl/r/rpl_rfr_disable_on_expl_pk_absence.result index 2977dc859f5..127184a0766 100644 --- a/storage/tokudb/mysql-test/tokudb_rpl/r/rpl_rfr_disable_on_expl_pk_absence.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_rfr_disable_on_expl_pk_absence.result @@ -1,8 +1,10 @@ include/master-slave.inc [connection master] call mtr.add_suppression("read free replication is disabled for tokudb table"); +connection master; CREATE TABLE t (a int(11), b char(20)) ENGINE = TokuDB; INSERT INTO t (a, b) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'); +connection slave; SELECT * FROM t; a b 1 a @@ -10,6 +12,7 @@ a b 3 c 4 d 5 e +connection master; UPDATE t SET a = a + 10 WHERE b = 'b'; SELECT * FROM t; a b @@ -18,6 +21,7 @@ a b 3 c 4 d 5 e +connection slave; SELECT * FROM t; a b 1 a @@ -25,6 +29,7 @@ a b 3 c 4 d 5 e +connection master; UPDATE t SET a = a + 10 WHERE b = 'b'; SELECT * FROM t; a b @@ -33,6 +38,7 @@ a b 3 c 4 d 5 e +connection slave; SELECT * FROM t; a b 1 a @@ -40,5 +46,7 @@ a b 3 c 4 d 5 e +connection master; DROP TABLE t; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_commit_after_flush.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_commit_after_flush.result new file mode 100644 index 00000000000..cc9174ba09e --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_commit_after_flush.result @@ -0,0 +1,13 @@ +include/master-slave.inc +[connection master] +CREATE TABLE t1 (a INT) ENGINE=tokudb; +begin; +insert into t1 values(1); +flush tables with read lock; +commit; +connection slave; +connection master; +unlock tables; +drop table t1; +connection slave; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id.result new file mode 100644 index 00000000000..02da7194eb5 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id.result @@ -0,0 +1,580 @@ +# +# Setup +# +# +# See if queries that use both auto_increment and LAST_INSERT_ID() +# are replicated well +# +# We also check how the foreign_key_check variable is replicated +# +include/master-slave.inc +[connection master] +connection master; +SET @old_concurrent_insert= @@global.concurrent_insert; +SET @@global.concurrent_insert= 0; +connection master; +create table t1(a int auto_increment, key(a)) engine=tokudb; +create table t2(b int auto_increment, c int, key(b)) engine=tokudb; +insert into t1 values (1),(2),(3); +insert into t1 values (null); +insert into t2 values (null,last_insert_id()); +connection slave; +select * from t1 ORDER BY a; +a +1 +2 +3 +4 +select * from t2 ORDER BY b; +b c +1 4 +connection master; +drop table t1; +drop table t2; +create table t1(a int auto_increment, key(a)) engine=tokudb; +create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) engine=tokudb; +SET FOREIGN_KEY_CHECKS=0; +insert into t1 values (10); +insert into t1 values (null),(null),(null); +insert into t2 values (5,0); +insert into t2 values (null,last_insert_id()); +SET FOREIGN_KEY_CHECKS=1; +connection slave; +select * from t1; +a +10 +11 +12 +13 +select * from t2; +b c +5 0 +6 11 +connection master; +# +# check if INSERT SELECT in auto_increment is well replicated (bug #490) +# +drop table t2; +drop table t1; +create table t1(a int auto_increment, key(a)) engine=tokudb; +create table t2(b int auto_increment, c int, key(b)) engine=tokudb; +insert into t1 values (10); +insert into t1 values (null),(null),(null); +insert into t2 values (5,0); +insert into t2 (c) select * from t1 ORDER BY a; +select * from t2 ORDER BY b; +b c +5 0 +6 10 +7 11 +8 12 +9 13 +connection slave; +select * from t1 ORDER BY a; +a +10 +11 +12 +13 +select * from t2 ORDER BY b; +b c +5 0 +6 10 +7 11 +8 12 +9 13 +connection master; +drop table t1; +drop table t2; +connection slave; +# +# Bug#8412: Error codes reported in binary log for CHARACTER SET, +# FOREIGN_KEY_CHECKS +# +connection master; +SET TIMESTAMP=1000000000; +CREATE TABLE t1 ( a INT UNIQUE ) engine=tokudb; +SET FOREIGN_KEY_CHECKS=0; +INSERT INTO t1 VALUES (1),(1); +Got one of the listed errors +connection slave; +connection master; +drop table t1; +connection slave; +# +# Bug#14553: NULL in WHERE resets LAST_INSERT_ID +# +connection master; +set @@session.sql_auto_is_null=1; +create table t1(a int auto_increment, key(a)) engine=tokudb; +create table t2(a int) engine=tokudb; +insert into t1 (a) values (null); +insert into t2 (a) select a from t1 where a is null; +insert into t2 (a) select a from t1 where a is null; +select * from t2; +a +1 +connection slave; +connection slave; +select * from t2; +a +1 +connection master; +drop table t1; +drop table t2; +# +# End of 4.1 tests +# +# +# BUG#15728: LAST_INSERT_ID function inside a stored function returns 0 +# +# The solution is not to reset last_insert_id on enter to sub-statement. +# +connection master; +drop function if exists bug15728; +drop function if exists bug15728_insert; +drop table if exists t1, t2; +create table t1 ( +id int not null auto_increment, +last_id int, +primary key (id) +) engine=tokudb; +create function bug15728() returns int(11) +return last_insert_id(); +insert into t1 (last_id) values (0); +insert into t1 (last_id) values (last_insert_id()); +insert into t1 (last_id) values (bug15728()); +create table t2 ( +id int not null auto_increment, +last_id int, +primary key (id) +) engine=tokudb; +create function bug15728_insert() returns int(11) modifies sql data +begin +insert into t2 (last_id) values (bug15728()); +return bug15728(); +end| +create trigger t1_bi before insert on t1 for each row +begin +declare res int; +select bug15728_insert() into res; +set NEW.last_id = res; +end| +insert into t1 (last_id) values (0); +drop trigger t1_bi; +select last_insert_id(); +last_insert_id() +4 +select bug15728_insert(); +bug15728_insert() +2 +select last_insert_id(); +last_insert_id() +4 +insert into t1 (last_id) values (bug15728()); +select last_insert_id(); +last_insert_id() +5 +drop procedure if exists foo; +create procedure foo() +begin +declare res int; +insert into t2 (last_id) values (bug15728()); +insert into t1 (last_id) values (bug15728()); +end| +call foo(); +select * from t1; +id last_id +1 0 +2 1 +3 2 +4 1 +5 4 +6 3 +select * from t2; +id last_id +1 3 +2 4 +3 5 +connection slave; +select * from t1; +id last_id +1 0 +2 1 +3 2 +4 1 +5 4 +6 3 +select * from t2; +id last_id +1 3 +2 4 +3 5 +connection master; +drop function bug15728; +drop function bug15728_insert; +drop table t1,t2; +drop procedure foo; +create table t1 (n int primary key auto_increment not null, +b int, unique(b)) engine=tokudb; +set sql_log_bin=0; +insert into t1 values(null,100); +replace into t1 values(null,50),(null,100),(null,150); +select * from t1 order by n; +n b +2 50 +3 100 +4 150 +truncate table t1; +set sql_log_bin=1; +insert into t1 values(null,100); +select * from t1 order by n; +n b +1 100 +connection slave; +insert into t1 values(null,200),(null,300); +delete from t1 where b <> 100; +select * from t1 order by n; +n b +1 100 +connection master; +replace into t1 values(null,100),(null,350); +select * from t1 order by n; +n b +2 100 +3 350 +connection slave; +select * from t1 order by n; +n b +2 100 +3 350 +connection master; +insert into t1 values (NULL,400),(3,500),(NULL,600) on duplicate key UPDATE n=1000; +select * from t1 order by n; +n b +2 100 +4 400 +1000 350 +1001 600 +connection slave; +select * from t1 order by n; +n b +2 100 +4 400 +1000 350 +1001 600 +connection master; +drop table t1; +create table t1 (n int primary key auto_increment not null, +b int, unique(b)) engine=tokudb; +insert into t1 values(null,100); +select * from t1 order by n; +n b +1 100 +connection slave; +insert into t1 values(null,200),(null,300); +delete from t1 where b <> 100; +select * from t1 order by n; +n b +1 100 +connection master; +insert into t1 values(null,100),(null,350) on duplicate key update n=2; +select * from t1 order by n; +n b +2 100 +3 350 +connection slave; +select * from t1 order by n; +n b +2 100 +3 350 +connection master; +drop table t1; +connection slave; +connection master; +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT, +UNIQUE(b)) ENGINE=tokudb; +INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; +SELECT * FROM t1 ORDER BY a; +a b +1 10 +2 2 +connection slave; +SELECT * FROM t1 ORDER BY a; +a b +1 10 +2 2 +connection master; +drop table t1; +CREATE TABLE t1 ( +id bigint(20) unsigned NOT NULL auto_increment, +field_1 int(10) unsigned NOT NULL, +field_2 varchar(255) NOT NULL, +field_3 varchar(255) NOT NULL, +PRIMARY KEY (id), +UNIQUE KEY field_1 (field_1, field_2) +) ENGINE=tokudb; +CREATE TABLE t2 ( +field_a int(10) unsigned NOT NULL, +field_b varchar(255) NOT NULL, +field_c varchar(255) NOT NULL +) ENGINE=tokudb; +INSERT INTO t2 (field_a, field_b, field_c) VALUES (1, 'a', '1a'); +INSERT INTO t2 (field_a, field_b, field_c) VALUES (2, 'b', '2b'); +INSERT INTO t2 (field_a, field_b, field_c) VALUES (3, 'c', '3c'); +INSERT INTO t2 (field_a, field_b, field_c) VALUES (4, 'd', '4d'); +INSERT INTO t2 (field_a, field_b, field_c) VALUES (5, 'e', '5e'); +INSERT INTO t1 (field_1, field_2, field_3) +SELECT t2.field_a, t2.field_b, t2.field_c +FROM t2 +ON DUPLICATE KEY UPDATE +t1.field_3 = t2.field_c; +INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f'); +INSERT INTO t1 (field_1, field_2, field_3) +SELECT t2.field_a, t2.field_b, t2.field_c +FROM t2 +ON DUPLICATE KEY UPDATE +t1.field_3 = t2.field_c; +SELECT * FROM t1 ORDER BY id; +id field_1 field_2 field_3 +1 1 a 1a +2 2 b 2b +3 3 c 3c +4 4 d 4d +5 5 e 5e +8 6 f 6f +connection slave; +SELECT * FROM t1 ORDER BY id; +id field_1 field_2 field_3 +1 1 a 1a +2 2 b 2b +3 3 c 3c +4 4 d 4d +5 5 e 5e +8 6 f 6f +connection master; +drop table t1, t2; +connection master; +DROP PROCEDURE IF EXISTS p1; +DROP TABLE IF EXISTS t1, t2; +SELECT LAST_INSERT_ID(0); +LAST_INSERT_ID(0) +0 +CREATE TABLE t1 ( +id INT NOT NULL DEFAULT 0, +last_id INT, +PRIMARY KEY (id) +) ENGINE=tokudb; +CREATE TABLE t2 ( +id INT NOT NULL AUTO_INCREMENT, +last_id INT, +PRIMARY KEY (id) +) ENGINE=tokudb; +CREATE PROCEDURE p1() +BEGIN +INSERT INTO t2 (last_id) VALUES (LAST_INSERT_ID()); +INSERT INTO t1 (last_id) VALUES (LAST_INSERT_ID()); +END| +CALL p1(); +SELECT * FROM t1 ORDER BY id; +id last_id +0 1 +SELECT * FROM t2 ORDER BY id; +id last_id +1 0 +connection slave; +SELECT * FROM t1 ORDER BY id; +id last_id +0 1 +SELECT * FROM t2 ORDER BY id; +id last_id +1 0 +connection master; +DROP PROCEDURE p1; +DROP TABLE t1, t2; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP FUNCTION IF EXISTS f2; +DROP FUNCTION IF EXISTS f3; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( +i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +j INT DEFAULT 0 +) ENGINE=tokudb; +CREATE TABLE t2 (i INT) ENGINE=tokudb; +CREATE PROCEDURE p1() +BEGIN +INSERT INTO t1 (i) VALUES (NULL); +INSERT INTO t2 (i) VALUES (LAST_INSERT_ID()); +INSERT INTO t1 (i) VALUES (NULL), (NULL); +INSERT INTO t2 (i) VALUES (LAST_INSERT_ID()); +END | +CREATE FUNCTION f1() RETURNS INT MODIFIES SQL DATA +BEGIN +INSERT INTO t1 (i) VALUES (NULL); +INSERT INTO t2 (i) VALUES (LAST_INSERT_ID()); +INSERT INTO t1 (i) VALUES (NULL), (NULL); +INSERT INTO t2 (i) VALUES (LAST_INSERT_ID()); +RETURN 0; +END | +CREATE FUNCTION f2() RETURNS INT NOT DETERMINISTIC +RETURN LAST_INSERT_ID() | +CREATE FUNCTION f3() RETURNS INT MODIFIES SQL DATA +BEGIN +INSERT INTO t2 (i) VALUES (LAST_INSERT_ID()); +RETURN 0; +END | +INSERT INTO t1 VALUES (NULL, -1); +CALL p1(); +SELECT f1(); +f1() +0 +INSERT INTO t1 VALUES (NULL, f2()), (NULL, LAST_INSERT_ID()), +(NULL, LAST_INSERT_ID()), (NULL, f2()), (NULL, f2()); +INSERT INTO t1 VALUES (NULL, f2()); +INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID()); +UPDATE t1 SET j= -1 WHERE i IS NULL; +INSERT INTO t1 (i) VALUES (NULL); +connection master1; +INSERT INTO t1 (i) VALUES (NULL); +connection master; +SELECT f3(); +f3() +0 +SELECT * FROM t1 ORDER BY i; +i j +1 -1 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 3 +9 3 +10 3 +11 3 +12 3 +13 8 +14 -1 +15 13 +16 0 +17 0 +SELECT * FROM t2 ORDER BY i; +i +2 +3 +5 +6 +16 +connection slave; +SELECT * FROM t1; +i j +1 -1 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 3 +9 3 +10 3 +11 3 +12 3 +13 8 +14 -1 +15 13 +16 0 +17 0 +SELECT * FROM t2; +i +2 +3 +5 +6 +16 +connection master; +DROP PROCEDURE p1; +DROP FUNCTION f1; +DROP FUNCTION f2; +DROP FUNCTION f3; +DROP TABLE t1, t2; +connection slave; +# +# End of 5.0 tests +# +connection master; +create table t2 ( +id int not null auto_increment, +last_id int, +primary key (id) +) engine=tokudb; +connection master; +truncate table t2; +create table t1 (id tinyint primary key) engine=tokudb; +create function insid() returns int +begin +insert into t2 (last_id) values (0); +return 0; +end| +set sql_log_bin=0; +insert into t2 (id) values(1),(2),(3); +delete from t2; +set sql_log_bin=1; +select insid(); +insid() +0 +set sql_log_bin=0; +insert into t2 (id) values(5),(6),(7); +delete from t2 where id>=5; +set sql_log_bin=1; +insert into t1 select insid(); +select * from t1 order by id; +id +0 +select * from t2 order by id; +id last_id +4 0 +8 0 +connection slave; +select * from t1 order by id; +id +0 +select * from t2 order by id; +id last_id +4 0 +8 0 +connection master; +drop table t1; +drop function insid; +truncate table t2; +create table t1 (n int primary key auto_increment not null, +b int, unique(b)) engine=tokudb; +create procedure foo() +begin +insert into t1 values(null,10); +insert ignore into t1 values(null,10); +insert ignore into t1 values(null,10); +insert into t2 values(null,3); +end| +call foo(); +select * from t1 order by n; +n b +1 10 +select * from t2 order by id; +id last_id +1 3 +connection slave; +select * from t1 order by n; +n b +1 10 +select * from t2 order by id; +id last_id +1 3 +connection master; +drop table t1, t2; +drop procedure foo; +SET @@global.concurrent_insert= @old_concurrent_insert; +set @@session.sql_auto_is_null=default; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id_pk.result new file mode 100644 index 00000000000..20369a1842c --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id_pk.result @@ -0,0 +1,84 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); +create table t1(a int auto_increment, primary key(a)); +create table t2(b int auto_increment, c int, primary key(b)); +insert into t1 values (1),(2),(3); +insert into t1 values (null); +insert into t2 values (null,last_insert_id()); +connection slave; +select * from t1 ORDER BY a; +a +1 +2 +3 +4 +select * from t2 ORDER BY b; +b c +1 4 +connection master; +drop table t1; +drop table t2; +create table t1(a int auto_increment, key(a)) engine=tokudb; +create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) engine=tokudb; +SET FOREIGN_KEY_CHECKS=0; +insert into t1 values (10); +insert into t1 values (null),(null),(null); +insert into t2 values (5,0); +insert into t2 values (null,last_insert_id()); +SET FOREIGN_KEY_CHECKS=1; +connection slave; +select * from t1; +a +10 +11 +12 +13 +select * from t2; +b c +5 0 +6 11 +connection master; +drop table t2; +drop table t1; +create table t1(a int auto_increment, primary key(a)); +create table t2(b int auto_increment, c int, primary key(b)); +insert into t1 values (10); +insert into t1 values (null),(null),(null); +insert into t2 values (5,0); +insert into t2 (c) select * from t1 ORDER BY a; +select * from t2 ORDER BY b; +b c +5 0 +6 10 +7 11 +8 12 +9 13 +connection slave; +select * from t1 ORDER BY a; +a +10 +11 +12 +13 +select * from t2 ORDER BY b; +b c +5 0 +6 10 +7 11 +8 12 +9 13 +connection master; +drop table t1; +drop table t2; +connection slave; +connection master; +SET TIMESTAMP=1000000000; +CREATE TABLE t1 ( a INT UNIQUE ); +SET FOREIGN_KEY_CHECKS=0; +INSERT INTO t1 VALUES (1),(1); +Got one of the listed errors +connection slave; +connection master; +drop table t1; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update.result new file mode 100644 index 00000000000..1036e753961 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update.result @@ -0,0 +1,27 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) ENGINE=TokuDB; +CREATE TABLE t2 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) ENGINE=TokuDB; +INSERT INTO t1 VALUES (NULL, 0); +INSERT INTO t1 SELECT NULL, 0 FROM t1; +INSERT INTO t2 VALUES (NULL, 0), (NULL,1); +SELECT * FROM t1 ORDER BY a; +a b +1 0 +2 0 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 +UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a; +connection slave; +connection master; +drop table t1, t2; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update2.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update2.result new file mode 100644 index 00000000000..e51eac13783 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update2.result @@ -0,0 +1,61 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT'); +drop table if exists t1,t2; +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) ENGINE=TokuDB; +CREATE TABLE t2 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) ENGINE=TokuDB; +INSERT INTO t1 VALUES (NULL, 0); +INSERT INTO t1 SELECT NULL, 0 FROM t1; +INSERT INTO t2 VALUES (NULL, 0), (NULL,1); +SELECT * FROM t1 ORDER BY a; +a b +1 0 +2 0 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 +UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a; +SELECT * FROM t1 ORDER BY a; +a b +1 4 +2 5 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 +connection slave; +SELECT * FROM t1 ORDER BY a; +a b +1 4 +2 5 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 +connection master; +drop table t1,t2; +connection slave; +reset master; +connection master; +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (0); +UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b; +select * from t1; +a +3 +connection slave; +connection slave; +select * from t1; +a +3 +connection master; +drop table t1; +connection slave; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update3.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update3.result new file mode 100644 index 00000000000..aae924f2ae8 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update3.result @@ -0,0 +1,208 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); + +-------- Test for BUG#9361 -------- +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) ENGINE=TokuDB; +CREATE TABLE t2 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) ENGINE=TokuDB; +INSERT INTO t1 VALUES (NULL, 0); +INSERT INTO t1 SELECT NULL, 0 FROM t1; +INSERT INTO t2 VALUES (NULL, 0), (NULL,1); +SELECT * FROM t1 ORDER BY a; +a b +1 0 +2 0 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 +UPDATE t2, (SELECT a FROM t1 ORDER BY a) AS t SET t2.b = t.a+5 ; +SELECT * FROM t1 ORDER BY a; +a b +1 0 +2 0 +SELECT * FROM t2 ORDER BY a; +a b +1 6 +2 6 +connection slave; +connection slave; +SELECT * FROM t1 ORDER BY a; +a b +1 0 +2 0 +SELECT * FROM t2 ORDER BY a; +a b +1 6 +2 6 +connection master; +drop table t1,t2; + +-------- Test 1 for BUG#9361 -------- +connection master; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +CREATE TABLE t1 ( +a1 char(30), +a2 int, +a3 int, +a4 char(30), +a5 char(30) +); +CREATE TABLE t2 ( +b1 int, +b2 char(30) +); +INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar'); +INSERT INTO t2 VALUES (1, 'baz'); +UPDATE t1 a, t2 +SET a.a1 = 'No' +WHERE a.a2 = +(SELECT b1 +FROM t2 +WHERE b2 = 'baz') +AND a.a3 IS NULL +AND a.a4 = 'foo' +AND a.a5 = 'bar'; +connection slave; +connection slave; +SELECT * FROM t1; +a1 a2 a3 a4 a5 +No 1 NULL foo bar +SELECT * FROM t2; +b1 b2 +1 baz +connection master; +DROP TABLE t1, t2; + +-------- Test 2 for BUG#9361 -------- +connection master; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +CREATE TABLE t1 ( +i INT, +j INT, +x INT, +y INT, +z INT +); +CREATE TABLE t2 ( +i INT, +k INT, +x INT, +y INT, +z INT +); +CREATE TABLE t3 ( +j INT, +k INT, +x INT, +y INT, +z INT +); +INSERT INTO t1 VALUES ( 1, 2,13,14,15); +INSERT INTO t2 VALUES ( 1, 3,23,24,25); +INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36); +UPDATE t1 AS a +INNER JOIN t2 AS b +ON a.i = b.i +INNER JOIN t3 AS c +ON a.j = c.j AND b.k = c.k +SET a.x = b.x, +a.y = b.y, +a.z = ( +SELECT sum(z) +FROM t3 +WHERE y = 34 +) +WHERE b.x = 23; +connection slave; +connection slave; +SELECT * FROM t1; +i j x y z +1 2 23 24 71 +connection master; +DROP TABLE t1, t2, t3; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 'test.t1' +DROP TABLE IF EXISTS t2; +Warnings: +Note 1051 Unknown table 'test.t2' +CREATE TABLE t1 ( +idp int(11) NOT NULL default '0', +idpro int(11) default NULL, +price decimal(19,4) default NULL, +PRIMARY KEY (idp) +); +CREATE TABLE t2 ( +idpro int(11) NOT NULL default '0', +price decimal(19,4) default NULL, +nbprice int(11) default NULL, +PRIMARY KEY (idpro) +); +INSERT INTO t1 VALUES +(1,1,'3.0000'), +(2,2,'1.0000'), +(3,1,'1.0000'), +(4,1,'4.0000'), +(5,3,'2.0000'), +(6,2,'4.0000'); +INSERT INTO t2 VALUES +(1,'0.0000',0), +(2,'0.0000',0), +(3,'0.0000',0); +update +t2 +join +( select idpro, min(price) as min_price, count(*) as nbr_price +from t1 +where idpro>0 and price>0 +group by idpro +) as table_price +on t2.idpro = table_price.idpro +set t2.price = table_price.min_price, +t2.nbprice = table_price.nbr_price; +select "-- MASTER AFTER JOIN --" as ""; + +-- MASTER AFTER JOIN -- +select * from t1; +idp idpro price +1 1 3.0000 +2 2 1.0000 +3 1 1.0000 +4 1 4.0000 +5 3 2.0000 +6 2 4.0000 +select * from t2; +idpro price nbprice +1 1.0000 3 +2 1.0000 2 +3 2.0000 1 +connection slave; +select "-- SLAVE AFTER JOIN --" as ""; + +-- SLAVE AFTER JOIN -- +select * from t1; +idp idpro price +1 1 3.0000 +2 2 1.0000 +3 1 1.0000 +4 1 4.0000 +5 3 2.0000 +6 2 4.0000 +select * from t2; +idpro price nbprice +1 1.0000 3 +2 1.0000 2 +3 2.0000 1 +connection master; +DROP TABLE t1, t2; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/tokudb_rpl/r/rpl_tokudb_rfr_partition_table.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_rfr_partition_table.result index 4594959c6d0..4594959c6d0 100644 --- a/storage/tokudb/mysql-test/tokudb_rpl/r/rpl_tokudb_rfr_partition_table.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_rfr_partition_table.result diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_crash_safe.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_crash_safe.result new file mode 100644 index 00000000000..04578c3ff68 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_crash_safe.result @@ -0,0 +1,2183 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression('Attempting backtrace'); +call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001"); +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression(".* InnoDB: Warning: allocated tablespace .*, old maximum was .*"); +################################################################################### +# PREPARE EXECUTION +################################################################################### +include/stop_slave.inc +SHOW CREATE TABLE mysql.slave_relay_log_info; +Table Create Table +slave_relay_log_info CREATE TABLE `slave_relay_log_info` ( + `Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.', + `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the current relay log file.', + `Relay_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The relay log position of the last executed event.', + `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log file from which the events in the relay log file were read.', + `Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last executed event.', + `Sql_delay` int(11) NOT NULL COMMENT 'The number of seconds that the slave must lag behind the master.', + `Number_of_workers` int(10) unsigned NOT NULL, + `Id` int(10) unsigned NOT NULL COMMENT 'Internal Id that uniquely identifies this record.', + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Relay Log Information' +SHOW CREATE TABLE mysql.slave_worker_info; +Table Create Table +slave_worker_info CREATE TABLE `slave_worker_info` ( + `Id` int(10) unsigned NOT NULL, + `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Relay_log_pos` bigint(20) unsigned NOT NULL, + `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Master_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Checkpoint_relay_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Checkpoint_master_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_seqno` int(10) unsigned NOT NULL, + `Checkpoint_group_size` int(10) unsigned NOT NULL, + `Checkpoint_group_bitmap` blob NOT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Worker Information' +ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb; +ALTER TABLE mysql.slave_worker_info ENGINE= Innodb; +SHOW CREATE TABLE mysql.slave_relay_log_info; +Table Create Table +slave_relay_log_info CREATE TABLE `slave_relay_log_info` ( + `Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.', + `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the current relay log file.', + `Relay_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The relay log position of the last executed event.', + `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log file from which the events in the relay log file were read.', + `Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last executed event.', + `Sql_delay` int(11) NOT NULL COMMENT 'The number of seconds that the slave must lag behind the master.', + `Number_of_workers` int(10) unsigned NOT NULL, + `Id` int(10) unsigned NOT NULL COMMENT 'Internal Id that uniquely identifies this record.', + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Relay Log Information' +SHOW CREATE TABLE mysql.slave_worker_info; +Table Create Table +slave_worker_info CREATE TABLE `slave_worker_info` ( + `Id` int(10) unsigned NOT NULL, + `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Relay_log_pos` bigint(20) unsigned NOT NULL, + `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Master_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Checkpoint_relay_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Checkpoint_master_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_seqno` int(10) unsigned NOT NULL, + `Checkpoint_group_size` int(10) unsigned NOT NULL, + `Checkpoint_group_bitmap` blob NOT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Worker Information' +include/start_slave.inc +rpl_mixing_engines.inc [commands=configure] +CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1); +CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +END| +CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +END| +CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +RETURN "fc_i_tt_5_suc"; +END| +CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +RETURN "fc_i_nt_5_suc"; +END| +CREATE FUNCTION fc_i_nt_3_tt_3_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_3(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +SELECT max(stmt_id) INTO in_stmt_id FROM tt_3 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_3(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +RETURN "fc_i_nt_3_tt_3_suc"; +END| +CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id; +INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +################################################################################### +# EXECUTE CASES CRASHING THE XID +################################################################################### + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=T] +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-func] +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (9, 1); +fc_i_tt_5_suc (9, 1) +fc_i_tt_5_suc +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-proc] +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (10, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-trig C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-func C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (12, 4); +fc_i_tt_5_suc (12, 4) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-proc C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (13, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-trig T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-func T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (15, 2); +fc_i_tt_5_suc (15, 2) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-proc T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (16, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=T] +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-func] +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (19, 1); +fc_i_tt_5_suc (19, 1) +fc_i_tt_5_suc +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-proc] +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (20, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-trig C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-func C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (22, 4); +fc_i_tt_5_suc (22, 4) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-proc C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (23, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-trig T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-func T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (25, 2); +fc_i_tt_5_suc (25, 2) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-proc T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (26, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=T] +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-func] +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (29, 1); +fc_i_tt_5_suc (29, 1) +fc_i_tt_5_suc +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-proc] +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (30, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-trig C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-func C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (32, 4); +fc_i_tt_5_suc (32, 4) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-proc C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (33, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-trig T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-func T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (35, 2); +fc_i_tt_5_suc (35, 2) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-proc T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (36, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T] +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-func] +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (39, 1); +fc_i_tt_5_suc (39, 1) +fc_i_tt_5_suc +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-proc] +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (40, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-trig C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-func C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (42, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (42, 4); +fc_i_tt_5_suc (42, 4) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-proc C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (43, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (43, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-trig T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (44, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-func T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (45, 2); +fc_i_tt_5_suc (45, 2) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-proc T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (46, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (46, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc +################################################################################### +# EXECUTE CASES CRASHING THE BEGIN/COMMIT +################################################################################### + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_and_update_pos";; +FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=N] +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (47, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_and_update_pos";; +FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=N-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (48, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_and_update_pos";; +FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=N-func] +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (49, 1); +fc_i_nt_5_suc (49, 1) +fc_i_nt_5_suc +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc +################################################################################### +# CHECK CONSISTENCY +################################################################################### +include/sync_slave_sql_with_master.inc +################################################################################### +# CLEAN +################################################################################### +rpl_mixing_engines.inc [commands=clean] +DROP TABLE tt_1; +DROP TABLE tt_2; +DROP TABLE tt_3; +DROP TABLE tt_4; +DROP TABLE tt_5; +DROP TABLE tt_6; +DROP TABLE nt_1; +DROP TABLE nt_2; +DROP TABLE nt_3; +DROP TABLE nt_4; +DROP TABLE nt_5; +DROP TABLE nt_6; +DROP PROCEDURE pc_i_tt_5_suc; +DROP PROCEDURE pc_i_nt_5_suc; +DROP FUNCTION fc_i_tt_5_suc; +DROP FUNCTION fc_i_nt_5_suc; +DROP FUNCTION fc_i_nt_3_tt_3_suc; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_blobs.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_blobs.result new file mode 100644 index 00000000000..a0713d01593 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_blobs.result @@ -0,0 +1,4739 @@ +include/rpl_init.inc [topology=1->2->3] +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_2', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_3', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +### engines: TokuDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +### engines: TokuDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +### engines: TokuDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_eng_full.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_eng_full.result new file mode 100644 index 00000000000..d86105a3440 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_eng_full.result @@ -0,0 +1,3681 @@ +include/rpl_init.inc [topology=1->2->3] +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +### engines: TokuDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### Testing with TokuDB storage engine +CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +#### case #1: AI: no values logged +CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE; +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +c1 +100 +include/rpl_sync.inc +SELECT * FROM t1; +c1 +100 +SELECT * FROM t1; +c1 +100 +DROP TABLE t1; +include/rpl_sync.inc +#### case #2: AI: not empty but slave does not have usable data for its columns (INSERT) +CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE; +SET SQL_LOG_BIN=0; +CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=0; +CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, primary key(c2)) Engine=ENGINE; +SET SQL_LOG_BIN=1; +INSERT INTO t1(c2) VALUES (1); +SELECT * FROM t1; +c1 c2 +100 1 +include/rpl_sync.inc +SELECT * FROM t1; +c1 +100 +SELECT * FROM t1; +c1 +100 +DROP TABLE t1; +include/rpl_sync.inc +#### case #3: BI: usable columns on the slave, AI: no usable columns on the slave +CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE; +SET SQL_LOG_BIN=0; +CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=0; +CREATE TABLE t1 (c1 int DEFAULT 100, c2 int) Engine=ENGINE; +SET SQL_LOG_BIN=1; +INSERT INTO t1 VALUES (1,1); +SELECT * FROM t1; +c1 c2 +1 1 +include/rpl_sync.inc +SELECT * FROM t1; +c1 +1 +SELECT * FROM t1; +c1 +1 +UPDATE t1 SET c2=2 WHERE c1=1 AND c2=1; +SELECT * FROM t1; +c1 c2 +1 2 +include/rpl_sync.inc +SELECT * FROM t1; +c1 +1 +SELECT * FROM t1; +c1 +1 +DROP TABLE t1; +include/rpl_sync.inc +#### case #4: AI, BI: no usable columns on the slave (NOOP UPDATE). +#### +CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE; +SET SQL_LOG_BIN=0; +CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=0; +CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, c3 int, primary key(c2)) Engine=ENGINE; +SET SQL_LOG_BIN=1; +INSERT INTO t1 VALUES (1,1,1); +SELECT * FROM t1; +c1 c2 c3 +1 1 1 +include/rpl_sync.inc +SELECT * FROM t1; +c1 +1 +SELECT * FROM t1; +c1 +1 +UPDATE t1 SET c3=300 WHERE c2=1; +SELECT * FROM t1; +c1 c2 c3 +1 1 300 +include/rpl_sync.inc +SELECT * FROM t1; +c1 +1 +SELECT * FROM t1; +c1 +1 +DROP TABLE t1; +include/rpl_sync.inc +#### case #5: BI: no usable columns on the slave, AI: usable columns on the slave (slave must stop). +#### +CREATE TABLE t1 (c1 INT DEFAULT 100) Engine=ENGINE; +SET SQL_LOG_BIN=0; +CREATE TABLE t1 (c1 INT DEFAULT 100) Engine=ENGINE; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=0; +CREATE TABLE t1 (c1 INT DEFAULT 100, c2 INT PRIMARY KEY) Engine=ENGINE; +SET SQL_LOG_BIN=1; +INSERT INTO t1 VALUES (1,1); +SELECT * FROM t1; +c1 c2 +1 1 +include/rpl_sync.inc +SELECT * FROM t1; +c1 +1 +SELECT * FROM t1; +c1 +1 +UPDATE t1 SET c1=300 WHERE c2=1; +SELECT * FROM t1; +c1 c2 +300 1 +SET SQL_LOG_BIN=0; +call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032"); +call mtr.add_suppression("Slave SQL: .*Could not execute Update_rows event on table test.t1; Can.t find record in .t1.* Error_code: 1032"); +call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); +SET SQL_LOG_BIN=1; +include/wait_for_slave_sql_error_and_skip.inc [errno=1032] +DROP TABLE t1; +include/rpl_sync.inc +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_eng_min.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_eng_min.result new file mode 100644 index 00000000000..45a5e6ee341 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_eng_min.result @@ -0,0 +1,3522 @@ +include/rpl_init.inc [topology=1->2->3] +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +### engines: TokuDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_eng_noblob.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_eng_noblob.result new file mode 100644 index 00000000000..52906a7ee36 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_eng_noblob.result @@ -0,0 +1,3522 @@ +include/rpl_init.inc [topology=1->2->3] +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_2', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_3', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +### engines: TokuDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, TokuDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_idx_full.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_idx_full.result new file mode 100644 index 00000000000..e802156918e --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_idx_full.result @@ -0,0 +1,3505 @@ +include/rpl_init.inc [topology=1->2->3] +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +### engines: TokuDB, TokuDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, TokuDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_idx_min.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_idx_min.result new file mode 100644 index 00000000000..368b3b5f938 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_idx_min.result @@ -0,0 +1,3530 @@ +include/rpl_init.inc [topology=1->2->3] +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +### engines: TokuDB, TokuDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, TokuDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_idx_noblob.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_idx_noblob.result new file mode 100644 index 00000000000..bb6c3ea1c3e --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_img_idx_noblob.result @@ -0,0 +1,3530 @@ +include/rpl_init.inc [topology=1->2->3] +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_2', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_3', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +### engines: TokuDB, TokuDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, TokuDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: TokuDB, InnoDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, TokuDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= TokuDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, TokuDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= TokuDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no keys slaves with no keys as well +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with keys +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields (first slave with UK NOT NULL, second with PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with no key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, first slave with key on different field and second slave with key on yet another different field. +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields (first slave has UK NOT NULL) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with Key, slaves with PKs on different fields +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, slaves with no keys +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NULLABLE, first slave with K on different field second slave with key on yet another different field +CREATE TABLE t (c1 int, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL, first slave with UK NOT NULL on different field +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with UK NOT NULL and slaves with PK on different fields +CREATE TABLE t (c1 int NOT NULL, c2 blob, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and no keys on the slaves +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Master with PK and first slave with KEY only +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave (which has unique NOT NULL key instead of PK) +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Different PKs on master and first slave +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_log.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_log.result new file mode 100644 index 00000000000..73c010c6eb7 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_log.result @@ -0,0 +1,315 @@ +include/master-slave.inc +[connection master] +connection slave; +include/stop_slave.inc +include/wait_for_slave_to_stop.inc +reset master; +reset slave; +start slave; +include/wait_for_slave_to_start.inc +connection slave; +set @save_slave_ddl_exec_mode=@@global.slave_ddl_exec_mode; +set @@global.slave_ddl_exec_mode=STRICT; +connection master; +create table t1(n int not null auto_increment primary key)ENGINE=TokuDB; +insert into t1 values (NULL); +drop table t1; +create table t1 (word char(20) not null)ENGINE=TokuDB; +load data infile 'LOAD_FILE' into table t1 ignore 1 lines; +select count(*) from t1; +count(*) +69 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # insert into t1 values (NULL) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # load data infile '../../std_data/words.dat' into table t1 ignore 1 lines +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # insert into t1 values (NULL) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +flush logs; +create table t3 (a int)ENGINE=TokuDB; +connection master; +select * from t1 order by 1 asc; +word +Aarhus +Aaron +Aaron +Ababa +Ababa +aback +aback +abaft +abaft +abandon +abandon +abandoned +abandoned +abandoning +abandoning +abandonment +abandonment +abandons +abandons +abase +abased +abasement +abasements +abases +abash +abashed +abashes +abashing +abasing +abate +abated +abatement +abatements +abater +abates +abating +Abba +abbe +abbey +abbeys +abbot +abbots +Abbott +abbreviate +abbreviated +abbreviates +abbreviating +abbreviation +abbreviations +Abby +abdomen +abdomens +abdominal +abduct +abducted +abduction +abductions +abductor +abductors +abducts +Abe +abed +Abel +Abelian +Abelson +Aberdeen +Abernathy +aberrant +aberration +connection slave; +select * from t1 order by 1 asc; +word +Aarhus +Aaron +Aaron +Ababa +Ababa +aback +aback +abaft +abaft +abandon +abandon +abandoned +abandoned +abandoning +abandoning +abandonment +abandonment +abandons +abandons +abase +abased +abasement +abasements +abases +abash +abashed +abashes +abashing +abasing +abate +abated +abatement +abatements +abater +abates +abating +Abba +abbe +abbey +abbeys +abbot +abbots +Abbott +abbreviate +abbreviated +abbreviates +abbreviating +abbreviation +abbreviations +Abby +abdomen +abdomens +abdominal +abduct +abducted +abduction +abductions +abductor +abductors +abducts +Abe +abed +Abel +Abelian +Abelson +Aberdeen +Abernathy +aberrant +aberration +flush logs; +include/stop_slave.inc +include/start_slave.inc +connection master; +create table t2 (n int)ENGINE=TokuDB; +insert into t2 values (1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # insert into t1 values (NULL) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # load data infile '../../std_data/words.dat' into table t1 ignore 1 lines +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Rotate # # master-bin.000002;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 +master-bin.000002 # Gtid # # GTID #-#-# +master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=TokuDB +master-bin.000002 # Gtid # # GTID #-#-# +master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=TokuDB +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Annotate_rows # # insert into t2 values (1) +master-bin.000002 # Table_map # # table_id: # (test.t2) +master-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000002 # Xid # # COMMIT /* XID */ +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +connection slave; +show binary logs; +Log_name File_size +slave-bin.000001 # +slave-bin.000002 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Gtid # # GTID #-#-# +slave-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB +slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Annotate_rows # # insert into t1 values (NULL) +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Gtid # # GTID #-#-# +slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +slave-bin.000001 # Gtid # # GTID #-#-# +slave-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB +slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Annotate_rows # # load data infile '../../std_data/words.dat' into table t1 ignore 1 lines +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Gtid # # GTID #-#-# +slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=TokuDB +slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002 +slave-bin.000002 # Gtid # # GTID #-#-# +slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=TokuDB +slave-bin.000002 # Gtid # # BEGIN GTID #-#-# +slave-bin.000002 # Annotate_rows # # insert into t2 values (1) +slave-bin.000002 # Table_map # # table_id: # (test.t2) +slave-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F +slave-bin.000002 # Xid # # COMMIT /* XID */ +include/check_slave_is_running.inc +show binlog events in 'slave-bin.000005' from 4; +ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log +connection master; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +include/rpl_reset.inc +connection master; +create table t1(a int auto_increment primary key, b int); +insert into t1 values (NULL, 1); +set insert_id=5; +insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int) +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # insert into t1 values (NULL, 1) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +select * from t1; +a b +1 1 +5 1 +6 1 +drop table t1; +connection slave; +set @@global.slave_ddl_exec_mode=@save_slave_ddl_exec_mode; +connection master; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_lower_case_table_names.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_lower_case_table_names.result new file mode 100644 index 00000000000..d4a50261d60 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_lower_case_table_names.result @@ -0,0 +1,51 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +******** [ MASTER ] ******** +CREATE DATABASE BUG_37656; +use BUG_37656; +show databases like 'BUG_37656'; +Database (BUG_37656) +BUG_37656 +******** [ SLAVE ] ******** +show databases like 'bug_37656'; +Database (bug_37656) +bug_37656 +******** [ MASTER ] ******** +CREATE TABLE T1 (a int); +CREATE TABLE T2 (b int) ENGINE=TokuDB; +CREATE TABLE T3 (txt TEXT); +show tables; +Tables_in_BUG_37656 +T1 +T2 +T3 +******** [ SLAVE ] ******** +use bug_37656; +show tables; +Tables_in_bug_37656 +t2 +t3 +CREATE TABLE t1 (a INT); +******** [ MASTER ] ******** +use BUG_37656; +INSERT INTO T1 VALUES (1); +INSERT INTO T2 VALUES (1); +use test; +INSERT INTO BUG_37656.T1 VALUES (2); +INSERT INTO BUG_37656.T2 VALUES (2); +LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE BUG_37656.T3; +******** [ SLAVE ] ******** +include/diff_tables.inc [master:BUG_37656.T2, slave:bug_37656.t2] +include/diff_tables.inc [master:BUG_37656.T3, slave:bug_37656.t3] +******** [ MASTER ] ******** +DROP DATABASE BUG_37656; +include/rpl_reset.inc +CREATE DATABASE B50653; +USE B50653; +CREATE PROCEDURE b50653_proc() BEGIN SELECT 1; END; +DROP PROCEDURE b50653_proc; +DROP DATABASE B50653; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp003.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp003.result new file mode 100644 index 00000000000..c3345d52d06 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp003.result @@ -0,0 +1,66 @@ +include/master-slave.inc +[connection master] +connection master; +DROP PROCEDURE IF EXISTS test.p1; +DROP PROCEDURE IF EXISTS test.p2; +DROP TABLE IF EXISTS test.t1; +CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=TOKUDB; +CREATE PROCEDURE test.p1() +BEGIN +INSERT INTO test.t1 VALUES (4); +SELECT get_lock("test", 100); +UPDATE test.t1 set a=a+4 WHERE a=4; +END| +CREATE PROCEDURE test.p2() +BEGIN +UPDATE test.t1 SET a=a+1; +END| +SELECT get_lock("test", 200); +get_lock("test", 200) +1 +connection master1; +CALL test.p1(); +connection master; +CALL test.p2(); +SELECT release_lock("test"); +release_lock("test") +1 +connection master1; +get_lock("test", 100) +1 +SELECT release_lock("test"); +release_lock("test") +1 +connection master; +SELECT * FROM test.t1; +a +5 +connection slave; +connection slave; +SELECT * FROM test.t1; +a +5 +connection master; +DROP TABLE IF EXISTS test.t1; +CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=TOKUDB; +CALL test.p2(); +CALL test.p1(); +get_lock("test", 100) +1 +SELECT release_lock("test"); +release_lock("test") +1 +SELECT * FROM test.t1; +a +8 +connection slave; +connection slave; +SELECT * FROM test.t1; +a +8 +connection master; +DROP PROCEDURE IF EXISTS test.p1; +DROP PROCEDURE IF EXISTS test.p2; +DROP TABLE IF EXISTS test.t1; +connection slave; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp006.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp006.result new file mode 100644 index 00000000000..33c6c266950 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp006.result @@ -0,0 +1,46 @@ +include/master-slave.inc +[connection master] +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP PROCEDURE IF EXISTS p1; +DROP PROCEDURE IF EXISTS p2; +CREATE TABLE IF NOT EXISTS t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=TokuDB; +CREATE TABLE IF NOT EXISTS t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=TokuDB; +CREATE PROCEDURE p1() +BEGIN +DECLARE done INT DEFAULT 0; +DECLARE spa CHAR(16); +DECLARE spb INT; +DECLARE cur1 CURSOR FOR SELECT name, +(YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5)) +FROM t1; +DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1; +OPEN cur1; +SET AUTOCOMMIT=0; +REPEAT +FETCH cur1 INTO spa, spb; +IF NOT done THEN +START TRANSACTION; +INSERT INTO t2 VALUES (spa,spb); +COMMIT; +END IF; +UNTIL done END REPEAT; +SET AUTOCOMMIT=1; +CLOSE cur1; +END| +CREATE PROCEDURE p2() +BEGIN +INSERT INTO t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1'); +END| +CALL p2(); +connection slave; +connection master; +CALL p1(); +connection slave; +connection master; +DROP TABLE t1; +DROP TABLE t2; +DROP PROCEDURE p1; +DROP PROCEDURE p2; +connection slave; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_trig004.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_trig004.result new file mode 100644 index 00000000000..4d7ab112bc8 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_trig004.result @@ -0,0 +1,32 @@ +include/master-slave.inc +[connection master] +connection master; +DROP TRIGGER test.t1_bi_t2; +DROP TABLE IF EXISTS test.t1; +DROP TABLE IF EXISTS test.t2; +CREATE TABLE test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d FLOAT, PRIMARY KEY(n))ENGINE=TOKUDB; +CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=TOKUDB; +CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)// +INSERT INTO test.t2 VALUES (1, 0.0); +INSERT INTO test.t2 VALUES (1, 0.0); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +select * from test.t1; +n d +1 1.234 +select * from test.t2; +n f +1 0 +connection slave; +connection slave; +select * from test.t1; +n d +1 1.234 +select * from test.t2; +n f +1 0 +connection master; +DROP TRIGGER test.t1_bi_t2; +DROP TABLE test.t1; +DROP TABLE test.t2; +connection slave; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_log.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_log.result new file mode 100644 index 00000000000..83335b0237c --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_log.result @@ -0,0 +1,304 @@ +include/master-slave.inc +[connection master] +connection slave; +include/stop_slave.inc +include/wait_for_slave_to_stop.inc +reset master; +reset slave; +start slave; +include/wait_for_slave_to_start.inc +connection slave; +set @save_slave_ddl_exec_mode=@@global.slave_ddl_exec_mode; +set @@global.slave_ddl_exec_mode=STRICT; +connection master; +create table t1(n int not null auto_increment primary key)ENGINE=TokuDB; +insert into t1 values (NULL); +drop table t1; +create table t1 (word char(20) not null)ENGINE=TokuDB; +load data infile 'LOAD_FILE' into table t1 ignore 1 lines; +select count(*) from t1; +count(*) +69 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `test`; insert into t1 values (NULL) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (`word`) ;file_id=# +master-bin.000001 # Xid # # COMMIT /* XID */ +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `test`; insert into t1 values (NULL) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +flush logs; +create table t3 (a int)ENGINE=TokuDB; +connection master; +select * from t1 order by 1 asc; +word +Aarhus +Aaron +Aaron +Ababa +Ababa +aback +aback +abaft +abaft +abandon +abandon +abandoned +abandoned +abandoning +abandoning +abandonment +abandonment +abandons +abandons +abase +abased +abasement +abasements +abases +abash +abashed +abashes +abashing +abasing +abate +abated +abatement +abatements +abater +abates +abating +Abba +abbe +abbey +abbeys +abbot +abbots +Abbott +abbreviate +abbreviated +abbreviates +abbreviating +abbreviation +abbreviations +Abby +abdomen +abdomens +abdominal +abduct +abducted +abduction +abductions +abductor +abductors +abducts +Abe +abed +Abel +Abelian +Abelson +Aberdeen +Abernathy +aberrant +aberration +connection slave; +select * from t1 order by 1 asc; +word +Aarhus +Aaron +Aaron +Ababa +Ababa +aback +aback +abaft +abaft +abandon +abandon +abandoned +abandoned +abandoning +abandoning +abandonment +abandonment +abandons +abandons +abase +abased +abasement +abasements +abases +abash +abashed +abashes +abashing +abasing +abate +abated +abatement +abatements +abater +abates +abating +Abba +abbe +abbey +abbeys +abbot +abbots +Abbott +abbreviate +abbreviated +abbreviates +abbreviating +abbreviation +abbreviations +Abby +abdomen +abdomens +abdominal +abduct +abducted +abduction +abductions +abductor +abductors +abducts +Abe +abed +Abel +Abelian +Abelson +Aberdeen +Abernathy +aberrant +aberration +flush logs; +include/stop_slave.inc +include/start_slave.inc +connection master; +create table t2 (n int)ENGINE=TokuDB; +insert into t2 values (1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `test`; insert into t1 values (NULL) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (`word`) ;file_id=# +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Rotate # # master-bin.000002;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 +master-bin.000002 # Gtid # # GTID #-#-# +master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=TokuDB +master-bin.000002 # Gtid # # GTID #-#-# +master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=TokuDB +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Query # # use `test`; insert into t2 values (1) +master-bin.000002 # Xid # # COMMIT /* XID */ +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +connection slave; +show binary logs; +Log_name File_size +slave-bin.000001 # +slave-bin.000002 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Gtid # # GTID #-#-# +slave-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB +slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Intvar # # INSERT_ID=1 +slave-bin.000001 # Query # # use `test`; insert into t1 values (NULL) +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Gtid # # GTID #-#-# +slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +slave-bin.000001 # Gtid # # GTID #-#-# +slave-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB +slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +slave-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../tmp/SQL_LOAD-<SERVER UUID>-<MASTER server-id>-<file-id>.<extension>' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (`word`) ;file_id=# +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Gtid # # GTID #-#-# +slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=TokuDB +slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002 +slave-bin.000002 # Gtid # # GTID #-#-# +slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=TokuDB +slave-bin.000002 # Gtid # # BEGIN GTID #-#-# +slave-bin.000002 # Query # # use `test`; insert into t2 values (1) +slave-bin.000002 # Xid # # COMMIT /* XID */ +include/check_slave_is_running.inc +show binlog events in 'slave-bin.000005' from 4; +ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log +connection master; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +include/rpl_reset.inc +connection master; +create table t1(a int auto_increment primary key, b int); +insert into t1 values (NULL, 1); +set insert_id=5; +insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int) +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `test`; insert into t1 values (NULL, 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # LAST_INSERT_ID=1 +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()) +master-bin.000001 # Query # # COMMIT +select * from t1; +a b +1 1 +5 1 +6 1 +drop table t1; +connection slave; +set @@global.slave_ddl_exec_mode=@save_slave_ddl_exec_mode; +connection master; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_mixed_crash_safe.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_mixed_crash_safe.result new file mode 100644 index 00000000000..226a2b93140 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_mixed_crash_safe.result @@ -0,0 +1,1773 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression('Attempting backtrace'); +call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001"); +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression(".* InnoDB: Warning: allocated tablespace .*, old maximum was .*"); +################################################################################### +# PREPARE EXECUTION +################################################################################### +include/stop_slave.inc +SHOW CREATE TABLE mysql.slave_relay_log_info; +Table Create Table +slave_relay_log_info CREATE TABLE `slave_relay_log_info` ( + `Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.', + `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the current relay log file.', + `Relay_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The relay log position of the last executed event.', + `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log file from which the events in the relay log file were read.', + `Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last executed event.', + `Sql_delay` int(11) NOT NULL COMMENT 'The number of seconds that the slave must lag behind the master.', + `Number_of_workers` int(10) unsigned NOT NULL, + `Id` int(10) unsigned NOT NULL COMMENT 'Internal Id that uniquely identifies this record.', + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Relay Log Information' +SHOW CREATE TABLE mysql.slave_worker_info; +Table Create Table +slave_worker_info CREATE TABLE `slave_worker_info` ( + `Id` int(10) unsigned NOT NULL, + `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Relay_log_pos` bigint(20) unsigned NOT NULL, + `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Master_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Checkpoint_relay_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Checkpoint_master_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_seqno` int(10) unsigned NOT NULL, + `Checkpoint_group_size` int(10) unsigned NOT NULL, + `Checkpoint_group_bitmap` blob NOT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Worker Information' +ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb; +ALTER TABLE mysql.slave_worker_info ENGINE= Innodb; +SHOW CREATE TABLE mysql.slave_relay_log_info; +Table Create Table +slave_relay_log_info CREATE TABLE `slave_relay_log_info` ( + `Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.', + `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the current relay log file.', + `Relay_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The relay log position of the last executed event.', + `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log file from which the events in the relay log file were read.', + `Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last executed event.', + `Sql_delay` int(11) NOT NULL COMMENT 'The number of seconds that the slave must lag behind the master.', + `Number_of_workers` int(10) unsigned NOT NULL, + `Id` int(10) unsigned NOT NULL COMMENT 'Internal Id that uniquely identifies this record.', + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Relay Log Information' +SHOW CREATE TABLE mysql.slave_worker_info; +Table Create Table +slave_worker_info CREATE TABLE `slave_worker_info` ( + `Id` int(10) unsigned NOT NULL, + `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Relay_log_pos` bigint(20) unsigned NOT NULL, + `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Master_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Checkpoint_relay_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Checkpoint_master_log_pos` bigint(20) unsigned NOT NULL, + `Checkpoint_seqno` int(10) unsigned NOT NULL, + `Checkpoint_group_size` int(10) unsigned NOT NULL, + `Checkpoint_group_bitmap` blob NOT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Worker Information' +include/start_slave.inc +rpl_mixing_engines.inc [commands=configure] +CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = TokuDB; +INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1); +CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +END| +CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +END| +CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +RETURN "fc_i_tt_5_suc"; +END| +CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +RETURN "fc_i_nt_5_suc"; +END| +CREATE FUNCTION fc_i_nt_3_tt_3_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_3(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +SELECT max(stmt_id) INTO in_stmt_id FROM tt_3 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_3(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +RETURN "fc_i_nt_3_tt_3_suc"; +END| +CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id; +INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +################################################################################### +# EXECUTE CASES CRASHING THE XID +################################################################################### + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=T] +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-func] +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (9, 1); +fc_i_tt_5_suc (9, 1) +fc_i_tt_5_suc +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-proc] +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (10, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-trig C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-func C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (12, 4); +fc_i_tt_5_suc (12, 4) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(12,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(12,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-proc C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (13, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-trig T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-func T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (15, 2); +fc_i_tt_5_suc (15, 2) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(15,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(15,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_apply";; +FAILURE d,crash_after_apply and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-proc T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (16, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=T] +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-func] +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (19, 1); +fc_i_tt_5_suc (19, 1) +fc_i_tt_5_suc +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(19,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(19,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-proc] +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (20, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-trig C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-func C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (22, 4); +fc_i_tt_5_suc (22, 4) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(22,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(22,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-proc C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (23, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-trig T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-func T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (25, 2); +fc_i_tt_5_suc (25, 2) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(25,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(25,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_before_update_pos";; +FAILURE d,crash_before_update_pos and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-proc T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (26, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=T] +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-func] +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (29, 1); +fc_i_tt_5_suc (29, 1) +fc_i_tt_5_suc +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(29,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(29,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=T-proc] +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (30, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-trig C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-func C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (32, 4); +fc_i_tt_5_suc (32, 4) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(32,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(32,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T T-proc C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (33, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-trig T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-func T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (35, 2); +fc_i_tt_5_suc (35, 2) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(35,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(35,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_update_pos_before_apply";; +FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1 +rpl_mixing_engines.inc [commands=B T-proc T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (36, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T] +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-func] +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (39, 1); +fc_i_tt_5_suc (39, 1) +fc_i_tt_5_suc +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(39,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(39,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-proc] +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (40, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-trig C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-func C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (42, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (42, 4); +fc_i_tt_5_suc (42, 4) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (42, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(42,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (42, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(42,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-proc C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (43, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (43, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (43, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',43), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',43), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (43, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',43), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',43), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-trig T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (44, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (44, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (44, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-func T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (45, 2); +fc_i_tt_5_suc (45, 2) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(45,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(45,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-proc T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (46, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (46, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',46), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',46), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (46, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',46), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',46), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (46, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc +################################################################################### +# EXECUTE CASES CRASHING THE BEGIN/COMMIT +################################################################################### + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_and_update_pos";; +FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=N] +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (47, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (47, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (47, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_and_update_pos";; +FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=N-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (48, 1); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (48, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (48, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_and_update_pos";; +FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=N-func] +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (49, 1); +fc_i_nt_5_suc (49, 1) +fc_i_nt_5_suc +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(49,1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(49,1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc +################################################################################### +# CHECK CONSISTENCY +################################################################################### +include/sync_slave_sql_with_master.inc +################################################################################### +# CLEAN +################################################################################### +rpl_mixing_engines.inc [commands=clean] +DROP TABLE tt_1; +DROP TABLE tt_2; +DROP TABLE tt_3; +DROP TABLE tt_4; +DROP TABLE tt_5; +DROP TABLE tt_6; +DROP TABLE nt_1; +DROP TABLE nt_2; +DROP TABLE nt_3; +DROP TABLE nt_4; +DROP TABLE nt_5; +DROP TABLE nt_6; +DROP PROCEDURE pc_i_tt_5_suc; +DROP PROCEDURE pc_i_nt_5_suc; +DROP FUNCTION fc_i_tt_5_suc; +DROP FUNCTION fc_i_nt_5_suc; +DROP FUNCTION fc_i_nt_3_tt_3_suc; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_mixed_lower_case_table_names.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_mixed_lower_case_table_names.result new file mode 100644 index 00000000000..e3d83733ed0 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_mixed_lower_case_table_names.result @@ -0,0 +1,48 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +******** [ MASTER ] ******** +CREATE DATABASE BUG_37656; +use BUG_37656; +show databases like 'BUG_37656'; +Database (BUG_37656) +BUG_37656 +******** [ SLAVE ] ******** +show databases like 'bug_37656'; +Database (bug_37656) +bug_37656 +******** [ MASTER ] ******** +CREATE TABLE T1 (a int); +CREATE TABLE T2 (b int) ENGINE=TokuDB; +CREATE TABLE T3 (txt TEXT); +show tables; +Tables_in_BUG_37656 +T1 +T2 +T3 +******** [ SLAVE ] ******** +use bug_37656; +show tables; +Tables_in_bug_37656 +t2 +t3 +CREATE TABLE t1 (a INT); +******** [ MASTER ] ******** +use BUG_37656; +INSERT INTO T1 VALUES (1); +INSERT INTO T2 VALUES (1); +LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE BUG_37656.T3; +******** [ SLAVE ] ******** +include/diff_tables.inc [master:BUG_37656.T2, slave:bug_37656.t2] +include/diff_tables.inc [master:BUG_37656.T3, slave:bug_37656.t3] +******** [ MASTER ] ******** +DROP DATABASE BUG_37656; +include/rpl_reset.inc +CREATE DATABASE B50653; +USE B50653; +CREATE PROCEDURE b50653_proc() BEGIN SELECT 1; END; +DROP PROCEDURE b50653_proc; +DROP DATABASE B50653; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_not_null_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_not_null_tokudb.test index 57243376ac2..53cf555ce64 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_not_null_tokudb.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_not_null_tokudb.test @@ -11,9 +11,9 @@ # 3 - NULL --> NOT NULL ( sql-mode != STRICT and no failures) # ################################################################################# ---source include/master-slave.inc --source include/have_tokudb.inc --source include/have_binlog_format_row.inc +--source include/master-slave.inc let $engine=TokuDB; --source extra/rpl_tests/rpl_not_null.test diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt index 0aa48174807..e1bddaa2204 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt @@ -1,5 +1,2 @@ ---read-only=ON ---loose-tokudb-rpl-unique-checks-delay=10000 ---loose-tokudb-rpl-unique-checks=OFF ---loose-tokudb-rpl-lookup-rows-delay=10000 ---loose-tokudb-rpl-lookup-rows=OFF +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=OFF + diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt index 0aa48174807..93a2685e847 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt @@ -1,5 +1 @@ ---read-only=ON ---loose-tokudb-rpl-unique-checks-delay=10000 ---loose-tokudb-rpl-unique-checks=OFF ---loose-tokudb-rpl-lookup-rows-delay=10000 ---loose-tokudb-rpl-lookup-rows=OFF +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test index d6ccf2487ae..25fe8847dad 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test @@ -42,15 +42,16 @@ update t set b=b+2 where a=1; update t set b=b+3 where a=4; update t set b=b+4 where a=3; update t set b=b+1 where 1<=a and a<=3; -select unix_timestamp() into @tstart; +--echo # select unix_timestamp() into @tstart; # wait for the delete to finish on the slave connection master; sync_slave_with_master; # source include/sync_slave_sql_with_master.inc; connection master; -select unix_timestamp() into @tend; -#select @tend-@tstart <= 5; # assert no delay in the delete time +--echo # Commented out for MariaDB +--echo # select unix_timestamp() into @tend; +--echo # select @tend-@tstart <= 5; # assert no delay in the delete time connection slave; select * from t; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt index 7f49776e4e8..dd719829112 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt @@ -1,3 +1,2 @@ ---read-only=ON ---loose-tokudb-rpl-unique-checks-delay=5000 ---loose-tokudb-rpl-unique-checks=OFF +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=5000 --loose-tokudb-rpl-unique-checks=OFF + diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test index db96ac321c0..d2a1cbea328 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test @@ -22,7 +22,6 @@ connection master; # select @@autocommit; eval create table t (a bigint not null, primary key(a)) engine=$engine; # show create table t; -select unix_timestamp() into @tstart; insert into t values (1); insert into t values (2),(3); insert into t values (4); @@ -30,8 +29,7 @@ insert into t values (4); sync_slave_with_master; # source include/sync_slave_sql_with_master.inc; -#connection master; -#select unix_timestamp()-@tstart; +connection master; connection slave; # insert into t values (5); # test read-only diff --git a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_rfr_disable_on_expl_pk_absence-slave.opt index c87bbb62418..c87bbb62418 100644 --- a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_rfr_disable_on_expl_pk_absence-slave.opt diff --git a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence.test b/storage/tokudb/mysql-test/rpl/t/rpl_rfr_disable_on_expl_pk_absence.test index 67e77c1511c..67e77c1511c 100644 --- a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_rfr_disable_on_expl_pk_absence.test diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_row_basic_3tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_row_basic_3tokudb.test index eb1bad94e29..4c38646b112 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_row_basic_3tokudb.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_row_basic_3tokudb.test @@ -1,11 +1,11 @@ --- source include/have_tokudb.inc --- source include/have_binlog_format_row.inc --- source include/master-slave.inc +--source include/have_tokudb.inc +--source include/have_binlog_format_row.inc +--source include/master-slave.inc connection slave; let $bit_field_special = ALL_LOSSY; -let $type= 'TokuDB'; -let $extra_index= ; --- source extra/rpl_tests/rpl_row_basic.test +let $type = 'TokuDB'; +let $extra_index = ; +--source extra/rpl_tests/rpl_row_basic.test --source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_stm_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_stm_tokudb.test index bd4de6e467c..25f0ab3b934 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_stm_tokudb.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_stm_tokudb.test @@ -4,6 +4,7 @@ source include/master-slave.inc; source include/have_tokudb.inc; source include/have_binlog_format_statement.inc; +# gtids disabled because it tests DROP TEMPORARY inside a transaction source extra/rpl_tests/rpl_tokudb.test; --source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_commit_after_flush.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_commit_after_flush.test new file mode 100644 index 00000000000..b39661c111b --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_commit_after_flush.test @@ -0,0 +1,5 @@ +-- source include/have_tokudb.inc +-- source include/master-slave.inc +let $engine_type=tokudb; +-- source extra/rpl_tests/rpl_commit_after_flush.test +--source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id-master.opt new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id-master.opt diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id-slave.opt new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id-slave.opt diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id.test new file mode 100644 index 00000000000..b0308402b40 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id.test @@ -0,0 +1,6 @@ +################################# +# Wrapper for rpl_insert_id.test# +################################# +-- source include/have_tokudb.inc +let $engine_type=tokudb; +-- source extra/rpl_tests/rpl_insert_id.test diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id_pk.test new file mode 100644 index 00000000000..103cad8a266 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_insert_id_pk.test @@ -0,0 +1,6 @@ +################################# +# Wrapper for rpl_insert_id.test# +################################# +-- source include/have_tokudb.inc +let $engine_type=tokudb; +-- source extra/rpl_tests/rpl_insert_id_pk.test diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update.test new file mode 100644 index 00000000000..89a73b1506f --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update.test @@ -0,0 +1,3 @@ +-- source include/have_tokudb.inc +let $engine_type=TokuDB; +-- source extra/rpl_tests/rpl_multi_update.test diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update2-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update2-slave.opt new file mode 100644 index 00000000000..17d4171af0e --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update2-slave.opt @@ -0,0 +1 @@ +--replicate-ignore-table=nothing.sensible diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update2.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update2.test new file mode 100644 index 00000000000..b73b302d024 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update2.test @@ -0,0 +1,12 @@ +####################################################### +# Wrapper for rpl_multi_update2.test to allow multi # +# Engines to reuse test code. By JBM 2006-02-15 # +# Added comments section and to skip when ndb is # +# Default engine. # +####################################################### +--source include/have_tokudb.inc +--source include/master-slave.inc +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT'); +let $engine_type=TokuDB; +--source extra/rpl_tests/rpl_multi_update2.test +--source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update3.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update3.test new file mode 100644 index 00000000000..2cdf44bff16 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_multi_update3.test @@ -0,0 +1,12 @@ +####################################################### +# Wrapper for rpl_multi_update3.test to allow multi # +# Engines to reuse test code. By JBM 2006-02-15 # +# Added comments section and to skip when ndb is # +# Default engine. # +####################################################### +--source include/have_tokudb.inc +--source include/master-slave.inc +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); +let $engine_type=TokuDB; +--source extra/rpl_tests/rpl_multi_update3.test +--source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_tokudb_rfr_partition_table-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_rfr_partition_table-slave.opt index 2a7ec2590cc..2a7ec2590cc 100644 --- a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_tokudb_rfr_partition_table-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_rfr_partition_table-slave.opt diff --git a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_tokudb_rfr_partition_table.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_rfr_partition_table.test index eadeda83cd5..a9cdaa57248 100644 --- a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_tokudb_rfr_partition_table.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_rfr_partition_table.test @@ -1,5 +1,7 @@ # test tokudb read free replication feature with partition table +skip MDEV-13441; +--source include/have_partition.inc --source include/have_debug.inc --source include/have_partition.inc --source include/have_tokudb.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_crash_safe-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_crash_safe-master.opt new file mode 100644 index 00000000000..e980c2de7ff --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_crash_safe-master.opt @@ -0,0 +1 @@ +--transaction_isolation=READ-COMMITTED diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_crash_safe-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_crash_safe-slave.opt new file mode 100644 index 00000000000..264c5c1a4b4 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_crash_safe-slave.opt @@ -0,0 +1 @@ +--skip-slave-start --relay-log-info-repository=TABLE --relay-log-recovery=1 --transaction_isolation=READ-COMMITTED diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_crash_safe.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_crash_safe.test new file mode 100644 index 00000000000..6bd79691528 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_crash_safe.test @@ -0,0 +1,19 @@ +# This test takes long time, so only run it with the --big-test mtr-flag. +--source include/big_test.inc +--source include/not_embedded.inc +--source include/not_valgrind.inc +--source include/have_debug.inc +--source include/have_tokudb.inc +--source include/have_binlog_format_row.inc +--source include/not_mts_slave_parallel_workers.inc +--source include/master-slave.inc + +call mtr.add_suppression('Attempting backtrace'); +call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001"); +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression(".* InnoDB: Warning: allocated tablespace .*, old maximum was .*"); + +let $engine_type=TokuDB; +let $database_name=test; +--source extra/rpl_tests/rpl_crash_safe.test +--source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_blobs.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_blobs.test new file mode 100644 index 00000000000..ff4a0435a5e --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_blobs.test @@ -0,0 +1,54 @@ +#Want to skip this test from daily Valgrind execution +skip Require rpl files from MySQL; +--source include/no_valgrind_without_big.inc + +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +# +# This file contains tests for WL#5096. +# + +-- let $rpl_topology= 1->2->3 +-- source include/rpl_init.inc +-- source include/have_binlog_format_row.inc + +# +# WL#5096 Tests. +# + +# +# Tests combinations of binlog-row-image against mixes of MyISAM and InnoDB +# storage engines on all three servers. +# +# All the combinarions need not to be separated into their own files as +# the tests for indexes and engines mixes are, because noblobs test script +# does not take too long time, thence we do not risk triggering PB2 timeout +# on valgrind runs. +# + +## NOBLOB + +-- let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/rpl_row_img_blobs.test +-- source suite/tokudb.rpl/include/rpl_tokudb_row_img_general_loop.inc + +## MINIMAL + +-- let $row_img_set=server_1:MINIMAL:N,server_2:MINIMAL:Y,server_3:MINIMAL:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/rpl_row_img_blobs.test +-- source suite/tokudb.rpl/include/rpl_tokudb_row_img_general_loop.inc + +## FULL + +-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/rpl_row_img_blobs.test +-- source suite/tokudb.rpl/include/rpl_tokudb_row_img_general_loop.inc + + +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_eng_full.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_eng_full.test new file mode 100644 index 00000000000..68ff71752ac --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_eng_full.test @@ -0,0 +1,51 @@ +#Want to skip this test from daily Valgrind execution +skip Require rpl files from MySQL; +-- source include/no_valgrind_without_big.inc +# +# This file contains tests for WL#5096 and bug fixes. +# + +-- source include/have_binlog_format_row.inc +-- source include/not_gtid_enabled.inc + +-- let $rpl_topology= 1->2->3 +-- source include/rpl_init.inc + +-- connection server_1 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_2 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_3 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_1 + +# +# WL#5096 +# + +# +# Tests for different storage engines on each server, +# but same index structure on tables. The tests are conducted +# using FULL binlog-row-image on all servers. +# + +-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test +-- source suite/tokudb.rpl/include/rpl_tokudb_row_img_general_loop.inc + +# +# BUG#49100 +# + +-- echo ### Testing with TokuDB storage engine + +-- let $engine=TokuDB +-- source extra/rpl_tests/rpl_row_empty_imgs.test + + +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_eng_min.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_eng_min.test new file mode 100644 index 00000000000..3ba958fc691 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_eng_min.test @@ -0,0 +1,43 @@ +#Want to skip this test from daily Valgrind execution +skip Require rpl files from MySQL; +-- source include/no_valgrind_without_big.inc +# +# This file contains tests for WL#5096 and bug fixes. +# + +-- let $rpl_topology= 1->2->3 +-- source include/rpl_init.inc +-- source include/have_binlog_format_row.inc + +-- connection server_1 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_2 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_3 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_1 + +# +# WL#5096 +# + +# +# Tests for different storage engines on each server, +# but same index structure on tables. The tests are conducted +# using MINIMAL binlog-row-image on all servers. +# + +-- let $row_img_set=server_1:MINIMAL:N,server_2:MINIMAL:Y,server_3:MINIMAL:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test +-- source suite/tokudb.rpl/include/rpl_tokudb_row_img_general_loop.inc + +-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +-- source include/rpl_row_img_set.inc + + +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_eng_noblob.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_eng_noblob.test new file mode 100644 index 00000000000..f539e3ac370 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_eng_noblob.test @@ -0,0 +1,43 @@ +#Want to skip this test from daily Valgrind execution +skip Require rpl files from MySQL; +-- source include/no_valgrind_without_big.inc +# +# This file contains tests for WL#5096 and bug fixes. +# + +-- let $rpl_topology= 1->2->3 +-- source include/rpl_init.inc +-- source include/have_binlog_format_row.inc + +-- connection server_1 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_2 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_3 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_1 + +# +# WL#5096 +# + +# +# Tests for different storage engines on each server, +# but same index structure on tables. The tests are conducted +# using NOBLOB binlog-row-image on all servers. +# + +-- let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test +-- source suite/tokudb.rpl/include/rpl_tokudb_row_img_general_loop.inc + +-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +-- source include/rpl_row_img_set.inc + + +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_idx_full.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_idx_full.test new file mode 100644 index 00000000000..9dfd1675f53 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_idx_full.test @@ -0,0 +1,39 @@ +#Want to skip this test from daily Valgrind execution +skip Require rpl files from MySQL; +-- source include/no_valgrind_without_big.inc +# +# This file contains tests for WL#5096. +# + +-- let $rpl_topology= 1->2->3 +-- source include/rpl_init.inc +-- source include/have_binlog_format_row.inc + +-- connection server_1 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_2 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_3 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_1 + +# +# WL#5096 Tests. +# + +# +# Tests FULL image against a mix of MyISAM and InnoDB engines on +# each of the three servers. +# + +-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/rpl_row_img_diff_indexes.test +-- source suite/tokudb.rpl/include/rpl_tokudb_row_img_general_loop.inc + + +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_idx_min.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_idx_min.test new file mode 100644 index 00000000000..03e022940a6 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_idx_min.test @@ -0,0 +1,42 @@ +#Want to skip this test from daily Valgrind execution +skip Require rpl files from MySQL; +--source include/no_valgrind_without_big.inc +# +# This file contains tests for WL#5096. +# + +--let $rpl_topology= 1->2->3 +--source include/rpl_init.inc +-- source include/have_binlog_format_row.inc + +-- connection server_1 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_2 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_3 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_1 + +# +# WL#5096 Tests. +# + +# +# Tests MINIMAL image against a mix of MyISAM and InnoDB engines on +# each of the three servers. +# + +-- let $row_img_set=server_1:MINIMAL:N,server_2:MINIMAL:Y,server_3:MINIMAL:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/rpl_row_img_diff_indexes.test +-- source suite/tokudb.rpl/include/rpl_tokudb_row_img_general_loop.inc + +-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +-- source include/rpl_row_img_set.inc + + +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_idx_noblob.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_idx_noblob.test new file mode 100644 index 00000000000..ed147c8902b --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_img_idx_noblob.test @@ -0,0 +1,42 @@ +#Want to skip this test from daily Valgrind execution +skip Require rpl files from MySQL; +-- source include/no_valgrind_without_big.inc +# +# This file contains tests for WL#5096. +# + +-- let $rpl_topology= 1->2->3 +-- source include/rpl_init.inc +-- source include/have_binlog_format_row.inc + +-- connection server_1 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_2 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_3 +-- source include/have_innodb.inc +-- source include/have_tokudb.inc +-- connection server_1 + +# +# WL#5096 +# + +# +# Tests NOBLOB image against a mix of MyISAM and InnoDB engines on +# each of the three servers. +# + +-- let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/rpl_row_img_diff_indexes.test +-- source suite/tokudb.rpl/include/rpl_tokudb_row_img_general_loop.inc + +-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +-- source include/rpl_row_img_set.inc + + +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_log-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_log-master.opt new file mode 100644 index 00000000000..773ec62bef2 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_log-master.opt @@ -0,0 +1,2 @@ +--skip-external-locking +--default-storage-engine=MyISAM diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_log.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_log.test new file mode 100644 index 00000000000..826eb5eab86 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_log.test @@ -0,0 +1,14 @@ +################################### +# Wrapper for rpl_row_log.test # +# Added wrapper so that MyISAM & # +# Innodb and NDB could all use the# +# Same test. NDB produced a diff # +# bin-log # +################################### +-- source include/have_binlog_format_row.inc +-- source include/have_tokudb.inc +-- source include/master-slave.inc +let $engine_type=TokuDB; +-- source extra/rpl_tests/rpl_log.test + +--source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_lower_case_table_names-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_lower_case_table_names-slave.opt new file mode 100644 index 00000000000..8be29bbe976 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_lower_case_table_names-slave.opt @@ -0,0 +1 @@ +--replicate-do-db=bug_37656 --replicate-ignore-table=bug_37656.t1 --replicate-do-table=bug_37656.t2 --replicate-do-table=bug_37656.t3 --lower-case-table-names=1 diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_lower_case_table_names.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_lower_case_table_names.test new file mode 100644 index 00000000000..c9f6d9055b3 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_lower_case_table_names.test @@ -0,0 +1,15 @@ +# BUG#37656 +# +# For details look into extra/rpl_tests/rpl_lower_case_table_names.test +# +skip Missing extra/rpl_tests/rpl_lower_case_table_names.test; + +-- source include/not_gtid_enabled.inc +-- source include/have_tokudb.inc +-- source include/not_windows.inc +-- source include/have_binlog_format_row.inc +-- source include/master-slave.inc + +-- let $engine=TokuDB +-- source extra/rpl_tests/rpl_lower_case_table_names.test +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_sp003.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_sp003.test new file mode 100644 index 00000000000..1c5be34fb23 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_sp003.test @@ -0,0 +1,13 @@ +################################# +# Wrapper for rpl_row_sp003.test# +################################# +######################################################## +# By JBM 2005-02-15 Wrapped to allow reuse of test code# +# Added to skip if ndb is default # +######################################################## +-- source include/have_tokudb.inc +-- source include/have_binlog_format_row.inc +-- source include/master-slave.inc +let $engine_type=TOKUDB; +-- source extra/rpl_tests/rpl_row_sp003.test +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_sp006.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_sp006.test new file mode 100644 index 00000000000..064339b8e68 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_sp006.test @@ -0,0 +1,13 @@ +################################# +# Wrapper for rpl_row_sp006.test# +################################# +######################################################## +# By JBM 2005-02-15 Wrapped to allow reuse of test code# +# Added to skip if ndb is default # +######################################################## +-- source include/have_tokudb.inc +-- source include/have_binlog_format_row.inc +-- source include/master-slave.inc +let $engine_type=TokuDB; +-- source extra/rpl_tests/rpl_row_sp006.test +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_trig004.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_trig004.test new file mode 100644 index 00000000000..471c5f8cc3d --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_row_trig004.test @@ -0,0 +1,18 @@ +############################################################################# +# Original Author: JBM # +# Original Date: Oct/18/2005 # +############################################################################# +# TEST: Use before insert triggers and has the second insert fail # +############################################################################# +# Change by JBM 2006-02-14 added to skip when NDB default engine # +# This test has been wrapped to allow multipal engines to use same code # +############################################################################# + +# Includes +-- source include/have_binlog_format_row.inc +-- source include/have_tokudb.inc +-- source include/master-slave.inc +let $engine_type=TOKUDB; +-- source extra/rpl_tests/rpl_trig004.test + +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_log-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_log-master.opt new file mode 100644 index 00000000000..773ec62bef2 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_log-master.opt @@ -0,0 +1,2 @@ +--skip-external-locking +--default-storage-engine=MyISAM diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_log.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_log.test new file mode 100644 index 00000000000..b877d555619 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_log.test @@ -0,0 +1,14 @@ +################################### +# Wrapper for rpl_row_log.test # +# Added wrapper so that MyISAM & # +# Innodb and NDB could all use the# +# Same test. NDB produced a diff # +# bin-log # +################################### +-- source include/have_binlog_format_statement.inc +-- source include/have_tokudb.inc +-- source include/master-slave.inc +let $engine_type=TokuDB; +-- source extra/rpl_tests/rpl_log.test + +--source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_crash_safe-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_crash_safe-master.opt new file mode 100644 index 00000000000..e980c2de7ff --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_crash_safe-master.opt @@ -0,0 +1 @@ +--transaction_isolation=READ-COMMITTED diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_crash_safe-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_crash_safe-slave.opt new file mode 100644 index 00000000000..264c5c1a4b4 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_crash_safe-slave.opt @@ -0,0 +1 @@ +--skip-slave-start --relay-log-info-repository=TABLE --relay-log-recovery=1 --transaction_isolation=READ-COMMITTED diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_crash_safe.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_crash_safe.test new file mode 100644 index 00000000000..724550fae4a --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_crash_safe.test @@ -0,0 +1,18 @@ +--source include/big_test.inc +--source include/not_embedded.inc +--source include/not_valgrind.inc +--source include/have_debug.inc +--source include/have_tokudb.inc +--source include/have_binlog_format_mixed_or_statement.inc +--source include/not_mts_slave_parallel_workers.inc +--source include/master-slave.inc + +call mtr.add_suppression('Attempting backtrace'); +call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001"); +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression(".* InnoDB: Warning: allocated tablespace .*, old maximum was .*"); + +let $engine_type=TokuDB; +let $database_name=test; +--source extra/rpl_tests/rpl_crash_safe.test +--source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_lower_case_table_names-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_lower_case_table_names-slave.opt new file mode 100644 index 00000000000..8be29bbe976 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_lower_case_table_names-slave.opt @@ -0,0 +1 @@ +--replicate-do-db=bug_37656 --replicate-ignore-table=bug_37656.t1 --replicate-do-table=bug_37656.t2 --replicate-do-table=bug_37656.t3 --lower-case-table-names=1 diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_lower_case_table_names.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_lower_case_table_names.test new file mode 100644 index 00000000000..f9fd0e13b83 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_stm_mixed_lower_case_table_names.test @@ -0,0 +1,14 @@ +# BUG#37656 +# +# For details look into extra/rpl_tests/rpl_lower_case_table_names.test +# +skip Missing extra/rpl_tests/rpl_lower_case_table_names.test; + +-- source include/have_tokudb.inc +-- source include/not_windows.inc +-- source include/have_binlog_format_mixed_or_statement.inc +-- source include/master-slave.inc + +-- let $engine=TokuDB +-- source extra/rpl_tests/rpl_lower_case_table_names.test +-- source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/tokudb/r/kill_query_blocked_in_lt.result b/storage/tokudb/mysql-test/tokudb/r/kill_query_blocked_in_lt.result new file mode 100644 index 00000000000..27423a840e8 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/r/kill_query_blocked_in_lt.result @@ -0,0 +1,26 @@ +### connection default +CREATE TABLE t (a INT PRIMARY KEY, b INT) ENGINE=TokuDB; +INSERT INTO t (a, b) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), +(6, 6), (7, 7), (8, 8), (9, 9), (10, 10), +(11, 11), (12, 12), (13, 13), (14, 14), (15, 15), +(16, 16), (17, 17), (18, 18), (19, 19), (20, 20); +### connection con1 +SET DEBUG_SYNC= 'toku_range_lock_granted_immediately SIGNAL lock_granted WAIT_FOR lock_granted_continue'; +UPDATE t SET b=1 WHERE a BETWEEN 5 AND 10; +### connection default +SET DEBUG_SYNC= 'now WAIT_FOR lock_granted'; +### connection con2 +SET DEBUG_SYNC= 'toku_range_lock_before_wait SIGNAL lock_not_granted WAIT_FOR lock_not_granted_continue'; +SET DEBUG_SYNC= 'toku_range_lock_not_granted_after_wait SIGNAL lock_not_granted_after_wait'; +UPDATE t SET b=1 WHERE a BETWEEN 5 AND 10; +### connection default +SET DEBUG_SYNC= 'now SIGNAL lock_not_granted_continue WAIT_FOR lock_not_granted'; +KILL QUERY con2_id +SET DEBUG_SYNC= 'now SIGNAL lock_granted_continue WAIT_FOR lock_not_granted_after_wait'; +### connection con1 +### reap +### connection con2 +### reap +ERROR 70100: Query execution was interrupted +### connection default +DROP TABLE t; diff --git a/storage/tokudb/mysql-test/tokudb/r/locks-select-update-3.result b/storage/tokudb/mysql-test/tokudb/r/locks-select-update-3.result index e8c82b65967..af728338110 100644 --- a/storage/tokudb/mysql-test/tokudb/r/locks-select-update-3.result +++ b/storage/tokudb/mysql-test/tokudb/r/locks-select-update-3.result @@ -1,6 +1,4 @@ -SET DEFAULT_STORAGE_ENGINE='tokudb'; -drop table if exists t; -create table t (a int primary key, b int); +create table t (a int primary key, b int) engine=tokudb; insert into t values (1,0); set session transaction isolation level read committed; begin; @@ -9,7 +7,7 @@ a b 1 0 update t set b=b+1 where a=1; connect conn1,localhost,root; -set session tokudb_lock_timeout= 60000; +set session tokudb_lock_timeout=60000; set session transaction isolation level read committed; begin; select * from t where a=1 for update; diff --git a/storage/tokudb/mysql-test/tokudb/t/kill_query_blocked_in_lt.test b/storage/tokudb/mysql-test/tokudb/t/kill_query_blocked_in_lt.test new file mode 100644 index 00000000000..f1412f0cd40 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/t/kill_query_blocked_in_lt.test @@ -0,0 +1,57 @@ +--source include/have_tokudb.inc +--source include/have_debug_sync.inc + +--echo ### connection default + +skip MDEV-13442; +CREATE TABLE t (a INT PRIMARY KEY, b INT) ENGINE=TokuDB; + +INSERT INTO t (a, b) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), + (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), + (11, 11), (12, 12), (13, 13), (14, 14), (15, 15), + (16, 16), (17, 17), (18, 18), (19, 19), (20, 20); + +--connect(con1, localhost, root) +--connect(con2, localhost, root) + +--connection con1 +--echo ### connection con1 +SET DEBUG_SYNC= 'toku_range_lock_granted_immediately SIGNAL lock_granted WAIT_FOR lock_granted_continue'; +--send UPDATE t SET b=1 WHERE a BETWEEN 5 AND 10 + +--connection default +--echo ### connection default +SET DEBUG_SYNC= 'now WAIT_FOR lock_granted'; + +--connection con2 +--echo ### connection con2 +--let $con2_id= `SELECT CONNECTION_ID()` +SET DEBUG_SYNC= 'toku_range_lock_before_wait SIGNAL lock_not_granted WAIT_FOR lock_not_granted_continue'; +SET DEBUG_SYNC= 'toku_range_lock_not_granted_after_wait SIGNAL lock_not_granted_after_wait'; +--send UPDATE t SET b=1 WHERE a BETWEEN 5 AND 10 + +--connection default +--echo ### connection default +SET DEBUG_SYNC= 'now SIGNAL lock_not_granted_continue WAIT_FOR lock_not_granted'; + +--disable_query_log +--eval KILL QUERY $con2_id +--enable_query_log +--echo KILL QUERY con2_id +SET DEBUG_SYNC= 'now SIGNAL lock_granted_continue WAIT_FOR lock_not_granted_after_wait'; + +--connection con1 +--echo ### connection con1 +--echo ### reap +--reap + +--connection con2 +--echo ### connection con2 +--echo ### reap +--error ER_QUERY_INTERRUPTED +--reap + +--connection default +--echo ### connection default + +DROP TABLE t; diff --git a/storage/tokudb/mysql-test/tokudb/t/locks-select-update-3.test b/storage/tokudb/mysql-test/tokudb/t/locks-select-update-3.test index 5b54fa7313e..fcd89d5783f 100644 --- a/storage/tokudb/mysql-test/tokudb/t/locks-select-update-3.test +++ b/storage/tokudb/mysql-test/tokudb/t/locks-select-update-3.test @@ -1,12 +1,8 @@ source include/have_tokudb.inc; +source include/count_sessions.inc; # test that select for update is executed with serializable isolation -SET DEFAULT_STORAGE_ENGINE='tokudb'; - ---disable_warnings -drop table if exists t; ---enable_warnings -create table t (a int primary key, b int); +create table t (a int primary key, b int) engine=tokudb; insert into t values (1,0); set session transaction isolation level read committed; begin; @@ -15,7 +11,7 @@ select * from t where a=1 for update; # t2 update update t set b=b+1 where a=1; connect(conn1,localhost,root); -set session tokudb_lock_timeout= 60000; +set session tokudb_lock_timeout=60000; set session transaction isolation level read committed; begin; # t2 select for update, should hang until t1 commits @@ -34,3 +30,4 @@ connection default; disconnect conn1; drop table t; +source include/wait_until_count_sessions.inc; diff --git a/storage/tokudb/mysql-test/tokudb_backup/r/rpl_safe_slave.result b/storage/tokudb/mysql-test/tokudb_backup/r/rpl_safe_slave.result index 13b5915354f..3f742690bd8 100644 --- a/storage/tokudb/mysql-test/tokudb_backup/r/rpl_safe_slave.result +++ b/storage/tokudb/mysql-test/tokudb_backup/r/rpl_safe_slave.result @@ -53,8 +53,6 @@ Variable_name Value Slave_open_temp_tables 0 ### Continue backup SET DEBUG_SYNC = "now SIGNAL ttlss_continue"; -## Reset debug_sync points -SET DEBUG_SYNC = "RESET"; ### Wait for backup finish include/filter_file.inc ### Slave tokubackup_slave_info content: diff --git a/storage/tokudb/mysql-test/tokudb_backup/t/rpl_safe_slave.inc b/storage/tokudb/mysql-test/tokudb_backup/t/rpl_safe_slave.inc index e0732ee63fc..9b795008eff 100644 --- a/storage/tokudb/mysql-test/tokudb_backup/t/rpl_safe_slave.inc +++ b/storage/tokudb/mysql-test/tokudb_backup/t/rpl_safe_slave.inc @@ -59,9 +59,6 @@ SHOW STATUS LIKE 'Slave_open_temp_tables'; --echo ### Continue backup SET DEBUG_SYNC = "now SIGNAL ttlss_continue"; ---echo ## Reset debug_sync points -SET DEBUG_SYNC = "RESET"; - --connection slave_2 --echo ### Wait for backup finish --reap diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev12972.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev12972.result new file mode 100644 index 00000000000..92aefedac69 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev12972.result @@ -0,0 +1,19 @@ +CREATE TABLE t1 (pk INT PRIMARY KEY, i1 INT, c1 VARCHAR(1), KEY(c1)) ENGINE=TokuDB; +INSERT INTO t1 VALUES +(1,2,NULL),(2,5,'x'),(3,3,'i'),(4,1,'e'),(5,4,'p'); +CREATE TABLE t2 (i2 INT) ENGINE=TokuDB; +INSERT INTO t2 VALUES (1),(2); +CREATE TABLE t3 (i3 INT, c3 VARCHAR(1), KEY(i3)) ENGINE=TokuDB; +INSERT INTO t3 VALUES +(1,'e'),(1,'z'),(1,'i'),(1,'q'),(1,'i'),(1,'f'),(1,'m'),(2,'c'),(1,'d'), +(2,'n'),(1,'t'),(2,'e'),(1,'w'),(2,'y'),(1,'j'),(2,'i'),(1,'f'),(2,'f'), +(1,'s'),(2,'y'); +SET join_cache_level = 8; +SET optimizer_switch ='mrr=on,mrr_sort_keys=on,optimize_join_buffer_size=on'; +SELECT * FROM t1 AS t1_outer WHERE EXISTS ( SELECT * FROM t2 WHERE i2 IN ( SELECT i3 FROM t3 INNER JOIN t1 AS t1_inner ON (t1_inner.c1 = c3 ) WHERE t1_inner.i1 < t1_outer.i1 ) ); +pk i1 c1 +1 2 NULL +2 5 x +3 3 i +5 4 p +DROP TABLE t1, t2, t3; diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/t/mdev12972.test b/storage/tokudb/mysql-test/tokudb_mariadb/t/mdev12972.test new file mode 100644 index 00000000000..9d136ff0c65 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_mariadb/t/mdev12972.test @@ -0,0 +1,26 @@ +# +# MDEV-12972 Random and Frequent Segfault (SIG 11) During Runtime +# +# This was actually a memory overrun in MRR that TokuDB triggered +# + +CREATE TABLE t1 (pk INT PRIMARY KEY, i1 INT, c1 VARCHAR(1), KEY(c1)) ENGINE=TokuDB; +INSERT INTO t1 VALUES +(1,2,NULL),(2,5,'x'),(3,3,'i'),(4,1,'e'),(5,4,'p'); + +CREATE TABLE t2 (i2 INT) ENGINE=TokuDB; +INSERT INTO t2 VALUES (1),(2); + +CREATE TABLE t3 (i3 INT, c3 VARCHAR(1), KEY(i3)) ENGINE=TokuDB; +INSERT INTO t3 VALUES +(1,'e'),(1,'z'),(1,'i'),(1,'q'),(1,'i'),(1,'f'),(1,'m'),(2,'c'),(1,'d'), +(2,'n'),(1,'t'),(2,'e'),(1,'w'),(2,'y'),(1,'j'),(2,'i'),(1,'f'),(2,'f'), +(1,'s'),(2,'y'); + +SET join_cache_level = 8; +SET optimizer_switch ='mrr=on,mrr_sort_keys=on,optimize_join_buffer_size=on'; + +--sorted_result +SELECT * FROM t1 AS t1_outer WHERE EXISTS ( SELECT * FROM t2 WHERE i2 IN ( SELECT i3 FROM t3 INNER JOIN t1 AS t1_inner ON (t1_inner.c1 = c3 ) WHERE t1_inner.i1 < t1_outer.i1 ) ); + +DROP TABLE t1, t2, t3; diff --git a/storage/tokudb/tokudb_information_schema.cc b/storage/tokudb/tokudb_information_schema.cc index 2b4128cc03a..5cd0609ac74 100644 --- a/storage/tokudb/tokudb_information_schema.cc +++ b/storage/tokudb/tokudb_information_schema.cc @@ -76,8 +76,7 @@ int trx_callback( uint64_t txn_id = txn->id64(txn); uint64_t client_id; - void *client_extra; - txn->get_client_id(txn, &client_id, &client_extra); + txn->get_client_id(txn, &client_id, NULL); uint64_t start_time = txn->get_start_time(txn); trx_extra_t* e = reinterpret_cast<struct trx_extra_t*>(extra); THD* thd = e->thd; @@ -317,8 +316,7 @@ int locks_callback( uint64_t txn_id = txn->id64(txn); uint64_t client_id; - void *client_extra; - txn->get_client_id(txn, &client_id, &client_extra); + txn->get_client_id(txn, &client_id, NULL); locks_extra_t* e = reinterpret_cast<struct locks_extra_t*>(extra); THD* thd = e->thd; TABLE* table = e->table; diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt index 4f9d2bd2cbb..a717249cf5a 100644 --- a/storage/xtradb/CMakeLists.txt +++ b/storage/xtradb/CMakeLists.txt @@ -100,9 +100,9 @@ ENDIF() IF(NOT MSVC) # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not - # workaround for gcc 4.1.2 RHEL5/x86, gcc atomic ops only work under -march=i686 + # workaround for old gcc on x86, gcc atomic ops only work under -march=i686 IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND - CMAKE_C_COMPILER_VERSION VERSION_LESS "4.1.3") + CMAKE_C_COMPILER_VERSION VERSION_LESS "4.4.0") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686") ENDIF() diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc index ffd7ebc7504..1f40f971be3 100644 --- a/storage/xtradb/btr/btr0cur.cc +++ b/storage/xtradb/btr/btr0cur.cc @@ -2466,6 +2466,15 @@ any_extern: rec = page_cur_get_rec(page_cursor); } + /* We limit max record size to 16k even for 64k page size. */ + if (new_rec_size >= COMPRESSED_REC_MAX_DATA_SIZE || + (!dict_table_is_comp(index->table) + && new_rec_size >= REDUNDANT_REC_MAX_DATA_SIZE)) { + err = DB_OVERFLOW; + + goto func_exit; + } + if (UNIV_UNLIKELY(new_rec_size >= (page_get_free_space_of_empty(page_is_comp(page)) / 2))) { diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc index 84eea3bc692..db7e2172e93 100644 --- a/storage/xtradb/buf/buf0flu.cc +++ b/storage/xtradb/buf/buf0flu.cc @@ -2861,7 +2861,10 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)( when SRV_SHUTDOWN_CLEANUP is set other threads like the master and the purge threads may be working as well. We start flushing the buffer pool but can't be sure that no new pages are being - dirtied until we enter SRV_SHUTDOWN_FLUSH_PHASE phase. */ + dirtied until we enter SRV_SHUTDOWN_FLUSH_PHASE phase. Because + the LRU manager thread is also flushing at SRV_SHUTDOWN_CLEANUP + but not SRV_SHUTDOWN_FLUSH_PHASE, we only leave the + SRV_SHUTDOWN_CLEANUP loop when the LRU manager quits. */ do { n_flushed = page_cleaner_do_flush_batch(PCT_IO(100), LSN_MAX); @@ -2870,7 +2873,10 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)( if (n_flushed == 0) { os_thread_sleep(100000); } - } while (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP); + + os_rmb; + } while (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP + || buf_lru_manager_is_active); /* At this point all threads including the master and the purge thread must have been suspended. */ @@ -2887,6 +2893,11 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)( buf_flush_wait_batch_end(NULL, BUF_FLUSH_LIST); buf_flush_wait_LRU_batch_end(); +#ifdef UNIV_DEBUG + os_rmb; + ut_ad(!buf_lru_manager_is_active); +#endif + bool success; do { @@ -2965,6 +2976,7 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)( } buf_lru_manager_is_active = false; + os_wmb; /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc index a1cfeb3860f..7550943de7a 100644 --- a/storage/xtradb/dict/dict0dict.cc +++ b/storage/xtradb/dict/dict0dict.cc @@ -1395,9 +1395,6 @@ dict_table_add_to_cache( dict_table_autoinc_restore(table); ut_ad(dict_lru_validate()); - - dict_sys->size += mem_heap_get_size(table->heap) - + strlen(table->name) + 1; } /**********************************************************************//** @@ -1812,9 +1809,6 @@ dict_table_rename_in_cache( HASH_INSERT(dict_table_t, name_hash, dict_sys->table_hash, fold, table); - dict_sys->size += strlen(new_name) - strlen(old_name); - ut_a(dict_sys->size > 0); - /* Update the table_name field in indexes */ for (index = dict_table_get_first_index(table); index != NULL; @@ -2101,7 +2095,6 @@ dict_table_remove_from_cache_low( { dict_foreign_t* foreign; dict_index_t* index; - ulint size; ut_ad(table); ut_ad(dict_lru_validate()); @@ -2181,12 +2174,6 @@ dict_table_remove_from_cache_low( trx_free_for_background(trx); } - size = mem_heap_get_size(table->heap) + strlen(table->name) + 1; - - ut_ad(dict_sys->size >= size); - - dict_sys->size -= size; - dict_mem_table_free(table); } @@ -2430,9 +2417,13 @@ dict_index_too_big_for_tree( rec_max_size = 2; } else { /* The maximum allowed record size is half a B-tree - page. No additional sparse page directory entry will - be generated for the first few user records. */ - page_rec_max = page_get_free_space_of_empty(comp) / 2; + page(16k for 64k page size). No additional sparse + page directory entry will be generated for the first + few user records. */ + page_rec_max = (comp || UNIV_PAGE_SIZE < UNIV_PAGE_SIZE_MAX) + ? page_get_free_space_of_empty(comp) / 2 + : REDUNDANT_REC_MAX_DATA_SIZE; + page_ptr_max = page_rec_max; /* Each record has a header. */ rec_max_size = comp @@ -2516,7 +2507,6 @@ add_field_size: /* Check the size limit on leaf pages. */ if (UNIV_UNLIKELY(rec_max_size >= page_rec_max)) { - return(TRUE); } @@ -2729,8 +2719,6 @@ undo_size_ok: dict_index_is_ibuf(index) ? SYNC_IBUF_INDEX_TREE : SYNC_INDEX_TREE); - dict_sys->size += mem_heap_get_size(new_index->heap); - dict_mem_index_free(index); return(DB_SUCCESS); @@ -2747,7 +2735,6 @@ dict_index_remove_from_cache_low( ibool lru_evict) /*!< in: TRUE if index being evicted to make room in the table LRU list */ { - ulint size; ulint retries = 0; btr_search_t* info; @@ -2816,12 +2803,6 @@ dict_index_remove_from_cache_low( /* Remove the index from the list of indexes of the table */ UT_LIST_REMOVE(indexes, table->indexes, index); - size = mem_heap_get_size(index->heap); - - ut_ad(dict_sys->size >= size); - - dict_sys->size -= size; - dict_mem_index_free(index); } @@ -7323,3 +7304,38 @@ dict_tf_to_row_format_string( return(0); } #endif /* !UNIV_HOTBACKUP */ + +/** Calculate the used memory occupied by the data dictionary +table and index objects. +@return number of bytes occupied. */ +UNIV_INTERN +ulint +dict_sys_get_size() +{ + ulint size = 0; + + ut_ad(dict_sys); + + mutex_enter(&dict_sys->mutex); + + for(ulint i = 0; i < hash_get_n_cells(dict_sys->table_hash); i++) { + dict_table_t* table; + + for (table = static_cast<dict_table_t*>(HASH_GET_FIRST(dict_sys->table_hash,i)); + table != NULL; + table = static_cast<dict_table_t*>(HASH_GET_NEXT(name_hash, table))) { + dict_index_t* index; + size += mem_heap_get_size(table->heap) + strlen(table->name) +1; + + for(index = dict_table_get_first_index(table); + index != NULL; + index = dict_table_get_next_index(index)) { + size += mem_heap_get_size(index->heap); + } + } + } + + mutex_exit(&dict_sys->mutex); + + return (size); +} diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc index e73d600d2ca..fa4d105e7dc 100644 --- a/storage/xtradb/fil/fil0crypt.cc +++ b/storage/xtradb/fil/fil0crypt.cc @@ -25,13 +25,18 @@ Modified Jan Lindström jan.lindstrom@mariadb.com #include "fil0fil.h" #include "fil0crypt.h" +#include "mach0data.h" +#include "page0zip.h" +#include "buf0buf.h" +#include "buf0checksum.h" + +#ifndef UNIV_INNOCHECKSUM + #include "srv0srv.h" #include "srv0start.h" -#include "mach0data.h" #include "log0recv.h" #include "mtr0mtr.h" #include "mtr0log.h" -#include "page0zip.h" #include "ut0ut.h" #include "btr0scrub.h" #include "fsp0fsp.h" @@ -107,13 +112,20 @@ UNIV_INTERN mysql_pfs_key_t fil_crypt_data_mutex_key; extern my_bool srv_background_scrub_data_uncompressed; extern my_bool srv_background_scrub_data_compressed; +/*********************************************************************** +Check if a key needs rotation given a key_state +@param[in] encrypt_mode Encryption mode +@param[in] key_version Current key version +@param[in] latest_key_version Latest key version +@param[in] rotate_key_age when to rotate +@return true if key needs rotation, false if not */ static bool fil_crypt_needs_rotation( - fil_encryption_t encrypt_mode, /*!< in: Encryption - mode */ - uint key_version, /*!< in: Key version */ - uint latest_key_version, /*!< in: Latest key version */ - uint rotate_key_age); /*!< in: When to rotate */ + fil_encryption_t encrypt_mode, + uint key_version, + uint latest_key_version, + uint rotate_key_age) + MY_ATTRIBUTE((warn_unused_result)); /********************************************************************* Init space crypt */ @@ -908,137 +920,6 @@ fil_crypt_calculate_checksum( return checksum; } -/********************************************************************* -Verify that post encryption checksum match calculated checksum. -This function should be called only if tablespace contains crypt_data -metadata (this is strong indication that tablespace is encrypted). -Function also verifies that traditional checksum does not match -calculated checksum as if it does page could be valid unencrypted, -encrypted, or corrupted. - -@param[in] page Page to verify -@param[in] zip_size zip size -@param[in] space Tablespace -@param[in] pageno Page no -@return true if page is encrypted AND OK, false otherwise */ -UNIV_INTERN -bool -fil_space_verify_crypt_checksum( - byte* page, - ulint zip_size, - const fil_space_t* space, - ulint pageno) -{ - uint key_version = mach_read_from_4(page+ FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION); - - /* If page is not encrypted, return false */ - if (key_version == 0) { - return(false); - } - - /* Read stored post encryption checksum. */ - ib_uint32_t checksum = mach_read_from_4( - page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + 4); - - /* Declare empty pages non-corrupted */ - if (checksum == 0 - && *reinterpret_cast<const ib_uint64_t*>(page + FIL_PAGE_LSN) == 0 - && buf_page_is_zeroes(page, zip_size)) { - return(true); - } - - /* Compressed and encrypted pages do not have checksum. Assume not - corrupted. Page verification happens after decompression in - buf_page_io_complete() using buf_page_is_corrupted(). */ - if (mach_read_from_2(page+FIL_PAGE_TYPE) == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED) { - return (true); - } - - ib_uint32_t cchecksum1 = 0; - ib_uint32_t cchecksum2 = 0; - - /* Calculate checksums */ - if (zip_size) { - cchecksum1 = page_zip_calc_checksum( - page, zip_size, SRV_CHECKSUM_ALGORITHM_CRC32); - - if(cchecksum1 != checksum) { - cchecksum2 = page_zip_calc_checksum( - page, zip_size, - SRV_CHECKSUM_ALGORITHM_INNODB); - } - } else { - cchecksum1 = buf_calc_page_crc32(page); - - if (cchecksum1 != checksum) { - cchecksum2 = (ib_uint32_t) buf_calc_page_new_checksum( - page); - } - } - - /* If stored checksum matches one of the calculated checksums - page is not corrupted. */ - - bool encrypted = (checksum == cchecksum1 || checksum == cchecksum2 - || checksum == BUF_NO_CHECKSUM_MAGIC); - - /* MySQL 5.6 and MariaDB 10.0 and 10.1 will write an LSN to the - first page of each system tablespace file at - FIL_PAGE_FILE_FLUSH_LSN offset. On other pages and in other files, - the field might have been uninitialized until MySQL 5.5. In MySQL 5.7 - (and MariaDB Server 10.2.2) WL#7990 stopped writing the field for other - than page 0 of the system tablespace. - - Starting from MariaDB 10.1 the field has been repurposed for - encryption key_version. - - Starting with MySQL 5.7 (and MariaDB Server 10.2), the - field has been repurposed for SPATIAL INDEX pages for - FIL_RTREE_SPLIT_SEQ_NUM. - - Note that FIL_PAGE_FILE_FLUSH_LSN is not included in the InnoDB page - checksum. - - Thus, FIL_PAGE_FILE_FLUSH_LSN could contain any value. While the - field would usually be 0 for pages that are not encrypted, we cannot - assume that a nonzero value means that the page is encrypted. - Therefore we must validate the page both as encrypted and unencrypted - when FIL_PAGE_FILE_FLUSH_LSN does not contain 0. - */ - - ulint checksum1 = mach_read_from_4( - page + FIL_PAGE_SPACE_OR_CHKSUM); - - ulint checksum2 = checksum1; - - bool valid; - - if (zip_size) { - valid = (checksum1 == cchecksum1); - } else { - checksum1 = mach_read_from_4( - page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM); - valid = (buf_page_is_checksum_valid_crc32(page,checksum1,checksum2) - || buf_page_is_checksum_valid_innodb(page,checksum1, checksum2)); - } - - if (encrypted && valid) { - /* If page is encrypted and traditional checksums match, - page could be still encrypted, or not encrypted and valid or - corrupted. */ - ib_logf(IB_LOG_LEVEL_ERROR, - " Page %lu in space %s (%lu) maybe corrupted." - " Post encryption checksum %u stored [%lu:%lu] key_version %u", - pageno, - space ? space->name : "N/A", - mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID), - checksum, checksum1, checksum2, key_version); - encrypted = false; - } - - return(encrypted); -} - /***********************************************************************/ /** A copy of global key state */ @@ -2660,3 +2541,159 @@ fil_space_get_scrub_status( mutex_exit(&crypt_data->mutex); } } + +#endif /* !UNIV_INNOCHECKSUM */ + +/********************************************************************* +Verify that post encryption checksum match calculated checksum. +This function should be called only if tablespace contains crypt_data +metadata (this is strong indication that tablespace is encrypted). +Function also verifies that traditional checksum does not match +calculated checksum as if it does page could be valid unencrypted, +encrypted, or corrupted. + +@param[in] page Page to verify +@param[in] zip_size zip size +@param[in] space Tablespace +@param[in] pageno Page no +@return true if page is encrypted AND OK, false otherwise */ +UNIV_INTERN +bool +fil_space_verify_crypt_checksum( + byte* page, + ulint zip_size, +#ifndef UNIV_INNOCHECKSUM + const fil_space_t* space, +#else + const void* space, +#endif + ulint pageno) +{ + uint key_version = mach_read_from_4(page+ FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION); + + /* If page is not encrypted, return false */ + if (key_version == 0) { + return(false); + } + + srv_checksum_algorithm_t algorithm = + static_cast<srv_checksum_algorithm_t>(srv_checksum_algorithm); + + /* If no checksum is used, can't continue checking. */ + if (algorithm == SRV_CHECKSUM_ALGORITHM_NONE) { + return(true); + } + + /* Read stored post encryption checksum. */ + ib_uint32_t checksum = mach_read_from_4( + page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + 4); + + /* Declare empty pages non-corrupted */ + if (checksum == 0 + && *reinterpret_cast<const ib_uint64_t*>(page + FIL_PAGE_LSN) == 0 + && buf_page_is_zeroes(page, zip_size)) { + return(true); + } + + /* Compressed and encrypted pages do not have checksum. Assume not + corrupted. Page verification happens after decompression in + buf_page_io_complete() using buf_page_is_corrupted(). */ + if (mach_read_from_2(page+FIL_PAGE_TYPE) == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED) { + return (true); + } + + ib_uint32_t cchecksum1 = 0; + ib_uint32_t cchecksum2 = 0; + + /* Calculate checksums */ + if (zip_size) { + cchecksum1 = page_zip_calc_checksum( + page, zip_size, SRV_CHECKSUM_ALGORITHM_CRC32); + + cchecksum2 = (cchecksum1 == checksum) + ? 0 + : page_zip_calc_checksum( + page, zip_size, + SRV_CHECKSUM_ALGORITHM_INNODB); + } else { + cchecksum1 = buf_calc_page_crc32(page); + cchecksum2 = (cchecksum1 == checksum) + ? 0 + : buf_calc_page_new_checksum(page); + } + + /* If stored checksum matches one of the calculated checksums + page is not corrupted. */ + + bool encrypted = (checksum == cchecksum1 || checksum == cchecksum2 + || checksum == BUF_NO_CHECKSUM_MAGIC); + + /* MySQL 5.6 and MariaDB 10.0 and 10.1 will write an LSN to the + first page of each system tablespace file at + FIL_PAGE_FILE_FLUSH_LSN offset. On other pages and in other files, + the field might have been uninitialized until MySQL 5.5. In MySQL 5.7 + (and MariaDB Server 10.2.2) WL#7990 stopped writing the field for other + than page 0 of the system tablespace. + + Starting from MariaDB 10.1 the field has been repurposed for + encryption key_version. + + Starting with MySQL 5.7 (and MariaDB Server 10.2), the + field has been repurposed for SPATIAL INDEX pages for + FIL_RTREE_SPLIT_SEQ_NUM. + + Note that FIL_PAGE_FILE_FLUSH_LSN is not included in the InnoDB page + checksum. + + Thus, FIL_PAGE_FILE_FLUSH_LSN could contain any value. While the + field would usually be 0 for pages that are not encrypted, we cannot + assume that a nonzero value means that the page is encrypted. + Therefore we must validate the page both as encrypted and unencrypted + when FIL_PAGE_FILE_FLUSH_LSN does not contain 0. + */ + + uint32_t checksum1 = mach_read_from_4(page + FIL_PAGE_SPACE_OR_CHKSUM); + uint32_t checksum2; + + bool valid; + + if (zip_size) { + valid = (checksum1 == cchecksum1); + checksum2 = checksum1; + } else { + checksum2 = mach_read_from_4( + page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM); + valid = (buf_page_is_checksum_valid_crc32(page,checksum1,checksum2) + || buf_page_is_checksum_valid_innodb(page,checksum1, checksum2)); + } + + if (encrypted && valid) { + /* If page is encrypted and traditional checksums match, + page could be still encrypted, or not encrypted and valid or + corrupted. */ +#ifndef UNIV_INNOCHECKSUM + ib_logf(IB_LOG_LEVEL_ERROR, + " Page " ULINTPF " in space %s (" ULINTPF ") maybe corrupted." + " Post encryption checksum %u stored [%u:%u] key_version %u", + pageno, + space ? space->name : "N/A", + mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID), + checksum, checksum1, checksum2, key_version); +#else + if (log_file) { + fprintf(log_file, + "Page " ULINTPF ":" ULINTPF " may be corrupted." + " Post encryption checksum %u" + " stored [%u:%u] key_version %u\n", + pageno, + mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID), + checksum, checksum1, checksum2, + key_version); + } +#endif /* UNIV_INNOCHECKSUM */ + + encrypted = false; + } + + return(encrypted); +} diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index b797c0a2114..0e46f406753 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -2271,18 +2271,33 @@ convert_error_code_to_mysql( case DB_TOO_BIG_RECORD: { /* If prefix is true then a 768-byte prefix is stored - locally for BLOB fields. Refer to dict_table_get_format() */ + locally for BLOB fields. Refer to dict_table_get_format(). + Note that in page0zip.ic page_zip_rec_needs_ext() rec_size + is limited to COMPRESSED_REC_MAX_DATA_SIZE (16K) or + REDUNDANT_REC_MAX_DATA_SIZE (16K-1). */ bool prefix = (dict_tf_get_format(flags) == UNIV_FORMAT_A); + bool comp = !!(flags & DICT_TF_COMPACT); + ulint free_space = page_get_free_space_of_empty(comp) / 2; + + if (free_space >= (comp ? COMPRESSED_REC_MAX_DATA_SIZE : + REDUNDANT_REC_MAX_DATA_SIZE)) { + free_space = (comp ? COMPRESSED_REC_MAX_DATA_SIZE : + REDUNDANT_REC_MAX_DATA_SIZE) - 1; + } + my_printf_error(ER_TOO_BIG_ROWSIZE, "Row size too large (> %lu). Changing some columns " "to TEXT or BLOB %smay help. In current row " "format, BLOB prefix of %d bytes is stored inline.", MYF(0), - page_get_free_space_of_empty(flags & - DICT_TF_COMPACT) / 2, - prefix ? "or using ROW_FORMAT=DYNAMIC " - "or ROW_FORMAT=COMPRESSED ": "", - prefix ? DICT_MAX_FIXED_COL_LEN : 0); + free_space, + prefix + ? "or using ROW_FORMAT=DYNAMIC or" + " ROW_FORMAT=COMPRESSED " + : "", + prefix + ? DICT_MAX_FIXED_COL_LEN + : 0); return(HA_ERR_TO_BIG_ROW); } diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc index 957e23d608a..32ad4844c34 100644 --- a/storage/xtradb/handler/handler0alter.cc +++ b/storage/xtradb/handler/handler0alter.cc @@ -157,11 +157,22 @@ my_error_innodb( case DB_CORRUPTION: my_error(ER_NOT_KEYFILE, MYF(0), table); break; - case DB_TOO_BIG_RECORD: - my_error(ER_TOO_BIG_ROWSIZE, MYF(0), - page_get_free_space_of_empty( - flags & DICT_TF_COMPACT) / 2); + case DB_TOO_BIG_RECORD: { + /* Note that in page0zip.ic page_zip_rec_needs_ext() rec_size + is limited to COMPRESSED_REC_MAX_DATA_SIZE (16K) or + REDUNDANT_REC_MAX_DATA_SIZE (16K-1). */ + bool comp = !!(flags & DICT_TF_COMPACT); + ulint free_space = page_get_free_space_of_empty(comp) / 2; + + if (free_space >= (comp ? COMPRESSED_REC_MAX_DATA_SIZE : + REDUNDANT_REC_MAX_DATA_SIZE)) { + free_space = (comp ? COMPRESSED_REC_MAX_DATA_SIZE : + REDUNDANT_REC_MAX_DATA_SIZE) - 1; + } + + my_error(ER_TOO_BIG_ROWSIZE, MYF(0), free_space); break; + } case DB_INVALID_NULL: /* TODO: report the row, as we do for DB_DUPLICATE_KEY */ my_error(ER_INVALID_USE_OF_NULL, MYF(0)); diff --git a/storage/xtradb/handler/xtradb_i_s.cc b/storage/xtradb/handler/xtradb_i_s.cc index eaf7da733bf..b3c79975fb3 100644 --- a/storage/xtradb/handler/xtradb_i_s.cc +++ b/storage/xtradb/handler/xtradb_i_s.cc @@ -314,19 +314,20 @@ static int xtradb_internal_hash_tables_fill_table(THD* thd, TABLE_LIST* tables, if (dict_sys) { + ulint dict_size = dict_sys_get_size(); OK(field_store_string(fields[INT_HASH_TABLES_NAME], "Dictionary Cache")); OK(field_store_ulint(fields[INT_HASH_TABLES_TOTAL], ((dict_sys->table_hash->n_cells + dict_sys->table_id_hash->n_cells ) * sizeof(hash_cell_t) - + dict_sys->size))); + + dict_size))); OK(field_store_ulint(fields[INT_HASH_TABLES_CONSTANT], ((dict_sys->table_hash->n_cells + dict_sys->table_id_hash->n_cells ) * sizeof(hash_cell_t)))); OK(field_store_ulint(fields[INT_HASH_TABLES_VARIABLE], - dict_sys->size)); + dict_size)); OK(schema_table_store_record(thd, table)); } diff --git a/storage/xtradb/include/dict0dict.h b/storage/xtradb/include/dict0dict.h index 0290b884ece..a43b04d9d1e 100644 --- a/storage/xtradb/include/dict0dict.h +++ b/storage/xtradb/include/dict0dict.h @@ -1653,9 +1653,6 @@ struct dict_sys_t{ on name */ hash_table_t* table_id_hash; /*!< hash table of the tables, based on id */ - ulint size; /*!< varying space in bytes occupied - by the data dictionary table and - index objects */ dict_table_t* sys_tables; /*!< SYS_TABLES table */ dict_table_t* sys_columns; /*!< SYS_COLUMNS table */ dict_table_t* sys_indexes; /*!< SYS_INDEXES table */ @@ -1898,6 +1895,13 @@ dict_table_get_index_on_first_col( ulint col_index); /*!< in: position of column in table */ +/** Calculate the used memory occupied by the data dictionary +table and index objects. +@return number of bytes occupied. */ +UNIV_INTERN +ulint +dict_sys_get_size(); + #endif /* !UNIV_HOTBACKUP */ #ifndef UNIV_NONINL diff --git a/storage/xtradb/include/page0zip.ic b/storage/xtradb/include/page0zip.ic index 9a583086925..bee35a48cc2 100644 --- a/storage/xtradb/include/page0zip.ic +++ b/storage/xtradb/include/page0zip.ic @@ -178,8 +178,9 @@ page_zip_rec_needs_ext( ut_ad(ut_is_2pow(zip_size)); ut_ad(comp || !zip_size); -#if UNIV_PAGE_SIZE_MAX > REC_MAX_DATA_SIZE - if (rec_size >= REC_MAX_DATA_SIZE) { +#if UNIV_PAGE_SIZE_MAX > COMPRESSED_REC_MAX_DATA_SIZE + if (comp ? rec_size >= COMPRESSED_REC_MAX_DATA_SIZE : + rec_size >= REDUNDANT_REC_MAX_DATA_SIZE) { return(TRUE); } #endif diff --git a/storage/xtradb/include/rem0rec.h b/storage/xtradb/include/rem0rec.h index 9baf0ab380a..afc191e632d 100644 --- a/storage/xtradb/include/rem0rec.h +++ b/storage/xtradb/include/rem0rec.h @@ -976,9 +976,15 @@ are given in one byte (resp. two byte) format. */ #define REC_1BYTE_OFFS_LIMIT 0x7FUL #define REC_2BYTE_OFFS_LIMIT 0x7FFFUL -/* The data size of record must be smaller than this because we reserve -two upmost bits in a two byte offset for special purposes */ -#define REC_MAX_DATA_SIZE (16384) +/* The data size of record must not be larger than this on +REDUNDANT row format because we reserve two upmost bits in a +two byte offset for special purposes */ +#define REDUNDANT_REC_MAX_DATA_SIZE (16383) + +/* The data size of record must be smaller than this on +COMPRESSED row format because we reserve two upmost bits in a +two byte offset for special purposes */ +#define COMPRESSED_REC_MAX_DATA_SIZE (16384) #ifdef WITH_WSREP int wsrep_rec_get_foreign_key( diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 23c8c0a659d..739f6640eef 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -48,7 +48,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX 36 #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 82.0 +#define PERCONA_INNODB_VERSION 82.1 #endif /* Enable UNIV_LOG_ARCHIVE in XtraDB */ diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc index 833f3240369..31a2cad05eb 100644 --- a/storage/xtradb/log/log0log.cc +++ b/storage/xtradb/log/log0log.cc @@ -3635,6 +3635,7 @@ wait_suspend_loop: before proceeding further. */ count = 0; + os_rmb; while (buf_page_cleaner_is_active || buf_lru_manager_is_active) { if (srv_print_verbose_log && count == 0) { ib_logf(IB_LOG_LEVEL_INFO, @@ -3646,6 +3647,7 @@ wait_suspend_loop: if (count > 600) { count = 0; } + os_rmb; } if (log_scrub_thread_active) { diff --git a/storage/xtradb/mysql-test/storage_engine/type_spatial_indexes.rdiff b/storage/xtradb/mysql-test/storage_engine/type_spatial_indexes.rdiff index 154116b748c..e312cf8f65c 100644 --- a/storage/xtradb/mysql-test/storage_engine/type_spatial_indexes.rdiff +++ b/storage/xtradb/mysql-test/storage_engine/type_spatial_indexes.rdiff @@ -352,8 +352,8 @@ -116 0 -SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; -fid AsText(Centroid(g)) --117 POINT(55.58852775304245 17.426536064113982) --118 POINT(55.58852775304245 17.426536064113982) +-117 POINT(57.98031067576927 17.854754130800433) +-118 POINT(57.98031067576927 17.854754130800433) -119 POINT(2 2) -SELECT fid, Area(g) FROM gis_multi_polygon; -fid Area(g) diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc index cc5d1320142..80e8304ea10 100644 --- a/storage/xtradb/srv/srv0srv.cc +++ b/storage/xtradb/srv/srv0srv.cc @@ -1600,6 +1600,8 @@ srv_printf_innodb_monitor( recv_sys_subtotal = ((recv_sys && recv_sys->addr_hash) ? mem_heap_get_size(recv_sys->heap) : 0); + ulint dict_size = dict_sys ? dict_sys_get_size() : 0; + fprintf(file, "Internal hash tables (constant factor + variable factor)\n" " Adaptive hash index %lu \t(%lu + " ULINTPF ")\n" @@ -1618,11 +1620,11 @@ srv_printf_innodb_monitor( (ulong) (dict_sys ? ((dict_sys->table_hash->n_cells + dict_sys->table_id_hash->n_cells ) * sizeof(hash_cell_t) - + dict_sys->size) : 0), + + dict_size) : 0), (ulong) (dict_sys ? ((dict_sys->table_hash->n_cells + dict_sys->table_id_hash->n_cells ) * sizeof(hash_cell_t)) : 0), - dict_sys ? (dict_sys->size) : 0, + dict_size, (ulong) (fil_system_hash_cells() * sizeof(hash_cell_t) + fil_system_hash_nodes()), @@ -1643,7 +1645,7 @@ srv_printf_innodb_monitor( fprintf(file, "Dictionary memory allocated " ULINTPF "\n", - dict_sys ? dict_sys->size : 0); + dict_sys ? dict_sys_get_size() : 0); buf_print_io(file); @@ -1805,7 +1807,7 @@ srv_export_innodb_status(void) mem_dictionary = (dict_sys ? ((dict_sys->table_hash->n_cells + dict_sys->table_id_hash->n_cells ) * sizeof(hash_cell_t) - + dict_sys->size) : 0); + + dict_sys_get_size()) : 0); mutex_enter(&srv_innodb_monitor_mutex); |